@record-evolution/widget-overlay 1.0.8 → 1.0.10

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.
@@ -1,719 +1,699 @@
1
- import { css as ve, LitElement as Te, html as y, nothing as P } from "lit";
2
- import { property as te, customElement as Re, state as M, query as ke } from "lit/decorators.js";
3
- const $ = globalThis, u = (o) => {
4
- $.emitLitDebugLogEvents && $.dispatchEvent(new CustomEvent("lit-debug", {
5
- detail: o
6
- }));
1
+ const k = globalThis, J = k.ShadowRoot && (k.ShadyCSS === void 0 || k.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, K = /* @__PURE__ */ Symbol(), lt = /* @__PURE__ */ new WeakMap();
2
+ let _t = class {
3
+ constructor(t, e, s) {
4
+ if (this._$cssResult$ = !0, s !== K) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
+ this.cssText = t, this.t = e;
6
+ }
7
+ get styleSheet() {
8
+ let t = this.o;
9
+ const e = this.t;
10
+ if (J && t === void 0) {
11
+ const s = e !== void 0 && e.length === 1;
12
+ s && (t = lt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && lt.set(e, t));
13
+ }
14
+ return t;
15
+ }
16
+ toString() {
17
+ return this.cssText;
18
+ }
7
19
  };
8
- let I;
9
- $.litIssuedWarnings ??= /* @__PURE__ */ new Set(), I = (o, e) => {
10
- e += o ? ` See https://lit.dev/msg/${o} for more information.` : "", !$.litIssuedWarnings.has(e) && !$.litIssuedWarnings.has(o) && (console.warn(e), $.litIssuedWarnings.add(e));
11
- }, queueMicrotask(() => {
12
- I("dev-mode", "Lit is in dev mode. Not recommended for production!");
13
- });
14
- const x = $.ShadyDOM?.inUse && $.ShadyDOM?.noPatch === !0 ? $.ShadyDOM.wrap : (o) => o, z = $.trustedTypes, pe = z ? z.createPolicy("lit-html", {
15
- createHTML: (o) => o
16
- }) : void 0, De = (o) => o, Ce = (o, e, t) => De, ue = (o, e, t) => j(), Ne = "$lit$", v = `lit$${Math.random().toFixed(9).slice(2)}$`, Se = "?" + v, Ue = `<${Se}>`, V = document, O = () => V.createComment(""), D = (o) => o === null || typeof o != "object" && typeof o != "function", ie = Array.isArray, Ie = (o) => ie(o) || // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
- typeof o?.[Symbol.iterator] == "function", K = `[
18
- \f\r]`, ze = `[^
19
- \f\r"'\`<>=]`, Oe = `[^\\s"'>=/]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, fe = 1, G = 2, He = 3, ge = /-->/g, _e = />/g, S = new RegExp(`>|${K}(?:(${Oe}+)(${K}*=${K}*(?:${ze}|("|')|))|$)`, "g"), Be = 0, ye = 1, je = 2, $e = 3, Y = /'/g, q = /"/g, Ee = /^(?:script|style|textarea|title)$/i, J = 2, ee = 3, se = 1, H = 2, We = 3, Fe = 4, Ke = 5, ne = 6, Ge = 7, N = /* @__PURE__ */ Symbol.for("lit-noChange"), _ = /* @__PURE__ */ Symbol.for("lit-nothing"), be = /* @__PURE__ */ new WeakMap(), A = V.createTreeWalker(
20
- V,
21
- 129
22
- /* NodeFilter.SHOW_{ELEMENT|COMMENT} */
23
- );
24
- let j = Ce;
25
- function Ae(o, e) {
26
- if (!ie(o) || !o.hasOwnProperty("raw")) {
27
- let t = "invalid template strings array";
28
- throw t = `
29
- Internal Error: expected template strings to be an array
30
- with a 'raw' field. Faking a template strings array by
31
- calling html or svg like an ordinary function is effectively
32
- the same as calling unsafeHtml and can lead to major security
33
- issues, e.g. opening your code up to XSS attacks.
34
- If you're using the html or svg tagged template functions normally
35
- and still seeing this error, please file a bug at
36
- https://github.com/lit/lit/issues/new?template=bug_report.md
37
- and include information about your build tooling, if any.
38
- `.trim().replace(/\n */g, `
39
- `), new Error(t);
40
- }
41
- return pe !== void 0 ? pe.createHTML(e) : e;
20
+ const Pt = (r) => new _t(typeof r == "string" ? r : r + "", void 0, K), bt = (r, ...t) => {
21
+ const e = r.length === 1 ? r[0] : t.reduce(((s, i, o) => s + ((n) => {
22
+ if (n._$cssResult$ === !0) return n.cssText;
23
+ if (typeof n == "number") return n;
24
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
25
+ })(i) + r[o + 1]), r[0]);
26
+ return new _t(e, r, K);
27
+ }, Ut = (r, t) => {
28
+ if (J) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
29
+ else for (const e of t) {
30
+ const s = document.createElement("style"), i = k.litNonce;
31
+ i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
32
+ }
33
+ }, ht = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
34
+ let e = "";
35
+ for (const s of t.cssRules) e += s.cssText;
36
+ return Pt(e);
37
+ })(r) : r;
38
+ const { is: Tt, defineProperty: Ot, getOwnPropertyDescriptor: Mt, getOwnPropertyNames: Nt, getOwnPropertySymbols: Ht, getPrototypeOf: Lt } = Object, z = globalThis, ct = z.trustedTypes, Rt = ct ? ct.emptyScript : "", kt = z.reactiveElementPolyfillSupport, N = (r, t) => r, j = { toAttribute(r, t) {
39
+ switch (t) {
40
+ case Boolean:
41
+ r = r ? Rt : null;
42
+ break;
43
+ case Object:
44
+ case Array:
45
+ r = r == null ? r : JSON.stringify(r);
46
+ }
47
+ return r;
48
+ }, fromAttribute(r, t) {
49
+ let e = r;
50
+ switch (t) {
51
+ case Boolean:
52
+ e = r !== null;
53
+ break;
54
+ case Number:
55
+ e = r === null ? null : Number(r);
56
+ break;
57
+ case Object:
58
+ case Array:
59
+ try {
60
+ e = JSON.parse(r);
61
+ } catch {
62
+ e = null;
63
+ }
64
+ }
65
+ return e;
66
+ } }, Q = (r, t) => !Tt(r, t), dt = { attribute: !0, type: String, converter: j, reflect: !1, useDefault: !1, hasChanged: Q };
67
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), z.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
+ let E = class extends HTMLElement {
69
+ static addInitializer(t) {
70
+ this._$Ei(), (this.l ??= []).push(t);
71
+ }
72
+ static get observedAttributes() {
73
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
74
+ }
75
+ static createProperty(t, e = dt) {
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 s = /* @__PURE__ */ Symbol(), i = this.getPropertyDescriptor(t, s, e);
78
+ i !== void 0 && Ot(this.prototype, t, i);
79
+ }
80
+ }
81
+ static getPropertyDescriptor(t, e, s) {
82
+ const { get: i, set: o } = Mt(this.prototype, t) ?? { get() {
83
+ return this[e];
84
+ }, set(n) {
85
+ this[e] = n;
86
+ } };
87
+ return { get: i, set(n) {
88
+ const h = i?.call(this);
89
+ o?.call(this, n), this.requestUpdate(t, h, s);
90
+ }, configurable: !0, enumerable: !0 };
91
+ }
92
+ static getPropertyOptions(t) {
93
+ return this.elementProperties.get(t) ?? dt;
94
+ }
95
+ static _$Ei() {
96
+ if (this.hasOwnProperty(N("elementProperties"))) return;
97
+ const t = Lt(this);
98
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
99
+ }
100
+ static finalize() {
101
+ if (this.hasOwnProperty(N("finalized"))) return;
102
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(N("properties"))) {
103
+ const e = this.properties, s = [...Nt(e), ...Ht(e)];
104
+ for (const i of s) this.createProperty(i, e[i]);
105
+ }
106
+ const t = this[Symbol.metadata];
107
+ if (t !== null) {
108
+ const e = litPropertyMetadata.get(t);
109
+ if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
110
+ }
111
+ this._$Eh = /* @__PURE__ */ new Map();
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
+ }
116
+ this.elementStyles = this.finalizeStyles(this.styles);
117
+ }
118
+ static finalizeStyles(t) {
119
+ const e = [];
120
+ if (Array.isArray(t)) {
121
+ const s = new Set(t.flat(1 / 0).reverse());
122
+ for (const i of s) e.unshift(ht(i));
123
+ } else t !== void 0 && e.push(ht(t));
124
+ return e;
125
+ }
126
+ static _$Eu(t, e) {
127
+ const s = e.attribute;
128
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
129
+ }
130
+ constructor() {
131
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
132
+ }
133
+ _$Ev() {
134
+ this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this)));
135
+ }
136
+ addController(t) {
137
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
138
+ }
139
+ removeController(t) {
140
+ this._$EO?.delete(t);
141
+ }
142
+ _$E_() {
143
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
144
+ for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
145
+ t.size > 0 && (this._$Ep = t);
146
+ }
147
+ createRenderRoot() {
148
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
149
+ return Ut(t, this.constructor.elementStyles), t;
150
+ }
151
+ connectedCallback() {
152
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
153
+ }
154
+ enableUpdating(t) {
155
+ }
156
+ disconnectedCallback() {
157
+ this._$EO?.forEach(((t) => t.hostDisconnected?.()));
158
+ }
159
+ attributeChangedCallback(t, e, s) {
160
+ this._$AK(t, s);
161
+ }
162
+ _$ET(t, e) {
163
+ const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
164
+ if (i !== void 0 && s.reflect === !0) {
165
+ const o = (s.converter?.toAttribute !== void 0 ? s.converter : j).toAttribute(e, s.type);
166
+ this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
167
+ }
168
+ }
169
+ _$AK(t, e) {
170
+ const s = this.constructor, i = s._$Eh.get(t);
171
+ if (i !== void 0 && this._$Em !== i) {
172
+ const o = s.getPropertyOptions(i), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : j;
173
+ this._$Em = i, this[i] = n.fromAttribute(e, o.type) ?? this._$Ej?.get(i) ?? null, this._$Em = null;
174
+ }
175
+ }
176
+ requestUpdate(t, e, s) {
177
+ if (t !== void 0) {
178
+ const i = this.constructor, o = this[t];
179
+ if (s ??= i.getPropertyOptions(t), !((s.hasChanged ?? Q)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
180
+ this.C(t, e, s);
181
+ }
182
+ this.isUpdatePending === !1 && (this._$ES = this._$EP());
183
+ }
184
+ C(t, e, { useDefault: s, reflect: i, wrapped: o }, n) {
185
+ s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== 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
+ }
187
+ async _$EP() {
188
+ this.isUpdatePending = !0;
189
+ try {
190
+ await this._$ES;
191
+ } catch (e) {
192
+ Promise.reject(e);
193
+ }
194
+ const t = this.scheduleUpdate();
195
+ return t != null && await t, !this.isUpdatePending;
196
+ }
197
+ scheduleUpdate() {
198
+ return this.performUpdate();
199
+ }
200
+ performUpdate() {
201
+ if (!this.isUpdatePending) return;
202
+ if (!this.hasUpdated) {
203
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
204
+ for (const [i, o] of this._$Ep) this[i] = o;
205
+ this._$Ep = void 0;
206
+ }
207
+ const s = this.constructor.elementProperties;
208
+ if (s.size > 0) for (const [i, o] of s) {
209
+ const { wrapped: n } = o, h = this[i];
210
+ n !== !0 || this._$AL.has(i) || h === void 0 || this.C(i, void 0, o, h);
211
+ }
212
+ }
213
+ let t = !1;
214
+ const e = this._$AL;
215
+ try {
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
+ }
220
+ t && this._$AE(e);
221
+ }
222
+ willUpdate(t) {
223
+ }
224
+ _$AE(t) {
225
+ this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
226
+ }
227
+ _$EM() {
228
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
229
+ }
230
+ get updateComplete() {
231
+ return this.getUpdateComplete();
232
+ }
233
+ getUpdateComplete() {
234
+ return this._$ES;
235
+ }
236
+ shouldUpdate(t) {
237
+ return !0;
238
+ }
239
+ update(t) {
240
+ this._$Eq &&= this._$Eq.forEach(((e) => this._$ET(e, this[e]))), this._$EM();
241
+ }
242
+ updated(t) {
243
+ }
244
+ firstUpdated(t) {
245
+ }
246
+ };
247
+ E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[N("elementProperties")] = /* @__PURE__ */ new Map(), E[N("finalized")] = /* @__PURE__ */ new Map(), kt?.({ ReactiveElement: E }), (z.reactiveElementVersions ??= []).push("2.1.0");
248
+ const tt = globalThis, D = tt.trustedTypes, pt = D ? D.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, At = "$lit$", b = `lit$${Math.random().toFixed(9).slice(2)}$`, wt = "?" + b, jt = `<${wt}>`, S = document, H = () => S.createComment(""), L = (r) => r === null || typeof r != "object" && typeof r != "function", et = Array.isArray, Dt = (r) => et(r) || typeof r?.[Symbol.iterator] == "function", q = `[
249
+ \f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ut = /-->/g, ft = />/g, A = RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
250
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), $t = /'/g, gt = /"/g, xt = /^(?:script|style|textarea|title)$/i, It = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), g = It(1), y = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), mt = /* @__PURE__ */ new WeakMap(), x = S.createTreeWalker(S, 129);
251
+ function St(r, t) {
252
+ if (!et(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
253
+ return pt !== void 0 ? pt.createHTML(t) : t;
42
254
  }
43
- const Ye = (o, e) => {
44
- const t = o.length - 1, i = [];
45
- let s = e === J ? "<svg>" : e === ee ? "<math>" : "", n, r = R;
46
- for (let a = 0; a < t; a++) {
47
- const c = o[a];
48
- let f = -1, m, d = 0, l;
49
- for (; d < c.length && (r.lastIndex = d, l = r.exec(c), l !== null); )
50
- if (d = r.lastIndex, r === R) {
51
- if (l[fe] === "!--")
52
- r = ge;
53
- else if (l[fe] !== void 0)
54
- r = _e;
55
- else if (l[G] !== void 0)
56
- Ee.test(l[G]) && (n = new RegExp(`</${l[G]}`, "g")), r = S;
57
- else if (l[He] !== void 0)
58
- throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions");
59
- } else r === S ? l[Be] === ">" ? (r = n ?? R, f = -1) : l[ye] === void 0 ? f = -2 : (f = r.lastIndex - l[je].length, m = l[ye], r = l[$e] === void 0 ? S : l[$e] === '"' ? q : Y) : r === q || r === Y ? r = S : r === ge || r === _e ? r = R : (r = S, n = void 0);
60
- console.assert(f === -1 || r === S || r === Y || r === q, "unexpected parse state B");
61
- const p = r === S && o[a + 1].startsWith("/>") ? " " : "";
62
- s += r === R ? c + Ue : f >= 0 ? (i.push(m), c.slice(0, f) + Ne + c.slice(f) + v + p) : c + v + (f === -2 ? a : p);
63
- }
64
- const h = s + (o[t] || "<?>") + (e === J ? "</svg>" : e === ee ? "</math>" : "");
65
- return [Ae(o, h), i];
255
+ const zt = (r, t) => {
256
+ const e = r.length - 1, s = [];
257
+ let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = O;
258
+ for (let h = 0; h < e; h++) {
259
+ const a = r[h];
260
+ let d, u, l = -1, p = 0;
261
+ for (; p < a.length && (n.lastIndex = p, u = n.exec(a), u !== null); ) p = n.lastIndex, n === O ? u[1] === "!--" ? n = ut : u[1] !== void 0 ? n = ft : u[2] !== void 0 ? (xt.test(u[2]) && (i = RegExp("</" + u[2], "g")), n = A) : u[3] !== void 0 && (n = A) : n === A ? u[0] === ">" ? (n = i ?? O, l = -1) : u[1] === void 0 ? l = -2 : (l = n.lastIndex - u[2].length, d = u[1], n = u[3] === void 0 ? A : u[3] === '"' ? gt : $t) : n === gt || n === $t ? n = A : n === ut || n === ft ? n = O : (n = A, i = void 0);
262
+ const c = n === A && r[h + 1].startsWith("/>") ? " " : "";
263
+ o += n === O ? a + jt : l >= 0 ? (s.push(d), a.slice(0, l) + At + a.slice(l) + b + c) : a + b + (l === -2 ? h : c);
264
+ }
265
+ return [St(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
66
266
  };
67
- class U {
68
- constructor({ strings: e, ["_$litType$"]: t }, i) {
267
+ class R {
268
+ constructor({ strings: t, _$litType$: e }, s) {
269
+ let i;
69
270
  this.parts = [];
70
- let s, n = 0, r = 0;
71
- const h = e.length - 1, a = this.parts, [c, f] = Ye(e, t);
72
- if (this.el = U.createElement(c, i), A.currentNode = this.el.content, t === J || t === ee) {
73
- const m = this.el.content.firstChild;
74
- m.replaceWith(...m.childNodes);
271
+ let o = 0, n = 0;
272
+ const h = t.length - 1, a = this.parts, [d, u] = zt(t, e);
273
+ if (this.el = R.createElement(d, s), x.currentNode = this.el.content, e === 2 || e === 3) {
274
+ const l = this.el.content.firstChild;
275
+ l.replaceWith(...l.childNodes);
75
276
  }
76
- for (; (s = A.nextNode()) !== null && a.length < h; ) {
77
- if (s.nodeType === 1) {
78
- {
79
- const m = s.localName;
80
- if (/^(?:textarea|template)$/i.test(m) && s.innerHTML.includes(v)) {
81
- const d = `Expressions are not supported inside \`${m}\` elements. See https://lit.dev/msg/expression-in-${m} for more information.`;
82
- if (m === "template")
83
- throw new Error(d);
84
- I("", d);
85
- }
86
- }
87
- if (s.hasAttributes())
88
- for (const m of s.getAttributeNames())
89
- if (m.endsWith(Ne)) {
90
- const d = f[r++], p = s.getAttribute(m).split(v), g = /([.?@])?(.*)/.exec(d);
91
- a.push({
92
- type: se,
93
- index: n,
94
- name: g[2],
95
- strings: p,
96
- ctor: g[1] === "." ? Ze : g[1] === "?" ? Qe : g[1] === "@" ? Xe : W
97
- }), s.removeAttribute(m);
98
- } else m.startsWith(v) && (a.push({
99
- type: ne,
100
- index: n
101
- }), s.removeAttribute(m));
102
- if (Ee.test(s.tagName)) {
103
- const m = s.textContent.split(v), d = m.length - 1;
104
- if (d > 0) {
105
- s.textContent = z ? z.emptyScript : "";
106
- for (let l = 0; l < d; l++)
107
- s.append(m[l], O()), A.nextNode(), a.push({ type: H, index: ++n });
108
- s.append(m[d], O());
277
+ for (; (i = x.nextNode()) !== null && a.length < h; ) {
278
+ if (i.nodeType === 1) {
279
+ if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(At)) {
280
+ const p = u[n++], c = i.getAttribute(l).split(b), $ = /([.?@])?(.*)/.exec(p);
281
+ a.push({ type: 1, index: o, name: $[2], strings: c, ctor: $[1] === "." ? Vt : $[1] === "?" ? Wt : $[1] === "@" ? qt : B }), i.removeAttribute(l);
282
+ } else l.startsWith(b) && (a.push({ type: 6, index: o }), i.removeAttribute(l));
283
+ if (xt.test(i.tagName)) {
284
+ const l = i.textContent.split(b), p = l.length - 1;
285
+ if (p > 0) {
286
+ i.textContent = D ? D.emptyScript : "";
287
+ for (let c = 0; c < p; c++) i.append(l[c], H()), x.nextNode(), a.push({ type: 2, index: ++o });
288
+ i.append(l[p], H());
109
289
  }
110
290
  }
111
- } else if (s.nodeType === 8)
112
- if (s.data === Se)
113
- a.push({ type: H, index: n });
114
- else {
115
- let d = -1;
116
- for (; (d = s.data.indexOf(v, d + 1)) !== -1; )
117
- a.push({ type: Ge, index: n }), d += v.length - 1;
118
- }
119
- n++;
291
+ } else if (i.nodeType === 8) if (i.data === wt) a.push({ type: 2, index: o });
292
+ else {
293
+ let l = -1;
294
+ for (; (l = i.data.indexOf(b, l + 1)) !== -1; ) a.push({ type: 7, index: o }), l += b.length - 1;
295
+ }
296
+ o++;
120
297
  }
121
- if (f.length !== r)
122
- throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`' + e.join("${...}") + "`");
123
- u && u({
124
- kind: "template prep",
125
- template: this,
126
- clonableTemplate: this.el,
127
- parts: this.parts,
128
- strings: e
129
- });
130
- }
131
- // Overridden via `litHtmlPolyfillSupport` to provide platform support.
132
- /** @nocollapse */
133
- static createElement(e, t) {
134
- const i = V.createElement("template");
135
- return i.innerHTML = e, i;
298
+ }
299
+ static createElement(t, e) {
300
+ const s = S.createElement("template");
301
+ return s.innerHTML = t, s;
136
302
  }
137
303
  }
138
- function L(o, e, t = o, i) {
139
- if (e === N)
140
- return e;
141
- let s = i !== void 0 ? t.__directives?.[i] : t.__directive;
142
- const n = D(e) ? void 0 : (
143
- // This property needs to remain unminified.
144
- e._$litDirective$
145
- );
146
- return s?.constructor !== n && (s?._$notifyDirectiveConnectionChanged?.(!1), n === void 0 ? s = void 0 : (s = new n(o), s._$initialize(o, t, i)), i !== void 0 ? (t.__directives ??= [])[i] = s : t.__directive = s), s !== void 0 && (e = L(o, s._$resolve(o, e.values), s, i)), e;
304
+ function P(r, t, e = r, s) {
305
+ if (t === y) return t;
306
+ let i = s !== void 0 ? e._$Co?.[s] : e._$Cl;
307
+ const o = L(t) ? void 0 : t._$litDirective$;
308
+ return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = i : e._$Cl = i), i !== void 0 && (t = P(r, i._$AS(r, t.values), i, s)), t;
147
309
  }
148
- class qe {
149
- constructor(e, t) {
150
- this._$parts = [], this._$disconnectableChildren = void 0, this._$template = e, this._$parent = t;
310
+ let Bt = class {
311
+ constructor(t, e) {
312
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
151
313
  }
152
- // Called by ChildPart parentNode getter
153
314
  get parentNode() {
154
- return this._$parent.parentNode;
155
- }
156
- // See comment in Disconnectable interface for why this is a getter
157
- get _$isConnected() {
158
- return this._$parent._$isConnected;
159
- }
160
- // This method is separate from the constructor because we need to return a
161
- // DocumentFragment and we don't want to hold onto it with an instance field.
162
- _clone(e) {
163
- const { el: { content: t }, parts: i } = this._$template, s = (e?.creationScope ?? V).importNode(t, !0);
164
- A.currentNode = s;
165
- let n = A.nextNode(), r = 0, h = 0, a = i[0];
315
+ return this._$AM.parentNode;
316
+ }
317
+ get _$AU() {
318
+ return this._$AM._$AU;
319
+ }
320
+ u(t) {
321
+ const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? S).importNode(e, !0);
322
+ x.currentNode = i;
323
+ let o = x.nextNode(), n = 0, h = 0, a = s[0];
166
324
  for (; a !== void 0; ) {
167
- if (r === a.index) {
168
- let c;
169
- a.type === H ? c = new oe(n, n.nextSibling, this, e) : a.type === se ? c = new a.ctor(n, a.name, a.strings, this, e) : a.type === ne && (c = new Je(n, this, e)), this._$parts.push(c), a = i[++h];
325
+ if (n === a.index) {
326
+ let d;
327
+ a.type === 2 ? d = new U(o, o.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (d = new Ft(o, this, t)), this._$AV.push(d), a = s[++h];
170
328
  }
171
- r !== a?.index && (n = A.nextNode(), r++);
329
+ n !== a?.index && (o = x.nextNode(), n++);
172
330
  }
173
- return A.currentNode = V, s;
174
- }
175
- _update(e) {
176
- let t = 0;
177
- for (const i of this._$parts)
178
- i !== void 0 && (u && u({
179
- kind: "set part",
180
- part: i,
181
- value: e[t],
182
- valueIndex: t,
183
- values: e,
184
- templateInstance: this
185
- }), i.strings !== void 0 ? (i._$setValue(e, i, t), t += i.strings.length - 2) : i._$setValue(e[t])), t++;
331
+ return x.currentNode = S, i;
332
+ }
333
+ p(t) {
334
+ let e = 0;
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
+ }
337
+ };
338
+ class U {
339
+ get _$AU() {
340
+ return this._$AM?._$AU ?? this._$Cv;
341
+ }
342
+ constructor(t, e, s, i) {
343
+ this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = i?.isConnected ?? !0;
186
344
  }
187
- }
188
- let oe = class Ve {
189
- // See comment in Disconnectable interface for why this is a getter
190
- get _$isConnected() {
191
- return this._$parent?._$isConnected ?? this.__isConnected;
192
- }
193
- constructor(e, t, i, s) {
194
- this.type = H, this._$committedValue = _, this._$disconnectableChildren = void 0, this._$startNode = e, this._$endNode = t, this._$parent = i, this.options = s, this.__isConnected = s?.isConnected ?? !0, this._textSanitizer = void 0;
195
- }
196
- /**
197
- * The parent node into which the part renders its content.
198
- *
199
- * A ChildPart's content consists of a range of adjacent child nodes of
200
- * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and
201
- * `.endNode`).
202
- *
203
- * - If both `.startNode` and `.endNode` are non-null, then the part's content
204
- * consists of all siblings between `.startNode` and `.endNode`, exclusively.
205
- *
206
- * - If `.startNode` is non-null but `.endNode` is null, then the part's
207
- * content consists of all siblings following `.startNode`, up to and
208
- * including the last child of `.parentNode`. If `.endNode` is non-null, then
209
- * `.startNode` will always be non-null.
210
- *
211
- * - If both `.endNode` and `.startNode` are null, then the part's content
212
- * consists of all child nodes of `.parentNode`.
213
- */
214
345
  get parentNode() {
215
- let e = x(this._$startNode).parentNode;
216
- const t = this._$parent;
217
- return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
218
- }
219
- /**
220
- * The part's leading marker node, if any. See `.parentNode` for more
221
- * information.
222
- */
346
+ let t = this._$AA.parentNode;
347
+ const e = this._$AM;
348
+ return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
349
+ }
223
350
  get startNode() {
224
- return this._$startNode;
351
+ return this._$AA;
225
352
  }
226
- /**
227
- * The part's trailing marker node, if any. See `.parentNode` for more
228
- * information.
229
- */
230
353
  get endNode() {
231
- return this._$endNode;
232
- }
233
- _$setValue(e, t = this) {
234
- if (this.parentNode === null)
235
- throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");
236
- if (e = L(this, e, t), D(e))
237
- e === _ || e == null || e === "" ? (this._$committedValue !== _ && (u && u({
238
- kind: "commit nothing to child",
239
- start: this._$startNode,
240
- end: this._$endNode,
241
- parent: this._$parent,
242
- options: this.options
243
- }), this._$clear()), this._$committedValue = _) : e !== this._$committedValue && e !== N && this._commitText(e);
244
- else if (e._$litType$ !== void 0)
245
- this._commitTemplateResult(e);
246
- else if (e.nodeType !== void 0) {
247
- if (this.options?.host === e) {
248
- this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"), console.warn("Attempted to render the template host", e, "inside itself. This is almost always a mistake, and in dev mode ", "we render some warning text. In production however, we'll ", "render it, which will usually result in an error, and sometimes ", "in the element disappearing from the DOM.");
249
- return;
250
- }
251
- this._commitNode(e);
252
- } else Ie(e) ? this._commitIterable(e) : this._commitText(e);
253
- }
254
- _insert(e) {
255
- return x(x(this._$startNode).parentNode).insertBefore(e, this._$endNode);
256
- }
257
- _commitNode(e) {
258
- if (this._$committedValue !== e) {
259
- if (this._$clear(), j !== Ce) {
260
- const t = this._$startNode.parentNode?.nodeName;
261
- if (t === "STYLE" || t === "SCRIPT") {
262
- let i = "Forbidden";
263
- throw t === "STYLE" ? i = "Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets." : i = "Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.", new Error(i);
264
- }
265
- }
266
- u && u({
267
- kind: "commit node",
268
- start: this._$startNode,
269
- parent: this._$parent,
270
- value: e,
271
- options: this.options
272
- }), this._$committedValue = this._insert(e);
273
- }
354
+ return this._$AB;
274
355
  }
275
- _commitText(e) {
276
- if (this._$committedValue !== _ && D(this._$committedValue)) {
277
- const t = x(this._$startNode).nextSibling;
278
- this._textSanitizer === void 0 && (this._textSanitizer = ue()), e = this._textSanitizer(e), u && u({
279
- kind: "commit text",
280
- node: t,
281
- value: e,
282
- options: this.options
283
- }), t.data = e;
284
- } else {
285
- const t = V.createTextNode("");
286
- this._commitNode(t), this._textSanitizer === void 0 && (this._textSanitizer = ue()), e = this._textSanitizer(e), u && u({
287
- kind: "commit text",
288
- node: t,
289
- value: e,
290
- options: this.options
291
- }), t.data = e;
292
- }
293
- this._$committedValue = e;
294
- }
295
- _commitTemplateResult(e) {
296
- const { values: t, ["_$litType$"]: i } = e, s = typeof i == "number" ? this._$getTemplate(e) : (i.el === void 0 && (i.el = U.createElement(Ae(i.h, i.h[0]), this.options)), i);
297
- if (this._$committedValue?._$template === s)
298
- u && u({
299
- kind: "template updating",
300
- template: s,
301
- instance: this._$committedValue,
302
- parts: this._$committedValue._$parts,
303
- options: this.options,
304
- values: t
305
- }), this._$committedValue._update(t);
356
+ _$AI(t, e = this) {
357
+ t = P(this, t, e), L(t) ? t === f || t == null || t === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : t !== this._$AH && t !== y && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Dt(t) ? this.k(t) : this._(t);
358
+ }
359
+ O(t) {
360
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
361
+ }
362
+ T(t) {
363
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
364
+ }
365
+ _(t) {
366
+ this._$AH !== f && L(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t;
367
+ }
368
+ $(t) {
369
+ const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = R.createElement(St(s.h, s.h[0]), this.options)), s);
370
+ if (this._$AH?._$AD === i) this._$AH.p(e);
306
371
  else {
307
- const n = new qe(s, this), r = n._clone(this.options);
308
- u && u({
309
- kind: "template instantiated",
310
- template: s,
311
- instance: n,
312
- parts: n._$parts,
313
- options: this.options,
314
- fragment: r,
315
- values: t
316
- }), n._update(t), u && u({
317
- kind: "template instantiated and updated",
318
- template: s,
319
- instance: n,
320
- parts: n._$parts,
321
- options: this.options,
322
- fragment: r,
323
- values: t
324
- }), this._commitNode(r), this._$committedValue = n;
372
+ const o = new Bt(i, this), n = o.u(this.options);
373
+ o.p(e), this.T(n), this._$AH = o;
325
374
  }
326
375
  }
327
- // Overridden via `litHtmlPolyfillSupport` to provide platform support.
328
- /** @internal */
329
- _$getTemplate(e) {
330
- let t = be.get(e.strings);
331
- return t === void 0 && be.set(e.strings, t = new U(e)), t;
332
- }
333
- _commitIterable(e) {
334
- ie(this._$committedValue) || (this._$committedValue = [], this._$clear());
335
- const t = this._$committedValue;
336
- let i = 0, s;
337
- for (const n of e)
338
- i === t.length ? t.push(s = new Ve(this._insert(O()), this._insert(O()), this, this.options)) : s = t[i], s._$setValue(n), i++;
339
- i < t.length && (this._$clear(s && x(s._$endNode).nextSibling, i), t.length = i);
340
- }
341
- /**
342
- * Removes the nodes contained within this Part from the DOM.
343
- *
344
- * @param start Start node to clear from, for clearing a subset of the part's
345
- * DOM (used when truncating iterables)
346
- * @param from When `start` is specified, the index within the iterable from
347
- * which ChildParts are being removed, used for disconnecting directives in
348
- * those Parts.
349
- *
350
- * @internal
351
- */
352
- _$clear(e = x(this._$startNode).nextSibling, t) {
353
- for (this._$notifyConnectionChanged?.(!1, !0, t); e && e !== this._$endNode; ) {
354
- const i = x(e).nextSibling;
355
- x(e).remove(), e = i;
376
+ _$AC(t) {
377
+ let e = mt.get(t.strings);
378
+ return e === void 0 && mt.set(t.strings, e = new R(t)), e;
379
+ }
380
+ k(t) {
381
+ et(this._$AH) || (this._$AH = [], this._$AR());
382
+ const e = this._$AH;
383
+ let s, i = 0;
384
+ for (const o of t) i === e.length ? e.push(s = new U(this.O(H()), this.O(H()), this, this.options)) : s = e[i], s._$AI(o), i++;
385
+ i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
386
+ }
387
+ _$AR(t = this._$AA.nextSibling, e) {
388
+ for (this._$AP?.(!1, !0, e); t && t !== this._$AB; ) {
389
+ const s = t.nextSibling;
390
+ t.remove(), t = s;
356
391
  }
357
392
  }
358
- /**
359
- * Implementation of RootPart's `isConnected`. Note that this method
360
- * should only be called on `RootPart`s (the `ChildPart` returned from a
361
- * top-level `render()` call). It has no effect on non-root ChildParts.
362
- * @param isConnected Whether to set
363
- * @internal
364
- */
365
- setConnected(e) {
366
- if (this._$parent === void 0)
367
- this.__isConnected = e, this._$notifyConnectionChanged?.(e);
368
- else
369
- throw new Error("part.setConnected() may only be called on a RootPart returned from render().");
393
+ setConnected(t) {
394
+ this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
370
395
  }
371
- };
372
- class W {
396
+ }
397
+ class B {
373
398
  get tagName() {
374
399
  return this.element.tagName;
375
400
  }
376
- // See comment in Disconnectable interface for why this is a getter
377
- get _$isConnected() {
378
- return this._$parent._$isConnected;
379
- }
380
- constructor(e, t, i, s, n) {
381
- this.type = se, this._$committedValue = _, this._$disconnectableChildren = void 0, this.element = e, this.name = t, this._$parent = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$committedValue = new Array(i.length - 1).fill(new String()), this.strings = i) : this._$committedValue = _, this._sanitizer = void 0;
382
- }
383
- /**
384
- * Sets the value of this part by resolving the value from possibly multiple
385
- * values and static strings and committing it to the DOM.
386
- * If this part is single-valued, `this._strings` will be undefined, and the
387
- * method will be called with a single value argument. If this part is
388
- * multi-value, `this._strings` will be defined, and the method is called
389
- * with the value array of the part's owning TemplateInstance, and an offset
390
- * into the value array from which the values should be read.
391
- * This method is overloaded this way to eliminate short-lived array slices
392
- * of the template instance values, and allow a fast-path for single-valued
393
- * parts.
394
- *
395
- * @param value The part value, or an array of values for multi-valued parts
396
- * @param valueIndex the index to start reading values from. `undefined` for
397
- * single-valued parts
398
- * @param noCommit causes the part to not commit its value to the DOM. Used
399
- * in hydration to prime attribute parts with their first-rendered value,
400
- * but not set the attribute, and in SSR to no-op the DOM operation and
401
- * capture the value for serialization.
402
- *
403
- * @internal
404
- */
405
- _$setValue(e, t = this, i, s) {
406
- const n = this.strings;
407
- let r = !1;
408
- if (n === void 0)
409
- e = L(this, e, t, 0), r = !D(e) || e !== this._$committedValue && e !== N, r && (this._$committedValue = e);
401
+ get _$AU() {
402
+ return this._$AM._$AU;
403
+ }
404
+ constructor(t, e, s, i, o) {
405
+ this.type = 1, this._$AH = f, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = f;
406
+ }
407
+ _$AI(t, e = this, s, i) {
408
+ const o = this.strings;
409
+ let n = !1;
410
+ if (o === void 0) t = P(this, t, e, 0), n = !L(t) || t !== this._$AH && t !== y, n && (this._$AH = t);
410
411
  else {
411
- const h = e;
412
- e = n[0];
413
- let a, c;
414
- for (a = 0; a < n.length - 1; a++)
415
- c = L(this, h[i + a], t, a), c === N && (c = this._$committedValue[a]), r ||= !D(c) || c !== this._$committedValue[a], c === _ ? e = _ : e !== _ && (e += (c ?? "") + n[a + 1]), this._$committedValue[a] = c;
412
+ const h = t;
413
+ let a, d;
414
+ for (t = o[0], a = 0; a < o.length - 1; a++) d = P(this, h[s + a], e, a), d === y && (d = this._$AH[a]), n ||= !L(d) || d !== this._$AH[a], d === f ? t = f : t !== f && (t += (d ?? "") + o[a + 1]), this._$AH[a] = d;
416
415
  }
417
- r && !s && this._commitValue(e);
418
- }
419
- /** @internal */
420
- _commitValue(e) {
421
- e === _ ? x(this.element).removeAttribute(this.name) : (this._sanitizer === void 0 && (this._sanitizer = j(this.element, this.name)), e = this._sanitizer(e ?? ""), u && u({
422
- kind: "commit attribute",
423
- element: this.element,
424
- name: this.name,
425
- value: e,
426
- options: this.options
427
- }), x(this.element).setAttribute(this.name, e ?? ""));
416
+ n && !i && this.j(t);
417
+ }
418
+ j(t) {
419
+ t === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
428
420
  }
429
421
  }
430
- class Ze extends W {
422
+ class Vt extends B {
431
423
  constructor() {
432
- super(...arguments), this.type = We;
433
- }
434
- /** @internal */
435
- _commitValue(e) {
436
- this._sanitizer === void 0 && (this._sanitizer = j(this.element, this.name)), e = this._sanitizer(e), u && u({
437
- kind: "commit property",
438
- element: this.element,
439
- name: this.name,
440
- value: e,
441
- options: this.options
442
- }), this.element[this.name] = e === _ ? void 0 : e;
424
+ super(...arguments), this.type = 3;
425
+ }
426
+ j(t) {
427
+ this.element[this.name] = t === f ? void 0 : t;
443
428
  }
444
429
  }
445
- class Qe extends W {
430
+ class Wt extends B {
446
431
  constructor() {
447
- super(...arguments), this.type = Fe;
448
- }
449
- /** @internal */
450
- _commitValue(e) {
451
- u && u({
452
- kind: "commit boolean attribute",
453
- element: this.element,
454
- name: this.name,
455
- value: !!(e && e !== _),
456
- options: this.options
457
- }), x(this.element).toggleAttribute(this.name, !!e && e !== _);
432
+ super(...arguments), this.type = 4;
433
+ }
434
+ j(t) {
435
+ this.element.toggleAttribute(this.name, !!t && t !== f);
458
436
  }
459
437
  }
460
- class Xe extends W {
461
- constructor(e, t, i, s, n) {
462
- if (super(e, t, i, s, n), this.type = Ke, this.strings !== void 0)
463
- throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`);
464
- }
465
- // EventPart does not use the base _$setValue/_resolveValue implementation
466
- // since the dirty checking is more complex
467
- /** @internal */
468
- _$setValue(e, t = this) {
469
- if (e = L(this, e, t, 0) ?? _, e === N)
470
- return;
471
- const i = this._$committedValue, s = e === _ && i !== _ || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, n = e !== _ && (i === _ || s);
472
- u && u({
473
- kind: "commit event listener",
474
- element: this.element,
475
- name: this.name,
476
- value: e,
477
- options: this.options,
478
- removeListener: s,
479
- addListener: n,
480
- oldListener: i
481
- }), s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, e), this._$committedValue = e;
482
- }
483
- handleEvent(e) {
484
- typeof this._$committedValue == "function" ? this._$committedValue.call(this.options?.host ?? this.element, e) : this._$committedValue.handleEvent(e);
438
+ class qt extends B {
439
+ constructor(t, e, s, i, o) {
440
+ super(t, e, s, i, o), this.type = 5;
441
+ }
442
+ _$AI(t, e = this) {
443
+ if ((t = P(this, t, e, 0) ?? f) === y) return;
444
+ const s = this._$AH, i = t === f && s !== f || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== f && (s === f || i);
445
+ i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
446
+ }
447
+ handleEvent(t) {
448
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
485
449
  }
486
450
  }
487
- class Je {
488
- constructor(e, t, i) {
489
- this.element = e, this.type = ne, this._$disconnectableChildren = void 0, this._$parent = t, this.options = i;
490
- }
491
- // See comment in Disconnectable interface for why this is a getter
492
- get _$isConnected() {
493
- return this._$parent._$isConnected;
494
- }
495
- _$setValue(e) {
496
- u && u({
497
- kind: "commit to element binding",
498
- element: this.element,
499
- value: e,
500
- options: this.options
501
- }), L(this, e);
451
+ class Ft {
452
+ constructor(t, e, s) {
453
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
454
+ }
455
+ get _$AU() {
456
+ return this._$AM._$AU;
457
+ }
458
+ _$AI(t) {
459
+ P(this, t);
502
460
  }
503
461
  }
504
- const et = {
505
- _ChildPart: oe
506
- }, tt = $.litHtmlPolyfillSupportDevMode;
507
- tt?.(U, oe);
508
- ($.litHtmlVersions ??= []).push("3.3.0");
509
- $.litHtmlVersions.length > 1 && queueMicrotask(() => {
510
- I("multiple-versions", "Multiple versions of Lit loaded. Loading multiple versions is not recommended.");
511
- });
512
- const re = {
513
- ATTRIBUTE: 1,
514
- CHILD: 2
515
- }, ae = (o) => (...e) => ({
516
- // This property needs to remain unminified.
517
- _$litDirective$: o,
518
- values: e
519
- });
520
- class le {
521
- constructor(e) {
462
+ const Zt = { I: U }, Xt = tt.litHtmlPolyfillSupport;
463
+ Xt?.(R, U), (tt.litHtmlVersions ??= []).push("3.3.0");
464
+ const Yt = (r, t, e) => {
465
+ const s = e?.renderBefore ?? t;
466
+ let i = s._$litPart$;
467
+ if (i === void 0) {
468
+ const o = e?.renderBefore ?? null;
469
+ s._$litPart$ = i = new U(t.insertBefore(H(), o), o, void 0, e ?? {});
470
+ }
471
+ return i._$AI(r), i;
472
+ };
473
+ const st = globalThis;
474
+ let C = class extends E {
475
+ constructor() {
476
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
522
477
  }
523
- // See comment in Disconnectable interface for why this is a getter
524
- get _$isConnected() {
525
- return this._$parent._$isConnected;
478
+ createRenderRoot() {
479
+ const t = super.createRenderRoot();
480
+ return this.renderOptions.renderBefore ??= t.firstChild, t;
526
481
  }
527
- /** @internal */
528
- _$initialize(e, t, i) {
529
- this.__part = e, this._$parent = t, this.__attributeIndex = i;
482
+ update(t) {
483
+ const e = this.render();
484
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Yt(e, this.renderRoot, this.renderOptions);
530
485
  }
531
- /** @internal */
532
- _$resolve(e, t) {
533
- return this.update(e, t);
486
+ connectedCallback() {
487
+ super.connectedCallback(), this._$Do?.setConnected(!0);
534
488
  }
535
- update(e, t) {
536
- return this.render(...t);
489
+ disconnectedCallback() {
490
+ super.disconnectedCallback(), this._$Do?.setConnected(!1);
537
491
  }
492
+ render() {
493
+ return y;
494
+ }
495
+ };
496
+ C._$litElement$ = !0, C.finalized = !0, st.litElementHydrateSupport?.({ LitElement: C });
497
+ const Gt = st.litElementPolyfillSupport;
498
+ Gt?.({ LitElement: C });
499
+ (st.litElementVersions ??= []).push("4.2.0");
500
+ const Jt = (r) => (t, e) => {
501
+ e !== void 0 ? e.addInitializer((() => {
502
+ customElements.define(r, t);
503
+ })) : customElements.define(r, t);
504
+ };
505
+ const Kt = { attribute: !0, type: String, converter: j, reflect: !1, hasChanged: Q }, Qt = (r = Kt, t, e) => {
506
+ const { kind: s, metadata: i } = e;
507
+ let o = globalThis.litPropertyMetadata.get(i);
508
+ if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), o.set(e.name, r), s === "accessor") {
509
+ const { name: n } = e;
510
+ return { set(h) {
511
+ const a = t.get.call(this);
512
+ t.set.call(this, h), this.requestUpdate(n, a, r);
513
+ }, init(h) {
514
+ return h !== void 0 && this.C(n, void 0, r, h), h;
515
+ } };
516
+ }
517
+ if (s === "setter") {
518
+ const { name: n } = e;
519
+ return function(h) {
520
+ const a = this[n];
521
+ t.call(this, h), this.requestUpdate(n, a, r);
522
+ };
523
+ }
524
+ throw Error("Unsupported decorator location: " + s);
525
+ };
526
+ function V(r) {
527
+ return (t, e) => typeof e == "object" ? Qt(r, t, e) : ((s, i, o) => {
528
+ const n = i.hasOwnProperty(o);
529
+ return i.constructor.createProperty(o, s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
530
+ })(r, t, e);
531
+ }
532
+ function T(r) {
533
+ return V({ ...r, state: !0, attribute: !1 });
538
534
  }
539
- const Le = "important", Me = " !" + Le, it = 0 - Me.length;
540
- class st extends le {
541
- constructor(e) {
542
- if (super(e), e.type !== re.ATTRIBUTE || e.name !== "style" || e.strings?.length > 2)
543
- throw new Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
544
- }
545
- render(e) {
546
- return Object.keys(e).reduce((t, i) => {
547
- const s = e[i];
548
- return s == null ? t : (i = i.includes("-") ? i : i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase(), t + `${i}:${s};`);
549
- }, "");
550
- }
551
- update(e, [t]) {
552
- const { style: i } = e.element;
553
- if (this._previousStyleProperties === void 0)
554
- return this._previousStyleProperties = new Set(Object.keys(t)), this.render(t);
555
- for (const s of this._previousStyleProperties)
556
- t[s] == null && (this._previousStyleProperties.delete(s), s.includes("-") ? i.removeProperty(s) : i[s] = null);
535
+ const te = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(r, t, e), e);
536
+ function ee(r, t) {
537
+ return (e, s, i) => {
538
+ const o = (n) => n.renderRoot?.querySelector(r) ?? null;
539
+ return te(e, s, { get() {
540
+ return o(this);
541
+ } });
542
+ };
543
+ }
544
+ const it = { ATTRIBUTE: 1, CHILD: 2 }, rt = (r) => (...t) => ({ _$litDirective$: r, values: t });
545
+ let ot = class {
546
+ constructor(t) {
547
+ }
548
+ get _$AU() {
549
+ return this._$AM._$AU;
550
+ }
551
+ _$AT(t, e, s) {
552
+ this._$Ct = t, this._$AM = e, this._$Ci = s;
553
+ }
554
+ _$AS(t, e) {
555
+ return this.update(t, e);
556
+ }
557
+ update(t, e) {
558
+ return this.render(...e);
559
+ }
560
+ };
561
+ const Et = "important", se = " !" + Et, F = rt(class extends ot {
562
+ constructor(r) {
563
+ if (super(r), r.type !== it.ATTRIBUTE || r.name !== "style" || r.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
564
+ }
565
+ render(r) {
566
+ return Object.keys(r).reduce(((t, e) => {
567
+ const s = r[e];
568
+ return s == null ? t : t + `${e = e.includes("-") ? e : e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
569
+ }), "");
570
+ }
571
+ update(r, [t]) {
572
+ const { style: e } = r.element;
573
+ if (this.ft === void 0) return this.ft = new Set(Object.keys(t)), this.render(t);
574
+ for (const s of this.ft) t[s] == null && (this.ft.delete(s), s.includes("-") ? e.removeProperty(s) : e[s] = null);
557
575
  for (const s in t) {
558
- const n = t[s];
559
- if (n != null) {
560
- this._previousStyleProperties.add(s);
561
- const r = typeof n == "string" && n.endsWith(Me);
562
- s.includes("-") || r ? i.setProperty(s, r ? n.slice(0, it) : n, r ? Le : "") : i[s] = n;
576
+ const i = t[s];
577
+ if (i != null) {
578
+ this.ft.add(s);
579
+ const o = typeof i == "string" && i.endsWith(se);
580
+ s.includes("-") || o ? e.setProperty(s, o ? i.slice(0, -11) : i, o ? Et : "") : e[s] = i;
563
581
  }
564
582
  }
565
- return N;
583
+ return y;
566
584
  }
567
- }
568
- const Z = ae(st);
569
- const nt = 1;
570
- class de extends le {
571
- constructor(e) {
572
- if (super(e), this._value = _, e.type !== re.CHILD)
573
- throw new Error(`${this.constructor.directiveName}() can only be used in child bindings`);
574
- }
575
- render(e) {
576
- if (e === _ || e == null)
577
- return this._templateResult = void 0, this._value = e;
578
- if (e === N)
579
- return e;
580
- if (typeof e != "string")
581
- throw new Error(`${this.constructor.directiveName}() called with a non-string value`);
582
- if (e === this._value)
583
- return this._templateResult;
584
- this._value = e;
585
- const t = [e];
586
- return t.raw = t, this._templateResult = {
587
- // Cast to a known set of integers that satisfy ResultType so that we
588
- // don't have to export ResultType and possibly encourage this pattern.
589
- // This property needs to remain unminified.
590
- _$litType$: this.constructor.resultType,
591
- strings: t,
592
- values: []
593
- };
585
+ });
586
+ class Y extends ot {
587
+ constructor(t) {
588
+ if (super(t), this.it = f, t.type !== it.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
589
+ }
590
+ render(t) {
591
+ if (t === f || t == null) return this._t = void 0, this.it = t;
592
+ if (t === y) return t;
593
+ if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
594
+ if (t === this.it) return this._t;
595
+ this.it = t;
596
+ const e = [t];
597
+ return e.raw = e, this._t = { _$litType$: this.constructor.resultType, strings: e, values: [] };
594
598
  }
595
599
  }
596
- de.directiveName = "unsafeHTML";
597
- de.resultType = nt;
598
- const ot = 2;
599
- class ce extends de {
600
- }
601
- ce.directiveName = "unsafeSVG";
602
- ce.resultType = ot;
603
- const rt = ae(ce);
604
- const { _ChildPart: at } = et, T = window.ShadyDOM?.inUse && window.ShadyDOM?.noPatch === !0 ? window.ShadyDOM.wrap : (o) => o, xe = () => document.createComment(""), k = (o, e, t) => {
605
- const i = T(o._$startNode).parentNode, s = e === void 0 ? o._$endNode : e._$startNode;
606
- if (t === void 0) {
607
- const n = T(i).insertBefore(xe(), s), r = T(i).insertBefore(xe(), s);
608
- t = new at(n, r, o, o.options);
600
+ Y.directiveName = "unsafeHTML", Y.resultType = 1;
601
+ let G = class extends Y {
602
+ };
603
+ G.directiveName = "unsafeSVG", G.resultType = 2;
604
+ const ie = rt(G);
605
+ const { I: re } = Zt, vt = () => document.createComment(""), M = (r, t, e) => {
606
+ const s = r._$AA.parentNode, i = t === void 0 ? r._$AB : t._$AA;
607
+ if (e === void 0) {
608
+ const o = s.insertBefore(vt(), i), n = s.insertBefore(vt(), i);
609
+ e = new re(o, n, r, r.options);
609
610
  } else {
610
- const n = T(t._$endNode).nextSibling, r = t._$parent, h = r !== o;
611
+ const o = e._$AB.nextSibling, n = e._$AM, h = n !== r;
611
612
  if (h) {
612
- t._$reparentDisconnectables?.(o), t._$parent = o;
613
613
  let a;
614
- t._$notifyConnectionChanged !== void 0 && (a = o._$isConnected) !== r._$isConnected && t._$notifyConnectionChanged(a);
614
+ e._$AQ?.(r), e._$AM = r, e._$AP !== void 0 && (a = r._$AU) !== n._$AU && e._$AP(a);
615
615
  }
616
- if (n !== s || h) {
617
- let a = t._$startNode;
618
- for (; a !== n; ) {
619
- const c = T(a).nextSibling;
620
- T(i).insertBefore(a, s), a = c;
616
+ if (o !== i || h) {
617
+ let a = e._$AA;
618
+ for (; a !== o; ) {
619
+ const d = a.nextSibling;
620
+ s.insertBefore(a, i), a = d;
621
621
  }
622
622
  }
623
623
  }
624
- return t;
625
- }, E = (o, e, t = o) => (o._$setValue(e, t), o), lt = {}, dt = (o, e = lt) => o._$committedValue = e, ct = (o) => o._$committedValue, Q = (o) => {
626
- o._$notifyConnectionChanged?.(!1, !0);
627
- let e = o._$startNode;
628
- const t = T(o._$endNode).nextSibling;
629
- for (; e !== t; ) {
630
- const i = T(e).nextSibling;
631
- T(e).remove(), e = i;
624
+ return e;
625
+ }, w = (r, t, e = r) => (r._$AI(t, e), r), oe = {}, ne = (r, t = oe) => r._$AH = t, ae = (r) => r._$AH, Z = (r) => {
626
+ r._$AP?.(!1, !0);
627
+ let t = r._$AA;
628
+ const e = r._$AB.nextSibling;
629
+ for (; t !== e; ) {
630
+ const s = t.nextSibling;
631
+ t.remove(), t = s;
632
632
  }
633
633
  };
634
- const we = (o, e, t) => {
635
- const i = /* @__PURE__ */ new Map();
636
- for (let s = e; s <= t; s++)
637
- i.set(o[s], s);
638
- return i;
639
- };
640
- class ht extends le {
641
- constructor(e) {
642
- if (super(e), e.type !== re.CHILD)
643
- throw new Error("repeat() can only be used in text expressions");
644
- }
645
- _getValuesAndKeys(e, t, i) {
634
+ const yt = (r, t, e) => {
635
+ const s = /* @__PURE__ */ new Map();
636
+ for (let i = t; i <= e; i++) s.set(r[i], i);
637
+ return s;
638
+ }, X = rt(class extends ot {
639
+ constructor(r) {
640
+ if (super(r), r.type !== it.CHILD) throw Error("repeat() can only be used in text expressions");
641
+ }
642
+ dt(r, t, e) {
646
643
  let s;
647
- i === void 0 ? i = t : t !== void 0 && (s = t);
648
- const n = [], r = [];
649
- let h = 0;
650
- for (const a of e)
651
- n[h] = s ? s(a, h) : h, r[h] = i(a, h), h++;
652
- return {
653
- values: r,
654
- keys: n
655
- };
656
- }
657
- render(e, t, i) {
658
- return this._getValuesAndKeys(e, t, i).values;
659
- }
660
- update(e, [t, i, s]) {
661
- const n = ct(e), { values: r, keys: h } = this._getValuesAndKeys(t, i, s);
662
- if (!Array.isArray(n))
663
- return this._itemKeys = h, r;
664
- const a = this._itemKeys ??= [], c = [];
665
- let f, m, d = 0, l = n.length - 1, p = 0, g = r.length - 1;
666
- for (; d <= l && p <= g; )
667
- if (n[d] === null)
668
- d++;
669
- else if (n[l] === null)
670
- l--;
671
- else if (a[d] === h[p])
672
- c[p] = E(n[d], r[p]), d++, p++;
673
- else if (a[l] === h[g])
674
- c[g] = E(n[l], r[g]), l--, g--;
675
- else if (a[d] === h[g])
676
- c[g] = E(n[d], r[g]), k(e, c[g + 1], n[d]), d++, g--;
677
- else if (a[l] === h[p])
678
- c[p] = E(n[l], r[p]), k(e, n[d], n[l]), l--, p++;
679
- else if (f === void 0 && (f = we(h, p, g), m = we(a, d, l)), !f.has(a[d]))
680
- Q(n[d]), d++;
681
- else if (!f.has(a[l]))
682
- Q(n[l]), l--;
683
- else {
684
- const w = m.get(h[p]), F = w !== void 0 ? n[w] : null;
685
- if (F === null) {
686
- const me = k(e, n[d]);
687
- E(me, r[p]), c[p] = me;
688
- } else
689
- c[p] = E(F, r[p]), k(e, n[d], F), n[w] = null;
690
- p++;
691
- }
692
- for (; p <= g; ) {
693
- const w = k(e, c[g + 1]);
694
- E(w, r[p]), c[p++] = w;
644
+ e === void 0 ? e = t : t !== void 0 && (s = t);
645
+ const i = [], o = [];
646
+ let n = 0;
647
+ for (const h of r) i[n] = s ? s(h, n) : n, o[n] = e(h, n), n++;
648
+ return { values: o, keys: i };
649
+ }
650
+ render(r, t, e) {
651
+ return this.dt(r, t, e).values;
652
+ }
653
+ update(r, [t, e, s]) {
654
+ const i = ae(r), { values: o, keys: n } = this.dt(t, e, s);
655
+ if (!Array.isArray(i)) return this.ut = n, o;
656
+ const h = this.ut ??= [], a = [];
657
+ let d, u, l = 0, p = i.length - 1, c = 0, $ = o.length - 1;
658
+ for (; l <= p && c <= $; ) if (i[l] === null) l++;
659
+ else if (i[p] === null) p--;
660
+ else if (h[l] === n[c]) a[c] = w(i[l], o[c]), l++, c++;
661
+ else if (h[p] === n[$]) a[$] = w(i[p], o[$]), p--, $--;
662
+ else if (h[l] === n[$]) a[$] = w(i[l], o[$]), M(r, a[$ + 1], i[l]), l++, $--;
663
+ else if (h[p] === n[c]) a[c] = w(i[p], o[c]), M(r, i[l], i[p]), p--, c++;
664
+ else if (d === void 0 && (d = yt(n, c, $), u = yt(h, l, p)), d.has(h[l])) if (d.has(h[p])) {
665
+ const m = u.get(n[c]), W = m !== void 0 ? i[m] : null;
666
+ if (W === null) {
667
+ const at = M(r, i[l]);
668
+ w(at, o[c]), a[c] = at;
669
+ } else a[c] = w(W, o[c]), M(r, i[l], W), i[m] = null;
670
+ c++;
671
+ } else Z(i[p]), p--;
672
+ else Z(i[l]), l++;
673
+ for (; c <= $; ) {
674
+ const m = M(r, a[$ + 1]);
675
+ w(m, o[c]), a[c++] = m;
695
676
  }
696
- for (; d <= l; ) {
697
- const w = n[d++];
698
- w !== null && Q(w);
677
+ for (; l <= p; ) {
678
+ const m = i[l++];
679
+ m !== null && Z(m);
699
680
  }
700
- return this._itemKeys = h, dt(e, c), N;
681
+ return this.ut = n, ne(r, a), y;
701
682
  }
702
- }
703
- const X = ae(ht);
704
- var mt = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, Pe = (o, e, t, i) => {
705
- for (var s = i > 1 ? void 0 : i ? pt(e, t) : e, n = o.length - 1, r; n >= 0; n--)
706
- (r = o[n]) && (s = (i ? r(e, t, s) : r(s)) || s);
707
- return i && s && mt(e, t, s), s;
683
+ });
684
+ var le = Object.defineProperty, he = Object.getOwnPropertyDescriptor, Ct = (r, t, e, s) => {
685
+ for (var i = s > 1 ? void 0 : s ? he(t, e) : t, o = r.length - 1, n; o >= 0; o--)
686
+ (n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i);
687
+ return s && i && le(t, e, i), i;
708
688
  };
709
- let B = class extends Te {
689
+ let I = class extends C {
710
690
  render() {
711
- return y`
712
- ${this.value !== void 0 ? y`<div class="bar" style="width: ${this.value * 100}%;"></div>` : y`<div class="indeterminate"></div>`}
691
+ return g`
692
+ ${this.value !== void 0 ? g`<div class="bar" style="width: ${this.value * 100}%;"></div>` : g`<div class="indeterminate"></div>`}
713
693
  `;
714
694
  }
715
695
  };
716
- B.styles = ve`
696
+ I.styles = bt`
717
697
  :host {
718
698
  display: inline-block;
719
699
  width: var(--progress-width, 200px);
@@ -755,36 +735,36 @@ B.styles = ve`
755
735
  }
756
736
  }
757
737
  `;
758
- Pe([
759
- te({ type: Number })
760
- ], B.prototype, "value", 2);
761
- B = Pe([
762
- Re("linear-progress")
763
- ], B);
764
- var ut = Object.defineProperty, C = (o, e, t, i) => {
765
- for (var s = void 0, n = o.length - 1, r; n >= 0; n--)
766
- (r = o[n]) && (s = r(e, t, s) || s);
767
- return s && ut(e, t, s), s;
738
+ Ct([
739
+ V({ type: Number })
740
+ ], I.prototype, "value", 2);
741
+ I = Ct([
742
+ Jt("linear-progress")
743
+ ], I);
744
+ var ce = Object.defineProperty, _ = (r, t, e, s) => {
745
+ for (var i = void 0, o = r.length - 1, n; o >= 0; o--)
746
+ (n = r[o]) && (i = n(t, e, i) || i);
747
+ return i && ce(t, e, i), i;
768
748
  };
769
- const he = class he extends Te {
749
+ const nt = class nt extends C {
770
750
  constructor() {
771
- super(), this.version = "1.0.8", this.getModifier = this.getModifier.bind(this);
751
+ super(), this.version = "1.0.10", this.getModifier = this.getModifier.bind(this);
772
752
  }
773
- update(e) {
774
- e.has("inputData") && (this.transform(), this.modifier || this.getModifier()), e.has("theme") && this.registerTheme(this.theme), super.update(e);
753
+ update(t) {
754
+ t.has("inputData") && (this.transform(), this.modifier || this.getModifier()), t.has("theme") && this.registerTheme(this.theme), super.update(t);
775
755
  }
776
- firstUpdated(e) {
756
+ firstUpdated(t) {
777
757
  this.registerTheme(this.theme), new ResizeObserver(this.getModifier).observe(this);
778
758
  }
779
- registerTheme(e) {
780
- const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), i = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
781
- this.themeBgColor = i || 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;
759
+ registerTheme(t) {
760
+ const e = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), s = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
761
+ this.themeBgColor = s || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = e || this.theme?.theme_object?.title?.textStyle?.color, this.themeSubtitleColor = e || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor;
782
762
  }
783
- handleFileChange(e) {
784
- const i = e.target.files?.[0];
785
- i && (this.previewUrl && URL.revokeObjectURL(this.previewUrl), this.previewUrl = URL.createObjectURL(i), this.dispatchEvent(
763
+ handleFileChange(t) {
764
+ const s = t.target.files?.[0];
765
+ s && (this.previewUrl && URL.revokeObjectURL(this.previewUrl), this.previewUrl = URL.createObjectURL(s), this.dispatchEvent(
786
766
  new CustomEvent("overlay-file-selected", {
787
- detail: { file: i, name: i.name, size: i.size, type: i.type, url: this.previewUrl },
767
+ detail: { file: s, name: s.name, size: s.size, type: s.type, url: this.previewUrl },
788
768
  bubbles: !0,
789
769
  composed: !0
790
770
  })
@@ -795,29 +775,29 @@ const he = class he extends Te {
795
775
  this.previewUrl = void 0;
796
776
  return;
797
777
  }
798
- const e = this.inputData.image.trim(), i = e.replace(/^\uFEFF/, "").trimStart().match(/<svg[\s\S]*?<\/svg>/i);
799
- if (i) {
800
- this.inlineSvg = i[0].trim(), this.previewUrl = void 0;
778
+ const t = this.inputData.image.trim(), s = t.replace(/^\uFEFF/, "").trimStart().match(/<svg[\s\S]*?<\/svg>/i);
779
+ if (s) {
780
+ this.inlineSvg = s[0].trim(), this.previewUrl = void 0;
801
781
  return;
802
782
  }
803
- if (/^data:image\/svg\+xml[,;]/.test(e)) {
804
- this.previewUrl = e;
783
+ if (/^data:image\/svg\+xml[,;]/.test(t)) {
784
+ this.previewUrl = t;
805
785
  return;
806
786
  }
807
- if (/^data:image\/[a-zA-Z.+-]+;base64,/.test(e)) {
808
- this.previewUrl = e;
787
+ if (/^data:image\/[a-zA-Z.+-]+;base64,/.test(t)) {
788
+ this.previewUrl = t;
809
789
  return;
810
790
  }
811
- if (/^[A-Za-z0-9+/]+=*$/.test(e) && e.length > 100) {
812
- this.previewUrl = `data:image/*;base64,${e}`;
791
+ if (/^[A-Za-z0-9+/]+=*$/.test(t) && t.length > 100) {
792
+ this.previewUrl = `data:image/*;base64,${t}`;
813
793
  return;
814
794
  }
815
795
  try {
816
- new URL(e), this.previewUrl = e;
796
+ new URL(t), this.previewUrl = t;
817
797
  return;
818
798
  } catch {
819
- if (/^([./]|\/)/.test(e)) {
820
- this.previewUrl = e;
799
+ if (/^([./]|\/)/.test(t)) {
800
+ this.previewUrl = t;
821
801
  return;
822
802
  }
823
803
  }
@@ -825,117 +805,117 @@ const he = class he extends Te {
825
805
  }
826
806
  async getModifier() {
827
807
  if (!this.baseLayer) return;
828
- const e = this.baseLayer.getBoundingClientRect();
829
- if (!e) return;
830
- const t = this.baseLayer.parentElement?.getBoundingClientRect();
808
+ const t = this.baseLayer.getBoundingClientRect();
831
809
  if (!t) return;
832
- let i, s;
810
+ const e = this.baseLayer.parentElement?.getBoundingClientRect();
811
+ if (!e) return;
812
+ let s, i;
833
813
  if (this.baseLayer instanceof HTMLImageElement)
834
- i = this.baseLayer.naturalWidth, s = this.baseLayer.naturalHeight;
814
+ s = this.baseLayer.naturalWidth, i = this.baseLayer.naturalHeight;
835
815
  else {
836
- const d = this.baseLayer.querySelector("svg");
837
- if (d) {
838
- const l = d.viewBox.baseVal;
839
- if (console.log(l), l && l.width > 0 && l.height > 0)
840
- i = l.width, s = l.height;
816
+ const p = this.baseLayer.querySelector("svg");
817
+ if (p) {
818
+ const c = p.viewBox.baseVal;
819
+ if (console.log(c), c && c.width > 0 && c.height > 0)
820
+ s = c.width, i = c.height;
841
821
  else {
842
- const p = this.baseLayer.getAttribute("width"), g = this.baseLayer.getAttribute("height");
843
- p && g && (i = parseFloat(p), s = parseFloat(g));
822
+ const $ = this.baseLayer.getAttribute("width"), m = this.baseLayer.getAttribute("height");
823
+ $ && m && (s = parseFloat($), i = parseFloat(m));
844
824
  }
845
825
  }
846
826
  }
847
- if (!i || !s) return;
848
- const n = e.width / i, r = e.height / s, h = Math.min(n, r), a = i * h, c = s * h, f = (t.width - a) / 2, m = (t.height - c) / 2;
849
- this.modifier = { scaler: h, xOffset: f, yOffset: m, visibleWidth: a, visibleHeight: c };
827
+ if (!s || !i) return;
828
+ const o = t.width / s, n = t.height / i, h = Math.min(o, n), a = s * h, d = i * h, u = (e.width - a) / 2, l = (e.height - d) / 2;
829
+ this.modifier = { scaler: h, xOffset: u, yOffset: l, visibleWidth: a, visibleHeight: d };
850
830
  }
851
- getOverlayItemPosition(e, t, i) {
831
+ getOverlayItemPosition(t, e, s) {
852
832
  return {
853
- left: e * i.visibleWidth,
854
- top: t * i.visibleHeight
833
+ left: t * s.visibleWidth,
834
+ top: e * s.visibleHeight
855
835
  };
856
836
  }
857
- renderText(e, t, i) {
858
- const s = e, n = this.getOverlayItemPosition(t.relXPos, t.relYPos, i);
859
- if (!n) return P;
860
- const r = s.textStyle?.precision ?? 1;
861
- let h = t.data;
837
+ renderText(t, e, s) {
838
+ const i = t, o = this.getOverlayItemPosition(e.relXPos, e.relYPos, s);
839
+ if (!o) return f;
840
+ const n = i.textStyle?.precision ?? 1;
841
+ let h = e.data;
862
842
  const a = Number(h);
863
- let c = "#333";
864
- if (!Number.isNaN(a) && typeof r == "number" && r >= 0) {
865
- h = a.toFixed(r);
866
- const m = s.sections?.sectionLimits.findIndex((d) => a <= d) ?? -2;
867
- c = (m >= 1 ? s.sections?.colors[m - 1] : "#333") ?? "#333";
843
+ let d = "#333";
844
+ if (!Number.isNaN(a) && typeof n == "number" && n >= 0) {
845
+ h = a.toFixed(n);
846
+ const l = i.sections?.sectionLimits.findIndex((p) => a <= p) ?? -2;
847
+ d = (l >= 1 ? i.sections?.colors[l - 1] : "#333") ?? "#333";
868
848
  }
869
- const f = {
870
- "font-size": (s.textStyle.fontSize ?? 14) * i.scaler + "px",
871
- color: c,
872
- "background-color": s.textStyle.backgroundColor,
873
- "font-weight": s.textStyle.fontWeight,
874
- left: `${n.left}px`,
875
- top: `${n.top}px`,
876
- "border-radius": 10 * i.scaler + "px",
849
+ const u = {
850
+ "font-size": (i.textStyle.fontSize ?? 14) * s.scaler + "px",
851
+ color: d,
852
+ "background-color": i.textStyle.backgroundColor,
853
+ "font-weight": i.textStyle.fontWeight,
854
+ left: `${o.left}px`,
855
+ top: `${o.top}px`,
856
+ "border-radius": 10 * s.scaler + "px",
877
857
  "transform-origin": "50% 50%",
878
858
  transform: "translate(-50%, -50%)",
879
- padding: `${6 * i.scaler}px ${12 * i.scaler}px`
859
+ padding: `${6 * s.scaler}px ${12 * s.scaler}px`
880
860
  };
881
- return y`
882
- <div class="overlay-item" style=${Z(f)}>${t.prefix}${h}${t.suffix}</div>
861
+ return g`
862
+ <div class="overlay-item" style=${F(u)}>${e.prefix}${h}${e.suffix}</div>
883
863
  `;
884
864
  }
885
- renderProgress(e, t, i) {
886
- const s = e, n = this.getOverlayItemPosition(t.relXPos, t.relYPos, i);
887
- if (!n) return P;
888
- const r = s.sections?.sectionLimits.findIndex((p) => Number(t.data) <= p) ?? -2, a = {
889
- "--progress-color": (r >= 1 ? s.sections?.colors[r - 1] : void 0) ?? "#333",
890
- "--progress-width": (s.progressStyle?.width ?? 10) * i.scaler + "px",
891
- "--progress-height": (s.progressStyle?.height ?? 100) * i.scaler + "px",
892
- "--progress-background": s.progressStyle?.backgroundColor ?? "#fff",
893
- "border-radius": 10 * i.scaler + "px",
865
+ renderProgress(t, e, s) {
866
+ const i = t, o = this.getOverlayItemPosition(e.relXPos, e.relYPos, s);
867
+ if (!o) return f;
868
+ const n = i.sections?.sectionLimits.findIndex(($) => Number(e.data) <= $) ?? -2, a = {
869
+ "--progress-color": (n >= 1 ? i.sections?.colors[n - 1] : void 0) ?? "#333",
870
+ "--progress-width": (i.progressStyle?.width ?? 10) * s.scaler + "px",
871
+ "--progress-height": (i.progressStyle?.height ?? 100) * s.scaler + "px",
872
+ "--progress-background": i.progressStyle?.backgroundColor ?? "#fff",
873
+ "border-radius": 10 * s.scaler + "px",
894
874
  "transform-origin": "50% 50%",
895
- transform: `translate(-50%, -50%) rotate(${s.progressStyle?.rotate ?? 0}deg)`,
896
- left: `${n.left}px`,
897
- top: `${n.top}px`
898
- }, c = Number(t.data), f = s.sections ?? {}, m = Math.min(...f.sectionLimits.map(Number)), d = Math.max(...f.sectionLimits.map(Number));
899
- let l = d === m ? 0 : (c - m) / (d - m);
900
- return l = Math.min(1, Math.max(0, l)), y` <linear-progress .value=${l} style=${Z(a)}></linear-progress> `;
901
- }
902
- renderLayer(e) {
903
- const t = this.modifier;
904
- if (!t) return P;
905
- const i = {
906
- left: t.xOffset + "px",
907
- top: t.yOffset + "px",
908
- width: t.visibleWidth + "px",
909
- height: t.visibleHeight + "px"
875
+ transform: `translate(-50%, -50%) rotate(${i.progressStyle?.rotate ?? 0}deg)`,
876
+ left: `${o.left}px`,
877
+ top: `${o.top}px`
878
+ }, d = Number(e.data), u = i.sections ?? {}, l = Math.min(...u.sectionLimits.map(Number)), p = Math.max(...u.sectionLimits.map(Number));
879
+ let c = p === l ? 0 : (d - l) / (p - l);
880
+ return c = Math.min(1, Math.max(0, c)), g` <linear-progress .value=${c} style=${F(a)}></linear-progress> `;
881
+ }
882
+ renderLayer(t) {
883
+ const e = this.modifier;
884
+ if (!e) return f;
885
+ const s = {
886
+ left: e.xOffset + "px",
887
+ top: e.yOffset + "px",
888
+ width: e.visibleWidth + "px",
889
+ height: e.visibleHeight + "px"
910
890
  };
911
- return y`<div
891
+ return g`<div
912
892
  class="overlay"
913
- style=${Z(i)}
914
- type="${e.layerType}"
915
- name="${e.layerName}"
893
+ style=${F(s)}
894
+ type="${t.layerType}"
895
+ name="${t.layerName}"
916
896
  >
917
- ${e.layerType === "text" ? this.renderTextLayer(e) : this.renderProgressLayer(e)}
897
+ ${t.layerType === "text" ? this.renderTextLayer(t) : this.renderProgressLayer(t)}
918
898
  </div>`;
919
899
  }
920
- renderTextLayer(e) {
921
- const t = this.modifier;
922
- return t ? y`${X(
923
- e.textPins ?? [],
924
- (i, s) => s,
925
- (i) => y`${this.renderText(e, i, t)}`
926
- )}` : P;
927
- }
928
- renderProgressLayer(e) {
929
- const t = this.modifier;
930
- return t ? y`${X(
931
- e.progressPins ?? [],
932
- (i, s) => s,
933
- (i) => y`${this.renderProgress(e, i, t)}`
934
- )}` : P;
900
+ renderTextLayer(t) {
901
+ const e = this.modifier;
902
+ return e ? g`${X(
903
+ t.textPins ?? [],
904
+ (s, i) => i,
905
+ (s) => g`${this.renderText(t, s, e)}`
906
+ )}` : f;
907
+ }
908
+ renderProgressLayer(t) {
909
+ const e = this.modifier;
910
+ return e ? g`${X(
911
+ t.progressPins ?? [],
912
+ (s, i) => i,
913
+ (s) => g`${this.renderProgress(t, s, e)}`
914
+ )}` : f;
935
915
  }
936
916
  render() {
937
- const e = !!this.inlineSvg || !!this.previewUrl;
938
- return y`
917
+ const t = !!this.inlineSvg || !!this.previewUrl;
918
+ return g`
939
919
  <div class="wrapper" style="background-color: ${this.themeBgColor}">
940
920
  <h3 class="paging" ?active=${this.inputData?.title} style="color: ${this.themeTitleColor}">
941
921
  ${this.inputData?.title}
@@ -948,9 +928,9 @@ const he = class he extends Te {
948
928
  ${this.inputData?.subTitle}
949
929
  </p>
950
930
 
951
- <div class="paging no-data" ?active=${!e}>No Image</div>
952
- <div class="img-container paging" ?active="${e}">
953
- ${this.inlineSvg ? y`<div id="base-layer" class="svg-wrapper">${rt(this.inlineSvg)}</div>` : this.previewUrl ? y`<img
931
+ <div class="paging no-data" ?active=${!t}>No Image</div>
932
+ <div class="img-container paging" ?active="${t}">
933
+ ${this.inlineSvg ? g`<div id="base-layer" class="svg-wrapper">${ie(this.inlineSvg)}</div>` : this.previewUrl ? g`<img
954
934
  id="base-layer"
955
935
  @load="${this.getModifier}"
956
936
  src="${this.previewUrl}"
@@ -959,15 +939,15 @@ const he = class he extends Te {
959
939
  />` : ""}
960
940
  ${X(
961
941
  this.inputData?.overlays ?? [],
962
- (t) => t.layerName,
963
- (t) => y` ${this.renderLayer(t)} `
942
+ (e) => e.layerName,
943
+ (e) => g` ${this.renderLayer(e)} `
964
944
  )}
965
945
  </div>
966
946
  </div>
967
947
  `;
968
948
  }
969
949
  };
970
- he.styles = ve`
950
+ nt.styles = bt`
971
951
  :host {
972
952
  display: block;
973
953
  font-family: sans-serif;
@@ -1051,36 +1031,36 @@ he.styles = ve`
1051
1031
  pointer-events: auto;
1052
1032
  }
1053
1033
  `;
1054
- let b = he;
1055
- C([
1056
- te({ type: Object })
1057
- ], b.prototype, "inputData");
1058
- C([
1059
- te({ type: Object })
1060
- ], b.prototype, "theme");
1061
- C([
1062
- M()
1063
- ], b.prototype, "themeBgColor");
1064
- C([
1065
- M()
1066
- ], b.prototype, "themeTitleColor");
1067
- C([
1068
- M()
1069
- ], b.prototype, "themeSubtitleColor");
1070
- C([
1071
- M()
1072
- ], b.prototype, "previewUrl");
1073
- C([
1074
- M()
1075
- ], b.prototype, "inlineSvg");
1076
- C([
1077
- M()
1078
- ], b.prototype, "modifier");
1079
- C([
1080
- ke("#base-layer")
1081
- ], b.prototype, "baseLayer");
1082
- window.customElements.define("widget-overlay-1.0.8", b);
1034
+ let v = nt;
1035
+ _([
1036
+ V({ type: Object })
1037
+ ], v.prototype, "inputData");
1038
+ _([
1039
+ V({ type: Object })
1040
+ ], v.prototype, "theme");
1041
+ _([
1042
+ T()
1043
+ ], v.prototype, "themeBgColor");
1044
+ _([
1045
+ T()
1046
+ ], v.prototype, "themeTitleColor");
1047
+ _([
1048
+ T()
1049
+ ], v.prototype, "themeSubtitleColor");
1050
+ _([
1051
+ T()
1052
+ ], v.prototype, "previewUrl");
1053
+ _([
1054
+ T()
1055
+ ], v.prototype, "inlineSvg");
1056
+ _([
1057
+ T()
1058
+ ], v.prototype, "modifier");
1059
+ _([
1060
+ ee("#base-layer")
1061
+ ], v.prototype, "baseLayer");
1062
+ window.customElements.define("widget-overlay-1.0.10", v);
1083
1063
  export {
1084
- b as WidgetImage
1064
+ v as WidgetImage
1085
1065
  };
1086
1066
  //# sourceMappingURL=widget-overlay.js.map