UNPKG

altcha

Version:

Privacy-first CAPTCHA widget, compliant with global regulations (GDPR/HIPAA/CCPA/LGDP/DPDPA/PIPL) and WCAG accessible. No tracking, self-verifying.

1,862 lines 102 kB
var jo = Object.defineProperty; var Fn = (e) => { throw TypeError(e); }; var qo = (e, t, r) => t in e ? jo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r; var Ee = (e, t, r) => qo(e, typeof t != "symbol" ? t + "" : t, r), Mn = (e, t, r) => t.has(e) || Fn("Cannot " + r); var se = (e, t, r) => (Mn(e, t, "read from private field"), r ? r.call(e) : t.get(e)), $r = (e, t, r) => t.has(e) ? Fn("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), Sr = (e, t, r, i) => (Mn(e, t, "write to private field"), i ? i.call(e, r) : t.set(e, r), r); const ti = `(function(){"use strict";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function b(e,t,r){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r="SHA-256",n=1e6,s=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=s;c<=n;c+=1){if(o.signal.aborted)return null;if(await b(t,c,r)===e)return{number:c,took:Date.now()-a}}return null})(),controller:o}}function h(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function g(e,t=12){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e%256,e=Math.floor(e/256);return r}async function m(e,t="",r=1e6,n=0){const s="AES-GCM",o=new AbortController,a=Date.now(),l=async()=>{for(let u=n;u<=r;u+=1){if(o.signal.aborted||!c||!y)return null;try{const f=await crypto.subtle.decrypt({name:s,iv:g(u)},c,y);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,y=null;try{y=h(e);const u=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",u,s,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:l(),controller:o}}let i;onmessage=async e=>{const{type:t,payload:r,start:n,max:s}=e.data;let o=null;if(t==="abort")i==null||i.abort(),i=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:l}=r||{};o=await m(l,a,s,n)}else{const{algorithm:a,challenge:l,salt:c}=r||{};o=w(l,c,a,s,n)}i=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})(); `, Vn = typeof self < "u" && self.Blob && new Blob([ti], { type: "text/javascript;charset=utf-8" }); function Bo(e) { let t; try { if (t = Vn && (self.URL || self.webkitURL).createObjectURL(Vn), !t) throw ""; const r = new Worker(t, { name: e == null ? void 0 : e.name }); return r.addEventListener("error", () => { (self.URL || self.webkitURL).revokeObjectURL(t); }), r; } catch { return new Worker( "data:text/javascript;charset=utf-8," + encodeURIComponent(ti), { name: e == null ? void 0 : e.name } ); } finally { t && (self.URL || self.webkitURL).revokeObjectURL(t); } } const Ho = "5"; var ei; typeof window < "u" && ((ei = window.__svelte ?? (window.__svelte = {})).v ?? (ei.v = /* @__PURE__ */ new Set())).add(Ho); const Go = 1, Wo = 4, Yo = 8, Zo = 16, zo = 1, Jo = 2, qr = "[", ri = "[!", ni = "]", yt = {}, ue = Symbol(), Ko = "http://www.w3.org/1999/xhtml", Un = !1; function ii(e) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } var oi = Array.isArray, Xo = Array.prototype.indexOf, Qo = Array.from, ir = Object.keys, Vt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, ea = Object.getOwnPropertyDescriptors, ta = Object.prototype, ra = Array.prototype, ai = Object.getPrototypeOf, jn = Object.isExtensible; const wt = () => { }; function li(e) { for (var t = 0; t < e.length; t++) e[t](); } function na(e, t, r = !1) { return e === void 0 ? r ? ( /** @type {() => V} */ t() ) : ( /** @type {V} */ t ) : e; } const Ce = 2, si = 4, cr = 8, Br = 16, Fe = 32, ot = 64, or = 128, ve = 256, ar = 512, fe = 1024, De = 2048, at = 4096, Et = 8192, dr = 16384, ia = 32768, Hr = 65536, oa = 1 << 19, ui = 1 << 20, Lr = 1 << 21, Ft = Symbol("$state"), fi = Symbol("legacy props"), aa = Symbol(""); function la(e) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } function sa() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } function ua(e) { throw new Error("https://svelte.dev/e/effect_orphan"); } function fa() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } function ca() { throw new Error("https://svelte.dev/e/hydration_failed"); } function da(e) { throw new Error("https://svelte.dev/e/props_invalid_value"); } function ha() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } function va() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } function ga() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } function hr(e) { console.warn("https://svelte.dev/e/hydration_mismatch"); } let M = !1; function bt(e) { M = e; } let F; function We(e) { if (e === null) throw hr(), yt; return F = e; } function Ct() { return We( /** @type {TemplateNode} */ /* @__PURE__ */ ze(F) ); } function Y(e) { if (M) { if (/* @__PURE__ */ ze(F) !== null) throw hr(), yt; F = e; } } function pa() { for (var e = 0, t = F; ; ) { if (t.nodeType === 8) { var r = ( /** @type {Comment} */ t.data ); if (r === ni) { if (e === 0) return t; e -= 1; } else (r === qr || r === ri) && (e += 1); } var i = ( /** @type {TemplateNode} */ /* @__PURE__ */ ze(t) ); t.remove(), t = i; } } let ma = !1; function He(e) { if (typeof e != "object" || e === null || Ft in e) return e; const t = ai(e); if (t !== ta && t !== ra) return e; var r = /* @__PURE__ */ new Map(), i = oi(e), a = /* @__PURE__ */ P(0), o = D, u = (s) => { var c = D; Ne(o); var d = s(); return Ne(c), d; }; return i && r.set("length", /* @__PURE__ */ P( /** @type {any[]} */ e.length )), new Proxy( /** @type {any} */ e, { defineProperty(s, c, d) { (!("value" in d) || d.configurable === !1 || d.enumerable === !1 || d.writable === !1) && ha(); var _ = r.get(c); return _ === void 0 ? (_ = u(() => /* @__PURE__ */ P(d.value)), r.set(c, _)) : b( _, u(() => He(d.value)) ), !0; }, deleteProperty(s, c) { var d = r.get(c); if (d === void 0) c in s && (r.set( c, u(() => /* @__PURE__ */ P(ue)) ), Tr(a)); else { if (i && typeof c == "string") { var _ = ( /** @type {Source<number>} */ r.get("length") ), h = Number(c); Number.isInteger(h) && h < _.v && b(_, h); } b(d, ue), Tr(a); } return !0; }, get(s, c, d) { var w; if (c === Ft) return e; var _ = r.get(c), h = c in s; if (_ === void 0 && (!h || (w = rt(s, c)) != null && w.writable) && (_ = u(() => /* @__PURE__ */ P(He(h ? s[c] : ue))), r.set(c, _)), _ !== void 0) { var m = l(_); return m === ue ? void 0 : m; } return Reflect.get(s, c, d); }, getOwnPropertyDescriptor(s, c) { var d = Reflect.getOwnPropertyDescriptor(s, c); if (d && "value" in d) { var _ = r.get(c); _ && (d.value = l(_)); } else if (d === void 0) { var h = r.get(c), m = h == null ? void 0 : h.v; if (h !== void 0 && m !== ue) return { enumerable: !0, configurable: !0, value: m, writable: !0 }; } return d; }, has(s, c) { var m; if (c === Ft) return !0; var d = r.get(c), _ = d !== void 0 && d.v !== ue || Reflect.has(s, c); if (d !== void 0 || N !== null && (!_ || (m = rt(s, c)) != null && m.writable)) { d === void 0 && (d = u(() => /* @__PURE__ */ P(_ ? He(s[c]) : ue)), r.set(c, d)); var h = l(d); if (h === ue) return !1; } return _; }, set(s, c, d, _) { var K; var h = r.get(c), m = c in s; if (i && c === "length") for (var w = d; w < /** @type {Source<number>} */ h.v; w += 1) { var S = r.get(w + ""); S !== void 0 ? b(S, ue) : w in s && (S = u(() => /* @__PURE__ */ P(ue)), r.set(w + "", S)); } h === void 0 ? (!m || (K = rt(s, c)) != null && K.writable) && (h = u(() => /* @__PURE__ */ P(void 0)), b( h, u(() => He(d)) ), r.set(c, h)) : (m = h.v !== ue, b( h, u(() => He(d)) )); var E = Reflect.getOwnPropertyDescriptor(s, c); if (E != null && E.set && E.set.call(_, d), !m) { if (i && typeof c == "string") { var U = ( /** @type {Source<number>} */ r.get("length") ), ce = Number(c); Number.isInteger(ce) && ce >= U.v && b(U, ce + 1); } Tr(a); } return !0; }, ownKeys(s) { l(a); var c = Reflect.ownKeys(s).filter((h) => { var m = r.get(h); return m === void 0 || m.v !== ue; }); for (var [d, _] of r) _.v !== ue && !(d in s) && c.push(d); return c; }, setPrototypeOf() { va(); } } ); } function Tr(e, t = 1) { b(e, e.v + t); } var qn, ci, di, hi; function Or() { if (qn === void 0) { qn = window, ci = /Firefox/.test(navigator.userAgent); var e = Element.prototype, t = Node.prototype, r = Text.prototype; di = rt(t, "firstChild").get, hi = rt(t, "nextSibling").get, jn(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), jn(r) && (r.__t = void 0); } } function vr(e = "") { return document.createTextNode(e); } // @__NO_SIDE_EFFECTS__ function _e(e) { return di.call(e); } // @__NO_SIDE_EFFECTS__ function ze(e) { return hi.call(e); } function Z(e, t) { if (!M) return /* @__PURE__ */ _e(e); var r = ( /** @type {TemplateNode} */ /* @__PURE__ */ _e(F) ); return r === null && (r = F.appendChild(vr())), We(r), r; } function Lt(e, t) { if (!M) { var r = ( /** @type {DocumentFragment} */ /* @__PURE__ */ _e( /** @type {Node} */ e ) ); return r instanceof Comment && r.data === "" ? /* @__PURE__ */ ze(r) : r; } return F; } function z(e, t = 1, r = !1) { let i = M ? F : e; for (var a; t--; ) a = i, i = /** @type {TemplateNode} */ /* @__PURE__ */ ze(i); if (!M) return i; var o = i == null ? void 0 : i.nodeType; if (r && o !== 3) { var u = vr(); return i === null ? a == null || a.after(u) : i.before(u), We(u), u; } return We(i), /** @type {TemplateNode} */ i; } function _a(e) { e.textContent = ""; } function vi(e) { return e === this.v; } function gi(e, t) { return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; } function Gr(e) { return !gi(e, this.v); } // @__NO_SIDE_EFFECTS__ function gr(e) { var t = Ce | De, r = D !== null && (D.f & Ce) !== 0 ? ( /** @type {Derived} */ D ) : null; return N === null || r !== null && (r.f & ve) !== 0 ? t |= ve : N.f |= ui, { ctx: oe, deps: null, effects: null, equals: vi, f: t, fn: e, reactions: null, rv: 0, v: ( /** @type {V} */ null ), wv: 0, parent: r ?? N }; } // @__NO_SIDE_EFFECTS__ function Ot(e) { const t = /* @__PURE__ */ gr(e); return Ri(t), t; } // @__NO_SIDE_EFFECTS__ function ba(e) { const t = /* @__PURE__ */ gr(e); return t.equals = Gr, t; } function pi(e) { var t = e.effects; if (t !== null) { e.effects = null; for (var r = 0; r < t.length; r += 1) Ye( /** @type {Effect} */ t[r] ); } } function ya(e) { for (var t = e.parent; t !== null; ) { if ((t.f & Ce) === 0) return ( /** @type {Effect} */ t ); t = t.parent; } return null; } function mi(e) { var t, r = N; Ze(ya(e)); try { pi(e), t = Di(e); } finally { Ze(r); } return t; } function _i(e) { var t = mi(e), r = (Ge || (e.f & ve) !== 0) && e.deps !== null ? at : fe; xe(e, r), e.equals(t) || (e.v = t, e.wv = Si()); } function wa(e) { N === null && D === null && ua(), D !== null && (D.f & ve) !== 0 && N === null && sa(), Bt && la(); } function Ea(e, t) { var r = t.last; r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e); } function lt(e, t, r, i = !0) { var a = N, o = { ctx: oe, deps: null, nodes_start: null, nodes_end: null, f: e | De, first: null, fn: t, last: null, next: null, parent: a, prev: null, teardown: null, transitions: null, wv: 0 }; if (r) try { Jr(o), o.f |= ia; } catch (c) { throw Ye(o), c; } else t !== null && mr(o); var u = r && o.deps === null && o.first === null && o.nodes_start === null && o.teardown === null && (o.f & (ui | or)) === 0; if (!u && i && (a !== null && Ea(o, a), D !== null && (D.f & Ce) !== 0)) { var s = ( /** @type {Derived} */ D ); (s.effects ?? (s.effects = [])).push(o); } return o; } function Wr(e) { const t = lt(cr, null, !1); return xe(t, fe), t.teardown = e, t; } function Pr(e) { wa(); var t = N !== null && (N.f & Fe) !== 0 && oe !== null && !oe.m; if (t) { var r = ( /** @type {ComponentContext} */ oe ); (r.e ?? (r.e = [])).push({ fn: e, effect: N, reaction: D }); } else { var i = Yr(e); return i; } } function Ca(e) { const t = lt(ot, e, !0); return () => { Ye(t); }; } function xa(e) { const t = lt(ot, e, !0); return (r = {}) => new Promise((i) => { r.outro ? Mr(t, () => { Ye(t), i(void 0); }) : (Ye(t), i(void 0)); }); } function Yr(e) { return lt(si, e, !1); } function Zr(e) { return lt(cr, e, !0); } function $e(e, t = [], r = gr) { const i = t.map(r); return bi(() => e(...i.map(l))); } function bi(e, t = 0) { return lt(cr | Br | t, e, !0); } function Fr(e, t = !0) { return lt(cr | Fe, e, !0, t); } function yi(e) { var t = e.teardown; if (t !== null) { const r = Bt, i = D; Hn(!0), Ne(null); try { t.call(null); } finally { Hn(r), Ne(i); } } } function wi(e, t = !1) { var r = e.first; for (e.first = e.last = null; r !== null; ) { var i = r.next; (r.f & ot) !== 0 ? r.parent = null : Ye(r, t), r = i; } } function ka(e) { for (var t = e.first; t !== null; ) { var r = t.next; (t.f & Fe) === 0 && Ye(t), t = r; } } function Ye(e, t = !0) { var r = !1; (t || (e.f & oa) !== 0) && e.nodes_start !== null && (Ei( e.nodes_start, /** @type {TemplateNode} */ e.nodes_end ), r = !0), wi(e, t && !r), fr(e, 0), xe(e, dr); var i = e.transitions; if (i !== null) for (const o of i) o.stop(); yi(e); var a = e.parent; a !== null && a.first !== null && Ci(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes_start = e.nodes_end = null; } function Ei(e, t) { for (; e !== null; ) { var r = e === t ? null : ( /** @type {TemplateNode} */ /* @__PURE__ */ ze(e) ); e.remove(), e = r; } } function Ci(e) { var t = e.parent, r = e.prev, i = e.next; r !== null && (r.next = i), i !== null && (i.prev = r), t !== null && (t.first === e && (t.first = i), t.last === e && (t.last = r)); } function Mr(e, t) { var r = []; xi(e, r, !0), Aa(r, () => { Ye(e), t && t(); }); } function Aa(e, t) { var r = e.length; if (r > 0) { var i = () => --r || t(); for (var a of e) a.out(i); } else t(); } function xi(e, t, r) { if ((e.f & Et) === 0) { if (e.f ^= Et, e.transitions !== null) for (const u of e.transitions) (u.is_global || r) && t.push(u); for (var i = e.first; i !== null; ) { var a = i.next, o = (i.f & Hr) !== 0 || (i.f & Fe) !== 0; xi(i, t, o ? r : !1), i = a; } } } function Bn(e) { ki(e, !0); } function ki(e, t) { if ((e.f & Et) !== 0) { e.f ^= Et, (e.f & fe) === 0 && (e.f ^= fe), Ht(e) && (xe(e, De), mr(e)); for (var r = e.first; r !== null; ) { var i = r.next, a = (r.f & Hr) !== 0 || (r.f & Fe) !== 0; ki(r, a ? t : !1), r = i; } if (e.transitions !== null) for (const o of e.transitions) (o.is_global || t) && o.in(); } } const Ia = typeof requestIdleCallback > "u" ? (e) => setTimeout(e, 1) : requestIdleCallback; let Ut = [], jt = []; function Ai() { var e = Ut; Ut = [], li(e); } function Ii() { var e = jt; jt = [], li(e); } function zr(e) { Ut.length === 0 && queueMicrotask(Ai), Ut.push(e); } function Ra(e) { jt.length === 0 && Ia(Ii), jt.push(e); } function $a() { Ut.length > 0 && Ai(), jt.length > 0 && Ii(); } let tr = !1, lr = !1, sr = null, nt = !1, Bt = !1; function Hn(e) { Bt = e; } let Mt = []; let D = null, Se = !1; function Ne(e) { D = e; } let N = null; function Ze(e) { N = e; } let ie = null; function Ri(e) { D !== null && D.f & Lr && (ie === null ? ie = [e] : ie.push(e)); } let ne = null, he = 0, pe = null; function Sa(e) { pe = e; } let $i = 1, ur = 0, Ge = !1; function Si() { return ++$i; } function Ht(e) { var h; var t = e.f; if ((t & De) !== 0) return !0; if ((t & at) !== 0) { var r = e.deps, i = (t & ve) !== 0; if (r !== null) { var a, o, u = (t & ar) !== 0, s = i && N !== null && !Ge, c = r.length; if (u || s) { var d = ( /** @type {Derived} */ e ), _ = d.parent; for (a = 0; a < c; a++) o = r[a], (u || !((h = o == null ? void 0 : o.reactions) != null && h.includes(d))) && (o.reactions ?? (o.reactions = [])).push(d); u && (d.f ^= ar), s && _ !== null && (_.f & ve) === 0 && (d.f ^= ve); } for (a = 0; a < c; a++) if (o = r[a], Ht( /** @type {Derived} */ o ) && _i( /** @type {Derived} */ o ), o.wv > e.wv) return !0; } (!i || N !== null && !Ge) && xe(e, fe); } return !1; } function Ta(e, t) { for (var r = t; r !== null; ) { if ((r.f & or) !== 0) try { r.fn(e); return; } catch { r.f ^= or; } r = r.parent; } throw tr = !1, e; } function Gn(e) { return (e.f & dr) === 0 && (e.parent === null || (e.parent.f & or) === 0); } function pr(e, t, r, i) { if (tr) { if (r === null && (tr = !1), Gn(t)) throw e; return; } if (r !== null && (tr = !0), Ta(e, t), Gn(t)) throw e; } function Ti(e, t, r = !0) { var i = e.reactions; if (i !== null) for (var a = 0; a < i.length; a++) { var o = i[a]; ie != null && ie.includes(e) || ((o.f & Ce) !== 0 ? Ti( /** @type {Derived} */ o, t, !1 ) : t === o && (r ? xe(o, De) : (o.f & fe) !== 0 && xe(o, at), mr( /** @type {Effect} */ o ))); } } function Di(e) { var w; var t = ne, r = he, i = pe, a = D, o = Ge, u = ie, s = oe, c = Se, d = e.f; ne = /** @type {null | Value[]} */ null, he = 0, pe = null, Ge = (d & ve) !== 0 && (Se || !nt || D === null), D = (d & (Fe | ot)) === 0 ? e : null, ie = null, Wn(e.ctx), Se = !1, ur++, e.f |= Lr; try { var _ = ( /** @type {Function} */ (0, e.fn)() ), h = e.deps; if (ne !== null) { var m; if (fr(e, he), h !== null && he > 0) for (h.length = he + ne.length, m = 0; m < ne.length; m++) h[he + m] = ne[m]; else e.deps = h = ne; if (!Ge) for (m = he; m < h.length; m++) ((w = h[m]).reactions ?? (w.reactions = [])).push(e); } else h !== null && he < h.length && (fr(e, he), h.length = he); if (Mi() && pe !== null && !Se && h !== null && (e.f & (Ce | at | De)) === 0) for (m = 0; m < /** @type {Source[]} */ pe.length; m++) Ti( pe[m], /** @type {Effect} */ e ); return a !== null && a !== e && (ur++, pe !== null && (i === null ? i = pe : i.push(.../** @type {Source[]} */ pe))), _; } finally { ne = t, he = r, pe = i, D = a, Ge = o, ie = u, Wn(s), Se = c, e.f ^= Lr; } } function Da(e, t) { let r = t.reactions; if (r !== null) { var i = Xo.call(r, e); if (i !== -1) { var a = r.length - 1; a === 0 ? r = t.reactions = null : (r[i] = r[a], r.pop()); } } r === null && (t.f & Ce) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` // allows us to skip the expensive work of disconnecting and immediately reconnecting it (ne === null || !ne.includes(t)) && (xe(t, at), (t.f & (ve | ar)) === 0 && (t.f ^= ar), pi( /** @type {Derived} **/ t ), fr( /** @type {Derived} **/ t, 0 )); } function fr(e, t) { var r = e.deps; if (r !== null) for (var i = t; i < r.length; i++) Da(e, r[i]); } function Jr(e) { var t = e.f; if ((t & dr) === 0) { xe(e, fe); var r = N, i = oe, a = nt; N = e, nt = !0; try { (t & Br) !== 0 ? ka(e) : wi(e), yi(e); var o = Di(e); e.teardown = typeof o == "function" ? o : null, e.wv = $i; var u = e.deps, s; Un && ma && e.f & De; } catch (c) { pr(c, e, r, i || e.ctx); } finally { nt = a, N = r; } } } function Na() { try { fa(); } catch (e) { if (sr !== null) pr(e, sr, null); else throw e; } } function Ni() { var e = nt; try { var t = 0; for (nt = !0; Mt.length > 0; ) { t++ > 1e3 && Na(); var r = Mt, i = r.length; Mt = []; for (var a = 0; a < i; a++) { var o = Oa(r[a]); La(o); } qt.clear(); } } finally { lr = !1, nt = e, sr = null; } } function La(e) { var t = e.length; if (t !== 0) for (var r = 0; r < t; r++) { var i = e[r]; if ((i.f & (dr | Et)) === 0) try { Ht(i) && (Jr(i), i.deps === null && i.first === null && i.nodes_start === null && (i.teardown === null ? Ci(i) : i.fn = null)); } catch (a) { pr(a, i, null, i.ctx); } } } function mr(e) { lr || (lr = !0, queueMicrotask(Ni)); for (var t = sr = e; t.parent !== null; ) { t = t.parent; var r = t.f; if ((r & (ot | Fe)) !== 0) { if ((r & fe) === 0) return; t.f ^= fe; } } Mt.push(t); } function Oa(e) { for (var t = [], r = e; r !== null; ) { var i = r.f, a = (i & (Fe | ot)) !== 0, o = a && (i & fe) !== 0; if (!o && (i & Et) === 0) { if ((i & si) !== 0) t.push(r); else if (a) r.f ^= fe; else try { Ht(r) && Jr(r); } catch (c) { pr(c, r, null, r.ctx); } var u = r.first; if (u !== null) { r = u; continue; } } var s = r.parent; for (r = r.next; r === null && s !== null; ) r = s.next, s = s.parent; } return t; } function k(e) { for (var t; ; ) { if ($a(), Mt.length === 0) return ( /** @type {T} */ t ); lr = !0, Ni(); } } async function Dr() { await Promise.resolve(), k(); } function l(e) { var t = e.f, r = (t & Ce) !== 0; if (D !== null && !Se) { if (!(ie != null && ie.includes(e))) { var i = D.deps; e.rv < ur && (e.rv = ur, ne === null && i !== null && i[he] === e ? he++ : ne === null ? ne = [e] : (!Ge || !ne.includes(e)) && ne.push(e)); } } else if (r && /** @type {Derived} */ e.deps === null && /** @type {Derived} */ e.effects === null) { var a = ( /** @type {Derived} */ e ), o = a.parent; o !== null && (o.f & ve) === 0 && (a.f ^= ve); } return r && (a = /** @type {Derived} */ e, Ht(a) && _i(a)), Bt && qt.has(e) ? qt.get(e) : e.v; } function it(e) { var t = Se; try { return Se = !0, e(); } finally { Se = t; } } const Pa = -7169; function xe(e, t) { e.f = e.f & Pa | t; } const qt = /* @__PURE__ */ new Map(); function Li(e, t) { var r = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: e, reactions: null, equals: vi, rv: 0, wv: 0 }; return r; } // @__NO_SIDE_EFFECTS__ function P(e, t) { const r = Li(e); return Ri(r), r; } // @__NO_SIDE_EFFECTS__ function Kr(e, t = !1) { const r = Li(e); return t || (r.equals = Gr), r; } function b(e, t, r = !1) { D !== null && !Se && Mi() && (D.f & (Ce | Br)) !== 0 && !(ie != null && ie.includes(e)) && ga(); let i = r ? He(t) : t; return Fa(e, i); } function Fa(e, t) { if (!e.equals(t)) { var r = e.v; Bt ? qt.set(e, t) : qt.set(e, r), e.v = t, (e.f & Ce) !== 0 && ((e.f & De) !== 0 && mi( /** @type {Derived} */ e ), xe(e, (e.f & ve) === 0 ? fe : at)), e.wv = Si(), Oi(e, De), N !== null && (N.f & fe) !== 0 && (N.f & (Fe | ot)) === 0 && (pe === null ? Sa([e]) : pe.push(e)); } return t; } function Oi(e, t) { var r = e.reactions; if (r !== null) for (var i = r.length, a = 0; a < i; a++) { var o = r[a], u = o.f; (u & De) === 0 && (xe(o, t), (u & (fe | ve)) !== 0 && ((u & Ce) !== 0 ? Oi( /** @type {Derived} */ o, at ) : mr( /** @type {Effect} */ o ))); } } let oe = null; function Wn(e) { oe = e; } function Pi(e, t = !1, r) { var i = oe = { p: oe, c: null, d: !1, e: null, m: !1, s: e, x: null, l: null }; Wr(() => { i.d = !0; }); } function Fi(e) { const t = oe; if (t !== null) { e !== void 0 && (t.x = e); const u = t.e; if (u !== null) { var r = N, i = D; t.e = null; try { for (var a = 0; a < u.length; a++) { var o = u[a]; Ze(o.effect), Ne(o.reaction), Yr(o.fn); } } finally { Ze(r), Ne(i); } } oe = t.p, t.m = !0; } return e || /** @type {T} */ {}; } function Mi() { return !0; } const Ma = ["touchstart", "touchmove"]; function Va(e) { return Ma.includes(e); } function Ua(e, t) { if (t) { const r = document.body; e.autofocus = !0, zr(() => { document.activeElement === r && e.focus(); }); } } let Yn = !1; function Vi() { Yn || (Yn = !0, document.addEventListener( "reset", (e) => { Promise.resolve().then(() => { var t; if (!e.defaultPrevented) for ( const r of /**@type {HTMLFormElement} */ e.target.elements ) (t = r.__on_r) == null || t.call(r); }); }, // In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation) { capture: !0 } )); } function Ui(e) { var t = D, r = N; Ne(null), Ze(null); try { return e(); } finally { Ne(t), Ze(r); } } function ja(e, t, r, i = r) { e.addEventListener(t, () => Ui(r)); const a = e.__on_r; a ? e.__on_r = () => { a(), i(!0); } : e.__on_r = () => i(!0), Vi(); } const ji = /* @__PURE__ */ new Set(), Vr = /* @__PURE__ */ new Set(); function qa(e, t, r, i = {}) { function a(o) { if (i.capture || Pt.call(t, o), !o.cancelBubble) return Ui(() => r == null ? void 0 : r.call(this, o)); } return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? zr(() => { t.addEventListener(e, a, i); }) : t.addEventListener(e, a, i), a; } function Be(e, t, r, i, a) { var o = { capture: i, passive: a }, u = qa(e, t, r, o); (t === document.body || t === window || t === document) && Wr(() => { t.removeEventListener(e, u, o); }); } function Ba(e) { for (var t = 0; t < e.length; t++) ji.add(e[t]); for (var r of Vr) r(e); } function Pt(e) { var K; var t = this, r = ( /** @type {Node} */ t.ownerDocument ), i = e.type, a = ((K = e.composedPath) == null ? void 0 : K.call(e)) || [], o = ( /** @type {null | Element} */ a[0] || e.target ), u = 0, s = e.__root; if (s) { var c = a.indexOf(s); if (c !== -1 && (t === document || t === /** @type {any} */ window)) { e.__root = t; return; } var d = a.indexOf(t); if (d === -1) return; c <= d && (u = c); } if (o = /** @type {Element} */ a[u] || e.target, o !== t) { Vt(e, "currentTarget", { configurable: !0, get() { return o || r; } }); var _ = D, h = N; Ne(null), Ze(null); try { for (var m, w = []; o !== null; ) { var S = o.assignedSlot || o.parentNode || /** @type {any} */ o.host || null; try { var E = o["__" + i]; if (E != null && (!/** @type {any} */ o.disabled || // DOM could've been updated already by the time this is reached, so we check this as well // -> the target could not have been disabled because it emits the event in the first place e.target === o)) if (oi(E)) { var [U, ...ce] = E; U.apply(o, [e, ...ce]); } else E.call(o, e); } catch (te) { m ? w.push(te) : m = te; } if (e.cancelBubble || S === t || S === null) break; o = S; } if (m) { for (let te of w) queueMicrotask(() => { throw te; }); throw m; } } finally { e.__root = t, delete e.currentTarget, Ne(_), Ze(h); } } } function Xr(e) { var t = document.createElement("template"); return t.innerHTML = e, t.content; } function Te(e, t) { var r = ( /** @type {Effect} */ N ); r.nodes_start === null && (r.nodes_start = e, r.nodes_end = t); } // @__NO_SIDE_EFFECTS__ function ke(e, t) { var r = (t & zo) !== 0, i = (t & Jo) !== 0, a, o = !e.startsWith("<!>"); return () => { if (M) return Te(F, null), F; a === void 0 && (a = Xr(o ? e : "<!>" + e), r || (a = /** @type {Node} */ /* @__PURE__ */ _e(a))); var u = ( /** @type {TemplateNode} */ i || ci ? document.importNode(a, !0) : a.cloneNode(!0) ); if (r) { var s = ( /** @type {TemplateNode} */ /* @__PURE__ */ _e(u) ), c = ( /** @type {TemplateNode} */ u.lastChild ); Te(s, c); } else Te(u, u); return u; }; } // @__NO_SIDE_EFFECTS__ function _r(e, t, r = "svg") { var i = !e.startsWith("<!>"), a = `<${r}>${i ? e : "<!>" + e}</${r}>`, o; return () => { if (M) return Te(F, null), F; if (!o) { var u = ( /** @type {DocumentFragment} */ Xr(a) ), s = ( /** @type {Element} */ /* @__PURE__ */ _e(u) ); o = /** @type {Element} */ /* @__PURE__ */ _e(s); } var c = ( /** @type {TemplateNode} */ o.cloneNode(!0) ); return Te(c, c), c; }; } function Xt() { if (M) return Te(F, null), F; var e = document.createDocumentFragment(), t = document.createComment(""), r = vr(); return e.append(t, r), Te(t, r), e; } function j(e, t) { if (M) { N.nodes_end = F, Ct(); return; } e !== null && e.before( /** @type {Node} */ t ); } function Ha(e, t) { var r = t == null ? "" : typeof t == "object" ? t + "" : t; r !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = r, e.nodeValue = r + ""); } function qi(e, t) { return Bi(e, t); } function Ga(e, t) { Or(), t.intro = t.intro ?? !1; const r = t.target, i = M, a = F; try { for (var o = ( /** @type {TemplateNode} */ /* @__PURE__ */ _e(r) ); o && (o.nodeType !== 8 || /** @type {Comment} */ o.data !== qr); ) o = /** @type {TemplateNode} */ /* @__PURE__ */ ze(o); if (!o) throw yt; bt(!0), We( /** @type {Comment} */ o ), Ct(); const u = Bi(e, { ...t, anchor: o }); if (F === null || F.nodeType !== 8 || /** @type {Comment} */ F.data !== ni) throw hr(), yt; return bt(!1), /** @type {Exports} */ u; } catch (u) { if (u === yt) return t.recover === !1 && ca(), Or(), _a(r), bt(!1), qi(e, t); throw u; } finally { bt(i), We(a); } } const mt = /* @__PURE__ */ new Map(); function Bi(e, { target: t, anchor: r, props: i = {}, events: a, context: o, intro: u = !0 }) { Or(); var s = /* @__PURE__ */ new Set(), c = (h) => { for (var m = 0; m < h.length; m++) { var w = h[m]; if (!s.has(w)) { s.add(w); var S = Va(w); t.addEventListener(w, Pt, { passive: S }); var E = mt.get(w); E === void 0 ? (document.addEventListener(w, Pt, { passive: S }), mt.set(w, 1)) : mt.set(w, E + 1); } } }; c(Qo(ji)), Vr.add(c); var d = void 0, _ = xa(() => { var h = r ?? t.appendChild(vr()); return Fr(() => { if (o) { Pi({}); var m = ( /** @type {ComponentContext} */ oe ); m.c = o; } a && (i.$$events = a), M && Te( /** @type {TemplateNode} */ h, null ), d = e(h, i) || {}, M && (N.nodes_end = F), o && Fi(); }), () => { var S; for (var m of s) { t.removeEventListener(m, Pt); var w = ( /** @type {number} */ mt.get(m) ); --w === 0 ? (document.removeEventListener(m, Pt), mt.delete(m)) : mt.set(m, w); } Vr.delete(c), h !== r && ((S = h.parentNode) == null || S.removeChild(h)); }; }); return Ur.set(d, _), d; } let Ur = /* @__PURE__ */ new WeakMap(); function Wa(e, t) { const r = Ur.get(e); return r ? (Ur.delete(e), r(t)) : Promise.resolve(); } function J(e, t, [r, i] = [0, 0]) { M && r === 0 && Ct(); var a = e, o = null, u = null, s = ue, c = r > 0 ? Hr : 0, d = !1; const _ = (m, w = !0) => { d = !0, h(w, m); }, h = (m, w) => { if (s === (s = m)) return; let S = !1; if (M && i !== -1) { if (r === 0) { const U = ( /** @type {Comment} */ a.data ); U === qr ? i = 0 : U === ri ? i = 1 / 0 : (i = parseInt(U.substring(1)), i !== i && (i = s ? 1 / 0 : -1)); } const E = i > r; !!s === E && (a = pa(), We(a), bt(!1), S = !0, i = -1); } s ? (o ? Bn(o) : w && (o = Fr(() => w(a))), u && Mr(u, () => { u = null; })) : (u ? Bn(u) : w && (u = Fr(() => w(a, [r + 1, i]))), o && Mr(o, () => { o = null; })), S && bt(!0); }; bi(() => { d = !1, t(_), d || h(null, null); }, c), M && (a = F); } function tt(e, t, r = !1, i = !1, a = !1) { var o = e, u = ""; $e(() => { var s = ( /** @type {Effect} */ N ); if (u === (u = t() ?? "")) { M && Ct(); return; } if (s.nodes_start !== null && (Ei( s.nodes_start, /** @type {TemplateNode} */ s.nodes_end ), s.nodes_start = s.nodes_end = null), u !== "") { if (M) { F.data; for (var c = Ct(), d = c; c !== null && (c.nodeType !== 8 || /** @type {Comment} */ c.data !== ""); ) d = c, c = /** @type {TemplateNode} */ /* @__PURE__ */ ze(c); if (c === null) throw hr(), yt; Te(F, d), o = We(c); return; } var _ = u + ""; r ? _ = `<svg>${_}</svg>` : i && (_ = `<math>${_}</math>`); var h = Xr(_); if ((r || i) && (h = /** @type {Element} */ /* @__PURE__ */ _e(h)), Te( /** @type {TemplateNode} */ /* @__PURE__ */ _e(h), /** @type {TemplateNode} */ h.lastChild ), r || i) for (; /* @__PURE__ */ _e(h); ) o.before( /** @type {Node} */ /* @__PURE__ */ _e(h) ); else o.before(h); } }); } function Ya(e, t, r, i, a) { var s; M && Ct(); var o = (s = t.$$slots) == null ? void 0 : s[r], u = !1; o === !0 && (o = t.children, u = !0), o === void 0 || o(e, u ? () => i : i); } const Zn = [...` \r\f \v\uFEFF`]; function Za(e, t, r) { var i = "" + e; if (r) { for (var a in r) if (r[a]) i = i ? i + " " + a : a; else if (i.length) for (var o = a.length, u = 0; (u = i.indexOf(a, u)) >= 0; ) { var s = u + o; (u === 0 || Zn.includes(i[u - 1])) && (s === i.length || Zn.includes(i[s])) ? i = (u === 0 ? "" : i.substring(0, u)) + i.substring(s + 1) : u = s; } } return i === "" ? null : i; } function za(e, t, r, i, a, o) { var u = e.__className; if (M || u !== r || u === void 0) { var s = Za(r, i, o); (!M || s !== e.getAttribute("class")) && (s == null ? e.removeAttribute("class") : e.className = s), e.__className = r; } else if (o && a !== o) for (var c in o) { var d = !!o[c]; (a == null || d !== !!a[c]) && e.classList.toggle(c, d); } return o; } const Ja = Symbol("is custom element"), Ka = Symbol("is html"); function zn(e) { if (M) { var t = !1, r = () => { if (!t) { if (t = !0, e.hasAttribute("value")) { var i = e.value; T(e, "value", null), e.value = i; } if (e.hasAttribute("checked")) { var a = e.checked; T(e, "checked", null), e.checked = a; } } }; e.__on_r = r, Ra(r), Vi(); } } function Xa(e, t) { var r = Hi(e); r.value === (r.value = // treat null and undefined the same for the initial value t ?? void 0) || // @ts-expect-error // `progress` elements always need their value set when it's `0` e.value === t && (t !== 0 || e.nodeName !== "PROGRESS") || (e.value = t ?? ""); } function T(e, t, r, i) { var a = Hi(e); M && (a[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === "LINK") || a[t] !== (a[t] = r) && (t === "loading" && (e[aa] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && Qa(e).includes(t) ? e[t] = r : e.setAttribute(t, r)); } function Hi(e) { return ( /** @type {Record<string | symbol, unknown>} **/ // @ts-expect-error e.__attributes ?? (e.__attributes = { [Ja]: e.nodeName.includes("-"), [Ka]: e.namespaceURI === Ko }) ); } var Jn = /* @__PURE__ */ new Map(); function Qa(e) { var t = Jn.get(e.nodeName); if (t) return t; Jn.set(e.nodeName, t = []); for (var r, i = e, a = Element.prototype; a !== i; ) { r = ea(i); for (var o in r) r[o].set && t.push(o); i = ai(i); } return t; } function el(e, t, r = t) { ja(e, "change", (i) => { var a = i ? e.defaultChecked : e.checked; r(a); }), // If we are hydrating and the value has since changed, // then use the update value from the input instead. (M && e.defaultChecked !== e.checked || // If defaultChecked is set, then checked == defaultChecked it(t) == null) && r(e.checked), Zr(() => { var i = t(); e.checked = !!i; }); } function Kn(e, t) { return e === t || (e == null ? void 0 : e[Ft]) === t; } function Qt(e = {}, t, r, i) { return Yr(() => { var a, o; return Zr(() => { a = o, o = [], it(() => { e !== r(...o) && (t(e, ...o), a && Kn(r(...a), e) && t(null, ...a)); }); }), () => { zr(() => { o && Kn(r(...o), e) && t(null, ...o); }); }; }), e; } function Gi(e) { oe === null && ii(), Pr(() => { const t = it(e); if (typeof t == "function") return ( /** @type {() => void} */ t ); }); } function tl(e) { oe === null && ii(), Gi(() => () => it(e)); } function Wi(e, t, r) { if (e == null) return t(void 0), wt; const i = it( () => e.subscribe( t, // @ts-expect-error r ) ); return i.unsubscribe ? () => i.unsubscribe() : i; } const _t = []; function rl(e, t = wt) { let r = null; const i = /* @__PURE__ */ new Set(); function a(s) { if (gi(e, s) && (e = s, r)) { const c = !_t.length; for (const d of i) d[1](), _t.push(d, e); if (c) { for (let d = 0; d < _t.length; d += 2) _t[d][0](_t[d + 1]); _t.length = 0; } } } function o(s) { a(s( /** @type {T} */ e )); } function u(s, c = wt) { const d = [s, c]; return i.add(d), i.size === 1 && (r = t(a, o) || wt), s( /** @type {T} */ e ), () => { i.delete(d), i.size === 0 && r && (r(), r = null); }; } return { set: a, update: o, subscribe: u }; } function rr(e) { let t; return Wi(e, (r) => t = r)(), t; } let er = !1, jr = Symbol(); function nl(e, t, r) { const i = r[t] ?? (r[t] = { store: null, source: /* @__PURE__ */ Kr(void 0), unsubscribe: wt }); if (i.store !== e && !(jr in r)) if (i.unsubscribe(), i.store = e ?? null, e == null) i.source.v = void 0, i.unsubscribe = wt; else { var a = !0; i.unsubscribe = Wi(e, (o) => { a ? i.source.v = o : b(i.source, o); }), a = !1; } return e && jr in r ? rr(e) : l(i.source); } function il() { const e = {}; function t() { Wr(() => { for (var r in e) e[r].unsubscribe(); Vt(e, jr, { enumerable: !1, value: !0 }); }); } return [e, t]; } function ol(e) { var t = er; try { return er = !1, [e(), er]; } finally { er = t; } } function Xn(e) { var t; return ((t = e.ctx) == null ? void 0 : t.d) ?? !1; } function I(e, t, r, i) { var st; var a = (r & Go) !== 0, o = !0, u = (r & Yo) !== 0, s = (r & Zo) !== 0, c = !1, d; u ? [d, c] = ol(() => ( /** @type {V} */ e[t] )) : d = /** @type {V} */ e[t]; var _ = Ft in e || fi in e, h = u && (((st = rt(e, t)) == null ? void 0 : st.set) ?? (_ && t in e && ((q) => e[t] = q))) || void 0, m = ( /** @type {V} */ i ), w = !0, S = !1, E = () => (S = !0, w && (w = !1, s ? m = it( /** @type {() => V} */ i ) : m = /** @type {V} */ i), m); d === void 0 && i !== void 0 && (h && o && da(), d = E(), h && h(d)); var U; if (U = () => { var q = ( /** @type {V} */ e[t] ); return q === void 0 ? E() : (w = !0, S = !1, q); }, (r & Wo) === 0) return U; if (h) { var ce = e.$$legacy; return function(q, ae) { return arguments.length > 0 ? ((!ae || ce || c) && h(ae ? U() : q), q) : U(); }; } var K = !1, te = /* @__PURE__ */ Kr(d), X = /* @__PURE__ */ gr(() => { var q = U(), ae = l(te); return K ? (K = !1, ae) : te.v = q; }); return u && l(X), a || (X.equals = Gr), function(q, ae) { if (arguments.length > 0) { const be = ae ? l(X) : u ? He(q) : q; if (!X.equals(be)) { if (K = !0, b(te, be), S && m !== void 0 && (m = be), Xn(X)) return q; it(() => l(X)); } return q; } return Xn(X) ? X.v : l(X); }; } function al(e) { return new ll(e); } var Pe, me; class ll { /** * @param {ComponentConstructorOptions & { * component: any; * }} options */ constructor(t) { /** @type {any} */ $r(this, Pe); /** @type {Record<string, any>} */ $r(this, me); var o; var r = /* @__PURE__ */ new Map(), i = (u, s) => { var c = /* @__PURE__ */ Kr(s); return r.set(u, c), c; }; const a = new Proxy( { ...t.props || {}, $$events: {} }, { get(u, s) { return l(r.get(s) ?? i(s, Reflect.get(u, s))); }, has(u, s) { return s === fi ? !0 : (l(r.get(s) ?? i(s, Reflect.get(u, s))), Reflect.has(u, s)); }, set(u, s, c) { return b(r.get(s) ?? i(s, c), c), Reflect.set(u, s, c); } } ); Sr(this, me, (t.hydrate ? Ga : qi)(t.component, { target: t.target, anchor: t.anchor, props: a, context: t.context, intro: t.intro ?? !1, recover: t.recover })), (!((o = t == null ? void 0 : t.props) != null && o.$$host) || t.sync === !1) && k(), Sr(this, Pe, a.$$events); for (const u of Object.keys(se(this, me))) u === "$set" || u === "$destroy" || u === "$on" || Vt(this, u, { get() { return se(this, me)[u]; }, /** @param {any} value */ set(s) { se(this, me)[u] = s; }, enumerable: !0 }); se(this, me).$set = /** @param {Record<string, any>} next */ (u) => { Object.assign(a, u); }, se(this, me).$destroy = () => { Wa(se(this, me)); }; } /** @param {Record<string, any>} props */ $set(t) { se(this, me).$set(t); } /** * @param {string} event * @param {(...args: any[]) => any} callback * @returns {any} */ $on(t, r) { se(this, Pe)[t] = se(this, Pe)[t] || []; const i = (...a) => r.call(this, ...a); return se(this, Pe)[t].push(i), () => { se(this, Pe)[t] = se(this, Pe)[t].filter( /** @param {any} fn */ (a) => a !== i ); }; } $destroy() { se(this, me).$destroy(); } } Pe = new WeakMap(), me = new WeakMap(); let Yi; typeof HTMLElement == "function" && (Yi = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots * @param {*} use_shadow_dom */ constructor(t, r, i) { super(); /** The Svelte component constructor */ Ee(this, "$$ctor"); /** Slots */ Ee(this, "$$s"); /** @type {any} The Svelte component instance */ Ee(this, "$$c"); /** Whether or not the custom element is connected */ Ee(this, "$$cn", !1); /** @type {Record<string, any>} Component props data */ Ee(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ Ee(this, "$$r", !1); /** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */ Ee(this, "$$p_d", {}); /** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */ Ee(this, "$$l", {}); /** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */ Ee(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ Ee(this, "$$me"); this.$$ctor = t, this.$$s = r, i && this.attachShadow({ mode: "open" }); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ addEventListener(t, r, i) { if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(r), this.$$c) { const a = this.$$c.$on(t, r); this.$$l_u.set(r, a); } super.addEventListener(t, r, i); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ removeEventListener(t, r, i) { if (super.removeEventListener(t, r, i), this.$$c) { const a = this.$$l_u.get(r); a && (a(), this.$$l_u.delete(r)); } } async connectedCallback() { if (this.$$cn = !0, !this.$$c) { let t = function(a) { return (o) => { const u = document.createElement("slot"); a !== "default" && (u.name = a), j(o, u); }; }; if (await Promise.resolve(), !this.$$cn || this.$$c) return; const r = {}, i = sl(this); for (const a of this.$$s) a in i && (a === "default" && !this.$$d.children ? (this.$$d.children = t(a), r.default = !0) : r[a] = t(a)); for (const a of this.attributes) { const o = this.$$g_p(a.name); o in this.$$d || (this.$$d[o] = nr(o, a.value, this.$$p_d, "toProp")); } for (const a in this.$$p_d) !(a in this.$$d) && this[a] !== void 0 && (this.$$d[a] = this[a], delete this[a]); this.$$c = al({ component: this.$$ctor, target: this.shadowRoot || this, props: { ...this.$$d, $$slots: r, $$host: this } }), this.$$me = Ca(() => { Zr(() => { var a; this.$$r = !0; for (const o of ir(this.$$c)) { if (!((a = this.$$p_d[o]) != null && a.reflect)) continue; this.$$d[o] = this.$$c[o]; const u = nr( o, this.$$d[o], this.$$p_d, "toAttribute" ); u == null ? this.removeAttribute(this.$$p_d[o].attribute || o) : this.setAttribute(this.$$p_d[o].attribute || o, u); } this.$$r = !1; }); }); for (const a in this.$$l) for (const o of this.$$l[a]) { const u = this.$$c.$on(a, o); this.$$l_u.set(o, u); } this.$$l = {}; } } // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte // and setting attributes through setAttribute etc, this is helpful /** * @param {string} attr * @param {string} _oldValue * @param {string} newValue */ attributeChangedCallback(t, r, i) { var a; this.$$r || (t = this.$$g_p(t), this.$$d[t] = nr(t, i, this.$$p_d, "toProp"), (a = this.$$c) == null || a.$set({ [t]: this.$$d[t] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0); }); } /** * @param {string} attribute_name */ $$g