You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@topsort/banners

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@topsort/banners - npm Package Compare versions

Comparing version
0.4.0
to
0.4.1
+326
-302
dist/banners.mjs

@@ -6,3 +6,3 @@ /**

*/
let ct = class extends Event {
let at = class extends Event {
constructor(t, e, s) {

@@ -22,9 +22,9 @@ super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = e, this.subscribe = s ?? !1;

*/
let X = class {
let F = class {
constructor(t, e, s, i) {
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, n) => {
this.unsubscribe && (this.unsubscribe !== n && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, n)), this.unsubscribe = n;
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (n, o) => {
this.unsubscribe && (this.unsubscribe !== o && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = n, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(n, o)), this.unsubscribe = o;
}, this.host = t, e.context !== void 0) {
const o = e;
this.context = o.context, this.callback = o.callback, this.subscribe = o.subscribe ?? !1;
const n = e;
this.context = n.context, this.callback = n.callback, this.subscribe = n.subscribe ?? !1;
} else

@@ -41,3 +41,3 @@ this.context = e, this.callback = s, this.subscribe = i ?? !1;

dispatchRequest() {
this.host.dispatchEvent(new ct(this.context, this.t, this.subscribe));
this.host.dispatchEvent(new at(this.context, this.t, this.subscribe));
}

@@ -50,3 +50,3 @@ };

*/
let At = class {
let vt = class {
get value() {

@@ -86,21 +86,21 @@ return this.o;

*/
let wt = class extends Event {
let At = class extends Event {
constructor(t) {
super("context-provider", { bubbles: !0, composed: !0 }), this.context = t;
}
}, Z = class extends At {
}, X = class extends vt {
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)
var i, n;
super(e.context !== void 0 ? e.initialValue : s), this.onContextRequest = (o) => {
const a = o.composedPath()[0];
o.context === this.context && a !== this.host && (o.stopPropagation(), this.addCallback(o.callback, a, o.subscribe));
}, this.onProviderRequest = (o) => {
const a = o.composedPath()[0];
if (o.context !== this.context || a === this.host)
return;
const h = /* @__PURE__ */ new Set();
for (const [c, { consumerHost: u }] of this.subscriptions)
h.has(c) || (h.add(c), u.dispatchEvent(new ct(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);
h.has(c) || (h.add(c), u.dispatchEvent(new at(this.context, c, !0)));
o.stopPropagation();
}, this.host = t, e.context !== void 0 ? this.context = e.context : this.context = e, this.attachListeners(), (n = (i = this.host).addController) == null || n.call(i, this);
}

@@ -111,3 +111,3 @@ attachListeners() {

hostConnected() {
this.host.dispatchEvent(new wt(this.context));
this.host.dispatchEvent(new At(this.context));
}

@@ -120,3 +120,3 @@ };

*/
function Et({ context: r }) {
function wt({ context: r }) {
return (t, e) => {

@@ -126,32 +126,32 @@ const s = /* @__PURE__ */ new WeakMap();

return e.addInitializer(function() {
s.set(this, new Z(this, { context: r }));
s.set(this, new X(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);
var n;
return (n = s.get(this)) == null || n.setValue(i), t.set.call(this, i);
}, init(i) {
var o;
return (o = s.get(this)) == null || o.setValue(i), i;
var n;
return (n = s.get(this)) == null || n.setValue(i), i;
} };
{
t.constructor.addInitializer((n) => {
s.set(n, new Z(n, { context: r }));
t.constructor.addInitializer((o) => {
s.set(o, new X(o, { context: r }));
});
const i = Object.getOwnPropertyDescriptor(t, e);
let o;
let n;
if (i === void 0) {
const n = /* @__PURE__ */ new WeakMap();
o = { get() {
return n.get(this);
const o = /* @__PURE__ */ new WeakMap();
n = { get() {
return o.get(this);
}, set(a) {
s.get(this).setValue(a), n.set(this, a);
s.get(this).setValue(a), o.set(this, a);
}, configurable: !0, enumerable: !0 };
} else {
const n = i.set;
o = { ...i, set(a) {
s.get(this).setValue(a), n == null || n.call(this, a);
const o = i.set;
n = { ...i, set(a) {
s.get(this).setValue(a), o == null || o.call(this, a);
} };
}
return void Object.defineProperty(t, e, o);
return void Object.defineProperty(t, e, n);
}

@@ -165,11 +165,11 @@ };

*/
function St({ context: r, subscribe: t }) {
function Et({ context: r, subscribe: t }) {
return (e, s) => {
typeof s == "object" ? s.addInitializer(function() {
new X(this, { context: r, callback: (i) => {
new F(this, { context: r, callback: (i) => {
e.set.call(this, i);
}, subscribe: t });
}) : e.constructor.addInitializer((i) => {
new X(i, { context: r, callback: (o) => {
i[s] = o;
new F(i, { context: r, callback: (n) => {
i[s] = n;
}, subscribe: t });

@@ -184,6 +184,6 @@ });

*/
const M = globalThis, J = M.ShadowRoot && (M.ShadyCSS === void 0 || M.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, F = Symbol(), G = /* @__PURE__ */ new WeakMap();
let lt = class {
const M = globalThis, J = M.ShadowRoot && (M.ShadyCSS === void 0 || M.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ct = Symbol(), Z = /* @__PURE__ */ new WeakMap();
let St = class {
constructor(t, e, s) {
if (this._$cssResult$ = !0, s !== F)
if (this._$cssResult$ = !0, s !== ct)
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");

@@ -197,3 +197,3 @@ this.cssText = t, this.t = e;

const s = e !== void 0 && e.length === 1;
s && (t = G.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && G.set(e, t));
s && (t = Z.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Z.set(e, t));
}

@@ -206,12 +206,3 @@ return t;

};
const xt = (r) => new lt(typeof r == "string" ? r : r + "", void 0, F), Ct = (r, ...t) => {
const e = r.length === 1 ? r[0] : t.reduce((s, i, o) => s + ((n) => {
if (n._$cssResult$ === !0)
return n.cssText;
if (typeof n == "number")
return n;
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.");
})(i) + r[o + 1], r[0]);
return new lt(e, r, F);
}, Tt = (r, t) => {
const xt = (r) => new St(typeof r == "string" ? r : r + "", void 0, ct), Ct = (r, t) => {
if (J)

@@ -224,3 +215,3 @@ r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);

}
}, Y = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
}, G = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
let e = "";

@@ -236,6 +227,6 @@ for (const s of t.cssRules)

*/
const { is: Pt, defineProperty: Nt, getOwnPropertyDescriptor: Rt, getOwnPropertyNames: Ut, getOwnPropertySymbols: Ot, getPrototypeOf: kt } = Object, y = globalThis, tt = y.trustedTypes, Ht = tt ? tt.emptyScript : "", z = y.reactiveElementPolyfillSupport, P = (r, t) => r, j = { toAttribute(r, t) {
const { is: Tt, defineProperty: Pt, getOwnPropertyDescriptor: Nt, getOwnPropertyNames: Rt, getOwnPropertySymbols: Ut, getPrototypeOf: Ot } = Object, m = globalThis, Y = m.trustedTypes, kt = Y ? Y.emptyScript : "", z = m.reactiveElementPolyfillSupport, N = (r, t) => r, H = { toAttribute(r, t) {
switch (t) {
case Boolean:
r = r ? Ht : null;
r = r ? kt : null;
break;

@@ -265,5 +256,5 @@ case Object:

return e;
} }, L = (r, t) => !Pt(r, t), et = { attribute: !0, type: String, converter: j, reflect: !1, hasChanged: L };
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), y.litPropertyMetadata ?? (y.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
class E extends HTMLElement {
} }, L = (r, t) => !Tt(r, t), tt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: L };
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), m.litPropertyMetadata ?? (m.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
class S extends HTMLElement {
static addInitializer(t) {

@@ -275,35 +266,35 @@ this._$Ei(), (this.l ?? (this.l = [])).push(t);

}
static createProperty(t, e = et) {
static createProperty(t, e = tt) {
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 && Nt(this.prototype, t, i);
i !== void 0 && Pt(this.prototype, t, i);
}
}
static getPropertyDescriptor(t, e, s) {
const { get: i, set: o } = Rt(this.prototype, t) ?? { get() {
const { get: i, set: n } = Nt(this.prototype, t) ?? { get() {
return this[e];
}, set(n) {
this[e] = n;
}, set(o) {
this[e] = o;
} };
return { get() {
return i == null ? void 0 : i.call(this);
}, set(n) {
}, set(o) {
const a = i == null ? void 0 : i.call(this);
o.call(this, n), this.requestUpdate(t, a, s);
n.call(this, o), this.requestUpdate(t, a, s);
}, configurable: !0, enumerable: !0 };
}
static getPropertyOptions(t) {
return this.elementProperties.get(t) ?? et;
return this.elementProperties.get(t) ?? tt;
}
static _$Ei() {
if (this.hasOwnProperty(P("elementProperties")))
if (this.hasOwnProperty(N("elementProperties")))
return;
const t = kt(this);
const t = Ot(this);
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
}
static finalize() {
if (this.hasOwnProperty(P("finalized")))
if (this.hasOwnProperty(N("finalized")))
return;
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
const e = this.properties, s = [...Ut(e), ...Ot(e)];
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(N("properties"))) {
const e = this.properties, s = [...Rt(e), ...Ut(e)];
for (const i of s)

@@ -331,5 +322,5 @@ this.createProperty(i, e[i]);

for (const i of s)
e.unshift(Y(i));
e.unshift(G(i));
} else
t !== void 0 && e.push(Y(t));
t !== void 0 && e.push(G(t));
return e;

@@ -364,3 +355,3 @@ }

const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return Tt(t, this.constructor.elementStyles), t;
return Ct(t, this.constructor.elementStyles), t;
}

@@ -387,15 +378,15 @@ connectedCallback() {

_$EC(t, e) {
var o;
var n;
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 : j).toAttribute(e, s.type);
this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : H).toAttribute(e, s.type);
this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
}
}
_$AK(t, e) {
var o;
var n;
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 : j;
this._$Em = i, this[i] = a.fromAttribute(e, n.type), this._$Em = null;
const o = s.getPropertyOptions(i), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : H;
this._$Em = i, this[i] = a.fromAttribute(e, o.type), this._$Em = null;
}

@@ -433,4 +424,4 @@ }

if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
for (const [o, n] of this._$Ep)
this[o] = n;
for (const [n, o] of this._$Ep)
this[n] = o;
this._$Ep = void 0;

@@ -440,4 +431,4 @@ }

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);
for (const [n, o] of i)
o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], o);
}

@@ -448,4 +439,4 @@ let t = !1;

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);
var n;
return (n = i.hostUpdate) == null ? void 0 : n.call(i);
}), this.update(e)) : this._$EU();

@@ -486,3 +477,3 @@ } catch (i) {

}
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[P("elementProperties")] = /* @__PURE__ */ new Map(), E[P("finalized")] = /* @__PURE__ */ new Map(), z == null || z({ ReactiveElement: E }), (y.reactiveElementVersions ?? (y.reactiveElementVersions = [])).push("2.0.4");
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[N("elementProperties")] = /* @__PURE__ */ new Map(), S[N("finalized")] = /* @__PURE__ */ new Map(), z == null || z({ ReactiveElement: S }), (m.reactiveElementVersions ?? (m.reactiveElementVersions = [])).push("2.0.4");
/**

@@ -493,4 +484,4 @@ * @license

*/
const It = Symbol();
let Mt = class {
const jt = Symbol();
let It = class {
get taskComplete() {

@@ -502,6 +493,6 @@ return this.t || (this.i === 1 ? this.t = new Promise((t, e) => {

constructor(t, e, s) {
var o;
var n;
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 ?? Mt, 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 = (n = this.T) == null ? void 0 : n.call(this));
}

@@ -527,18 +518,18 @@ hostUpdate() {

async run(t) {
var n, a, h, c, u;
var o, a, h, c, u;
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 ?? (t = this.T()), this.O = t, this.i === 1 ? (o = this.q) == null || o.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;
this.q = new AbortController();
let o = !1;
let n = !1;
try {
e = await this.v(t, { signal: this.q.signal });
} catch (l) {
o = !0, s = l;
n = !0, s = l;
}
if (this.p === i) {
if (e === It)
if (e === jt)
this.i = 0;
else {
if (o === !1) {
if (n === !1) {
try {

@@ -575,3 +566,3 @@ (a = this.k) == null || a.call(this, e);

render(t) {
var e, s, i, o;
var e, s, i, n;
switch (this.i) {

@@ -585,3 +576,3 @@ case 0:

case 3:
return (o = t.error) == null ? void 0 : o.call(t, this.error);
return (n = t.error) == null ? void 0 : n.call(t, this.error);
default:

@@ -592,3 +583,3 @@ throw Error("Unexpected status: " + this.i);

};
const jt = (r, t) => r === t || r.length === t.length && r.every((e, s) => !L(e, t[s]));
const Mt = (r, t) => r === t || r.length === t.length && r.every((e, s) => !L(e, t[s]));
/**

@@ -599,76 +590,76 @@ * @license

*/
const N = globalThis, B = N.trustedTypes, st = B ? B.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ut = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, dt = "?" + _, Bt = `<${dt}>`, A = document, R = () => A.createComment(""), U = (r) => r === null || typeof r != "object" && typeof r != "function", pt = Array.isArray, qt = (r) => pt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", W = `[
\f\r]`, T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g, rt = />/g, m = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ot = /"/g, $t = /^(?:script|style|textarea|title)$/i, Lt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), $ = Lt(1), x = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), ht = /* @__PURE__ */ new WeakMap(), v = A.createTreeWalker(A, 129);
const R = globalThis, B = R.trustedTypes, et = B ? B.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, lt = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, ut = "?" + _, Ht = `<${ut}>`, w = document, U = () => w.createComment(""), O = (r) => r === null || typeof r != "object" && typeof r != "function", dt = Array.isArray, Bt = (r) => dt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", W = `[
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, it = />/g, v = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), rt = /'/g, nt = /"/g, pt = /^(?:script|style|textarea|title)$/i, qt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), p = qt(1), C = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), ot = /* @__PURE__ */ new WeakMap(), A = w.createTreeWalker(w, 129);
function ft(r, t) {
if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
throw Error("invalid template strings array");
return st !== void 0 ? st.createHTML(t) : t;
return et !== void 0 ? et.createHTML(t) : t;
}
const Dt = (r, t) => {
const Lt = (r, t) => {
const e = r.length - 1, s = [];
let i, o = t === 2 ? "<svg>" : "", n = T;
let i, n = t === 2 ? "<svg>" : "", o = P;
for (let a = 0; a < e; a++) {
const h = r[a];
let c, u, l = -1, f = 0;
for (; f < h.length && (n.lastIndex = f, u = n.exec(h), u !== null); )
f = n.lastIndex, n === T ? u[1] === "!--" ? n = it : u[1] !== void 0 ? n = rt : u[2] !== void 0 ? ($t.test(u[2]) && (i = RegExp("</" + u[2], "g")), n = m) : u[3] !== void 0 && (n = m) : n === m ? u[0] === ">" ? (n = i ?? T, l = -1) : u[1] === void 0 ? l = -2 : (l = n.lastIndex - u[2].length, c = u[1], n = u[3] === void 0 ? m : u[3] === '"' ? ot : nt) : n === ot || n === nt ? n = m : n === it || n === rt ? n = T : (n = m, i = void 0);
const b = n === m && r[a + 1].startsWith("/>") ? " " : "";
o += n === T ? h + Bt : l >= 0 ? (s.push(c), h.slice(0, l) + ut + h.slice(l) + _ + b) : h + _ + (l === -2 ? a : b);
let c, u, l = -1, $ = 0;
for (; $ < h.length && (o.lastIndex = $, u = o.exec(h), u !== null); )
$ = o.lastIndex, o === P ? u[1] === "!--" ? o = st : u[1] !== void 0 ? o = it : u[2] !== void 0 ? (pt.test(u[2]) && (i = RegExp("</" + u[2], "g")), o = v) : u[3] !== void 0 && (o = v) : o === v ? u[0] === ">" ? (o = i ?? P, l = -1) : u[1] === void 0 ? l = -2 : (l = o.lastIndex - u[2].length, c = u[1], o = u[3] === void 0 ? v : u[3] === '"' ? nt : rt) : o === nt || o === rt ? o = v : o === st || o === it ? o = P : (o = v, i = void 0);
const g = o === v && r[a + 1].startsWith("/>") ? " " : "";
n += o === P ? h + Ht : l >= 0 ? (s.push(c), h.slice(0, l) + lt + h.slice(l) + _ + g) : h + _ + (l === -2 ? a : g);
}
return [ft(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s];
return [ft(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s];
};
class O {
class k {
constructor({ strings: t, _$litType$: e }, s) {
let i;
this.parts = [];
let o = 0, n = 0;
const a = t.length - 1, h = this.parts, [c, u] = Dt(t, e);
if (this.el = O.createElement(c, s), v.currentNode = this.el.content, e === 2) {
let n = 0, o = 0;
const a = t.length - 1, h = this.parts, [c, u] = Lt(t, e);
if (this.el = k.createElement(c, s), A.currentNode = this.el.content, e === 2) {
const l = this.el.content.firstChild;
l.replaceWith(...l.childNodes);
}
for (; (i = v.nextNode()) !== null && h.length < a; ) {
for (; (i = A.nextNode()) !== null && h.length < a; ) {
if (i.nodeType === 1) {
if (i.hasAttributes())
for (const l of i.getAttributeNames())
if (l.endsWith(ut)) {
const f = u[n++], b = i.getAttribute(l).split(_), I = /([.?@])?(.*)/.exec(f);
h.push({ type: 1, index: o, name: I[2], strings: b, ctor: I[1] === "." ? Wt : I[1] === "?" ? Kt : I[1] === "@" ? Qt : D }), i.removeAttribute(l);
if (l.endsWith(lt)) {
const $ = u[o++], g = i.getAttribute(l).split(_), y = /([.?@])?(.*)/.exec($);
h.push({ type: 1, index: n, name: y[2], strings: g, ctor: y[1] === "." ? zt : y[1] === "?" ? Wt : y[1] === "@" ? Vt : D }), i.removeAttribute(l);
} else
l.startsWith(_) && (h.push({ type: 6, index: o }), i.removeAttribute(l));
if ($t.test(i.tagName)) {
const l = i.textContent.split(_), f = l.length - 1;
if (f > 0) {
l.startsWith(_) && (h.push({ type: 6, index: n }), i.removeAttribute(l));
if (pt.test(i.tagName)) {
const l = i.textContent.split(_), $ = l.length - 1;
if ($ > 0) {
i.textContent = B ? B.emptyScript : "";
for (let b = 0; b < f; b++)
i.append(l[b], R()), v.nextNode(), h.push({ type: 2, index: ++o });
i.append(l[f], R());
for (let g = 0; g < $; g++)
i.append(l[g], U()), A.nextNode(), h.push({ type: 2, index: ++n });
i.append(l[$], U());
}
}
} else if (i.nodeType === 8)
if (i.data === dt)
h.push({ type: 2, index: o });
if (i.data === ut)
h.push({ type: 2, index: n });
else {
let l = -1;
for (; (l = i.data.indexOf(_, l + 1)) !== -1; )
h.push({ type: 7, index: o }), l += _.length - 1;
h.push({ type: 7, index: n }), l += _.length - 1;
}
o++;
n++;
}
}
static createElement(t, e) {
const s = A.createElement("template");
const s = w.createElement("template");
return s.innerHTML = t, s;
}
}
function C(r, t, e = r, s) {
var n, a;
if (t === x)
function T(r, t, e = r, s) {
var o, a;
if (t === C)
return t;
let i = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl;
const o = U(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 = C(r, i._$AS(r, t.values), i, s)), t;
let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
const n = O(t) ? void 0 : t._$litDirective$;
return (i == null ? void 0 : i.constructor) !== n && ((a = i == null ? void 0 : i._$AO) == null || a.call(i, !1), n === void 0 ? i = void 0 : (i = new n(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;
}
class zt {
class Dt {
constructor(t, e) {

@@ -684,13 +675,13 @@ 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) ?? A).importNode(e, !0);
v.currentNode = i;
let o = v.nextNode(), n = 0, a = 0, h = s[0];
const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? w).importNode(e, !0);
A.currentNode = i;
let n = A.nextNode(), o = 0, a = 0, h = s[0];
for (; h !== void 0; ) {
if (n === h.index) {
if (o === h.index) {
let c;
h.type === 2 ? c = new H(o, o.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(o, h.name, h.strings, this, t) : h.type === 6 && (c = new Vt(o, this, t)), this._$AV.push(c), h = s[++a];
h.type === 2 ? c = new I(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new Kt(n, this, t)), this._$AV.push(c), h = s[++a];
}
n !== (h == null ? void 0 : h.index) && (o = v.nextNode(), n++);
o !== (h == null ? void 0 : h.index) && (n = A.nextNode(), o++);
}
return v.currentNode = A, i;
return A.currentNode = w, i;
}

@@ -703,3 +694,3 @@ p(t) {

}
class H {
class I {
get _$AU() {

@@ -724,3 +715,3 @@ var t;

_$AI(t, e = this) {
t = C(this, t, e), U(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== x && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : qt(t) ? this.k(t) : this._(t);
t = T(this, t, e), O(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Bt(t) ? this.k(t) : this._(t);
}

@@ -734,24 +725,24 @@ S(t) {

_(t) {
this._$AH !== d && U(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
this._$AH !== d && O(this._$AH) ? this._$AA.nextSibling.data = t : this.T(w.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 = O.createElement(ft(s.h, s.h[0]), this.options)), s);
if (((o = this._$AH) == null ? void 0 : o._$AD) === i)
var n;
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = k.createElement(ft(s.h, s.h[0]), this.options)), s);
if (((n = this._$AH) == null ? void 0 : n._$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 Dt(i, this), a = o.u(this.options);
o.p(e), this.T(a), this._$AH = o;
}
}
_$AC(t) {
let e = ht.get(t.strings);
return e === void 0 && ht.set(t.strings, e = new O(t)), e;
let e = ot.get(t.strings);
return e === void 0 && ot.set(t.strings, e = new k(t)), e;
}
k(t) {
pt(this._$AH) || (this._$AH = [], this._$AR());
dt(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 H(this.S(R()), this.S(R()), this, this.options)) : s = e[i], s._$AI(o), i++;
for (const n of t)
i === e.length ? e.push(s = new I(this.S(U()), this.S(U()), this, this.options)) : s = e[i], s._$AI(n), i++;
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);

@@ -778,17 +769,17 @@ }

}
constructor(t, e, s, i, o) {
this.type = 1, this._$AH = d, 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 = d;
constructor(t, e, s, i, n) {
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = d;
}
_$AI(t, e = this, s, i) {
const o = this.strings;
let n = !1;
if (o === void 0)
t = C(this, t, e, 0), n = !U(t) || t !== this._$AH && t !== x, n && (this._$AH = t);
const n = this.strings;
let o = !1;
if (n === void 0)
t = T(this, t, e, 0), o = !O(t) || t !== this._$AH && t !== C, o && (this._$AH = t);
else {
const a = t;
let h, c;
for (t = o[0], h = 0; h < o.length - 1; h++)
c = C(this, a[s + h], e, h), c === x && (c = this._$AH[h]), n || (n = !U(c) || c !== this._$AH[h]), c === d ? t = d : t !== d && (t += (c ?? "") + o[h + 1]), this._$AH[h] = c;
for (t = n[0], h = 0; h < n.length - 1; h++)
c = T(this, a[s + h], e, h), c === C && (c = this._$AH[h]), o || (o = !O(c) || c !== this._$AH[h]), c === d ? t = d : t !== d && (t += (c ?? "") + n[h + 1]), this._$AH[h] = c;
}
n && !i && this.j(t);
o && !i && this.j(t);
}

@@ -799,3 +790,3 @@ j(t) {

}
class Wt extends D {
class zt extends D {
constructor() {

@@ -808,3 +799,3 @@ super(...arguments), this.type = 3;

}
class Kt extends D {
class Wt extends D {
constructor() {

@@ -817,11 +808,11 @@ super(...arguments), this.type = 4;

}
class Qt extends D {
constructor(t, e, s, i, o) {
super(t, e, s, i, o), this.type = 5;
class Vt extends D {
constructor(t, e, s, i, n) {
super(t, e, s, i, n), this.type = 5;
}
_$AI(t, e = this) {
if ((t = C(this, t, e, 0) ?? d) === x)
if ((t = T(this, t, e, 0) ?? d) === C)
return;
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== d && (s === d || i);
i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== d && (s === d || i);
i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
}

@@ -833,3 +824,3 @@ handleEvent(t) {

}
class Vt {
class Kt {
constructor(t, e, s) {

@@ -842,13 +833,13 @@ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;

_$AI(t) {
C(this, t);
T(this, t);
}
}
const K = N.litHtmlPolyfillSupport;
K == null || K(O, H), (N.litHtmlVersions ?? (N.litHtmlVersions = [])).push("3.1.3");
const Jt = (r, t, e) => {
const V = R.litHtmlPolyfillSupport;
V == null || V(k, I), (R.litHtmlVersions ?? (R.litHtmlVersions = [])).push("3.1.3");
const Qt = (r, t, e) => {
const s = (e == null ? void 0 : e.renderBefore) ?? t;
let i = s._$litPart$;
if (i === void 0) {
const o = (e == null ? void 0 : e.renderBefore) ?? null;
s._$litPart$ = i = new H(t.insertBefore(R(), o), o, void 0, e ?? {});
const n = (e == null ? void 0 : e.renderBefore) ?? null;
s._$litPart$ = i = new I(t.insertBefore(U(), n), n, void 0, e ?? {});
}

@@ -862,3 +853,3 @@ return i._$AI(r), i;

*/
class S extends E {
class x extends S {
constructor() {

@@ -874,3 +865,3 @@ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;

const e = this.render();
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Jt(e, this.renderRoot, this.renderOptions);
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Qt(e, this.renderRoot, this.renderOptions);
}

@@ -886,9 +877,9 @@ connectedCallback() {

render() {
return x;
return C;
}
}
var at;
S._$litElement$ = !0, S.finalized = !0, (at = globalThis.litElementHydrateSupport) == null || at.call(globalThis, { LitElement: S });
const Q = globalThis.litElementPolyfillSupport;
Q == null || Q({ LitElement: S });
var ht;
x._$litElement$ = !0, x.finalized = !0, (ht = globalThis.litElementHydrateSupport) == null || ht.call(globalThis, { LitElement: x });
const K = globalThis.litElementPolyfillSupport;
K == null || K({ LitElement: x });
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.5");

@@ -900,3 +891,3 @@ /**

*/
const gt = (r) => (t, e) => {
const $t = (r) => (t, e) => {
e !== void 0 ? e.addInitializer(() => {

@@ -911,19 +902,19 @@ customElements.define(r, t);

*/
const Ft = { attribute: !0, type: String, converter: j, reflect: !1, hasChanged: L }, Xt = (r = Ft, t, e) => {
const Jt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: L }, Ft = (r = Jt, 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") {
const { name: n } = e;
let n = globalThis.litPropertyMetadata.get(i);
if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), n.set(e.name, r), s === "accessor") {
const { name: o } = e;
return { set(a) {
const h = t.get.call(this);
t.set.call(this, a), this.requestUpdate(n, h, r);
t.set.call(this, a), this.requestUpdate(o, h, r);
}, init(a) {
return a !== void 0 && this.P(n, void 0, r), a;
return a !== void 0 && this.P(o, void 0, r), a;
} };
}
if (s === "setter") {
const { name: n } = e;
const { name: o } = e;
return function(a) {
const h = this[n];
t.call(this, a), this.requestUpdate(n, h, r);
const h = this[o];
t.call(this, a), this.requestUpdate(o, h, r);
};

@@ -933,8 +924,16 @@ }

};
function p(r) {
return (t, e) => typeof e == "object" ? Xt(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;
function f(r) {
return (t, e) => typeof e == "object" ? Ft(r, t, e) : ((s, i, n) => {
const o = i.hasOwnProperty(n);
return i.constructor.createProperty(n, o ? { ...s, wrapped: !0 } : s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
})(r, t, e);
}
function Xt(r) {
try {
const t = new URL(r ?? "");
return `${t.origin}${t.pathname.split("/manifest")[0]}/iframe${t.search}`;
} catch {
return null;
}
}
class Zt extends Error {

@@ -957,3 +956,3 @@ constructor(t, e) {

}
const bt = () => {
const gt = () => {
const r = navigator.userAgent;

@@ -965,3 +964,3 @@ 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`), {
const s = gt(), i = window.TS.token, n = window.TS.url || "https://api.topsort.com", o = await fetch(new URL(`${n}/v2/auctions`), {
method: "POST",

@@ -972,3 +971,3 @@ mode: "cors",

"Content-Type": "application/json",
"X-UA": `topsort/banners-0.4.0 (${s})`
"X-UA": `topsort/banners-0.4.1 (${s})`
},

@@ -980,9 +979,9 @@ body: JSON.stringify({

});
if (!n.ok) {
const c = await n.json();
if (!o.ok) {
const c = await o.json();
throw e(c), new Error(c.message);
}
const h = (await n.json()).results[0];
const h = (await o.json()).results[0];
if (!h)
throw new Zt("No auction results", n.status);
throw new Zt("No auction results", o.status);
if (h.error)

@@ -992,5 +991,5 @@ throw e(h.error), new Error(h.error);

}
var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, g = (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);
var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, b = (r, t, e, s) => {
for (var i = s > 1 ? void 0 : s ? ee(t, e) : t, n = r.length - 1, o; n >= 0; n--)
(o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
return s && i && te(t, e, i), i;

@@ -1004,3 +1003,3 @@ };

buildAuction(s) {
const i = bt(), o = {
const i = gt(), n = {
type: "banners",

@@ -1011,11 +1010,11 @@ slots: s,

};
return this.categoryId ? o.category = {
return this.categoryId ? n.category = {
id: this.categoryId
} : this.categoryIds ? o.category = {
ids: this.categoryIds.split(",").map((n) => n.trim())
} : this.categoryDisjunctions ? o.category = {
disjunctions: [this.categoryDisjunctions.split(",").map((n) => n.trim())]
} : this.searchQuery && (o.searchQuery = this.searchQuery), this.location && (o.geoTargeting = {
} : this.categoryIds ? n.category = {
ids: this.categoryIds.split(",").map((o) => o.trim())
} : this.categoryDisjunctions ? n.category = {
disjunctions: [this.categoryDisjunctions.split(",").map((o) => o.trim())]
} : this.searchQuery && (n.searchQuery = this.searchQuery), this.location && (n.geoTargeting = {
location: this.location
}), o;
}), n;
}

@@ -1031,25 +1030,25 @@ emitEvent(s) {

}
return g([
p({ type: Number })
], t.prototype, "width", 2), g([
p({ type: Number })
], t.prototype, "height", 2), g([
p({ attribute: "id", type: String })
], t.prototype, "slotId", 2), g([
p({ attribute: "category-id", type: String })
], t.prototype, "categoryId", 2), g([
p({ attribute: "category-ids", type: String })
], t.prototype, "categoryIds", 2), g([
p({ attribute: "category-disjunctions", type: String })
], t.prototype, "categoryDisjunctions", 2), g([
p({ attribute: "search-query", type: String })
], t.prototype, "searchQuery", 2), g([
p({ attribute: "location", type: String })
], t.prototype, "location", 2), g([
p({ attribute: "new-tab", type: Boolean })
return b([
f({ type: Number })
], t.prototype, "width", 2), b([
f({ type: Number })
], t.prototype, "height", 2), b([
f({ attribute: "id", type: String })
], t.prototype, "slotId", 2), b([
f({ attribute: "category-id", type: String })
], t.prototype, "categoryId", 2), b([
f({ attribute: "category-ids", type: String })
], t.prototype, "categoryIds", 2), b([
f({ attribute: "category-disjunctions", type: String })
], t.prototype, "categoryDisjunctions", 2), b([
f({ attribute: "search-query", type: String })
], t.prototype, "searchQuery", 2), b([
f({ attribute: "location", type: String })
], t.prototype, "location", 2), b([
f({ attribute: "new-tab", type: Boolean })
], t.prototype, "newTab", 2), t;
};
var ie = Object.defineProperty, re = Object.getOwnPropertyDescriptor, w = (r, t, e, s) => {
for (var i = s > 1 ? void 0 : s ? re(t, e) : t, o = r.length - 1, n; o >= 0; o--)
(n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i);
var ie = Object.defineProperty, re = Object.getOwnPropertyDescriptor, E = (r, t, e, s) => {
for (var i = s > 1 ? void 0 : s ? re(t, e) : t, n = r.length - 1, o; n >= 0; n--)
(o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
return s && i && ie(t, e, i), i;

@@ -1063,15 +1062,15 @@ };

}
function _t() {
function bt() {
if (window.TS_BANNERS.getLoadingElement) {
const r = window.TS_BANNERS.getLoadingElement();
return $`${r}`;
return p`${r}`;
}
return $``;
return p``;
}
function V(r) {
function Q(r) {
if (window.TS_BANNERS.getErrorElement) {
const t = window.TS_BANNERS.getErrorElement(r);
return $`${t}`;
return p`${t}`;
}
return $``;
return p``;
}

@@ -1081,33 +1080,58 @@ function yt() {

const r = window.TS_BANNERS.getNoWinnersElement();
return $`${r}`;
return p`${r}`;
}
return $``;
return p``;
}
function mt(r, t, e, s) {
function _t(r, t, e, s) {
var c, u;
if (window.TS_BANNERS.getBannerElement) {
const c = window.TS_BANNERS.getBannerElement(r);
return $`${c}`;
const l = window.TS_BANNERS.getBannerElement(r);
return p`${l}`;
}
const i = r.asset[0].url, o = Ct`
img {
width: ${t}px;
height: ${e}px;
if (!((u = (c = r.asset) == null ? void 0 : c[0]) != null && u.url))
return p``;
const i = r.asset[0].url, o = (() => {
try {
const $ = new URL(i).pathname.split("/"), g = $.indexOf("manifest");
if (g >= 0) {
const y = $[g + 1];
return (y == null ? void 0 : y.startsWith("video")) ?? !1;
}
`, n = oe(r), a = $`<img src="${i}" alt="Topsort banner"></img>`, h = s ? $`<a href="${n}" target="_blank">${a}</a>` : $`<a href="${n}">${a}</a>`;
return $`
<div style="${o}"
data-ts-clickable
data-ts-resolved-bid=${r.resolvedBidId}
class="ts-banner">
${h}
</div>
`;
return !1;
} catch {
return !1;
}
})() ? p`
<iframe
src="${Xt(i)}"
autoplay
muted
loop
playsinline
style="width:${t}px; height:${e}px; object-fit:cover;"
></iframe>
` : p`
<img
src="${i}"
alt="Topsort banner"
style="width:${t}px; height:${e}px; object-fit:cover;"
/>
`, a = oe(r), h = s ? p`<a href="${a}" target="_blank">${o}</a>` : p`<a href="${a}">${o}</a>`;
return p`
<div
data-ts-clickable
data-ts-resolved-bid=${r.resolvedBidId}
class="ts-banner"
>
${h}
</div>
`;
}
const vt = Symbol("banner-context"), he = (r, t) => {
const mt = 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 k = class extends se(S) {
let j = class extends se(x) {
constructor() {
super(...arguments), this.task = new Mt(this, {
super(...arguments), this.task = new It(this, {
task: ([r], t) => Yt(this.buildAuction(r), { ...t, logError: ne }).then((e) => (t.signal.throwIfAborted(), this.isContext && (this.context = { ...this.context, banners: e }), e)).catch((e) => {

@@ -1127,6 +1151,6 @@ throw t.signal.throwIfAborted(), this.isContext && (this.context = { ...this.context, error: e }), e;

render() {
return !window.TS.token || !this.slotId ? V(new Gt(window.TS.token, this.slotId)) : this.isContext ? $`` : this.task.render({
pending: () => _t(),
complete: (r) => (this.emitEvent(r.length ? "ready" : "nowinners"), r.length ? mt(r[0], this.height, this.width, this.newTab) : yt()),
error: (r) => V(r)
return !window.TS.token || !this.slotId ? Q(new Gt(window.TS.token, this.slotId)) : this.isContext ? p`` : this.task.render({
pending: () => bt(),
complete: (r) => (this.emitEvent(r.length ? "ready" : "nowinners"), r.length ? _t(r[0], this.height, this.width, this.newTab) : yt()),
error: (r) => Q(r)
});

@@ -1150,16 +1174,16 @@ }

};
w([
Et({ context: vt }),
p({ attribute: !1, hasChanged: he })
], k.prototype, "context", 2);
w([
p({ type: Boolean, attribute: "context" })
], k.prototype, "isContext", 2);
w([
p({ attribute: !1, state: !0 })
], k.prototype, "slots", 2);
k = w([
gt("topsort-banner")
], k);
let q = class extends S {
E([
wt({ context: mt }),
f({ attribute: !1, hasChanged: he })
], j.prototype, "context", 2);
E([
f({ type: Boolean, attribute: "context" })
], j.prototype, "isContext", 2);
E([
f({ attribute: !1, state: !0 })
], j.prototype, "slots", 2);
j = E([
$t("topsort-banner")
], j);
let q = class extends x {
constructor() {

@@ -1169,3 +1193,3 @@ super(...arguments), this.rank = 0;

render() {
return this.context ? this.context.banners ? this.context.error ? V(this.context.error) : !this.context.banners.length || this.context.banners.length < this.rank ? yt() : mt(
return this.context ? this.context.banners ? this.context.error ? Q(this.context.error) : !this.context.banners.length || this.context.banners.length < this.rank ? yt() : _t(
this.context.banners[this.rank - 1],

@@ -1175,3 +1199,3 @@ this.context.width,

this.context.newTab
) : _t() : $``;
) : bt() : p``;
}

@@ -1183,16 +1207,16 @@ // avoid shadow dom since we cannot attach to events via analytics.js

};
w([
St({ context: vt, subscribe: !0 }),
p({ attribute: !1 })
E([
Et({ context: mt, subscribe: !0 }),
f({ attribute: !1 })
], q.prototype, "context", 2);
w([
p({ attribute: "rank", type: Number })
E([
f({ attribute: "rank", type: Number })
], q.prototype, "rank", 2);
q = w([
gt("topsort-banner-slot")
q = E([
$t("topsort-banner-slot")
], q);
export {
k as TopsortBanner,
j as TopsortBanner,
q as TopsortBannerSlot
};
//# sourceMappingURL=banners.mjs.map
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@topsort/banners",
"version": "0.4.0",
"version": "0.4.1",
"description": "A web component for displaying Topsort banner ads.",
"type": "module",
"author": "Topsort",
"packageManager": "pnpm@9.0.6",
"repository": {
"url": "https://github.com/Topsort/banners.js"
},
"engines": {

@@ -21,3 +25,3 @@ "node": ">=20.0.0",

],
"homepage": "https://github.com/Topsort/banners.js#readme",
"homepage": "https://github.com/Topsort/banners.js",
"exports": {

@@ -37,15 +41,2 @@ ".": {

],
"devDependencies": {
"@biomejs/biome": "^1.7.0",
"@types/node": "^20.12.7",
"typescript": "^5.4.5",
"vite": "^5.2.9",
"vite-plugin-dts": "^3.8.3"
},
"dependencies": {
"@lit/context": "^1.1.2",
"@lit/task": "^1.0.1",
"lit": "^3.1.3",
"skeleton-webcomponent-loader": "^2.1.4"
},
"scripts": {

@@ -58,3 +49,16 @@ "preinstall": "npx only-allow pnpm",

"typecheck": "tsc --noEmit"
},
"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"
},
"dependencies": {
"@lit/context": "1.1.2",
"@lit/task": "1.0.1",
"lit": "3.1.3",
"skeleton-webcomponent-loader": "2.1.4"
}
}
}

@@ -61,3 +61,3 @@ ![version](https://img.shields.io/npm/v/@topsort/banners)

<topsort-banner-slot rank="3"></topsort-banner-slot>
</topsort-banner-context>
</topsort-banner>
```

@@ -64,0 +64,0 @@

Sorry, the diff of this file is too big to display