@topsort/banners
Advanced tools
+6
-0
@@ -0,1 +1,7 @@ | ||
| ### 0.6.0 | ||
| - Add support for sending opaque user ID in auction requests | ||
| - Integrate with analytics.js getUserId() for consistent user identification across auctions and events | ||
| - Support custom user ID override via window.TS.getUserId() | ||
| ### 0.3.0 | ||
@@ -2,0 +8,0 @@ |
+2
-19
@@ -18,2 +18,3 @@ import { LitElement } from 'lit'; | ||
| searchQuery?: string; | ||
| opaqueUserId?: string; | ||
| } | ||
@@ -59,3 +60,3 @@ | ||
| render(): TemplateResult<1>; | ||
| firstUpdated(): void; | ||
| firstUpdated(): Promise<void>; | ||
| } | ||
@@ -86,19 +87,1 @@ | ||
| export { } | ||
| declare global { | ||
| interface Window { | ||
| TS_BANNERS: { | ||
| getLink(banner: Banner): string; | ||
| getLoadingElement(): HTMLElement; | ||
| getErrorElement(error: unknown): HTMLElement; | ||
| getNoWinnersElement(): HTMLElement; | ||
| getBannerElement(banner: Banner): HTMLElement; | ||
| }; | ||
| TS: { | ||
| readonly token: string; | ||
| readonly url?: string; | ||
| }; | ||
| } | ||
| } | ||
+606
-498
@@ -1,22 +0,7 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2021 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| let lt = class extends Event { | ||
| constructor(t, e, s) { | ||
| super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = e, this.subscribe = s ?? !1; | ||
| let _t = class extends Event { | ||
| constructor(t, e, s, i) { | ||
| super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.contextTarget = e, this.callback = s, this.subscribe = i ?? !1; | ||
| } | ||
| }; | ||
| /** | ||
| * @license | ||
| * Copyright 2021 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| /** | ||
| * @license | ||
| * Copyright 2021 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| let Z = class { | ||
| let it = class { | ||
| constructor(t, e, s, i) { | ||
@@ -28,4 +13,3 @@ if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, n) => { | ||
| this.context = o.context, this.callback = o.callback, this.subscribe = o.subscribe ?? !1; | ||
| } else | ||
| this.context = e, this.callback = s, this.subscribe = i ?? !1; | ||
| } else this.context = e, this.callback = s, this.subscribe = i ?? !1; | ||
| this.host.addController(this); | ||
@@ -40,11 +24,6 @@ } | ||
| dispatchRequest() { | ||
| this.host.dispatchEvent(new lt(this.context, this.t, this.subscribe)); | ||
| this.host.dispatchEvent(new _t(this.context, this.host, this.t, this.subscribe)); | ||
| } | ||
| }; | ||
| /** | ||
| * @license | ||
| * Copyright 2021 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| let At = class { | ||
| let Ot = class { | ||
| get value() { | ||
@@ -62,9 +41,7 @@ return this.o; | ||
| this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => { | ||
| for (const [e, { disposer: s }] of this.subscriptions) | ||
| e(this.o, s); | ||
| for (const [e, { disposer: s }] of this.subscriptions) e(this.o, s); | ||
| }, t !== void 0 && (this.value = t); | ||
| } | ||
| addCallback(t, e, s) { | ||
| if (!s) | ||
| return void t(this.value); | ||
| if (!s) return void t(this.value); | ||
| this.subscriptions.has(t) || this.subscriptions.set(t, { disposer: () => { | ||
@@ -80,26 +57,18 @@ this.subscriptions.delete(t); | ||
| }; | ||
| /** | ||
| * @license | ||
| * Copyright 2021 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| let wt = class extends Event { | ||
| constructor(t) { | ||
| super("context-provider", { bubbles: !0, composed: !0 }), this.context = t; | ||
| let Rt = class extends Event { | ||
| constructor(t, e) { | ||
| super("context-provider", { bubbles: !0, composed: !0 }), this.context = t, this.contextTarget = e; | ||
| } | ||
| }, G = class extends At { | ||
| }, rt = class extends Ot { | ||
| constructor(t, e, s) { | ||
| var i, o; | ||
| super(e.context !== void 0 ? e.initialValue : s), this.onContextRequest = (n) => { | ||
| const a = n.composedPath()[0]; | ||
| n.context === this.context && a !== this.host && (n.stopPropagation(), this.addCallback(n.callback, a, n.subscribe)); | ||
| }, this.onProviderRequest = (n) => { | ||
| const a = n.composedPath()[0]; | ||
| if (n.context !== this.context || a === this.host) | ||
| return; | ||
| const h = /* @__PURE__ */ new Set(); | ||
| for (const [c, { consumerHost: d }] of this.subscriptions) | ||
| h.has(c) || (h.add(c), d.dispatchEvent(new lt(this.context, c, !0))); | ||
| n.stopPropagation(); | ||
| }, this.host = t, e.context !== void 0 ? this.context = e.context : this.context = e, this.attachListeners(), (o = (i = this.host).addController) == null || o.call(i, this); | ||
| super(e.context !== void 0 ? e.initialValue : s), this.onContextRequest = (i) => { | ||
| if (i.context !== this.context) return; | ||
| const o = i.contextTarget ?? i.composedPath()[0]; | ||
| o !== this.host && (i.stopPropagation(), this.addCallback(i.callback, o, i.subscribe)); | ||
| }, this.onProviderRequest = (i) => { | ||
| if (i.context !== this.context || (i.contextTarget ?? i.composedPath()[0]) === this.host) return; | ||
| const o = /* @__PURE__ */ new Set(); | ||
| for (const [n, { consumerHost: h }] of this.subscriptions) o.has(n) || (o.add(n), h.dispatchEvent(new _t(this.context, h, n, !0))); | ||
| i.stopPropagation(); | ||
| }, this.host = t, e.context !== void 0 ? this.context = e.context : this.context = e, this.attachListeners(), this.host.addController?.(this); | ||
| } | ||
@@ -110,29 +79,19 @@ attachListeners() { | ||
| hostConnected() { | ||
| this.host.dispatchEvent(new wt(this.context)); | ||
| this.host.dispatchEvent(new Rt(this.context, this.host)); | ||
| } | ||
| }; | ||
| /** | ||
| * @license | ||
| * Copyright 2017 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| function Et({ context: r }) { | ||
| function Nt({ context: r }) { | ||
| return (t, e) => { | ||
| const s = /* @__PURE__ */ new WeakMap(); | ||
| if (typeof e == "object") | ||
| return e.addInitializer(function() { | ||
| s.set(this, new G(this, { context: r })); | ||
| }), { get() { | ||
| return t.get.call(this); | ||
| }, set(i) { | ||
| var o; | ||
| return (o = s.get(this)) == null || o.setValue(i), t.set.call(this, i); | ||
| }, init(i) { | ||
| var o; | ||
| return (o = s.get(this)) == null || o.setValue(i), i; | ||
| } }; | ||
| if (typeof e == "object") return { get() { | ||
| return t.get.call(this); | ||
| }, set(i) { | ||
| return s.get(this).setValue(i), t.set.call(this, i); | ||
| }, init(i) { | ||
| return s.set(this, new rt(this, { context: r, initialValue: i })), i; | ||
| } }; | ||
| { | ||
| t.constructor.addInitializer((n) => { | ||
| s.set(n, new G(n, { context: r })); | ||
| }); | ||
| t.constructor.addInitializer(((n) => { | ||
| s.set(n, new rt(n, { context: r })); | ||
| })); | ||
| const i = Object.getOwnPropertyDescriptor(t, e); | ||
@@ -144,9 +103,9 @@ let o; | ||
| return n.get(this); | ||
| }, set(a) { | ||
| s.get(this).setValue(a), n.set(this, a); | ||
| }, set(h) { | ||
| s.get(this).setValue(h), n.set(this, h); | ||
| }, configurable: !0, enumerable: !0 }; | ||
| } else { | ||
| const n = i.set; | ||
| o = { ...i, set(a) { | ||
| s.get(this).setValue(a), n == null || n.call(this, a); | ||
| o = { ...i, set(h) { | ||
| s.get(this).setValue(h), n?.call(this, h); | ||
| } }; | ||
@@ -158,30 +117,19 @@ } | ||
| } | ||
| /** | ||
| * @license | ||
| * Copyright 2022 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| function St({ context: r, subscribe: t }) { | ||
| function kt({ context: r, subscribe: t }) { | ||
| return (e, s) => { | ||
| typeof s == "object" ? s.addInitializer(function() { | ||
| new Z(this, { context: r, callback: (i) => { | ||
| typeof s == "object" ? s.addInitializer((function() { | ||
| new it(this, { context: r, callback: (i) => { | ||
| e.set.call(this, i); | ||
| }, subscribe: t }); | ||
| }) : e.constructor.addInitializer((i) => { | ||
| new Z(i, { context: r, callback: (o) => { | ||
| })) : e.constructor.addInitializer(((i) => { | ||
| new it(i, { context: r, callback: (o) => { | ||
| i[s] = o; | ||
| }, subscribe: t }); | ||
| }); | ||
| })); | ||
| }; | ||
| } | ||
| /** | ||
| * @license | ||
| * Copyright 2019 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| const j = globalThis, J = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, dt = Symbol(), Y = /* @__PURE__ */ new WeakMap(); | ||
| let xt = class { | ||
| const I = globalThis, Q = I.ShadowRoot && (I.ShadyCSS === void 0 || I.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, bt = Symbol(), ot = /* @__PURE__ */ new WeakMap(); | ||
| let Mt = class { | ||
| constructor(t, e, s) { | ||
| if (this._$cssResult$ = !0, s !== dt) | ||
| throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); | ||
| if (this._$cssResult$ = !0, s !== bt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); | ||
| this.cssText = t, this.t = e; | ||
@@ -192,5 +140,5 @@ } | ||
| const e = this.t; | ||
| if (J && t === void 0) { | ||
| if (Q && t === void 0) { | ||
| const s = e !== void 0 && e.length === 1; | ||
| s && (t = Y.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Y.set(e, t)); | ||
| s && (t = ot.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && ot.set(e, t)); | ||
| } | ||
@@ -203,25 +151,17 @@ return t; | ||
| }; | ||
| const Ct = (r) => new xt(typeof r == "string" ? r : r + "", void 0, dt), Tt = (r, t) => { | ||
| if (J) | ||
| r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); | ||
| else | ||
| for (const e of t) { | ||
| const s = document.createElement("style"), i = j.litNonce; | ||
| i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s); | ||
| } | ||
| }, tt = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => { | ||
| const jt = (r) => new Mt(typeof r == "string" ? r : r + "", void 0, bt), Ht = (r, t) => { | ||
| if (Q) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet)); | ||
| else for (const e of t) { | ||
| const s = document.createElement("style"), i = I.litNonce; | ||
| i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s); | ||
| } | ||
| }, nt = Q ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => { | ||
| let e = ""; | ||
| for (const s of t.cssRules) | ||
| e += s.cssText; | ||
| return Ct(e); | ||
| for (const s of t.cssRules) e += s.cssText; | ||
| return jt(e); | ||
| })(r) : r; | ||
| /** | ||
| * @license | ||
| * Copyright 2017 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| const { is: Pt, defineProperty: Rt, getOwnPropertyDescriptor: Nt, getOwnPropertyNames: Ut, getOwnPropertySymbols: Ot, getPrototypeOf: kt } = Object, v = globalThis, et = v.trustedTypes, It = et ? et.emptyScript : "", W = v.reactiveElementPolyfillSupport, R = (r, t) => r, B = { toAttribute(r, t) { | ||
| const { is: It, defineProperty: Bt, getOwnPropertyDescriptor: Lt, getOwnPropertyNames: qt, getOwnPropertySymbols: Dt, getPrototypeOf: zt } = Object, z = globalThis, ht = z.trustedTypes, Wt = ht ? ht.emptyScript : "", Vt = z.reactiveElementPolyfillSupport, T = (r, t) => r, F = { toAttribute(r, t) { | ||
| switch (t) { | ||
| case Boolean: | ||
| r = r ? It : null; | ||
| r = r ? Wt : null; | ||
| break; | ||
@@ -251,7 +191,7 @@ case Object: | ||
| return e; | ||
| } }, D = (r, t) => !Pt(r, t), st = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: D }; | ||
| Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), v.litPropertyMetadata ?? (v.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); | ||
| class x extends HTMLElement { | ||
| } }, Z = (r, t) => !It(r, t), at = { attribute: !0, type: String, converter: F, reflect: !1, hasChanged: Z }; | ||
| Symbol.metadata ??= Symbol("metadata"), z.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); | ||
| let P = class extends HTMLElement { | ||
| static addInitializer(t) { | ||
| this._$Ei(), (this.l ?? (this.l = [])).push(t); | ||
| this._$Ei(), (this.l ??= []).push(t); | ||
| } | ||
@@ -261,10 +201,10 @@ static get observedAttributes() { | ||
| } | ||
| static createProperty(t, e = st) { | ||
| static createProperty(t, e = at) { | ||
| if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) { | ||
| const s = Symbol(), i = this.getPropertyDescriptor(t, s, e); | ||
| i !== void 0 && Rt(this.prototype, t, i); | ||
| i !== void 0 && Bt(this.prototype, t, i); | ||
| } | ||
| } | ||
| static getPropertyDescriptor(t, e, s) { | ||
| const { get: i, set: o } = Nt(this.prototype, t) ?? { get() { | ||
| const { get: i, set: o } = Lt(this.prototype, t) ?? { get() { | ||
| return this[e]; | ||
@@ -275,24 +215,21 @@ }, set(n) { | ||
| return { get() { | ||
| return i == null ? void 0 : i.call(this); | ||
| return i?.call(this); | ||
| }, set(n) { | ||
| const a = i == null ? void 0 : i.call(this); | ||
| o.call(this, n), this.requestUpdate(t, a, s); | ||
| const h = i?.call(this); | ||
| o.call(this, n), this.requestUpdate(t, h, s); | ||
| }, configurable: !0, enumerable: !0 }; | ||
| } | ||
| static getPropertyOptions(t) { | ||
| return this.elementProperties.get(t) ?? st; | ||
| return this.elementProperties.get(t) ?? at; | ||
| } | ||
| static _$Ei() { | ||
| if (this.hasOwnProperty(R("elementProperties"))) | ||
| return; | ||
| const t = kt(this); | ||
| if (this.hasOwnProperty(T("elementProperties"))) return; | ||
| const t = zt(this); | ||
| t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties); | ||
| } | ||
| static finalize() { | ||
| if (this.hasOwnProperty(R("finalized"))) | ||
| return; | ||
| if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(R("properties"))) { | ||
| const e = this.properties, s = [...Ut(e), ...Ot(e)]; | ||
| for (const i of s) | ||
| this.createProperty(i, e[i]); | ||
| if (this.hasOwnProperty(T("finalized"))) return; | ||
| if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) { | ||
| const e = this.properties, s = [...qt(e), ...Dt(e)]; | ||
| for (const i of s) this.createProperty(i, e[i]); | ||
| } | ||
@@ -302,5 +239,3 @@ const t = this[Symbol.metadata]; | ||
| const e = litPropertyMetadata.get(t); | ||
| if (e !== void 0) | ||
| for (const [s, i] of e) | ||
| this.elementProperties.set(s, i); | ||
| if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i); | ||
| } | ||
@@ -318,6 +253,4 @@ this._$Eh = /* @__PURE__ */ new Map(); | ||
| const s = new Set(t.flat(1 / 0).reverse()); | ||
| for (const i of s) | ||
| e.unshift(tt(i)); | ||
| } else | ||
| t !== void 0 && e.push(tt(t)); | ||
| for (const i of s) e.unshift(nt(i)); | ||
| } else t !== void 0 && e.push(nt(t)); | ||
| return e; | ||
@@ -333,17 +266,13 @@ } | ||
| _$Ev() { | ||
| var t; | ||
| this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this)); | ||
| this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this))); | ||
| } | ||
| addController(t) { | ||
| var e; | ||
| (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t)); | ||
| (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.(); | ||
| } | ||
| removeController(t) { | ||
| var e; | ||
| (e = this._$EO) == null || e.delete(t); | ||
| this._$EO?.delete(t); | ||
| } | ||
| _$E_() { | ||
| const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties; | ||
| for (const s of e.keys()) | ||
| this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]); | ||
| for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]); | ||
| t.size > 0 && (this._$Ep = t); | ||
@@ -353,10 +282,6 @@ } | ||
| const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); | ||
| return Tt(t, this.constructor.elementStyles), t; | ||
| return Ht(t, this.constructor.elementStyles), t; | ||
| } | ||
| connectedCallback() { | ||
| var t; | ||
| this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => { | ||
| var s; | ||
| return (s = e.hostConnected) == null ? void 0 : s.call(e); | ||
| }); | ||
| this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.())); | ||
| } | ||
@@ -366,7 +291,3 @@ enableUpdating(t) { | ||
| disconnectedCallback() { | ||
| var t; | ||
| (t = this._$EO) == null || t.forEach((e) => { | ||
| var s; | ||
| return (s = e.hostDisconnected) == null ? void 0 : s.call(e); | ||
| }); | ||
| this._$EO?.forEach(((t) => t.hostDisconnected?.())); | ||
| } | ||
@@ -377,15 +298,13 @@ attributeChangedCallback(t, e, s) { | ||
| _$EC(t, e) { | ||
| var o; | ||
| const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s); | ||
| if (i !== void 0 && s.reflect === !0) { | ||
| const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : B).toAttribute(e, s.type); | ||
| this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null; | ||
| const o = (s.converter?.toAttribute !== void 0 ? s.converter : F).toAttribute(e, s.type); | ||
| this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null; | ||
| } | ||
| } | ||
| _$AK(t, e) { | ||
| var o; | ||
| const s = this.constructor, i = s._$Eh.get(t); | ||
| if (i !== void 0 && this._$Em !== i) { | ||
| const n = s.getPropertyOptions(i), a = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((o = n.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? n.converter : B; | ||
| this._$Em = i, this[i] = a.fromAttribute(e, n.type), this._$Em = null; | ||
| const o = s.getPropertyOptions(i), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : F; | ||
| this._$Em = i, this[i] = n.fromAttribute(e, o.type), this._$Em = null; | ||
| } | ||
@@ -395,4 +314,3 @@ } | ||
| if (t !== void 0) { | ||
| if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? D)(this[t], e)) | ||
| return; | ||
| if (s ??= this.constructor.getPropertyOptions(t), !(s.hasChanged ?? Z)(this[t], e)) return; | ||
| this.P(t, e, s); | ||
@@ -403,3 +321,3 @@ } | ||
| P(t, e, s) { | ||
| this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t); | ||
| this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t); | ||
| } | ||
@@ -420,15 +338,10 @@ async _$ET() { | ||
| performUpdate() { | ||
| var s; | ||
| if (!this.isUpdatePending) | ||
| return; | ||
| if (!this.isUpdatePending) return; | ||
| if (!this.hasUpdated) { | ||
| if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) { | ||
| for (const [o, n] of this._$Ep) | ||
| this[o] = n; | ||
| if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { | ||
| for (const [i, o] of this._$Ep) this[i] = o; | ||
| this._$Ep = void 0; | ||
| } | ||
| const i = this.constructor.elementProperties; | ||
| if (i.size > 0) | ||
| for (const [o, n] of i) | ||
| n.wrapped !== !0 || this._$AL.has(o) || this[o] === void 0 || this.P(o, this[o], n); | ||
| const s = this.constructor.elementProperties; | ||
| if (s.size > 0) for (const [i, o] of s) o.wrapped !== !0 || this._$AL.has(i) || this[i] === void 0 || this.P(i, this[i], o); | ||
| } | ||
@@ -438,8 +351,5 @@ let t = !1; | ||
| try { | ||
| t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => { | ||
| var o; | ||
| return (o = i.hostUpdate) == null ? void 0 : o.call(i); | ||
| }), this.update(e)) : this._$EU(); | ||
| } catch (i) { | ||
| throw t = !1, this._$EU(), i; | ||
| t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((s) => s.hostUpdate?.())), this.update(e)) : this._$EU(); | ||
| } catch (s) { | ||
| throw t = !1, this._$EU(), s; | ||
| } | ||
@@ -451,7 +361,3 @@ t && this._$AE(e); | ||
| _$AE(t) { | ||
| var e; | ||
| (e = this._$EO) == null || e.forEach((s) => { | ||
| var i; | ||
| return (i = s.hostUpdated) == null ? void 0 : i.call(s); | ||
| }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); | ||
| this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); | ||
| } | ||
@@ -471,3 +377,3 @@ _$EU() { | ||
| update(t) { | ||
| this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU(); | ||
| this._$Ej &&= this._$Ej.forEach(((e) => this._$EC(e, this[e]))), this._$EU(); | ||
| } | ||
@@ -478,21 +384,15 @@ updated(t) { | ||
| } | ||
| } | ||
| x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, x[R("elementProperties")] = /* @__PURE__ */ new Map(), x[R("finalized")] = /* @__PURE__ */ new Map(), W == null || W({ ReactiveElement: x }), (v.reactiveElementVersions ?? (v.reactiveElementVersions = [])).push("2.0.4"); | ||
| /** | ||
| * @license | ||
| * Copyright 2017 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| const Ht = Symbol(); | ||
| let Mt = class { | ||
| }; | ||
| P.elementStyles = [], P.shadowRootOptions = { mode: "open" }, P[T("elementProperties")] = /* @__PURE__ */ new Map(), P[T("finalized")] = /* @__PURE__ */ new Map(), Vt?.({ ReactiveElement: P }), (z.reactiveElementVersions ??= []).push("2.0.4"); | ||
| const Kt = Symbol(); | ||
| let Ft = class { | ||
| get taskComplete() { | ||
| return this.t || (this.i === 1 ? this.t = new Promise((t, e) => { | ||
| return this.t || (this.i === 1 ? this.t = new Promise(((t, e) => { | ||
| this.o = t, this.h = e; | ||
| }) : this.i === 3 ? this.t = Promise.reject(this.l) : this.t = Promise.resolve(this.u)), this.t; | ||
| })) : this.i === 3 ? this.t = Promise.reject(this.l) : this.t = Promise.resolve(this.u)), this.t; | ||
| } | ||
| constructor(t, e, s) { | ||
| var o; | ||
| this.p = 0, this.i = 0, (this._ = t).addController(this); | ||
| const i = typeof e == "object" ? e : { task: e, args: s }; | ||
| this.v = i.task, this.j = i.args, this.m = i.argsEqual ?? jt, this.k = i.onComplete, this.A = i.onError, this.autoRun = i.autoRun ?? !0, "initialValue" in i && (this.u = i.initialValue, this.i = 2, this.O = (o = this.T) == null ? void 0 : o.call(this)); | ||
| this.v = i.task, this.j = i.args, this.m = i.argsEqual ?? Jt, this.k = i.onComplete, this.A = i.onError, this.autoRun = i.autoRun ?? !0, "initialValue" in i && (this.u = i.initialValue, this.i = 2, this.O = this.T?.()); | ||
| } | ||
@@ -506,7 +406,5 @@ hostUpdate() { | ||
| T() { | ||
| if (this.j === void 0) | ||
| return; | ||
| if (this.j === void 0) return; | ||
| const t = this.j(); | ||
| if (!Array.isArray(t)) | ||
| throw Error("The args function must return an array"); | ||
| if (!Array.isArray(t)) throw Error("The args function must return an array"); | ||
| return t; | ||
@@ -519,5 +417,4 @@ } | ||
| async run(t) { | ||
| var n, a, h, c, d; | ||
| let e, s; | ||
| t ?? (t = this.T()), this.O = t, this.i === 1 ? (n = this.q) == null || n.abort() : (this.t = void 0, this.o = void 0, this.h = void 0), this.i = 1, this.autoRun === "afterUpdate" ? queueMicrotask(() => this._.requestUpdate()) : this._.requestUpdate(); | ||
| t ??= this.T(), this.O = t, this.i === 1 ? this.q?.abort() : (this.t = void 0, this.o = void 0, this.h = void 0), this.i = 1, this.autoRun === "afterUpdate" ? queueMicrotask((() => this._.requestUpdate())) : this._.requestUpdate(); | ||
| const i = ++this.p; | ||
@@ -528,21 +425,20 @@ this.q = new AbortController(); | ||
| e = await this.v(t, { signal: this.q.signal }); | ||
| } catch (l) { | ||
| o = !0, s = l; | ||
| } catch (n) { | ||
| o = !0, s = n; | ||
| } | ||
| if (this.p === i) { | ||
| if (e === Ht) | ||
| this.i = 0; | ||
| if (e === Kt) this.i = 0; | ||
| else { | ||
| if (o === !1) { | ||
| try { | ||
| (a = this.k) == null || a.call(this, e); | ||
| this.k?.(e); | ||
| } catch { | ||
| } | ||
| this.i = 2, (h = this.o) == null || h.call(this, e); | ||
| this.i = 2, this.o?.(e); | ||
| } else { | ||
| try { | ||
| (c = this.A) == null || c.call(this, s); | ||
| this.A?.(s); | ||
| } catch { | ||
| } | ||
| this.i = 3, (d = this.h) == null || d.call(this, s); | ||
| this.i = 3, this.h?.(s); | ||
| } | ||
@@ -555,4 +451,3 @@ this.u = e, this.l = s; | ||
| abort(t) { | ||
| var e; | ||
| this.i === 1 && ((e = this.q) == null || e.abort(t)); | ||
| this.i === 1 && this.q?.abort(t); | ||
| } | ||
@@ -569,12 +464,11 @@ get value() { | ||
| render(t) { | ||
| var e, s, i, o; | ||
| switch (this.i) { | ||
| case 0: | ||
| return (e = t.initial) == null ? void 0 : e.call(t); | ||
| return t.initial?.(); | ||
| case 1: | ||
| return (s = t.pending) == null ? void 0 : s.call(t); | ||
| return t.pending?.(); | ||
| case 2: | ||
| return (i = t.complete) == null ? void 0 : i.call(t, this.value); | ||
| return t.complete?.(this.value); | ||
| case 3: | ||
| return (o = t.error) == null ? void 0 : o.call(t, this.error); | ||
| return t.error?.(this.error); | ||
| default: | ||
@@ -585,30 +479,265 @@ throw Error("Unexpected status: " + this.i); | ||
| }; | ||
| const jt = (r, t) => r === t || r.length === t.length && r.every((e, s) => !D(e, t[s])); | ||
| /** | ||
| * @license | ||
| * Copyright 2017 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| const N = globalThis, q = N.trustedTypes, it = q ? q.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ut = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, pt = "?" + m, Bt = `<${pt}>`, S = document, U = () => S.createComment(""), O = (r) => r === null || typeof r != "object" && typeof r != "function", ft = Array.isArray, qt = (r) => ft(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", V = `[ | ||
| \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, ot = />/g, A = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^ | ||
| \f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ht = /"/g, $t = /^(?:script|style|textarea|title)$/i, Lt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), f = Lt(1), C = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), w = S.createTreeWalker(S, 129); | ||
| function gt(r, t) { | ||
| if (!Array.isArray(r) || !r.hasOwnProperty("raw")) | ||
| throw Error("invalid template strings array"); | ||
| return it !== void 0 ? it.createHTML(t) : t; | ||
| const Jt = (r, t) => r === t || r.length === t.length && r.every(((e, s) => !Z(e, t[s]))); | ||
| const B = globalThis, X = B.ShadowRoot && (B.ShadyCSS === void 0 || B.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, vt = Symbol(), ct = /* @__PURE__ */ new WeakMap(); | ||
| let Qt = class { | ||
| constructor(t, e, s) { | ||
| if (this._$cssResult$ = !0, s !== vt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); | ||
| this.cssText = t, this.t = e; | ||
| } | ||
| get styleSheet() { | ||
| let t = this.o; | ||
| const e = this.t; | ||
| if (X && t === void 0) { | ||
| const s = e !== void 0 && e.length === 1; | ||
| s && (t = ct.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && ct.set(e, t)); | ||
| } | ||
| return t; | ||
| } | ||
| toString() { | ||
| return this.cssText; | ||
| } | ||
| }; | ||
| const Zt = (r) => new Qt(typeof r == "string" ? r : r + "", void 0, vt), Xt = (r, t) => { | ||
| if (X) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet)); | ||
| else for (const e of t) { | ||
| const s = document.createElement("style"), i = B.litNonce; | ||
| i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s); | ||
| } | ||
| }, lt = X ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => { | ||
| let e = ""; | ||
| for (const s of t.cssRules) e += s.cssText; | ||
| return Zt(e); | ||
| })(r) : r; | ||
| const { is: Gt, defineProperty: Yt, getOwnPropertyDescriptor: te, getOwnPropertyNames: ee, getOwnPropertySymbols: se, getPrototypeOf: ie } = Object, W = globalThis, dt = W.trustedTypes, re = dt ? dt.emptyScript : "", oe = W.reactiveElementPolyfillSupport, U = (r, t) => r, L = { toAttribute(r, t) { | ||
| switch (t) { | ||
| case Boolean: | ||
| r = r ? re : null; | ||
| break; | ||
| case Object: | ||
| case Array: | ||
| r = r == null ? r : JSON.stringify(r); | ||
| } | ||
| return r; | ||
| }, fromAttribute(r, t) { | ||
| let e = r; | ||
| switch (t) { | ||
| case Boolean: | ||
| e = r !== null; | ||
| break; | ||
| case Number: | ||
| e = r === null ? null : Number(r); | ||
| break; | ||
| case Object: | ||
| case Array: | ||
| try { | ||
| e = JSON.parse(r); | ||
| } catch { | ||
| e = null; | ||
| } | ||
| } | ||
| return e; | ||
| } }, G = (r, t) => !Gt(r, t), ut = { attribute: !0, type: String, converter: L, reflect: !1, useDefault: !1, hasChanged: G }; | ||
| Symbol.metadata ??= Symbol("metadata"), W.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); | ||
| let S = class extends HTMLElement { | ||
| static addInitializer(t) { | ||
| this._$Ei(), (this.l ??= []).push(t); | ||
| } | ||
| static get observedAttributes() { | ||
| return this.finalize(), this._$Eh && [...this._$Eh.keys()]; | ||
| } | ||
| static createProperty(t, e = ut) { | ||
| 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) { | ||
| const s = Symbol(), i = this.getPropertyDescriptor(t, s, e); | ||
| i !== void 0 && Yt(this.prototype, t, i); | ||
| } | ||
| } | ||
| static getPropertyDescriptor(t, e, s) { | ||
| const { get: i, set: o } = te(this.prototype, t) ?? { get() { | ||
| return this[e]; | ||
| }, set(n) { | ||
| this[e] = n; | ||
| } }; | ||
| return { get: i, set(n) { | ||
| const h = i?.call(this); | ||
| o?.call(this, n), this.requestUpdate(t, h, s); | ||
| }, configurable: !0, enumerable: !0 }; | ||
| } | ||
| static getPropertyOptions(t) { | ||
| return this.elementProperties.get(t) ?? ut; | ||
| } | ||
| static _$Ei() { | ||
| if (this.hasOwnProperty(U("elementProperties"))) return; | ||
| const t = ie(this); | ||
| t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties); | ||
| } | ||
| static finalize() { | ||
| if (this.hasOwnProperty(U("finalized"))) return; | ||
| if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(U("properties"))) { | ||
| const e = this.properties, s = [...ee(e), ...se(e)]; | ||
| for (const i of s) this.createProperty(i, e[i]); | ||
| } | ||
| const t = this[Symbol.metadata]; | ||
| if (t !== null) { | ||
| const e = litPropertyMetadata.get(t); | ||
| if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i); | ||
| } | ||
| this._$Eh = /* @__PURE__ */ new Map(); | ||
| for (const [e, s] of this.elementProperties) { | ||
| const i = this._$Eu(e, s); | ||
| i !== void 0 && this._$Eh.set(i, e); | ||
| } | ||
| this.elementStyles = this.finalizeStyles(this.styles); | ||
| } | ||
| static finalizeStyles(t) { | ||
| const e = []; | ||
| if (Array.isArray(t)) { | ||
| const s = new Set(t.flat(1 / 0).reverse()); | ||
| for (const i of s) e.unshift(lt(i)); | ||
| } else t !== void 0 && e.push(lt(t)); | ||
| return e; | ||
| } | ||
| static _$Eu(t, e) { | ||
| const s = e.attribute; | ||
| return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0; | ||
| } | ||
| constructor() { | ||
| super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev(); | ||
| } | ||
| _$Ev() { | ||
| this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this))); | ||
| } | ||
| addController(t) { | ||
| (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.(); | ||
| } | ||
| removeController(t) { | ||
| this._$EO?.delete(t); | ||
| } | ||
| _$E_() { | ||
| const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties; | ||
| for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]); | ||
| t.size > 0 && (this._$Ep = t); | ||
| } | ||
| createRenderRoot() { | ||
| const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); | ||
| return Xt(t, this.constructor.elementStyles), t; | ||
| } | ||
| connectedCallback() { | ||
| this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.())); | ||
| } | ||
| enableUpdating(t) { | ||
| } | ||
| disconnectedCallback() { | ||
| this._$EO?.forEach(((t) => t.hostDisconnected?.())); | ||
| } | ||
| attributeChangedCallback(t, e, s) { | ||
| this._$AK(t, s); | ||
| } | ||
| _$ET(t, e) { | ||
| const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s); | ||
| if (i !== void 0 && s.reflect === !0) { | ||
| const o = (s.converter?.toAttribute !== void 0 ? s.converter : L).toAttribute(e, s.type); | ||
| this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null; | ||
| } | ||
| } | ||
| _$AK(t, e) { | ||
| const s = this.constructor, i = s._$Eh.get(t); | ||
| if (i !== void 0 && this._$Em !== i) { | ||
| const o = s.getPropertyOptions(i), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : L; | ||
| this._$Em = i; | ||
| const h = n.fromAttribute(e, o.type); | ||
| this[i] = h ?? this._$Ej?.get(i) ?? h, this._$Em = null; | ||
| } | ||
| } | ||
| requestUpdate(t, e, s) { | ||
| if (t !== void 0) { | ||
| const i = this.constructor, o = this[t]; | ||
| if (s ??= i.getPropertyOptions(t), !((s.hasChanged ?? G)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return; | ||
| this.C(t, e, s); | ||
| } | ||
| this.isUpdatePending === !1 && (this._$ES = this._$EP()); | ||
| } | ||
| C(t, e, { useDefault: s, reflect: i, wrapped: o }, n) { | ||
| 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)); | ||
| } | ||
| async _$EP() { | ||
| this.isUpdatePending = !0; | ||
| try { | ||
| await this._$ES; | ||
| } catch (e) { | ||
| Promise.reject(e); | ||
| } | ||
| const t = this.scheduleUpdate(); | ||
| return t != null && await t, !this.isUpdatePending; | ||
| } | ||
| scheduleUpdate() { | ||
| return this.performUpdate(); | ||
| } | ||
| performUpdate() { | ||
| if (!this.isUpdatePending) return; | ||
| if (!this.hasUpdated) { | ||
| if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { | ||
| for (const [i, o] of this._$Ep) this[i] = o; | ||
| this._$Ep = void 0; | ||
| } | ||
| const s = this.constructor.elementProperties; | ||
| if (s.size > 0) for (const [i, o] of s) { | ||
| const { wrapped: n } = o, h = this[i]; | ||
| n !== !0 || this._$AL.has(i) || h === void 0 || this.C(i, void 0, o, h); | ||
| } | ||
| } | ||
| let t = !1; | ||
| const e = this._$AL; | ||
| try { | ||
| t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((s) => s.hostUpdate?.())), this.update(e)) : this._$EM(); | ||
| } catch (s) { | ||
| throw t = !1, this._$EM(), s; | ||
| } | ||
| t && this._$AE(e); | ||
| } | ||
| willUpdate(t) { | ||
| } | ||
| _$AE(t) { | ||
| this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); | ||
| } | ||
| _$EM() { | ||
| this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1; | ||
| } | ||
| get updateComplete() { | ||
| return this.getUpdateComplete(); | ||
| } | ||
| getUpdateComplete() { | ||
| return this._$ES; | ||
| } | ||
| shouldUpdate(t) { | ||
| return !0; | ||
| } | ||
| update(t) { | ||
| this._$Eq &&= this._$Eq.forEach(((e) => this._$ET(e, this[e]))), this._$EM(); | ||
| } | ||
| updated(t) { | ||
| } | ||
| firstUpdated(t) { | ||
| } | ||
| }; | ||
| S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[U("elementProperties")] = /* @__PURE__ */ new Map(), S[U("finalized")] = /* @__PURE__ */ new Map(), oe?.({ ReactiveElement: S }), (W.reactiveElementVersions ??= []).push("2.1.1"); | ||
| const Y = globalThis, q = Y.trustedTypes, pt = q ? q.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, wt = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, Et = "?" + _, ne = `<${Et}>`, E = document, O = () => E.createComment(""), R = (r) => r === null || typeof r != "object" && typeof r != "function", tt = Array.isArray, he = (r) => tt(r) || typeof r?.[Symbol.iterator] == "function", K = `[ | ||
| \f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ft = /-->/g, $t = />/g, b = RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ | ||
| \f\r"'\`<>=]|("|')|))|$)`, "g"), gt = /'/g, yt = /"/g, St = /^(?:script|style|textarea|title)$/i, ae = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), f = ae(1), A = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), mt = /* @__PURE__ */ new WeakMap(), v = E.createTreeWalker(E, 129); | ||
| function At(r, t) { | ||
| if (!tt(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array"); | ||
| return pt !== void 0 ? pt.createHTML(t) : t; | ||
| } | ||
| const Dt = (r, t) => { | ||
| const ce = (r, t) => { | ||
| const e = r.length - 1, s = []; | ||
| let i, o = t === 2 ? "<svg>" : "", n = P; | ||
| for (let a = 0; a < e; a++) { | ||
| const h = r[a]; | ||
| let c, d, l = -1, $ = 0; | ||
| for (; $ < h.length && (n.lastIndex = $, d = n.exec(h), d !== null); ) | ||
| $ = n.lastIndex, n === P ? d[1] === "!--" ? n = rt : d[1] !== void 0 ? n = ot : d[2] !== void 0 ? ($t.test(d[2]) && (i = RegExp("</" + d[2], "g")), n = A) : d[3] !== void 0 && (n = A) : n === A ? d[0] === ">" ? (n = i ?? P, l = -1) : d[1] === void 0 ? l = -2 : (l = n.lastIndex - d[2].length, c = d[1], n = d[3] === void 0 ? A : d[3] === '"' ? ht : nt) : n === ht || n === nt ? n = A : n === rt || n === ot ? n = P : (n = A, i = void 0); | ||
| const g = n === A && r[a + 1].startsWith("/>") ? " " : ""; | ||
| o += n === P ? h + Bt : l >= 0 ? (s.push(c), h.slice(0, l) + ut + h.slice(l) + m + g) : h + m + (l === -2 ? a : g); | ||
| let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = C; | ||
| for (let h = 0; h < e; h++) { | ||
| const a = r[h]; | ||
| let c, d, l = -1, g = 0; | ||
| for (; g < a.length && (n.lastIndex = g, d = n.exec(a), d !== null); ) g = n.lastIndex, n === C ? d[1] === "!--" ? n = ft : d[1] !== void 0 ? n = $t : d[2] !== void 0 ? (St.test(d[2]) && (i = RegExp("</" + d[2], "g")), n = b) : d[3] !== void 0 && (n = b) : n === b ? d[0] === ">" ? (n = i ?? C, l = -1) : d[1] === void 0 ? l = -2 : (l = n.lastIndex - d[2].length, c = d[1], n = d[3] === void 0 ? b : d[3] === '"' ? yt : gt) : n === yt || n === gt ? n = b : n === ft || n === $t ? n = C : (n = b, i = void 0); | ||
| const m = n === b && r[h + 1].startsWith("/>") ? " " : ""; | ||
| o += n === C ? a + ne : l >= 0 ? (s.push(c), a.slice(0, l) + wt + a.slice(l) + _ + m) : a + _ + (l === -2 ? h : m); | ||
| } | ||
| return [gt(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s]; | ||
| return [At(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s]; | ||
| }; | ||
| class k { | ||
| class N { | ||
| constructor({ strings: t, _$litType$: e }, s) { | ||
@@ -618,33 +747,26 @@ let i; | ||
| let o = 0, n = 0; | ||
| const a = t.length - 1, h = this.parts, [c, d] = Dt(t, e); | ||
| if (this.el = k.createElement(c, s), w.currentNode = this.el.content, e === 2) { | ||
| const h = t.length - 1, a = this.parts, [c, d] = ce(t, e); | ||
| if (this.el = N.createElement(c, s), v.currentNode = this.el.content, e === 2 || e === 3) { | ||
| const l = this.el.content.firstChild; | ||
| l.replaceWith(...l.childNodes); | ||
| } | ||
| for (; (i = w.nextNode()) !== null && h.length < a; ) { | ||
| for (; (i = v.nextNode()) !== null && a.length < h; ) { | ||
| if (i.nodeType === 1) { | ||
| if (i.hasAttributes()) | ||
| for (const l of i.getAttributeNames()) | ||
| if (l.endsWith(ut)) { | ||
| const $ = d[n++], g = i.getAttribute(l).split(m), _ = /([.?@])?(.*)/.exec($); | ||
| h.push({ type: 1, index: o, name: _[2], strings: g, ctor: _[1] === "." ? Wt : _[1] === "?" ? Vt : _[1] === "@" ? Kt : z }), i.removeAttribute(l); | ||
| } else | ||
| l.startsWith(m) && (h.push({ type: 6, index: o }), i.removeAttribute(l)); | ||
| if ($t.test(i.tagName)) { | ||
| const l = i.textContent.split(m), $ = l.length - 1; | ||
| if ($ > 0) { | ||
| if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(wt)) { | ||
| const g = d[n++], m = i.getAttribute(l).split(_), H = /([.?@])?(.*)/.exec(g); | ||
| a.push({ type: 1, index: o, name: H[2], strings: m, ctor: H[1] === "." ? de : H[1] === "?" ? ue : H[1] === "@" ? pe : V }), i.removeAttribute(l); | ||
| } else l.startsWith(_) && (a.push({ type: 6, index: o }), i.removeAttribute(l)); | ||
| if (St.test(i.tagName)) { | ||
| const l = i.textContent.split(_), g = l.length - 1; | ||
| if (g > 0) { | ||
| i.textContent = q ? q.emptyScript : ""; | ||
| for (let g = 0; g < $; g++) | ||
| i.append(l[g], U()), w.nextNode(), h.push({ type: 2, index: ++o }); | ||
| i.append(l[$], U()); | ||
| for (let m = 0; m < g; m++) i.append(l[m], O()), v.nextNode(), a.push({ type: 2, index: ++o }); | ||
| i.append(l[g], O()); | ||
| } | ||
| } | ||
| } else if (i.nodeType === 8) | ||
| if (i.data === pt) | ||
| h.push({ type: 2, index: o }); | ||
| else { | ||
| let l = -1; | ||
| for (; (l = i.data.indexOf(m, l + 1)) !== -1; ) | ||
| h.push({ type: 7, index: o }), l += m.length - 1; | ||
| } | ||
| } else if (i.nodeType === 8) if (i.data === Et) a.push({ type: 2, index: o }); | ||
| else { | ||
| let l = -1; | ||
| for (; (l = i.data.indexOf(_, l + 1)) !== -1; ) a.push({ type: 7, index: o }), l += _.length - 1; | ||
| } | ||
| o++; | ||
@@ -654,15 +776,13 @@ } | ||
| static createElement(t, e) { | ||
| const s = S.createElement("template"); | ||
| const s = E.createElement("template"); | ||
| return s.innerHTML = t, s; | ||
| } | ||
| } | ||
| function T(r, t, e = r, s) { | ||
| var n, a; | ||
| if (t === C) | ||
| return t; | ||
| let i = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl; | ||
| const o = O(t) ? void 0 : t._$litDirective$; | ||
| return (i == null ? void 0 : i.constructor) !== o && ((a = i == null ? void 0 : i._$AO) == null || a.call(i, !1), o === void 0 ? i = void 0 : (i = new o(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = T(r, i._$AS(r, t.values), i, s)), t; | ||
| function x(r, t, e = r, s) { | ||
| if (t === A) return t; | ||
| let i = s !== void 0 ? e._$Co?.[s] : e._$Cl; | ||
| const o = R(t) ? void 0 : t._$litDirective$; | ||
| 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 = x(r, i._$AS(r, t.values), i, s)), t; | ||
| } | ||
| class zt { | ||
| class le { | ||
| constructor(t, e) { | ||
@@ -678,27 +798,25 @@ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e; | ||
| u(t) { | ||
| const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? S).importNode(e, !0); | ||
| w.currentNode = i; | ||
| let o = w.nextNode(), n = 0, a = 0, h = s[0]; | ||
| for (; h !== void 0; ) { | ||
| if (n === h.index) { | ||
| const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? E).importNode(e, !0); | ||
| v.currentNode = i; | ||
| let o = v.nextNode(), n = 0, h = 0, a = s[0]; | ||
| for (; a !== void 0; ) { | ||
| if (n === a.index) { | ||
| let c; | ||
| h.type === 2 ? c = new M(o, o.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(o, h.name, h.strings, this, t) : h.type === 6 && (c = new Qt(o, this, t)), this._$AV.push(c), h = s[++a]; | ||
| a.type === 2 ? c = new j(o, o.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (c = new fe(o, this, t)), this._$AV.push(c), a = s[++h]; | ||
| } | ||
| n !== (h == null ? void 0 : h.index) && (o = w.nextNode(), n++); | ||
| n !== a?.index && (o = v.nextNode(), n++); | ||
| } | ||
| return w.currentNode = S, i; | ||
| return v.currentNode = E, i; | ||
| } | ||
| p(t) { | ||
| let e = 0; | ||
| 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++; | ||
| 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++; | ||
| } | ||
| } | ||
| class M { | ||
| class j { | ||
| get _$AU() { | ||
| var t; | ||
| return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv; | ||
| return this._$AM?._$AU ?? this._$Cv; | ||
| } | ||
| constructor(t, e, s, i) { | ||
| this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0; | ||
| this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = i?.isConnected ?? !0; | ||
| } | ||
@@ -708,3 +826,3 @@ get parentNode() { | ||
| const e = this._$AM; | ||
| return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t; | ||
| return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t; | ||
| } | ||
@@ -718,48 +836,43 @@ get startNode() { | ||
| _$AI(t, e = this) { | ||
| t = T(this, t, e), O(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : qt(t) ? this.k(t) : this._(t); | ||
| t = x(this, t, e), R(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== A && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : he(t) ? this.k(t) : this._(t); | ||
| } | ||
| S(t) { | ||
| O(t) { | ||
| return this._$AA.parentNode.insertBefore(t, this._$AB); | ||
| } | ||
| T(t) { | ||
| this._$AH !== t && (this._$AR(), this._$AH = this.S(t)); | ||
| this._$AH !== t && (this._$AR(), this._$AH = this.O(t)); | ||
| } | ||
| _(t) { | ||
| this._$AH !== u && O(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t; | ||
| this._$AH !== u && R(this._$AH) ? this._$AA.nextSibling.data = t : this.T(E.createTextNode(t)), this._$AH = t; | ||
| } | ||
| $(t) { | ||
| var o; | ||
| const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = k.createElement(gt(s.h, s.h[0]), this.options)), s); | ||
| if (((o = this._$AH) == null ? void 0 : o._$AD) === i) | ||
| this._$AH.p(e); | ||
| const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = N.createElement(At(s.h, s.h[0]), this.options)), s); | ||
| if (this._$AH?._$AD === i) this._$AH.p(e); | ||
| else { | ||
| const n = new zt(i, this), a = n.u(this.options); | ||
| n.p(e), this.T(a), this._$AH = n; | ||
| const o = new le(i, this), n = o.u(this.options); | ||
| o.p(e), this.T(n), this._$AH = o; | ||
| } | ||
| } | ||
| _$AC(t) { | ||
| let e = at.get(t.strings); | ||
| return e === void 0 && at.set(t.strings, e = new k(t)), e; | ||
| let e = mt.get(t.strings); | ||
| return e === void 0 && mt.set(t.strings, e = new N(t)), e; | ||
| } | ||
| k(t) { | ||
| ft(this._$AH) || (this._$AH = [], this._$AR()); | ||
| tt(this._$AH) || (this._$AH = [], this._$AR()); | ||
| const e = this._$AH; | ||
| let s, i = 0; | ||
| for (const o of t) | ||
| i === e.length ? e.push(s = new M(this.S(U()), this.S(U()), this, this.options)) : s = e[i], s._$AI(o), i++; | ||
| for (const o of t) i === e.length ? e.push(s = new j(this.O(O()), this.O(O()), this, this.options)) : s = e[i], s._$AI(o), i++; | ||
| i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i); | ||
| } | ||
| _$AR(t = this._$AA.nextSibling, e) { | ||
| var s; | ||
| for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) { | ||
| const i = t.nextSibling; | ||
| t.remove(), t = i; | ||
| for (this._$AP?.(!1, !0, e); t !== this._$AB; ) { | ||
| const s = t.nextSibling; | ||
| t.remove(), t = s; | ||
| } | ||
| } | ||
| setConnected(t) { | ||
| var e; | ||
| this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t)); | ||
| this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t)); | ||
| } | ||
| } | ||
| class z { | ||
| class V { | ||
| get tagName() { | ||
@@ -777,9 +890,7 @@ return this.element.tagName; | ||
| let n = !1; | ||
| if (o === void 0) | ||
| t = T(this, t, e, 0), n = !O(t) || t !== this._$AH && t !== C, n && (this._$AH = t); | ||
| if (o === void 0) t = x(this, t, e, 0), n = !R(t) || t !== this._$AH && t !== A, n && (this._$AH = t); | ||
| else { | ||
| const a = t; | ||
| let h, c; | ||
| for (t = o[0], h = 0; h < o.length - 1; h++) | ||
| c = T(this, a[s + h], e, h), c === C && (c = this._$AH[h]), n || (n = !O(c) || c !== this._$AH[h]), c === u ? t = u : t !== u && (t += (c ?? "") + o[h + 1]), this._$AH[h] = c; | ||
| const h = t; | ||
| let a, c; | ||
| for (t = o[0], a = 0; a < o.length - 1; a++) c = x(this, h[s + a], e, a), c === A && (c = this._$AH[a]), n ||= !R(c) || c !== this._$AH[a], c === u ? t = u : t !== u && (t += (c ?? "") + o[a + 1]), this._$AH[a] = c; | ||
| } | ||
@@ -792,3 +903,3 @@ n && !i && this.j(t); | ||
| } | ||
| class Wt extends z { | ||
| class de extends V { | ||
| constructor() { | ||
@@ -801,3 +912,3 @@ super(...arguments), this.type = 3; | ||
| } | ||
| class Vt extends z { | ||
| class ue extends V { | ||
| constructor() { | ||
@@ -810,3 +921,3 @@ super(...arguments), this.type = 4; | ||
| } | ||
| class Kt extends z { | ||
| class pe extends V { | ||
| constructor(t, e, s, i, o) { | ||
@@ -816,4 +927,3 @@ super(t, e, s, i, o), this.type = 5; | ||
| _$AI(t, e = this) { | ||
| if ((t = T(this, t, e, 0) ?? u) === C) | ||
| return; | ||
| if ((t = x(this, t, e, 0) ?? u) === A) return; | ||
| const s = this._$AH, i = t === u && s !== u || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== u && (s === u || i); | ||
@@ -823,7 +933,6 @@ i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t; | ||
| handleEvent(t) { | ||
| var e; | ||
| typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t); | ||
| typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t); | ||
| } | ||
| } | ||
| class Qt { | ||
| class fe { | ||
| constructor(t, e, s) { | ||
@@ -836,22 +945,18 @@ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s; | ||
| _$AI(t) { | ||
| T(this, t); | ||
| x(this, t); | ||
| } | ||
| } | ||
| const K = N.litHtmlPolyfillSupport; | ||
| K == null || K(k, M), (N.litHtmlVersions ?? (N.litHtmlVersions = [])).push("3.1.3"); | ||
| const Ft = (r, t, e) => { | ||
| const s = (e == null ? void 0 : e.renderBefore) ?? t; | ||
| const $e = Y.litHtmlPolyfillSupport; | ||
| $e?.(N, j), (Y.litHtmlVersions ??= []).push("3.3.1"); | ||
| const ge = (r, t, e) => { | ||
| const s = e?.renderBefore ?? t; | ||
| let i = s._$litPart$; | ||
| if (i === void 0) { | ||
| const o = (e == null ? void 0 : e.renderBefore) ?? null; | ||
| s._$litPart$ = i = new M(t.insertBefore(U(), o), o, void 0, e ?? {}); | ||
| const o = e?.renderBefore ?? null; | ||
| s._$litPart$ = i = new j(t.insertBefore(O(), o), o, void 0, e ?? {}); | ||
| } | ||
| return i._$AI(r), i; | ||
| }; | ||
| /** | ||
| * @license | ||
| * Copyright 2017 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| class E extends x { | ||
| const et = globalThis; | ||
| class w extends S { | ||
| constructor() { | ||
@@ -861,52 +966,38 @@ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; | ||
| createRenderRoot() { | ||
| var e; | ||
| const t = super.createRenderRoot(); | ||
| return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t; | ||
| return this.renderOptions.renderBefore ??= t.firstChild, t; | ||
| } | ||
| update(t) { | ||
| const e = this.render(); | ||
| this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ft(e, this.renderRoot, this.renderOptions); | ||
| this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = ge(e, this.renderRoot, this.renderOptions); | ||
| } | ||
| connectedCallback() { | ||
| var t; | ||
| super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0); | ||
| super.connectedCallback(), this._$Do?.setConnected(!0); | ||
| } | ||
| disconnectedCallback() { | ||
| var t; | ||
| super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1); | ||
| super.disconnectedCallback(), this._$Do?.setConnected(!1); | ||
| } | ||
| render() { | ||
| return C; | ||
| return A; | ||
| } | ||
| } | ||
| var ct; | ||
| E._$litElement$ = !0, E.finalized = !0, (ct = globalThis.litElementHydrateSupport) == null || ct.call(globalThis, { LitElement: E }); | ||
| const Q = globalThis.litElementPolyfillSupport; | ||
| Q == null || Q({ LitElement: E }); | ||
| (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.5"); | ||
| /** | ||
| * @license | ||
| * Copyright 2017 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| const X = (r) => (t, e) => { | ||
| e !== void 0 ? e.addInitializer(() => { | ||
| w._$litElement$ = !0, w.finalized = !0, et.litElementHydrateSupport?.({ LitElement: w }); | ||
| const ye = et.litElementPolyfillSupport; | ||
| ye?.({ LitElement: w }); | ||
| (et.litElementVersions ??= []).push("4.2.1"); | ||
| const st = (r) => (t, e) => { | ||
| e !== void 0 ? e.addInitializer((() => { | ||
| customElements.define(r, t); | ||
| }) : customElements.define(r, t); | ||
| })) : customElements.define(r, t); | ||
| }; | ||
| /** | ||
| * @license | ||
| * Copyright 2017 Google LLC | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
| const Jt = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: D }, Xt = (r = Jt, t, e) => { | ||
| const me = { attribute: !0, type: String, converter: L, reflect: !1, hasChanged: G }, _e = (r = me, t, e) => { | ||
| const { kind: s, metadata: i } = e; | ||
| let o = globalThis.litPropertyMetadata.get(i); | ||
| if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), o.set(e.name, r), s === "accessor") { | ||
| 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") { | ||
| const { name: n } = e; | ||
| return { set(a) { | ||
| const h = t.get.call(this); | ||
| t.set.call(this, a), this.requestUpdate(n, h, r); | ||
| }, init(a) { | ||
| return a !== void 0 && this.P(n, void 0, r), a; | ||
| return { set(h) { | ||
| const a = t.get.call(this); | ||
| t.set.call(this, h), this.requestUpdate(n, a, r); | ||
| }, init(h) { | ||
| return h !== void 0 && this.C(n, void 0, r, h), h; | ||
| } }; | ||
@@ -916,5 +1007,5 @@ } | ||
| const { name: n } = e; | ||
| return function(a) { | ||
| const h = this[n]; | ||
| t.call(this, a), this.requestUpdate(n, h, r); | ||
| return function(h) { | ||
| const a = this[n]; | ||
| t.call(this, h), this.requestUpdate(n, a, r); | ||
| }; | ||
@@ -925,8 +1016,8 @@ } | ||
| function p(r) { | ||
| return (t, e) => typeof e == "object" ? Xt(r, t, e) : ((s, i, o) => { | ||
| return (t, e) => typeof e == "object" ? _e(r, t, e) : ((s, i, o) => { | ||
| const n = i.hasOwnProperty(o); | ||
| return i.constructor.createProperty(o, n ? { ...s, wrapped: !0 } : s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0; | ||
| return i.constructor.createProperty(o, s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0; | ||
| })(r, t, e); | ||
| } | ||
| class Zt extends Error { | ||
| class be extends Error { | ||
| constructor(t, e) { | ||
@@ -939,3 +1030,3 @@ super(t), this.name = "TopsortRequestError", this.status = e; | ||
| } | ||
| class Gt extends Error { | ||
| class ve extends Error { | ||
| constructor(t, e) { | ||
@@ -949,3 +1040,7 @@ let s = "Missing "; | ||
| } | ||
| const bt = () => { | ||
| function we() { | ||
| if (window.TS?.getUserId && typeof window.TS.getUserId == "function") | ||
| return window.TS.getUserId(); | ||
| } | ||
| const xt = () => { | ||
| const r = navigator.userAgent; | ||
@@ -956,4 +1051,6 @@ return /(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(r) || /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test( | ||
| }; | ||
| async function Yt(r, { signal: t, logError: e }) { | ||
| const s = bt(), i = window.TS.token, o = window.TS.url || "https://api.topsort.com", n = await fetch(new URL(`${o}/v2/auctions`), { | ||
| async function Ee(r, { signal: t, logError: e }) { | ||
| const s = xt(), i = window.TS.token, o = window.TS.url || "https://api.topsort.com", n = we(); | ||
| n && (r.opaqueUserId = n); | ||
| const h = await fetch(new URL(`${o}/v2/auctions`), { | ||
| method: "POST", | ||
@@ -964,3 +1061,3 @@ mode: "cors", | ||
| "Content-Type": "application/json", | ||
| "X-UA": `topsort/banners-0.5.2 (${s})` | ||
| "X-UA": `topsort/banners-0.6.0 (${s})` | ||
| }, | ||
@@ -972,19 +1069,18 @@ body: JSON.stringify({ | ||
| }); | ||
| if (!n.ok) { | ||
| const c = await n.json(); | ||
| throw e(c), new Error(c.message); | ||
| if (!h.ok) { | ||
| const d = await h.json(); | ||
| throw new Error(d.message); | ||
| } | ||
| const h = (await n.json()).results[0]; | ||
| if (!h) | ||
| throw new Zt("No auction results", n.status); | ||
| if (h.error) | ||
| throw e(h.error), new Error(h.error); | ||
| return h.winners; | ||
| const c = (await h.json()).results[0]; | ||
| if (!c) throw new be("No auction results", h.status); | ||
| if (c.error) | ||
| throw e(c.error), new Error(c.error); | ||
| return c.winners; | ||
| } | ||
| var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, y = (r, t, e, s) => { | ||
| for (var i = s > 1 ? void 0 : s ? ee(t, e) : t, o = r.length - 1, n; o >= 0; o--) | ||
| (n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i); | ||
| return s && i && te(t, e, i), i; | ||
| var Se = Object.defineProperty, y = (r, t, e, s) => { | ||
| for (var i = void 0, o = r.length - 1, n; o >= 0; o--) | ||
| (n = r[o]) && (i = n(t, e, i) || i); | ||
| return i && Se(t, e, i), i; | ||
| }; | ||
| const se = (r) => { | ||
| const Ae = (r) => { | ||
| class t extends r { | ||
@@ -995,3 +1091,3 @@ constructor() { | ||
| buildAuction(s) { | ||
| const i = bt(), o = { | ||
| const i = xt(), o = { | ||
| type: "banners", | ||
@@ -1023,32 +1119,32 @@ slots: s, | ||
| p({ type: Number }) | ||
| ], t.prototype, "width", 2), y([ | ||
| ], t.prototype, "width"), y([ | ||
| p({ type: Number }) | ||
| ], t.prototype, "height", 2), y([ | ||
| ], t.prototype, "height"), y([ | ||
| p({ attribute: "id", type: String }) | ||
| ], t.prototype, "slotId", 2), y([ | ||
| ], t.prototype, "slotId"), y([ | ||
| p({ attribute: "category-id", type: String }) | ||
| ], t.prototype, "categoryId", 2), y([ | ||
| ], t.prototype, "categoryId"), y([ | ||
| p({ attribute: "category-ids", type: String }) | ||
| ], t.prototype, "categoryIds", 2), y([ | ||
| ], t.prototype, "categoryIds"), y([ | ||
| p({ attribute: "category-disjunctions", type: String }) | ||
| ], t.prototype, "categoryDisjunctions", 2), y([ | ||
| ], t.prototype, "categoryDisjunctions"), y([ | ||
| p({ attribute: "search-query", type: String }) | ||
| ], t.prototype, "searchQuery", 2), y([ | ||
| ], t.prototype, "searchQuery"), y([ | ||
| p({ attribute: "location", type: String }) | ||
| ], t.prototype, "location", 2), y([ | ||
| ], t.prototype, "location"), y([ | ||
| p({ attribute: "new-tab", type: Boolean }) | ||
| ], t.prototype, "newTab", 2), t; | ||
| ], t.prototype, "newTab"), t; | ||
| }; | ||
| var ie = Object.defineProperty, re = Object.getOwnPropertyDescriptor, b = (r, t, e, s) => { | ||
| for (var i = s > 1 ? void 0 : s ? re(t, e) : t, o = r.length - 1, n; o >= 0; o--) | ||
| var xe = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, $ = (r, t, e, s) => { | ||
| for (var i = s > 1 ? void 0 : s ? Pe(t, e) : t, o = r.length - 1, n; o >= 0; o--) | ||
| (n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i); | ||
| return s && i && ie(t, e, i), i; | ||
| return s && i && xe(t, e, i), i; | ||
| }; | ||
| window.TS_BANNERS = window.TS_BANNERS || {}; | ||
| function oe(r) { | ||
| function Ce(r) { | ||
| } | ||
| function ne(r) { | ||
| function Te(r) { | ||
| return window.TS_BANNERS.getLink ? window.TS_BANNERS.getLink(r) : r.type === "url" ? r.id : `${r.type}/${r.id}`; | ||
| } | ||
| function yt() { | ||
| function Pt() { | ||
| if (window.TS_BANNERS.getLoadingElement) { | ||
@@ -1060,3 +1156,3 @@ const r = window.TS_BANNERS.getLoadingElement(); | ||
| } | ||
| function F(r) { | ||
| function J(r) { | ||
| if (window.TS_BANNERS.getErrorElement) { | ||
@@ -1068,3 +1164,3 @@ const t = window.TS_BANNERS.getErrorElement(r); | ||
| } | ||
| function _t() { | ||
| function Ct() { | ||
| if (window.TS_BANNERS.getNoWinnersElement) { | ||
@@ -1076,18 +1172,13 @@ const r = window.TS_BANNERS.getNoWinnersElement(); | ||
| } | ||
| function mt(r, t, e, s) { | ||
| var c, d; | ||
| function Tt(r, t, e, s) { | ||
| if (window.TS_BANNERS.getBannerElement) { | ||
| const l = window.TS_BANNERS.getBannerElement(r); | ||
| return f`${l}`; | ||
| const c = window.TS_BANNERS.getBannerElement(r); | ||
| return f`${c}`; | ||
| } | ||
| if (!((d = (c = r.asset) == null ? void 0 : c[0]) != null && d.url)) | ||
| if (!r.asset?.[0]?.url) | ||
| return f``; | ||
| const i = r.asset[0].url, n = (() => { | ||
| try { | ||
| const $ = new URL(i).pathname.split("/"), g = $.indexOf("manifest"); | ||
| if (g >= 0) { | ||
| const _ = $[g + 1]; | ||
| return (_ == null ? void 0 : _.startsWith("video")) ?? !1; | ||
| } | ||
| return !1; | ||
| const d = new URL(i).pathname.split("/"), l = d.indexOf("manifest"); | ||
| return l >= 0 ? d[l + 1]?.startsWith("video") ?? !1 : !1; | ||
| } catch { | ||
@@ -1108,3 +1199,3 @@ return !1; | ||
| /> | ||
| `, a = ne(r), h = s ? f`<a href="${a}" target="_blank">${n}</a>` : f`<a href="${a}">${n}</a>`; | ||
| `, h = Te(r), a = s ? f`<a href="${h}" target="_blank">${n}</a>` : f`<a href="${h}">${n}</a>`; | ||
| return f` | ||
@@ -1116,20 +1207,14 @@ <div | ||
| > | ||
| ${h} | ||
| ${a} | ||
| </div> | ||
| `; | ||
| } | ||
| const vt = Symbol("banner-context"), he = (r, t) => { | ||
| var e, s; | ||
| return !t && r ? !0 : r == null || t == null ? !1 : r.width !== t.width || r.height !== t.height || r.newTab !== t.newTab || !!r.error != !!t.error || ((e = r.banners) == null ? void 0 : e.length) !== ((s = t.banners) == null ? void 0 : s.length); | ||
| }; | ||
| let I = class extends se(E) { | ||
| const Ut = Symbol("banner-context"), Ue = (r, t) => !t && r ? !0 : r == null || t == null ? !1 : r.width !== t.width || r.height !== t.height || r.newTab !== t.newTab || !!r.error != !!t.error || r.banners?.length !== t.banners?.length; | ||
| let k = class extends Ae(w) { | ||
| constructor() { | ||
| super(...arguments), this.task = new Mt(this, { | ||
| task: ([r], t) => Yt(this.buildAuction(r), { ...t, logError: oe }).then((e) => (t.signal.throwIfAborted(), this.isContext && (this.context = { ...this.context, banners: e }), e)).catch((e) => { | ||
| super(...arguments), this.task = new Ft(this, { | ||
| task: ([r], t) => Ee(this.buildAuction(r), { ...t, logError: Ce }).then((e) => (t.signal.throwIfAborted(), this.isContext && (this.context = { ...this.context, banners: e }), e)).catch((e) => { | ||
| throw t.signal.throwIfAborted(), this.isContext && (this.context = { ...this.context, error: e }), e; | ||
| }), | ||
| args: () => { | ||
| var r; | ||
| return [((r = this.slots) == null ? void 0 : r.length) || 1]; | ||
| } | ||
| args: () => [this.slots?.length || 1] | ||
| }), this.context = { | ||
@@ -1142,6 +1227,6 @@ width: this.width, | ||
| render() { | ||
| return !window.TS.token || !this.slotId ? F(new Gt(window.TS.token, this.slotId)) : this.isContext ? f`` : this.task.render({ | ||
| pending: () => yt(), | ||
| complete: (r) => (this.emitEvent(r.length ? "ready" : "nowinners"), r.length ? mt(r[0], this.width, this.height, this.newTab) : _t()), | ||
| error: (r) => F(r) | ||
| return !window.TS.token || !this.slotId ? J(new ve(window.TS.token, this.slotId)) : this.isContext ? f`` : this.task.render({ | ||
| pending: () => Pt(), | ||
| complete: (r) => (this.emitEvent(r.length ? "ready" : "nowinners"), r.length ? Tt(r[0], this.width, this.height, this.newTab) : Ct()), | ||
| error: (r) => J(r) | ||
| }); | ||
@@ -1165,16 +1250,16 @@ } | ||
| }; | ||
| b([ | ||
| Et({ context: vt }), | ||
| p({ attribute: !1, hasChanged: he }) | ||
| ], I.prototype, "context", 2); | ||
| b([ | ||
| $([ | ||
| Nt({ context: Ut }), | ||
| p({ attribute: !1, hasChanged: Ue }) | ||
| ], k.prototype, "context", 2); | ||
| $([ | ||
| p({ type: Boolean, attribute: "context" }) | ||
| ], I.prototype, "isContext", 2); | ||
| b([ | ||
| ], k.prototype, "isContext", 2); | ||
| $([ | ||
| p({ attribute: !1, state: !0 }) | ||
| ], I.prototype, "slots", 2); | ||
| I = b([ | ||
| X("topsort-banner") | ||
| ], I); | ||
| let L = class extends E { | ||
| ], k.prototype, "slots", 2); | ||
| k = $([ | ||
| st("topsort-banner") | ||
| ], k); | ||
| let D = class extends w { | ||
| constructor() { | ||
@@ -1184,3 +1269,3 @@ super(...arguments), this.rank = 0; | ||
| render() { | ||
| return this.context ? this.context.banners ? this.context.error ? F(this.context.error) : !this.context.banners.length || this.context.banners.length < this.rank ? _t() : mt( | ||
| return this.context ? this.context.banners ? this.context.error ? J(this.context.error) : !this.context.banners.length || this.context.banners.length < this.rank ? Ct() : Tt( | ||
| this.context.banners[this.rank - 1], | ||
@@ -1190,3 +1275,3 @@ this.context.width, | ||
| this.context.newTab | ||
| ) : yt() : f``; | ||
| ) : Pt() : f``; | ||
| } | ||
@@ -1198,13 +1283,13 @@ // avoid shadow dom since we cannot attach to events via analytics.js | ||
| }; | ||
| b([ | ||
| St({ context: vt, subscribe: !0 }), | ||
| $([ | ||
| kt({ context: Ut, subscribe: !0 }), | ||
| p({ attribute: !1 }) | ||
| ], L.prototype, "context", 2); | ||
| b([ | ||
| ], D.prototype, "context", 2); | ||
| $([ | ||
| p({ attribute: "rank", type: Number }) | ||
| ], L.prototype, "rank", 2); | ||
| L = b([ | ||
| X("topsort-banner-slot") | ||
| ], L); | ||
| let H = class extends E { | ||
| ], D.prototype, "rank", 2); | ||
| D = $([ | ||
| st("topsort-banner-slot") | ||
| ], D); | ||
| let M = class extends w { | ||
| constructor() { | ||
@@ -1231,10 +1316,15 @@ super(...arguments), this.src = "", this.width = "800px", this.height = "400px"; | ||
| } | ||
| firstUpdated() { | ||
| const r = this.shadowRoot.getElementById(this.videoId); | ||
| if (!r) | ||
| async firstUpdated() { | ||
| const r = this.shadowRoot?.getElementById(this.videoId); | ||
| if (!r) return; | ||
| r.style.width = this.width, r.style.height = this.height, r.style.objectFit = "cover"; | ||
| let t; | ||
| try { | ||
| t = await Re.load(); | ||
| } catch (s) { | ||
| console.error("Failed to load HLS.js:", s); | ||
| return; | ||
| r.style.width = this.width, r.style.height = this.height, r.style.objectFit = "cover"; | ||
| const t = window.Hls; | ||
| } | ||
| if (!t) { | ||
| console.error("Hls.js not loaded"); | ||
| console.error("HLS.js not available after load"); | ||
| return; | ||
@@ -1248,19 +1338,37 @@ } | ||
| }; | ||
| b([ | ||
| $([ | ||
| p({ type: String }) | ||
| ], H.prototype, "src", 2); | ||
| b([ | ||
| ], M.prototype, "src", 2); | ||
| $([ | ||
| p({ type: String }) | ||
| ], H.prototype, "width", 2); | ||
| b([ | ||
| ], M.prototype, "width", 2); | ||
| $([ | ||
| p({ type: String }) | ||
| ], H.prototype, "height", 2); | ||
| H = b([ | ||
| X("hls-video") | ||
| ], H); | ||
| ], M.prototype, "height", 2); | ||
| M = $([ | ||
| st("hls-video") | ||
| ], M); | ||
| class Oe { | ||
| constructor() { | ||
| this.loadPromise = null; | ||
| } | ||
| load() { | ||
| return this.loadPromise ? this.loadPromise : window.Hls ? (this.loadPromise = Promise.resolve(window.Hls), this.loadPromise) : (this.loadPromise = new Promise((t, e) => { | ||
| const s = document.createElement("script"); | ||
| s.src = "https://cdn.jsdelivr.net/npm/hls.js@1.6.13/dist/hls.min.js", s.onload = () => { | ||
| window.Hls ? t(window.Hls) : e(new Error("HLS.js loaded but not available")); | ||
| }, s.onerror = () => { | ||
| e(new Error("Failed to load HLS.js")); | ||
| }, document.head.appendChild(s); | ||
| }).catch((t) => { | ||
| throw this.loadPromise = null, t; | ||
| }), this.loadPromise); | ||
| } | ||
| } | ||
| const Re = new Oe(); | ||
| export { | ||
| H as HlsVideo, | ||
| I as TopsortBanner, | ||
| L as TopsortBannerSlot | ||
| M as HlsVideo, | ||
| k as TopsortBanner, | ||
| D as TopsortBannerSlot | ||
| }; | ||
| //# sourceMappingURL=banners.mjs.map |
+15
-10
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@topsort/banners", | ||
| "version": "0.5.2", | ||
| "version": "0.6.0", | ||
| "description": "A web component for displaying Topsort banner ads.", | ||
| "type": "module", | ||
| "author": "Topsort", | ||
| "packageManager": "pnpm@9.0.6", | ||
| "packageManager": "pnpm@10.23.0", | ||
| "repository": { | ||
@@ -49,14 +49,19 @@ "url": "https://github.com/Topsort/banners.js" | ||
| "devDependencies": { | ||
| "@biomejs/biome": "2.2.4", | ||
| "@types/node": "20.12.7", | ||
| "typescript": "5.4.5", | ||
| "vite": "5.2.9", | ||
| "vite-plugin-dts": "3.8.3" | ||
| "@biomejs/biome": "2.3.7", | ||
| "@types/node": "24.10.1", | ||
| "typescript": "5.9.3", | ||
| "vite": "7.2.4", | ||
| "vite-plugin-dts": "4.5.4" | ||
| }, | ||
| "dependencies": { | ||
| "@lit/context": "1.1.2", | ||
| "@lit/task": "1.0.1", | ||
| "lit": "3.1.3", | ||
| "@lit/context": "1.1.6", | ||
| "@lit/task": "1.0.3", | ||
| "lit": "3.3.1", | ||
| "skeleton-webcomponent-loader": "2.1.4" | ||
| }, | ||
| "pnpm": { | ||
| "overrides": { | ||
| "brace-expansion": ">=2.0.2" | ||
| } | ||
| } | ||
| } |
+20
-1
@@ -16,3 +16,3 @@  | ||
| type="module" | ||
| src="https://unpkg.com/@topsort/banners@0.5.2/dist/banners.mjs" | ||
| src="https://unpkg.com/@topsort/banners@0.6.0/dist/banners.mjs" | ||
| ></script> | ||
@@ -107,2 +107,21 @@ <script async type="module" src="https://unpkg.com/@topsort/analytics.js"></script> | ||
| ## Custom User ID (Optional) | ||
| If you want to use your own user identification system instead of the automatic opaque user ID, you can override the `getUserId` function in the `window.TS` configuration. | ||
| Your custom `getUserId` function should return the user's ID as a string. You are responsible for generating and persisting the ID (e.g., in a cookie or local storage). | ||
| ```javascript | ||
| window.TS = { | ||
| token: "<your topsort api key>", | ||
| getUserId() { | ||
| // Return your custom user ID | ||
| // This will be used for both auction requests and event reporting | ||
| return globalUserId ?? generateAndStoreUserId(); | ||
| }, | ||
| }; | ||
| ``` | ||
| This configuration needs to be set before analytics.js is loaded or imported. | ||
| # Listening to events | ||
@@ -109,0 +128,0 @@ The banner component emits an event when the state changes. You can listen to this event to write custom logic. |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
158239
18.53%1388
7.26%150
14.5%4
-20%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated
Updated