@record-evolution/widget-image 1.1.15 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -12
- package/dist/widget-image.js +302 -277
- package/dist/widget-image.js.map +1 -1
- package/package.json +5 -1
- package/src/definition-schema.d.ts +34 -9
- package/src/definition-schema.json +32 -15
- package/src/widget-image.ts +50 -19
package/dist/widget-image.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const z = globalThis,
|
|
1
|
+
const z = globalThis, F = z.ShadowRoot && (z.ShadyCSS === void 0 || z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, G = /* @__PURE__ */ Symbol(), Y = /* @__PURE__ */ new WeakMap();
|
|
2
2
|
let pt = class {
|
|
3
|
-
constructor(t, e,
|
|
4
|
-
if (this._$cssResult$ = !0,
|
|
3
|
+
constructor(t, e, s) {
|
|
4
|
+
if (this._$cssResult$ = !0, s !== G) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let t = this.o;
|
|
9
9
|
const e = this.t;
|
|
10
|
-
if (
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
if (F && t === void 0) {
|
|
11
|
+
const s = e !== void 0 && e.length === 1;
|
|
12
|
+
s && (t = Y.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Y.set(e, t));
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
@@ -17,23 +17,23 @@ let pt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e = r.length === 1 ? r[0] : t.reduce(((
|
|
20
|
+
const mt = (r) => new pt(typeof r == "string" ? r : r + "", void 0, G), gt = (r, ...t) => {
|
|
21
|
+
const e = r.length === 1 ? r[0] : t.reduce(((s, i, n) => s + ((o) => {
|
|
22
22
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
23
23
|
if (typeof o == "number") return o;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
-
})(
|
|
25
|
+
})(i) + r[n + 1]), r[0]);
|
|
26
26
|
return new pt(e, r, G);
|
|
27
27
|
}, _t = (r, t) => {
|
|
28
|
-
if (
|
|
28
|
+
if (F) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
29
29
|
else for (const e of t) {
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const s = document.createElement("style"), i = z.litNonce;
|
|
31
|
+
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
}, tt =
|
|
33
|
+
}, tt = F ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
|
-
for (const
|
|
36
|
-
return
|
|
35
|
+
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
+
return mt(e);
|
|
37
37
|
})(r) : r;
|
|
38
38
|
const { is: yt, defineProperty: At, getOwnPropertyDescriptor: vt, getOwnPropertyNames: bt, getOwnPropertySymbols: wt, getPrototypeOf: xt } = Object, k = globalThis, et = k.trustedTypes, St = et ? et.emptyScript : "", Et = k.reactiveElementPolyfillSupport, T = (r, t) => r, j = { toAttribute(r, t) {
|
|
39
39
|
switch (t) {
|
|
@@ -74,19 +74,19 @@ let S = class extends HTMLElement {
|
|
|
74
74
|
}
|
|
75
75
|
static createProperty(t, e = it) {
|
|
76
76
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
|
-
const
|
|
78
|
-
|
|
77
|
+
const s = /* @__PURE__ */ Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
78
|
+
i !== void 0 && At(this.prototype, t, i);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
static getPropertyDescriptor(t, e,
|
|
82
|
-
const { get:
|
|
81
|
+
static getPropertyDescriptor(t, e, s) {
|
|
82
|
+
const { get: i, set: n } = vt(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(o) {
|
|
85
85
|
this[e] = o;
|
|
86
86
|
} };
|
|
87
|
-
return { get:
|
|
88
|
-
const
|
|
89
|
-
n?.call(this, o), this.requestUpdate(t,
|
|
87
|
+
return { get: i, set(o) {
|
|
88
|
+
const a = i?.call(this);
|
|
89
|
+
n?.call(this, o), this.requestUpdate(t, a, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
@@ -100,32 +100,32 @@ let S = class extends HTMLElement {
|
|
|
100
100
|
static finalize() {
|
|
101
101
|
if (this.hasOwnProperty(T("finalized"))) return;
|
|
102
102
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) {
|
|
103
|
-
const e = this.properties,
|
|
104
|
-
for (const
|
|
103
|
+
const e = this.properties, s = [...bt(e), ...wt(e)];
|
|
104
|
+
for (const i of s) this.createProperty(i, e[i]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
107
107
|
if (t !== null) {
|
|
108
108
|
const e = litPropertyMetadata.get(t);
|
|
109
|
-
if (e !== void 0) for (const [
|
|
109
|
+
if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
|
|
110
110
|
}
|
|
111
111
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
|
-
for (const [e,
|
|
113
|
-
const
|
|
114
|
-
|
|
112
|
+
for (const [e, s] of this.elementProperties) {
|
|
113
|
+
const i = this._$Eu(e, s);
|
|
114
|
+
i !== void 0 && this._$Eh.set(i, e);
|
|
115
115
|
}
|
|
116
116
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
117
|
}
|
|
118
118
|
static finalizeStyles(t) {
|
|
119
119
|
const e = [];
|
|
120
120
|
if (Array.isArray(t)) {
|
|
121
|
-
const
|
|
122
|
-
for (const
|
|
121
|
+
const s = new Set(t.flat(1 / 0).reverse());
|
|
122
|
+
for (const i of s) e.unshift(tt(i));
|
|
123
123
|
} else t !== void 0 && e.push(tt(t));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
126
126
|
static _$Eu(t, e) {
|
|
127
|
-
const
|
|
128
|
-
return
|
|
127
|
+
const s = e.attribute;
|
|
128
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
129
129
|
}
|
|
130
130
|
constructor() {
|
|
131
131
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
@@ -141,7 +141,7 @@ let S = class extends HTMLElement {
|
|
|
141
141
|
}
|
|
142
142
|
_$E_() {
|
|
143
143
|
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
144
|
-
for (const
|
|
144
|
+
for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
|
|
145
145
|
t.size > 0 && (this._$Ep = t);
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
@@ -156,33 +156,33 @@ let S = class extends HTMLElement {
|
|
|
156
156
|
disconnectedCallback() {
|
|
157
157
|
this._$EO?.forEach(((t) => t.hostDisconnected?.()));
|
|
158
158
|
}
|
|
159
|
-
attributeChangedCallback(t, e,
|
|
160
|
-
this._$AK(t,
|
|
159
|
+
attributeChangedCallback(t, e, s) {
|
|
160
|
+
this._$AK(t, s);
|
|
161
161
|
}
|
|
162
162
|
_$ET(t, e) {
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
const n = (
|
|
166
|
-
this._$Em = t, n == null ? this.removeAttribute(
|
|
163
|
+
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
164
|
+
if (i !== void 0 && s.reflect === !0) {
|
|
165
|
+
const n = (s.converter?.toAttribute !== void 0 ? s.converter : j).toAttribute(e, s.type);
|
|
166
|
+
this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
const n =
|
|
173
|
-
this._$Em =
|
|
170
|
+
const s = this.constructor, i = s._$Eh.get(t);
|
|
171
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
172
|
+
const n = s.getPropertyOptions(i), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : j;
|
|
173
|
+
this._$Em = i, this[i] = o.fromAttribute(e, n.type) ?? this._$Ej?.get(i) ?? null, this._$Em = null;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
requestUpdate(t, e,
|
|
176
|
+
requestUpdate(t, e, s) {
|
|
177
177
|
if (t !== void 0) {
|
|
178
|
-
const
|
|
179
|
-
if (
|
|
180
|
-
this.C(t, e,
|
|
178
|
+
const i = this.constructor, n = this[t];
|
|
179
|
+
if (s ??= i.getPropertyOptions(t), !((s.hasChanged ?? Z)(n, e) || s.useDefault && s.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
|
|
180
|
+
this.C(t, e, s);
|
|
181
181
|
}
|
|
182
182
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
183
183
|
}
|
|
184
|
-
C(t, e, { useDefault:
|
|
185
|
-
|
|
184
|
+
C(t, e, { useDefault: s, reflect: i, wrapped: n }, o) {
|
|
185
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
186
186
|
}
|
|
187
187
|
async _$EP() {
|
|
188
188
|
this.isUpdatePending = !0;
|
|
@@ -201,21 +201,21 @@ let S = class extends HTMLElement {
|
|
|
201
201
|
if (!this.isUpdatePending) return;
|
|
202
202
|
if (!this.hasUpdated) {
|
|
203
203
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
204
|
-
for (const [
|
|
204
|
+
for (const [i, n] of this._$Ep) this[i] = n;
|
|
205
205
|
this._$Ep = void 0;
|
|
206
206
|
}
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
const { wrapped: o } = n,
|
|
210
|
-
o !== !0 || this._$AL.has(
|
|
207
|
+
const s = this.constructor.elementProperties;
|
|
208
|
+
if (s.size > 0) for (const [i, n] of s) {
|
|
209
|
+
const { wrapped: o } = n, a = this[i];
|
|
210
|
+
o !== !0 || this._$AL.has(i) || a === void 0 || this.C(i, void 0, n, a);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
let t = !1;
|
|
214
214
|
const e = this._$AL;
|
|
215
215
|
try {
|
|
216
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((
|
|
217
|
-
} catch (
|
|
218
|
-
throw t = !1, this._$EM(),
|
|
216
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((s) => s.hostUpdate?.())), this.update(e)) : this._$EM();
|
|
217
|
+
} catch (s) {
|
|
218
|
+
throw t = !1, this._$EM(), s;
|
|
219
219
|
}
|
|
220
220
|
t && this._$AE(e);
|
|
221
221
|
}
|
|
@@ -245,67 +245,67 @@ let S = class extends HTMLElement {
|
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
247
|
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[T("elementProperties")] = /* @__PURE__ */ new Map(), S[T("finalized")] = /* @__PURE__ */ new Map(), Et?.({ ReactiveElement: S }), (k.reactiveElementVersions ??= []).push("2.1.0");
|
|
248
|
-
const
|
|
249
|
-
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, nt = />/g, A = RegExp(`>|${
|
|
248
|
+
const J = globalThis, I = J.trustedTypes, st = I ? I.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, dt = "$lit$", y = `lit$${Math.random().toFixed(9).slice(2)}$`, ut = "?" + y, Ct = `<${ut}>`, w = document, M = () => w.createComment(""), N = (r) => r === null || typeof r != "object" && typeof r != "function", K = Array.isArray, Pt = (r) => K(r) || typeof r?.[Symbol.iterator] == "function", q = `[
|
|
249
|
+
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, nt = />/g, A = RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
|
|
250
250
|
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, ht = /"/g, $t = /^(?:script|style|textarea|title)$/i, Ut = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), U = Ut(1), x = /* @__PURE__ */ Symbol.for("lit-noChange"), $ = /* @__PURE__ */ Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), b = w.createTreeWalker(w, 129);
|
|
251
251
|
function ft(r, t) {
|
|
252
|
-
if (!
|
|
252
|
+
if (!K(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
253
253
|
return st !== void 0 ? st.createHTML(t) : t;
|
|
254
254
|
}
|
|
255
255
|
const Ot = (r, t) => {
|
|
256
|
-
const e = r.length - 1,
|
|
257
|
-
let
|
|
258
|
-
for (let
|
|
259
|
-
const h = r[
|
|
260
|
-
let
|
|
261
|
-
for (; d < h.length && (o.lastIndex = d, u = o.exec(h), u !== null); ) d = o.lastIndex, o === P ? u[1] === "!--" ? o = rt : u[1] !== void 0 ? o = nt : u[2] !== void 0 ? ($t.test(u[2]) && (
|
|
262
|
-
const
|
|
263
|
-
n += o === P ? h + Ct :
|
|
264
|
-
}
|
|
265
|
-
return [ft(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")),
|
|
256
|
+
const e = r.length - 1, s = [];
|
|
257
|
+
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = P;
|
|
258
|
+
for (let a = 0; a < e; a++) {
|
|
259
|
+
const h = r[a];
|
|
260
|
+
let c, u, l = -1, d = 0;
|
|
261
|
+
for (; d < h.length && (o.lastIndex = d, u = o.exec(h), u !== null); ) d = o.lastIndex, o === P ? u[1] === "!--" ? o = rt : u[1] !== void 0 ? o = nt : u[2] !== void 0 ? ($t.test(u[2]) && (i = RegExp("</" + u[2], "g")), o = A) : u[3] !== void 0 && (o = A) : o === A ? u[0] === ">" ? (o = i ?? P, l = -1) : u[1] === void 0 ? l = -2 : (l = o.lastIndex - u[2].length, c = u[1], o = u[3] === void 0 ? A : u[3] === '"' ? ht : ot) : o === ht || o === ot ? o = A : o === rt || o === nt ? o = P : (o = A, i = void 0);
|
|
262
|
+
const p = o === A && r[a + 1].startsWith("/>") ? " " : "";
|
|
263
|
+
n += o === P ? h + Ct : l >= 0 ? (s.push(c), h.slice(0, l) + dt + h.slice(l) + y + p) : h + y + (l === -2 ? a : p);
|
|
264
|
+
}
|
|
265
|
+
return [ft(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
266
266
|
};
|
|
267
|
-
class
|
|
268
|
-
constructor({ strings: t, _$litType$: e },
|
|
269
|
-
let
|
|
267
|
+
class D {
|
|
268
|
+
constructor({ strings: t, _$litType$: e }, s) {
|
|
269
|
+
let i;
|
|
270
270
|
this.parts = [];
|
|
271
271
|
let n = 0, o = 0;
|
|
272
|
-
const
|
|
273
|
-
if (this.el =
|
|
274
|
-
const
|
|
275
|
-
|
|
272
|
+
const a = t.length - 1, h = this.parts, [c, u] = Ot(t, e);
|
|
273
|
+
if (this.el = D.createElement(c, s), b.currentNode = this.el.content, e === 2 || e === 3) {
|
|
274
|
+
const l = this.el.content.firstChild;
|
|
275
|
+
l.replaceWith(...l.childNodes);
|
|
276
276
|
}
|
|
277
|
-
for (; (
|
|
278
|
-
if (
|
|
279
|
-
if (
|
|
280
|
-
const d = u[o++],
|
|
281
|
-
h.push({ type: 1, index: n, name: f[2], strings:
|
|
282
|
-
} else
|
|
283
|
-
if ($t.test(
|
|
284
|
-
const
|
|
277
|
+
for (; (i = b.nextNode()) !== null && h.length < a; ) {
|
|
278
|
+
if (i.nodeType === 1) {
|
|
279
|
+
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(dt)) {
|
|
280
|
+
const d = u[o++], p = i.getAttribute(l).split(y), f = /([.?@])?(.*)/.exec(d);
|
|
281
|
+
h.push({ type: 1, index: n, name: f[2], strings: p, ctor: f[1] === "." ? Ht : f[1] === "?" ? Mt : f[1] === "@" ? Nt : L }), i.removeAttribute(l);
|
|
282
|
+
} else l.startsWith(y) && (h.push({ type: 6, index: n }), i.removeAttribute(l));
|
|
283
|
+
if ($t.test(i.tagName)) {
|
|
284
|
+
const l = i.textContent.split(y), d = l.length - 1;
|
|
285
285
|
if (d > 0) {
|
|
286
|
-
|
|
287
|
-
for (let
|
|
288
|
-
|
|
286
|
+
i.textContent = I ? I.emptyScript : "";
|
|
287
|
+
for (let p = 0; p < d; p++) i.append(l[p], M()), b.nextNode(), h.push({ type: 2, index: ++n });
|
|
288
|
+
i.append(l[d], M());
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
} else if (
|
|
291
|
+
} else if (i.nodeType === 8) if (i.data === ut) h.push({ type: 2, index: n });
|
|
292
292
|
else {
|
|
293
|
-
let
|
|
294
|
-
for (; (
|
|
293
|
+
let l = -1;
|
|
294
|
+
for (; (l = i.data.indexOf(y, l + 1)) !== -1; ) h.push({ type: 7, index: n }), l += y.length - 1;
|
|
295
295
|
}
|
|
296
296
|
n++;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
static createElement(t, e) {
|
|
300
|
-
const
|
|
301
|
-
return
|
|
300
|
+
const s = w.createElement("template");
|
|
301
|
+
return s.innerHTML = t, s;
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
function E(r, t, e = r,
|
|
304
|
+
function E(r, t, e = r, s) {
|
|
305
305
|
if (t === x) return t;
|
|
306
|
-
let
|
|
307
|
-
const n =
|
|
308
|
-
return
|
|
306
|
+
let i = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
307
|
+
const n = N(t) ? void 0 : t._$litDirective$;
|
|
308
|
+
return i?.constructor !== n && (i?._$AO?.(!1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = i : e._$Cl = i), i !== void 0 && (t = E(r, i._$AS(r, t.values), i, s)), t;
|
|
309
309
|
}
|
|
310
310
|
let Tt = class {
|
|
311
311
|
constructor(t, e) {
|
|
@@ -318,29 +318,29 @@ let Tt = class {
|
|
|
318
318
|
return this._$AM._$AU;
|
|
319
319
|
}
|
|
320
320
|
u(t) {
|
|
321
|
-
const { el: { content: e }, parts:
|
|
322
|
-
b.currentNode =
|
|
323
|
-
let n = b.nextNode(), o = 0,
|
|
321
|
+
const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? w).importNode(e, !0);
|
|
322
|
+
b.currentNode = i;
|
|
323
|
+
let n = b.nextNode(), o = 0, a = 0, h = s[0];
|
|
324
324
|
for (; h !== void 0; ) {
|
|
325
325
|
if (o === h.index) {
|
|
326
|
-
let
|
|
327
|
-
h.type === 2 ?
|
|
326
|
+
let c;
|
|
327
|
+
h.type === 2 ? c = new C(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new Dt(n, this, t)), this._$AV.push(c), h = s[++a];
|
|
328
328
|
}
|
|
329
329
|
o !== h?.index && (n = b.nextNode(), o++);
|
|
330
330
|
}
|
|
331
|
-
return b.currentNode = w,
|
|
331
|
+
return b.currentNode = w, i;
|
|
332
332
|
}
|
|
333
333
|
p(t) {
|
|
334
334
|
let e = 0;
|
|
335
|
-
for (const
|
|
335
|
+
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
class C {
|
|
339
339
|
get _$AU() {
|
|
340
340
|
return this._$AM?._$AU ?? this._$Cv;
|
|
341
341
|
}
|
|
342
|
-
constructor(t, e,
|
|
343
|
-
this.type = 2, this._$AH = $, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM =
|
|
342
|
+
constructor(t, e, s, i) {
|
|
343
|
+
this.type = 2, this._$AH = $, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = i?.isConnected ?? !0;
|
|
344
344
|
}
|
|
345
345
|
get parentNode() {
|
|
346
346
|
let t = this._$AA.parentNode;
|
|
@@ -354,7 +354,7 @@ class C {
|
|
|
354
354
|
return this._$AB;
|
|
355
355
|
}
|
|
356
356
|
_$AI(t, e = this) {
|
|
357
|
-
t = E(this, t, e),
|
|
357
|
+
t = E(this, t, e), N(t) ? t === $ || t == null || t === "" ? (this._$AH !== $ && this._$AR(), this._$AH = $) : t !== this._$AH && t !== x && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Pt(t) ? this.k(t) : this._(t);
|
|
358
358
|
}
|
|
359
359
|
O(t) {
|
|
360
360
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -363,31 +363,31 @@ class C {
|
|
|
363
363
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
364
364
|
}
|
|
365
365
|
_(t) {
|
|
366
|
-
this._$AH !== $ &&
|
|
366
|
+
this._$AH !== $ && N(this._$AH) ? this._$AA.nextSibling.data = t : this.T(w.createTextNode(t)), this._$AH = t;
|
|
367
367
|
}
|
|
368
368
|
$(t) {
|
|
369
|
-
const { values: e, _$litType$:
|
|
370
|
-
if (this._$AH?._$AD ===
|
|
369
|
+
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = D.createElement(ft(s.h, s.h[0]), this.options)), s);
|
|
370
|
+
if (this._$AH?._$AD === i) this._$AH.p(e);
|
|
371
371
|
else {
|
|
372
|
-
const n = new Tt(
|
|
372
|
+
const n = new Tt(i, this), o = n.u(this.options);
|
|
373
373
|
n.p(e), this.T(o), this._$AH = n;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
_$AC(t) {
|
|
377
377
|
let e = at.get(t.strings);
|
|
378
|
-
return e === void 0 && at.set(t.strings, e = new
|
|
378
|
+
return e === void 0 && at.set(t.strings, e = new D(t)), e;
|
|
379
379
|
}
|
|
380
380
|
k(t) {
|
|
381
|
-
|
|
381
|
+
K(this._$AH) || (this._$AH = [], this._$AR());
|
|
382
382
|
const e = this._$AH;
|
|
383
|
-
let
|
|
384
|
-
for (const n of t)
|
|
385
|
-
|
|
383
|
+
let s, i = 0;
|
|
384
|
+
for (const n of t) i === e.length ? e.push(s = new C(this.O(M()), this.O(M()), this, this.options)) : s = e[i], s._$AI(n), i++;
|
|
385
|
+
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
386
386
|
}
|
|
387
387
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
388
388
|
for (this._$AP?.(!1, !0, e); t && t !== this._$AB; ) {
|
|
389
|
-
const
|
|
390
|
-
t.remove(), t =
|
|
389
|
+
const s = t.nextSibling;
|
|
390
|
+
t.remove(), t = s;
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
setConnected(t) {
|
|
@@ -401,19 +401,19 @@ class L {
|
|
|
401
401
|
get _$AU() {
|
|
402
402
|
return this._$AM._$AU;
|
|
403
403
|
}
|
|
404
|
-
constructor(t, e,
|
|
405
|
-
this.type = 1, this._$AH = $, this._$AN = void 0, this.element = t, this.name = e, this._$AM =
|
|
404
|
+
constructor(t, e, s, i, n) {
|
|
405
|
+
this.type = 1, this._$AH = $, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = $;
|
|
406
406
|
}
|
|
407
|
-
_$AI(t, e = this,
|
|
407
|
+
_$AI(t, e = this, s, i) {
|
|
408
408
|
const n = this.strings;
|
|
409
409
|
let o = !1;
|
|
410
|
-
if (n === void 0) t = E(this, t, e, 0), o = !
|
|
410
|
+
if (n === void 0) t = E(this, t, e, 0), o = !N(t) || t !== this._$AH && t !== x, o && (this._$AH = t);
|
|
411
411
|
else {
|
|
412
|
-
const
|
|
413
|
-
let h,
|
|
414
|
-
for (t = n[0], h = 0; h < n.length - 1; h++)
|
|
412
|
+
const a = t;
|
|
413
|
+
let h, c;
|
|
414
|
+
for (t = n[0], h = 0; h < n.length - 1; h++) c = E(this, a[s + h], e, h), c === x && (c = this._$AH[h]), o ||= !N(c) || c !== this._$AH[h], c === $ ? t = $ : t !== $ && (t += (c ?? "") + n[h + 1]), this._$AH[h] = c;
|
|
415
415
|
}
|
|
416
|
-
o && !
|
|
416
|
+
o && !i && this.j(t);
|
|
417
417
|
}
|
|
418
418
|
j(t) {
|
|
419
419
|
t === $ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
@@ -427,7 +427,7 @@ class Ht extends L {
|
|
|
427
427
|
this.element[this.name] = t === $ ? void 0 : t;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
class
|
|
430
|
+
class Mt extends L {
|
|
431
431
|
constructor() {
|
|
432
432
|
super(...arguments), this.type = 4;
|
|
433
433
|
}
|
|
@@ -435,22 +435,22 @@ class Dt extends L {
|
|
|
435
435
|
this.element.toggleAttribute(this.name, !!t && t !== $);
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
class
|
|
439
|
-
constructor(t, e,
|
|
440
|
-
super(t, e,
|
|
438
|
+
class Nt extends L {
|
|
439
|
+
constructor(t, e, s, i, n) {
|
|
440
|
+
super(t, e, s, i, n), this.type = 5;
|
|
441
441
|
}
|
|
442
442
|
_$AI(t, e = this) {
|
|
443
443
|
if ((t = E(this, t, e, 0) ?? $) === x) return;
|
|
444
|
-
const
|
|
445
|
-
|
|
444
|
+
const s = this._$AH, i = t === $ && s !== $ || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== $ && (s === $ || i);
|
|
445
|
+
i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
446
446
|
}
|
|
447
447
|
handleEvent(t) {
|
|
448
448
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
class
|
|
452
|
-
constructor(t, e,
|
|
453
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options =
|
|
451
|
+
class Dt {
|
|
452
|
+
constructor(t, e, s) {
|
|
453
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
454
454
|
}
|
|
455
455
|
get _$AU() {
|
|
456
456
|
return this._$AM._$AU;
|
|
@@ -459,18 +459,18 @@ class Rt {
|
|
|
459
459
|
E(this, t);
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
const
|
|
463
|
-
zt?.(
|
|
462
|
+
const Rt = { I: C }, zt = J.litHtmlPolyfillSupport;
|
|
463
|
+
zt?.(D, C), (J.litHtmlVersions ??= []).push("3.3.0");
|
|
464
464
|
const jt = (r, t, e) => {
|
|
465
|
-
const
|
|
466
|
-
let
|
|
467
|
-
if (
|
|
465
|
+
const s = e?.renderBefore ?? t;
|
|
466
|
+
let i = s._$litPart$;
|
|
467
|
+
if (i === void 0) {
|
|
468
468
|
const n = e?.renderBefore ?? null;
|
|
469
|
-
|
|
469
|
+
s._$litPart$ = i = new C(t.insertBefore(M(), n), n, void 0, e ?? {});
|
|
470
470
|
}
|
|
471
|
-
return
|
|
471
|
+
return i._$AI(r), i;
|
|
472
472
|
};
|
|
473
|
-
const
|
|
473
|
+
const Q = globalThis;
|
|
474
474
|
let H = class extends S {
|
|
475
475
|
constructor() {
|
|
476
476
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
@@ -493,10 +493,10 @@ let H = class extends S {
|
|
|
493
493
|
return x;
|
|
494
494
|
}
|
|
495
495
|
};
|
|
496
|
-
H._$litElement$ = !0, H.finalized = !0,
|
|
497
|
-
const It =
|
|
496
|
+
H._$litElement$ = !0, H.finalized = !0, Q.litElementHydrateSupport?.({ LitElement: H });
|
|
497
|
+
const It = Q.litElementPolyfillSupport;
|
|
498
498
|
It?.({ LitElement: H });
|
|
499
|
-
(
|
|
499
|
+
(Q.litElementVersions ??= []).push("4.2.0");
|
|
500
500
|
const kt = { CHILD: 2 }, Lt = (r) => (...t) => ({ _$litDirective$: r, values: t });
|
|
501
501
|
class Bt {
|
|
502
502
|
constructor(t) {
|
|
@@ -504,8 +504,8 @@ class Bt {
|
|
|
504
504
|
get _$AU() {
|
|
505
505
|
return this._$AM._$AU;
|
|
506
506
|
}
|
|
507
|
-
_$AT(t, e,
|
|
508
|
-
this._$Ct = t, this._$AM = e, this._$Ci =
|
|
507
|
+
_$AT(t, e, s) {
|
|
508
|
+
this._$Ct = t, this._$AM = e, this._$Ci = s;
|
|
509
509
|
}
|
|
510
510
|
_$AS(t, e) {
|
|
511
511
|
return this.update(t, e);
|
|
@@ -514,144 +514,144 @@ class Bt {
|
|
|
514
514
|
return this.render(...e);
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
const { I: Wt } =
|
|
518
|
-
const
|
|
517
|
+
const { I: Wt } = Rt, lt = () => document.createComment(""), O = (r, t, e) => {
|
|
518
|
+
const s = r._$AA.parentNode, i = t === void 0 ? r._$AB : t._$AA;
|
|
519
519
|
if (e === void 0) {
|
|
520
|
-
const n =
|
|
520
|
+
const n = s.insertBefore(lt(), i), o = s.insertBefore(lt(), i);
|
|
521
521
|
e = new Wt(n, o, r, r.options);
|
|
522
522
|
} else {
|
|
523
|
-
const n = e._$AB.nextSibling, o = e._$AM,
|
|
524
|
-
if (
|
|
523
|
+
const n = e._$AB.nextSibling, o = e._$AM, a = o !== r;
|
|
524
|
+
if (a) {
|
|
525
525
|
let h;
|
|
526
526
|
e._$AQ?.(r), e._$AM = r, e._$AP !== void 0 && (h = r._$AU) !== o._$AU && e._$AP(h);
|
|
527
527
|
}
|
|
528
|
-
if (n !==
|
|
528
|
+
if (n !== i || a) {
|
|
529
529
|
let h = e._$AA;
|
|
530
530
|
for (; h !== n; ) {
|
|
531
|
-
const
|
|
532
|
-
|
|
531
|
+
const c = h.nextSibling;
|
|
532
|
+
s.insertBefore(h, i), h = c;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
return e;
|
|
537
|
-
}, v = (r, t, e = r) => (r._$AI(t, e), r), qt = {}, Vt = (r, t = qt) => r._$AH = t,
|
|
537
|
+
}, v = (r, t, e = r) => (r._$AI(t, e), r), qt = {}, Vt = (r, t = qt) => r._$AH = t, Ft = (r) => r._$AH, V = (r) => {
|
|
538
538
|
r._$AP?.(!1, !0);
|
|
539
539
|
let t = r._$AA;
|
|
540
540
|
const e = r._$AB.nextSibling;
|
|
541
541
|
for (; t !== e; ) {
|
|
542
|
-
const
|
|
543
|
-
t.remove(), t =
|
|
542
|
+
const s = t.nextSibling;
|
|
543
|
+
t.remove(), t = s;
|
|
544
544
|
}
|
|
545
545
|
};
|
|
546
546
|
const ct = (r, t, e) => {
|
|
547
|
-
const
|
|
548
|
-
for (let
|
|
549
|
-
return
|
|
550
|
-
},
|
|
547
|
+
const s = /* @__PURE__ */ new Map();
|
|
548
|
+
for (let i = t; i <= e; i++) s.set(r[i], i);
|
|
549
|
+
return s;
|
|
550
|
+
}, Gt = Lt(class extends Bt {
|
|
551
551
|
constructor(r) {
|
|
552
552
|
if (super(r), r.type !== kt.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
553
553
|
}
|
|
554
554
|
dt(r, t, e) {
|
|
555
|
-
let
|
|
556
|
-
e === void 0 ? e = t : t !== void 0 && (
|
|
557
|
-
const
|
|
555
|
+
let s;
|
|
556
|
+
e === void 0 ? e = t : t !== void 0 && (s = t);
|
|
557
|
+
const i = [], n = [];
|
|
558
558
|
let o = 0;
|
|
559
|
-
for (const
|
|
560
|
-
return { values: n, keys:
|
|
559
|
+
for (const a of r) i[o] = s ? s(a, o) : o, n[o] = e(a, o), o++;
|
|
560
|
+
return { values: n, keys: i };
|
|
561
561
|
}
|
|
562
562
|
render(r, t, e) {
|
|
563
563
|
return this.dt(r, t, e).values;
|
|
564
564
|
}
|
|
565
|
-
update(r, [t, e,
|
|
566
|
-
const
|
|
567
|
-
if (!Array.isArray(
|
|
568
|
-
const
|
|
569
|
-
let
|
|
570
|
-
for (;
|
|
571
|
-
else if (
|
|
572
|
-
else if (l
|
|
573
|
-
else if (
|
|
574
|
-
else if (l
|
|
575
|
-
else if (
|
|
576
|
-
else if (
|
|
577
|
-
const
|
|
578
|
-
if (
|
|
579
|
-
const X = O(r,
|
|
580
|
-
v(X, n[
|
|
581
|
-
} else h[
|
|
582
|
-
|
|
583
|
-
} else
|
|
584
|
-
else
|
|
585
|
-
for (;
|
|
586
|
-
const
|
|
587
|
-
v(
|
|
565
|
+
update(r, [t, e, s]) {
|
|
566
|
+
const i = Ft(r), { values: n, keys: o } = this.dt(t, e, s);
|
|
567
|
+
if (!Array.isArray(i)) return this.ut = o, n;
|
|
568
|
+
const a = this.ut ??= [], h = [];
|
|
569
|
+
let c, u, l = 0, d = i.length - 1, p = 0, f = n.length - 1;
|
|
570
|
+
for (; l <= d && p <= f; ) if (i[l] === null) l++;
|
|
571
|
+
else if (i[d] === null) d--;
|
|
572
|
+
else if (a[l] === o[p]) h[p] = v(i[l], n[p]), l++, p++;
|
|
573
|
+
else if (a[d] === o[f]) h[f] = v(i[d], n[f]), d--, f--;
|
|
574
|
+
else if (a[l] === o[f]) h[f] = v(i[l], n[f]), O(r, h[f + 1], i[l]), l++, f--;
|
|
575
|
+
else if (a[d] === o[p]) h[p] = v(i[d], n[p]), O(r, i[l], i[d]), d--, p++;
|
|
576
|
+
else if (c === void 0 && (c = ct(o, p, f), u = ct(a, l, d)), c.has(a[l])) if (c.has(a[d])) {
|
|
577
|
+
const _ = u.get(o[p]), W = _ !== void 0 ? i[_] : null;
|
|
578
|
+
if (W === null) {
|
|
579
|
+
const X = O(r, i[l]);
|
|
580
|
+
v(X, n[p]), h[p] = X;
|
|
581
|
+
} else h[p] = v(W, n[p]), O(r, i[l], W), i[_] = null;
|
|
582
|
+
p++;
|
|
583
|
+
} else V(i[d]), d--;
|
|
584
|
+
else V(i[l]), l++;
|
|
585
|
+
for (; p <= f; ) {
|
|
586
|
+
const _ = O(r, h[f + 1]);
|
|
587
|
+
v(_, n[p]), h[p++] = _;
|
|
588
588
|
}
|
|
589
|
-
for (;
|
|
590
|
-
const
|
|
591
|
-
|
|
589
|
+
for (; l <= d; ) {
|
|
590
|
+
const _ = i[l++];
|
|
591
|
+
_ !== null && V(_);
|
|
592
592
|
}
|
|
593
593
|
return this.ut = o, Vt(r, h), x;
|
|
594
594
|
}
|
|
595
595
|
});
|
|
596
|
-
const
|
|
596
|
+
const Zt = (r) => r ?? $;
|
|
597
597
|
const Jt = (r) => (t, e) => {
|
|
598
598
|
e !== void 0 ? e.addInitializer((() => {
|
|
599
599
|
customElements.define(r, t);
|
|
600
600
|
})) : customElements.define(r, t);
|
|
601
601
|
};
|
|
602
602
|
const Kt = { attribute: !0, type: String, converter: j, reflect: !1, hasChanged: Z }, Qt = (r = Kt, t, e) => {
|
|
603
|
-
const { kind:
|
|
604
|
-
let n = globalThis.litPropertyMetadata.get(
|
|
605
|
-
if (n === void 0 && globalThis.litPropertyMetadata.set(
|
|
603
|
+
const { kind: s, metadata: i } = e;
|
|
604
|
+
let n = globalThis.litPropertyMetadata.get(i);
|
|
605
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), n.set(e.name, r), s === "accessor") {
|
|
606
606
|
const { name: o } = e;
|
|
607
|
-
return { set(
|
|
607
|
+
return { set(a) {
|
|
608
608
|
const h = t.get.call(this);
|
|
609
|
-
t.set.call(this,
|
|
610
|
-
}, init(
|
|
611
|
-
return
|
|
609
|
+
t.set.call(this, a), this.requestUpdate(o, h, r);
|
|
610
|
+
}, init(a) {
|
|
611
|
+
return a !== void 0 && this.C(o, void 0, r, a), a;
|
|
612
612
|
} };
|
|
613
613
|
}
|
|
614
|
-
if (
|
|
614
|
+
if (s === "setter") {
|
|
615
615
|
const { name: o } = e;
|
|
616
|
-
return function(
|
|
616
|
+
return function(a) {
|
|
617
617
|
const h = this[o];
|
|
618
|
-
t.call(this,
|
|
618
|
+
t.call(this, a), this.requestUpdate(o, h, r);
|
|
619
619
|
};
|
|
620
620
|
}
|
|
621
|
-
throw Error("Unsupported decorator location: " +
|
|
621
|
+
throw Error("Unsupported decorator location: " + s);
|
|
622
622
|
};
|
|
623
|
-
function
|
|
624
|
-
return (t, e) => typeof e == "object" ? Qt(r, t, e) : ((
|
|
625
|
-
const o =
|
|
626
|
-
return
|
|
623
|
+
function B(r) {
|
|
624
|
+
return (t, e) => typeof e == "object" ? Qt(r, t, e) : ((s, i, n) => {
|
|
625
|
+
const o = i.hasOwnProperty(n);
|
|
626
|
+
return i.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
|
|
627
627
|
})(r, t, e);
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
return
|
|
629
|
+
function R(r) {
|
|
630
|
+
return B({ ...r, state: !0, attribute: !1 });
|
|
631
631
|
}
|
|
632
632
|
const Xt = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(r, t, e), e);
|
|
633
633
|
function Yt(r, t) {
|
|
634
|
-
return (e,
|
|
634
|
+
return (e, s, i) => {
|
|
635
635
|
const n = (o) => o.renderRoot?.querySelector(r) ?? null;
|
|
636
|
-
return Xt(e,
|
|
636
|
+
return Xt(e, s, { get() {
|
|
637
637
|
return n(this);
|
|
638
638
|
} });
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
|
-
var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor,
|
|
642
|
-
for (var
|
|
643
|
-
(o = r[n]) && (
|
|
644
|
-
return
|
|
641
|
+
var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, g = (r, t, e, s) => {
|
|
642
|
+
for (var i = s > 1 ? void 0 : s ? ee(t, e) : t, n = r.length - 1, o; n >= 0; n--)
|
|
643
|
+
(o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
644
|
+
return s && i && te(t, e, i), i;
|
|
645
645
|
};
|
|
646
|
-
let
|
|
646
|
+
let m = class extends H {
|
|
647
647
|
constructor() {
|
|
648
|
-
super(...arguments), this.elementWidth = 0, this.elementHeight = 0, this.version = "1.1.
|
|
648
|
+
super(...arguments), this.elementWidth = 0, this.elementHeight = 0, this.version = "1.1.17";
|
|
649
649
|
}
|
|
650
650
|
disconnectedCallback() {
|
|
651
651
|
super.disconnectedCallback(), this.resizeObserver && this.resizeObserver.disconnect();
|
|
652
652
|
}
|
|
653
653
|
update(r) {
|
|
654
|
-
r.has("inputData") && this.updateGridLayout(), r.has("theme") && this.registerTheme(this.theme), super.update(r);
|
|
654
|
+
(r.has("inputData") || r.has("timeRange")) && this.updateGridLayout(), r.has("theme") && this.registerTheme(this.theme), super.update(r);
|
|
655
655
|
}
|
|
656
656
|
firstUpdated(r) {
|
|
657
657
|
this.registerTheme(this.theme), this.wrapper && (this.resizeObserver = new ResizeObserver(() => {
|
|
@@ -662,24 +662,41 @@ let g = class extends H {
|
|
|
662
662
|
const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), e = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
|
|
663
663
|
this.themeBgColor = e || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = t || this.theme?.theme_object?.title?.textStyle?.color, this.themeSubtitleColor = t || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor;
|
|
664
664
|
}
|
|
665
|
+
/**
|
|
666
|
+
* Get images filtered by timeRange if available
|
|
667
|
+
*/
|
|
668
|
+
getFilteredImages() {
|
|
669
|
+
const r = this.inputData?.useUpload ? typeof this.inputData?.image == "string" ? this.inputData.image : "" : this.inputData?.imageUrl ?? "";
|
|
670
|
+
let t = this.inputData?.multiImage ? this.inputData?.data ?? [] : [{ imageUrl: r, label: this.inputData?.title ?? "" }];
|
|
671
|
+
if (this.timeRange && this.inputData?.multiImage) {
|
|
672
|
+
const e = Number(this.timeRange.start), s = Number(this.timeRange.end);
|
|
673
|
+
(!isNaN(e) || !isNaN(s)) && (t = t.filter((i) => {
|
|
674
|
+
const n = i.timestamp;
|
|
675
|
+
if (n == null) return !0;
|
|
676
|
+
const o = Number(n);
|
|
677
|
+
return isNaN(o) ? !0 : !(!isNaN(e) && o < e || !isNaN(s) && o > s);
|
|
678
|
+
}));
|
|
679
|
+
}
|
|
680
|
+
return t;
|
|
681
|
+
}
|
|
665
682
|
/**
|
|
666
683
|
* Update grid layout based on container size and number of elements
|
|
667
684
|
*/
|
|
668
685
|
updateGridLayout() {
|
|
669
686
|
if (!this.wrapper) return;
|
|
670
|
-
const
|
|
671
|
-
if (
|
|
672
|
-
const
|
|
673
|
-
if (
|
|
674
|
-
const
|
|
687
|
+
const t = this.getFilteredImages().length;
|
|
688
|
+
if (t === 0) return;
|
|
689
|
+
const e = this.wrapper.getBoundingClientRect(), s = e.width * 0.04, i = e.height * 0.04, n = e.width - s, o = e.height - i;
|
|
690
|
+
if (n <= 0 || o <= 0) return;
|
|
691
|
+
const a = this.optimizeLayout(
|
|
692
|
+
n,
|
|
675
693
|
o,
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
(u, a) => Math.abs(u / a - 1 / 1),
|
|
694
|
+
t,
|
|
695
|
+
(c, u) => Math.abs(c / u - 1 / 1),
|
|
679
696
|
this.inputData?.gap ?? 12
|
|
680
697
|
);
|
|
681
|
-
this.elementWidth =
|
|
682
|
-
|
|
698
|
+
this.elementWidth = a.elementWidth, this.elementHeight = a.elementHeight, this.wrapper.querySelectorAll(".image-item").forEach((c) => {
|
|
699
|
+
c.style.width = `${a.elementWidth}px`, c.style.height = `${a.elementHeight}px`;
|
|
683
700
|
});
|
|
684
701
|
}
|
|
685
702
|
/**
|
|
@@ -691,7 +708,7 @@ let g = class extends H {
|
|
|
691
708
|
* @param gap - Gap between elements (default: 12)
|
|
692
709
|
* @returns Optimal layout configuration
|
|
693
710
|
*/
|
|
694
|
-
optimizeLayout(r, t, e,
|
|
711
|
+
optimizeLayout(r, t, e, s, i = 12) {
|
|
695
712
|
let n = {
|
|
696
713
|
elementWidth: 0,
|
|
697
714
|
elementHeight: 0,
|
|
@@ -700,27 +717,27 @@ let g = class extends H {
|
|
|
700
717
|
error: 1 / 0
|
|
701
718
|
};
|
|
702
719
|
for (let o = 1; o <= e; o++) {
|
|
703
|
-
const
|
|
704
|
-
if (u <= 0 ||
|
|
705
|
-
const d = u / o,
|
|
720
|
+
const a = Math.ceil(e / o), h = i * (o - 1), c = i * (a - 1), u = r - h, l = t - c;
|
|
721
|
+
if (u <= 0 || l <= 0) continue;
|
|
722
|
+
const d = u / o, p = l / a, f = s(d, p);
|
|
706
723
|
f < n.error && (n = {
|
|
707
724
|
elementWidth: d,
|
|
708
|
-
elementHeight:
|
|
725
|
+
elementHeight: p,
|
|
709
726
|
numCols: o,
|
|
710
|
-
numRows:
|
|
727
|
+
numRows: a,
|
|
711
728
|
error: f
|
|
712
729
|
});
|
|
713
730
|
}
|
|
714
731
|
return n;
|
|
715
732
|
}
|
|
716
733
|
render() {
|
|
717
|
-
const r = this.
|
|
734
|
+
const r = this.getFilteredImages(), t = r.length > 1, e = r.filter((i) => i.label).length > 0, s = r.some((i) => i.imageUrl);
|
|
718
735
|
return U`
|
|
719
736
|
<div
|
|
720
737
|
class="wrapper"
|
|
721
|
-
style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}; gap: ${
|
|
738
|
+
style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}; gap: ${t ? `${this.inputData?.gap ?? 12}px` : "0px"}; ${t ? "" : "flex-direction: column;"}"
|
|
722
739
|
>
|
|
723
|
-
${!
|
|
740
|
+
${!t && this.inputData?.title ? U`
|
|
724
741
|
<h3
|
|
725
742
|
class="paging"
|
|
726
743
|
?active=${this.inputData?.title}
|
|
@@ -729,7 +746,7 @@ let g = class extends H {
|
|
|
729
746
|
${this.inputData?.title}
|
|
730
747
|
</h3>
|
|
731
748
|
` : $}
|
|
732
|
-
${!
|
|
749
|
+
${!t && this.inputData?.subTitle ? U`
|
|
733
750
|
<p
|
|
734
751
|
class="paging"
|
|
735
752
|
?active=${this.inputData?.subTitle}
|
|
@@ -741,19 +758,24 @@ let g = class extends H {
|
|
|
741
758
|
<div class="paging no-data" ?active=${!s} style="color: ${this.themeTitleColor};">
|
|
742
759
|
No Image
|
|
743
760
|
</div>
|
|
744
|
-
${
|
|
745
|
-
|
|
746
|
-
(
|
|
747
|
-
(
|
|
761
|
+
${Gt(
|
|
762
|
+
r,
|
|
763
|
+
(i) => i.imageUrl,
|
|
764
|
+
(i) => U`
|
|
748
765
|
<div
|
|
749
766
|
class="image-item"
|
|
750
767
|
style="width: ${this.elementWidth}px; height: ${this.elementHeight}px;"
|
|
751
768
|
>
|
|
752
|
-
${
|
|
753
|
-
|
|
769
|
+
${e ? U`<h2
|
|
770
|
+
class="title"
|
|
771
|
+
style="${this.inputData?.labelFontSize ? `font-size: ${this.inputData.labelFontSize}px;` : ""}"
|
|
772
|
+
>
|
|
773
|
+
${i.label ?? ""}
|
|
774
|
+
</h2>` : $}
|
|
775
|
+
<div class="img-container paging" ?active="${i.imageUrl}">
|
|
754
776
|
<img
|
|
755
|
-
src="${
|
|
756
|
-
alt="${
|
|
777
|
+
src="${Zt(i.imageUrl)}"
|
|
778
|
+
alt="${i.label || "Image Widget"}"
|
|
757
779
|
style="object-fit: ${this.inputData?.stretchToFit ? "fill" : "contain"}"
|
|
758
780
|
/>
|
|
759
781
|
</div>
|
|
@@ -764,7 +786,7 @@ let g = class extends H {
|
|
|
764
786
|
`;
|
|
765
787
|
}
|
|
766
788
|
};
|
|
767
|
-
|
|
789
|
+
m.styles = gt`
|
|
768
790
|
:host {
|
|
769
791
|
display: block;
|
|
770
792
|
font-family: sans-serif;
|
|
@@ -855,34 +877,37 @@ g.styles = mt`
|
|
|
855
877
|
justify-content: center;
|
|
856
878
|
}
|
|
857
879
|
`;
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
],
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
],
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
],
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
],
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
],
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
],
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
],
|
|
879
|
-
|
|
880
|
+
g([
|
|
881
|
+
B({ type: Object })
|
|
882
|
+
], m.prototype, "inputData", 2);
|
|
883
|
+
g([
|
|
884
|
+
B({ type: Object })
|
|
885
|
+
], m.prototype, "theme", 2);
|
|
886
|
+
g([
|
|
887
|
+
B({ type: Object })
|
|
888
|
+
], m.prototype, "timeRange", 2);
|
|
889
|
+
g([
|
|
890
|
+
R()
|
|
891
|
+
], m.prototype, "themeBgColor", 2);
|
|
892
|
+
g([
|
|
893
|
+
R()
|
|
894
|
+
], m.prototype, "themeTitleColor", 2);
|
|
895
|
+
g([
|
|
896
|
+
R()
|
|
897
|
+
], m.prototype, "themeSubtitleColor", 2);
|
|
898
|
+
g([
|
|
899
|
+
R()
|
|
900
|
+
], m.prototype, "elementWidth", 2);
|
|
901
|
+
g([
|
|
902
|
+
R()
|
|
903
|
+
], m.prototype, "elementHeight", 2);
|
|
904
|
+
g([
|
|
880
905
|
Yt(".wrapper")
|
|
881
|
-
],
|
|
882
|
-
|
|
883
|
-
Jt("widget-image-1.1.
|
|
884
|
-
],
|
|
906
|
+
], m.prototype, "wrapper", 2);
|
|
907
|
+
m = g([
|
|
908
|
+
Jt("widget-image-1.1.17")
|
|
909
|
+
], m);
|
|
885
910
|
export {
|
|
886
|
-
|
|
911
|
+
m as WidgetImage
|
|
887
912
|
};
|
|
888
913
|
//# sourceMappingURL=widget-image.js.map
|