var UE = Object.defineProperty; var BE = (t, e, n) => e in t ? UE(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; var de = (t, e, n) => BE(t, typeof e != "symbol" ? e + "" : e, n); function VE(t, e) { for (var n = 0; n < e.length; n++) { const i = e[n]; if (typeof i != "string" && !Array.isArray(i)) { for (const o in i) if (o !== "default" && !(o in t)) { const a = Object.getOwnPropertyDescriptor(i, o); a && Object.defineProperty(t, o, a.get ? a : { enumerable: !0, get: () => i[o] }); } } } return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" })); } const Qr = {}; let zE = 0; function Zi(t, e) { const n = `atom${++zE}`, i = { toString() { return (Qr ? "production" : void 0) !== "production" && this.debugLabel ? n + ":" + this.debugLabel : n; } }; return typeof t == "function" ? i.read = t : (i.init = t, i.read = HE, i.write = qE), e && (i.write = e), i; } function HE(t) { return t(this); } function qE(t, e, n) { return e( this, typeof n == "function" ? n(t(this)) : n ); } const Fv = (t, e) => t.unstable_is ? t.unstable_is(e) : e === t, pp = (t) => "init" in t, mp = (t) => !!t.write, jd = /* @__PURE__ */ new WeakMap(), dm = (t) => { var e; return fm(t) && !((e = jd.get(t)) != null && e[1]); }, KE = (t, e) => { const n = jd.get(t); if (n) n[1] = !0, n[0].forEach((i) => i(e)); else if ((Qr ? "production" : void 0) !== "production") throw new Error("[Bug] cancelable promise not found"); }, GE = (t) => { if (jd.has(t)) return; const e = [/* @__PURE__ */ new Set(), !1]; jd.set(t, e); const n = () => { e[1] = !0; }; t.then(n, n), t.onCancel = (i) => { e[0].add(i); }; }, fm = (t) => typeof (t == null ? void 0 : t.then) == "function", Mv = (t) => "v" in t || "e" in t, pd = (t) => { if ("e" in t) throw t.e; if ((Qr ? "production" : void 0) !== "production" && !("v" in t)) throw new Error("[Bug] atom state is not initialized"); return t.v; }, nw = (t, e, n) => { n.p.has(t) || (n.p.add(t), e.then( () => { n.p.delete(t); }, () => { n.p.delete(t); } )); }, $v = (t, e, n, i, o) => { var a; if ((Qr ? "production" : void 0) !== "production" && i === e) throw new Error("[Bug] atom cannot depend on itself"); n.d.set(i, o.n), dm(n.v) && nw(e, n.v, o), (a = o.m) == null || a.t.add(e), t && WE(t, i, e); }, za = () => [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map(), /* @__PURE__ */ new Set()], gp = (t, e, n) => { t[0].has(e) || t[0].set(e, /* @__PURE__ */ new Set()), t[1].set(e, n); }, WE = (t, e, n) => { const i = t[0].get(e); i && i.add(n); }, QE = (t, e) => t[0].get(e), jv = (t, e) => { t[2].add(e); }, Uo = (t) => { for (; t[1].size || t[2].size; ) { t[0].clear(); const e = new Set(t[1].values()); t[1].clear(); const n = new Set(t[2]); t[2].clear(), e.forEach((i) => { var o; return (o = i.m) == null ? void 0 : o.l.forEach((a) => a()); }), n.forEach((i) => i()); } }, rw = (t) => { let e; (Qr ? "production" : void 0) !== "production" && (e = /* @__PURE__ */ new Set()); const n = (x, C, $) => { const J = "v" in C, le = C.v, ne = dm(C.v) ? C.v : null; if (fm($)) { GE($); for (const he of C.d.keys()) nw( x, $, t(he, C) ); C.v = $, delete C.e; } else C.v = $, delete C.e; (!J || !Object.is(le, C.v)) && (++C.n, ne && KE(ne, $)); }, i = (x, C, $, J) => { var le; if (!(J != null && J(C)) && Mv($) && ($.m || Array.from($.d).every( ([Re, ut]) => ( // Recursively, read the atom state of the dependency, and // check if the atom epoch number is unchanged i(x, Re, t(Re, $), J).n === ut ) ))) return $; $.d.clear(); let ne = !0; const he = (Re) => { if (Fv(C, Re)) { const He = t(Re, $); if (!Mv(He)) if (pp(Re)) n(Re, He, Re.init); else throw new Error("no atom init"); return pd(He); } const ut = i( x, Re, t(Re, $), J ); if (ne) $v(x, C, $, Re, ut); else { const He = za(); $v(He, C, $, Re, ut), v(He, C, $), Uo(He); } return pd(ut); }; let ye, me; const Fe = { get signal() { return ye || (ye = new AbortController()), ye.signal; }, get setSelf() { return (Qr ? "production" : void 0) !== "production" && !mp(C) && console.warn("setSelf function cannot be used with read-only atom"), !me && mp(C) && (me = (...Re) => { if ((Qr ? "production" : void 0) !== "production" && ne && console.warn("setSelf function cannot be called in sync"), !ne) return p(C, ...Re); }), me; } }; try { const Re = C.read(he, Fe); if (n(C, $, Re), fm(Re)) { (le = Re.onCancel) == null || le.call(Re, () => ye == null ? void 0 : ye.abort()); const ut = () => { if ($.m) { const He = za(); v(He, C, $), Uo(He); } }; Re.then(ut, ut); } return $; } catch (Re) { return delete $.v, $.e = Re, ++$.n, $; } finally { ne = !1; } }, o = (x) => pd(i(void 0, x, t(x))), a = (x, C, $) => { var J, le; const ne = /* @__PURE__ */ new Map(); for (const he of ((J = $.m) == null ? void 0 : J.t) || []) ne.set(he, t(he, $)); for (const he of $.p) ne.set( he, t(he, $) ); return (le = QE(x, C)) == null || le.forEach((he) => { ne.set(he, t(he, $)); }), ne; }, l = (x, C, $) => { const J = [], le = /* @__PURE__ */ new Set(), ne = (me, Fe) => { if (!le.has(me)) { le.add(me); for (const [Re, ut] of a(x, me, Fe)) me !== Re && ne(Re, ut); J.push([me, Fe, Fe.n]); } }; ne(C, $); const he = /* @__PURE__ */ new Set([C]), ye = (me) => le.has(me); for (let me = J.length - 1; me >= 0; --me) { const [Fe, Re, ut] = J[me]; let He = !1; for (const We of Re.d.keys()) if (We !== Fe && he.has(We)) { He = !0; break; } He && (i(x, Fe, Re, ye), v(x, Fe, Re), ut !== Re.n && (gp(x, Fe, Re), he.add(Fe))), le.delete(Fe); } }, f = (x, C, $, ...J) => { const le = (ye) => pd(i(x, ye, t(ye, $))), ne = (ye, ...me) => { const Fe = t(ye, $); let Re; if (Fv(C, ye)) { if (!pp(ye)) throw new Error("atom not writable"); const ut = "v" in Fe, He = Fe.v, We = me[0]; n(ye, Fe, We), v(x, ye, Fe), (!ut || !Object.is(He, Fe.v)) && (gp(x, ye, Fe), l(x, ye, Fe)); } else Re = f(x, ye, Fe, ...me); return Uo(x), Re; }; return C.write(le, ne, ...J); }, p = (x, ...C) => { const $ = za(), J = f($, x, t(x), ...C); return Uo($), J; }, v = (x, C, $) => { if ($.m && !dm($.v)) { for (const J of $.d.keys()) $.m.d.has(J) || (k(x, J, t(J, $)).t.add(C), $.m.d.add(J)); for (const J of $.m.d || []) if (!$.d.has(J)) { $.m.d.delete(J); const le = b(x, J, t(J, $)); le == null || le.t.delete(C); } } }, k = (x, C, $) => { if (!$.m) { i(x, C, $); for (const J of $.d.keys()) k(x, J, t(J, $)).t.add(C); if ($.m = { l: /* @__PURE__ */ new Set(), d: new Set($.d.keys()), t: /* @__PURE__ */ new Set() }, (Qr ? "production" : void 0) !== "production" && e.add(C), mp(C) && C.onMount) { const J = $.m, { onMount: le } = C; jv(x, () => { const ne = le( (...he) => f(x, C, $, ...he) ); ne && (J.u = ne); }); } } return $.m; }, b = (x, C, $) => { if ($.m && !$.m.l.size && !Array.from($.m.t).some( (J) => { var le; return (le = t(J, $).m) == null ? void 0 : le.d.has(C); } )) { const J = $.m.u; J && jv(x, J), delete $.m, (Qr ? "production" : void 0) !== "production" && e.delete(C); for (const le of $.d.keys()) { const ne = b(x, le, t(le, $)); ne == null || ne.t.delete(C); } return; } return $.m; }, O = { get: o, set: p, sub: (x, C) => { const $ = za(), J = t(x), le = k($, x, J); Uo($); const ne = le.l; return ne.add(C), () => { ne.delete(C); const he = za(); b(he, x, J), Uo(he); }; }, unstable_derive: (x) => rw(...x(t)) }; return (Qr ? "production" : void 0) !== "production" && Object.assign(O, { // store dev methods (these are tentative and subject to change without notice) dev4_get_internal_weak_map: () => ({ get: (C) => { const $ = t(C); if ($.n !== 0) return $; } }), dev4_get_mounted_atoms: () => e, dev4_restore_atoms: (C) => { const $ = za(); for (const [J, le] of C) if (pp(J)) { const ne = t(J), he = "v" in ne, ye = ne.v; n(J, ne, le), v($, J, ne), (!he || !Object.is(ye, ne.v)) && (gp($, J, ne), l($, J, ne)); } Uo($); } }), O; }, YE = () => { const t = /* @__PURE__ */ new WeakMap(); return rw((n) => { let i = t.get(n); return i || (i = { d: /* @__PURE__ */ new Map(), p: /* @__PURE__ */ new Set(), n: 0 }, t.set(n, i)), i; }); }; let ol; const XE = () => (ol || (ol = YE(), (Qr ? "production" : void 0) !== "production" && (globalThis.__JOTAI_DEFAULT_STORE__ || (globalThis.__JOTAI_DEFAULT_STORE__ = ol), globalThis.__JOTAI_DEFAULT_STORE__ !== ol && console.warn( "Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044" ))), ol); var JE = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Wl(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } var yp = { exports: {} }, _t = {}; /** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Uv; function ZE() { if (Uv) return _t; Uv = 1; var t = Symbol.for("react.element"), e = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), l = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), v = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), b = Symbol.iterator; function w(D) { return D === null || typeof D != "object" ? null : (D = b && D[b] || D["@@iterator"], typeof D == "function" ? D : null); } var T = { isMounted: function() { return !1; }, enqueueForceUpdate: function() { }, enqueueReplaceState: function() { }, enqueueSetState: function() { } }, O = Object.assign, x = {}; function C(D, ae, Ve) { this.props = D, this.context = ae, this.refs = x, this.updater = Ve || T; } C.prototype.isReactComponent = {}, C.prototype.setState = function(D, ae) { if (typeof D != "object" && typeof D != "function" && D != null) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); this.updater.enqueueSetState(this, D, ae, "setState"); }, C.prototype.forceUpdate = function(D) { this.updater.enqueueForceUpdate(this, D, "forceUpdate"); }; function $() { } $.prototype = C.prototype; function J(D, ae, Ve) { this.props = D, this.context = ae, this.refs = x, this.updater = Ve || T; } var le = J.prototype = new $(); le.constructor = J, O(le, C.prototype), le.isPureReactComponent = !0; var ne = Array.isArray, he = Object.prototype.hasOwnProperty, ye = { current: null }, me = { key: !0, ref: !0, __self: !0, __source: !0 }; function Fe(D, ae, Ve) { var F, Y = {}, nt = null, Te = null; if (ae != null) for (F in ae.ref !== void 0 && (Te = ae.ref), ae.key !== void 0 && (nt = "" + ae.key), ae) he.call(ae, F) && !me.hasOwnProperty(F) && (Y[F] = ae[F]); var ze = arguments.length - 2; if (ze === 1) Y.children = Ve; else if (1 < ze) { for (var Ce = Array(ze), kt = 0; kt < ze; kt++) Ce[kt] = arguments[kt + 2]; Y.children = Ce; } if (D && D.defaultProps) for (F in ze = D.defaultProps, ze) Y[F] === void 0 && (Y[F] = ze[F]); return { $$typeof: t, type: D, key: nt, ref: Te, props: Y, _owner: ye.current }; } function Re(D, ae) { return { $$typeof: t, type: D.type, key: ae, ref: D.ref, props: D.props, _owner: D._owner }; } function ut(D) { return typeof D == "object" && D !== null && D.$$typeof === t; } function He(D) { var ae = { "=": "=0", ":": "=2" }; return "$" + D.replace(/[=:]/g, function(Ve) { return ae[Ve]; }); } var We = /\/+/g; function ot(D, ae) { return typeof D == "object" && D !== null && D.key != null ? He("" + D.key) : ae.toString(36); } function W(D, ae, Ve, F, Y) { var nt = typeof D; (nt === "undefined" || nt === "boolean") && (D = null); var Te = !1; if (D === null) Te = !0; else switch (nt) { case "string": case "number": Te = !0; break; case "object": switch (D.$$typeof) { case t: case e: Te = !0; } } if (Te) return Te = D, Y = Y(Te), D = F === "" ? "." + ot(Te, 0) : F, ne(Y) ? (Ve = "", D != null && (Ve = D.replace(We, "$&/") + "/"), W(Y, ae, Ve, "", function(kt) { return kt; })) : Y != null && (ut(Y) && (Y = Re(Y, Ve + (!Y.key || Te && Te.key === Y.key ? "" : ("" + Y.key).replace(We, "$&/") + "/") + D)), ae.push(Y)), 1; if (Te = 0, F = F === "" ? "." : F + ":", ne(D)) for (var ze = 0; ze < D.length; ze++) { nt = D[ze]; var Ce = F + ot(nt, ze); Te += W(nt, ae, Ve, Ce, Y); } else if (Ce = w(D), typeof Ce == "function") for (D = Ce.call(D), ze = 0; !(nt = D.next()).done; ) nt = nt.value, Ce = F + ot(nt, ze++), Te += W(nt, ae, Ve, Ce, Y); else if (nt === "object") throw ae = String(D), Error("Objects are not valid as a React child (found: " + (ae === "[object Object]" ? "object with keys {" + Object.keys(D).join(", ") + "}" : ae) + "). If you meant to render a collection of children, use an array instead."); return Te; } function L(D, ae, Ve) { if (D == null) return D; var F = [], Y = 0; return W(D, F, "", "", function(nt) { return ae.call(Ve, nt, Y++); }), F; } function oe(D) { if (D._status === -1) { var ae = D._result; ae = ae(), ae.then(function(Ve) { (D._status === 0 || D._status === -1) && (D._status = 1, D._result = Ve); }, function(Ve) { (D._status === 0 || D._status === -1) && (D._status = 2, D._result = Ve); }), D._status === -1 && (D._status = 0, D._result = ae); } if (D._status === 1) return D._result.default; throw D._result; } var ge = { current: null }, te = { transition: null }, ue = { ReactCurrentDispatcher: ge, ReactCurrentBatchConfig: te, ReactCurrentOwner: ye }; function M() { throw Error("act(...) is not supported in production builds of React."); } return _t.Children = { map: L, forEach: function(D, ae, Ve) { L(D, function() { ae.apply(this, arguments); }, Ve); }, count: function(D) { var ae = 0; return L(D, function() { ae++; }), ae; }, toArray: function(D) { return L(D, function(ae) { return ae; }) || []; }, only: function(D) { if (!ut(D)) throw Error("React.Children.only expected to receive a single React element child."); return D; } }, _t.Component = C, _t.Fragment = n, _t.Profiler = o, _t.PureComponent = J, _t.StrictMode = i, _t.Suspense = p, _t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ue, _t.act = M, _t.cloneElement = function(D, ae, Ve) { if (D == null) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + D + "."); var F = O({}, D.props), Y = D.key, nt = D.ref, Te = D._owner; if (ae != null) { if (ae.ref !== void 0 && (nt = ae.ref, Te = ye.current), ae.key !== void 0 && (Y = "" + ae.key), D.type && D.type.defaultProps) var ze = D.type.defaultProps; for (Ce in ae) he.call(ae, Ce) && !me.hasOwnProperty(Ce) && (F[Ce] = ae[Ce] === void 0 && ze !== void 0 ? ze[Ce] : ae[Ce]); } var Ce = arguments.length - 2; if (Ce === 1) F.children = Ve; else if (1 < Ce) { ze = Array(Ce); for (var kt = 0; kt < Ce; kt++) ze[kt] = arguments[kt + 2]; F.children = ze; } return { $$typeof: t, type: D.type, key: Y, ref: nt, props: F, _owner: Te }; }, _t.createContext = function(D) { return D = { $$typeof: l, _currentValue: D, _currentValue2: D, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, D.Provider = { $$typeof: a, _context: D }, D.Consumer = D; }, _t.createElement = Fe, _t.createFactory = function(D) { var ae = Fe.bind(null, D); return ae.type = D, ae; }, _t.createRef = function() { return { current: null }; }, _t.forwardRef = function(D) { return { $$typeof: f, render: D }; }, _t.isValidElement = ut, _t.lazy = function(D) { return { $$typeof: k, _payload: { _status: -1, _result: D }, _init: oe }; }, _t.memo = function(D, ae) { return { $$typeof: v, type: D, compare: ae === void 0 ? null : ae }; }, _t.startTransition = function(D) { var ae = te.transition; te.transition = {}; try { D(); } finally { te.transition = ae; } }, _t.unstable_act = M, _t.useCallback = function(D, ae) { return ge.current.useCallback(D, ae); }, _t.useContext = function(D) { return ge.current.useContext(D); }, _t.useDebugValue = function() { }, _t.useDeferredValue = function(D) { return ge.current.useDeferredValue(D); }, _t.useEffect = function(D, ae) { return ge.current.useEffect(D, ae); }, _t.useId = function() { return ge.current.useId(); }, _t.useImperativeHandle = function(D, ae, Ve) { return ge.current.useImperativeHandle(D, ae, Ve); }, _t.useInsertionEffect = function(D, ae) { return ge.current.useInsertionEffect(D, ae); }, _t.useLayoutEffect = function(D, ae) { return ge.current.useLayoutEffect(D, ae); }, _t.useMemo = function(D, ae) { return ge.current.useMemo(D, ae); }, _t.useReducer = function(D, ae, Ve) { return ge.current.useReducer(D, ae, Ve); }, _t.useRef = function(D) { return ge.current.useRef(D); }, _t.useState = function(D) { return ge.current.useState(D); }, _t.useSyncExternalStore = function(D, ae, Ve) { return ge.current.useSyncExternalStore(D, ae, Ve); }, _t.useTransition = function() { return ge.current.useTransition(); }, _t.version = "18.3.1", _t; } var Bv; function ag() { return Bv || (Bv = 1, yp.exports = ZE()), yp.exports; } var st = ag(); const hm = /* @__PURE__ */ Wl(st), iw = {}, eN = st.createContext( void 0 ), sw = (t) => st.useContext(eN) || XE(), ow = (t) => typeof (t == null ? void 0 : t.then) == "function", tN = (t) => { t.status = "pending", t.then( (e) => { t.status = "fulfilled", t.value = e; }, (e) => { t.status = "rejected", t.reason = e; } ); }, nN = hm.use || ((t) => { if (t.status === "pending") throw t; if (t.status === "fulfilled") return t.value; throw t.status === "rejected" ? t.reason : (tN(t), t); }), vp = /* @__PURE__ */ new WeakMap(), rN = (t) => { let e = vp.get(t); return e || (e = new Promise((n, i) => { let o = t; const a = (p) => (v) => { o === p && n(v); }, l = (p) => (v) => { o === p && i(v); }, f = (p) => { "onCancel" in p && typeof p.onCancel == "function" && p.onCancel((v) => { if ((iw ? "production" : void 0) !== "production" && v === p) throw new Error("[Bug] p is not updated even after cancelation"); ow(v) ? (vp.set(v, e), o = v, v.then(a(v), l(v)), f(v)) : n(v); }); }; t.then(a(t), l(t)), f(t); }), vp.set(t, e)), e; }; function Ud(t, e) { const n = sw(), [[i, o, a], l] = st.useReducer( (v) => { const k = n.get(t); return Object.is(v[0], k) && v[1] === n && v[2] === t ? v : [k, n, t]; }, void 0, () => [n.get(t), n, t] ); let f = i; if ((o !== n || a !== t) && (l(), f = n.get(t)), st.useEffect(() => { const v = n.sub(t, () => { l(); }); return l(), v; }, [n, t, void 0]), st.useDebugValue(f), ow(f)) { const v = rN(f); return nN(v); } return f; } function ug(t, e) { const n = sw(); return st.useCallback( (...o) => { if ((iw ? "production" : void 0) !== "production" && !("write" in t)) throw new Error("not writable atom"); return n.set(t, ...o); }, [n, t] ); } function kp(t, e) { return [ Ud(t), // We do wrong type assertion here, which results in throwing an error. ug(t) ]; } const aw = Zi(null); aw.debugLabel = "accountAtom"; const iN = { NZ_AWS_REGION: "us-east-1" }, { NZ_AWS_REGION: sN, NZ_BACKOFFICE_BACK_URL: oN, NZ_CORE_SERVICES_GRAPHQL_URL: aN, NZ_CORE_SERVICES_REST_URL: uN } = iN, ds = { AWS: { region: sN, cognito: { userPoolId: "us-east-1_EZ7wuZ4ig", userPoolWebClientId: "2jok7cst8ebf6ppscrhji57gvr" } }, // Back services apiUrls: { restV1: oN || "https://b133h34s56.execute-api.us-east-1.amazonaws.com", restV2: uN || "https://core-services-prod.nizza.com/api", graphql: aN || "https://core-services-prod.nizza.com/graphql", corsProxy: "https://3hvqfl2xcg.execute-api.us-east-1.amazonaws.com" }, publicUrls: { // Public app url platformSite: "https://platform.nizza.com", // Nizza CDN nizzaCdn: "https://cdn.nizza.com", // Bundle bundleSite: "https://bundle.nizza.com", // WSS IVS CHAT wssIVSChat: "wss://edge.ivschat.us-east-1.amazonaws.com", // Global Page globalPage: "https://live.nizza.com" } }; async function Jn(t) { const { url: e, method: n = "GET", body: i, raw: o = !1, contentTypeJson: a = !0, timeout: l, ...f } = t, p = new Headers({ ...a ? { "content-type": "application/json" } : {}, ...t.headers }), v = new AbortController(), { signal: k } = v; let b; const w = fetch(e, { method: n, headers: p, body: i, signal: k, ...f }); l && (b = setTimeout(() => { v.abort(); }, l)); const T = await w; if (o) return T; const O = await T.json(); if (clearTimeout(b), !T.ok) { const x = O ? JSON.stringify(O) : T.statusText; throw new Error(x); } return O; } const pm = (t) => Jn({ ...t, contentTypeJson: !1, raw: !1 }); function lN(t, e, n) { fetch(e).then((i) => i.blob()).then((i) => uw(i, `${t}.${n}`)); } const uw = (t, e, n) => { const i = [t], o = new Blob(i, { type: n ?? "application/octet-stream" }); if (typeof window.navigator.msSaveBlob < "u") return window.navigator.msSaveBlob(o, e); const a = window.URL && window.URL.createObjectURL ? window.URL.createObjectURL(o) : window.webkitURL.createObjectURL(o), l = document.createElement("a"); return l.style.display = "none", l.href = a, l.setAttribute("download", e), typeof l.download > "u" && l.setAttribute("target", "_blank"), document.body.appendChild(l), l.click(), setTimeout(() => { document.body.removeChild(l), window.URL.revokeObjectURL(a); }, 200); }; var cN = "2.0.3", mm = 500, Vv = "user-agent", au = "", zv = "?", Bd = "function", Qs = "undefined", uu = "object", gm = "string", Wn = "browser", es = "cpu", wi = "device", Yr = "engine", Or = "os", iu = "result", be = "name", pe = "type", we = "vendor", Ne = "version", Qn = "architecture", Ll = "major", ke = "model", wl = "console", gt = "mobile", Ft = "tablet", ln = "smarttv", _i = "wearable", _p = "xr", Sl = "embedded", al = "inapp", lg = "brands", zo = "formFactors", cg = "fullVersionList", su = "platform", dg = "platformVersion", df = "bitness", io = "sec-ch-ua", dN = io + "-full-version-list", fN = io + "-arch", hN = io + "-" + df, pN = io + "-form-factors", mN = io + "-" + gt, gN = io + "-" + ke, lw = io + "-" + su, yN = lw + "-version", cw = [lg, cg, gt, ke, su, dg, Qn, zo, df], md = "Amazon", Ha = "Apple", Hv = "ASUS", qv = "BlackBerry", Bo = "Google", Kv = "Huawei", Gv = "Lenovo", Wv = "Honor", gd = "LG", wp = "Microsoft", Sp = "Motorola", bp = "Nvidia", Qv = "OnePlus", Ep = "OPPO", ul = "Samsung", Yv = "Sharp", ll = "Sony", Np = "Xiaomi", Ap = "Zebra", Xv = "Chrome", Jv = "Chromium", Hs = "Chromecast", vN = "Edge", cl = "Firefox", dl = "Opera", xp = "Facebook", Zv = "Sogou", qa = "Mobile ", fl = " Browser", ym = "Windows", kN = typeof window !== Qs, Yn = kN && window.navigator ? window.navigator : void 0, Ks = Yn && Yn.userAgentData ? Yn.userAgentData : void 0, _N = function(t, e) { var n = {}, i = e; if (!Vd(e)) { i = {}; for (var o in e) for (var a in e[o]) i[a] = e[o][a].concat(i[a] ? i[a] : []); } for (var l in t) n[l] = i[l] && i[l].length % 2 === 0 ? i[l].concat(t[l]) : t[l]; return n; }, ff = function(t) { for (var e = {}, n = 0; n < t.length; n++) e[t[n].toUpperCase()] = t[n]; return e; }, vm = function(t, e) { if (typeof t === uu && t.length > 0) { for (var n in t) if (rs(t[n]) == rs(e)) return !0; return !1; } return pu(t) ? rs(e).indexOf(rs(t)) !== -1 : !1; }, Vd = function(t, e) { for (var n in t) return /^(browser|cpu|device|engine|os)$/.test(n) || (e ? Vd(t[n]) : !1); }, pu = function(t) { return typeof t === gm; }, Cp = function(t) { if (t) { for (var e = [], n = lu(/\\?\"/g, t).split(","), i = 0; i < n.length; i++) if (n[i].indexOf(";") > -1) { var o = Dl(n[i]).split(";v="); e[i] = { brand: o[0], version: o[1] }; } else e[i] = Dl(n[i]); return e; } }, rs = function(t) { return pu(t) ? t.toLowerCase() : t; }, Op = function(t) { return pu(t) ? lu(/[^\d\.]/g, t).split(".")[0] : void 0; }, is = function(t) { for (var e in t) { var n = t[e]; typeof n == uu && n.length == 2 ? this[n[0]] = n[1] : this[n] = void 0; } return this; }, lu = function(t, e) { return pu(e) ? e.replace(t, au) : e; }, hl = function(t) { return lu(/\\?\"/g, t); }, Dl = function(t, e) { if (pu(t)) return t = lu(/^\s\s*/, t), typeof e === Qs ? t : t.substring(0, mm); }, Tp = function(t, e) { if (!(!t || !e)) for (var n = 0, i, o, a, l, f, p; n < e.length && !f; ) { var v = e[n], k = e[n + 1]; for (i = o = 0; i < v.length && !f && v[i]; ) if (f = v[i++].exec(t), f) for (a = 0; a < k.length; a++) p = f[++o], l = k[a], typeof l === uu && l.length > 0 ? l.length === 2 ? typeof l[1] == Bd ? this[l[0]] = l[1].call(this, p) : this[l[0]] = l[1] : l.length === 3 ? typeof l[1] === Bd && !(l[1].exec && l[1].test) ? this[l[0]] = p ? l[1].call(this, p, l[2]) : void 0 : this[l[0]] = p ? p.replace(l[1], l[2]) : void 0 : l.length === 4 && (this[l[0]] = p ? l[3].call(this, p.replace(l[1], l[2])) : void 0) : this[l] = p || void 0; n += 2; } }, Gs = function(t, e) { for (var n in e) if (typeof e[n] === uu && e[n].length > 0) { for (var i = 0; i < e[n].length; i++) if (vm(e[n][i], t)) return n === zv ? void 0 : n; } else if (vm(e[n], t)) return n === zv ? void 0 : n; return e.hasOwnProperty("*") ? e["*"] : t; }, ek = { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2e3: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", "8.1": "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" }, tk = { embedded: "Automotive", mobile: "Mobile", tablet: ["Tablet", "EInk"], smarttv: "TV", wearable: "Watch", xr: ["VR", "XR"], "?": ["Desktop", "Unknown"], "*": void 0 }, nk = { browser: [ [ // Most common regardless engine /\b(?:crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS ], [Ne, [be, qa + "Chrome"]], [ /edg(?:e|ios|a)?\/([\w\.]+)/i // Microsoft Edge ], [Ne, [be, "Edge"]], [ // Presto based /(opera mini)\/([-\w\.]+)/i, // Opera Mini /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, // Opera Mobi/Tablet /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i // Opera ], [be, Ne], [ /opios[\/ ]+([\w\.]+)/i // Opera mini on iphone >= 8.0 ], [Ne, [be, dl + " Mini"]], [ /\bop(?:rg)?x\/([\w\.]+)/i // Opera GX ], [Ne, [be, dl + " GX"]], [ /\bopr\/([\w\.]+)/i // Opera Webkit ], [Ne, [be, dl]], [ // Mixed /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i // Baidu ], [Ne, [be, "Baidu"]], [ /\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i // Maxthon ], [Ne, [be, "Maxthon"]], [ /(kindle)\/([\w\.]+)/i, // Kindle /(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer/Sleipnir // Trident based /(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i, // Avant/IEMobile/SlimBrowser/SlimBoat/Slimjet /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer // Blink/Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon/LG Browser/Otter/qutebrowser/Dooble /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i, // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar/Helio/Dragon /(heytap|ovi|115|surf)browser\/([\d\.]+)/i, // HeyTap/Ovi/115/Surf /(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i // Ecosia/Weibo ], [be, Ne], [ /quark(?:pc)?\/([-\w\.]+)/i // Quark ], [Ne, [be, "Quark"]], [ /\bddg\/([\w\.]+)/i // DuckDuckGo ], [Ne, [be, "DuckDuckGo"]], [ /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser ], [Ne, [be, "UCBrowser"]], [ /microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser /\bqbcore\/([\w\.]+).+microm/i, /micromessenger\/([\w\.]+)/i // WeChat ], [Ne, [be, "WeChat"]], [ /konqueror\/([\w\.]+)/i // Konqueror ], [Ne, [be, "Konqueror"]], [ /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11 ], [Ne, [be, "IE"]], [ /ya(?:search)?browser\/([\w\.]+)/i // Yandex ], [Ne, [be, "Yandex"]], [ /slbrowser\/([\w\.]+)/i // Smart Lenovo Browser ], [Ne, [be, "Smart " + Gv + fl]], [ /(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser ], [[be, /(.+)/, "$1 Secure" + fl], Ne], [ /\bfocus\/([\w\.]+)/i // Firefox Focus ], [Ne, [be, cl + " Focus"]], [ /\bopt\/([\w\.]+)/i // Opera Touch ], [Ne, [be, dl + " Touch"]], [ /coc_coc\w+\/([\w\.]+)/i // Coc Coc Browser ], [Ne, [be, "Coc Coc"]], [ /dolfin\/([\w\.]+)/i // Dolphin ], [Ne, [be, "Dolphin"]], [ /coast\/([\w\.]+)/i // Opera Coast ], [Ne, [be, dl + " Coast"]], [ /miuibrowser\/([\w\.]+)/i // MIUI Browser ], [Ne, [be, "MIUI" + fl]], [ /fxios\/([\w\.-]+)/i // Firefox for iOS ], [Ne, [be, qa + cl]], [ /\bqihoobrowser\/?([\w\.]*)/i // 360 ], [Ne, [be, "360"]], [ /\b(qq)\/([\w\.]+)/i // QQ ], [[be, /(.+)/, "$1Browser"], Ne], [ /(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i ], [[be, /(.+)/, "$1" + fl], Ne], [ // Oculus/Sailfish/HuaweiBrowser/VivoBrowser/PicoBrowser /samsungbrowser\/([\w\.]+)/i // Samsung Internet ], [Ne, [be, ul + " Internet"]], [ /metasr[\/ ]?([\d\.]+)/i // Sogou Explorer ], [Ne, [be, Zv + " Explorer"]], [ /(sogou)mo\w+\/([\d\.]+)/i // Sogou Mobile ], [[be, Zv + " Mobile"], Ne], [ /(electron)\/([\w\.]+) safari/i, // Electron-based App /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla /m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i // QQ/2345 ], [be, Ne], [ /(lbbrowser|rekonq)/i // LieBao Browser/Rekonq ], [be], [ /ome\/([\w\.]+) \w* ?(iron) saf/i, // Iron /ome\/([\w\.]+).+qihu (360)[es]e/i // 360 ], [Ne, be], [ // WebView /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android ], [[be, xp], Ne, [pe, al]], [ /(Klarna)\/([\w\.]+)/i, // Klarna Shopping Browser for iOS & Android /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp /(daum)apps[\/ ]([\w\.]+)/i, // Daum App /safari (line)\/([\w\.]+)/i, // Line App for iOS /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android /(alipay)client\/([\w\.]+)/i, // Alipay /(twitter)(?:and| f.+e\/([\w\.]+))/i, // Twitter /(instagram|snapchat)[\/ ]([-\w\.]+)/i // Instagram/Snapchat ], [be, Ne, [pe, al]], [ /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS ], [Ne, [be, "GSA"], [pe, al]], [ /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok ], [Ne, [be, "TikTok"], [pe, al]], [ /\[(linkedin)app\]/i // LinkedIn App for iOS & Android ], [be, [pe, al]], [ /(chromium)[\/ ]([-\w\.]+)/i // Chromium ], [be, Ne], [ /headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless ], [Ne, [be, Xv + " Headless"]], [ / wv\).+(chrome)\/([\w\.]+)/i // Chrome WebView ], [[be, Xv + " WebView"], Ne], [ /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i // Android Browser ], [Ne, [be, "Android" + fl]], [ /chrome\/([\w\.]+) mobile/i // Chrome Mobile ], [Ne, [be, qa + "Chrome"]], [ /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia ], [be, Ne], [ /version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i // Safari Mobile ], [Ne, [be, qa + "Safari"]], [ /iphone .*mobile(?:\/\w+ | ?)safari/i ], [[be, qa + "Safari"]], [ /version\/([\w\.\,]+) .*(safari)/i // Safari ], [Ne, be], [ /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 ], [be, [Ne, "1"]], [ /(webkit|khtml)\/([\w\.]+)/i ], [be, Ne], [ // Gecko based /(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i // Firefox Mobile ], [[be, qa + cl], Ne], [ /(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape ], [[be, "Netscape"], Ne], [ /(wolvic|librewolf)\/([\w\.]+)/i // Wolvic/LibreWolf ], [be, Ne], [ /mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality ], [Ne, [be, cl + " Reality"]], [ /ekiohf.+(flow)\/([\w\.]+)/i, // Flow /(swiftfox)/i, // Swiftfox /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i, // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix /(firefox)\/([\w\.]+)/i, // Other Firefox-based /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, // Mozilla // Other /(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Obigo/Mosaic/Go/ICE/UP.Browser/Ladybird /\b(links) \(([\w\.]+)/i // Links ], [be, [Ne, /_/g, "."]], [ /(cobalt)\/([\w\.]+)/i // Cobalt ], [be, [Ne, /[^\d\.]+./, au]] ], cpu: [ [ /\b((amd|x|x86[-_]?|wow|win)64)\b/i // AMD64 (x64) ], [[Qn, "amd64"]], [ /(ia32(?=;))/i, // IA32 (quicktime) /\b((i[346]|x)86)(pc)?\b/i // IA32 (x86) ], [[Qn, "ia32"]], [ /\b(aarch64|arm(v?[89]e?l?|_?64))\b/i // ARM64 ], [[Qn, "arm64"]], [ /\b(arm(v[67])?ht?n?[fl]p?)\b/i // ARMHF ], [[Qn, "armhf"]], [ // PocketPC mistakenly identified as PowerPC /( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i ], [[Qn, "arm"]], [ /((ppc|powerpc)(64)?)( mac|;|\))/i // PowerPC ], [[Qn, /ower/, au, rs]], [ / sun4\w[;\)]/i // SPARC ], [[Qn, "sparc"]], [ /\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC ], [[Qn, rs]] ], device: [ [ ////////////////////////// // MOBILES & TABLETS ///////////////////////// // Samsung /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i ], [ke, [we, ul], [pe, Ft]], [ /\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]((?!sm-[lr])[-\w]+)/i, /sec-(sgh\w+)/i ], [ke, [we, ul], [pe, gt]], [ // Apple /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i // iPod/iPhone ], [ke, [we, Ha], [pe, gt]], [ /\((ipad);[-\w\),; ]+apple/i, // iPad /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i ], [ke, [we, Ha], [pe, Ft]], [ /(macintosh);/i ], [ke, [we, Ha]], [ // Sharp /\b(sh-?[altvz]?\d\d[a-ekm]?)/i ], [ke, [we, Yv], [pe, gt]], [ // Honor /\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i ], [ke, [we, Wv], [pe, Ft]], [ /honor([-\w ]+)[;\)]/i ], [ke, [we, Wv], [pe, gt]], [ // Huawei /\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i ], [ke, [we, Kv], [pe, Ft]], [ /(?:huawei)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i ], [ke, [we, Kv], [pe, gt]], [ // Xiaomi /oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i, /\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i // Mi Pad tablets ], [[ke, /_/g, " "], [we, Np], [pe, Ft]], [ /\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i, // Xiaomi POCO /\b; (\w+) build\/hm\1/i, // Xiaomi Hongmi 'numeric' models /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, // Xiaomi Redmi 'numeric' models /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i, // Xiaomi Mi / ([\w ]+) miui\/v?\d/i ], [[ke, /_/g, " "], [we, Np], [pe, gt]], [ // OPPO /; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i ], [ke, [we, Ep], [pe, gt]], [ /\b(opd2(\d{3}a?))(?: bui|\))/i ], [ke, [we, Gs, { OnePlus: ["304", "403", "203"], "*": Ep }], [pe, Ft]], [ // BLU Vivo Series /(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i ], [ke, [we, "BLU"], [pe, gt]], [ // Vivo /; vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i ], [ke, [we, "Vivo"], [pe, gt]], [ // Realme /\b(rmx[1-3]\d{3})(?: bui|;|\))/i ], [ke, [we, "Realme"], [pe, gt]], [ // Motorola /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i ], [ke, [we, Sp], [pe, gt]], [ /\b(mz60\d|xoom[2 ]{0,2}) build\//i ], [ke, [we, Sp], [pe, Ft]], [ // LG /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i ], [ke, [we, gd], [pe, Ft]], [ /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i, /\blg-?([\d\w]+) bui/i ], [ke, [we, gd], [pe, gt]], [ // Lenovo /(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i, /lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i ], [ke, [we, Gv], [pe, Ft]], [ // Nokia /(nokia) (t[12][01])/i ], [we, ke, [pe, Ft]], [ /(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i, /nokia[-_ ]?(([-\w\. ]*))/i ], [[ke, /_/g, " "], [pe, gt], [we, "Nokia"]], [ // Google /(pixel (c|tablet))\b/i // Google Pixel C/Tablet ], [ke, [we, Bo], [pe, Ft]], [ /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i // Google Pixel ], [ke, [we, Bo], [pe, gt]], [ // Sony /droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i ], [ke, [we, ll], [pe, gt]], [ /sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i ], [[ke, "Xperia Tablet"], [we, ll], [pe, Ft]], [ // OnePlus / (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i ], [ke, [we, Qv], [pe, gt]], [ // Amazon /(alexa)webm/i, /(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i, // Kindle Fire without Silk / Echo Show /(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD ], [ke, [we, md], [pe, Ft]], [ /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone ], [[ke, /(.+)/g, "Fire Phone $1"], [we, md], [pe, gt]], [ // BlackBerry /(playbook);[-\w\),; ]+(rim)/i // BlackBerry PlayBook ], [ke, we, [pe, Ft]], [ /\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i // BlackBerry 10 ], [ke, [we, qv], [pe, gt]], [ // Asus /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i ], [ke, [we, Hv], [pe, Ft]], [ / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i ], [ke, [we, Hv], [pe, gt]], [ // HTC /(nexus 9)/i // HTC Nexus 9 ], [ke, [we, "HTC"], [pe, Ft]], [ /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, // HTC // ZTE /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony ], [we, [ke, /_/g, " "], [pe, gt]], [ // TCL /tcl (xess p17aa)/i, /droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i ], [ke, [we, "TCL"], [pe, Ft]], [ /droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i ], [ke, [we, "TCL"], [pe, gt]], [ // itel /(itel) ((\w+))/i ], [[we, rs], ke, [pe, Gs, { tablet: ["p10001l", "w7001"], "*": "mobile" }]], [ // Acer /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i ], [ke, [we, "Acer"], [pe, Ft]], [ // Meizu /droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i ], [ke, [we, "Meizu"], [pe, gt]], [ // Ulefone /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i ], [ke, [we, "Ulefone"], [pe, gt]], [ // Energizer /; (energy ?\w+)(?: bui|\))/i, /; energizer ([\w ]+)(?: bui|\))/i ], [ke, [we, "Energizer"], [pe, gt]], [ // Cat /; cat (b35);/i, /; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i ], [ke, [we, "Cat"], [pe, gt]], [ // Smartfren /((?:new )?andromax[\w- ]+)(?: bui|\))/i ], [ke, [we, "Smartfren"], [pe, gt]], [ // Nothing /droid.+; (a(?:015|06[35]|142p?))/i ], [ke, [we, "Nothing"], [pe, gt]], [ // Archos /; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i, /archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i ], [ke, [we, "Archos"], [pe, Ft]], [ /archos ([\w ]+)( b|\))/i, /; (ac[3-6]\d\w{2,8})( b|\))/i ], [ke, [we, "Archos"], [pe, gt]], [ // MIXED /(imo) (tab \w+)/i, // IMO /(infinix) (x1101b?)/i // Infinix XPad ], [we, ke, [pe, Ft]], [ /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i, // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron/Infinix/Tecno/Micromax/Advan /; (blu|hmd|imo|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i, // BLU/HMD/IMO/TCL /(hp) ([\w ]+\w)/i, // HP iPAQ /(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia /(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i, // Lenovo /(oppo) ?([\w ]+) bui/i // OPPO ], [we, ke, [pe, gt]], [ /(kobo)\s(ereader|touch)/i, // Kobo /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad /(kindle)\/([\w\.]+)/i // Kindle ], [we, ke, [pe, Ft]], [ /(surface duo)/i // Surface Duo ], [ke, [we, wp], [pe, Ft]], [ /droid [\d\.]+; (fp\du?)(?: b|\))/i // Fairphone ], [ke, [we, "Fairphone"], [pe, gt]], [ /((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i // Nvidia Tablets ], [ke, [we, bp], [pe, Ft]], [ /(sprint) (\w+)/i // Sprint Phones ], [we, ke, [pe, gt]], [ /(kin\.[onetw]{3})/i // Microsoft Kin ], [[ke, /\./g, " "], [we, wp], [pe, gt]], [ /droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i // Zebra ], [ke, [we, Ap], [pe, Ft]], [ /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i ], [ke, [we, Ap], [pe, gt]], [ /////////////////// // SMARTTVS /////////////////// /smart-tv.+(samsung)/i // Samsung ], [we, [pe, ln]], [ /hbbtv.+maple;(\d+)/i ], [[ke, /^/, "SmartTV"], [we, ul], [pe, ln]], [ /tcast.+(lg)e?. ([-\w]+)/i // LG SmartTV ], [we, ke, [pe, ln]], [ /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i ], [[we, gd], [pe, ln]], [ /(apple) ?tv/i // Apple TV ], [we, [ke, Ha + " TV"], [pe, ln]], [ /crkey.*devicetype\/chromecast/i // Google Chromecast Third Generation ], [[ke, Hs + " Third Generation"], [we, Bo], [pe, ln]], [ /crkey.*devicetype\/([^/]*)/i // Google Chromecast with specific device type ], [[ke, /^/, "Chromecast "], [we, Bo], [pe, ln]], [ /fuchsia.*crkey/i // Google Chromecast Nest Hub ], [[ke, Hs + " Nest Hub"], [we, Bo], [pe, ln]], [ /crkey/i // Google Chromecast, Linux-based or unknown ], [[ke, Hs], [we, Bo], [pe, ln]], [ /(portaltv)/i // Facebook Portal TV ], [ke, [we, xp], [pe, ln]], [ /droid.+aft(\w+)( bui|\))/i // Fire TV ], [ke, [we, md], [pe, ln]], [ /(shield \w+ tv)/i // Nvidia Shield TV ], [ke, [we, bp], [pe, ln]], [ /\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i // Sharp ], [ke, [we, Yv], [pe, ln]], [ /(bravia[\w ]+)( bui|\))/i // Sony ], [ke, [we, ll], [pe, ln]], [ /(mi(tv|box)-?\w+) bui/i // Xiaomi ], [ke, [we, Np], [pe, ln]], [ /Hbbtv.*(technisat) (.*);/i // TechniSAT ], [we, ke, [pe, ln]], [ /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, // Roku /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i // HbbTV devices ], [[we, Dl], [ke, Dl], [pe, ln]], [ // SmartTV from Unidentified Vendors /droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i ], [ke, [pe, ln]], [ /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i ], [[pe, ln]], [ /////////////////// // CONSOLES /////////////////// /(ouya)/i, // Ouya /(nintendo) (\w+)/i // Nintendo ], [we, ke, [pe, wl]], [ /droid.+; (shield)( bui|\))/i // Nvidia Portable ], [ke, [we, bp], [pe, wl]], [ /(playstation \w+)/i // Playstation ], [ke, [we, ll], [pe, wl]], [ /\b(xbox(?: one)?(?!; xbox))[\); ]/i // Microsoft Xbox ], [ke, [we, wp], [pe, wl]], [ /////////////////// // WEARABLES /////////////////// /\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i // Samsung Galaxy Watch ], [ke, [we, ul], [pe, _i]], [ /((pebble))app/i, // Pebble /(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i // Asus ZenWatch / LG Watch / Pixel Watch ], [we, ke, [pe, _i]], [ /(ow(?:19|20)?we?[1-3]{1,3})/i // Oppo Watch ], [ke, [we, Ep], [pe, _i]], [ /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i // Apple Watch ], [ke, [we, Ha], [pe, _i]], [ /(opwwe\d{3})/i // OnePlus Watch ], [ke, [we, Qv], [pe, _i]], [ /(moto 360)/i // Motorola 360 ], [ke, [we, Sp], [pe, _i]], [ /(smartwatch 3)/i // Sony SmartWatch ], [ke, [we, ll], [pe, _i]], [ /(g watch r)/i // LG G Watch R ], [ke, [we, gd], [pe, _i]], [ /droid.+; (wt63?0{2,3})\)/i ], [ke, [we, Ap], [pe, _i]], [ /////////////////// // XR /////////////////// /droid.+; (glass) \d/i // Google Glass ], [ke, [we, Bo], [pe, _p]], [ /(pico) (4|neo3(?: link|pro)?)/i // Pico ], [we, ke, [pe, _p]], [ /(quest( \d| pro)?s?).+vr/i // Meta Quest ], [ke, [we, xp], [pe, _p]], [ /////////////////// // EMBEDDED /////////////////// /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i // Tesla ], [we, [pe, Sl]], [ /(aeobc)\b/i // Echo Dot ], [ke, [we, md], [pe, Sl]], [ /(homepod).+mac os/i // Apple HomePod ], [ke, [we, Ha], [pe, Sl]], [ /windows iot/i ], [[pe, Sl]], [ //////////////////// // MIXED (GENERIC) /////////////////// /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i ], [ke, [pe, Gs, { mobile: "Mobile", xr: "VR", "*": Ft }]], [ /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i // Unidentifiable Tablet ], [[pe, Ft]], [ /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile ], [[pe, gt]], [ /droid .+?; ([\w\. -]+)( bui|\))/i // Generic Android Device ], [ke, [we, "Generic"]] ], engine: [ [ /windows.+ edge\/([\w\.]+)/i // EdgeHTML ], [Ne, [be, vN + "HTML"]], [ /(arkweb)\/([\w\.]+)/i // ArkWeb ], [be, Ne], [ /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i // Blink ], [Ne, [be, "Blink"]], [ /(presto)\/([\w\.]+)/i, // Presto /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna/Servo /ekioh(flow)\/([\w\.]+)/i, // Flow /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links /(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab /\b(libweb)/i // LibWeb ], [be, Ne], [ /ladybird\//i ], [[be, "LibWeb"]], [ /rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko ], [Ne, be] ], os: [ [ // Windows /microsoft (windows) (vista|xp)/i // Windows (iTunes) ], [be, Ne], [ /(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i // Windows Phone ], [be, [Ne, Gs, ek]], [ /windows nt 6\.2; (arm)/i, // Windows RT /windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i, /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i ], [[Ne, Gs, ek], [be, ym]], [ // iOS/macOS /[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, /cfnetwork\/.+darwin/i ], [[Ne, /_/g, "."], [be, "iOS"]], [ /(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i // Mac OS ], [[be, "macOS"], [Ne, /_/g, "."]], [ // Google Chromecast /android ([\d\.]+).*crkey/i // Google Chromecast, Android-based ], [Ne, [be, Hs + " Android"]], [ /fuchsia.*crkey\/([\d\.]+)/i // Google Chromecast, Fuchsia-based ], [Ne, [be, Hs + " Fuchsia"]], [ /crkey\/([\d\.]+).*devicetype\/smartspeaker/i // Google Chromecast, Linux-based Smart Speaker ], [Ne, [be, Hs + " SmartSpeaker"]], [ /linux.*crkey\/([\d\.]+)/i // Google Chromecast, Legacy Linux-based ], [Ne, [be, Hs + " Linux"]], [ /crkey\/([\d\.]+)/i // Google Chromecast, unknown ], [Ne, [be, Hs]], [ // Mobile OSes /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS ], [Ne, be], [ /(ubuntu) ([\w\.]+) like android/i // Ubuntu Touch ], [[be, /(.+)/, "$1 Touch"], Ne], [ // Android/Blackberry/WebOS/QNX/Bada/RIM/KaiOS/Maemo/MeeGo/S40/Sailfish OS/OpenHarmony/Tizen /(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i ], [be, Ne], [ /\(bb(10);/i // BlackBerry 10 ], [Ne, [be, qv]], [ /(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i // Symbian ], [Ne, [be, "Symbian"]], [ /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i // Firefox OS ], [Ne, [be, cl + " OS"]], [ /web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i // WebOS ], [Ne, [be, "webOS"]], [ /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i // watchOS ], [Ne, [be, "watchOS"]], [ // Google ChromeOS /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i // Chromium OS ], [[be, "Chrome OS"], Ne], [ // Smart TVs /panasonic;(viera)/i, // Panasonic Viera /(netrange)mmh/i, // Netrange /(nettv)\/(\d+\.[\w\.]+)/i, // NetTV // Console /(nintendo|playstation) (\w+)/i, // Nintendo/Playstation /(xbox); +xbox ([^\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S) /(pico) .+os([\w\.]+)/i, // Pico // Other /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, // Joli/Palm /(mint)[\/\(\) ]?(\w*)/i, // Mint /(mageia|vectorlinux)[; ]/i, // Mageia/VectorLinux /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire /(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i, // Hurd/Linux /(gnu) ?([\w\.]*)/i, // GNU /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly /(haiku) (\w+)/i // Haiku ], [be, Ne], [ /(sunos) ?([\w\.\d]*)/i // Solaris ], [[be, "Solaris"], Ne], [ /((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS /(unix) ?([\w\.]*)/i // UNIX ], [be, Ne] ] }, yd = function() { var t = { init: {}, isIgnore: {}, isIgnoreRgx: {}, toString: {} }; return is.call(t.init, [ [Wn, [be, Ne, Ll, pe]], [es, [Qn]], [wi, [pe, ke, we]], [Yr, [be, Ne]], [Or, [be, Ne]] ]), is.call(t.isIgnore, [ [Wn, [Ne, Ll]], [Yr, [Ne]], [Or, [Ne]] ]), is.call(t.isIgnoreRgx, [ [Wn, / ?browser$/i], [Or, / ?os$/i] ]), is.call(t.toString, [ [Wn, [be, Ne]], [es, [Qn]], [wi, [we, ke]], [Yr, [be, Ne]], [Or, [be, Ne]] ]), t; }(), wN = function(t, e) { var n = yd.init[e], i = yd.isIgnore[e] || 0, o = yd.isIgnoreRgx[e] || 0, a = yd.toString[e] || 0; function l() { is.call(this, n); } return l.prototype.getItem = function() { return t; }, l.prototype.withClientHints = function() { return Ks ? Ks.getHighEntropyValues(cw).then(function(f) { return t.setCH(new dw(f, !1)).parseCH().get(); }) : t.parseCH().get(); }, l.prototype.withFeatureCheck = function() { return t.detectFeature().get(); }, e != iu && (l.prototype.is = function(f) { var p = !1; for (var v in this) if (this.hasOwnProperty(v) && !vm(i, v) && rs(o ? lu(o, this[v]) : this[v]) == rs(o ? lu(o, f) : f)) { if (p = !0, f != Qs) break; } else if (f == Qs && p) { p = !p; break; } return p; }, l.prototype.toString = function() { var f = au; for (var p in a) typeof this[a[p]] !== Qs && (f += (f ? " " : au) + this[a[p]]); return f || Qs; }), Ks || (l.prototype.then = function(f) { var p = this, v = function() { for (var b in p) p.hasOwnProperty(b) && (this[b] = p[b]); }; v.prototype = { is: l.prototype.is, toString: l.prototype.toString }; var k = new v(); return f(k), k; }), new l(); }; function dw(t, e) { if (t = t || {}, is.call(this, cw), e) is.call(this, [ [lg, Cp(t[io])], [cg, Cp(t[dN])], [gt, /\?1/.test(t[mN])], [ke, hl(t[gN])], [su, hl(t[lw])], [dg, hl(t[yN])], [Qn, hl(t[fN])], [zo, Cp(t[pN])], [df, hl(t[hN])] ]); else for (var n in t) this.hasOwnProperty(n) && typeof t[n] !== Qs && (this[n] = t[n]); } function rk(t, e, n, i) { return this.get = function(o) { return o ? this.data.hasOwnProperty(o) ? this.data[o] : void 0 : this.data; }, this.set = function(o, a) { return this.data[o] = a, this; }, this.setCH = function(o) { return this.uaCH = o, this; }, this.detectFeature = function() { if (Yn && Yn.userAgent == this.ua) switch (this.itemType) { case Wn: Yn.brave && typeof Yn.brave.isBrave == Bd && this.set(be, "Brave"); break; case wi: !this.get(pe) && Ks && Ks[gt] && this.set(pe, gt), this.get(ke) == "Macintosh" && Yn && typeof Yn.standalone !== Qs && Yn.maxTouchPoints && Yn.maxTouchPoints > 2 && this.set(ke, "iPad").set(pe, Ft); break; case Or: !this.get(be) && Ks && Ks[su] && this.set(be, Ks[su]); break; case iu: var o = this.data, a = function(l) { return o[l].getItem().detectFeature().get(); }; this.set(Wn, a(Wn)).set(es, a(es)).set(wi, a(wi)).set(Yr, a(Yr)).set(Or, a(Or)); } return this; }, this.parseUA = function() { return this.itemType != iu && Tp.call(this.data, this.ua, this.rgxMap), this.itemType == Wn && this.set(Ll, Op(this.get(Ne))), this; }, this.parseCH = function() { var o = this.uaCH, a = this.rgxMap; switch (this.itemType) { case Wn: case Yr: var l = o[cg] || o[lg], f; if (l) for (var p in l) { var v = l[p].brand || l[p], k = l[p].version; this.itemType == Wn && !/not.a.brand/i.test(v) && (!f || /chrom/i.test(f) && v != Jv) && (v = Gs(v, { Chrome: "Google Chrome", Edge: "Microsoft Edge", "Chrome WebView": "Android WebView", "Chrome Headless": "HeadlessChrome", "Huawei Browser": "HuaweiBrowser", "MIUI Browser": "Miui Browser", "Opera Mobi": "OperaMobile", Yandex: "YaBrowser" }), this.set(be, v).set(Ne, k).set(Ll, Op(k)), f = v), this.itemType == Yr && v == Jv && this.set(Ne, k); } break; case es: var b = o[Qn]; b && (b && o[df] == "64" && (b += "64"), Tp.call(this.data, b + ";", a)); break; case wi: if (o[gt] && this.set(pe, gt), o[ke] && (this.set(ke, o[ke]), !this.get(pe) || !this.get(we))) { var w = {}; Tp.call(w, "droid 9; " + o[ke] + ")", a), !this.get(pe) && w.type && this.set(pe, w.type), !this.get(we) && w.vendor && this.set(we, w.vendor); } if (o[zo]) { var T; if (typeof o[zo] != "string") for (var O = 0; !T && O < o[zo].length; ) T = Gs(o[zo][O++], tk); else T = Gs(o[zo], tk); this.set(pe, T); } break; case Or: var x = o[su]; if (x) { var C = o[dg]; x == ym && (C = parseInt(Op(C), 10) >= 13 ? "11" : "10"), this.set(be, x).set(Ne, C); } this.get(be) == ym && o[ke] == "Xbox" && this.set(be, "Xbox").set(Ne, void 0); break; case iu: var $ = this.data, J = function(le) { return $[le].getItem().setCH(o).parseCH().get(); }; this.set(Wn, J(Wn)).set(es, J(es)).set(wi, J(wi)).set(Yr, J(Yr)).set(Or, J(Or)); } return this; }, is.call(this, [ ["itemType", t], ["ua", e], ["uaCH", i], ["rgxMap", n], ["data", wN(this, t)] ]), this; } function as(t, e, n) { if (typeof t === uu ? (Vd(t, !0) ? (typeof e === uu && (n = e), e = t) : (n = t, e = void 0), t = void 0) : typeof t === gm && !Vd(e, !0) && (n = e, e = void 0), n && typeof n.append === Bd) { var i = {}; n.forEach(function(p, v) { i[v] = p; }), n = i; } if (!(this instanceof as)) return new as(t, e, n).getResult(); var o = typeof t === gm ? t : ( // Passed user-agent string n && n[Vv] ? n[Vv] : ( // User-Agent from passed headers Yn && Yn.userAgent ? Yn.userAgent : ( // navigator.userAgent au ) ) ), a = new dw(n, !0), l = e ? _N(nk, e) : nk, f = function(p) { return p == iu ? function() { return new rk(p, o, l, a).set("ua", o).set(Wn, this.getBrowser()).set(es, this.getCPU()).set(wi, this.getDevice()).set(Yr, this.getEngine()).set(Or, this.getOS()).get(); } : function() { return new rk(p, o, l[p], a).parseUA().get(); }; }; return is.call(this, [ ["getBrowser", f(Wn)], ["getCPU", f(es)], ["getDevice", f(wi)], ["getEngine", f(Yr)], ["getOS", f(Or)], ["getResult", f(iu)], ["getUA", function() { return o; }], ["setUA", function(p) { return pu(p) && (o = p.length > mm ? Dl(p, mm) : p), this; }] ]).setUA(o), this; } as.VERSION = cN; as.BROWSER = ff([be, Ne, Ll, pe]); as.CPU = ff([Qn]); as.DEVICE = ff([ke, we, pe, wl, gt, ln, Ft, _i, Sl]); as.ENGINE = as.OS = ff([be, Ne]); function qt(t) { return t != null && typeof t == "object" && t["@@functional/placeholder"] === !0; } function pr(t) { return function e(n) { return arguments.length === 0 || qt(n) ? e : t.apply(this, arguments); }; } function lr(t) { return function e(n, i) { switch (arguments.length) { case 0: return e; case 1: return qt(n) ? e : pr(function(o) { return t(n, o); }); default: return qt(n) && qt(i) ? e : qt(n) ? pr(function(o) { return t(o, i); }) : qt(i) ? pr(function(o) { return t(n, o); }) : t(n, i); } }; } function hf(t, e) { switch (t) { case 0: return function() { return e.apply(this, arguments); }; case 1: return function(n) { return e.apply(this, arguments); }; case 2: return function(n, i) { return e.apply(this, arguments); }; case 3: return function(n, i, o) { return e.apply(this, arguments); }; case 4: return function(n, i, o, a) { return e.apply(this, arguments); }; case 5: return function(n, i, o, a, l) { return e.apply(this, arguments); }; case 6: return function(n, i, o, a, l, f) { return e.apply(this, arguments); }; case 7: return function(n, i, o, a, l, f, p) { return e.apply(this, arguments); }; case 8: return function(n, i, o, a, l, f, p, v) { return e.apply(this, arguments); }; case 9: return function(n, i, o, a, l, f, p, v, k) { return e.apply(this, arguments); }; case 10: return function(n, i, o, a, l, f, p, v, k, b) { return e.apply(this, arguments); }; default: throw new Error("First argument to _arity must be a non-negative integer no greater than ten"); } } function fw(t, e, n) { return function() { for (var i = [], o = 0, a = t, l = 0, f = !1; l < e.length || o < arguments.length; ) { var p; l < e.length && (!qt(e[l]) || o >= arguments.length) ? p = e[l] : (p = arguments[o], o += 1), i[l] = p, qt(p) ? f = !0 : a -= 1, l += 1; } return !f && a <= 0 ? n.apply(this, i) : hf(Math.max(0, a), fw(t, i, n)); }; } var hw = /* @__PURE__ */ lr(function(e, n) { return e === 1 ? pr(n) : hf(e, fw(e, [], n)); }); function fg(t) { return function e(n, i, o) { switch (arguments.length) { case 0: return e; case 1: return qt(n) ? e : lr(function(a, l) { return t(n, a, l); }); case 2: return qt(n) && qt(i) ? e : qt(n) ? lr(function(a, l) { return t(a, i, l); }) : qt(i) ? lr(function(a, l) { return t(n, a, l); }) : pr(function(a) { return t(n, i, a); }); default: return qt(n) && qt(i) && qt(o) ? e : qt(n) && qt(i) ? lr(function(a, l) { return t(a, l, o); }) : qt(n) && qt(o) ? lr(function(a, l) { return t(a, i, l); }) : qt(i) && qt(o) ? lr(function(a, l) { return t(n, a, l); }) : qt(n) ? pr(function(a) { return t(a, i, o); }) : qt(i) ? pr(function(a) { return t(n, a, o); }) : qt(o) ? pr(function(a) { return t(n, i, a); }) : t(n, i, o); } }; } const pw = Array.isArray || function(e) { return e != null && e.length >= 0 && Object.prototype.toString.call(e) === "[object Array]"; }, mw = Number.isInteger || function(e) { return e << 0 === e; }; function gw(t) { return Object.prototype.toString.call(t) === "[object String]"; } function yw(t, e) { var n = t < 0 ? e.length + t : t; return gw(e) ? e.charAt(n) : e[n]; } var SN = /* @__PURE__ */ lr(function(e, n) { if (n != null) return mw(e) ? yw(e, n) : n[e]; }), bN = /* @__PURE__ */ pr(function(e) { return pw(e) ? !0 : !e || typeof e != "object" || gw(e) ? !1 : e.length === 0 ? !0 : e.length > 0 ? e.hasOwnProperty(0) && e.hasOwnProperty(e.length - 1) : !1; }), ik = typeof Symbol < "u" ? Symbol.iterator : "@@iterator"; function EN(t, e, n) { return function(o, a, l) { if (bN(l)) return t(o, a, l); if (l == null) return a; if (typeof l["fantasy-land/reduce"] == "function") return e(o, a, l, "fantasy-land/reduce"); if (l[ik] != null) return n(o, a, l[ik]()); if (typeof l.next == "function") return n(o, a, l); if (typeof l.reduce == "function") return e(o, a, l, "reduce"); throw new TypeError("reduce: list must be array or iterable"); }; } function NN(t, e, n) { for (var i = 0, o = n.length; i < o; ) { if (e = t["@@transducer/step"](e, n[i]), e && e["@@transducer/reduced"]) { e = e["@@transducer/value"]; break; } i += 1; } return t["@@transducer/result"](e); } var AN = /* @__PURE__ */ lr(function(e, n) { return hf(e.length, function() { return e.apply(n, arguments); }); }); function xN(t, e, n) { for (var i = n.next(); !i.done; ) { if (e = t["@@transducer/step"](e, i.value), e && e["@@transducer/reduced"]) { e = e["@@transducer/value"]; break; } i = n.next(); } return t["@@transducer/result"](e); } function CN(t, e, n, i) { return t["@@transducer/result"](n[i](AN(t["@@transducer/step"], t), e)); } var ON = /* @__PURE__ */ EN(NN, CN, xN), TN = /* @__PURE__ */ function() { function t(e) { this.f = e; } return t.prototype["@@transducer/init"] = function() { throw new Error("init not implemented on XWrap"); }, t.prototype["@@transducer/result"] = function(e) { return e; }, t.prototype["@@transducer/step"] = function(e, n) { return this.f(e, n); }, t; }(); function RN(t) { return new TN(t); } var IN = /* @__PURE__ */ fg(function(t, e, n) { return ON(typeof t == "function" ? RN(t) : t, e, n); }), PN = /* @__PURE__ */ pr(function(e) { return function() { return e; }; }), LN = /* @__PURE__ */ pr(function(e) { return hw(e.length, e); }), DN = /* @__PURE__ */ pr(function(e) { return e == null; }), FN = /* @__PURE__ */ lr(function(e, n) { switch (e) { case 0: return function() { return n.call(this); }; case 1: return function(i) { return n.call(this, i); }; case 2: return function(i, o) { return n.call(this, i, o); }; case 3: return function(i, o, a) { return n.call(this, i, o, a); }; case 4: return function(i, o, a, l) { return n.call(this, i, o, a, l); }; case 5: return function(i, o, a, l, f) { return n.call(this, i, o, a, l, f); }; case 6: return function(i, o, a, l, f, p) { return n.call(this, i, o, a, l, f, p); }; case 7: return function(i, o, a, l, f, p, v) { return n.call(this, i, o, a, l, f, p, v); }; case 8: return function(i, o, a, l, f, p, v, k) { return n.call(this, i, o, a, l, f, p, v, k); }; case 9: return function(i, o, a, l, f, p, v, k, b) { return n.call(this, i, o, a, l, f, p, v, k, b); }; case 10: return function(i, o, a, l, f, p, v, k, b, w) { return n.call(this, i, o, a, l, f, p, v, k, b, w); }; default: throw new Error("First argument to nAry must be a non-negative integer no greater than ten"); } }); function MN(t, e) { return function() { return e.call(this, t.apply(this, arguments)); }; } function vw(t, e) { return function() { var n = arguments.length; if (n === 0) return e(); var i = arguments[n - 1]; return pw(i) || typeof i[t] != "function" ? e.apply(this, arguments) : i[t].apply(i, Array.prototype.slice.call(arguments, 0, n - 1)); }; } var $N = /* @__PURE__ */ fg(/* @__PURE__ */ vw("slice", function(e, n, i) { return Array.prototype.slice.call(i, e, n); })), jN = /* @__PURE__ */ pr(/* @__PURE__ */ vw("tail", /* @__PURE__ */ $N(1, 1 / 0))); function sk() { if (arguments.length === 0) throw new Error("pipe requires at least one argument"); return hf(arguments[0].length, IN(MN, arguments[0], jN(arguments))); } var UN = /* @__PURE__ */ lr(function(e, n) { if (e > 10) throw new Error("Constructor with greater than ten arguments"); return e === 0 ? function() { return new n(); } : LN(FN(e, function(i, o, a, l, f, p, v, k, b, w) { switch (e) { case 1: return new n(i); case 2: return new n(i, o); case 3: return new n(i, o, a); case 4: return new n(i, o, a, l); case 5: return new n(i, o, a, l, f); case 6: return new n(i, o, a, l, f, p); case 7: return new n(i, o, a, l, f, p, v); case 8: return new n(i, o, a, l, f, p, v, k); case 9: return new n(i, o, a, l, f, p, v, k, b); case 10: return new n(i, o, a, l, f, p, v, k, b, w); } })); }), BN = /* @__PURE__ */ fg(function(e, n, i) { return hw(Math.max(e.length, n.length, i.length), function() { return e.apply(this, arguments) ? n.apply(this, arguments) : i.apply(this, arguments); }); }); function VN(t, e) { for (var n = e, i = 0; i < t.length; i += 1) { if (n == null) return; var o = t[i]; mw(o) ? n = yw(o, n) : n = n[o]; } return n; } var ok = /* @__PURE__ */ lr(function(e, n) { for (var i = {}, o = {}, a = 0, l = e.length; a < l; ) o[e[a]] = 1, a += 1; for (var f in n) o.hasOwnProperty(f) || (i[f] = n[f]); return i; }), zN = /* @__PURE__ */ lr(VN); class fs extends Error { /** * Creates a new instance of DomainError. * @param name - The name of the error. * @param message - A detailed message describing the error. * @param value - Optional value that provides additional context about the error. */ constructor(e, n, i) { super(n), this.value = i, this.name = e, Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); } /** * Converts the DomainError to a plain object for transfer or logging. * @returns An object representing the error in a more readable format. */ toDTO() { return { name: this.name, message: this.message, ...this.value && { value: this.value }, // Include a human-readable stack trace if available. ...this.stack && { stack: this.formatStack() } }; } /** * Formats the error stack trace into a human-readable string. * @returns A formatted stack trace string. */ formatStack() { return this.stack ? this.stack.split(` `).map((e) => e.trim()).join(" | ") : ""; } } class hg extends fs { constructor(e) { super( "RESOURCE_NOT_FOUND_ERROR", `Resource with id '${e}' not found.`, e ); } } class Xn extends fs { constructor(e) { super( "APP_UNEXPECTED_ERROR", e.message ?? "An unexpected error occurred.", e ); } } class pf extends fs { constructor() { super("APP_ACCOUNT_INVALID_ERROR", "Account not defined"); } } class kw extends fs { constructor(e) { super( "INVALID_NIZZA_GLOBAL_OBJECT_ERROR", ` Configuration property invalid: "${e}". It looks like you are trying to use a configuration property that is required but is "undefined", make sure you have initialized the global object "nizza". * If you are using the @nizza/core library: import { getNizza } from '@nizza/core'; const nizza = getNizza(); nizza.configure({ account: env.account, ... }); * If you are using the window: window.nizza.configure({ account: env.account, ... }); ` ); } } function HN(t, e) { e.forEach((n) => { if (DN(zN(n.split("."), t))) throw new kw(n); }); } function Ct(t) { for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) n[i - 1] = arguments[i]; throw new Error(typeof t == "number" ? "[MobX] minified error nr: " + t + (n.length ? " " + n.map(String).join(",") : "") + ". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts" : "[MobX] " + t); } var qN = {}; function _w() { return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : qN; } var ww = Object.assign, zd = Object.getOwnPropertyDescriptor, Ni = Object.defineProperty, mf = Object.prototype, km = []; Object.freeze(km); var pg = {}; Object.freeze(pg); var KN = typeof Proxy < "u", GN = /* @__PURE__ */ Object.toString(); function Sw() { KN || Ct("Proxy not available"); } function bw(t) { var e = !1; return function() { if (!e) return e = !0, t.apply(this, arguments); }; } var eu = function() { }; function Zr(t) { return typeof t == "function"; } function Jo(t) { var e = typeof t; switch (e) { case "string": case "symbol": case "number": return !0; } return !1; } function gf(t) { return t !== null && typeof t == "object"; } function eo(t) { if (!gf(t)) return !1; var e = Object.getPrototypeOf(t); if (e == null) return !0; var n = Object.hasOwnProperty.call(e, "constructor") && e.constructor; return typeof n == "function" && n.toString() === GN; } function Ew(t) { var e = t == null ? void 0 : t.constructor; return e ? e.name === "GeneratorFunction" || e.displayName === "GeneratorFunction" : !1; } function yf(t, e, n) { Ni(t, e, { enumerable: !1, writable: !0, configurable: !0, value: n }); } function Nw(t, e, n) { Ni(t, e, { enumerable: !1, writable: !1, configurable: !0, value: n }); } function ia(t, e) { var n = "isMobX" + t; return e.prototype[n] = !0, function(i) { return gf(i) && i[n] === !0; }; } function mu(t) { return t != null && Object.prototype.toString.call(t) === "[object Map]"; } function WN(t) { var e = Object.getPrototypeOf(t), n = Object.getPrototypeOf(e), i = Object.getPrototypeOf(n); return i === null; } function ts(t) { return t != null && Object.prototype.toString.call(t) === "[object Set]"; } var Aw = typeof Object.getOwnPropertySymbols < "u"; function QN(t) { var e = Object.keys(t); if (!Aw) return e; var n = Object.getOwnPropertySymbols(t); return n.length ? [].concat(e, n.filter(function(i) { return mf.propertyIsEnumerable.call(t, i); })) : e; } var vf = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : Aw ? function(t) { return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)); } : ( /* istanbul ignore next */ Object.getOwnPropertyNames ); function xw(t) { return t === null ? null : typeof t == "object" ? "" + t : t; } function ss(t, e) { return mf.hasOwnProperty.call(t, e); } var YN = Object.getOwnPropertyDescriptors || function(e) { var n = {}; return vf(e).forEach(function(i) { n[i] = zd(e, i); }), n; }; function fr(t, e) { return !!(t & e); } function hr(t, e, n) { return n ? t |= e : t &= ~e, t; } function ak(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, i = Array(e); n < e; n++) i[n] = t[n]; return i; } function XN(t, e) { for (var n = 0; n < e.length; n++) { var i = e[n]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, ZN(i.key), i); } } function gu(t, e, n) { return e && XN(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t; } function tu(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (n) return (n = n.call(t)).next.bind(n); if (Array.isArray(t) || (n = e1(t)) || e) { n && (t = n); var i = 0; return function() { return i >= t.length ? { done: !0 } : { done: !1, value: t[i++] }; }; } throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function to() { return to = Object.assign ? Object.assign.bind() : function(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e]; for (var i in n) ({}).hasOwnProperty.call(n, i) && (t[i] = n[i]); } return t; }, to.apply(null, arguments); } function Cw(t, e) { t.prototype = Object.create(e.prototype), t.prototype.constructor = t, _m(t, e); } function _m(t, e) { return _m = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, i) { return n.__proto__ = i, n; }, _m(t, e); } function JN(t, e) { if (typeof t != "object" || !t) return t; var n = t[Symbol.toPrimitive]; if (n !== void 0) { var i = n.call(t, e); if (typeof i != "object") return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(t); } function ZN(t) { var e = JN(t, "string"); return typeof e == "symbol" ? e : e + ""; } function e1(t, e) { if (t) { if (typeof t == "string") return ak(t, e); var n = {}.toString.call(t).slice(8, -1); return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ak(t, e) : void 0; } } var Si = /* @__PURE__ */ Symbol("mobx-stored-annotations"); function Ai(t) { function e(n, i) { if (Ql(i)) return t.decorate_20223_(n, i); yu(n, i, t); } return Object.assign(e, t); } function yu(t, e, n) { ss(t, Si) || yf(t, Si, to({}, t[Si])), a1(n) || (t[Si][e] = n); } function t1(t) { return ss(t, Si) || yf(t, Si, to({}, t[Si])), t[Si]; } function Ql(t) { return typeof t == "object" && typeof t.kind == "string"; } var dt = /* @__PURE__ */ Symbol("mobx administration"), so = /* @__PURE__ */ function() { function t(n) { n === void 0 && (n = "Atom"), this.name_ = void 0, this.flags_ = 0, this.observers_ = /* @__PURE__ */ new Set(), this.lastAccessedBy_ = 0, this.lowestObserverState_ = xt.NOT_TRACKING_, this.onBOL = void 0, this.onBUOL = void 0, this.name_ = n; } var e = t.prototype; return e.onBO = function() { this.onBOL && this.onBOL.forEach(function(i) { return i(); }); }, e.onBUO = function() { this.onBUOL && this.onBUOL.forEach(function(i) { return i(); }); }, e.reportObserved = function() { return Hw(this); }, e.reportChanged = function() { Ir(), qw(this), Pr(); }, e.toString = function() { return this.name_; }, gu(t, [{ key: "isBeingObserved", get: function() { return fr(this.flags_, t.isBeingObservedMask_); }, set: function(i) { this.flags_ = hr(this.flags_, t.isBeingObservedMask_, i); } }, { key: "isPendingUnobservation", get: function() { return fr(this.flags_, t.isPendingUnobservationMask_); }, set: function(i) { this.flags_ = hr(this.flags_, t.isPendingUnobservationMask_, i); } }, { key: "diffValue", get: function() { return fr(this.flags_, t.diffValueMask_) ? 1 : 0; }, set: function(i) { this.flags_ = hr(this.flags_, t.diffValueMask_, i === 1); } }]); }(); so.isBeingObservedMask_ = 1; so.isPendingUnobservationMask_ = 2; so.diffValueMask_ = 4; var mg = /* @__PURE__ */ ia("Atom", so); function Ow(t, e, n) { e === void 0 && (e = eu), n === void 0 && (n = eu); var i = new so(t); return e !== eu && lA(i, e), n !== eu && Jw(i, n), i; } function n1(t, e) { return dS(t, e); } function r1(t, e) { return Object.is ? Object.is(t, e) : t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e; } var cu = { structural: n1, default: r1 }; function Zo(t, e, n) { return tS(t) ? t : Array.isArray(t) ? on.array(t, { name: n }) : eo(t) ? on.object(t, void 0, { name: n }) : mu(t) ? on.map(t, { name: n }) : ts(t) ? on.set(t, { name: n }) : typeof t == "function" && !Ef(t) && !Ml(t) ? Ew(t) ? du(t) : Fl(n, t) : t; } function i1(t, e, n) { if (t == null || xf(t) || Af(t) || oa(t) || vu(t)) return t; if (Array.isArray(t)) return on.array(t, { name: n, deep: !1 }); if (eo(t)) return on.object(t, void 0, { name: n, deep: !1 }); if (mu(t)) return on.map(t, { name: n, deep: !1 }); if (ts(t)) return on.set(t, { name: n, deep: !1 }); } function kf(t) { return t; } function s1(t, e) { return dS(t, e) ? e : t; } var o1 = "override"; function a1(t) { return t.annotationType_ === o1; } function Yl(t, e) { return { annotationType_: t, options_: e, make_: u1, extend_: l1, decorate_20223_: c1 }; } function u1(t, e, n, i) { var o; if ((o = this.options_) != null && o.bound) return this.extend_(t, e, n, !1) === null ? 0 : 1; if (i === t.target_) return this.extend_(t, e, n, !1) === null ? 0 : 2; if (Ef(n.value)) return 1; var a = Tw(t, this, e, n, !1); return Ni(i, e, a), 2; } function l1(t, e, n, i) { var o = Tw(t, this, e, n); return t.defineProperty_(e, o, i); } function c1(t, e) { var n = e.kind, i = e.name, o = e.addInitializer, a = this, l = function(v) { var k, b, w, T; return no((k = (b = a.options_) == null ? void 0 : b.name) != null ? k : i.toString(), v, (w = (T = a.options_) == null ? void 0 : T.autoAction) != null ? w : !1); }; if (n == "field") { o(function() { yu(this, i, a); }); return; } if (n == "method") { var f; return Ef(t) || (t = l(t)), (f = this.options_) != null && f.bound && o(function() { var p = this, v = p[i].bind(p); v.isMobxAction = !0, p[i] = v; }), t; } Ct("Cannot apply '" + a.annotationType_ + "' to '" + String(i) + "' (kind: " + n + "):" + (` '` + a.annotationType_ + "' can only be used on properties with a function value.")); } function d1(t, e, n, i) { e.annotationType_, i.value; } function Tw(t, e, n, i, o) { var a, l, f, p, v, k, b; o === void 0 && (o = qe.safeDescriptors), d1(t, e, n, i); var w = i.value; if ((a = e.options_) != null && a.bound) { var T; w = w.bind((T = t.proxy_) != null ? T : t.target_); } return { value: no( (l = (f = e.options_) == null ? void 0 : f.name) != null ? l : n.toString(), w, (p = (v = e.options_) == null ? void 0 : v.autoAction) != null ? p : !1, // https://github.com/mobxjs/mobx/discussions/3140 (k = e.options_) != null && k.bound ? (b = t.proxy_) != null ? b : t.target_ : void 0 ), // Non-configurable for classes // prevents accidental field redefinition in subclass configurable: o ? t.isPlainObject_ : !0, // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058 enumerable: !1, // Non-obsevable, therefore non-writable // Also prevents rewriting in subclass constructor writable: !o }; } function Rw(t, e) { return { annotationType_: t, options_: e, make_: f1, extend_: h1, decorate_20223_: p1 }; } function f1(t, e, n, i) { var o; if (i === t.target_) return this.extend_(t, e, n, !1) === null ? 0 : 2; if ((o = this.options_) != null && o.bound && (!ss(t.target_, e) || !Ml(t.target_[e])) && this.extend_(t, e, n, !1) === null) return 0; if (Ml(n.value)) return 1; var a = Iw(t, this, e, n, !1, !1); return Ni(i, e, a), 2; } function h1(t, e, n, i) { var o, a = Iw(t, this, e, n, (o = this.options_) == null ? void 0 : o.bound); return t.defineProperty_(e, a, i); } function p1(t, e) { var n, i = e.name, o = e.addInitializer; return Ml(t) || (t = du(t)), (n = this.options_) != null && n.bound && o(function() { var a = this, l = a[i].bind(a); l.isMobXFlow = !0, a[i] = l; }), t; } function m1(t, e, n, i) { e.annotationType_, i.value; } function Iw(t, e, n, i, o, a) { a === void 0 && (a = qe.safeDescriptors), m1(t, e, n, i); var l = i.value; if (Ml(l) || (l = du(l)), o) { var f; l = l.bind((f = t.proxy_) != null ? f : t.target_), l.isMobXFlow = !0; } return { value: l, // Non-configurable for classes // prevents accidental field redefinition in subclass configurable: a ? t.isPlainObject_ : !0, // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058 enumerable: !1, // Non-obsevable, therefore non-writable // Also prevents rewriting in subclass constructor writable: !a }; } function gg(t, e) { return { annotationType_: t, options_: e, make_: g1, extend_: y1, decorate_20223_: v1 }; } function g1(t, e, n) { return this.extend_(t, e, n, !1) === null ? 0 : 1; } function y1(t, e, n, i) { return k1(t, this, e, n), t.defineComputedProperty_(e, to({}, this.options_, { get: n.get, set: n.set }), i); } function v1(t, e) { var n = this, i = e.name, o = e.addInitializer; return o(function() { var a = ku(this)[dt], l = to({}, n.options_, { get: t, context: this }); l.name || (l.name = "ObservableObject." + i.toString()), a.values_.set(i, new ei(l)); }), function() { return this[dt].getObservablePropValue_(i); }; } function k1(t, e, n, i) { e.annotationType_, i.get; } function _f(t, e) { return { annotationType_: t, options_: e, make_: _1, extend_: w1, decorate_20223_: S1 }; } function _1(t, e, n) { return this.extend_(t, e, n, !1) === null ? 0 : 1; } function w1(t, e, n, i) { var o, a; return b1(t, this), t.defineObservableProperty_(e, n.value, (o = (a = this.options_) == null ? void 0 : a.enhancer) != null ? o : Zo, i); } function S1(t, e) { var n = this, i = e.kind, o = e.name, a = /* @__PURE__ */ new WeakSet(); function l(f, p) { var v, k, b = ku(f)[dt], w = new Qo(p, (v = (k = n.options_) == null ? void 0 : k.enhancer) != null ? v : Zo, "ObservableObject." + o.toString(), !1); b.values_.set(o, w), a.add(f); } if (i == "accessor") return { get: function() { return a.has(this) || l(this, t.get.call(this)), this[dt].getObservablePropValue_(o); }, set: function(p) { return a.has(this) || l(this, p), this[dt].setObservablePropValue_(o, p); }, init: function(p) { return a.has(this) || l(this, p), p; } }; } function b1(t, e, n, i) { e.annotationType_; } var E1 = "true", N1 = /* @__PURE__ */ Pw(); function Pw(t) { return { annotationType_: E1, options_: t, make_: A1, extend_: x1, decorate_20223_: C1 }; } function A1(t, e, n, i) { var o, a; if (n.get) return Ys.make_(t, e, n, i); if (n.set) { var l = no(e.toString(), n.set); return i === t.target_ ? t.defineProperty_(e, { configurable: qe.safeDescriptors ? t.isPlainObject_ : !0, set: l }) === null ? 0 : 2 : (Ni(i, e, { configurable: !0, set: l }), 2); } if (i !== t.target_ && typeof n.value == "function") { var f; if (Ew(n.value)) { var p, v = (p = this.options_) != null && p.autoBind ? du.bound : du; return v.make_(t, e, n, i); } var k = (f = this.options_) != null && f.autoBind ? Fl.bound : Fl; return k.make_(t, e, n, i); } var b = ((o = this.options_) == null ? void 0 : o.deep) === !1 ? on.ref : on; if (typeof n.value == "function" && (a = this.options_) != null && a.autoBind) { var w; n.value = n.value.bind((w = t.proxy_) != null ? w : t.target_); } return b.make_(t, e, n, i); } function x1(t, e, n, i) { var o, a; if (n.get) return Ys.extend_(t, e, n, i); if (n.set) return t.defineProperty_(e, { configurable: qe.safeDescriptors ? t.isPlainObject_ : !0, set: no(e.toString(), n.set) }, i); if (typeof n.value == "function" && (o = this.options_) != null && o.autoBind) { var l; n.value = n.value.bind((l = t.proxy_) != null ? l : t.target_); } var f = ((a = this.options_) == null ? void 0 : a.deep) === !1 ? on.ref : on; return f.extend_(t, e, n, i); } function C1(t, e) { Ct("'" + this.annotationType_ + "' cannot be used as a decorator"); } var O1 = "observable", T1 = "observable.ref", R1 = "observable.shallow", I1 = "observable.struct", Lw = { deep: !0, name: void 0, defaultDecorator: void 0, proxy: !0 }; Object.freeze(Lw); function vd(t) { return t || Lw; } var wm = /* @__PURE__ */ _f(O1), P1 = /* @__PURE__ */ _f(T1, { enhancer: kf }), L1 = /* @__PURE__ */ _f(R1, { enhancer: i1 }), D1 = /* @__PURE__ */ _f(I1, { enhancer: s1 }), Dw = /* @__PURE__ */ Ai(wm); function kd(t) { return t.deep === !0 ? Zo : t.deep === !1 ? kf : M1(t.defaultDecorator); } function F1(t) { var e; return t ? (e = t.defaultDecorator) != null ? e : Pw(t) : void 0; } function M1(t) { var e, n; return t && (e = (n = t.options_) == null ? void 0 : n.enhancer) != null ? e : Zo; } function Fw(t, e, n) { if (Ql(e)) return wm.decorate_20223_(t, e); if (Jo(e)) { yu(t, e, wm); return; } return tS(t) ? t : eo(t) ? on.object(t, e, n) : Array.isArray(t) ? on.array(t, e) : mu(t) ? on.map(t, e) : ts(t) ? on.set(t, e) : typeof t == "object" && t !== null ? t : on.box(t, e); } ww(Fw, Dw); var $1 = { box: function(e, n) { var i = vd(n); return new Qo(e, kd(i), i.name, !0, i.equals); }, array: function(e, n) { var i = vd(n); return (qe.useProxies === !1 || i.proxy === !1 ? TA : _A)(e, kd(i), i.name); }, map: function(e, n) { var i = vd(n); return new sS(e, kd(i), i.name); }, set: function(e, n) { var i = vd(n); return new oS(e, kd(i), i.name); }, object: function(e, n, i) { return aa(function() { return cA(qe.useProxies === !1 || (i == null ? void 0 : i.proxy) === !1 ? ku({}, i) : gA({}, i), e, n); }); }, ref: /* @__PURE__ */ Ai(P1), shallow: /* @__PURE__ */ Ai(L1), deep: Dw, struct: /* @__PURE__ */ Ai(D1) }, on = /* @__PURE__ */ ww(Fw, $1), Mw = "computed", j1 = "computed.struct", Sm = /* @__PURE__ */ gg(Mw), U1 = /* @__PURE__ */ gg(j1, { equals: cu.structural }), Ys = function(e, n) { if (Ql(n)) return Sm.decorate_20223_(e, n); if (Jo(n)) return yu(e, n, Sm); if (eo(e)) return Ai(gg(Mw, e)); var i = eo(n) ? n : {}; return i.get = e, i.name || (i.name = e.name || ""), new ei(i); }; Object.assign(Ys, Sm); Ys.struct = /* @__PURE__ */ Ai(U1); var uk, lk, Hd = 0, B1 = 1, V1 = (uk = (lk = /* @__PURE__ */ zd(function() { }, "name")) == null ? void 0 : lk.configurable) != null ? uk : !1, ck = { value: "action", configurable: !0, writable: !1, enumerable: !1 }; function no(t, e, n, i) { n === void 0 && (n = !1); function o() { return z1(t, n, e, i || this, arguments); } return o.isMobxAction = !0, o.toString = function() { return e.toString(); }, V1 && (ck.value = t, Ni(o, "name", ck)), o; } function z1(t, e, n, i, o) { var a = H1(t, e); try { return n.apply(i, o); } catch (l) { throw a.error_ = l, l; } finally { q1(a); } } function H1(t, e, n, i) { var o = !1, a = 0, l = qe.trackingDerivation, f = !e || !l; Ir(); var p = qe.allowStateChanges; f && (sa(), p = wf(!0)); var v = yg(!0), k = { runAsAction_: f, prevDerivation_: l, prevAllowStateChanges_: p, prevAllowStateReads_: v, notifySpy_: o, startTime_: a, actionId_: B1++, parentActionId_: Hd }; return Hd = k.actionId_, k; } function q1(t) { Hd !== t.actionId_ && Ct(30), Hd = t.parentActionId_, t.error_ !== void 0 && (qe.suppressReactionErrors = !0), Sf(t.prevAllowStateChanges_), Al(t.prevAllowStateReads_), Pr(), t.runAsAction_ && os(t.prevDerivation_), qe.suppressReactionErrors = !1; } function $w(t, e) { var n = wf(t); try { return e(); } finally { Sf(n); } } function wf(t) { var e = qe.allowStateChanges; return qe.allowStateChanges = t, e; } function Sf(t) { qe.allowStateChanges = t; } var Qo = /* @__PURE__ */ function(t) { function e(i, o, a, l, f) { var p; return a === void 0 && (a = "ObservableValue"), f === void 0 && (f = cu.default), p = t.call(this, a) || this, p.enhancer = void 0, p.name_ = void 0, p.equals = void 0, p.hasUnreportedChange_ = !1, p.interceptors_ = void 0, p.changeListeners_ = void 0, p.value_ = void 0, p.dehancer = void 0, p.enhancer = o, p.name_ = a, p.equals = f, p.value_ = o(i, void 0, a), p; } Cw(e, t); var n = e.prototype; return n.dehanceValue = function(o) { return this.dehancer !== void 0 ? this.dehancer(o) : o; }, n.set = function(o) { this.value_, o = this.prepareNewValue_(o), o !== qe.UNCHANGED && this.setNewValue_(o); }, n.prepareNewValue_ = function(o) { if (Tr(this)) { var a = Rr(this, { object: this, type: xi, newValue: o }); if (!a) return qe.UNCHANGED; o = a.newValue; } return o = this.enhancer(o, this.value_, this.name_), this.equals(this.value_, o) ? qe.UNCHANGED : o; }, n.setNewValue_ = function(o) { var a = this.value_; this.value_ = o, this.reportChanged(), Xr(this) && Jr(this, { type: xi, object: this, newValue: o, oldValue: a }); }, n.get = function() { return this.reportObserved(), this.dehanceValue(this.value_); }, n.intercept_ = function(o) { return Xl(this, o); }, n.observe_ = function(o, a) { return a && o({ observableKind: "value", debugObjectName: this.name_, object: this, type: xi, newValue: this.value_, oldValue: void 0 }), Jl(this, o); }, n.raw = function() { return this.value_; }, n.toJSON = function() { return this.get(); }, n.toString = function() { return this.name_ + "[" + this.value_ + "]"; }, n.valueOf = function() { return xw(this.get()); }, n[Symbol.toPrimitive] = function() { return this.valueOf(); }, e; }(so), ei = /* @__PURE__ */ function() { function t(n) { this.dependenciesState_ = xt.NOT_TRACKING_, this.observing_ = [], this.newObserving_ = null, this.observers_ = /* @__PURE__ */ new Set(), this.runId_ = 0, this.lastAccessedBy_ = 0, this.lowestObserverState_ = xt.UP_TO_DATE_, this.unboundDepsCount_ = 0, this.value_ = new Kd(null), this.name_ = void 0, this.triggeredBy_ = void 0, this.flags_ = 0, this.derivation = void 0, this.setter_ = void 0, this.isTracing_ = qd.NONE, this.scope_ = void 0, this.equals_ = void 0, this.requiresReaction_ = void 0, this.keepAlive_ = void 0, this.onBOL = void 0, this.onBUOL = void 0, n.get || Ct(31), this.derivation = n.get, this.name_ = n.name || "ComputedValue", n.set && (this.setter_ = no("ComputedValue-setter", n.set)), this.equals_ = n.equals || (n.compareStructural || n.struct ? cu.structural : cu.default), this.scope_ = n.context, this.requiresReaction_ = n.requiresReaction, this.keepAlive_ = !!n.keepAlive; } var e = t.prototype; return e.onBecomeStale_ = function() { Q1(this); }, e.onBO = function() { this.onBOL && this.onBOL.forEach(function(i) { return i(); }); }, e.onBUO = function() { this.onBUOL && this.onBUOL.forEach(function(i) { return i(); }); }, e.get = function() { if (this.isComputing && Ct(32, this.name_, this.derivation), qe.inBatch === 0 && // !globalState.trackingDerivatpion && this.observers_.size === 0 && !this.keepAlive_) bm(this) && (this.warnAboutUntrackedRead_(), Ir(), this.value_ = this.computeValue_(!1), Pr()); else if (Hw(this), bm(this)) { var i = qe.trackingContext; this.keepAlive_ && !i && (qe.trackingContext = this), this.trackAndCompute() && W1(this), qe.trackingContext = i; } var o = this.value_; if (Td(o)) throw o.cause; return o; }, e.set = function(i) { if (this.setter_) { this.isRunningSetter && Ct(33, this.name_), this.isRunningSetter = !0; try { this.setter_.call(this.scope_, i); } finally { this.isRunningSetter = !1; } } else Ct(34, this.name_); }, e.trackAndCompute = function() { var i = this.value_, o = ( /* see #1208 */ this.dependenciesState_ === xt.NOT_TRACKING_ ), a = this.computeValue_(!0), l = o || Td(i) || Td(a) || !this.equals_(i, a); return l && (this.value_ = a), l; }, e.computeValue_ = function(i) { this.isComputing = !0; var o = wf(!1), a; if (i) a = jw(this, this.derivation, this.scope_); else if (qe.disableErrorBoundaries === !0) a = this.derivation.call(this.scope_); else try { a = this.derivation.call(this.scope_); } catch (l) { a = new Kd(l); } return Sf(o), this.isComputing = !1, a; }, e.suspend_ = function() { this.keepAlive_ || (Em(this), this.value_ = void 0); }, e.observe_ = function(i, o) { var a = this, l = !0, f = void 0; return Nf(function() { var p = a.get(); if (!l || o) { var v = sa(); i({ observableKind: "computed", debugObjectName: a.name_, type: xi, object: a, newValue: p, oldValue: f }), os(v); } l = !1, f = p; }); }, e.warnAboutUntrackedRead_ = function() { }, e.toString = function() { return this.name_ + "[" + this.derivation.toString() + "]"; }, e.valueOf = function() { return xw(this.get()); }, e[Symbol.toPrimitive] = function() { return this.valueOf(); }, gu(t, [{ key: "isComputing", get: function() { return fr(this.flags_, t.isComputingMask_); }, set: function(i) { this.flags_ = hr(this.flags_, t.isComputingMask_, i); } }, { key: "isRunningSetter", get: function() { return fr(this.flags_, t.isRunningSetterMask_); }, set: function(i) { this.flags_ = hr(this.flags_, t.isRunningSetterMask_, i); } }, { key: "isBeingObserved", get: function() { return fr(this.flags_, t.isBeingObservedMask_); }, set: function(i) { this.flags_ = hr(this.flags_, t.isBeingObservedMask_, i); } }, { key: "isPendingUnobservation", get: function() { return fr(this.flags_, t.isPendingUnobservationMask_); }, set: function(i) { this.flags_ = hr(this.flags_, t.isPendingUnobservationMask_, i); } }, { key: "diffValue", get: function() { return fr(this.flags_, t.diffValueMask_) ? 1 : 0; }, set: function(i) { this.flags_ = hr(this.flags_, t.diffValueMask_, i === 1); } }]); }(); ei.isComputingMask_ = 1; ei.isRunningSetterMask_ = 2; ei.isBeingObservedMask_ = 4; ei.isPendingUnobservationMask_ = 8; ei.diffValueMask_ = 16; var bf = /* @__PURE__ */ ia("ComputedValue", ei), xt; (function(t) { t[t.NOT_TRACKING_ = -1] = "NOT_TRACKING_", t[t.UP_TO_DATE_ = 0] = "UP_TO_DATE_", t[t.POSSIBLY_STALE_ = 1] = "POSSIBLY_STALE_", t[t.STALE_ = 2] = "STALE_"; })(xt || (xt = {})); var qd; (function(t) { t[t.NONE = 0] = "NONE", t[t.LOG = 1] = "LOG", t[t.BREAK = 2] = "BREAK"; })(qd || (qd = {})); var Kd = function(e) { this.cause = void 0, this.cause = e; }; function Td(t) { return t instanceof Kd; } function bm(t) { switch (t.dependenciesState_) { case xt.UP_TO_DATE_: return !1; case xt.NOT_TRACKING_: case xt.STALE_: return !0; case xt.POSSIBLY_STALE_: { for (var e = yg(!0), n = sa(), i = t.observing_, o = i.length, a = 0; a < o; a++) { var l = i[a]; if (bf(l)) { if (qe.disableErrorBoundaries) l.get(); else try { l.get(); } catch { return os(n), Al(e), !0; } if (t.dependenciesState_ === xt.STALE_) return os(n), Al(e), !0; } } return Bw(t), os(n), Al(e), !1; } } } function jw(t, e, n) { var i = yg(!0); Bw(t), t.newObserving_ = new Array( // Reserve constant space for initial dependencies, dynamic space otherwise. // See https://github.com/mobxjs/mobx/pull/3833 t.runId_ === 0 ? 100 : t.observing_.length ), t.unboundDepsCount_ = 0, t.runId_ = ++qe.runId; var o = qe.trackingDerivation; qe.trackingDerivation = t, qe.inBatch++; var a; if (qe.disableErrorBoundaries === !0) a = e.call(n); else try { a = e.call(n); } catch (l) { a = new Kd(l); } return qe.inBatch--, qe.trackingDerivation = o, K1(t), Al(i), a; } function K1(t) { for (var e = t.observing_, n = t.observing_ = t.newObserving_, i = xt.UP_TO_DATE_, o = 0, a = t.unboundDepsCount_, l = 0; l < a; l++) { var f = n[l]; f.diffValue === 0 && (f.diffValue = 1, o !== l && (n[o] = f), o++), f.dependenciesState_ > i && (i = f.dependenciesState_); } for (n.length = o, t.newObserving_ = null, a = e.length; a--; ) { var p = e[a]; p.diffValue === 0 && Vw(p, t), p.diffValue = 0; } for (; o--; ) { var v = n[o]; v.diffValue === 1 && (v.diffValue = 0, G1(v, t)); } i !== xt.UP_TO_DATE_ && (t.dependenciesState_ = i, t.onBecomeStale_()); } function Em(t) { var e = t.observing_; t.observing_ = []; for (var n = e.length; n--; ) Vw(e[n], t); t.dependenciesState_ = xt.NOT_TRACKING_; } function Uw(t) { var e = sa(); try { return t(); } finally { os(e); } } function sa() { var t = qe.trackingDerivation; return qe.trackingDerivation = null, t; } function os(t) { qe.trackingDerivation = t; } function yg(t) { var e = qe.allowStateReads; return qe.allowStateReads = t, e; } function Al(t) { qe.allowStateReads = t; } function Bw(t) { if (t.dependenciesState_ !== xt.UP_TO_DATE_) { t.dependenciesState_ = xt.UP_TO_DATE_; for (var e = t.observing_, n = e.length; n--; ) e[n].lowestObserverState_ = xt.UP_TO_DATE_; } } var Rp = function() { this.version = 6, this.UNCHANGED = {}, this.trackingDerivation = null, this.trackingContext = null, this.runId = 0, this.mobxGuid = 0, this.inBatch = 0, this.pendingUnobservations = [], this.pendingReactions = [], this.isRunningReactions = !1, this.allowStateChanges = !1, this.allowStateReads = !0, this.enforceActions = !0, this.spyListeners = [], this.globalReactionErrorHandlers = [], this.computedRequiresReaction = !1, this.reactionRequiresObservable = !1, this.observableRequiresReaction = !1, this.disableErrorBoundaries = !1, this.suppressReactionErrors = !1, this.useProxies = !0, this.verifyProxies = !1, this.safeDescriptors = !0; }, Ip = !0, qe = /* @__PURE__ */ function() { var t = /* @__PURE__ */ _w(); return t.__mobxInstanceCount > 0 && !t.__mobxGlobals && (Ip = !1), t.__mobxGlobals && t.__mobxGlobals.version !== new Rp().version && (Ip = !1), Ip ? t.__mobxGlobals ? (t.__mobxInstanceCount += 1, t.__mobxGlobals.UNCHANGED || (t.__mobxGlobals.UNCHANGED = {}), t.__mobxGlobals) : (t.__mobxInstanceCount = 1, t.__mobxGlobals = /* @__PURE__ */ new Rp()) : (setTimeout(function() { Ct(35); }, 1), new Rp()); }(); function G1(t, e) { t.observers_.add(e), t.lowestObserverState_ > e.dependenciesState_ && (t.lowestObserverState_ = e.dependenciesState_); } function Vw(t, e) { t.observers_.delete(e), t.observers_.size === 0 && zw(t); } function zw(t) { t.isPendingUnobservation === !1 && (t.isPendingUnobservation = !0, qe.pendingUnobservations.push(t)); } function Ir() { qe.inBatch++; } function Pr() { if (--qe.inBatch === 0) { Kw(); for (var t = qe.pendingUnobservations, e = 0; e < t.length; e++) { var n = t[e]; n.isPendingUnobservation = !1, n.observers_.size === 0 && (n.isBeingObserved && (n.isBeingObserved = !1, n.onBUO()), n instanceof ei && n.suspend_()); } qe.pendingUnobservations = []; } } function Hw(t) { var e = qe.trackingDerivation; return e !== null ? (e.runId_ !== t.lastAccessedBy_ && (t.lastAccessedBy_ = e.runId_, e.newObserving_[e.unboundDepsCount_++] = t, !t.isBeingObserved && qe.trackingContext && (t.isBeingObserved = !0, t.onBO())), t.isBeingObserved) : (t.observers_.size === 0 && qe.inBatch > 0 && zw(t), !1); } function qw(t) { t.lowestObserverState_ !== xt.STALE_ && (t.lowestObserverState_ = xt.STALE_, t.observers_.forEach(function(e) { e.dependenciesState_ === xt.UP_TO_DATE_ && e.onBecomeStale_(), e.dependenciesState_ = xt.STALE_; })); } function W1(t) { t.lowestObserverState_ !== xt.STALE_ && (t.lowestObserverState_ = xt.STALE_, t.observers_.forEach(function(e) { e.dependenciesState_ === xt.POSSIBLY_STALE_ ? e.dependenciesState_ = xt.STALE_ : e.dependenciesState_ === xt.UP_TO_DATE_ && (t.lowestObserverState_ = xt.UP_TO_DATE_); })); } function Q1(t) { t.lowestObserverState_ === xt.UP_TO_DATE_ && (t.lowestObserverState_ = xt.POSSIBLY_STALE_, t.observers_.forEach(function(e) { e.dependenciesState_ === xt.UP_TO_DATE_ && (e.dependenciesState_ = xt.POSSIBLY_STALE_, e.onBecomeStale_()); })); } var us = /* @__PURE__ */ function() { function t(n, i, o, a) { n === void 0 && (n = "Reaction"), this.name_ = void 0, this.onInvalidate_ = void 0, this.errorHandler_ = void 0, this.requiresObservable_ = void 0, this.observing_ = [], this.newObserving_ = [], this.dependenciesState_ = xt.NOT_TRACKING_, this.runId_ = 0, this.unboundDepsCount_ = 0, this.flags_ = 0, this.isTracing_ = qd.NONE, this.name_ = n, this.onInvalidate_ = i, this.errorHandler_ = o, this.requiresObservable_ = a; } var e = t.prototype; return e.onBecomeStale_ = function() { this.schedule_(); }, e.schedule_ = function() { this.isScheduled || (this.isScheduled = !0, qe.pendingReactions.push(this), Kw()); }, e.runReaction_ = function() { if (!this.isDisposed) { Ir(), this.isScheduled = !1; var i = qe.trackingContext; if (qe.trackingContext = this, bm(this)) { this.isTrackPending = !0; try { this.onInvalidate_(); } catch (o) { this.reportExceptionInDerivation_(o); } } qe.trackingContext = i, Pr(); } }, e.track = function(i) { if (!this.isDisposed) { Ir(), this.isRunning = !0; var o = qe.trackingContext; qe.trackingContext = this; var a = jw(this, i, void 0); qe.trackingContext = o, this.isRunning = !1, this.isTrackPending = !1, this.isDisposed && Em(this), Td(a) && this.reportExceptionInDerivation_(a.cause), Pr(); } }, e.reportExceptionInDerivation_ = function(i) { var o = this; if (this.errorHandler_) { this.errorHandler_(i, this); return; } if (qe.disableErrorBoundaries) throw i; var a = "[mobx] uncaught error in '" + this + "'"; qe.suppressReactionErrors || console.error(a, i), qe.globalReactionErrorHandlers.forEach(function(l) { return l(i, o); }); }, e.dispose = function() { this.isDisposed || (this.isDisposed = !0, this.isRunning || (Ir(), Em(this), Pr())); }, e.getDisposer_ = function(i) { var o = this, a = function l() { o.dispose(), i == null || i.removeEventListener == null || i.removeEventListener("abort", l); }; return i == null || i.addEventListener == null || i.addEventListener("abort", a), a[dt] = this, a; }, e.toString = function() { return "Reaction[" + this.name_ + "]"; }, e.trace = function(i) { }, gu(t, [{ key: "isDisposed", get: function() { return fr(this.flags_, t.isDisposedMask_); }, set: function(i) { this.flags_ = hr(this.flags_, t.isDisposedMask_, i); } }, { key: "isScheduled", get: function() { return fr(this.flags_, t.isScheduledMask_); }, set: function(i) { this.flags_ = hr(this.flags_, t.isScheduledMask_, i); } }, { key: "isTrackPending", get: function() { return fr(this.flags_, t.isTrackPendingMask_); }, set: function(i) { this.flags_ = hr(this.flags_, t.isTrackPendingMask_, i); } }, { key: "isRunning", get: function() { return fr(this.flags_, t.isRunningMask_); }, set: function(i) { this.flags_ = hr(this.flags_, t.isRunningMask_, i); } }, { key: "diffValue", get: function() { return fr(this.flags_, t.diffValueMask_) ? 1 : 0; }, set: function(i) { this.flags_ = hr(this.flags_, t.diffValueMask_, i === 1); } }]); }(); us.isDisposedMask_ = 1; us.isScheduledMask_ = 2; us.isTrackPendingMask_ = 4; us.isRunningMask_ = 8; us.diffValueMask_ = 16; var Y1 = 100, X1 = function(e) { return e(); }; function Kw() { qe.inBatch > 0 || qe.isRunningReactions || X1(J1); } function J1() { qe.isRunningReactions = !0; for (var t = qe.pendingReactions, e = 0; t.length > 0; ) { ++e === Y1 && (console.error("[mobx] cycle in reaction: " + t[0]), t.splice(0)); for (var n = t.splice(0), i = 0, o = n.length; i < o; i++) n[i].runReaction_(); } qe.isRunningReactions = !1; } var Gd = /* @__PURE__ */ ia("Reaction", us); function xl() { return !1; } function Z1(t) { return console.warn("[mobx.spy] Is a no-op in production builds"), function() { }; } var Gw = "action", eA = "action.bound", Ww = "autoAction", tA = "autoAction.bound", nA = "", Nm = /* @__PURE__ */ Yl(Gw), rA = /* @__PURE__ */ Yl(eA, { bound: !0 }), Am = /* @__PURE__ */ Yl(Ww, { autoAction: !0 }), iA = /* @__PURE__ */ Yl(tA, { autoAction: !0, bound: !0 }); function Qw(t) { var e = function(i, o) { if (Zr(i)) return no(i.name || nA, i, t); if (Zr(o)) return no(i, o, t); if (Ql(o)) return (t ? Am : Nm).decorate_20223_(i, o); if (Jo(o)) return yu(i, o, t ? Am : Nm); if (Jo(i)) return Ai(Yl(t ? Ww : Gw, { name: i, autoAction: t })); }; return e; } var cr = /* @__PURE__ */ Qw(!1); Object.assign(cr, Nm); var Fl = /* @__PURE__ */ Qw(!0); Object.assign(Fl, Am); cr.bound = /* @__PURE__ */ Ai(rA); Fl.bound = /* @__PURE__ */ Ai(iA); function Ef(t) { return Zr(t) && t.isMobxAction === !0; } function Nf(t, e) { var n, i, o, a; e === void 0 && (e = pg); var l = (n = (i = e) == null ? void 0 : i.name) != null ? n : "Autorun", f = !e.scheduler && !e.delay, p; if (f) p = new us(l, function() { this.track(b); }, e.onError, e.requiresObservable); else { var v = Yw(e), k = !1; p = new us(l, function() { k || (k = !0, v(function() { k = !1, p.isDisposed || p.track(b); })); }, e.onError, e.requiresObservable); } function b() { t(p); } return (o = e) != null && (o = o.signal) != null && o.aborted || p.schedule_(), p.getDisposer_((a = e) == null ? void 0 : a.signal); } var sA = function(e) { return e(); }; function Yw(t) { return t.scheduler ? t.scheduler : t.delay ? function(e) { return setTimeout(e, t.delay); } : sA; } function Xw(t, e, n) { var i, o, a; n === void 0 && (n = pg); var l = (i = n.name) != null ? i : "Reaction", f = cr(l, n.onError ? oA(n.onError, e) : e), p = !n.scheduler && !n.delay, v = Yw(n), k = !0, b = !1, w, T = n.compareStructural ? cu.structural : n.equals || cu.default, O = new us(l, function() { k || p ? x() : b || (b = !0, v(x)); }, n.onError, n.requiresObservable); function x() { if (b = !1, !O.isDisposed) { var C = !1, $ = w; O.track(function() { var J = $w(!1, function() { return t(O); }); C = k || !T(w, J), w = J; }), (k && n.fireImmediately || !k && C) && f(w, $, O), k = !1; } } return (o = n) != null && (o = o.signal) != null && o.aborted || O.schedule_(), O.getDisposer_((a = n) == null ? void 0 : a.signal); } function oA(t, e) { return function() { try { return e.apply(this, arguments); } catch (n) { t.call(this, n); } }; } var aA = "onBO", uA = "onBUO"; function lA(t, e, n) { return Zw(aA, t, e, n); } function Jw(t, e, n) { return Zw(uA, t, e, n); } function Zw(t, e, n, i) { var o = xm(e), a = Zr(i) ? i : n, l = t + "L"; return o[l] ? o[l].add(a) : o[l] = /* @__PURE__ */ new Set([a]), function() { var f = o[l]; f && (f.delete(a), f.size === 0 && delete o[l]); }; } function cA(t, e, n, i) { var o = YN(e); return aa(function() { var a = ku(t, i)[dt]; vf(o).forEach(function(l) { a.extend_( l, o[l], // must pass "undefined" for { key: undefined } n && l in n ? n[l] : !0 ); }); }), t; } var dA = 0; function eS() { this.message = "FLOW_CANCELLED"; } eS.prototype = /* @__PURE__ */ Object.create(Error.prototype); var Pp = /* @__PURE__ */ Rw("flow"), fA = /* @__PURE__ */ Rw("flow.bound", { bound: !0 }), du = /* @__PURE__ */ Object.assign(function(e, n) { if (Ql(n)) return Pp.decorate_20223_(e, n); if (Jo(n)) return yu(e, n, Pp); var i = e, o = i.name || "", a = function() { var f = this, p = arguments, v = ++dA, k = cr(o + " - runid: " + v + " - init", i).apply(f, p), b, w = void 0, T = new Promise(function(O, x) { var C = 0; b = x; function $(ne) { w = void 0; var he; try { he = cr(o + " - runid: " + v + " - yield " + C++, k.next).call(k, ne); } catch (ye) { return x(ye); } le(he); } function J(ne) { w = void 0; var he; try { he = cr(o + " - runid: " + v + " - yield " + C++, k.throw).call(k, ne); } catch (ye) { return x(ye); } le(he); } function le(ne) { if (Zr(ne == null ? void 0 : ne.then)) { ne.then(le, x); return; } return ne.done ? O(ne.value) : (w = Promise.resolve(ne.value), w.then($, J)); } $(void 0); }); return T.cancel = cr(o + " - runid: " + v + " - cancel", function() { try { w && dk(w); var O = k.return(void 0), x = Promise.resolve(O.value); x.then(eu, eu), dk(x), b(new eS()); } catch (C) { b(C); } }), T; }; return a.isMobXFlow = !0, a; }, Pp); du.bound = /* @__PURE__ */ Ai(fA); function dk(t) { Zr(t.cancel) && t.cancel(); } function Ml(t) { return (t == null ? void 0 : t.isMobXFlow) === !0; } function hA(t, e) { return t ? xf(t) || !!t[dt] || mg(t) || Gd(t) || bf(t) : !1; } function tS(t) { return hA(t); } function ns(t, e) { e === void 0 && (e = void 0), Ir(); try { return t.apply(e); } finally { Pr(); } } function nS(t, e, n) { return arguments.length === 1 || e && typeof e == "object" ? pA(t, e) : rS(t, e, {}); } function rS(t, e, n) { var i; if (typeof n.timeout == "number") { var o = new Error("WHEN_TIMEOUT"); i = setTimeout(function() { if (!l[dt].isDisposed) if (l(), n.onError) n.onError(o); else throw o; }, n.timeout); } n.name = "When"; var a = no("When-effect", e), l = Nf(function(f) { var p = $w(!1, t); p && (f.dispose(), i && clearTimeout(i), a()); }, n); return l; } function pA(t, e) { var n; if (e != null && (n = e.signal) != null && n.aborted) return Object.assign(Promise.reject(new Error("WHEN_ABORTED")), { cancel: function() { return null; } }); var i, o, a = new Promise(function(l, f) { var p, v = rS(t, l, to({}, e, { onError: f })); i = function() { v(), f(new Error("WHEN_CANCELLED")); }, o = function() { v(), f(new Error("WHEN_ABORTED")); }, e == null || (p = e.signal) == null || p.addEventListener == null || p.addEventListener("abort", o); }).finally(function() { var l; return e == null || (l = e.signal) == null || l.removeEventListener == null ? void 0 : l.removeEventListener("abort", o); }); return a.cancel = i, a; } function Ka(t) { return t[dt]; } var mA = { has: function(e, n) { return Ka(e).has_(n); }, get: function(e, n) { return Ka(e).get_(n); }, set: function(e, n, i) { var o; return Jo(n) ? (o = Ka(e).set_(n, i, !0)) != null ? o : !0 : !1; }, deleteProperty: function(e, n) { var i; return Jo(n) ? (i = Ka(e).delete_(n, !0)) != null ? i : !0 : !1; }, defineProperty: function(e, n, i) { var o; return (o = Ka(e).defineProperty_(n, i)) != null ? o : !0; }, ownKeys: function(e) { return Ka(e).ownKeys_(); }, preventExtensions: function(e) { Ct(13); } }; function gA(t, e) { var n, i; return Sw(), t = ku(t, e), (i = (n = t[dt]).proxy_) != null ? i : n.proxy_ = new Proxy(t, mA); } function Tr(t) { return t.interceptors_ !== void 0 && t.interceptors_.length > 0; } function Xl(t, e) { var n = t.interceptors_ || (t.interceptors_ = []); return n.push(e), bw(function() { var i = n.indexOf(e); i !== -1 && n.splice(i, 1); }); } function Rr(t, e) { var n = sa(); try { for (var i = [].concat(t.interceptors_ || []), o = 0, a = i.length; o < a && (e = i[o](e), e && !e.type && Ct(14), !!e); o++) ; return e; } finally { os(n); } } function Xr(t) { return t.changeListeners_ !== void 0 && t.changeListeners_.length > 0; } function Jl(t, e) { var n = t.changeListeners_ || (t.changeListeners_ = []); return n.push(e), bw(function() { var i = n.indexOf(e); i !== -1 && n.splice(i, 1); }); } function Jr(t, e) { var n = sa(), i = t.changeListeners_; if (i) { i = i.slice(); for (var o = 0, a = i.length; o < a; o++) i[o](e); os(n); } } function yA(t, e, n) { return aa(function() { var i, o = ku(t, n)[dt]; (i = e) != null || (e = t1(t)), vf(e).forEach(function(a) { return o.make_(a, e[a]); }); }), t; } var fk = "splice", xi = "update", vA = 1e4, kA = { get: function(e, n) { var i = e[dt]; return n === dt ? i : n === "length" ? i.getArrayLength_() : typeof n == "string" && !isNaN(n) ? i.get_(parseInt(n)) : ss(Wd, n) ? Wd[n] : e[n]; }, set: function(e, n, i) { var o = e[dt]; return n === "length" && o.setArrayLength_(i), typeof n == "symbol" || isNaN(n) ? e[n] = i : o.set_(parseInt(n), i), !0; }, preventExtensions: function() { Ct(15); } }, vg = /* @__PURE__ */ function() { function t(n, i, o, a) { n === void 0 && (n = "ObservableArray"), this.owned_ = void 0, this.legacyMode_ = void 0, this.atom_ = void 0, this.values_ = [], this.interceptors_ = void 0, this.changeListeners_ = void 0, this.enhancer_ = void 0, this.dehancer = void 0, this.proxy_ = void 0, this.lastKnownLength_ = 0, this.owned_ = o, this.legacyMode_ = a, this.atom_ = new so(n), this.enhancer_ = function(l, f) { return i(l, f, "ObservableArray[..]"); }; } var e = t.prototype; return e.dehanceValue_ = function(i) { return this.dehancer !== void 0 ? this.dehancer(i) : i; }, e.dehanceValues_ = function(i) { return this.dehancer !== void 0 && i.length > 0 ? i.map(this.dehancer) : i; }, e.intercept_ = function(i) { return Xl(this, i); }, e.observe_ = function(i, o) { return o === void 0 && (o = !1), o && i({ observableKind: "array", object: this.proxy_, debugObjectName: this.atom_.name_, type: "splice", index: 0, added: this.values_.slice(), addedCount: this.values_.length, removed: [], removedCount: 0 }), Jl(this, i); }, e.getArrayLength_ = function() { return this.atom_.reportObserved(), this.values_.length; }, e.setArrayLength_ = function(i) { (typeof i != "number" || isNaN(i) || i < 0) && Ct("Out of range: " + i); var o = this.values_.length; if (i !== o) if (i > o) { for (var a = new Array(i - o), l = 0; l < i - o; l++) a[l] = void 0; this.spliceWithArray_(o, 0, a); } else this.spliceWithArray_(i, o - i); }, e.updateArrayLength_ = function(i, o) { i !== this.lastKnownLength_ && Ct(16), this.lastKnownLength_ += o, this.legacyMode_ && o > 0 && cS(i + o + 1); }, e.spliceWithArray_ = function(i, o, a) { var l = this; this.atom_; var f = this.values_.length; if (i === void 0 ? i = 0 : i > f ? i = f : i < 0 && (i = Math.max(0, f + i)), arguments.length === 1 ? o = f - i : o == null ? o = 0 : o = Math.max(0, Math.min(o, f - i)), a === void 0 && (a = km), Tr(this)) { var p = Rr(this, { object: this.proxy_, type: fk, index: i, removedCount: o, added: a }); if (!p) return km; o = p.removedCount, a = p.added; } if (a = a.length === 0 ? a : a.map(function(b) { return l.enhancer_(b, void 0); }), this.legacyMode_) { var v = a.length - o; this.updateArrayLength_(f, v); } var k = this.spliceItemsIntoValues_(i, o, a); return (o !== 0 || a.length !== 0) && this.notifyArraySplice_(i, a, k), this.dehanceValues_(k); }, e.spliceItemsIntoValues_ = function(i, o, a) { if (a.length < vA) { var l; return (l = this.values_).splice.apply(l, [i, o].concat(a)); } else { var f = this.values_.slice(i, i + o), p = this.values_.slice(i + o); this.values_.length += a.length - o; for (var v = 0; v < a.length; v++) this.values_[i + v] = a[v]; for (var k = 0; k < p.length; k++) this.values_[i + a.length + k] = p[k]; return f; } }, e.notifyArrayChildUpdate_ = function(i, o, a) { var l = !this.owned_ && xl(), f = Xr(this), p = f || l ? { observableKind: "array", object: this.proxy_, type: xi, debugObjectName: this.atom_.name_, index: i, newValue: o, oldValue: a } : null; this.atom_.reportChanged(), f && Jr(this, p); }, e.notifyArraySplice_ = function(i, o, a) { var l = !this.owned_ && xl(), f = Xr(this), p = f || l ? { observableKind: "array", object: this.proxy_, debugObjectName: this.atom_.name_, type: fk, index: i, removed: a, added: o, removedCount: a.length, addedCount: o.length } : null; this.atom_.reportChanged(), f && Jr(this, p); }, e.get_ = function(i) { if (this.legacyMode_ && i >= this.values_.length) { console.warn("[mobx] Out of bounds read: " + i); return; } return this.atom_.reportObserved(), this.dehanceValue_(this.values_[i]); }, e.set_ = function(i, o) { var a = this.values_; if (this.legacyMode_ && i > a.length && Ct(17, i, a.length), i < a.length) { this.atom_; var l = a[i]; if (Tr(this)) { var f = Rr(this, { type: xi, object: this.proxy_, // since "this" is the real array we need to pass its proxy index: i, newValue: o }); if (!f) return; o = f.newValue; } o = this.enhancer_(o, l); var p = o !== l; p && (a[i] = o, this.notifyArrayChildUpdate_(i, o, l)); } else { for (var v = new Array(i + 1 - a.length), k = 0; k < v.length - 1; k++) v[k] = void 0; v[v.length - 1] = o, this.spliceWithArray_(a.length, 0, v); } }, t; }(); function _A(t, e, n, i) { return n === void 0 && (n = "ObservableArray"), i === void 0 && (i = !1), Sw(), aa(function() { var o = new vg(n, e, i, !1); Nw(o.values_, dt, o); var a = new Proxy(o.values_, kA); return o.proxy_ = a, t && t.length && o.spliceWithArray_(0, 0, t), a; }); } var Wd = { clear: function() { return this.splice(0); }, replace: function(e) { var n = this[dt]; return n.spliceWithArray_(0, n.values_.length, e); }, // Used by JSON.stringify toJSON: function() { return this.slice(); }, /* * functions that do alter the internal structure of the array, (based on lib.es6.d.ts) * since these functions alter the inner structure of the array, the have side effects. * Because the have side effects, they should not be used in computed function, * and for that reason the do not call dependencyState.notifyObserved */ splice: function(e, n) { for (var i = arguments.length, o = new Array(i > 2 ? i - 2 : 0), a = 2; a < i; a++) o[a - 2] = arguments[a]; var l = this[dt]; switch (arguments.length) { case 0: return []; case 1: return l.spliceWithArray_(e); case 2: return l.spliceWithArray_(e, n); } return l.spliceWithArray_(e, n, o); }, spliceWithArray: function(e, n, i) { return this[dt].spliceWithArray_(e, n, i); }, push: function() { for (var e = this[dt], n = arguments.length, i = new Array(n), o = 0; o < n; o++) i[o] = arguments[o]; return e.spliceWithArray_(e.values_.length, 0, i), e.values_.length; }, pop: function() { return this.splice(Math.max(this[dt].values_.length - 1, 0), 1)[0]; }, shift: function() { return this.splice(0, 1)[0]; }, unshift: function() { for (var e = this[dt], n = arguments.length, i = new Array(n), o = 0; o < n; o++) i[o] = arguments[o]; return e.spliceWithArray_(0, 0, i), e.values_.length; }, reverse: function() { return qe.trackingDerivation && Ct(37, "reverse"), this.replace(this.slice().reverse()), this; }, sort: function() { qe.trackingDerivation && Ct(37, "sort"); var e = this.slice(); return e.sort.apply(e, arguments), this.replace(e), this; }, remove: function(e) { var n = this[dt], i = n.dehanceValues_(n.values_).indexOf(e); return i > -1 ? (this.splice(i, 1), !0) : !1; } }; Ut("at", yr); Ut("concat", yr); Ut("flat", yr); Ut("includes", yr); Ut("indexOf", yr); Ut("join", yr); Ut("lastIndexOf", yr); Ut("slice", yr); Ut("toString", yr); Ut("toLocaleString", yr); Ut("toSorted", yr); Ut("toSpliced", yr); Ut("with", yr); Ut("every", ti); Ut("filter", ti); Ut("find", ti); Ut("findIndex", ti); Ut("findLast", ti); Ut("findLastIndex", ti); Ut("flatMap", ti); Ut("forEach", ti); Ut("map", ti); Ut("some", ti); Ut("toReversed", ti); Ut("reduce", iS); Ut("reduceRight", iS); function Ut(t, e) { typeof Array.prototype[t] == "function" && (Wd[t] = e(t)); } function yr(t) { return function() { var e = this[dt]; e.atom_.reportObserved(); var n = e.dehanceValues_(e.values_); return n[t].apply(n, arguments); }; } function ti(t) { return function(e, n) { var i = this, o = this[dt]; o.atom_.reportObserved(); var a = o.dehanceValues_(o.values_); return a[t](function(l, f) { return e.call(n, l, f, i); }); }; } function iS(t) { return function() { var e = this, n = this[dt]; n.atom_.reportObserved(); var i = n.dehanceValues_(n.values_), o = arguments[0]; return arguments[0] = function(a, l, f) { return o(a, l, f, e); }, i[t].apply(i, arguments); }; } var wA = /* @__PURE__ */ ia("ObservableArrayAdministration", vg); function Af(t) { return gf(t) && wA(t[dt]); } var SA = {}, Xs = "add", Qd = "delete", sS = /* @__PURE__ */ function() { function t(n, i, o) { var a = this; i === void 0 && (i = Zo), o === void 0 && (o = "ObservableMap"), this.enhancer_ = void 0, this.name_ = void 0, this[dt] = SA, this.data_ = void 0, this.hasMap_ = void 0, this.keysAtom_ = void 0, this.interceptors_ = void 0, this.changeListeners_ = void 0, this.dehancer = void 0, this.enhancer_ = i, this.name_ = o, Zr(Map) || Ct(18), aa(function() { a.keysAtom_ = Ow("ObservableMap.keys()"), a.data_ = /* @__PURE__ */ new Map(), a.hasMap_ = /* @__PURE__ */ new Map(), n && a.merge(n); }); } var e = t.prototype; return e.has_ = function(i) { return this.data_.has(i); }, e.has = function(i) { var o = this; if (!qe.trackingDerivation) return this.has_(i); var a = this.hasMap_.get(i); if (!a) { var l = a = new Qo(this.has_(i), kf, "ObservableMap.key?", !1); this.hasMap_.set(i, l), Jw(l, function() { return o.hasMap_.delete(i); }); } return a.get(); }, e.set = function(i, o) { var a = this.has_(i); if (Tr(this)) { var l = Rr(this, { type: a ? xi : Xs, object: this, newValue: o, name: i }); if (!l) return this; o = l.newValue; } return a ? this.updateValue_(i, o) : this.addValue_(i, o), this; }, e.delete = function(i) { var o = this; if (this.keysAtom_, Tr(this)) { var a = Rr(this, { type: Qd, object: this, name: i }); if (!a) return !1; } if (this.has_(i)) { var l = xl(), f = Xr(this), p = f || l ? { observableKind: "map", debugObjectName: this.name_, type: Qd, object: this, oldValue: this.data_.get(i).value_, name: i } : null; return ns(function() { var v; o.keysAtom_.reportChanged(), (v = o.hasMap_.get(i)) == null || v.setNewValue_(!1); var k = o.data_.get(i); k.setNewValue_(void 0), o.data_.delete(i); }), f && Jr(this, p), !0; } return !1; }, e.updateValue_ = function(i, o) { var a = this.data_.get(i); if (o = a.prepareNewValue_(o), o !== qe.UNCHANGED) { var l = xl(), f = Xr(this), p = f || l ? { observableKind: "map", debugObjectName: this.name_, type: xi, object: this, oldValue: a.value_, name: i, newValue: o } : null; a.setNewValue_(o), f && Jr(this, p); } }, e.addValue_ = function(i, o) { var a = this; this.keysAtom_, ns(function() { var v, k = new Qo(o, a.enhancer_, "ObservableMap.key", !1); a.data_.set(i, k), o = k.value_, (v = a.hasMap_.get(i)) == null || v.setNewValue_(!0), a.keysAtom_.reportChanged(); }); var l = xl(), f = Xr(this), p = f || l ? { observableKind: "map", debugObjectName: this.name_, type: Xs, object: this, name: i, newValue: o } : null; f && Jr(this, p); }, e.get = function(i) { return this.has(i) ? this.dehanceValue_(this.data_.get(i).get()) : this.dehanceValue_(void 0); }, e.dehanceValue_ = function(i) { return this.dehancer !== void 0 ? this.dehancer(i) : i; }, e.keys = function() { return this.keysAtom_.reportObserved(), this.data_.keys(); }, e.values = function() { var i = this, o = this.keys(); return $l({ next: function() { var l = o.next(), f = l.done, p = l.value; return { done: f, value: f ? void 0 : i.get(p) }; } }); }, e.entries = function() { var i = this, o = this.keys(); return $l({ next: function() { var l = o.next(), f = l.done, p = l.value; return { done: f, value: f ? void 0 : [p, i.get(p)] }; } }); }, e[Symbol.iterator] = function() { return this.entries(); }, e.forEach = function(i, o) { for (var a = tu(this), l; !(l = a()).done; ) { var f = l.value, p = f[0], v = f[1]; i.call(o, v, p, this); } }, e.merge = function(i) { var o = this; return oa(i) && (i = new Map(i)), ns(function() { eo(i) ? QN(i).forEach(function(a) { return o.set(a, i[a]); }) : Array.isArray(i) ? i.forEach(function(a) { var l = a[0], f = a[1]; return o.set(l, f); }) : mu(i) ? (WN(i) || Ct(19, i), i.forEach(function(a, l) { return o.set(l, a); })) : i != null && Ct(20, i); }), this; }, e.clear = function() { var i = this; ns(function() { Uw(function() { for (var o = tu(i.keys()), a; !(a = o()).done; ) { var l = a.value; i.delete(l); } }); }); }, e.replace = function(i) { var o = this; return ns(function() { for (var a = bA(i), l = /* @__PURE__ */ new Map(), f = !1, p = tu(o.data_.keys()), v; !(v = p()).done; ) { var k = v.value; if (!a.has(k)) { var b = o.delete(k); if (b) f = !0; else { var w = o.data_.get(k); l.set(k, w); } } } for (var T = tu(a.entries()), O; !(O = T()).done; ) { var x = O.value, C = x[0], $ = x[1], J = o.data_.has(C); if (o.set(C, $), o.data_.has(C)) { var le = o.data_.get(C); l.set(C, le), J || (f = !0); } } if (!f) if (o.data_.size !== l.size) o.keysAtom_.reportChanged(); else for (var ne = o.data_.keys(), he = l.keys(), ye = ne.next(), me = he.next(); !ye.done; ) { if (ye.value !== me.value) { o.keysAtom_.reportChanged(); break; } ye = ne.next(), me = he.next(); } o.data_ = l; }), this; }, e.toString = function() { return "[object ObservableMap]"; }, e.toJSON = function() { return Array.from(this); }, e.observe_ = function(i, o) { return Jl(this, i); }, e.intercept_ = function(i) { return Xl(this, i); }, gu(t, [{ key: "size", get: function() { return this.keysAtom_.reportObserved(), this.data_.size; } }, { key: Symbol.toStringTag, get: function() { return "Map"; } }]); }(), oa = /* @__PURE__ */ ia("ObservableMap", sS); function bA(t) { if (mu(t) || oa(t)) return t; if (Array.isArray(t)) return new Map(t); if (eo(t)) { var e = /* @__PURE__ */ new Map(); for (var n in t) e.set(n, t[n]); return e; } else return Ct(21, t); } var EA = {}, oS = /* @__PURE__ */ function() { function t(n, i, o) { var a = this; i === void 0 && (i = Zo), o === void 0 && (o = "ObservableSet"), this.name_ = void 0, this[dt] = EA, this.data_ = /* @__PURE__ */ new Set(), this.atom_ = void 0, this.changeListeners_ = void 0, this.interceptors_ = void 0, this.dehancer = void 0, this.enhancer_ = void 0, this.name_ = o, Zr(Set) || Ct(22), this.enhancer_ = function(l, f) { return i(l, f, o); }, aa(function() { a.atom_ = Ow(a.name_), n && a.replace(n); }); } var e = t.prototype; return e.dehanceValue_ = function(i) { return this.dehancer !== void 0 ? this.dehancer(i) : i; }, e.clear = function() { var i = this; ns(function() { Uw(function() { for (var o = tu(i.data_.values()), a; !(a = o()).done; ) { var l = a.value; i.delete(l); } }); }); }, e.forEach = function(i, o) { for (var a = tu(this), l; !(l = a()).done; ) { var f = l.value; i.call(o, f, f, this); } }, e.add = function(i) { var o = this; if (this.atom_, Tr(this)) { var a = Rr(this, { type: Xs, object: this, newValue: i }); if (!a) return this; } if (!this.has(i)) { ns(function() { o.data_.add(o.enhancer_(i, void 0)), o.atom_.reportChanged(); }); var l = !1, f = Xr(this), p = f || l ? { observableKind: "set", debugObjectName: this.name_, type: Xs, object: this, newValue: i } : null; f && Jr(this, p); } return this; }, e.delete = function(i) { var o = this; if (Tr(this)) { var a = Rr(this, { type: Qd, object: this, oldValue: i }); if (!a) return !1; } if (this.has(i)) { var l = !1, f = Xr(this), p = f || l ? { observableKind: "set", debugObjectName: this.name_, type: Qd, object: this, oldValue: i } : null; return ns(function() { o.atom_.reportChanged(), o.data_.delete(i); }), f && Jr(this, p), !0; } return !1; }, e.has = function(i) { return this.atom_.reportObserved(), this.data_.has(this.dehanceValue_(i)); }, e.entries = function() { var i = 0, o = Array.from(this.keys()), a = Array.from(this.values()); return $l({ next: function() { var f = i; return i += 1, f < a.length ? { value: [o[f], a[f]], done: !1 } : { done: !0 }; } }); }, e.keys = function() { return this.values(); }, e.values = function() { this.atom_.reportObserved(); var i = this, o = 0, a = Array.from(this.data_.values()); return $l({ next: function() { return o < a.length ? { value: i.dehanceValue_(a[o++]), done: !1 } : { done: !0 }; } }); }, e.intersection = function(i) { if (ts(i)) return i.intersection(this); var o = new Set(this); return o.intersection(i); }, e.union = function(i) { if (ts(i)) return i.union(this); var o = new Set(this); return o.union(i); }, e.difference = function(i) { return new Set(this).difference(i); }, e.symmetricDifference = function(i) { if (ts(i)) return i.symmetricDifference(this); var o = new Set(this); return o.symmetricDifference(i); }, e.isSubsetOf = function(i) { return new Set(this).isSubsetOf(i); }, e.isSupersetOf = function(i) { return new Set(this).isSupersetOf(i); }, e.isDisjointFrom = function(i) { if (ts(i)) return i.isDisjointFrom(this); var o = new Set(this); return o.isDisjointFrom(i); }, e.replace = function(i) { var o = this; return vu(i) && (i = new Set(i)), ns(function() { Array.isArray(i) ? (o.clear(), i.forEach(function(a) { return o.add(a); })) : ts(i) ? (o.clear(), i.forEach(function(a) { return o.add(a); })) : i != null && Ct("Cannot initialize set from " + i); }), this; }, e.observe_ = function(i, o) { return Jl(this, i); }, e.intercept_ = function(i) { return Xl(this, i); }, e.toJSON = function() { return Array.from(this); }, e.toString = function() { return "[object ObservableSet]"; }, e[Symbol.iterator] = function() { return this.values(); }, gu(t, [{ key: "size", get: function() { return this.atom_.reportObserved(), this.data_.size; } }, { key: Symbol.toStringTag, get: function() { return "Set"; } }]); }(), vu = /* @__PURE__ */ ia("ObservableSet", oS), hk = /* @__PURE__ */ Object.create(null), pk = "remove", aS = /* @__PURE__ */ function() { function t(n, i, o, a) { i === void 0 && (i = /* @__PURE__ */ new Map()), a === void 0 && (a = N1), this.target_ = void 0, this.values_ = void 0, this.name_ = void 0, this.defaultAnnotation_ = void 0, this.keysAtom_ = void 0, this.changeListeners_ = void 0, this.interceptors_ = void 0, this.proxy_ = void 0, this.isPlainObject_ = void 0, this.appliedAnnotations_ = void 0, this.pendingKeys_ = void 0, this.target_ = n, this.values_ = i, this.name_ = o, this.defaultAnnotation_ = a, this.keysAtom_ = new so("ObservableObject.keys"), this.isPlainObject_ = eo(this.target_); } var e = t.prototype; return e.getObservablePropValue_ = function(i) { return this.values_.get(i).get(); }, e.setObservablePropValue_ = function(i, o) { var a = this.values_.get(i); if (a instanceof ei) return a.set(o), !0; if (Tr(this)) { var l = Rr(this, { type: xi, object: this.proxy_ || this.target_, name: i, newValue: o }); if (!l) return null; o = l.newValue; } if (o = a.prepareNewValue_(o), o !== qe.UNCHANGED) { var f = Xr(this), p = !1, v = f || p ? { type: xi, observableKind: "object", debugObjectName: this.name_, object: this.proxy_ || this.target_, oldValue: a.value_, name: i, newValue: o } : null; a.setNewValue_(o), f && Jr(this, v); } return !0; }, e.get_ = function(i) { return qe.trackingDerivation && !ss(this.target_, i) && this.has_(i), this.target_[i]; }, e.set_ = function(i, o, a) { return a === void 0 && (a = !1), ss(this.target_, i) ? this.values_.has(i) ? this.setObservablePropValue_(i, o) : a ? Reflect.set(this.target_, i, o) : (this.target_[i] = o, !0) : this.extend_(i, { value: o, enumerable: !0, writable: !0, configurable: !0 }, this.defaultAnnotation_, a); }, e.has_ = function(i) { if (!qe.trackingDerivation) return i in this.target_; this.pendingKeys_ || (this.pendingKeys_ = /* @__PURE__ */ new Map()); var o = this.pendingKeys_.get(i); return o || (o = new Qo(i in this.target_, kf, "ObservableObject.key?", !1), this.pendingKeys_.set(i, o)), o.get(); }, e.make_ = function(i, o) { if (o === !0 && (o = this.defaultAnnotation_), o !== !1) { if (!(i in this.target_)) { var a; if ((a = this.target_[Si]) != null && a[i]) return; Ct(1, o.annotationType_, this.name_ + "." + i.toString()); } for (var l = this.target_; l && l !== mf; ) { var f = zd(l, i); if (f) { var p = o.make_(this, i, f, l); if (p === 0) return; if (p === 1) break; } l = Object.getPrototypeOf(l); } gk(this, o, i); } }, e.extend_ = function(i, o, a, l) { if (l === void 0 && (l = !1), a === !0 && (a = this.defaultAnnotation_), a === !1) return this.defineProperty_(i, o, l); var f = a.extend_(this, i, o, l); return f && gk(this, a, i), f; }, e.defineProperty_ = function(i, o, a) { a === void 0 && (a = !1), this.keysAtom_; try { Ir(); var l = this.delete_(i); if (!l) return l; if (Tr(this)) { var f = Rr(this, { object: this.proxy_ || this.target_, name: i, type: Xs, newValue: o.value }); if (!f) return null; var p = f.newValue; o.value !== p && (o = to({}, o, { value: p })); } if (a) { if (!Reflect.defineProperty(this.target_, i, o)) return !1; } else Ni(this.target_, i, o); this.notifyPropertyAddition_(i, o.value); } finally { Pr(); } return !0; }, e.defineObservableProperty_ = function(i, o, a, l) { l === void 0 && (l = !1), this.keysAtom_; try { Ir(); var f = this.delete_(i); if (!f) return f; if (Tr(this)) { var p = Rr(this, { object: this.proxy_ || this.target_, name: i, type: Xs, newValue: o }); if (!p) return null; o = p.newValue; } var v = mk(i), k = { configurable: qe.safeDescriptors ? this.isPlainObject_ : !0, enumerable: !0, get: v.get, set: v.set }; if (l) { if (!Reflect.defineProperty(this.target_, i, k)) return !1; } else Ni(this.target_, i, k); var b = new Qo(o, a, "ObservableObject.key", !1); this.values_.set(i, b), this.notifyPropertyAddition_(i, b.value_); } finally { Pr(); } return !0; }, e.defineComputedProperty_ = function(i, o, a) { a === void 0 && (a = !1), this.keysAtom_; try { Ir(); var l = this.delete_(i); if (!l) return l; if (Tr(this)) { var f = Rr(this, { object: this.proxy_ || this.target_, name: i, type: Xs, newValue: void 0 }); if (!f) return null; } o.name || (o.name = "ObservableObject.key"), o.context = this.proxy_ || this.target_; var p = mk(i), v = { configurable: qe.safeDescriptors ? this.isPlainObject_ : !0, enumerable: !1, get: p.get, set: p.set }; if (a) { if (!Reflect.defineProperty(this.target_, i, v)) return !1; } else Ni(this.target_, i, v); this.values_.set(i, new ei(o)), this.notifyPropertyAddition_(i, void 0); } finally { Pr(); } return !0; }, e.delete_ = function(i, o) { if (o === void 0 && (o = !1), this.keysAtom_, !ss(this.target_, i)) return !0; if (Tr(this)) { var a = Rr(this, { object: this.proxy_ || this.target_, name: i, type: pk }); if (!a) return null; } try { var l; Ir(); var f = Xr(this), p = !1, v = this.values_.get(i), k = void 0; if (!v && (f || p)) { var b; k = (b = zd(this.target_, i)) == null ? void 0 : b.value; } if (o) { if (!Reflect.deleteProperty(this.target_, i)) return !1; } else delete this.target_[i]; if (v && (this.values_.delete(i), v instanceof Qo && (k = v.value_), qw(v)), this.keysAtom_.reportChanged(), (l = this.pendingKeys_) == null || (l = l.get(i)) == null || l.set(i in this.target_), f || p) { var w = { type: pk, observableKind: "object", object: this.proxy_ || this.target_, debugObjectName: this.name_, oldValue: k, name: i }; f && Jr(this, w); } } finally { Pr(); } return !0; }, e.observe_ = function(i, o) { return Jl(this, i); }, e.intercept_ = function(i) { return Xl(this, i); }, e.notifyPropertyAddition_ = function(i, o) { var a, l = Xr(this), f = !1; if (l || f) { var p = l || f ? { type: Xs, observableKind: "object", debugObjectName: this.name_, object: this.proxy_ || this.target_, name: i, newValue: o } : null; l && Jr(this, p); } (a = this.pendingKeys_) == null || (a = a.get(i)) == null || a.set(!0), this.keysAtom_.reportChanged(); }, e.ownKeys_ = function() { return this.keysAtom_.reportObserved(), vf(this.target_); }, e.keys_ = function() { return this.keysAtom_.reportObserved(), Object.keys(this.target_); }, t; }(); function ku(t, e) { var n; if (ss(t, dt)) return t; var i = (n = e == null ? void 0 : e.name) != null ? n : "ObservableObject", o = new aS(t, /* @__PURE__ */ new Map(), String(i), F1(e)); return yf(t, dt, o), t; } var NA = /* @__PURE__ */ ia("ObservableObjectAdministration", aS); function mk(t) { return hk[t] || (hk[t] = { get: function() { return this[dt].getObservablePropValue_(t); }, set: function(n) { return this[dt].setObservablePropValue_(t, n); } }); } function xf(t) { return gf(t) ? NA(t[dt]) : !1; } function gk(t, e, n) { var i; (i = t.target_[Si]) == null || delete i[n]; } var AA = /* @__PURE__ */ lS(0), xA = /* @__PURE__ */ function() { var t = !1, e = {}; return Object.defineProperty(e, "0", { set: function() { t = !0; } }), Object.create(e)[0] = 1, t === !1; }(), Lp = 0, uS = function() { }; function CA(t, e) { Object.setPrototypeOf ? Object.setPrototypeOf(t.prototype, e) : t.prototype.__proto__ !== void 0 ? t.prototype.__proto__ = e : t.prototype = e; } CA(uS, Array.prototype); var kg = /* @__PURE__ */ function(t) { function e(i, o, a, l) { var f; return a === void 0 && (a = "ObservableArray"), l === void 0 && (l = !1), f = t.call(this) || this, aa(function() { var p = new vg(a, o, l, !0); p.proxy_ = f, Nw(f, dt, p), i && i.length && f.spliceWithArray(0, 0, i), xA && Object.defineProperty(f, "0", AA); }), f; } Cw(e, t); var n = e.prototype; return n.concat = function() { this[dt].atom_.reportObserved(); for (var o = arguments.length, a = new Array(o), l = 0; l < o; l++) a[l] = arguments[l]; return Array.prototype.concat.apply( this.slice(), //@ts-ignore a.map(function(f) { return Af(f) ? f.slice() : f; }) ); }, n[Symbol.iterator] = function() { var i = this, o = 0; return $l({ next: function() { return o < i.length ? { value: i[o++], done: !1 } : { done: !0, value: void 0 }; } }); }, gu(e, [{ key: "length", get: function() { return this[dt].getArrayLength_(); }, set: function(o) { this[dt].setArrayLength_(o); } }, { key: Symbol.toStringTag, get: function() { return "Array"; } }]); }(uS); Object.entries(Wd).forEach(function(t) { var e = t[0], n = t[1]; e !== "concat" && yf(kg.prototype, e, n); }); function lS(t) { return { enumerable: !1, configurable: !0, get: function() { return this[dt].get_(t); }, set: function(n) { this[dt].set_(t, n); } }; } function OA(t) { Ni(kg.prototype, "" + t, lS(t)); } function cS(t) { if (t > Lp) { for (var e = Lp; e < t + 100; e++) OA(e); Lp = t; } } cS(1e3); function TA(t, e, n) { return new kg(t, e, n); } function xm(t, e) { if (typeof t == "object" && t !== null) { if (Af(t)) return e !== void 0 && Ct(23), t[dt].atom_; if (vu(t)) return t.atom_; if (oa(t)) { if (e === void 0) return t.keysAtom_; var n = t.data_.get(e) || t.hasMap_.get(e); return n || Ct(25, e, Cm(t)), n; } if (xf(t)) { if (!e) return Ct(26); var i = t[dt].values_.get(e); return i || Ct(27, e, Cm(t)), i; } if (mg(t) || bf(t) || Gd(t)) return t; } else if (Zr(t) && Gd(t[dt])) return t[dt]; Ct(28); } function RA(t, e) { if (t || Ct(29), mg(t) || bf(t) || Gd(t) || oa(t) || vu(t)) return t; if (t[dt]) return t[dt]; Ct(24, t); } function Cm(t, e) { var n; if (e !== void 0) n = xm(t, e); else { if (Ef(t)) return t.name; xf(t) || oa(t) || vu(t) ? n = RA(t) : n = xm(t); } return n.name_; } function aa(t) { var e = sa(), n = wf(!0); Ir(); try { return t(); } finally { Pr(), Sf(n), os(e); } } var yk = mf.toString; function dS(t, e, n) { return n === void 0 && (n = -1), Om(t, e, n); } function Om(t, e, n, i, o) { if (t === e) return t !== 0 || 1 / t === 1 / e; if (t == null || e == null) return !1; if (t !== t) return e !== e; var a = typeof t; if (a !== "function" && a !== "object" && typeof e != "object") return !1; var l = yk.call(t); if (l !== yk.call(e)) return !1; switch (l) { // Strings, numbers, regular expressions, dates, and booleans are compared by value. case "[object RegExp]": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') case "[object String]": return "" + t == "" + e; case "[object Number]": return +t != +t ? +e != +e : +t == 0 ? 1 / +t === 1 / e : +t == +e; case "[object Date]": case "[object Boolean]": return +t == +e; case "[object Symbol]": return typeof Symbol < "u" && Symbol.valueOf.call(t) === Symbol.valueOf.call(e); case "[object Map]": case "[object Set]": n >= 0 && n++; break; } t = vk(t), e = vk(e); var f = l === "[object Array]"; if (!f) { if (typeof t != "object" || typeof e != "object") return !1; var p = t.constructor, v = e.constructor; if (p !== v && !(Zr(p) && p instanceof p && Zr(v) && v instanceof v) && "constructor" in t && "constructor" in e) return !1; } if (n === 0) return !1; n < 0 && (n = -1), i = i || [], o = o || []; for (var k = i.length; k--; ) if (i[k] === t) return o[k] === e; if (i.push(t), o.push(e), f) { if (k = t.length, k !== e.length) return !1; for (; k--; ) if (!Om(t[k], e[k], n - 1, i, o)) return !1; } else { var b = Object.keys(t), w; if (k = b.length, Object.keys(e).length !== k) return !1; for (; k--; ) if (w = b[k], !(ss(e, w) && Om(t[w], e[w], n - 1, i, o))) return !1; } return i.pop(), o.pop(), !0; } function vk(t) { return Af(t) ? t.slice() : mu(t) || oa(t) || ts(t) || vu(t) ? Array.from(t.entries()) : t; } function $l(t) { return t[Symbol.iterator] = IA, t; } function IA() { return this; } ["Symbol", "Map", "Set"].forEach(function(t) { var e = _w(); typeof e[t] > "u" && Ct("MobX requires global '" + t + "' to be available or polyfilled"); }); typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ == "object" && __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({ spy: Z1, extras: { getDebugName: Cm }, $mobx: dt }); function PA(t, e = []) { st.useEffect(() => { const n = Nf(t); return () => n(); }, e); } function fS(t, e = {}) { const { defaultValue: n, deps: i = [] } = e, o = st.useMemo(() => t, i), [a, l] = st.useState( () => o() || n ); return st.useEffect(() => { const f = Nf(() => l(o())); return () => f(); }, [o, ...i]), a; } function LA(t, e, n = []) { const i = st.useMemo(() => t, n), o = st.useMemo(() => e, n); st.useEffect(() => { const a = Xw(i, o); return () => a(); }, [i, o]); } var Dp = { exports: {} }, pl = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var kk; function DA() { if (kk) return pl; kk = 1; var t = ag(), e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, o = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 }; function l(f, p, v) { var k, b = {}, w = null, T = null; v !== void 0 && (w = "" + v), p.key !== void 0 && (w = "" + p.key), p.ref !== void 0 && (T = p.ref); for (k in p) i.call(p, k) && !a.hasOwnProperty(k) && (b[k] = p[k]); if (f && f.defaultProps) for (k in p = f.defaultProps, p) b[k] === void 0 && (b[k] = p[k]); return { $$typeof: e, type: f, key: w, ref: T, props: b, _owner: o.current }; } return pl.Fragment = n, pl.jsx = l, pl.jsxs = l, pl; } var _k; function FA() { return _k || (_k = 1, Dp.exports = DA()), Dp.exports; } var jl = FA(); let _g = /* @__PURE__ */ new Map(); const Tm = st.createContext(_g), MA = ({ children: t, stores: e }) => { const n = st.useContext(Tm), i = st.useMemo(() => { const o = /* @__PURE__ */ new Map(); return e.forEach((a) => o.set(a.class, a.value)), _g = new Map([...n, ...o]); }, []); return /* @__PURE__ */ jl.jsx(Tm.Provider, { value: i, children: t }); }; function $A(t) { return st.useContext(Tm).get(t); } function jA(t) { return _g.get(t); } var Rd = { exports: {} }, UA = Rd.exports, wk; function BA() { return wk || (wk = 1, function(t, e) { (function(n, i) { t.exports = i(); })(UA, function() { var n = function(c, h) { return (n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(g, _) { g.__proto__ = _; } || function(g, _) { for (var S in _) Object.prototype.hasOwnProperty.call(_, S) && (g[S] = _[S]); })(c, h); }, i = function() { return (i = Object.assign || function(c) { for (var h, g = 1, _ = arguments.length; g < _; g++) for (var S in h = arguments[g]) Object.prototype.hasOwnProperty.call(h, S) && (c[S] = h[S]); return c; }).apply(this, arguments); }; function o(c, h, g) { for (var _, S = 0, N = h.length; S < N; S++) !_ && S in h || ((_ = _ || Array.prototype.slice.call(h, 0, S))[S] = h[S]); return c.concat(_ || Array.prototype.slice.call(h)); } var a = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : JE, l = Object.keys, f = Array.isArray; function p(c, h) { return typeof h != "object" || l(h).forEach(function(g) { c[g] = h[g]; }), c; } typeof Promise > "u" || a.Promise || (a.Promise = Promise); var v = Object.getPrototypeOf, k = {}.hasOwnProperty; function b(c, h) { return k.call(c, h); } function w(c, h) { typeof h == "function" && (h = h(v(c))), (typeof Reflect > "u" ? l : Reflect.ownKeys)(h).forEach(function(g) { O(c, g, h[g]); }); } var T = Object.defineProperty; function O(c, h, g, _) { T(c, h, p(g && b(g, "get") && typeof g.get == "function" ? { get: g.get, set: g.set, configurable: !0 } : { value: g, configurable: !0, writable: !0 }, _)); } function x(c) { return { from: function(h) { return c.prototype = Object.create(h.prototype), O(c.prototype, "constructor", c), { extend: w.bind(null, c.prototype) }; } }; } var C = Object.getOwnPropertyDescriptor, $ = [].slice; function J(c, h, g) { return $.call(c, h, g); } function le(c, h) { return h(c); } function ne(c) { if (!c) throw new Error("Assertion Failed"); } function he(c) { a.setImmediate ? setImmediate(c) : setTimeout(c, 0); } function ye(c, h) { if (typeof h == "string" && b(c, h)) return c[h]; if (!h) return c; if (typeof h != "string") { for (var g = [], _ = 0, S = h.length; _ < S; ++_) { var N = ye(c, h[_]); g.push(N); } return g; } var A = h.indexOf("."); if (A !== -1) { var I = c[h.substr(0, A)]; return I == null ? void 0 : ye(I, h.substr(A + 1)); } } function me(c, h, g) { if (c && h !== void 0 && !("isFrozen" in Object && Object.isFrozen(c))) if (typeof h != "string" && "length" in h) { ne(typeof g != "string" && "length" in g); for (var _ = 0, S = h.length; _ < S; ++_) me(c, h[_], g[_]); } else { var N, A, I = h.indexOf("."); I !== -1 ? (N = h.substr(0, I), (A = h.substr(I + 1)) === "" ? g === void 0 ? f(c) && !isNaN(parseInt(N)) ? c.splice(N, 1) : delete c[N] : c[N] = g : me(I = !(I = c[N]) || !b(c, N) ? c[N] = {} : I, A, g)) : g === void 0 ? f(c) && !isNaN(parseInt(h)) ? c.splice(h, 1) : delete c[h] : c[h] = g; } } function Fe(c) { var h, g = {}; for (h in c) b(c, h) && (g[h] = c[h]); return g; } var Re = [].concat; function ut(c) { return Re.apply([], c); } var Dn = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ut([8, 16, 32, 64].map(function(c) { return ["Int", "Uint", "Float"].map(function(h) { return h + c + "Array"; }); }))).filter(function(c) { return a[c]; }), He = new Set(Dn.map(function(c) { return a[c]; })), We = null; function ot(c) { return We = /* @__PURE__ */ new WeakMap(), c = function h(g) { if (!g || typeof g != "object") return g; var _ = We.get(g); if (_) return _; if (f(g)) { _ = [], We.set(g, _); for (var S = 0, N = g.length; S < N; ++S) _.push(h(g[S])); } else if (He.has(g.constructor)) _ = g; else { var A, I = v(g); for (A in _ = I === Object.prototype ? {} : Object.create(I), We.set(g, _), g) b(g, A) && (_[A] = h(g[A])); } return _; }(c), We = null, c; } var W = {}.toString; function L(c) { return W.call(c).slice(8, -1); } var oe = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", ge = typeof oe == "symbol" ? function(c) { var h; return c != null && (h = c[oe]) && h.apply(c); } : function() { return null; }; function te(c, h) { return h = c.indexOf(h), 0 <= h && c.splice(h, 1), 0 <= h; } var ue = {}; function M(c) { var h, g, _, S; if (arguments.length === 1) { if (f(c)) return c.slice(); if (this === ue && typeof c == "string") return [c]; if (S = ge(c)) { for (g = []; !(_ = S.next()).done; ) g.push(_.value); return g; } if (c == null) return [c]; if (typeof (h = c.length) != "number") return [c]; for (g = new Array(h); h--; ) g[h] = c[h]; return g; } for (h = arguments.length, g = new Array(h); h--; ) g[h] = arguments[h]; return g; } var D = typeof Symbol < "u" ? function(c) { return c[Symbol.toStringTag] === "AsyncFunction"; } : function() { return !1; }, vr = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], Un = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(vr), ae = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" }; function Ve(c, h) { this.name = c, this.message = h; } function F(c, h) { return c + ". Errors: " + Object.keys(h).map(function(g) { return h[g].toString(); }).filter(function(g, _, S) { return S.indexOf(g) === _; }).join(` `); } function Y(c, h, g, _) { this.failures = h, this.failedKeys = _, this.successCount = g, this.message = F(c, h); } function nt(c, h) { this.name = "BulkError", this.failures = Object.keys(h).map(function(g) { return h[g]; }), this.failuresByPos = h, this.message = F(c, this.failures); } x(Ve).from(Error).extend({ toString: function() { return this.name + ": " + this.message; } }), x(Y).from(Ve), x(nt).from(Ve); var Te = Un.reduce(function(c, h) { return c[h] = h + "Error", c; }, {}), ze = Ve, Ce = Un.reduce(function(c, h) { var g = h + "Error"; function _(S, N) { this.name = g, S ? typeof S == "string" ? (this.message = "".concat(S).concat(N ? ` ` + N : ""), this.inner = N || null) : typeof S == "object" && (this.message = "".concat(S.name, " ").concat(S.message), this.inner = S) : (this.message = ae[h] || g, this.inner = null); } return x(_).from(ze), c[h] = _, c; }, {}); Ce.Syntax = SyntaxError, Ce.Type = TypeError, Ce.Range = RangeError; var kt = vr.reduce(function(c, h) { return c[h + "Error"] = Ce[h], c; }, {}), wt = Un.reduce(function(c, h) { return ["Syntax", "Type", "Range"].indexOf(h) === -1 && (c[h + "Error"] = Ce[h]), c; }, {}); function et() { } function tn(c) { return c; } function Bt(c, h) { return c == null || c === tn ? h : function(g) { return h(c(g)); }; } function Ze(c, h) { return function() { c.apply(this, arguments), h.apply(this, arguments); }; } function Yt(c, h) { return c === et ? h : function() { var g = c.apply(this, arguments); g !== void 0 && (arguments[0] = g); var _ = this.onsuccess, S = this.onerror; this.onsuccess = null, this.onerror = null; var N = h.apply(this, arguments); return _ && (this.onsuccess = this.onsuccess ? Ze(_, this.onsuccess) : _), S && (this.onerror = this.onerror ? Ze(S, this.onerror) : S), N !== void 0 ? N : g; }; } function Lt(c, h) { return c === et ? h : function() { c.apply(this, arguments); var g = this.onsuccess, _ = this.onerror; this.onsuccess = this.onerror = null, h.apply(this, arguments), g && (this.onsuccess = this.onsuccess ? Ze(g, this.onsuccess) : g), _ && (this.onerror = this.onerror ? Ze(_, this.onerror) : _); }; } function $e(c, h) { return c === et ? h : function(g) { var _ = c.apply(this, arguments); p(g, _); var S = this.onsuccess, N = this.onerror; return this.onsuccess = null, this.onerror = null, g = h.apply(this, arguments), S && (this.onsuccess = this.onsuccess ? Ze(S, this.onsuccess) : S), N && (this.onerror = this.onerror ? Ze(N, this.onerror) : N), _ === void 0 ? g === void 0 ? void 0 : g : p(_, g); }; } function Et(c, h) { return c === et ? h : function() { return h.apply(this, arguments) !== !1 && c.apply(this, arguments); }; } function Oe(c, h) { return c === et ? h : function() { var g = c.apply(this, arguments); if (g && typeof g.then == "function") { for (var _ = this, S = arguments.length, N = new Array(S); S--; ) N[S] = arguments[S]; return g.then(function() { return h.apply(_, N); }); } return h.apply(this, arguments); }; } wt.ModifyError = Y, wt.DexieError = Ve, wt.BulkError = nt; var tt = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href); function Rt(c) { tt = c; } var Kt = {}, Vt = 100, Dn = typeof Promise > "u" ? [] : function() { var c = Promise.resolve(); if (typeof crypto > "u" || !crypto.subtle) return [c, v(c), c]; var h = crypto.subtle.digest("SHA-512", new Uint8Array([0])); return [h, v(h), c]; }(), vr = Dn[0], Un = Dn[1], Dn = Dn[2], Un = Un && Un.then, Lr = vr && vr.constructor, hs = !!Dn, ps = function(c, h) { Ti.push([c, h]), ri && (queueMicrotask(ic), ri = !1); }, Ci = !0, ri = !0, Oi = [], ao = [], ua = tn, ii = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: et, pgp: !1, env: {}, finalize: et }, Ye = ii, Ti = [], Dr = 0, ms = []; function je(c) { if (typeof this != "object") throw new TypeError("Promises must be constructed via new"); this._listeners = [], this._lib = !1; var h = this._PSD = Ye; if (typeof c != "function") { if (c !== Kt) throw new TypeError("Not a function"); return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && la(this, this._value)); } this._state = null, this._value = null, ++h.ref, function g(_, S) { try { S(function(N) { if (_._state === null) { if (N === _) throw new TypeError("A promise cannot be resolved with itself."); var A = _._lib && oi(); N && typeof N.then == "function" ? g(_, function(I, U) { N instanceof je ? N._then(I, U) : N.then(I, U); }) : (_._state = !0, _._value = N, Eu(_)), A && Ii(); } }, la.bind(null, _)); } catch (N) { la(_, N); } }(this, c); } var si = { get: function() { var c = Ye, h = ys; function g(_, S) { var N = this, A = !c.global && (c !== Ye || h !== ys), I = A && !Nn(), U = new je(function(V, K) { ca(N, new Ri(Au(_, c, A, I), Au(S, c, A, I), V, K, c)); }); return this._consoleTask && (U._consoleTask = this._consoleTask), U; } return g.prototype = Kt, g; }, set: function(c) { O(this, "then", c && c.prototype === Kt ? si : { get: function() { return c; }, set: si.set }); } }; function Ri(c, h, g, _, S) { this.onFulfilled = typeof c == "function" ? c : null, this.onRejected = typeof h == "function" ? h : null, this.resolve = g, this.reject = _, this.psd = S; } function la(c, h) { var g, _; ao.push(h), c._state === null && (g = c._lib && oi(), h = ua(h), c._state = !1, c._value = h, _ = c, Oi.some(function(S) { return S._value === _._value; }) || Oi.push(_), Eu(c), g && Ii()); } function Eu(c) { var h = c._listeners; c._listeners = []; for (var g = 0, _ = h.length; g < _; ++g) ca(c, h[g]); var S = c._PSD; --S.ref || S.finalize(), Dr === 0 && (++Dr, ps(function() { --Dr == 0 && Pi(); }, [])); } function ca(c, h) { if (c._state !== null) { var g = c._state ? h.onFulfilled : h.onRejected; if (g === null) return (c._state ? h.resolve : h.reject)(c._value); ++h.psd.ref, ++Dr, ps(rc, [g, c, h]); } else c._listeners.push(h); } function rc(c, h, g) { try { var _, S = h._value; !h._state && ao.length && (ao = []), _ = tt && h._consoleTask ? h._consoleTask.run(function() { return c(S); }) : c(S), h._state || ao.indexOf(S) !== -1 || function(N) { for (var A = Oi.length; A; ) if (Oi[--A]._value === N._value) return Oi.splice(A, 1); }(h), g.resolve(_); } catch (N) { g.reject(N); } finally { --Dr == 0 && Pi(), --g.psd.ref || g.psd.finalize(); } } function ic() { li(ii, function() { oi() && Ii(); }); } function oi() { var c = Ci; return ri = Ci = !1, c; } function Ii() { var c, h, g; do for (; 0 < Ti.length; ) for (c = Ti, Ti = [], g = c.length, h = 0; h < g; ++h) { var _ = c[h]; _[0].apply(null, _[1]); } while (0 < Ti.length); ri = Ci = !0; } function Pi() { var c = Oi; Oi = [], c.forEach(function(_) { _._PSD.onunhandled.call(null, _._value, _); }); for (var h = ms.slice(0), g = h.length; g; ) h[--g](); } function gs(c) { return new je(Kt, !1, c); } function It(c, h) { var g = Ye; return function() { var _ = oi(), S = Ye; try { return ui(g, !0), c.apply(this, arguments); } catch (N) { h && h(N); } finally { ui(S, !1), _ && Ii(); } }; } w(je.prototype, { then: si, _then: function(c, h) { ca(this, new Ri(null, null, c, h, Ye)); }, catch: function(c) { if (arguments.length === 1) return this.then(null, c); var h = c, g = arguments[1]; return typeof h == "function" ? this.then(null, function(_) { return (_ instanceof h ? g : gs)(_); }) : this.then(null, function(_) { return (_ && _.name === h ? g : gs)(_); }); }, finally: function(c) { return this.then(function(h) { return je.resolve(c()).then(function() { return h; }); }, function(h) { return je.resolve(c()).then(function() { return gs(h); }); }); }, timeout: function(c, h) { var g = this; return c < 1 / 0 ? new je(function(_, S) { var N = setTimeout(function() { return S(new Ce.Timeout(h)); }, c); g.then(_, S).finally(clearTimeout.bind(null, N)); }) : this; } }), typeof Symbol < "u" && Symbol.toStringTag && O(je.prototype, Symbol.toStringTag, "Dexie.Promise"), ii.env = Nu(), w(je, { all: function() { var c = M.apply(null, arguments).map(lo); return new je(function(h, g) { c.length === 0 && h([]); var _ = c.length; c.forEach(function(S, N) { return je.resolve(S).then(function(A) { c[N] = A, --_ || h(c); }, g); }); }); }, resolve: function(c) { return c instanceof je ? c : c && typeof c.then == "function" ? new je(function(h, g) { c.then(h, g); }) : new je(Kt, !0, c); }, reject: gs, race: function() { var c = M.apply(null, arguments).map(lo); return new je(function(h, g) { c.map(function(_) { return je.resolve(_).then(h, g); }); }); }, PSD: { get: function() { return Ye; }, set: function(c) { return Ye = c; } }, totalEchoes: { get: function() { return ys; } }, newPSD: ai, usePSD: li, scheduler: { get: function() { return ps; }, set: function(c) { ps = c; } }, rejectionMapper: { get: function() { return ua; }, set: function(c) { ua = c; } }, follow: function(c, h) { return new je(function(g, _) { return ai(function(S, N) { var A = Ye; A.unhandleds = [], A.onunhandled = N, A.finalize = Ze(function() { var I, U = this; I = function() { U.unhandleds.length === 0 ? S() : N(U.unhandleds[0]); }, ms.push(function V() { I(), ms.splice(ms.indexOf(V), 1); }), ++Dr, ps(function() { --Dr == 0 && Pi(); }, []); }, A.finalize), c(); }, h, g, _); }); } }), Lr && (Lr.allSettled && O(je, "allSettled", function() { var c = M.apply(null, arguments).map(lo); return new je(function(h) { c.length === 0 && h([]); var g = c.length, _ = new Array(g); c.forEach(function(S, N) { return je.resolve(S).then(function(A) { return _[N] = { status: "fulfilled", value: A }; }, function(A) { return _[N] = { status: "rejected", reason: A }; }).then(function() { return --g || h(_); }); }); }); }), Lr.any && typeof AggregateError < "u" && O(je, "any", function() { var c = M.apply(null, arguments).map(lo); return new je(function(h, g) { c.length === 0 && g(new AggregateError([])); var _ = c.length, S = new Array(_); c.forEach(function(N, A) { return je.resolve(N).then(function(I) { return h(I); }, function(I) { S[A] = I, --_ || g(new AggregateError(S)); }); }); }); }), Lr.withResolvers && (je.withResolvers = Lr.withResolvers)); var an = { awaits: 0, echoes: 0, id: 0 }, uo = 0, Li = [], Di = 0, ys = 0, Wf = 0; function ai(c, h, g, _) { var S = Ye, N = Object.create(S); return N.parent = S, N.ref = 0, N.global = !1, N.id = ++Wf, ii.env, N.env = hs ? { Promise: je, PromiseProp: { value: je, configurable: !0, writable: !0 }, all: je.all, race: je.race, allSettled: je.allSettled, any: je.any, resolve: je.resolve, reject: je.reject } : {}, h && p(N, h), ++S.ref, N.finalize = function() { --this.parent.ref || this.parent.finalize(); }, _ = li(N, c, g, _), N.ref === 0 && N.finalize(), _; } function vs() { return an.id || (an.id = ++uo), ++an.awaits, an.echoes += Vt, an.id; } function Nn() { return !!an.awaits && (--an.awaits == 0 && (an.id = 0), an.echoes = an.awaits * Vt, !0); } function lo(c) { return an.echoes && c && c.constructor === Lr ? (vs(), c.then(function(h) { return Nn(), h; }, function(h) { return Nn(), Xt(h); })) : c; } function sc() { var c = Li[Li.length - 1]; Li.pop(), ui(c, !1); } function ui(c, h) { var g, _ = Ye; (h ? !an.echoes || Di++ && c === Ye : !Di || --Di && c === Ye) || queueMicrotask(h ? (function(S) { ++ys, an.echoes && --an.echoes != 0 || (an.echoes = an.awaits = an.id = 0), Li.push(Ye), ui(S, !0); }).bind(null, c) : sc), c !== Ye && (Ye = c, _ === ii && (ii.env = Nu()), hs && (g = ii.env.Promise, h = c.env, (_.global || c.global) && (Object.defineProperty(a, "Promise", h.PromiseProp), g.all = h.all, g.race = h.race, g.resolve = h.resolve, g.reject = h.reject, h.allSettled && (g.allSettled = h.allSettled), h.any && (g.any = h.any)))); } function Nu() { var c = a.Promise; return hs ? { Promise: c, PromiseProp: Object.getOwnPropertyDescriptor(a, "Promise"), all: c.all, race: c.race, allSettled: c.allSettled, any: c.any, resolve: c.resolve, reject: c.reject } : {}; } function li(c, h, g, _, S) { var N = Ye; try { return ui(c, !0), h(g, _, S); } finally { ui(N, !1); } } function Au(c, h, g, _) { return typeof c != "function" ? c : function() { var S = Ye; g && vs(), ui(h, !0); try { return c.apply(this, arguments); } finally { ui(S, !1), _ && queueMicrotask(Nn); } }; } function da(c) { Promise === Lr && an.echoes === 0 ? Di === 0 ? c() : enqueueNativeMicroTask(c) : setTimeout(c, 0); } ("" + Un).indexOf("[native code]") === -1 && (vs = Nn = et); var Xt = je.reject, Fi = "ï¿¿", Ot = "Invalid key provided. Keys must be of type string, number, Date or Array.", oc = "String expected.", ci = [], co = "__dbnames", ks = "readonly", xu = "readwrite"; function di(c, h) { return c ? h ? function() { return c.apply(this, arguments) && h.apply(this, arguments); } : c : h; } var fo = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 }; function Fn(c) { return typeof c != "string" || /\./.test(c) ? function(h) { return h; } : function(h) { return h[c] === void 0 && c in h && delete (h = ot(h))[c], h; }; } function ac() { throw Ce.Type(); } function lt(c, h) { try { var g = uc(c), _ = uc(h); if (g !== _) return g === "Array" ? 1 : _ === "Array" ? -1 : g === "binary" ? 1 : _ === "binary" ? -1 : g === "string" ? 1 : _ === "string" ? -1 : g === "Date" ? 1 : _ !== "Date" ? NaN : -1; switch (g) { case "number": case "Date": case "string": return h < c ? 1 : c < h ? -1 : 0; case "binary": return function(S, N) { for (var A = S.length, I = N.length, U = A < I ? A : I, V = 0; V < U; ++V) if (S[V] !== N[V]) return S[V] < N[V] ? -1 : 1; return A === I ? 0 : A < I ? -1 : 1; }(lc(c), lc(h)); case "Array": return function(S, N) { for (var A = S.length, I = N.length, U = A < I ? A : I, V = 0; V < U; ++V) { var K = lt(S[V], N[V]); if (K !== 0) return K; } return A === I ? 0 : A < I ? -1 : 1; }(c, h); } } catch { } return NaN; } function uc(c) { var h = typeof c; return h != "object" ? h : ArrayBuffer.isView(c) ? "binary" : (c = L(c), c === "ArrayBuffer" ? "binary" : c); } function lc(c) { return c instanceof Uint8Array ? c : ArrayBuffer.isView(c) ? new Uint8Array(c.buffer, c.byteOffset, c.byteLength) : new Uint8Array(c); } var cc = (Pt.prototype._trans = function(c, h, g) { var _ = this._tx || Ye.trans, S = this.name, N = tt && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(c === "readonly" ? "read" : "write", " ").concat(this.name)); function A(V, K, P) { if (!P.schema[S]) throw new Ce.NotFound("Table " + S + " not part of transaction"); return h(P.idbtrans, P); } var I = oi(); try { var U = _ && _.db._novip === this.db._novip ? _ === Ye.trans ? _._promise(c, A, g) : ai(function() { return _._promise(c, A, g); }, { trans: _, transless: Ye.transless || Ye }) : function V(K, P, G, B) { if (K.idbdb && (K._state.openComplete || Ye.letThrough || K._vip)) { var q = K._createTransaction(P, G, K._dbSchema); try { q.create(), K._state.PR1398_maxLoop = 3; } catch (Q) { return Q.name === Te.InvalidState && K.isOpen() && 0 < --K._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), K.close({ disableAutoOpen: !1 }), K.open().then(function() { return V(K, P, G, B); })) : Xt(Q); } return q._promise(P, function(Q, H) { return ai(function() { return Ye.trans = q, B(Q, H, q); }); }).then(function(Q) { if (P === "readwrite") try { q.idbtrans.commit(); } catch { } return P === "readonly" ? Q : q._completion.then(function() { return Q; }); }); } if (K._state.openComplete) return Xt(new Ce.DatabaseClosed(K._state.dbOpenError)); if (!K._state.isBeingOpened) { if (!K._state.autoOpen) return Xt(new Ce.DatabaseClosed()); K.open().catch(et); } return K._state.dbReadyPromise.then(function() { return V(K, P, G, B); }); }(this.db, c, [this.name], A); return N && (U._consoleTask = N, U = U.catch(function(V) { return console.trace(V), Xt(V); })), U; } finally { I && Ii(); } }, Pt.prototype.get = function(c, h) { var g = this; return c && c.constructor === Object ? this.where(c).first(h) : c == null ? Xt(new Ce.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(_) { return g.core.get({ trans: _, key: c }).then(function(S) { return g.hook.reading.fire(S); }); }).then(h); }, Pt.prototype.where = function(c) { if (typeof c == "string") return new this.db.WhereClause(this, c); if (f(c)) return new this.db.WhereClause(this, "[".concat(c.join("+"), "]")); var h = l(c); if (h.length === 1) return this.where(h[0]).equals(c[h[0]]); var g = this.schema.indexes.concat(this.schema.primKey).filter(function(I) { if (I.compound && h.every(function(V) { return 0 <= I.keyPath.indexOf(V); })) { for (var U = 0; U < h.length; ++U) if (h.indexOf(I.keyPath[U]) === -1) return !1; return !0; } return !1; }).sort(function(I, U) { return I.keyPath.length - U.keyPath.length; })[0]; if (g && this.db._maxKey !== Fi) { var N = g.keyPath.slice(0, h.length); return this.where(N).equals(N.map(function(U) { return c[U]; })); } !g && tt && console.warn("The query ".concat(JSON.stringify(c), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(h.join("+"), "]")); var _ = this.schema.idxByName; function S(I, U) { return lt(I, U) === 0; } var A = h.reduce(function(P, U) { var V = P[0], K = P[1], P = _[U], G = c[U]; return [V || P, V || !P ? di(K, P && P.multi ? function(B) { return B = ye(B, U), f(B) && B.some(function(q) { return S(G, q); }); } : function(B) { return S(G, ye(B, U)); }) : K]; }, [null, null]), N = A[0], A = A[1]; return N ? this.where(N.name).equals(c[N.keyPath]).filter(A) : g ? this.filter(A) : this.where(h).equals(""); }, Pt.prototype.filter = function(c) { return this.toCollection().and(c); }, Pt.prototype.count = function(c) { return this.toCollection().count(c); }, Pt.prototype.offset = function(c) { return this.toCollection().offset(c); }, Pt.prototype.limit = function(c) { return this.toCollection().limit(c); }, Pt.prototype.each = function(c) { return this.toCollection().each(c); }, Pt.prototype.toArray = function(c) { return this.toCollection().toArray(c); }, Pt.prototype.toCollection = function() { return new this.db.Collection(new this.db.WhereClause(this)); }, Pt.prototype.orderBy = function(c) { return new this.db.Collection(new this.db.WhereClause(this, f(c) ? "[".concat(c.join("+"), "]") : c)); }, Pt.prototype.reverse = function() { return this.toCollection().reverse(); }, Pt.prototype.mapToClass = function(c) { var h, g = this.db, _ = this.name; function S() { return h !== null && h.apply(this, arguments) || this; } (this.schema.mappedClass = c).prototype instanceof ac && (function(U, V) { if (typeof V != "function" && V !== null) throw new TypeError("Class extends value " + String(V) + " is not a constructor or null"); function K() { this.constructor = U; } n(U, V), U.prototype = V === null ? Object.create(V) : (K.prototype = V.prototype, new K()); }(S, h = c), Object.defineProperty(S.prototype, "db", { get: function() { return g; }, enumerable: !1, configurable: !0 }), S.prototype.table = function() { return _; }, c = S); for (var N = /* @__PURE__ */ new Set(), A = c.prototype; A; A = v(A)) Object.getOwnPropertyNames(A).forEach(function(U) { return N.add(U); }); function I(U) { if (!U) return U; var V, K = Object.create(c.prototype); for (V in U) if (!N.has(V)) try { K[V] = U[V]; } catch { } return K; } return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = I, this.hook("reading", I), c; }, Pt.prototype.defineClass = function() { return this.mapToClass(function(c) { p(this, c); }); }, Pt.prototype.add = function(c, h) { var g = this, _ = this.schema.primKey, S = _.auto, N = _.keyPath, A = c; return N && S && (A = Fn(N)(c)), this._trans("readwrite", function(I) { return g.core.mutate({ trans: I, type: "add", keys: h != null ? [h] : null, values: [A] }); }).then(function(I) { return I.numFailures ? je.reject(I.failures[0]) : I.lastResult; }).then(function(I) { if (N) try { me(c, N, I); } catch { } return I; }); }, Pt.prototype.update = function(c, h) { return typeof c != "object" || f(c) ? this.where(":id").equals(c).modify(h) : (c = ye(c, this.schema.primKey.keyPath), c === void 0 ? Xt(new Ce.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(c).modify(h)); }, Pt.prototype.put = function(c, h) { var g = this, _ = this.schema.primKey, S = _.auto, N = _.keyPath, A = c; return N && S && (A = Fn(N)(c)), this._trans("readwrite", function(I) { return g.core.mutate({ trans: I, type: "put", values: [A], keys: h != null ? [h] : null }); }).then(function(I) { return I.numFailures ? je.reject(I.failures[0]) : I.lastResult; }).then(function(I) { if (N) try { me(c, N, I); } catch { } return I; }); }, Pt.prototype.delete = function(c) { var h = this; return this._trans("readwrite", function(g) { return h.core.mutate({ trans: g, type: "delete", keys: [c] }); }).then(function(g) { return g.numFailures ? je.reject(g.failures[0]) : void 0; }); }, Pt.prototype.clear = function() { var c = this; return this._trans("readwrite", function(h) { return c.core.mutate({ trans: h, type: "deleteRange", range: fo }); }).then(function(h) { return h.numFailures ? je.reject(h.failures[0]) : void 0; }); }, Pt.prototype.bulkGet = function(c) { var h = this; return this._trans("readonly", function(g) { return h.core.getMany({ keys: c, trans: g }).then(function(_) { return _.map(function(S) { return h.hook.reading.fire(S); }); }); }); }, Pt.prototype.bulkAdd = function(c, h, g) { var _ = this, S = Array.isArray(h) ? h : void 0, N = (g = g || (S ? void 0 : h)) ? g.allKeys : void 0; return this._trans("readwrite", function(A) { var V = _.schema.primKey, I = V.auto, V = V.keyPath; if (V && S) throw new Ce.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys"); if (S && S.length !== c.length) throw new Ce.InvalidArgument("Arguments objects and keys must have the same length"); var U = c.length, V = V && I ? c.map(Fn(V)) : c; return _.core.mutate({ trans: A, type: "add", keys: S, values: V, wantResults: N }).then(function(q) { var P = q.numFailures, G = q.results, B = q.lastResult, q = q.failures; if (P === 0) return N ? G : B; throw new nt("".concat(_.name, ".bulkAdd(): ").concat(P, " of ").concat(U, " operations failed"), q); }); }); }, Pt.prototype.bulkPut = function(c, h, g) { var _ = this, S = Array.isArray(h) ? h : void 0, N = (g = g || (S ? void 0 : h)) ? g.allKeys : void 0; return this._trans("readwrite", function(A) { var V = _.schema.primKey, I = V.auto, V = V.keyPath; if (V && S) throw new Ce.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys"); if (S && S.length !== c.length) throw new Ce.InvalidArgument("Arguments objects and keys must have the same length"); var U = c.length, V = V && I ? c.map(Fn(V)) : c; return _.core.mutate({ trans: A, type: "put", keys: S, values: V, wantResults: N }).then(function(q) { var P = q.numFailures, G = q.results, B = q.lastResult, q = q.failures; if (P === 0) return N ? G : B; throw new nt("".concat(_.name, ".bulkPut(): ").concat(P, " of ").concat(U, " operations failed"), q); }); }); }, Pt.prototype.bulkUpdate = function(c) { var h = this, g = this.core, _ = c.map(function(A) { return A.key; }), S = c.map(function(A) { return A.changes; }), N = []; return this._trans("readwrite", function(A) { return g.getMany({ trans: A, keys: _, cache: "clone" }).then(function(I) { var U = [], V = []; c.forEach(function(P, G) { var B = P.key, q = P.changes, Q = I[G]; if (Q) { for (var H = 0, Z = Object.keys(q); H < Z.length; H++) { var ie = Z[H], se = q[ie]; if (ie === h.schema.primKey.keyPath) { if (lt(se, B) !== 0) throw new Ce.Constraint("Cannot update primary key in bulkUpdate()"); } else me(Q, ie, se); } N.push(G), U.push(B), V.push(Q); } }); var K = U.length; return g.mutate({ trans: A, type: "put", keys: U, values: V, updates: { keys: _, changeSpecs: S } }).then(function(P) { var G = P.numFailures, B = P.failures; if (G === 0) return K; for (var q = 0, Q = Object.keys(B); q < Q.length; q++) { var H, Z = Q[q], ie = N[Number(Z)]; ie != null && (H = B[Z], delete B[Z], B[ie] = H); } throw new nt("".concat(h.name, ".bulkUpdate(): ").concat(G, " of ").concat(K, " operations failed"), B); }); }); }); }, Pt.prototype.bulkDelete = function(c) { var h = this, g = c.length; return this._trans("readwrite", function(_) { return h.core.mutate({ trans: _, type: "delete", keys: c }); }).then(function(A) { var S = A.numFailures, N = A.lastResult, A = A.failures; if (S === 0) return N; throw new nt("".concat(h.name, ".bulkDelete(): ").concat(S, " of ").concat(g, " operations failed"), A); }); }, Pt); function Pt() { } function fi(c) { function h(A, I) { if (I) { for (var U = arguments.length, V = new Array(U - 1); --U; ) V[U - 1] = arguments[U]; return g[A].subscribe.apply(null, V), c; } if (typeof A == "string") return g[A]; } var g = {}; h.addEventType = N; for (var _ = 1, S = arguments.length; _ < S; ++_) N(arguments[_]); return h; function N(A, I, U) { if (typeof A != "object") { var V; I = I || Et; var K = { subscribers: [], fire: U = U || et, subscribe: function(P) { K.subscribers.indexOf(P) === -1 && (K.subscribers.push(P), K.fire = I(K.fire, P)); }, unsubscribe: function(P) { K.subscribers = K.subscribers.filter(function(G) { return G !== P; }), K.fire = K.subscribers.reduce(I, U); } }; return g[A] = h[A] = K; } l(V = A).forEach(function(P) { var G = V[P]; if (f(G)) N(P, V[P][0], V[P][1]); else { if (G !== "asap") throw new Ce.InvalidArgument("Invalid event config"); var B = N(P, tn, function() { for (var q = arguments.length, Q = new Array(q); q--; ) Q[q] = arguments[q]; B.subscribers.forEach(function(H) { he(function() { H.apply(null, Q); }); }); }); } }); } } function Fr(c, h) { return x(h).from({ prototype: c }), h; } function Mr(c, h) { return !(c.filter || c.algorithm || c.or) && (h ? c.justLimit : !c.replayFilter); } function Cu(c, h) { c.filter = di(c.filter, h); } function Ou(c, h, g) { var _ = c.replayFilter; c.replayFilter = _ ? function() { return di(_(), h()); } : h, c.justLimit = g && !_; } function _s(c, h) { if (c.isPrimKey) return h.primaryKey; var g = h.getIndexByKeyPath(c.index); if (!g) throw new Ce.Schema("KeyPath " + c.index + " on object store " + h.name + " is not indexed"); return g; } function Tu(c, h, g) { var _ = _s(c, h.schema); return h.openCursor({ trans: g, values: !c.keysOnly, reverse: c.dir === "prev", unique: !!c.unique, query: { index: _, range: c.range } }); } function ws(c, h, g, _) { var S = c.replayFilter ? di(c.filter, c.replayFilter()) : c.filter; if (c.or) { var N = {}, A = function(I, U, V) { var K, P; S && !S(U, V, function(G) { return U.stop(G); }, function(G) { return U.fail(G); }) || ((P = "" + (K = U.primaryKey)) == "[object ArrayBuffer]" && (P = "" + new Uint8Array(K)), b(N, P) || (N[P] = !0, h(I, U, V))); }; return Promise.all([c.or._iterate(A, g), Ss(Tu(c, _, g), c.algorithm, A, !c.keysOnly && c.valueMapper)]); } return Ss(Tu(c, _, g), di(c.algorithm, S), h, !c.keysOnly && c.valueMapper); } function Ss(c, h, g, _) { var S = It(_ ? function(N, A, I) { return g(_(N), A, I); } : g); return c.then(function(N) { if (N) return N.start(function() { var A = function() { return N.continue(); }; h && !h(N, function(I) { return A = I; }, function(I) { N.stop(I), A = et; }, function(I) { N.fail(I), A = et; }) || S(N.value, N, function(I) { return A = I; }), A(); }); }); } var ho = (fa.prototype.execute = function(c) { var h = this["@@propmod"]; if (h.add !== void 0) { var g = h.add; if (f(g)) return o(o([], f(c) ? c : [], !0), g).sort(); if (typeof g == "number") return (Number(c) || 0) + g; if (typeof g == "bigint") try { return BigInt(c) + g; } catch { return BigInt(0) + g; } throw new TypeError("Invalid term ".concat(g)); } if (h.remove !== void 0) { var _ = h.remove; if (f(_)) return f(c) ? c.filter(function(S) { return !_.includes(S); }).sort() : []; if (typeof _ == "number") return Number(c) - _; if (typeof _ == "bigint") try { return BigInt(c) - _; } catch { return BigInt(0) - _; } throw new TypeError("Invalid subtrahend ".concat(_)); } return g = (g = h.replacePrefix) === null || g === void 0 ? void 0 : g[0], g && typeof c == "string" && c.startsWith(g) ? h.replacePrefix[1] + c.substring(g.length) : c; }, fa); function fa(c) { this["@@propmod"] = c; } var Tt = (bt.prototype._read = function(c, h) { var g = this._ctx; return g.error ? g.table._trans(null, Xt.bind(null, g.error)) : g.table._trans("readonly", c).then(h); }, bt.prototype._write = function(c) { var h = this._ctx; return h.error ? h.table._trans(null, Xt.bind(null, h.error)) : h.table._trans("readwrite", c, "locked"); }, bt.prototype._addAlgorithm = function(c) { var h = this._ctx; h.algorithm = di(h.algorithm, c); }, bt.prototype._iterate = function(c, h) { return ws(this._ctx, c, h, this._ctx.table.core); }, bt.prototype.clone = function(c) { var h = Object.create(this.constructor.prototype), g = Object.create(this._ctx); return c && p(g, c), h._ctx = g, h; }, bt.prototype.raw = function() { return this._ctx.valueMapper = null, this; }, bt.prototype.each = function(c) { var h = this._ctx; return this._read(function(g) { return ws(h, c, g, h.table.core); }); }, bt.prototype.count = function(c) { var h = this; return this._read(function(g) { var _ = h._ctx, S = _.table.core; if (Mr(_, !0)) return S.count({ trans: g, query: { index: _s(_, S.schema), range: _.range } }).then(function(A) { return Math.min(A, _.limit); }); var N = 0; return ws(_, function() { return ++N, !1; }, g, S).then(function() { return N; }); }).then(c); }, bt.prototype.sortBy = function(c, h) { var g = c.split(".").reverse(), _ = g[0], S = g.length - 1; function N(U, V) { return V ? N(U[g[V]], V - 1) : U[_]; } var A = this._ctx.dir === "next" ? 1 : -1; function I(U, V) { return lt(N(U, S), N(V, S)) * A; } return this.toArray(function(U) { return U.sort(I); }).then(h); }, bt.prototype.toArray = function(c) { var h = this; return this._read(function(g) { var _ = h._ctx; if (_.dir === "next" && Mr(_, !0) && 0 < _.limit) { var S = _.valueMapper, N = _s(_, _.table.core.schema); return _.table.core.query({ trans: g, limit: _.limit, values: !0, query: { index: N, range: _.range } }).then(function(I) { return I = I.result, S ? I.map(S) : I; }); } var A = []; return ws(_, function(I) { return A.push(I); }, g, _.table.core).then(function() { return A; }); }, c); }, bt.prototype.offset = function(c) { var h = this._ctx; return c <= 0 || (h.offset += c, Mr(h) ? Ou(h, function() { var g = c; return function(_, S) { return g === 0 || (g === 1 ? --g : S(function() { _.advance(g), g = 0; }), !1); }; }) : Ou(h, function() { var g = c; return function() { return --g < 0; }; })), this; }, bt.prototype.limit = function(c) { return this._ctx.limit = Math.min(this._ctx.limit, c), Ou(this._ctx, function() { var h = c; return function(g, _, S) { return --h <= 0 && _(S), 0 <= h; }; }, !0), this; }, bt.prototype.until = function(c, h) { return Cu(this._ctx, function(g, _, S) { return !c(g.value) || (_(S), h); }), this; }, bt.prototype.first = function(c) { return this.limit(1).toArray(function(h) { return h[0]; }).then(c); }, bt.prototype.last = function(c) { return this.reverse().first(c); }, bt.prototype.filter = function(c) { var h; return Cu(this._ctx, function(g) { return c(g.value); }), (h = this._ctx).isMatch = di(h.isMatch, c), this; }, bt.prototype.and = function(c) { return this.filter(c); }, bt.prototype.or = function(c) { return new this.db.WhereClause(this._ctx.table, c, this); }, bt.prototype.reverse = function() { return this._ctx.dir = this._ctx.dir === "prev" ? "next" : "prev", this._ondirectionchange && this._ondirectionchange(this._ctx.dir), this; }, bt.prototype.desc = function() { return this.reverse(); }, bt.prototype.eachKey = function(c) { var h = this._ctx; return h.keysOnly = !h.isMatch, this.each(function(g, _) { c(_.key, _); }); }, bt.prototype.eachUniqueKey = function(c) { return this._ctx.unique = "unique", this.eachKey(c); }, bt.prototype.eachPrimaryKey = function(c) { var h = this._ctx; return h.keysOnly = !h.isMatch, this.each(function(g, _) { c(_.primaryKey, _); }); }, bt.prototype.keys = function(c) { var h = this._ctx; h.keysOnly = !h.isMatch; var g = []; return this.each(function(_, S) { g.push(S.key); }).then(function() { return g; }).then(c); }, bt.prototype.primaryKeys = function(c) { var h = this._ctx; if (h.dir === "next" && Mr(h, !0) && 0 < h.limit) return this._read(function(_) { var S = _s(h, h.table.core.schema); return h.table.core.query({ trans: _, values: !1, limit: h.limit, query: { index: S, range: h.range } }); }).then(function(_) { return _.result; }).then(c); h.keysOnly = !h.isMatch; var g = []; return this.each(function(_, S) { g.push(S.primaryKey); }).then(function() { return g; }).then(c); }, bt.prototype.uniqueKeys = function(c) { return this._ctx.unique = "unique", this.keys(c); }, bt.prototype.firstKey = function(c) { return this.limit(1).keys(function(h) { return h[0]; }).then(c); }, bt.prototype.lastKey = function(c) { return this.reverse().firstKey(c); }, bt.prototype.distinct = function() { var c = this._ctx, c = c.index && c.table.schema.idxByName[c.index]; if (!c || !c.multi) return this; var h = {}; return Cu(this._ctx, function(S) { var _ = S.primaryKey.toString(), S = b(h, _); return h[_] = !0, !S; }), this; }, bt.prototype.modify = function(c) { var h = this, g = this._ctx; return this._write(function(_) { var S, N, A; A = typeof c == "function" ? c : (S = l(c), N = S.length, function(H) { for (var Z = !1, ie = 0; ie < N; ++ie) { var se = S[ie], fe = c[se], Ae = ye(H, se); fe instanceof ho ? (me(H, se, fe.execute(Ae)), Z = !0) : Ae !== fe && (me(H, se, fe), Z = !0); } return Z; }); var I = g.table.core, P = I.schema.primaryKey, U = P.outbound, V = P.extractKey, K = 200, P = h.db._options.modifyChunkSize; P && (K = typeof P == "object" ? P[I.name] || P["*"] || 200 : P); function G(H, se) { var ie = se.failures, se = se.numFailures; q += H - se; for (var fe = 0, Ae = l(ie); fe < Ae.length; fe++) { var De = Ae[fe]; B.push(ie[De]); } } var B = [], q = 0, Q = []; return h.clone().primaryKeys().then(function(H) { function Z(se) { var fe = Math.min(K, H.length - se); return I.getMany({ trans: _, keys: H.slice(se, se + fe), cache: "immutable" }).then(function(Ae) { for (var De = [], xe = [], Ie = U ? [] : null, Me = [], Pe = 0; Pe < fe; ++Pe) { var Ue = Ae[Pe], ht = { value: ot(Ue), primKey: H[se + Pe] }; A.call(ht, ht.value, ht) !== !1 && (ht.value == null ? Me.push(H[se + Pe]) : U || lt(V(Ue), V(ht.value)) === 0 ? (xe.push(ht.value), U && Ie.push(H[se + Pe])) : (Me.push(H[se + Pe]), De.push(ht.value))); } return Promise.resolve(0 < De.length && I.mutate({ trans: _, type: "add", values: De }).then(function(mt) { for (var vt in mt.failures) Me.splice(parseInt(vt), 1); G(De.length, mt); })).then(function() { return (0 < xe.length || ie && typeof c == "object") && I.mutate({ trans: _, type: "put", keys: Ie, values: xe, criteria: ie, changeSpec: typeof c != "function" && c, isAdditionalChunk: 0 < se }).then(function(mt) { return G(xe.length, mt); }); }).then(function() { return (0 < Me.length || ie && c === ha) && I.mutate({ trans: _, type: "delete", keys: Me, criteria: ie, isAdditionalChunk: 0 < se }).then(function(mt) { return G(Me.length, mt); }); }).then(function() { return H.length > se + fe && Z(se + K); }); }); } var ie = Mr(g) && g.limit === 1 / 0 && (typeof c != "function" || c === ha) && { index: g.index, range: g.range }; return Z(0).then(function() { if (0 < B.length) throw new Y("Error modifying one or more objects", B, q, Q); return H.length; }); }); }); }, bt.prototype.delete = function() { var c = this._ctx, h = c.range; return Mr(c) && (c.isPrimKey || h.type === 3) ? this._write(function(g) { var _ = c.table.core.schema.primaryKey, S = h; return c.table.core.count({ trans: g, query: { index: _, range: S } }).then(function(N) { return c.table.core.mutate({ trans: g, type: "deleteRange", range: S }).then(function(A) { var I = A.failures; if (A.lastResult, A.results, A = A.numFailures, A) throw new Y("Could not delete some values", Object.keys(I).map(function(U) { return I[U]; }), N - A); return N - A; }); }); }) : this.modify(ha); }, bt); function bt() { } var ha = function(c, h) { return h.value = null; }; function Ru(c, h) { return c < h ? -1 : c === h ? 0 : 1; } function dc(c, h) { return h < c ? -1 : c === h ? 0 : 1; } function An(c, h, g) { return c = c instanceof jr ? new c.Collection(c) : c, c._ctx.error = new (g || TypeError)(h), c; } function Mi(c) { return new c.Collection(c, function() { return $r(""); }).limit(0); } function bs(c, h, g, _) { var S, N, A, I, U, V, K, P = g.length; if (!g.every(function(q) { return typeof q == "string"; })) return An(c, oc); function G(q) { S = q === "next" ? function(H) { return H.toUpperCase(); } : function(H) { return H.toLowerCase(); }, N = q === "next" ? function(H) { return H.toLowerCase(); } : function(H) { return H.toUpperCase(); }, A = q === "next" ? Ru : dc; var Q = g.map(function(H) { return { lower: N(H), upper: S(H) }; }).sort(function(H, Z) { return A(H.lower, Z.lower); }); I = Q.map(function(H) { return H.upper; }), U = Q.map(function(H) { return H.lower; }), K = (V = q) === "next" ? "" : _; } G("next"), c = new c.Collection(c, function() { return rr(I[0], U[P - 1] + _); }), c._ondirectionchange = function(q) { G(q); }; var B = 0; return c._addAlgorithm(function(q, Q, H) { var Z = q.key; if (typeof Z != "string") return !1; var ie = N(Z); if (h(ie, U, B)) return !0; for (var se = null, fe = B; fe < P; ++fe) { var Ae = function(De, xe, Ie, Me, Pe, Ue) { for (var ht = Math.min(De.length, Me.length), mt = -1, vt = 0; vt < ht; ++vt) { var Cn = xe[vt]; if (Cn !== Me[vt]) return Pe(De[vt], Ie[vt]) < 0 ? De.substr(0, vt) + Ie[vt] + Ie.substr(vt + 1) : Pe(De[vt], Me[vt]) < 0 ? De.substr(0, vt) + Me[vt] + Ie.substr(vt + 1) : 0 <= mt ? De.substr(0, mt) + xe[mt] + Ie.substr(mt + 1) : null; Pe(De[vt], Cn) < 0 && (mt = vt); } return ht < Me.length && Ue === "next" ? De + Ie.substr(De.length) : ht < De.length && Ue === "prev" ? De.substr(0, Ie.length) : mt < 0 ? null : De.substr(0, mt) + Me[mt] + Ie.substr(mt + 1); }(Z, ie, I[fe], U[fe], A, V); Ae === null && se === null ? B = fe + 1 : (se === null || 0 < A(se, Ae)) && (se = Ae); } return Q(se !== null ? function() { q.continue(se + K); } : H), !1; }), c; } function rr(c, h, g, _) { return { type: 2, lower: c, upper: h, lowerOpen: g, upperOpen: _ }; } function $r(c) { return { type: 1, lower: c, upper: c }; } var jr = (Object.defineProperty(Mt.prototype, "Collection", { get: function() { return this._ctx.table.db.Collection; }, enumerable: !1, configurable: !0 }), Mt.prototype.between = function(c, h, g, _) { g = g !== !1, _ = _ === !0; try { return 0 < this._cmp(c, h) || this._cmp(c, h) === 0 && (g || _) && (!g || !_) ? Mi(this) : new this.Collection(this, function() { return rr(c, h, !g, !_); }); } catch { return An(this, Ot); } }, Mt.prototype.equals = function(c) { return c == null ? An(this, Ot) : new this.Collection(this, function() { return $r(c); }); }, Mt.prototype.above = function(c) { return c == null ? An(this, Ot) : new this.Collection(this, function() { return rr(c, void 0, !0); }); }, Mt.prototype.aboveOrEqual = function(c) { return c == null ? An(this, Ot) : new this.Collection(this, function() { return rr(c, void 0, !1); }); }, Mt.prototype.below = function(c) { return c == null ? An(this, Ot) : new this.Collection(this, function() { return rr(void 0, c, !1, !0); }); }, Mt.prototype.belowOrEqual = function(c) { return c == null ? An(this, Ot) : new this.Collection(this, function() { return rr(void 0, c); }); }, Mt.prototype.startsWith = function(c) { return typeof c != "string" ? An(this, oc) : this.between(c, c + Fi, !0, !0); }, Mt.prototype.startsWithIgnoreCase = function(c) { return c === "" ? this.startsWith(c) : bs(this, function(h, g) { return h.indexOf(g[0]) === 0; }, [c], Fi); }, Mt.prototype.equalsIgnoreCase = function(c) { return bs(this, function(h, g) { return h === g[0]; }, [c], ""); }, Mt.prototype.anyOfIgnoreCase = function() { var c = M.apply(ue, arguments); return c.length === 0 ? Mi(this) : bs(this, function(h, g) { return g.indexOf(h) !== -1; }, c, ""); }, Mt.prototype.startsWithAnyOfIgnoreCase = function() { var c = M.apply(ue, arguments); return c.length === 0 ? Mi(this) : bs(this, function(h, g) { return g.some(function(_) { return h.indexOf(_) === 0; }); }, c, Fi); }, Mt.prototype.anyOf = function() { var c = this, h = M.apply(ue, arguments), g = this._cmp; try { h.sort(g); } catch { return An(this, Ot); } if (h.length === 0) return Mi(this); var _ = new this.Collection(this, function() { return rr(h[0], h[h.length - 1]); }); _._ondirectionchange = function(N) { g = N === "next" ? c._ascending : c._descending, h.sort(g); }; var S = 0; return _._addAlgorithm(function(N, A, I) { for (var U = N.key; 0 < g(U, h[S]); ) if (++S === h.length) return A(I), !1; return g(U, h[S]) === 0 || (A(function() { N.continue(h[S]); }), !1); }), _; }, Mt.prototype.notEqual = function(c) { return this.inAnyRange([[-1 / 0, c], [c, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 }); }, Mt.prototype.noneOf = function() { var c = M.apply(ue, arguments); if (c.length === 0) return new this.Collection(this); try { c.sort(this._ascending); } catch { return An(this, Ot); } var h = c.reduce(function(g, _) { return g ? g.concat([[g[g.length - 1][1], _]]) : [[-1 / 0, _]]; }, null); return h.push([c[c.length - 1], this.db._maxKey]), this.inAnyRange(h, { includeLowers: !1, includeUppers: !1 }); }, Mt.prototype.inAnyRange = function(Z, h) { var g = this, _ = this._cmp, S = this._ascending, N = this._descending, A = this._min, I = this._max; if (Z.length === 0) return Mi(this); if (!Z.every(function(ie) { return ie[0] !== void 0 && ie[1] !== void 0 && S(ie[0], ie[1]) <= 0; })) return An(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", Ce.InvalidArgument); var U = !h || h.includeLowers !== !1, V = h && h.includeUppers === !0, K, P = S; function G(ie, se) { return P(ie[0], se[0]); } try { (K = Z.reduce(function(ie, se) { for (var fe = 0, Ae = ie.length; fe < Ae; ++fe) { var De = ie[fe]; if (_(se[0], De[1]) < 0 && 0 < _(se[1], De[0])) { De[0] = A(De[0], se[0]), De[1] = I(De[1], se[1]); break; } } return fe === Ae && ie.push(se), ie; }, [])).sort(G); } catch { return An(this, Ot); } var B = 0, q = V ? function(ie) { return 0 < S(ie, K[B][1]); } : function(ie) { return 0 <= S(ie, K[B][1]); }, Q = U ? function(ie) { return 0 < N(ie, K[B][0]); } : function(ie) { return 0 <= N(ie, K[B][0]); }, H = q, Z = new this.Collection(this, function() { return rr(K[0][0], K[K.length - 1][1], !U, !V); }); return Z._ondirectionchange = function(ie) { P = ie === "next" ? (H = q, S) : (H = Q, N), K.sort(G); }, Z._addAlgorithm(function(ie, se, fe) { for (var Ae, De = ie.key; H(De); ) if (++B === K.length) return se(fe), !1; return !q(Ae = De) && !Q(Ae) || (g._cmp(De, K[B][1]) === 0 || g._cmp(De, K[B][0]) === 0 || se(function() { P === S ? ie.continue(K[B][0]) : ie.continue(K[B][1]); }), !1); }), Z; }, Mt.prototype.startsWithAnyOf = function() { var c = M.apply(ue, arguments); return c.every(function(h) { return typeof h == "string"; }) ? c.length === 0 ? Mi(this) : this.inAnyRange(c.map(function(h) { return [h, h + Fi]; })) : An(this, "startsWithAnyOf() only works with strings"); }, Mt); function Mt() { } function xn(c) { return It(function(h) { return Ur(h), c(h.target.error), !1; }); } function Ur(c) { c.stopPropagation && c.stopPropagation(), c.preventDefault && c.preventDefault(); } var jn = "storagemutated", Iu = "x-storagemutated-1", Br = fi(null, jn), po = (kr.prototype._lock = function() { return ne(!Ye.global), ++this._reculock, this._reculock !== 1 || Ye.global || (Ye.lockOwnerFor = this), this; }, kr.prototype._unlock = function() { if (ne(!Ye.global), --this._reculock == 0) for (Ye.global || (Ye.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) { var c = this._blockedFuncs.shift(); try { li(c[1], c[0]); } catch { } } return this; }, kr.prototype._locked = function() { return this._reculock && Ye.lockOwnerFor !== this; }, kr.prototype.create = function(c) { var h = this; if (!this.mode) return this; var g = this.db.idbdb, _ = this.db._state.dbOpenError; if (ne(!this.idbtrans), !c && !g) switch (_ && _.name) { case "DatabaseClosedError": throw new Ce.DatabaseClosed(_); case "MissingAPIError": throw new Ce.MissingAPI(_.message, _); default: throw new Ce.OpenFailed(_); } if (!this.active) throw new Ce.TransactionInactive(); return ne(this._completion._state === null), (c = this.idbtrans = c || (this.db.core || g).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = It(function(S) { Ur(S), h._reject(c.error); }), c.onabort = It(function(S) { Ur(S), h.active && h._reject(new Ce.Abort(c.error)), h.active = !1, h.on("abort").fire(S); }), c.oncomplete = It(function() { h.active = !1, h._resolve(), "mutatedParts" in c && Br.storagemutated.fire(c.mutatedParts); }), this; }, kr.prototype._promise = function(c, h, g) { var _ = this; if (c === "readwrite" && this.mode !== "readwrite") return Xt(new Ce.ReadOnly("Transaction is readonly")); if (!this.active) return Xt(new Ce.TransactionInactive()); if (this._locked()) return new je(function(N, A) { _._blockedFuncs.push([function() { _._promise(c, h, g).then(N, A); }, Ye]); }); if (g) return ai(function() { var N = new je(function(A, I) { _._lock(); var U = h(A, I, _); U && U.then && U.then(A, I); }); return N.finally(function() { return _._unlock(); }), N._lib = !0, N; }); var S = new je(function(N, A) { var I = h(N, A, _); I && I.then && I.then(N, A); }); return S._lib = !0, S; }, kr.prototype._root = function() { return this.parent ? this.parent._root() : this; }, kr.prototype.waitFor = function(c) { var h, g = this._root(), _ = je.resolve(c); g._waitingFor ? g._waitingFor = g._waitingFor.then(function() { return _; }) : (g._waitingFor = _, g._waitingQueue = [], h = g.idbtrans.objectStore(g.storeNames[0]), function N() { for (++g._spinCount; g._waitingQueue.length; ) g._waitingQueue.shift()(); g._waitingFor && (h.get(-1 / 0).onsuccess = N); }()); var S = g._waitingFor; return new je(function(N, A) { _.then(function(I) { return g._waitingQueue.push(It(N.bind(null, I))); }, function(I) { return g._waitingQueue.push(It(A.bind(null, I))); }).finally(function() { g._waitingFor === S && (g._waitingFor = null); }); }); }, kr.prototype.abort = function() { this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new Ce.Abort())); }, kr.prototype.table = function(c) { var h = this._memoizedTables || (this._memoizedTables = {}); if (b(h, c)) return h[c]; var g = this.schema[c]; if (!g) throw new Ce.NotFound("Table " + c + " not part of transaction"); return g = new this.db.Table(c, g, this), g.core = this.db.core.table(c), h[c] = g; }, kr); function kr() { } function pa(c, h, g, _, S, N, A) { return { name: c, keyPath: h, unique: g, multi: _, auto: S, compound: N, src: (g && !A ? "&" : "") + (_ ? "*" : "") + (S ? "++" : "") + mo(h) }; } function mo(c) { return typeof c == "string" ? c : c ? "[" + [].join.call(c, "+") + "]" : ""; } function ma(c, h, g) { return { name: c, primKey: h, indexes: g, mappedClass: null, idxByName: (_ = function(S) { return [S.name, S]; }, g.reduce(function(S, N, A) { return A = _(N, A), A && (S[A[0]] = A[1]), S; }, {})) }; var _; } var go = function(c) { try { return c.only([[]]), go = function() { return [[]]; }, [[]]; } catch { return go = function() { return Fi; }, Fi; } }; function $i(c) { return c == null ? function() { } : typeof c == "string" ? (h = c).split(".").length === 1 ? function(g) { return g[h]; } : function(g) { return ye(g, h); } : function(g) { return ye(g, c); }; var h; } function Es(c) { return [].slice.call(c); } var Ns = 0; function hi(c) { return c == null ? ":id" : typeof c == "string" ? c : "[".concat(c.join("+"), "]"); } function Qf(c, h, U) { function _(H) { if (H.type === 3) return null; if (H.type === 4) throw new Error("Cannot convert never type to IDBKeyRange"); var B = H.lower, q = H.upper, Q = H.lowerOpen, H = H.upperOpen; return B === void 0 ? q === void 0 ? null : h.upperBound(q, !!H) : q === void 0 ? h.lowerBound(B, !!Q) : h.bound(B, q, !!Q, !!H); } function S(G) { var B, q = G.name; return { name: q, schema: G, mutate: function(Q) { var H = Q.trans, Z = Q.type, ie = Q.keys, se = Q.values, fe = Q.range; return new Promise(function(Ae, De) { Ae = It(Ae); var xe = H.objectStore(q), Ie = xe.keyPath == null, Me = Z === "put" || Z === "add"; if (!Me && Z !== "delete" && Z !== "deleteRange") throw new Error("Invalid operation type: " + Z); var Pe, Ue = (ie || se || { length: 1 }).length; if (ie && se && ie.length !== se.length) throw new Error("Given keys array must have same length as given values array."); if (Ue === 0) return Ae({ numFailures: 0, failures: {}, results: [], lastResult: void 0 }); function ht(Gt) { ++Cn, Ur(Gt); } var mt = [], vt = [], Cn = 0; if (Z === "deleteRange") { if (fe.type === 4) return Ae({ numFailures: Cn, failures: vt, results: [], lastResult: void 0 }); fe.type === 3 ? mt.push(Pe = xe.clear()) : mt.push(Pe = xe.delete(_(fe))); } else { var Ie = Me ? Ie ? [se, ie] : [se, null] : [ie, null], ft = Ie[0], fn = Ie[1]; if (Me) for (var hn = 0; hn < Ue; ++hn) mt.push(Pe = fn && fn[hn] !== void 0 ? xe[Z](ft[hn], fn[hn]) : xe[Z](ft[hn])), Pe.onerror = ht; else for (hn = 0; hn < Ue; ++hn) mt.push(Pe = xe[Z](ft[hn])), Pe.onerror = ht; } function Ao(Gt) { Gt = Gt.target.result, mt.forEach(function(Vr, xo) { return Vr.error != null && (vt[xo] = Vr.error); }), Ae({ numFailures: Cn, failures: vt, results: Z === "delete" ? ie : mt.map(function(Vr) { return Vr.result; }), lastResult: Gt }); } Pe.onerror = function(Gt) { ht(Gt), Ao(Gt); }, Pe.onsuccess = Ao; }); }, getMany: function(Q) { var H = Q.trans, Z = Q.keys; return new Promise(function(ie, se) { ie = It(ie); for (var fe, Ae = H.objectStore(q), De = Z.length, xe = new Array(De), Ie = 0, Me = 0, Pe = function(mt) { mt = mt.target, xe[mt._pos] = mt.result, ++Me === Ie && ie(xe); }, Ue = xn(se), ht = 0; ht < De; ++ht) Z[ht] != null && ((fe = Ae.get(Z[ht]))._pos = ht, fe.onsuccess = Pe, fe.onerror = Ue, ++Ie); Ie === 0 && ie(xe); }); }, get: function(Q) { var H = Q.trans, Z = Q.key; return new Promise(function(ie, se) { ie = It(ie); var fe = H.objectStore(q).get(Z); fe.onsuccess = function(Ae) { return ie(Ae.target.result); }, fe.onerror = xn(se); }); }, query: (B = V, function(Q) { return new Promise(function(H, Z) { H = It(H); var ie, se, fe, Ie = Q.trans, Ae = Q.values, De = Q.limit, Pe = Q.query, xe = De === 1 / 0 ? void 0 : De, Me = Pe.index, Pe = Pe.range, Ie = Ie.objectStore(q), Me = Me.isPrimaryKey ? Ie : Ie.index(Me.name), Pe = _(Pe); if (De === 0) return H({ result: [] }); B ? ((xe = Ae ? Me.getAll(Pe, xe) : Me.getAllKeys(Pe, xe)).onsuccess = function(Ue) { return H({ result: Ue.target.result }); }, xe.onerror = xn(Z)) : (ie = 0, se = !Ae && "openKeyCursor" in Me ? Me.openKeyCursor(Pe) : Me.openCursor(Pe), fe = [], se.onsuccess = function(Ue) { var ht = se.result; return ht ? (fe.push(Ae ? ht.value : ht.primaryKey), ++ie === De ? H({ result: fe }) : void ht.continue()) : H({ result: fe }); }, se.onerror = xn(Z)); }); }), openCursor: function(Q) { var H = Q.trans, Z = Q.values, ie = Q.query, se = Q.reverse, fe = Q.unique; return new Promise(function(Ae, De) { Ae = It(Ae); var Me = ie.index, xe = ie.range, Ie = H.objectStore(q), Ie = Me.isPrimaryKey ? Ie : Ie.index(Me.name), Me = se ? fe ? "prevunique" : "prev" : fe ? "nextunique" : "next", Pe = !Z && "openKeyCursor" in Ie ? Ie.openKeyCursor(_(xe), Me) : Ie.openCursor(_(xe), Me); Pe.onerror = xn(De), Pe.onsuccess = It(function(Ue) { var ht, mt, vt, Cn, ft = Pe.result; ft ? (ft.___id = ++Ns, ft.done = !1, ht = ft.continue.bind(ft), mt = (mt = ft.continuePrimaryKey) && mt.bind(ft), vt = ft.advance.bind(ft), Cn = function() { throw new Error("Cursor not stopped"); }, ft.trans = H, ft.stop = ft.continue = ft.continuePrimaryKey = ft.advance = function() { throw new Error("Cursor not started"); }, ft.fail = It(De), ft.next = function() { var fn = this, hn = 1; return this.start(function() { return hn-- ? fn.continue() : fn.stop(); }).then(function() { return fn; }); }, ft.start = function(fn) { function hn() { if (Pe.result) try { fn(); } catch (Gt) { ft.fail(Gt); } else ft.done = !0, ft.start = function() { throw new Error("Cursor behind last entry"); }, ft.stop(); } var Ao = new Promise(function(Gt, Vr) { Gt = It(Gt), Pe.onerror = xn(Vr), ft.fail = Vr, ft.stop = function(xo) { ft.stop = ft.continue = ft.continuePrimaryKey = ft.advance = Cn, Gt(xo); }; }); return Pe.onsuccess = It(function(Gt) { Pe.onsuccess = hn, hn(); }), ft.continue = ht, ft.continuePrimaryKey = mt, ft.advance = vt, hn(), Ao; }, Ae(ft)) : Ae(null); }, De); }); }, count: function(Q) { var H = Q.query, Z = Q.trans, ie = H.index, se = H.range; return new Promise(function(fe, Ae) { var De = Z.objectStore(q), xe = ie.isPrimaryKey ? De : De.index(ie.name), De = _(se), xe = De ? xe.count(De) : xe.count(); xe.onsuccess = It(function(Ie) { return fe(Ie.target.result); }), xe.onerror = xn(Ae); }); } }; } var N, A, I, K = (A = U, I = Es((N = c).objectStoreNames), { schema: { name: N.name, tables: I.map(function(G) { return A.objectStore(G); }).map(function(G) { var B = G.keyPath, H = G.autoIncrement, q = f(B), Q = {}, H = { name: G.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: B == null, compound: q, keyPath: B, autoIncrement: H, unique: !0, extractKey: $i(B) }, indexes: Es(G.indexNames).map(function(Z) { return G.index(Z); }).map(function(fe) { var ie = fe.name, se = fe.unique, Ae = fe.multiEntry, fe = fe.keyPath, Ae = { name: ie, compound: f(fe), keyPath: fe, unique: se, multiEntry: Ae, extractKey: $i(fe) }; return Q[hi(fe)] = Ae; }), getIndexByKeyPath: function(Z) { return Q[hi(Z)]; } }; return Q[":id"] = H.primaryKey, B != null && (Q[hi(B)] = H.primaryKey), H; }) }, hasGetAll: 0 < I.length && "getAll" in A.objectStore(I[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), U = K.schema, V = K.hasGetAll, K = U.tables.map(S), P = {}; return K.forEach(function(G) { return P[G.name] = G; }), { stack: "dbcore", transaction: c.transaction.bind(c), table: function(G) { if (!P[G]) throw new Error("Table '".concat(G, "' not found")); return P[G]; }, MIN_KEY: -1 / 0, MAX_KEY: go(h), schema: U }; } function Yf(c, h, g, _) { var S = g.IDBKeyRange; return g.indexedDB, { dbcore: (_ = Qf(h, S, _), c.dbcore.reduce(function(N, A) { return A = A.create, i(i({}, N), A(N)); }, _)) }; } function As(c, _) { var g = _.db, _ = Yf(c._middlewares, g, c._deps, _); c.core = _.dbcore, c.tables.forEach(function(S) { var N = S.name; c.core.schema.tables.some(function(A) { return A.name === N; }) && (S.core = c.core.table(N), c[N] instanceof c.Table && (c[N].core = S.core)); }); } function ji(c, h, g, _) { g.forEach(function(S) { var N = _[S]; h.forEach(function(A) { var I = function U(V, K) { return C(V, K) || (V = v(V)) && U(V, K); }(A, S); (!I || "value" in I && I.value === void 0) && (A === c.Transaction.prototype || A instanceof c.Transaction ? O(A, S, { get: function() { return this.table(S); }, set: function(U) { T(this, S, { value: U, writable: !0, configurable: !0, enumerable: !0 }); } }) : A[S] = new c.Table(S, N)); }); }); } function yo(c, h) { h.forEach(function(g) { for (var _ in g) g[_] instanceof c.Table && delete g[_]; }); } function fc(c, h) { return c._cfg.version - h._cfg.version; } function pi(c, h, g, _) { var S = c._dbSchema; g.objectStoreNames.contains("$meta") && !S.$meta && (S.$meta = ma("$meta", Bi("")[0], []), c._storeNames.push("$meta")); var N = c._createTransaction("readwrite", c._storeNames, S); N.create(g), N._completion.catch(_); var A = N._reject.bind(N), I = Ye.transless || Ye; ai(function() { return Ye.trans = N, Ye.transless = I, h !== 0 ? (As(c, g), V = h, ((U = N).storeNames.includes("$meta") ? U.table("$meta").get("version").then(function(K) { return K ?? V; }) : je.resolve(V)).then(function(K) { return G = K, B = N, q = g, Q = [], K = (P = c)._versions, H = P._dbSchema = ko(0, P.idbdb, q), (K = K.filter(function(Z) { return Z._cfg.version >= G; })).length !== 0 ? (K.forEach(function(Z) { Q.push(function() { var ie = H, se = Z._cfg.dbschema; gn(P, ie, q), gn(P, se, q), H = P._dbSchema = se; var fe = xs(ie, se); fe.add.forEach(function(Me) { ga(q, Me[0], Me[1].primKey, Me[1].indexes); }), fe.change.forEach(function(Me) { if (Me.recreate) throw new Ce.Upgrade("Not yet support for changing primary key"); var Pe = q.objectStore(Me.name); Me.add.forEach(function(Ue) { return Ui(Pe, Ue); }), Me.change.forEach(function(Ue) { Pe.deleteIndex(Ue.name), Ui(Pe, Ue); }), Me.del.forEach(function(Ue) { return Pe.deleteIndex(Ue); }); }); var Ae = Z._cfg.contentUpgrade; if (Ae && Z._cfg.version > G) { As(P, q), B._memoizedTables = {}; var De = Fe(se); fe.del.forEach(function(Me) { De[Me] = ie[Me]; }), yo(P, [P.Transaction.prototype]), ji(P, [P.Transaction.prototype], l(De), De), B.schema = De; var xe, Ie = D(Ae); return Ie && vs(), fe = je.follow(function() { var Me; (xe = Ae(B)) && Ie && (Me = Nn.bind(null, null), xe.then(Me, Me)); }), xe && typeof xe.then == "function" ? je.resolve(xe) : fe.then(function() { return xe; }); } }), Q.push(function(ie) { var se, fe, Ae = Z._cfg.dbschema; se = Ae, fe = ie, [].slice.call(fe.db.objectStoreNames).forEach(function(De) { return se[De] == null && fe.db.deleteObjectStore(De); }), yo(P, [P.Transaction.prototype]), ji(P, [P.Transaction.prototype], P._storeNames, P._dbSchema), B.schema = P._dbSchema; }), Q.push(function(ie) { P.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(P.idbdb.version / 10) === Z._cfg.version ? (P.idbdb.deleteObjectStore("$meta"), delete P._dbSchema.$meta, P._storeNames = P._storeNames.filter(function(se) { return se !== "$meta"; })) : ie.objectStore("$meta").put(Z._cfg.version, "version")); }); }), function Z() { return Q.length ? je.resolve(Q.shift()(B.idbtrans)).then(Z) : je.resolve(); }().then(function() { vo(H, q); })) : je.resolve(); var P, G, B, q, Q, H; }).catch(A)) : (l(S).forEach(function(K) { ga(g, K, S[K].primKey, S[K].indexes); }), As(c, g), void je.follow(function() { return c.on.populate.fire(N); }).catch(A)); var U, V; }); } function Pu(c, h) { vo(c._dbSchema, h), h.db.version % 10 != 0 || h.objectStoreNames.contains("$meta") || h.db.createObjectStore("$meta").add(Math.ceil(h.db.version / 10 - 1), "version"); var g = ko(0, c.idbdb, h); gn(c, c._dbSchema, h); for (var _ = 0, S = xs(g, c._dbSchema).change; _ < S.length; _++) { var N = function(A) { if (A.change.length || A.recreate) return console.warn("Unable to patch indexes of table ".concat(A.name, " because it has changes on the type of index or primary key.")), { value: void 0 }; var I = h.objectStore(A.name); A.add.forEach(function(U) { tt && console.debug("Dexie upgrade patch: Creating missing index ".concat(A.name, ".").concat(U.src)), Ui(I, U); }); }(S[_]); if (typeof N == "object") return N.value; } } function xs(c, h) { var g, _ = { del: [], add: [], change: [] }; for (g in c) h[g] || _.del.push(g); for (g in h) { var S = c[g], N = h[g]; if (S) { var A = { name: g, def: N, recreate: !1, del: [], add: [], change: [] }; if ("" + (S.primKey.keyPath || "") != "" + (N.primKey.keyPath || "") || S.primKey.auto !== N.primKey.auto) A.recreate = !0, _.change.push(A); else { var I = S.idxByName, U = N.idxByName, V = void 0; for (V in I) U[V] || A.del.push(V); for (V in U) { var K = I[V], P = U[V]; K ? K.src !== P.src && A.change.push(P) : A.add.push(P); } (0 < A.del.length || 0 < A.add.length || 0 < A.change.length) && _.change.push(A); } } else _.add.push([g, N]); } return _; } function ga(c, h, g, _) { var S = c.db.createObjectStore(h, g.keyPath ? { keyPath: g.keyPath, autoIncrement: g.auto } : { autoIncrement: g.auto }); return _.forEach(function(N) { return Ui(S, N); }), S; } function vo(c, h) { l(c).forEach(function(g) { h.db.objectStoreNames.contains(g) || (tt && console.debug("Dexie: Creating missing table", g), ga(h, g, c[g].primKey, c[g].indexes)); }); } function Ui(c, h) { c.createIndex(h.name, h.keyPath, { unique: h.unique, multiEntry: h.multi }); } function ko(c, h, g) { var _ = {}; return J(h.objectStoreNames, 0).forEach(function(S) { for (var N = g.objectStore(S), A = pa(mo(V = N.keyPath), V || "", !0, !1, !!N.autoIncrement, V && typeof V != "string", !0), I = [], U = 0; U < N.indexNames.length; ++U) { var K = N.index(N.indexNames[U]), V = K.keyPath, K = pa(K.name, V, !!K.unique, !!K.multiEntry, !1, V && typeof V != "string", !1); I.push(K); } _[S] = ma(S, A, I); }), _; } function gn(c, h, g) { for (var _ = g.db.objectStoreNames, S = 0; S < _.length; ++S) { var N = _[S], A = g.objectStore(N); c._hasGetAll = "getAll" in A; for (var I = 0; I < A.indexNames.length; ++I) { var U = A.indexNames[I], V = A.index(U).keyPath, K = typeof V == "string" ? V : "[" + J(V).join("+") + "]"; !h[N] || (V = h[N].idxByName[K]) && (V.name = U, delete h[N].idxByName[K], h[N].idxByName[U] = V); } } typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && a.WorkerGlobalScope && a instanceof a.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (c._hasGetAll = !1); } function Bi(c) { return c.split(",").map(function(h, g) { var _ = (h = h.trim()).replace(/([&*]|\+\+)/g, ""), S = /^\[/.test(_) ? _.match(/^\[(.*)\]$/)[1].split("+") : _; return pa(_, S || null, /\&/.test(h), /\*/.test(h), /\+\+/.test(h), f(S), g === 0); }); } var Lu = (mi.prototype._parseStoresSpec = function(c, h) { l(c).forEach(function(g) { if (c[g] !== null) { var _ = Bi(c[g]), S = _.shift(); if (S.unique = !0, S.multi) throw new Ce.Schema("Primary key cannot be multi-valued"); _.forEach(function(N) { if (N.auto) throw new Ce.Schema("Only primary key can be marked as autoIncrement (++)"); if (!N.keyPath) throw new Ce.Schema("Index must have a name and cannot be an empty string"); }), h[g] = ma(g, S, _); } }); }, mi.prototype.stores = function(g) { var h = this.db; this._cfg.storesSource = this._cfg.storesSource ? p(this._cfg.storesSource, g) : g; var g = h._versions, _ = {}, S = {}; return g.forEach(function(N) { p(_, N._cfg.storesSource), S = N._cfg.dbschema = {}, N._parseStoresSpec(_, S); }), h._dbSchema = S, yo(h, [h._allTables, h, h.Transaction.prototype]), ji(h, [h._allTables, h, h.Transaction.prototype, this._cfg.tables], l(S), S), h._storeNames = l(S), this; }, mi.prototype.upgrade = function(c) { return this._cfg.contentUpgrade = Oe(this._cfg.contentUpgrade || et, c), this; }, mi); function mi() { } function Du(c, h) { var g = c._dbNamesDB; return g || (g = c._dbNamesDB = new _r(co, { addons: [], indexedDB: c, IDBKeyRange: h })).version(1).stores({ dbnames: "name" }), g.table("dbnames"); } function _o(c) { return c && typeof c.databases == "function"; } function wo(c) { return ai(function() { return Ye.letThrough = !0, c(); }); } function Vi(c) { return !("from" in c); } var rn = function(c, h) { if (!this) { var g = new rn(); return c && "d" in c && p(g, c), g; } p(this, arguments.length ? { d: 1, from: c, to: 1 < arguments.length ? h : c } : { d: 0 }); }; function Cs(c, h, g) { var _ = lt(h, g); if (!isNaN(_)) { if (0 < _) throw RangeError(); if (Vi(c)) return p(c, { from: h, to: g, d: 1 }); var S = c.l, _ = c.r; if (lt(g, c.from) < 0) return S ? Cs(S, h, g) : c.l = { from: h, to: g, d: 1, l: null, r: null }, va(c); if (0 < lt(h, c.to)) return _ ? Cs(_, h, g) : c.r = { from: h, to: g, d: 1, l: null, r: null }, va(c); lt(h, c.from) < 0 && (c.from = h, c.l = null, c.d = _ ? _.d + 1 : 1), 0 < lt(g, c.to) && (c.to = g, c.r = null, c.d = c.l ? c.l.d + 1 : 1), g = !c.r, S && !c.l && So(c, S), _ && g && So(c, _); } } function So(c, h) { Vi(h) || function g(_, U) { var N = U.from, A = U.to, I = U.l, U = U.r; Cs(_, N, A), I && g(_, I), U && g(_, U); }(c, h); } function hc(c, h) { var g = ya(h), _ = g.next(); if (_.done) return !1; for (var S = _.value, N = ya(c), A = N.next(S.from), I = A.value; !_.done && !A.done; ) { if (lt(I.from, S.to) <= 0 && 0 <= lt(I.to, S.from)) return !0; lt(S.from, I.from) < 0 ? S = (_ = g.next(I.from)).value : I = (A = N.next(S.from)).value; } return !1; } function ya(c) { var h = Vi(c) ? null : { s: 0, n: c }; return { next: function(g) { for (var _ = 0 < arguments.length; h; ) switch (h.s) { case 0: if (h.s = 1, _) for (; h.n.l && lt(g, h.n.from) < 0; ) h = { up: h, n: h.n.l, s: 1 }; else for (; h.n.l; ) h = { up: h, n: h.n.l, s: 1 }; case 1: if (h.s = 2, !_ || lt(g, h.n.to) <= 0) return { value: h.n, done: !1 }; case 2: if (h.n.r) { h.s = 3, h = { up: h, n: h.n.r, s: 0 }; continue; } case 3: h = h.up; } return { done: !0 }; } }; } function va(c) { var h, g, _ = (((h = c.r) === null || h === void 0 ? void 0 : h.d) || 0) - (((g = c.l) === null || g === void 0 ? void 0 : g.d) || 0), S = 1 < _ ? "r" : _ < -1 ? "l" : ""; S && (h = S == "r" ? "l" : "r", g = i({}, c), _ = c[S], c.from = _.from, c.to = _.to, c[S] = _[S], g[S] = _[h], (c[h] = g).d = pc(g)), c.d = pc(c); } function pc(g) { var h = g.r, g = g.l; return (h ? g ? Math.max(h.d, g.d) : h.d : g ? g.d : 0) + 1; } function ka(c, h) { return l(h).forEach(function(g) { c[g] ? So(c[g], h[g]) : c[g] = function _(S) { var N, A, I = {}; for (N in S) b(S, N) && (A = S[N], I[N] = !A || typeof A != "object" || He.has(A.constructor) ? A : _(A)); return I; }(h[g]); }), c; } function Fu(c, h) { return c.all || h.all || Object.keys(c).some(function(g) { return h[g] && hc(h[g], c[g]); }); } w(rn.prototype, ((Un = { add: function(c) { return So(this, c), this; }, addKey: function(c) { return Cs(this, c, c), this; }, addKeys: function(c) { var h = this; return c.forEach(function(g) { return Cs(h, g, g); }), this; }, hasKey: function(c) { var h = ya(this).next(c).value; return h && lt(h.from, c) <= 0 && 0 <= lt(h.to, c); } })[oe] = function() { return ya(this); }, Un)); var zi = {}, Mu = {}, _a = !1; function wa(c) { ka(Mu, c), _a || (_a = !0, setTimeout(function() { _a = !1, $u(Mu, !(Mu = {})); }, 0)); } function $u(c, h) { h === void 0 && (h = !1); var g = /* @__PURE__ */ new Set(); if (c.all) for (var _ = 0, S = Object.values(zi); _ < S.length; _++) mc(A = S[_], c, g, h); else for (var N in c) { var A, I = /^idb\:\/\/(.*)\/(.*)\//.exec(N); I && (N = I[1], I = I[2], (A = zi["idb://".concat(N, "/").concat(I)]) && mc(A, c, g, h)); } g.forEach(function(U) { return U(); }); } function mc(c, h, g, _) { for (var S = [], N = 0, A = Object.entries(c.queries.query); N < A.length; N++) { for (var I = A[N], U = I[0], V = [], K = 0, P = I[1]; K < P.length; K++) { var G = P[K]; Fu(h, G.obsSet) ? G.subscribers.forEach(function(H) { return g.add(H); }) : _ && V.push(G); } _ && S.push([U, V]); } if (_) for (var B = 0, q = S; B < q.length; B++) { var Q = q[B], U = Q[0], V = Q[1]; c.queries.query[U] = V; } } function Xf(c) { var h = c._state, g = c._deps.indexedDB; if (h.isBeingOpened || c.idbdb) return h.dbReadyPromise.then(function() { return h.dbOpenError ? Xt(h.dbOpenError) : c; }); h.isBeingOpened = !0, h.dbOpenError = null, h.openComplete = !1; var _ = h.openCanceller, S = Math.round(10 * c.verno), N = !1; function A() { if (h.openCanceller !== _) throw new Ce.DatabaseClosed("db.open() was cancelled"); } function I() { return new je(function(G, B) { if (A(), !g) throw new Ce.MissingAPI(); var q = c.name, Q = h.autoSchema || !S ? g.open(q) : g.open(q, S); if (!Q) throw new Ce.MissingAPI(); Q.onerror = xn(B), Q.onblocked = It(c._fireOnBlocked), Q.onupgradeneeded = It(function(H) { var Z; K = Q.transaction, h.autoSchema && !c._options.allowEmptyDB ? (Q.onerror = Ur, K.abort(), Q.result.close(), (Z = g.deleteDatabase(q)).onsuccess = Z.onerror = It(function() { B(new Ce.NoSuchDatabase("Database ".concat(q, " doesnt exist"))); })) : (K.onerror = xn(B), H = H.oldVersion > Math.pow(2, 62) ? 0 : H.oldVersion, P = H < 1, c.idbdb = Q.result, N && Pu(c, K), pi(c, H / 10, K, B)); }, B), Q.onsuccess = It(function() { K = null; var H, Z, ie, se, fe, Ae = c.idbdb = Q.result, De = J(Ae.objectStoreNames); if (0 < De.length) try { var xe = Ae.transaction((se = De).length === 1 ? se[0] : se, "readonly"); if (h.autoSchema) Z = Ae, ie = xe, (H = c).verno = Z.version / 10, ie = H._dbSchema = ko(0, Z, ie), H._storeNames = J(Z.objectStoreNames, 0), ji(H, [H._allTables], l(ie), ie); else if (gn(c, c._dbSchema, xe), ((fe = xs(ko(0, (fe = c).idbdb, xe), fe._dbSchema)).add.length || fe.change.some(function(Ie) { return Ie.add.length || Ie.change.length; })) && !N) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), Ae.close(), S = Ae.version + 1, N = !0, G(I()); As(c, xe); } catch { } ci.push(c), Ae.onversionchange = It(function(Ie) { h.vcFired = !0, c.on("versionchange").fire(Ie); }), Ae.onclose = It(function(Ie) { c.on("close").fire(Ie); }), P && (fe = c._deps, xe = q, Ae = fe.indexedDB, fe = fe.IDBKeyRange, _o(Ae) || xe === co || Du(Ae, fe).put({ name: xe }).catch(et)), G(); }, B); }).catch(function(G) { switch (G == null ? void 0 : G.name) { case "UnknownError": if (0 < h.PR1398_maxLoop) return h.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), I(); break; case "VersionError": if (0 < S) return S = 0, I(); } return je.reject(G); }); } var U, V = h.dbReadyResolve, K = null, P = !1; return je.race([_, (typeof navigator > "u" ? je.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(G) { function B() { return indexedDB.databases().finally(G); } U = setInterval(B, 100), B(); }).finally(function() { return clearInterval(U); }) : Promise.resolve()).then(I)]).then(function() { return A(), h.onReadyBeingFired = [], je.resolve(wo(function() { return c.on.ready.fire(c.vip); })).then(function G() { if (0 < h.onReadyBeingFired.length) { var B = h.onReadyBeingFired.reduce(Oe, et); return h.onReadyBeingFired = [], je.resolve(wo(function() { return B(c.vip); })).then(G); } }); }).finally(function() { h.openCanceller === _ && (h.onReadyBeingFired = null, h.isBeingOpened = !1); }).catch(function(G) { h.dbOpenError = G; try { K && K.abort(); } catch { } return _ === h.openCanceller && c._close(), Xt(G); }).finally(function() { h.openComplete = !0, V(); }).then(function() { var G; return P && (G = {}, c.tables.forEach(function(B) { B.schema.indexes.forEach(function(q) { q.name && (G["idb://".concat(c.name, "/").concat(B.name, "/").concat(q.name)] = new rn(-1 / 0, [[[]]])); }), G["idb://".concat(c.name, "/").concat(B.name, "/")] = G["idb://".concat(c.name, "/").concat(B.name, "/:dels")] = new rn(-1 / 0, [[[]]]); }), Br(jn).fire(G), $u(G, !0)), c; }); } function bo(c) { function h(N) { return c.next(N); } var g = S(h), _ = S(function(N) { return c.throw(N); }); function S(N) { return function(U) { var I = N(U), U = I.value; return I.done ? U : U && typeof U.then == "function" ? U.then(g, _) : f(U) ? Promise.all(U).then(g, _) : g(U); }; } return S(h)(); } function Sa(c, h, g) { for (var _ = f(c) ? c.slice() : [c], S = 0; S < g; ++S) _.push(h); return _; } var Jf = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(c) { return i(i({}, c), { table: function(h) { var g = c.table(h), _ = g.schema, S = {}, N = []; function A(P, G, B) { var q = hi(P), Q = S[q] = S[q] || [], H = P == null ? 0 : typeof P == "string" ? 1 : P.length, Z = 0 < G, Z = i(i({}, B), { name: Z ? "".concat(q, "(virtual-from:").concat(B.name, ")") : B.name, lowLevelIndex: B, isVirtual: Z, keyTail: G, keyLength: H, extractKey: $i(P), unique: !Z && B.unique }); return Q.push(Z), Z.isPrimaryKey || N.push(Z), 1 < H && A(H === 2 ? P[0] : P.slice(0, H - 1), G + 1, B), Q.sort(function(ie, se) { return ie.keyTail - se.keyTail; }), Z; } h = A(_.primaryKey.keyPath, 0, _.primaryKey), S[":id"] = [h]; for (var I = 0, U = _.indexes; I < U.length; I++) { var V = U[I]; A(V.keyPath, 0, V); } function K(P) { var G, B = P.query.index; return B.isVirtual ? i(i({}, P), { query: { index: B.lowLevelIndex, range: (G = P.query.range, B = B.keyTail, { type: G.type === 1 ? 2 : G.type, lower: Sa(G.lower, G.lowerOpen ? c.MAX_KEY : c.MIN_KEY, B), lowerOpen: !0, upper: Sa(G.upper, G.upperOpen ? c.MIN_KEY : c.MAX_KEY, B), upperOpen: !0 }) } }) : P; } return i(i({}, g), { schema: i(i({}, _), { primaryKey: h, indexes: N, getIndexByKeyPath: function(P) { return (P = S[hi(P)]) && P[0]; } }), count: function(P) { return g.count(K(P)); }, query: function(P) { return g.query(K(P)); }, openCursor: function(P) { var G = P.query.index, B = G.keyTail, q = G.isVirtual, Q = G.keyLength; return q ? g.openCursor(K(P)).then(function(Z) { return Z && H(Z); }) : g.openCursor(P); function H(Z) { return Object.create(Z, { continue: { value: function(ie) { ie != null ? Z.continue(Sa(ie, P.reverse ? c.MAX_KEY : c.MIN_KEY, B)) : P.unique ? Z.continue(Z.key.slice(0, Q).concat(P.reverse ? c.MIN_KEY : c.MAX_KEY, B)) : Z.continue(); } }, continuePrimaryKey: { value: function(ie, se) { Z.continuePrimaryKey(Sa(ie, c.MAX_KEY, B), se); } }, primaryKey: { get: function() { return Z.primaryKey; } }, key: { get: function() { var ie = Z.key; return Q === 1 ? ie[0] : ie.slice(0, Q); } }, value: { get: function() { return Z.value; } } }); } } }); } }); } }; function ju(c, h, g, _) { return g = g || {}, _ = _ || "", l(c).forEach(function(S) { var N, A, I; b(h, S) ? (N = c[S], A = h[S], typeof N == "object" && typeof A == "object" && N && A ? (I = L(N)) !== L(A) ? g[_ + S] = h[S] : I === "Object" ? ju(N, A, g, _ + S + ".") : N !== A && (g[_ + S] = h[S]) : N !== A && (g[_ + S] = h[S])) : g[_ + S] = void 0; }), l(h).forEach(function(S) { b(c, S) || (g[_ + S] = h[S]); }), g; } function ba(c, h) { return h.type === "delete" ? h.keys : h.keys || h.values.map(c.extractKey); } var Zf = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(c) { return i(i({}, c), { table: function(h) { var g = c.table(h), _ = g.schema.primaryKey; return i(i({}, g), { mutate: function(S) { var N = Ye.trans, A = N.table(h).hook, I = A.deleting, U = A.creating, V = A.updating; switch (S.type) { case "add": if (U.fire === et) break; return N._promise("readwrite", function() { return K(S); }, !0); case "put": if (U.fire === et && V.fire === et) break; return N._promise("readwrite", function() { return K(S); }, !0); case "delete": if (I.fire === et) break; return N._promise("readwrite", function() { return K(S); }, !0); case "deleteRange": if (I.fire === et) break; return N._promise("readwrite", function() { return function P(G, B, q) { return g.query({ trans: G, values: !1, query: { index: _, range: B }, limit: q }).then(function(Q) { var H = Q.result; return K({ type: "delete", keys: H, trans: G }).then(function(Z) { return 0 < Z.numFailures ? Promise.reject(Z.failures[0]) : H.length < q ? { failures: [], numFailures: 0, lastResult: void 0 } : P(G, i(i({}, B), { lower: H[H.length - 1], lowerOpen: !0 }), q); }); }); }(S.trans, S.range, 1e4); }, !0); } return g.mutate(S); function K(P) { var G, B, q, Q = Ye.trans, H = P.keys || ba(_, P); if (!H) throw new Error("Keys missing"); return (P = P.type === "add" || P.type === "put" ? i(i({}, P), { keys: H }) : i({}, P)).type !== "delete" && (P.values = o([], P.values)), P.keys && (P.keys = o([], P.keys)), G = g, q = H, ((B = P).type === "add" ? Promise.resolve([]) : G.getMany({ trans: B.trans, keys: q, cache: "immutable" })).then(function(Z) { var ie = H.map(function(se, fe) { var Ae, De, xe, Ie = Z[fe], Me = { onerror: null, onsuccess: null }; return P.type === "delete" ? I.fire.call(Me, se, Ie, Q) : P.type === "add" || Ie === void 0 ? (Ae = U.fire.call(Me, se, P.values[fe], Q), se == null && Ae != null && (P.keys[fe] = se = Ae, _.outbound || me(P.values[fe], _.keyPath, se))) : (Ae = ju(Ie, P.values[fe]), (De = V.fire.call(Me, Ae, se, Ie, Q)) && (xe = P.values[fe], Object.keys(De).forEach(function(Pe) { b(xe, Pe) ? xe[Pe] = De[Pe] : me(xe, Pe, De[Pe]); }))), Me; }); return g.mutate(P).then(function(se) { for (var fe = se.failures, Ae = se.results, De = se.numFailures, se = se.lastResult, xe = 0; xe < H.length; ++xe) { var Ie = (Ae || H)[xe], Me = ie[xe]; Ie == null ? Me.onerror && Me.onerror(fe[xe]) : Me.onsuccess && Me.onsuccess(P.type === "put" && Z[xe] ? P.values[xe] : Ie); } return { failures: fe, results: Ae, numFailures: De, lastResult: se }; }).catch(function(se) { return ie.forEach(function(fe) { return fe.onerror && fe.onerror(se); }), Promise.reject(se); }); }); } } }); } }); } }; function gc(c, h, g) { try { if (!h || h.keys.length < c.length) return null; for (var _ = [], S = 0, N = 0; S < h.keys.length && N < c.length; ++S) lt(h.keys[S], c[N]) === 0 && (_.push(g ? ot(h.values[S]) : h.values[S]), ++N); return _.length === c.length ? _ : null; } catch { return null; } } var eh = { stack: "dbcore", level: -1, create: function(c) { return { table: function(h) { var g = c.table(h); return i(i({}, g), { getMany: function(_) { if (!_.cache) return g.getMany(_); var S = gc(_.keys, _.trans._cache, _.cache === "clone"); return S ? je.resolve(S) : g.getMany(_).then(function(N) { return _.trans._cache = { keys: _.keys, values: _.cache === "clone" ? ot(N) : N }, N; }); }, mutate: function(_) { return _.type !== "add" && (_.trans._cache = null), g.mutate(_); } }); } }; } }; function yc(c, h) { return c.trans.mode === "readonly" && !!c.subscr && !c.trans.explicit && c.trans.db._options.cache !== "disabled" && !h.schema.primaryKey.outbound; } function vc(c, h) { switch (c) { case "query": return h.values && !h.unique; case "get": case "getMany": case "count": case "openCursor": return !1; } } var th = { stack: "dbcore", level: 0, name: "Observability", create: function(c) { var h = c.schema.name, g = new rn(c.MIN_KEY, c.MAX_KEY); return i(i({}, c), { transaction: function(_, S, N) { if (Ye.subscr && S !== "readonly") throw new Ce.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ye.querier)); return c.transaction(_, S, N); }, table: function(_) { var S = c.table(_), N = S.schema, A = N.primaryKey, P = N.indexes, I = A.extractKey, U = A.outbound, V = A.autoIncrement && P.filter(function(B) { return B.compound && B.keyPath.includes(A.keyPath); }), K = i(i({}, S), { mutate: function(B) { function q(Pe) { return Pe = "idb://".concat(h, "/").concat(_, "/").concat(Pe), se[Pe] || (se[Pe] = new rn()); } var Q, H, Z, ie = B.trans, se = B.mutatedParts || (B.mutatedParts = {}), fe = q(""), Ae = q(":dels"), De = B.type, Me = B.type === "deleteRange" ? [B.range] : B.type === "delete" ? [B.keys] : B.values.length < 50 ? [ba(A, B).filter(function(Pe) { return Pe; }), B.values] : [], xe = Me[0], Ie = Me[1], Me = B.trans._cache; return f(xe) ? (fe.addKeys(xe), (Me = De === "delete" || xe.length === Ie.length ? gc(xe, Me) : null) || Ae.addKeys(xe), (Me || Ie) && (Q = q, H = Me, Z = Ie, N.indexes.forEach(function(Pe) { var Ue = Q(Pe.name || ""); function ht(vt) { return vt != null ? Pe.extractKey(vt) : null; } function mt(vt) { return Pe.multiEntry && f(vt) ? vt.forEach(function(Cn) { return Ue.addKey(Cn); }) : Ue.addKey(vt); } (H || Z).forEach(function(vt, fn) { var ft = H && ht(H[fn]), fn = Z && ht(Z[fn]); lt(ft, fn) !== 0 && (ft != null && mt(ft), fn != null && mt(fn)); }); }))) : xe ? (Ie = { from: (Ie = xe.lower) !== null && Ie !== void 0 ? Ie : c.MIN_KEY, to: (Ie = xe.upper) !== null && Ie !== void 0 ? Ie : c.MAX_KEY }, Ae.add(Ie), fe.add(Ie)) : (fe.add(g), Ae.add(g), N.indexes.forEach(function(Pe) { return q(Pe.name).add(g); })), S.mutate(B).then(function(Pe) { return !xe || B.type !== "add" && B.type !== "put" || (fe.addKeys(Pe.results), V && V.forEach(function(Ue) { for (var ht = B.values.map(function(ft) { return Ue.extractKey(ft); }), mt = Ue.keyPath.findIndex(function(ft) { return ft === A.keyPath; }), vt = 0, Cn = Pe.results.length; vt < Cn; ++vt) ht[vt][mt] = Pe.results[vt]; q(Ue.name).addKeys(ht); })), ie.mutatedParts = ka(ie.mutatedParts || {}, se), Pe; }); } }), P = function(q) { var Q = q.query, q = Q.index, Q = Q.range; return [q, new rn((q = Q.lower) !== null && q !== void 0 ? q : c.MIN_KEY, (Q = Q.upper) !== null && Q !== void 0 ? Q : c.MAX_KEY)]; }, G = { get: function(B) { return [A, new rn(B.key)]; }, getMany: function(B) { return [A, new rn().addKeys(B.keys)]; }, count: P, query: P, openCursor: P }; return l(G).forEach(function(B) { K[B] = function(q) { var Q = Ye.subscr, H = !!Q, Z = yc(Ye, S) && vc(B, q) ? q.obsSet = {} : Q; if (H) { var ie = function(Ie) { return Ie = "idb://".concat(h, "/").concat(_, "/").concat(Ie), Z[Ie] || (Z[Ie] = new rn()); }, se = ie(""), fe = ie(":dels"), Q = G[B](q), H = Q[0], Q = Q[1]; if ((B === "query" && H.isPrimaryKey && !q.values ? fe : ie(H.name || "")).add(Q), !H.isPrimaryKey) { if (B !== "count") { var Ae = B === "query" && U && q.values && S.query(i(i({}, q), { values: !1 })); return S[B].apply(this, arguments).then(function(Ie) { if (B === "query") { if (U && q.values) return Ae.then(function(ht) { return ht = ht.result, se.addKeys(ht), Ie; }); var Me = q.values ? Ie.result.map(I) : Ie.result; (q.values ? se : fe).addKeys(Me); } else if (B === "openCursor") { var Pe = Ie, Ue = q.values; return Pe && Object.create(Pe, { key: { get: function() { return fe.addKey(Pe.primaryKey), Pe.key; } }, primaryKey: { get: function() { var ht = Pe.primaryKey; return fe.addKey(ht), ht; } }, value: { get: function() { return Ue && se.addKey(Pe.primaryKey), Pe.value; } } }); } return Ie; }); } fe.add(g); } } return S[B].apply(this, arguments); }; }), K; } }); } }; function kc(c, h, g) { if (g.numFailures === 0) return h; if (h.type === "deleteRange") return null; var _ = h.keys ? h.keys.length : "values" in h && h.values ? h.values.length : 1; return g.numFailures === _ ? null : (h = i({}, h), f(h.keys) && (h.keys = h.keys.filter(function(S, N) { return !(N in g.failures); })), "values" in h && f(h.values) && (h.values = h.values.filter(function(S, N) { return !(N in g.failures); })), h); } function Eo(c, h) { return g = c, ((_ = h).lower === void 0 || (_.lowerOpen ? 0 < lt(g, _.lower) : 0 <= lt(g, _.lower))) && (c = c, (h = h).upper === void 0 || (h.upperOpen ? lt(c, h.upper) < 0 : lt(c, h.upper) <= 0)); var g, _; } function Os(c, h, G, _, S, N) { if (!G || G.length === 0) return c; var A = h.query.index, I = A.multiEntry, U = h.query.range, V = _.schema.primaryKey.extractKey, K = A.extractKey, P = (A.lowLevelIndex || A).extractKey, G = G.reduce(function(B, q) { var Q = B, H = []; if (q.type === "add" || q.type === "put") for (var Z = new rn(), ie = q.values.length - 1; 0 <= ie; --ie) { var se, fe = q.values[ie], Ae = V(fe); Z.hasKey(Ae) || (se = K(fe), (I && f(se) ? se.some(function(Pe) { return Eo(Pe, U); }) : Eo(se, U)) && (Z.addKey(Ae), H.push(fe))); } switch (q.type) { case "add": var De = new rn().addKeys(h.values ? B.map(function(Ue) { return V(Ue); }) : B), Q = B.concat(h.values ? H.filter(function(Ue) { return Ue = V(Ue), !De.hasKey(Ue) && (De.addKey(Ue), !0); }) : H.map(function(Ue) { return V(Ue); }).filter(function(Ue) { return !De.hasKey(Ue) && (De.addKey(Ue), !0); })); break; case "put": var xe = new rn().addKeys(q.values.map(function(Ue) { return V(Ue); })); Q = B.filter(function(Ue) { return !xe.hasKey(h.values ? V(Ue) : Ue); }).concat(h.values ? H : H.map(function(Ue) { return V(Ue); })); break; case "delete": var Ie = new rn().addKeys(q.keys); Q = B.filter(function(Ue) { return !Ie.hasKey(h.values ? V(Ue) : Ue); }); break; case "deleteRange": var Me = q.range; Q = B.filter(function(Ue) { return !Eo(V(Ue), Me); }); } return Q; }, c); return G === c ? c : (G.sort(function(B, q) { return lt(P(B), P(q)) || lt(V(B), V(q)); }), h.limit && h.limit < 1 / 0 && (G.length > h.limit ? G.length = h.limit : c.length === h.limit && G.length < h.limit && (S.dirty = !0)), N ? Object.freeze(G) : G); } function _c(c, h) { return lt(c.lower, h.lower) === 0 && lt(c.upper, h.upper) === 0 && !!c.lowerOpen == !!h.lowerOpen && !!c.upperOpen == !!h.upperOpen; } function wc(c, h) { return function(g, _, S, N) { if (g === void 0) return _ !== void 0 ? -1 : 0; if (_ === void 0) return 1; if ((_ = lt(g, _)) === 0) { if (S && N) return 0; if (S) return 1; if (N) return -1; } return _; }(c.lower, h.lower, c.lowerOpen, h.lowerOpen) <= 0 && 0 <= function(g, _, S, N) { if (g === void 0) return _ !== void 0 ? 1 : 0; if (_ === void 0) return -1; if ((_ = lt(g, _)) === 0) { if (S && N) return 0; if (S) return -1; if (N) return 1; } return _; }(c.upper, h.upper, c.upperOpen, h.upperOpen); } function Sc(c, h, g, _) { c.subscribers.add(g), _.addEventListener("abort", function() { var S, N; c.subscribers.delete(g), c.subscribers.size === 0 && (S = c, N = h, setTimeout(function() { S.subscribers.size === 0 && te(N, S); }, 3e3)); }); } var bc = { stack: "dbcore", level: 0, name: "Cache", create: function(c) { var h = c.schema.name; return i(i({}, c), { transaction: function(g, _, S) { var N, A, I = c.transaction(g, _, S); return _ === "readwrite" && (A = (N = new AbortController()).signal, S = function(U) { return function() { if (N.abort(), _ === "readwrite") { for (var V = /* @__PURE__ */ new Set(), K = 0, P = g; K < P.length; K++) { var G = P[K], B = zi["idb://".concat(h, "/").concat(G)]; if (B) { var q = c.table(G), Q = B.optimisticOps.filter(function(Ue) { return Ue.trans === I; }); if (I._explicit && U && I.mutatedParts) for (var H = 0, Z = Object.values(B.queries.query); H < Z.length; H++) for (var ie = 0, se = (De = Z[H]).slice(); ie < se.length; ie++) Fu((xe = se[ie]).obsSet, I.mutatedParts) && (te(De, xe), xe.subscribers.forEach(function(Ue) { return V.add(Ue); })); else if (0 < Q.length) { B.optimisticOps = B.optimisticOps.filter(function(Ue) { return Ue.trans !== I; }); for (var fe = 0, Ae = Object.values(B.queries.query); fe < Ae.length; fe++) for (var De, xe, Ie, Me = 0, Pe = (De = Ae[fe]).slice(); Me < Pe.length; Me++) (xe = Pe[Me]).res != null && I.mutatedParts && (U && !xe.dirty ? (Ie = Object.isFrozen(xe.res), Ie = Os(xe.res, xe.req, Q, q, xe, Ie), xe.dirty ? (te(De, xe), xe.subscribers.forEach(function(Ue) { return V.add(Ue); })) : Ie !== xe.res && (xe.res = Ie, xe.promise = je.resolve({ result: Ie }))) : (xe.dirty && te(De, xe), xe.subscribers.forEach(function(Ue) { return V.add(Ue); }))); } } } V.forEach(function(Ue) { return Ue(); }); } }; }, I.addEventListener("abort", S(!1), { signal: A }), I.addEventListener("error", S(!1), { signal: A }), I.addEventListener("complete", S(!0), { signal: A })), I; }, table: function(g) { var _ = c.table(g), S = _.schema.primaryKey; return i(i({}, _), { mutate: function(N) { var A = Ye.trans; if (S.outbound || A.db._options.cache === "disabled" || A.explicit || A.idbtrans.mode !== "readwrite") return _.mutate(N); var I = zi["idb://".concat(h, "/").concat(g)]; return I ? (A = _.mutate(N), N.type !== "add" && N.type !== "put" || !(50 <= N.values.length || ba(S, N).some(function(U) { return U == null; })) ? (I.optimisticOps.push(N), N.mutatedParts && wa(N.mutatedParts), A.then(function(U) { 0 < U.numFailures && (te(I.optimisticOps, N), (U = kc(0, N, U)) && I.optimisticOps.push(U), N.mutatedParts && wa(N.mutatedParts)); }), A.catch(function() { te(I.optimisticOps, N), N.mutatedParts && wa(N.mutatedParts); })) : A.then(function(U) { var V = kc(0, i(i({}, N), { values: N.values.map(function(K, P) { var G; return U.failures[P] ? K : (K = (G = S.keyPath) !== null && G !== void 0 && G.includes(".") ? ot(K) : i({}, K), me(K, S.keyPath, U.results[P]), K); }) }), U); I.optimisticOps.push(V), queueMicrotask(function() { return N.mutatedParts && wa(N.mutatedParts); }); }), A) : _.mutate(N); }, query: function(N) { if (!yc(Ye, _) || !vc("query", N)) return _.query(N); var A = ((V = Ye.trans) === null || V === void 0 ? void 0 : V.db._options.cache) === "immutable", P = Ye, I = P.requery, U = P.signal, V = function(q, Q, H, Z) { var ie = zi["idb://".concat(q, "/").concat(Q)]; if (!ie) return []; if (!(Q = ie.queries[H])) return [null, !1, ie, null]; var se = Q[(Z.query ? Z.query.index.name : null) || ""]; if (!se) return [null, !1, ie, null]; switch (H) { case "query": var fe = se.find(function(Ae) { return Ae.req.limit === Z.limit && Ae.req.values === Z.values && _c(Ae.req.query.range, Z.query.range); }); return fe ? [fe, !0, ie, se] : [se.find(function(Ae) { return ("limit" in Ae.req ? Ae.req.limit : 1 / 0) >= Z.limit && (!Z.values || Ae.req.values) && wc(Ae.req.query.range, Z.query.range); }), !1, ie, se]; case "count": return fe = se.find(function(Ae) { return _c(Ae.req.query.range, Z.query.range); }), [fe, !!fe, ie, se]; } }(h, g, "query", N), K = V[0], P = V[1], G = V[2], B = V[3]; return K && P ? K.obsSet = N.obsSet : (P = _.query(N).then(function(q) { var Q = q.result; if (K && (K.res = Q), A) { for (var H = 0, Z = Q.length; H < Z; ++H) Object.freeze(Q[H]); Object.freeze(Q); } else q.result = ot(Q); return q; }).catch(function(q) { return B && K && te(B, K), Promise.reject(q); }), K = { obsSet: N.obsSet, promise: P, subscribers: /* @__PURE__ */ new Set(), type: "query", req: N, dirty: !1 }, B ? B.push(K) : (B = [K], (G = G || (zi["idb://".concat(h, "/").concat(g)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[N.query.index.name || ""] = B)), Sc(K, B, I, U), K.promise.then(function(q) { return { result: Os(q.result, N, G == null ? void 0 : G.optimisticOps, _, K, A) }; }); } }); } }); } }; function No(c, h) { return new Proxy(c, { get: function(g, _, S) { return _ === "db" ? h : Reflect.get(g, _, S); } }); } var _r = (Dt.prototype.version = function(c) { if (isNaN(c) || c < 0.1) throw new Ce.Type("Given version is not a positive number"); if (c = Math.round(10 * c) / 10, this.idbdb || this._state.isBeingOpened) throw new Ce.Schema("Cannot add version when database is open"); this.verno = Math.max(this.verno, c); var h = this._versions, g = h.filter(function(_) { return _._cfg.version === c; })[0]; return g || (g = new this.Version(c), h.push(g), h.sort(fc), g.stores({}), this._state.autoSchema = !1, g); }, Dt.prototype._whenReady = function(c) { var h = this; return this.idbdb && (this._state.openComplete || Ye.letThrough || this._vip) ? c() : new je(function(g, _) { if (h._state.openComplete) return _(new Ce.DatabaseClosed(h._state.dbOpenError)); if (!h._state.isBeingOpened) { if (!h._state.autoOpen) return void _(new Ce.DatabaseClosed()); h.open().catch(et); } h._state.dbReadyPromise.then(g, _); }).then(c); }, Dt.prototype.use = function(c) { var h = c.stack, g = c.create, _ = c.level, S = c.name; return S && this.unuse({ stack: h, name: S }), c = this._middlewares[h] || (this._middlewares[h] = []), c.push({ stack: h, create: g, level: _ ?? 10, name: S }), c.sort(function(N, A) { return N.level - A.level; }), this; }, Dt.prototype.unuse = function(c) { var h = c.stack, g = c.name, _ = c.create; return h && this._middlewares[h] && (this._middlewares[h] = this._middlewares[h].filter(function(S) { return _ ? S.create !== _ : !!g && S.name !== g; })), this; }, Dt.prototype.open = function() { var c = this; return li(ii, function() { return Xf(c); }); }, Dt.prototype._close = function() { var c = this._state, h = ci.indexOf(this); if (0 <= h && ci.splice(h, 1), this.idbdb) { try { this.idbdb.close(); } catch { } this.idbdb = null; } c.isBeingOpened || (c.dbReadyPromise = new je(function(g) { c.dbReadyResolve = g; }), c.openCanceller = new je(function(g, _) { c.cancelOpen = _; })); }, Dt.prototype.close = function(g) { var h = (g === void 0 ? { disableAutoOpen: !0 } : g).disableAutoOpen, g = this._state; h ? (g.isBeingOpened && g.cancelOpen(new Ce.DatabaseClosed()), this._close(), g.autoOpen = !1, g.dbOpenError = new Ce.DatabaseClosed()) : (this._close(), g.autoOpen = this._options.autoOpen || g.isBeingOpened, g.openComplete = !1, g.dbOpenError = null); }, Dt.prototype.delete = function(c) { var h = this; c === void 0 && (c = { disableAutoOpen: !0 }); var g = 0 < arguments.length && typeof arguments[0] != "object", _ = this._state; return new je(function(S, N) { function A() { h.close(c); var I = h._deps.indexedDB.deleteDatabase(h.name); I.onsuccess = It(function() { var U, V, K; U = h._deps, V = h.name, K = U.indexedDB, U = U.IDBKeyRange, _o(K) || V === co || Du(K, U).delete(V).catch(et), S(); }), I.onerror = xn(N), I.onblocked = h._fireOnBlocked; } if (g) throw new Ce.InvalidArgument("Invalid closeOptions argument to db.delete()"); _.isBeingOpened ? _.dbReadyPromise.then(A) : A(); }); }, Dt.prototype.backendDB = function() { return this.idbdb; }, Dt.prototype.isOpen = function() { return this.idbdb !== null; }, Dt.prototype.hasBeenClosed = function() { var c = this._state.dbOpenError; return c && c.name === "DatabaseClosed"; }, Dt.prototype.hasFailed = function() { return this._state.dbOpenError !== null; }, Dt.prototype.dynamicallyOpened = function() { return this._state.autoSchema; }, Object.defineProperty(Dt.prototype, "tables", { get: function() { var c = this; return l(this._allTables).map(function(h) { return c._allTables[h]; }); }, enumerable: !1, configurable: !0 }), Dt.prototype.transaction = function() { var c = (function(h, g, _) { var S = arguments.length; if (S < 2) throw new Ce.InvalidArgument("Too few arguments"); for (var N = new Array(S - 1); --S; ) N[S - 1] = arguments[S]; return _ = N.pop(), [h, ut(N), _]; }).apply(this, arguments); return this._transaction.apply(this, c); }, Dt.prototype._transaction = function(c, h, g) { var _ = this, S = Ye.trans; S && S.db === this && c.indexOf("!") === -1 || (S = null); var N, A, I = c.indexOf("?") !== -1; c = c.replace("!", "").replace("?", ""); try { if (A = h.map(function(V) { if (V = V instanceof _.Table ? V.name : V, typeof V != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed"); return V; }), c == "r" || c === ks) N = ks; else { if (c != "rw" && c != xu) throw new Ce.InvalidArgument("Invalid transaction mode: " + c); N = xu; } if (S) { if (S.mode === ks && N === xu) { if (!I) throw new Ce.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY"); S = null; } S && A.forEach(function(V) { if (S && S.storeNames.indexOf(V) === -1) { if (!I) throw new Ce.SubTransaction("Table " + V + " not included in parent transaction."); S = null; } }), I && S && !S.active && (S = null); } } catch (V) { return S ? S._promise(null, function(K, P) { P(V); }) : Xt(V); } var U = (function V(K, P, G, B, q) { return je.resolve().then(function() { var Q = Ye.transless || Ye, H = K._createTransaction(P, G, K._dbSchema, B); if (H.explicit = !0, Q = { trans: H, transless: Q }, B) H.idbtrans = B.idbtrans; else try { H.create(), H.idbtrans._explicit = !0, K._state.PR1398_maxLoop = 3; } catch (se) { return se.name === Te.InvalidState && K.isOpen() && 0 < --K._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), K.close({ disableAutoOpen: !1 }), K.open().then(function() { return V(K, P, G, null, q); })) : Xt(se); } var Z, ie = D(q); return ie && vs(), Q = je.follow(function() { var se; (Z = q.call(H, H)) && (ie ? (se = Nn.bind(null, null), Z.then(se, se)) : typeof Z.next == "function" && typeof Z.throw == "function" && (Z = bo(Z))); }, Q), (Z && typeof Z.then == "function" ? je.resolve(Z).then(function(se) { return H.active ? se : Xt(new Ce.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")); }) : Q.then(function() { return Z; })).then(function(se) { return B && H._resolve(), H._completion.then(function() { return se; }); }).catch(function(se) { return H._reject(se), Xt(se); }); }); }).bind(null, this, N, A, S, g); return S ? S._promise(N, U, "lock") : Ye.trans ? li(Ye.transless, function() { return _._whenReady(U); }) : this._whenReady(U); }, Dt.prototype.table = function(c) { if (!b(this._allTables, c)) throw new Ce.InvalidTable("Table ".concat(c, " does not exist")); return this._allTables[c]; }, Dt); function Dt(c, h) { var g = this; this._middlewares = {}, this.verno = 0; var _ = Dt.dependencies; this._options = h = i({ addons: Dt.addons, autoOpen: !0, indexedDB: _.indexedDB, IDBKeyRange: _.IDBKeyRange, cache: "cloned" }, h), this._deps = { indexedDB: h.indexedDB, IDBKeyRange: h.IDBKeyRange }, _ = h.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this; var S, N, A, I, U, V = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: et, dbReadyPromise: null, cancelOpen: et, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: h.autoOpen }; V.dbReadyPromise = new je(function(P) { V.dbReadyResolve = P; }), V.openCanceller = new je(function(P, G) { V.cancelOpen = G; }), this._state = V, this.name = c, this.on = fi(this, "populate", "blocked", "versionchange", "close", { ready: [Oe, et] }), this.on.ready.subscribe = le(this.on.ready.subscribe, function(P) { return function(G, B) { Dt.vip(function() { var q, Q = g._state; Q.openComplete ? (Q.dbOpenError || je.resolve().then(G), B && P(G)) : Q.onReadyBeingFired ? (Q.onReadyBeingFired.push(G), B && P(G)) : (P(G), q = g, B || P(function H() { q.on.ready.unsubscribe(G), q.on.ready.unsubscribe(H); })); }); }; }), this.Collection = (S = this, Fr(Tt.prototype, function(Z, H) { this.db = S; var B = fo, q = null; if (H) try { B = H(); } catch (ie) { q = ie; } var Q = Z._ctx, H = Q.table, Z = H.hook.reading.fire; this._ctx = { table: H, index: Q.index, isPrimKey: !Q.index || H.schema.primKey.keyPath && Q.index === H.schema.primKey.name, range: B, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: q, or: Q.or, valueMapper: Z !== tn ? Z : null }; })), this.Table = (N = this, Fr(cc.prototype, function(P, G, B) { this.db = N, this._tx = B, this.name = P, this.schema = G, this.hook = N._allTables[P] ? N._allTables[P].hook : fi(null, { creating: [Yt, et], reading: [Bt, tn], updating: [$e, et], deleting: [Lt, et] }); })), this.Transaction = (A = this, Fr(po.prototype, function(P, G, B, q, Q) { var H = this; this.db = A, this.mode = P, this.storeNames = G, this.schema = B, this.chromeTransactionDurability = q, this.idbtrans = null, this.on = fi(this, "complete", "error", "abort"), this.parent = Q || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new je(function(Z, ie) { H._resolve = Z, H._reject = ie; }), this._completion.then(function() { H.active = !1, H.on.complete.fire(); }, function(Z) { var ie = H.active; return H.active = !1, H.on.error.fire(Z), H.parent ? H.parent._reject(Z) : ie && H.idbtrans && H.idbtrans.abort(), Xt(Z); }); })), this.Version = (I = this, Fr(Lu.prototype, function(P) { this.db = I, this._cfg = { version: P, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null }; })), this.WhereClause = (U = this, Fr(jr.prototype, function(P, G, B) { if (this.db = U, this._ctx = { table: P, index: G === ":id" ? null : G, or: B }, this._cmp = this._ascending = lt, this._descending = function(q, Q) { return lt(Q, q); }, this._max = function(q, Q) { return 0 < lt(q, Q) ? q : Q; }, this._min = function(q, Q) { return lt(q, Q) < 0 ? q : Q; }, this._IDBKeyRange = U._deps.IDBKeyRange, !this._IDBKeyRange) throw new Ce.MissingAPI(); })), this.on("versionchange", function(P) { 0 < P.newVersion ? console.warn("Another connection wants to upgrade database '".concat(g.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(g.name, "'. Closing db now to resume the delete request.")), g.close({ disableAutoOpen: !1 }); }), this.on("blocked", function(P) { !P.newVersion || P.newVersion < P.oldVersion ? console.warn("Dexie.delete('".concat(g.name, "') was blocked")) : console.warn("Upgrade '".concat(g.name, "' blocked by other connection holding version ").concat(P.oldVersion / 10)); }), this._maxKey = go(h.IDBKeyRange), this._createTransaction = function(P, G, B, q) { return new g.Transaction(P, G, B, g._options.chromeTransactionDurability, q); }, this._fireOnBlocked = function(P) { g.on("blocked").fire(P), ci.filter(function(G) { return G.name === g.name && G !== g && !G._state.vcFired; }).map(function(G) { return G.on("versionchange").fire(P); }); }, this.use(eh), this.use(bc), this.use(th), this.use(Jf), this.use(Zf); var K = new Proxy(this, { get: function(P, G, B) { if (G === "_vip") return !0; if (G === "table") return function(Q) { return No(g.table(Q), K); }; var q = Reflect.get(P, G, B); return q instanceof cc ? No(q, K) : G === "tables" ? q.map(function(Q) { return No(Q, K); }) : G === "_createTransaction" ? function() { return No(q.apply(this, arguments), K); } : q; } }); this.vip = K, _.forEach(function(P) { return P(g); }); } var Ea, Un = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", nh = (Na.prototype.subscribe = function(c, h, g) { return this._subscribe(c && typeof c != "function" ? c : { next: c, error: h, complete: g }); }, Na.prototype[Un] = function() { return this; }, Na); function Na(c) { this._subscribe = c; } try { Ea = { indexedDB: a.indexedDB || a.mozIndexedDB || a.webkitIndexedDB || a.msIndexedDB, IDBKeyRange: a.IDBKeyRange || a.webkitIDBKeyRange }; } catch { Ea = { indexedDB: null, IDBKeyRange: null }; } function Uu(c) { var h, g = !1, _ = new nh(function(S) { var N = D(c), A, I = !1, U = {}, V = {}, K = { get closed() { return I; }, unsubscribe: function() { I || (I = !0, A && A.abort(), P && Br.storagemutated.unsubscribe(B)); } }; S.start && S.start(K); var P = !1, G = function() { return da(q); }, B = function(Q) { ka(U, Q), Fu(V, U) && G(); }, q = function() { var Q, H, Z; !I && Ea.indexedDB && (U = {}, Q = {}, A && A.abort(), A = new AbortController(), Z = function(ie) { var se = oi(); try { N && vs(); var fe = ai(c, ie); return fe = N ? fe.finally(Nn) : fe; } finally { se && Ii(); } }(H = { subscr: Q, signal: A.signal, requery: G, querier: c, trans: null }), Promise.resolve(Z).then(function(ie) { g = !0, h = ie, I || H.signal.aborted || (U = {}, function(se) { for (var fe in se) if (b(se, fe)) return; return 1; }(V = Q) || P || (Br(jn, B), P = !0), da(function() { return !I && S.next && S.next(ie); })); }, function(ie) { g = !1, ["DatabaseClosedError", "AbortError"].includes(ie == null ? void 0 : ie.name) || I || da(function() { I || S.error && S.error(ie); }); })); }; return setTimeout(G, 0), K; }); return _.hasValue = function() { return g; }, _.getValue = function() { return h; }, _; } var ir = _r; function Hi(c) { var h = sr; try { sr = !0, Br.storagemutated.fire(c), $u(c, !0); } finally { sr = h; } } w(ir, i(i({}, wt), { delete: function(c) { return new ir(c, { addons: [] }).delete(); }, exists: function(c) { return new ir(c, { addons: [] }).open().then(function(h) { return h.close(), !0; }).catch("NoSuchDatabaseError", function() { return !1; }); }, getDatabaseNames: function(c) { try { return h = ir.dependencies, g = h.indexedDB, h = h.IDBKeyRange, (_o(g) ? Promise.resolve(g.databases()).then(function(_) { return _.map(function(S) { return S.name; }).filter(function(S) { return S !== co; }); }) : Du(g, h).toCollection().primaryKeys()).then(c); } catch { return Xt(new Ce.MissingAPI()); } var h, g; }, defineClass: function() { return function(c) { p(this, c); }; }, ignoreTransaction: function(c) { return Ye.trans ? li(Ye.transless, c) : c(); }, vip: wo, async: function(c) { return function() { try { var h = bo(c.apply(this, arguments)); return h && typeof h.then == "function" ? h : je.resolve(h); } catch (g) { return Xt(g); } }; }, spawn: function(c, h, g) { try { var _ = bo(c.apply(g, h || [])); return _ && typeof _.then == "function" ? _ : je.resolve(_); } catch (S) { return Xt(S); } }, currentTransaction: { get: function() { return Ye.trans || null; } }, waitFor: function(c, h) { return h = je.resolve(typeof c == "function" ? ir.ignoreTransaction(c) : c).timeout(h || 6e4), Ye.trans ? Ye.trans.waitFor(h) : h; }, Promise: je, debug: { get: function() { return tt; }, set: function(c) { Rt(c); } }, derive: x, extend: p, props: w, override: le, Events: fi, on: Br, liveQuery: Uu, extendObservabilitySet: ka, getByKeyPath: ye, setByKeyPath: me, delByKeyPath: function(c, h) { typeof h == "string" ? me(c, h, void 0) : "length" in h && [].map.call(h, function(g) { me(c, g, void 0); }); }, shallowClone: Fe, deepClone: ot, getObjectDiff: ju, cmp: lt, asap: he, minKey: -1 / 0, addons: [], connections: ci, errnames: Te, dependencies: Ea, cache: zi, semVer: "4.0.11", version: "4.0.11".split(".").map(function(c) { return parseInt(c); }).reduce(function(c, h, g) { return c + h / Math.pow(10, 2 * g); }) })), ir.maxKey = go(ir.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Br(jn, function(c) { sr || (c = new CustomEvent(Iu, { detail: c }), sr = !0, dispatchEvent(c), sr = !1); }), addEventListener(Iu, function(c) { c = c.detail, sr || Hi(c); })); var Ts, sr = !1, Ec = function() { }; return typeof BroadcastChannel < "u" && ((Ec = function() { (Ts = new BroadcastChannel(Iu)).onmessage = function(c) { return c.data && Hi(c.data); }; })(), typeof Ts.unref == "function" && Ts.unref(), Br(jn, function(c) { sr || Ts.postMessage(c); })), typeof addEventListener < "u" && (addEventListener("pagehide", function(c) { if (!_r.disableBfCache && c.persisted) { tt && console.debug("Dexie: handling persisted pagehide"), Ts != null && Ts.close(); for (var h = 0, g = ci; h < g.length; h++) g[h].close({ disableAutoOpen: !1 }); } }), addEventListener("pageshow", function(c) { !_r.disableBfCache && c.persisted && (tt && console.debug("Dexie: handling persisted pageshow"), Ec(), Hi({ all: new rn(-1 / 0, [[]]) })); })), je.rejectionMapper = function(c, h) { return !c || c instanceof Ve || c instanceof TypeError || c instanceof SyntaxError || !c.name || !kt[c.name] ? c : (h = new kt[c.name](h || c.message, c), "stack" in c && O(h, "stack", { get: function() { return this.inner.stack; } }), h); }, Rt(tt), i(_r, Object.freeze({ __proto__: null, Dexie: _r, liveQuery: Uu, Entity: ac, cmp: lt, PropModification: ho, replacePrefix: function(c, h) { return new ho({ replacePrefix: [c, h] }); }, add: function(c) { return new ho({ add: c }); }, remove: function(c) { return new ho({ remove: c }); }, default: _r, RangeSet: rn, mergeRanges: So, rangesOverlap: hc }), { default: _r }), _r; }); }(Rd)), Rd.exports; } var VA = BA(); const Rm = /* @__PURE__ */ Wl(VA), Sk = Symbol.for("Dexie"), Yd = globalThis[Sk] || (globalThis[Sk] = Rm); if (Rm.semVer !== Yd.semVer) throw new Error(`Two different versions of Dexie loaded in the same app: ${Rm.semVer} and ${Yd.semVer}`); const { liveQuery: tD, mergeRanges: nD, rangesOverlap: rD, RangeSet: iD, cmp: sD, Entity: oD, PropModification: aD, replacePrefix: uD, add: lD, remove: cD } = Yd; class hS extends Yd { constructor(n, i, o = {}) { super(n); de(this, "logs"); const a = { logs: "id, level, time, source, account" }; this.version(i).stores({ ...a, ...o }); } } class zA extends hS { constructor() { super("nizza", 1); } } class pS { constructor(e, n) { de(this, "logger"); de(this, "channel"); de(this, "listeners", /* @__PURE__ */ new Map()); de(this, "eventQueue", /* @__PURE__ */ new Map()); this.logger = n.child("EventBus"); try { this.logger.debug(`Creating BroadcastChannel with name "${e}"`), this.channel = new BroadcastChannel(e), this.channel.onmessage = (i) => this.handleMessage(i), this.channel.onmessageerror = (i) => this.logger.error("NizzaBroadcastChannel error:", i); } catch (i) { throw this.logger.error("Failed to create NizzaBroadcastChannel:", i), i; } } /** * Subscribe a listener function to a specific event with wildcards. * * @param {string} pattern - The event name to subscribe to. You can use wildcards like 'user:*' or 'chat:**'. * @param {EventBusListener} listener - The listener function to handle the event. * @returns {EventBusSubscription} - A subscription object that includes the event name and the `off()` function for unsubscribing. * @example * const subscription = eventBus.on('user:*', (event) => { * console.log('User event:', event.name); * }); * const chatSubscription = eventBus.on('chat:**', (event) => { * console.log('Chat event:', event.name); * }); */ on(e, n) { return this.logger.debug(`Subscribing to pattern "${e}"`), this.subscribeToEvent(e, n), { off: () => this.unsubscribeFromEvent(e, n) }; } /** * Emit an event through the BroadcastChannel. * * @param {string} event - The event name to emit. * @param {any} data - The data associated with the event. * @param {Attributes} attrs - Optional attributes associated with the event. * @example * // Emit a user login event * eventBus.emit('user:login', { username: 'user123' }); * * // Emit a chat message event * eventBus.emit('chat:message', { text: 'Hello, world!' }); */ emit(e, n, i = {}) { this.logger.debug(`Emitting event "${e}" with data`, n), this.emitEvent(e, n, i); } /** * Handle messages received through the BroadcastChannel and call the corresponding listener functions. * * @private * @param {MessageEvent} event - The received message event. */ handleMessage(e) { const n = e.data, { name: i } = n; this.logger.debug(`Received message "${i}" with data`, n); for (const [o, a] of this.listeners.entries()) this.matchWildcard(o, i) && (this.logger.debug(`Matching pattern "${o}" for event "${i}"`), a.forEach( (l) => l({ ...n, wildcard: o }) )); } /** * Subscribe a listener function to a specific event. * * @private * @param {string} pattern - The pattern to subscribe to. * @param {EventBusListener} listener - The listener function to handle the event. */ subscribeToEvent(e, n) { if (typeof e != "string" || typeof n != "function") { const o = new Error("Invalid arguments"); throw this.logger.error(o), o; } this.listeners.has(e) || (this.logger.debug(`Adding new pattern "${e}"`), this.listeners.set(e, /* @__PURE__ */ new Set())); const i = Array.from(this.eventQueue).filter(([o]) => { const a = this.matchWildcard(e, o); return a && (this.eventQueue.delete(o), this.logger.debug(`Dequeued pending events for "${o}".`)), a; }).flatMap(([, o]) => o); for (const [o, a] of this.listeners.entries()) this.matchWildcard(o, e) && (this.logger.debug(`Adding listener to pattern "${o}"`), a.add(n), i.length && (this.logger.debug(`Delivering pending events for "${e}".`), i.forEach((l) => { n({ ...l, wildcard: o }); }))); } /** * Emit an event and deliver it to the corresponding listeners. * * @private * @param {string} event - The event name to emit. * @param {any} data - The data associated with the event. * @param {Attributes} attrs - Optional attributes associated with the event. */ emitEvent(e, n, i) { if (typeof e != "string") { const l = new Error("Invalid arguments"); throw this.logger.error(l), l; } const o = { name: e, data: n, attrs: i }, a = Array.from(this.getMatchingListeners(e)); if (a.length) { this.logger.debug(`Delivering event "${e}" to listeners`); for (const [l, f] of a) f({ ...o, wildcard: l }); } else this.logger.debug(`No listeners for event "${e}", enqueuing`), this.eventQueue.has(e) || this.eventQueue.set(e, []), this.eventQueue.get(e).push(o); this.logger.debug("Posting message to channel", o), this.channel.postMessage(o); } /** * Get listeners that match the event name pattern. * * @private * @param {string} event - The event name to match. * @returns {Iterable<[string, EventBusListener]>} - Iterable of matching listeners and their patterns. */ *getMatchingListeners(e) { this.logger.debug(`Getting matching listeners for event "${e}"`); for (const [n, i] of this.listeners.entries()) if (this.matchWildcard(n, e)) for (const o of i) yield [n, o]; } /** * Unsubscribe a listener function from a specific event. * * @private * @param {string} event - The event name to unsubscribe from. * @param {EventBusListener} listener - The listener function to unsubscribe. */ unsubscribeFromEvent(e, n) { if (this.listeners.has(e)) { this.logger.debug(`Unsubscribing from event "${e}"`); const i = this.listeners.get(e); i.delete(n), i.size === 0 && (this.logger.debug(`No more listeners for event "${e}", deleting`), this.listeners.delete(e)); } } /** * Match wildcards in event names. * * @private * @param {string} wildcard - The wildcard pattern to match. * @param {string} pattern - The event name to check. * @returns {boolean} - `true` if the event name matches the pattern, otherwise `false`. */ matchWildcard(e, n) { const i = e.replace(/\*/g, "[^:]*").replace(/\*\*/g, ".*"), a = new RegExp(`^${i}$`).test(n); return this.logger.debug( `Wildcard "${e}" matches with pattern "${n}": ${a}` ), a; } } var ml = { exports: {} }, Fp, bk; function HA() { if (bk) return Fp; bk = 1; function t(n) { try { return JSON.stringify(n); } catch { return '"[Circular]"'; } } Fp = e; function e(n, i, o) { var a = o && o.stringify || t, l = 1; if (typeof n == "object" && n !== null) { var f = i.length + l; if (f === 1) return n; var p = new Array(f); p[0] = a(n); for (var v = 1; v < f; v++) p[v] = a(i[v]); return p.join(" "); } if (typeof n != "string") return n; var k = i.length; if (k === 0) return n; for (var b = "", w = 1 - l, T = -1, O = n && n.length || 0, x = 0; x < O; ) { if (n.charCodeAt(x) === 37 && x + 1 < O) { switch (T = T > -1 ? T : 0, n.charCodeAt(x + 1)) { case 100: // 'd' case 102: if (w >= k || i[w] == null) break; T < x && (b += n.slice(T, x)), b += Number(i[w]), T = x + 2, x++; break; case 105: if (w >= k || i[w] == null) break; T < x && (b += n.slice(T, x)), b += Math.floor(Number(i[w])), T = x + 2, x++; break; case 79: // 'O' case 111: // 'o' case 106: if (w >= k || i[w] === void 0) break; T < x && (b += n.slice(T, x)); var C = typeof i[w]; if (C === "string") { b += "'" + i[w] + "'", T = x + 2, x++; break; } if (C === "function") { b += i[w].name || "", T = x + 2, x++; break; } b += a(i[w]), T = x + 2, x++; break; case 115: if (w >= k) break; T < x && (b += n.slice(T, x)), b += String(i[w]), T = x + 2, x++; break; case 37: T < x && (b += n.slice(T, x)), b += "%", T = x + 2, x++, w--; break; } ++w; } ++x; } return T === -1 ? n : (T < O && (b += n.slice(T)), b); } return Fp; } var Ek; function qA() { if (Ek) return ml.exports; Ek = 1; const t = HA(); ml.exports = k; const e = W().console || {}, n = { mapHttpRequest: me, mapHttpResponse: me, wrapRequestSerializer: Fe, wrapResponseSerializer: Fe, wrapErrorSerializer: Fe, req: me, res: me, err: he, errWithCause: he }; function i(L, oe) { return L === "silent" ? 1 / 0 : oe.levels.values[L]; } const o = Symbol("pino.logFuncs"), a = Symbol("pino.hierarchy"), l = { error: "log", fatal: "error", warn: "error", info: "log", debug: "log", trace: "log" }; function f(L, oe) { const ge = { logger: oe, parent: L[a] }; oe[a] = ge; } function p(L, oe, ge) { const te = {}; oe.forEach((ue) => { te[ue] = ge[ue] ? ge[ue] : e[ue] || e[l[ue] || "log"] || Re; }), L[o] = te; } function v(L, oe) { return Array.isArray(L) ? L.filter(function(te) { return te !== "!stdSerializers.err"; }) : L === !0 ? Object.keys(oe) : !1; } function k(L) { L = L || {}, L.browser = L.browser || {}; const oe = L.browser.transmit; if (oe && typeof oe.send != "function") throw Error("pino: transmit option must have a send function"); const ge = L.browser.write || e; L.browser.write && (L.browser.asObject = !0); const te = L.serializers || {}, ue = v(L.browser.serialize, te); let M = L.browser.serialize; Array.isArray(L.browser.serialize) && L.browser.serialize.indexOf("!stdSerializers.err") > -1 && (M = !1); const D = Object.keys(L.customLevels || {}), ae = ["error", "fatal", "warn", "info", "debug", "trace"].concat(D); typeof ge == "function" && ae.forEach(function(kt) { ge[kt] = ge; }), (L.enabled === !1 || L.browser.disabled) && (L.level = "silent"); const Ve = L.level || "info", F = Object.create(ge); F.log || (F.log = Re), p(F, ae, ge), f({}, F), Object.defineProperty(F, "levelVal", { get: nt }), Object.defineProperty(F, "level", { get: Te, set: ze }); const Y = { transmit: oe, serialize: ue, asObject: L.browser.asObject, formatters: L.browser.formatters, levels: ae, timestamp: ye(L), messageKey: L.messageKey || "msg", onChild: L.onChild || Re }; F.levels = b(L), F.level = Ve, F.setMaxListeners = F.getMaxListeners = F.emit = F.addListener = F.on = F.prependListener = F.once = F.prependOnceListener = F.removeListener = F.removeAllListeners = F.listeners = F.listenerCount = F.eventNames = F.write = F.flush = Re, F.serializers = te, F._serialize = ue, F._stdErrSerialize = M, F.child = function(...kt) { return Ce.call(this, Y, ...kt); }, oe && (F._logEvent = ne()); function nt() { return i(this.level, this); } function Te() { return this._level; } function ze(kt) { if (kt !== "silent" && !this.levels.values[kt]) throw Error("unknown level " + kt); this._level = kt, O(this, Y, F, "error"), O(this, Y, F, "fatal"), O(this, Y, F, "warn"), O(this, Y, F, "info"), O(this, Y, F, "debug"), O(this, Y, F, "trace"), D.forEach((wt) => { O(this, Y, F, wt); }); } function Ce(kt, wt, et) { if (!wt) throw new Error("missing bindings for child Pino"); et = et || {}, ue && wt.serializers && (et.serializers = wt.serializers); const tn = et.serializers; if (ue && tn) { var Bt = Object.assign({}, te, tn), Ze = L.browser.serialize === !0 ? Object.keys(Bt) : ue; delete wt.serializers, J([wt], Ze, Bt, this._stdErrSerialize); } function Yt($e) { this._childLevel = ($e._childLevel | 0) + 1, this.bindings = wt, Bt && (this.serializers = Bt, this._serialize = Ze), oe && (this._logEvent = ne( [].concat($e._logEvent.bindings, wt) )); } Yt.prototype = this; const Lt = new Yt(this); return f(this, Lt), Lt.child = function(...$e) { return Ce.call(this, kt, ...$e); }, Lt.level = et.level || this.level, kt.onChild(Lt), Lt; } return F; } function b(L) { const oe = L.customLevels || {}, ge = Object.assign({}, k.levels.values, oe), te = Object.assign({}, k.levels.labels, w(oe)); return { values: ge, labels: te }; } function w(L) { const oe = {}; return Object.keys(L).forEach(function(ge) { oe[L[ge]] = ge; }), oe; } k.levels = { values: { fatal: 60, error: 50, warn: 40, info: 30, debug: 20, trace: 10 }, labels: { 10: "trace", 20: "debug", 30: "info", 40: "warn", 50: "error", 60: "fatal" } }, k.stdSerializers = n, k.stdTimeFunctions = Object.assign({}, { nullTime: ut, epochTime: He, unixTime: We, isoTime: ot }); function T(L) { const oe = []; L.bindings && oe.push(L.bindings); let ge = L[a]; for (; ge.parent; ) ge = ge.parent, ge.logger.bindings && oe.push(ge.logger.bindings); return oe.reverse(); } function O(L, oe, ge, te) { if (Object.defineProperty(L, te, { value: i(L.level, ge) > i(te, ge) ? Re : ge[o][te], writable: !0, enumerable: !0, configurable: !0 }), L[te] === Re) { if (!oe.transmit) return; const M = oe.transmit.level || L.level, D = i(M, ge); if (i(te, ge) < D) return; } L[te] = C(L, oe, ge, te); const ue = T(L); ue.length !== 0 && (L[te] = x(ue, L[te])); } function x(L, oe) { return function() { return oe.apply(this, [...L, ...arguments]); }; } function C(L, oe, ge, te) { return /* @__PURE__ */ function(ue) { return function() { const D = oe.timestamp(), ae = new Array(arguments.length), Ve = Object.getPrototypeOf && Object.getPrototypeOf(this) === e ? e : this; for (var F = 0; F < ae.length; F++) ae[F] = arguments[F]; var Y = !1; if (oe.serialize && (J(ae, this._serialize, this.serializers, this._stdErrSerialize), Y = !0), oe.asObject || oe.formatters ? ue.call(Ve, $(this, te, ae, D, oe)) : ue.apply(Ve, ae), oe.transmit) { const nt = oe.transmit.level || L._level, Te = i(nt, ge), ze = i(te, ge); if (ze < Te) return; le(this, { ts: D, methodLevel: te, methodValue: ze, transmitValue: ge.levels.values[oe.transmit.level || L._level], send: oe.transmit.send, val: i(L._level, ge) }, ae, Y); } }; }(L[o][te]); } function $(L, oe, ge, te, ue) { const { level: M, log: D = (Te) => Te } = ue.formatters || {}, ae = ge.slice(); let Ve = ae[0]; const F = {}; if (te && (F.time = te), M) { const Te = M(oe, L.levels.values[oe]); Object.assign(F, Te); } else F.level = L.levels.values[oe]; let Y = (L._childLevel | 0) + 1; if (Y < 1 && (Y = 1), Ve !== null && typeof Ve == "object") { for (; Y-- && typeof ae[0] == "object"; ) Object.assign(F, ae.shift()); Ve = ae.length ? t(ae.shift(), ae) : void 0; } else typeof Ve == "string" && (Ve = t(ae.shift(), ae)); return Ve !== void 0 && (F[ue.messageKey] = Ve), D(F); } function J(L, oe, ge, te) { for (const ue in L) if (te && L[ue] instanceof Error) L[ue] = k.stdSerializers.err(L[ue]); else if (typeof L[ue] == "object" && !Array.isArray(L[ue]) && oe) for (const M in L[ue]) oe.indexOf(M) > -1 && M in ge && (L[ue][M] = ge[M](L[ue][M])); } function le(L, oe, ge, te = !1) { const ue = oe.send, M = oe.ts, D = oe.methodLevel, ae = oe.methodValue, Ve = oe.val, F = L._logEvent.bindings; te || J( ge, L._serialize || Object.keys(L.serializers), L.serializers, L._stdErrSerialize === void 0 ? !0 : L._stdErrSerialize ), L._logEvent.ts = M, L._logEvent.messages = ge.filter(function(Y) { return F.indexOf(Y) === -1; }), L._logEvent.level.label = D, L._logEvent.level.value = ae, ue(D, L._logEvent, Ve), L._logEvent = ne(F); } function ne(L) { return { ts: 0, messages: [], bindings: L || [], level: { label: "", value: 0 } }; } function he(L) { const oe = { type: L.constructor.name, msg: L.message, stack: L.stack }; for (const ge in L) oe[ge] === void 0 && (oe[ge] = L[ge]); return oe; } function ye(L) { return typeof L.timestamp == "function" ? L.timestamp : L.timestamp === !1 ? ut : He; } function me() { return {}; } function Fe(L) { return L; } function Re() { } function ut() { return !1; } function He() { return Date.now(); } function We() { return Math.round(Date.now() / 1e3); } function ot() { return new Date(Date.now()).toISOString(); } function W() { function L(oe) { return typeof oe < "u" && oe; } try { return typeof globalThis < "u" || Object.defineProperty(Object.prototype, "globalThis", { get: function() { return delete Object.prototype.globalThis, this.globalThis = this; }, configurable: !0 }), globalThis; } catch { return L(self) || L(window) || L(this) || {}; } } return ml.exports.default = k, ml.exports.pino = k, ml.exports; } var KA = qA(); const GA = /* @__PURE__ */ Wl(KA), bn = []; for (let t = 0; t < 256; ++t) bn.push((t + 256).toString(16).slice(1)); function WA(t, e = 0) { return (bn[t[e + 0]] + bn[t[e + 1]] + bn[t[e + 2]] + bn[t[e + 3]] + "-" + bn[t[e + 4]] + bn[t[e + 5]] + "-" + bn[t[e + 6]] + bn[t[e + 7]] + "-" + bn[t[e + 8]] + bn[t[e + 9]] + "-" + bn[t[e + 10]] + bn[t[e + 11]] + bn[t[e + 12]] + bn[t[e + 13]] + bn[t[e + 14]] + bn[t[e + 15]]).toLowerCase(); } let Mp; const QA = new Uint8Array(16); function YA() { if (!Mp) { if (typeof crypto > "u" || !crypto.getRandomValues) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); Mp = crypto.getRandomValues.bind(crypto); } return Mp(QA); } const XA = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Nk = { randomUUID: XA }; function mS(t, e, n) { var o; if (Nk.randomUUID && !t) return Nk.randomUUID(); t = t || {}; const i = t.random ?? ((o = t.rng) == null ? void 0 : o.call(t)) ?? YA(); if (i.length < 16) throw new Error("Random bytes length must be >= 16"); return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, WA(i); } const JA = 4; var gS = /* @__PURE__ */ ((t) => (t.CREATED = "CREATED", t.STARTING = "STARTING", t.LIVE = "LIVE", t.FINALIZED = "FINALIZED", t))(gS || {}); const ZA = { ALL: "*", CORE: "core:**", ADD_TO_CART_HOOKS: "core:addToCartHooks:**", LIVE_STREAMING_EVENT: "event:**", EVENT_CHAT: "event:chat:**", EVENT_PRODUCTS: "event:products:**", CUSTOMIZE_LIVE: "customize-live:**", PLAYER: "player:**", SNACK_SIZE_VIDEO: "ssv:**", SNACK_SIZE_VIDEO_ADMIN: "ssv-admin:**", UI: "ui:**", UTILS: "utils:**" }, yS = { EVENT_STATUS_CHANGED: "event:statusChanged", /** AddToCartHook events */ ATCH_ACTION_EXECUTED: "core:addToCartHooks:actionExecuted" }; var vS = /* @__PURE__ */ ((t) => (t.English = "en", t.Spanish = "es", t.Portuguese = "pt", t))(vS || {}), en = /* @__PURE__ */ ((t) => (t.TRACE = "trace", t.DEBUG = "debug", t.INFO = "info", t.WARN = "warn", t.ERROR = "error", t.FATAL = "fatal", t))(en || {}); const $t = { trace: 10, debug: 20, info: 30, warn: 40, error: 50, fatal: 60 }, kS = { [$t.trace]: "trace", [$t.debug]: "debug", [$t.info]: "info", [$t.warn]: "warn", [$t.error]: "error", [$t.fatal]: "fatal" /* FATAL */ }; var _S = /* @__PURE__ */ ((t) => (t.COMBO = "Combo", t.BADGE = "Badged", t))(_S || {}), Js = /* @__PURE__ */ ((t) => (t.VTEX = "VTEX", t.PLATFORM = "platform", t.CACE = "CACE", t.GLOBAL_PAGE = "globalPage", t.CUSTOMIZATION = "customization", t.FAST_STORE = "faststore", t.UNKNOWN = "unknown", t))(Js || {}); function wS(t) { return Object.values(en).includes( String(t).toLowerCase() ); } class wg extends Error { /** * Creates a new instance of InvalidLogLevelError. * @param level - The invalid log level. */ constructor(e) { super(`Invalid log level: ${e}`), this.name = "InvalidLogLevelError"; } } const Ln = class Ln { /** * Creates a new instance of PinoAdapter. * @param config - The adapter configuration. */ constructor(e) { de(this, "instance"); de(this, "httpLogger"); de(this, "consoleLogger"); de(this, "config"); this.config = e; const { source: n, levelService: i, metadata: o = {}, consoleLogger: a, httpLogger: l } = e; Ln.root ?? (Ln.root = Ln.createRootLogger( a, l )), Ln.mergeGlobalMetadata(o), this.instance = Ln.root.child({ source: n }), this.consoleLogger = a, this.httpLogger = l, this.setLevel(i.getLevel(n)); } /** * Creates the root pino logger with custom options. * @param source - The source context. * @param httpLogger - The HTTP logger for production logs. * @returns A root pino logger instance. */ static createRootLogger(e, n) { return GA({ customLevels: $t, browser: { write: (i) => { const { payload: o, options: a, stack: l, ...f } = i, p = { ...f, ...o }; a.silent || e.print(p, l), p.level >= $t[en.WARN] && n.save(p); } } }); } /** * Merges new metadata into the global metadata. * @param metadata - The metadata to merge. */ static mergeGlobalMetadata(e = {}) { Ln.globalMetadata = { ...Ln.globalMetadata, ...e }; } /** * Creates a child logger with an extended source context. * Any additional metadata provided is merged into the global metadata. * @param source - The additional source context. * @param metadata - Optional metadata to merge globally. * @returns A new PinoAdapter instance representing the child logger. */ child(e, n = {}) { return Ln.mergeGlobalMetadata(n), new Ln({ source: `${this.config.source}:${e}`, levelService: this.config.levelService, consoleLogger: this.consoleLogger, httpLogger: this.httpLogger }); } /** * Sets the logging level for this adapter. * @param level - The desired log level. */ setLevel(e) { this.instance.level = e; } /** * Updates the global metadata. All subsequent log entries will include the updated metadata. * @param metadata - The metadata to merge into the global metadata. */ setMetadata(e) { Ln.mergeGlobalMetadata(e); } /** * Formats a log entry into a structured log payload. * @param entry - The log entry to format. * @returns A formatted log entry. */ formatLogEntry(e) { const { content: n, stack: i, options: o = {} } = e, { message: a, args: l = [] } = n, f = mS(), p = {}; let v; return a instanceof Error ? (p.error = { name: a.name, message: a.message, stack: a.stack }, v = a.message) : v = typeof a == "object" ? JSON.stringify(a) : String(a), l.forEach((b, w) => this.formatArg(b, w, p)), { payload: { id: f, msg: v, data: p, ...Ln.globalMetadata }, options: o, stack: i }; } /** * Formats an individual argument and merges it into the data object. * @param arg - The argument to format. * @param idx - The index of the argument. * @param data - The accumulator for formatted data. */ formatArg(e, n, i) { if (e instanceof Error) { const o = i.error ? `error${n + 1}` : "error"; i[o] = { message: e.message, stack: e.stack, name: e.name }; } else typeof e == "object" && e !== null ? Object.assign(i, e) : i[`$${n}`] = String(e); } /** * Logs an entry at the specified level. * @param level - The log level method to call. * @param entry - The log entry. * @throws Will throw an error if the log level method is not supported. */ log(e, n) { if (typeof this.instance[e] != "function") throw new wg(e); const i = this.formatLogEntry(n); this.instance[e](i); } trace(e) { this.log("trace", e); } debug(e) { this.log("debug", e); } info(e) { this.log("info", e); } warn(e) { this.log("warn", e); } error(e) { this.log("error", e); } fatal(e) { this.log("fatal", e); } get source() { return this.config.source; } }; // Global metadata shared across all instances. de(Ln, "globalMetadata", {}), de(Ln, "root", null); let Im = Ln; const Ak = { stackExclusionPatterns: /\b(PinoAdapter|ConsoleLogger|LoggerChain|Logger|Proxy|Child|pino\.js)\b/, themes: { dark: { baseStyles: { timestamp: "color: #A9A9A9; font-weight: normal;", // LightGray source: "color: #B0B0B0; font-weight: normal;", // Gray, less emphasis context: "color: #FFFFFF; font-weight: bold;", // White, more emphasis defaultMessage: "color: #E5E5E5; font-weight: normal;" // Subtle light text }, levels: { [$t[en.TRACE]]: "color: #778899; font-weight: bold;", // SlateGray [$t[en.DEBUG]]: "color: #008B8B; font-weight: bold;", // DarkCyan [$t[en.INFO]]: "color: #00FFFF; font-weight: bold;", // Cyan [$t[en.WARN]]: "color: #FFD700; font-weight: bold;", // Gold [$t[en.ERROR]]: "color: #FF4500; font-weight: bold;", // OrangeRed [$t[en.FATAL]]: "color: #FF0000; font-weight: bold; text-shadow: 1px 1px 1px black;" // Bright Red with shadow }, messages: { [$t[en.WARN]]: "color: #FFD700; font-weight: normal;", // Gold, no bold [$t[en.ERROR]]: "color: #FF4500; font-weight: normal;", // OrangeRed, no bold [$t[en.FATAL]]: "color: #FF0000; font-weight: bold;" // Bright Red } }, light: { baseStyles: { timestamp: "color: #4D4D4D; font-weight: normal;", // DarkGray for contrast source: "color: #666666; font-weight: normal;", // Medium Gray, less emphasis context: "color: #000000; font-weight: bold;", // Black, more emphasis defaultMessage: "color: #333333; font-weight: normal;" // Dark text }, levels: { [$t[en.TRACE]]: "color: #6A5ACD; font-weight: bold;", // SlateBlue [$t[en.DEBUG]]: "color: #00509E; font-weight: bold;", // Rich Blue [$t[en.INFO]]: "color: #1E90FF; font-weight: bold;", // DodgerBlue [$t[en.WARN]]: "color: #FFA500; font-weight: bold;", // Orange [$t[en.ERROR]]: "color: #ff0033; font-weight: bold;", // FireBrick [$t[en.FATAL]]: "color: #D80000; font-weight: bold; text-shadow: 1px 1px 1px #660000;" // Strong Red with shadow }, messages: { [$t[en.WARN]]: "color: #FFA500; font-weight: normal;", // Orange, no bold [$t[en.ERROR]]: "color: #ff0033; font-weight: normal;", // FireBrick, no bold [$t[en.FATAL]]: "color: #D80000; font-weight: bold;" // Strong Red } } } }; class ex { constructor() { de(this, "theme"); this.theme = this.initializeTheme(), this.setupThemeChangeListener(); } /** * Initializes the theme based on localStorage or browser settings. * @returns 'light' or 'dark' */ initializeTheme() { const e = localStorage.getItem("log-theme"); return e === "light" || e === "dark" ? e : this.detectTheme(); } /** * Detects the current console theme based on browser settings. * @returns 'light' or 'dark' */ detectTheme() { return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } /** * Sets up a listener to detect changes in the browser's theme settings. */ setupThemeChangeListener() { window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => { this.theme = e.matches ? "dark" : "light"; }); } /** * Manually sets the theme and stores it in localStorage. * @param theme - 'light' or 'dark' */ static setTheme(e) { localStorage.setItem("consoleLoggerTheme", e); } /** * Formats and filters the stack trace. * @param stack - Raw stack trace. * @returns Filtered and formatted stack trace. */ formatStack(e) { return e.split(` `).filter((n) => !Ak.stackExclusionPatterns.test(n)).map((n) => n.replace(/^Error\s*/, "").trim()); } /** * Retrieves the appropriate style for a log level based on the theme. * @param level - Log level. * @returns Console style string. */ getStyles(e) { const n = Ak.themes[this.theme]; return { ...n.baseStyles, level: n.levels[e] || n.baseStyles.defaultMessage, message: n.messages[e] || n.baseStyles.defaultMessage }; } /** * Gets the current time formatted as HH:mm:ss.SSS. * @returns Formatted time string. */ getTime() { return (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: !1 }) + `.${(/* @__PURE__ */ new Date()).getMilliseconds().toString().padStart(3, "0")}`; } /** * Prints a formatted log entry to the console. * @param log - Log object containing level, source, message, and data. */ print({ level: e, source: n, msg: i, data: o }, a) { const [l, f, p] = n.split(":"), v = (kS[e] || "UNKNOWN").toUpperCase(), k = p ? `${p}: ` : "", b = f ? `:${f}` : "", w = this.getStyles(e); console.groupCollapsed( `%c${this.getTime()} %c${v} %c[${l}${b}] %c${k}%c${i}`, w.timestamp, w.level, w.source, w.context, w.message ), o && Object.keys(o).length && console.log("Data:", o); const T = this.formatStack(a || new Error().stack); T.length && console.log("Stack:", T.join(` `)), console.groupEnd(); } } const tx = { endpoint: `${ds.apiUrls.restV2}/v1/telemetry/logs`, batchSize: 500, flushInterval: 10, maxRetries: 5, retryBackoffFactor: 2, maxPayloadSize: 500 }; class Sg { constructor(e) { de(this, "config"); de(this, "isFlushing", !1); de(this, "retryCount", 0); de(this, "isFlushScheduled", !1); this.config = e, this.setupUnloadListener(); } static create(e) { const n = { ...tx, ...e }; if (!n.db) throw new Error("Invalid Dixie DB"); if (!n.project) throw new Error("Project name is required"); return new Sg(n); } async save(e) { const n = JSON.parse(JSON.stringify(e)); await this.config.db.logs.add(n), this.scheduleFlush(); } scheduleFlush(e = this.config.flushInterval * 1e3) { this.isFlushScheduled || this.isFlushing || (this.isFlushScheduled = !0, setTimeout(() => { this.isFlushScheduled = !1, this.flush(); }, e)); } async flush() { if (this.isFlushing) return; this.isFlushing = !0; let e = !1; try { await this.processLogsBatch(async (i) => { await this.sendLogs(i), await this.deleteLogs(i); }), this.retryCount = 0, e = !0; } catch (i) { this.logError("flush", i); } this.isFlushing = !1; const n = await this.hasPendingLogs(); !e && n ? this.handleRetry() : e && n && this.scheduleFlush(); } async processLogsBatch(e) { const n = await this.getLogsBatch(), i = this.splitLogsByPayloadSize(n); for (const o of i) await e(o); } async getLogsBatch(e = this.config.batchSize) { return this.config.db.logs.orderBy("time").limit(e).toArray(); } splitLogsByPayloadSize(e) { let n = [], i = 0; const o = []; return e.forEach((a) => { const l = JSON.stringify(a).length / 1024; i + l > this.config.maxPayloadSize && (o.push(n), n = [], i = 0), n.push(a), i += l; }), n.length > 0 && o.push(n), o; } async sendLogs(e) { const n = this.buildPayload(e); await Jn({ url: this.config.endpoint, method: "POST", body: n }); } buildPayload(e) { return JSON.stringify({ project: this.config.project, logs: e }); } async deleteLogs(e) { const n = e.map((i) => i.id); await this.config.db.logs.bulkDelete(n); } logError(e, n) { console.error(`[${e}]`, n); } handleRetry() { if (this.retryCount >= this.config.maxRetries) return; this.retryCount++; const e = this.config.flushInterval * Math.pow(this.config.retryBackoffFactor, this.retryCount) * 1e3; this.scheduleFlush(e); } async hasPendingLogs() { return await this.config.db.logs.count() > 0; } setupUnloadListener() { window.addEventListener("beforeunload", async () => { this.isFlushing || !await this.hasPendingLogs() || await this.processLogsBatch(async (e) => { const n = this.buildPayload(e); navigator.sendBeacon(this.config.endpoint, n) ? await this.deleteLogs(e) : console.warn( "Failed to send logs via sendBeacon; logs will remain in the database." ); }); }); } } var $p = {}, jp, xk; function Cf() { if (xk) return jp; xk = 1; const t = "\\\\/", e = `[^${t}]`, n = "\\.", i = "\\+", o = "\\?", a = "\\/", l = "(?=.)", f = "[^/]", p = `(?:${a}|$)`, v = `(?:^|${a})`, k = `${n}{1,2}${p}`, b = `(?!${n})`, w = `(?!${v}${k})`, T = `(?!${n}{0,1}${p})`, O = `(?!${k})`, x = `[^.${a}]`, C = `${f}*?`, J = { DOT_LITERAL: n, PLUS_LITERAL: i, QMARK_LITERAL: o, SLASH_LITERAL: a, ONE_CHAR: l, QMARK: f, END_ANCHOR: p, DOTS_SLASH: k, NO_DOT: b, NO_DOTS: w, NO_DOT_SLASH: T, NO_DOTS_SLASH: O, QMARK_NO_DOT: x, STAR: C, START_ANCHOR: v, SEP: "/" }, le = { ...J, SLASH_LITERAL: `[${t}]`, QMARK: e, STAR: `${e}*?`, DOTS_SLASH: `${n}{1,2}(?:[${t}]|$)`, NO_DOT: `(?!${n})`, NO_DOTS: `(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`, NO_DOT_SLASH: `(?!${n}{0,1}(?:[${t}]|$))`, NO_DOTS_SLASH: `(?!${n}{1,2}(?:[${t}]|$))`, QMARK_NO_DOT: `[^.${t}]`, START_ANCHOR: `(?:^|[${t}])`, END_ANCHOR: `(?:[${t}]|$)`, SEP: "\\" }, ne = { alnum: "a-zA-Z0-9", alpha: "a-zA-Z", ascii: "\\x00-\\x7F", blank: " \\t", cntrl: "\\x00-\\x1F\\x7F", digit: "0-9", graph: "\\x21-\\x7E", lower: "a-z", print: "\\x20-\\x7E ", punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~", space: " \\t\\r\\n\\v\\f", upper: "A-Z", word: "A-Za-z0-9_", xdigit: "A-Fa-f0-9" }; return jp = { MAX_LENGTH: 1024 * 64, POSIX_REGEX_SOURCE: ne, // regular expressions REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, // Replace globs with equivalent patterns to reduce parsing time. REPLACEMENTS: { "***": "*", "**/**": "**", "**/**/**": "**" }, // Digits CHAR_0: 48, /* 0 */ CHAR_9: 57, /* 9 */ // Alphabet chars. CHAR_UPPERCASE_A: 65, /* A */ CHAR_LOWERCASE_A: 97, /* a */ CHAR_UPPERCASE_Z: 90, /* Z */ CHAR_LOWERCASE_Z: 122, /* z */ CHAR_LEFT_PARENTHESES: 40, /* ( */ CHAR_RIGHT_PARENTHESES: 41, /* ) */ CHAR_ASTERISK: 42, /* * */ // Non-alphabetic chars. CHAR_AMPERSAND: 38, /* & */ CHAR_AT: 64, /* @ */ CHAR_BACKWARD_SLASH: 92, /* \ */ CHAR_CARRIAGE_RETURN: 13, /* \r */ CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ CHAR_COLON: 58, /* : */ CHAR_COMMA: 44, /* , */ CHAR_DOT: 46, /* . */ CHAR_DOUBLE_QUOTE: 34, /* " */ CHAR_EQUAL: 61, /* = */ CHAR_EXCLAMATION_MARK: 33, /* ! */ CHAR_FORM_FEED: 12, /* \f */ CHAR_FORWARD_SLASH: 47, /* / */ CHAR_GRAVE_ACCENT: 96, /* ` */ CHAR_HASH: 35, /* # */ CHAR_HYPHEN_MINUS: 45, /* - */ CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ CHAR_LEFT_CURLY_BRACE: 123, /* { */ CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ CHAR_LINE_FEED: 10, /* \n */ CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ CHAR_PERCENT: 37, /* % */ CHAR_PLUS: 43, /* + */ CHAR_QUESTION_MARK: 63, /* ? */ CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ CHAR_RIGHT_CURLY_BRACE: 125, /* } */ CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ CHAR_SEMICOLON: 59, /* ; */ CHAR_SINGLE_QUOTE: 39, /* ' */ CHAR_SPACE: 32, /* */ CHAR_TAB: 9, /* \t */ CHAR_UNDERSCORE: 95, /* _ */ CHAR_VERTICAL_LINE: 124, /* | */ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ /** * Create EXTGLOB_CHARS */ extglobChars(he) { return { "!": { type: "negate", open: "(?:(?!(?:", close: `))${he.STAR})` }, "?": { type: "qmark", open: "(?:", close: ")?" }, "+": { type: "plus", open: "(?:", close: ")+" }, "*": { type: "star", open: "(?:", close: ")*" }, "@": { type: "at", open: "(?:", close: ")" } }; }, /** * Create GLOB_CHARS */ globChars(he) { return he === !0 ? le : J; } }, jp; } var Ck; function Of() { return Ck || (Ck = 1, function(t) { const { REGEX_BACKSLASH: e, REGEX_REMOVE_BACKSLASH: n, REGEX_SPECIAL_CHARS: i, REGEX_SPECIAL_CHARS_GLOBAL: o } = /* @__PURE__ */ Cf(); t.isObject = (a) => a !== null && typeof a == "object" && !Array.isArray(a), t.hasRegexChars = (a) => i.test(a), t.isRegexChar = (a) => a.length === 1 && t.hasRegexChars(a), t.escapeRegex = (a) => a.replace(o, "\\$1"), t.toPosixSlashes = (a) => a.replace(e, "/"), t.isWindows = () => { if (typeof navigator < "u" && navigator.platform) { const a = navigator.platform.toLowerCase(); return a === "win32" || a === "windows"; } return typeof process < "u" && process.platform ? process.platform === "win32" : !1; }, t.removeBackslashes = (a) => a.replace(n, (l) => l === "\\" ? "" : l), t.escapeLast = (a, l, f) => { const p = a.lastIndexOf(l, f); return p === -1 ? a : a[p - 1] === "\\" ? t.escapeLast(a, l, p - 1) : `${a.slice(0, p)}\\${a.slice(p)}`; }, t.removePrefix = (a, l = {}) => { let f = a; return f.startsWith("./") && (f = f.slice(2), l.prefix = "./"), f; }, t.wrapOutput = (a, l = {}, f = {}) => { const p = f.contains ? "" : "^", v = f.contains ? "" : "$"; let k = `${p}(?:${a})${v}`; return l.negated === !0 && (k = `(?:^(?!${k}).*$)`), k; }, t.basename = (a, { windows: l } = {}) => { const f = a.split(l ? /[\\/]/ : "/"), p = f[f.length - 1]; return p === "" ? f[f.length - 2] : p; }; }($p)), $p; } var Up, Ok; function nx() { if (Ok) return Up; Ok = 1; const t = /* @__PURE__ */ Of(), { CHAR_ASTERISK: e, /* * */ CHAR_AT: n, /* @ */ CHAR_BACKWARD_SLASH: i, /* \ */ CHAR_COMMA: o, /* , */ CHAR_DOT: a, /* . */ CHAR_EXCLAMATION_MARK: l, /* ! */ CHAR_FORWARD_SLASH: f, /* / */ CHAR_LEFT_CURLY_BRACE: p, /* { */ CHAR_LEFT_PARENTHESES: v, /* ( */ CHAR_LEFT_SQUARE_BRACKET: k, /* [ */ CHAR_PLUS: b, /* + */ CHAR_QUESTION_MARK: w, /* ? */ CHAR_RIGHT_CURLY_BRACE: T, /* } */ CHAR_RIGHT_PARENTHESES: O, /* ) */ CHAR_RIGHT_SQUARE_BRACKET: x /* ] */ } = /* @__PURE__ */ Cf(), C = (le) => le === f || le === i, $ = (le) => { le.isPrefix !== !0 && (le.depth = le.isGlobstar ? 1 / 0 : 1); }; return Up = (le, ne) => { const he = ne || {}, ye = le.length - 1, me = he.parts === !0 || he.scanToEnd === !0, Fe = [], Re = [], ut = []; let He = le, We = -1, ot = 0, W = 0, L = !1, oe = !1, ge = !1, te = !1, ue = !1, M = !1, D = !1, ae = !1, Ve = !1, F = !1, Y = 0, nt, Te, ze = { value: "", depth: 0, isGlob: !1 }; const Ce = () => We >= ye, kt = () => He.charCodeAt(We + 1), wt = () => (nt = Te, He.charCodeAt(++We)); for (; We < ye; ) { Te = wt(); let Yt; if (Te === i) { D = ze.backslashes = !0, Te = wt(), Te === p && (M = !0); continue; } if (M === !0 || Te === p) { for (Y++; Ce() !== !0 && (Te = wt()); ) { if (Te === i) { D = ze.backslashes = !0, wt(); continue; } if (Te === p) { Y++; continue; } if (M !== !0 && Te === a && (Te = wt()) === a) { if (L = ze.isBrace = !0, ge = ze.isGlob = !0, F = !0, me === !0) continue; break; } if (M !== !0 && Te === o) { if (L = ze.isBrace = !0, ge = ze.isGlob = !0, F = !0, me === !0) continue; break; } if (Te === T && (Y--, Y === 0)) { M = !1, L = ze.isBrace = !0, F = !0; break; } } if (me === !0) continue; break; } if (Te === f) { if (Fe.push(We), Re.push(ze), ze = { value: "", depth: 0, isGlob: !1 }, F === !0) continue; if (nt === a && We === ot + 1) { ot += 2; continue; } W = We + 1; continue; } if (he.noext !== !0 && (Te === b || Te === n || Te === e || Te === w || Te === l) === !0 && kt() === v) { if (ge = ze.isGlob = !0, te = ze.isExtglob = !0, F = !0, Te === l && We === ot && (Ve = !0), me === !0) { for (; Ce() !== !0 && (Te = wt()); ) { if (Te === i) { D = ze.backslashes = !0, Te = wt(); continue; } if (Te === O) { ge = ze.isGlob = !0, F = !0; break; } } continue; } break; } if (Te === e) { if (nt === e && (ue = ze.isGlobstar = !0), ge = ze.isGlob = !0, F = !0, me === !0) continue; break; } if (Te === w) { if (ge = ze.isGlob = !0, F = !0, me === !0) continue; break; } if (Te === k) { for (; Ce() !== !0 && (Yt = wt()); ) { if (Yt === i) { D = ze.backslashes = !0, wt(); continue; } if (Yt === x) { oe = ze.isBracket = !0, ge = ze.isGlob = !0, F = !0; break; } } if (me === !0) continue; break; } if (he.nonegate !== !0 && Te === l && We === ot) { ae = ze.negated = !0, ot++; continue; } if (he.noparen !== !0 && Te === v) { if (ge = ze.isGlob = !0, me === !0) { for (; Ce() !== !0 && (Te = wt()); ) { if (Te === v) { D = ze.backslashes = !0, Te = wt(); continue; } if (Te === O) { F = !0; break; } } continue; } break; } if (ge === !0) { if (F = !0, me === !0) continue; break; } } he.noext === !0 && (te = !1, ge = !1); let et = He, tn = "", Bt = ""; ot > 0 && (tn = He.slice(0, ot), He = He.slice(ot), W -= ot), et && ge === !0 && W > 0 ? (et = He.slice(0, W), Bt = He.slice(W)) : ge === !0 ? (et = "", Bt = He) : et = He, et && et !== "" && et !== "/" && et !== He && C(et.charCodeAt(et.length - 1)) && (et = et.slice(0, -1)), he.unescape === !0 && (Bt && (Bt = t.removeBackslashes(Bt)), et && D === !0 && (et = t.removeBackslashes(et))); const Ze = { prefix: tn, input: le, start: ot, base: et, glob: Bt, isBrace: L, isBracket: oe, isGlob: ge, isExtglob: te, isGlobstar: ue, negated: ae, negatedExtglob: Ve }; if (he.tokens === !0 && (Ze.maxDepth = 0, C(Te) || Re.push(ze), Ze.tokens = Re), he.parts === !0 || he.tokens === !0) { let Yt; for (let Lt = 0; Lt < Fe.length; Lt++) { const $e = Yt ? Yt + 1 : ot, Et = Fe[Lt], Oe = le.slice($e, Et); he.tokens && (Lt === 0 && ot !== 0 ? (Re[Lt].isPrefix = !0, Re[Lt].value = tn) : Re[Lt].value = Oe, $(Re[Lt]), Ze.maxDepth += Re[Lt].depth), (Lt !== 0 || Oe !== "") && ut.push(Oe), Yt = Et; } if (Yt && Yt + 1 < le.length) { const Lt = le.slice(Yt + 1); ut.push(Lt), he.tokens && (Re[Re.length - 1].value = Lt, $(Re[Re.length - 1]), Ze.maxDepth += Re[Re.length - 1].depth); } Ze.slashes = Fe, Ze.parts = ut; } return Ze; }, Up; } var Bp, Tk; function rx() { if (Tk) return Bp; Tk = 1; const t = /* @__PURE__ */ Cf(), e = /* @__PURE__ */ Of(), { MAX_LENGTH: n, POSIX_REGEX_SOURCE: i, REGEX_NON_SPECIAL_CHARS: o, REGEX_SPECIAL_CHARS_BACKREF: a, REPLACEMENTS: l } = t, f = (k, b) => { if (typeof b.expandRange == "function") return b.expandRange(...k, b); k.sort(); const w = `[${k.join("-")}]`; try { new RegExp(w); } catch { return k.map((O) => e.escapeRegex(O)).join(".."); } return w; }, p = (k, b) => `Missing ${k}: "${b}" - use "\\\\${b}" to match literal characters`, v = (k, b) => { if (typeof k != "string") throw new TypeError("Expected a string"); k = l[k] || k; const w = { ...b }, T = typeof w.maxLength == "number" ? Math.min(n, w.maxLength) : n; let O = k.length; if (O > T) throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${T}`); const x = { type: "bos", value: "", output: w.prepend || "" }, C = [x], $ = w.capture ? "" : "?:", J = t.globChars(w.windows), le = t.extglobChars(J), { DOT_LITERAL: ne, PLUS_LITERAL: he, SLASH_LITERAL: ye, ONE_CHAR: me, DOTS_SLASH: Fe, NO_DOT: Re, NO_DOT_SLASH: ut, NO_DOTS_SLASH: He, QMARK: We, QMARK_NO_DOT: ot, STAR: W, START_ANCHOR: L } = J, oe = ($e) => `(${$}(?:(?!${L}${$e.dot ? Fe : ne}).)*?)`, ge = w.dot ? "" : Re, te = w.dot ? We : ot; let ue = w.bash === !0 ? oe(w) : W; w.capture && (ue = `(${ue})`), typeof w.noext == "boolean" && (w.noextglob = w.noext); const M = { input: k, index: -1, start: 0, dot: w.dot === !0, consumed: "", output: "", prefix: "", backtrack: !1, negated: !1, brackets: 0, braces: 0, parens: 0, quotes: 0, globstar: !1, tokens: C }; k = e.removePrefix(k, M), O = k.length; const D = [], ae = [], Ve = []; let F = x, Y; const nt = () => M.index === O - 1, Te = M.peek = ($e = 1) => k[M.index + $e], ze = M.advance = () => k[++M.index] || "", Ce = () => k.slice(M.index + 1), kt = ($e = "", Et = 0) => { M.consumed += $e, M.index += Et; }, wt = ($e) => { M.output += $e.output != null ? $e.output : $e.value, kt($e.value); }, et = () => { let $e = 1; for (; Te() === "!" && (Te(2) !== "(" || Te(3) === "?"); ) ze(), M.start++, $e++; return $e % 2 === 0 ? !1 : (M.negated = !0, M.start++, !0); }, tn = ($e) => { M[$e]++, Ve.push($e); }, Bt = ($e) => { M[$e]--, Ve.pop(); }, Ze = ($e) => { if (F.type === "globstar") { const Et = M.braces > 0 && ($e.type === "comma" || $e.type === "brace"), Oe = $e.extglob === !0 || D.length && ($e.type === "pipe" || $e.type === "paren"); $e.type !== "slash" && $e.type !== "paren" && !Et && !Oe && (M.output = M.output.slice(0, -F.output.length), F.type = "star", F.value = "*", F.output = ue, M.output += F.output); } if (D.length && $e.type !== "paren" && (D[D.length - 1].inner += $e.value), ($e.value || $e.output) && wt($e), F && F.type === "text" && $e.type === "text") { F.output = (F.output || F.value) + $e.value, F.value += $e.value; return; } $e.prev = F, C.push($e), F = $e; }, Yt = ($e, Et) => { const Oe = { ...le[Et], conditions: 1, inner: "" }; Oe.prev = F, Oe.parens = M.parens, Oe.output = M.output; const tt = (w.capture ? "(" : "") + Oe.open; tn("parens"), Ze({ type: $e, value: Et, output: M.output ? "" : me }), Ze({ type: "paren", extglob: !0, value: ze(), output: tt }), D.push(Oe); }, Lt = ($e) => { let Et = $e.close + (w.capture ? ")" : ""), Oe; if ($e.type === "negate") { let tt = ue; if ($e.inner && $e.inner.length > 1 && $e.inner.includes("/") && (tt = oe(w)), (tt !== ue || nt() || /^\)+$/.test(Ce())) && (Et = $e.close = `)$))${tt}`), $e.inner.includes("*") && (Oe = Ce()) && /^\.[^\\/.]+$/.test(Oe)) { const Rt = v(Oe, { ...b, fastpaths: !1 }).output; Et = $e.close = `)${Rt})${tt})`; } $e.prev.type === "bos" && (M.negatedExtglob = !0); } Ze({ type: "paren", extglob: !0, value: Y, output: Et }), Bt("parens"); }; if (w.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(k)) { let $e = !1, Et = k.replace(a, (Oe, tt, Rt, Kt, Vt, vr) => Kt === "\\" ? ($e = !0, Oe) : Kt === "?" ? tt ? tt + Kt + (Vt ? We.repeat(Vt.length) : "") : vr === 0 ? te + (Vt ? We.repeat(Vt.length) : "") : We.repeat(Rt.length) : Kt === "." ? ne.repeat(Rt.length) : Kt === "*" ? tt ? tt + Kt + (Vt ? ue : "") : ue : tt ? Oe : `\\${Oe}`); return $e === !0 && (w.unescape === !0 ? Et = Et.replace(/\\/g, "") : Et = Et.replace(/\\+/g, (Oe) => Oe.length % 2 === 0 ? "\\\\" : Oe ? "\\" : "")), Et === k && w.contains === !0 ? (M.output = k, M) : (M.output = e.wrapOutput(Et, M, b), M); } for (; !nt(); ) { if (Y = ze(), Y === "\0") continue; if (Y === "\\") { const Oe = Te(); if (Oe === "/" && w.bash !== !0 || Oe === "." || Oe === ";") continue; if (!Oe) { Y += "\\", Ze({ type: "text", value: Y }); continue; } const tt = /^\\+/.exec(Ce()); let Rt = 0; if (tt && tt[0].length > 2 && (Rt = tt[0].length, M.index += Rt, Rt % 2 !== 0 && (Y += "\\")), w.unescape === !0 ? Y = ze() : Y += ze(), M.brackets === 0) { Ze({ type: "text", value: Y }); continue; } } if (M.brackets > 0 && (Y !== "]" || F.value === "[" || F.value === "[^")) { if (w.posix !== !1 && Y === ":") { const Oe = F.value.slice(1); if (Oe.includes("[") && (F.posix = !0, Oe.includes(":"))) { const tt = F.value.lastIndexOf("["), Rt = F.value.slice(0, tt), Kt = F.value.slice(tt + 2), Vt = i[Kt]; if (Vt) { F.value = Rt + Vt, M.backtrack = !0, ze(), !x.output && C.indexOf(F) === 1 && (x.output = me); continue; } } } (Y === "[" && Te() !== ":" || Y === "-" && Te() === "]") && (Y = `\\${Y}`), Y === "]" && (F.value === "[" || F.value === "[^") && (Y = `\\${Y}`), w.posix === !0 && Y === "!" && F.value === "[" && (Y = "^"), F.value += Y, wt({ value: Y }); continue; } if (M.quotes === 1 && Y !== '"') { Y = e.escapeRegex(Y), F.value += Y, wt({ value: Y }); continue; } if (Y === '"') { M.quotes = M.quotes === 1 ? 0 : 1, w.keepQuotes === !0 && Ze({ type: "text", value: Y }); continue; } if (Y === "(") { tn("parens"), Ze({ type: "paren", value: Y }); continue; } if (Y === ")") { if (M.parens === 0 && w.strictBrackets === !0) throw new SyntaxError(p("opening", "(")); const Oe = D[D.length - 1]; if (Oe && M.parens === Oe.parens + 1) { Lt(D.pop()); continue; } Ze({ type: "paren", value: Y, output: M.parens ? ")" : "\\)" }), Bt("parens"); continue; } if (Y === "[") { if (w.nobracket === !0 || !Ce().includes("]")) { if (w.nobracket !== !0 && w.strictBrackets === !0) throw new SyntaxError(p("closing", "]")); Y = `\\${Y}`; } else tn("brackets"); Ze({ type: "bracket", value: Y }); continue; } if (Y === "]") { if (w.nobracket === !0 || F && F.type === "bracket" && F.value.length === 1) { Ze({ type: "text", value: Y, output: `\\${Y}` }); continue; } if (M.brackets === 0) { if (w.strictBrackets === !0) throw new SyntaxError(p("opening", "[")); Ze({ type: "text", value: Y, output: `\\${Y}` }); continue; } Bt("brackets"); const Oe = F.value.slice(1); if (F.posix !== !0 && Oe[0] === "^" && !Oe.includes("/") && (Y = `/${Y}`), F.value += Y, wt({ value: Y }), w.literalBrackets === !1 || e.hasRegexChars(Oe)) continue; const tt = e.escapeRegex(F.value); if (M.output = M.output.slice(0, -F.value.length), w.literalBrackets === !0) { M.output += tt, F.value = tt; continue; } F.value = `(${$}${tt}|${F.value})`, M.output += F.value; continue; } if (Y === "{" && w.nobrace !== !0) { tn("braces"); const Oe = { type: "brace", value: Y, output: "(", outputIndex: M.output.length, tokensIndex: M.tokens.length }; ae.push(Oe), Ze(Oe); continue; } if (Y === "}") { const Oe = ae[ae.length - 1]; if (w.nobrace === !0 || !Oe) { Ze({ type: "text", value: Y, output: Y }); continue; } let tt = ")"; if (Oe.dots === !0) { const Rt = C.slice(), Kt = []; for (let Vt = Rt.length - 1; Vt >= 0 && (C.pop(), Rt[Vt].type !== "brace"); Vt--) Rt[Vt].type !== "dots" && Kt.unshift(Rt[Vt].value); tt = f(Kt, w), M.backtrack = !0; } if (Oe.comma !== !0 && Oe.dots !== !0) { const Rt = M.output.slice(0, Oe.outputIndex), Kt = M.tokens.slice(Oe.tokensIndex); Oe.value = Oe.output = "\\{", Y = tt = "\\}", M.output = Rt; for (const Vt of Kt) M.output += Vt.output || Vt.value; } Ze({ type: "brace", value: Y, output: tt }), Bt("braces"), ae.pop(); continue; } if (Y === "|") { D.length > 0 && D[D.length - 1].conditions++, Ze({ type: "text", value: Y }); continue; } if (Y === ",") { let Oe = Y; const tt = ae[ae.length - 1]; tt && Ve[Ve.length - 1] === "braces" && (tt.comma = !0, Oe = "|"), Ze({ type: "comma", value: Y, output: Oe }); continue; } if (Y === "/") { if (F.type === "dot" && M.index === M.start + 1) { M.start = M.index + 1, M.consumed = "", M.output = "", C.pop(), F = x; continue; } Ze({ type: "slash", value: Y, output: ye }); continue; } if (Y === ".") { if (M.braces > 0 && F.type === "dot") { F.value === "." && (F.output = ne); const Oe = ae[ae.length - 1]; F.type = "dots", F.output += Y, F.value += Y, Oe.dots = !0; continue; } if (M.braces + M.parens === 0 && F.type !== "bos" && F.type !== "slash") { Ze({ type: "text", value: Y, output: ne }); continue; } Ze({ type: "dot", value: Y, output: ne }); continue; } if (Y === "?") { if (!(F && F.value === "(") && w.noextglob !== !0 && Te() === "(" && Te(2) !== "?") { Yt("qmark", Y); continue; } if (F && F.type === "paren") { const tt = Te(); let Rt = Y; (F.value === "(" && !/[!=<:]/.test(tt) || tt === "<" && !/<([!=]|\w+>)/.test(Ce())) && (Rt = `\\${Y}`), Ze({ type: "text", value: Y, output: Rt }); continue; } if (w.dot !== !0 && (F.type === "slash" || F.type === "bos")) { Ze({ type: "qmark", value: Y, output: ot }); continue; } Ze({ type: "qmark", value: Y, output: We }); continue; } if (Y === "!") { if (w.noextglob !== !0 && Te() === "(" && (Te(2) !== "?" || !/[!=<:]/.test(Te(3)))) { Yt("negate", Y); continue; } if (w.nonegate !== !0 && M.index === 0) { et(); continue; } } if (Y === "+") { if (w.noextglob !== !0 && Te() === "(" && Te(2) !== "?") { Yt("plus", Y); continue; } if (F && F.value === "(" || w.regex === !1) { Ze({ type: "plus", value: Y, output: he }); continue; } if (F && (F.type === "bracket" || F.type === "paren" || F.type === "brace") || M.parens > 0) { Ze({ type: "plus", value: Y }); continue; } Ze({ type: "plus", value: he }); continue; } if (Y === "@") { if (w.noextglob !== !0 && Te() === "(" && Te(2) !== "?") { Ze({ type: "at", extglob: !0, value: Y, output: "" }); continue; } Ze({ type: "text", value: Y }); continue; } if (Y !== "*") { (Y === "$" || Y === "^") && (Y = `\\${Y}`); const Oe = o.exec(Ce()); Oe && (Y += Oe[0], M.index += Oe[0].length), Ze({ type: "text", value: Y }); continue; } if (F && (F.type === "globstar" || F.star === !0)) { F.type = "star", F.star = !0, F.value += Y, F.output = ue, M.backtrack = !0, M.globstar = !0, kt(Y); continue; } let $e = Ce(); if (w.noextglob !== !0 && /^\([^?]/.test($e)) { Yt("star", Y); continue; } if (F.type === "star") { if (w.noglobstar === !0) { kt(Y); continue; } const Oe = F.prev, tt = Oe.prev, Rt = Oe.type === "slash" || Oe.type === "bos", Kt = tt && (tt.type === "star" || tt.type === "globstar"); if (w.bash === !0 && (!Rt || $e[0] && $e[0] !== "/")) { Ze({ type: "star", value: Y, output: "" }); continue; } const Vt = M.braces > 0 && (Oe.type === "comma" || Oe.type === "brace"), vr = D.length && (Oe.type === "pipe" || Oe.type === "paren"); if (!Rt && Oe.type !== "paren" && !Vt && !vr) { Ze({ type: "star", value: Y, output: "" }); continue; } for (; $e.slice(0, 3) === "/**"; ) { const Dn = k[M.index + 4]; if (Dn && Dn !== "/") break; $e = $e.slice(3), kt("/**", 3); } if (Oe.type === "bos" && nt()) { F.type = "globstar", F.value += Y, F.output = oe(w), M.output = F.output, M.globstar = !0, kt(Y); continue; } if (Oe.type === "slash" && Oe.prev.type !== "bos" && !Kt && nt()) { M.output = M.output.slice(0, -(Oe.output + F.output).length), Oe.output = `(?:${Oe.output}`, F.type = "globstar", F.output = oe(w) + (w.strictSlashes ? ")" : "|$)"), F.value += Y, M.globstar = !0, M.output += Oe.output + F.output, kt(Y); continue; } if (Oe.type === "slash" && Oe.prev.type !== "bos" && $e[0] === "/") { const Dn = $e[1] !== void 0 ? "|$" : ""; M.output = M.output.slice(0, -(Oe.output + F.output).length), Oe.output = `(?:${Oe.output}`, F.type = "globstar", F.output = `${oe(w)}${ye}|${ye}${Dn})`, F.value += Y, M.output += Oe.output + F.output, M.globstar = !0, kt(Y + ze()), Ze({ type: "slash", value: "/", output: "" }); continue; } if (Oe.type === "bos" && $e[0] === "/") { F.type = "globstar", F.value += Y, F.output = `(?:^|${ye}|${oe(w)}${ye})`, M.output = F.output, M.globstar = !0, kt(Y + ze()), Ze({ type: "slash", value: "/", output: "" }); continue; } M.output = M.output.slice(0, -F.output.length), F.type = "globstar", F.output = oe(w), F.value += Y, M.output += F.output, M.globstar = !0, kt(Y); continue; } const Et = { type: "star", value: Y, output: ue }; if (w.bash === !0) { Et.output = ".*?", (F.type === "bos" || F.type === "slash") && (Et.output = ge + Et.output), Ze(Et); continue; } if (F && (F.type === "bracket" || F.type === "paren") && w.regex === !0) { Et.output = Y, Ze(Et); continue; } (M.index === M.start || F.type === "slash" || F.type === "dot") && (F.type === "dot" ? (M.output += ut, F.output += ut) : w.dot === !0 ? (M.output += He, F.output += He) : (M.output += ge, F.output += ge), Te() !== "*" && (M.output += me, F.output += me)), Ze(Et); } for (; M.brackets > 0; ) { if (w.strictBrackets === !0) throw new SyntaxError(p("closing", "]")); M.output = e.escapeLast(M.output, "["), Bt("brackets"); } for (; M.parens > 0; ) { if (w.strictBrackets === !0) throw new SyntaxError(p("closing", ")")); M.output = e.escapeLast(M.output, "("), Bt("parens"); } for (; M.braces > 0; ) { if (w.strictBrackets === !0) throw new SyntaxError(p("closing", "}")); M.output = e.escapeLast(M.output, "{"), Bt("braces"); } if (w.strictSlashes !== !0 && (F.type === "star" || F.type === "bracket") && Ze({ type: "maybe_slash", value: "", output: `${ye}?` }), M.backtrack === !0) { M.output = ""; for (const $e of M.tokens) M.output += $e.output != null ? $e.output : $e.value, $e.suffix && (M.output += $e.suffix); } return M; }; return v.fastpaths = (k, b) => { const w = { ...b }, T = typeof w.maxLength == "number" ? Math.min(n, w.maxLength) : n, O = k.length; if (O > T) throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${T}`); k = l[k] || k; const { DOT_LITERAL: x, SLASH_LITERAL: C, ONE_CHAR: $, DOTS_SLASH: J, NO_DOT: le, NO_DOTS: ne, NO_DOTS_SLASH: he, STAR: ye, START_ANCHOR: me } = t.globChars(w.windows), Fe = w.dot ? ne : le, Re = w.dot ? he : le, ut = w.capture ? "" : "?:", He = { negated: !1, prefix: "" }; let We = w.bash === !0 ? ".*?" : ye; w.capture && (We = `(${We})`); const ot = (ge) => ge.noglobstar === !0 ? We : `(${ut}(?:(?!${me}${ge.dot ? J : x}).)*?)`, W = (ge) => { switch (ge) { case "*": return `${Fe}${$}${We}`; case ".*": return `${x}${$}${We}`; case "*.*": return `${Fe}${We}${x}${$}${We}`; case "*/*": return `${Fe}${We}${C}${$}${Re}${We}`; case "**": return Fe + ot(w); case "**/*": return `(?:${Fe}${ot(w)}${C})?${Re}${$}${We}`; case "**/*.*": return `(?:${Fe}${ot(w)}${C})?${Re}${We}${x}${$}${We}`; case "**/.*": return `(?:${Fe}${ot(w)}${C})?${x}${$}${We}`; default: { const te = /^(.*?)\.(\w+)$/.exec(ge); if (!te) return; const ue = W(te[1]); return ue ? ue + x + te[2] : void 0; } } }, L = e.removePrefix(k, He); let oe = W(L); return oe && w.strictSlashes !== !0 && (oe += `${C}?`), oe; }, Bp = v, Bp; } var Vp, Rk; function ix() { if (Rk) return Vp; Rk = 1; const t = /* @__PURE__ */ nx(), e = /* @__PURE__ */ rx(), n = /* @__PURE__ */ Of(), i = /* @__PURE__ */ Cf(), o = (l) => l && typeof l == "object" && !Array.isArray(l), a = (l, f, p = !1) => { if (Array.isArray(l)) { const C = l.map((J) => a(J, f, p)); return (J) => { for (const le of C) { const ne = le(J); if (ne) return ne; } return !1; }; } const v = o(l) && l.tokens && l.input; if (l === "" || typeof l != "string" && !v) throw new TypeError("Expected pattern to be a non-empty string"); const k = f || {}, b = k.windows, w = v ? a.compileRe(l, f) : a.makeRe(l, f, !1, !0), T = w.state; delete w.state; let O = () => !1; if (k.ignore) { const C = { ...f, ignore: null, onMatch: null, onResult: null }; O = a(k.ignore, C, p); } const x = (C, $ = !1) => { const { isMatch: J, match: le, output: ne } = a.test(C, w, f, { glob: l, posix: b }), he = { glob: l, state: T, regex: w, posix: b, input: C, output: ne, match: le, isMatch: J }; return typeof k.onResult == "function" && k.onResult(he), J === !1 ? (he.isMatch = !1, $ ? he : !1) : O(C) ? (typeof k.onIgnore == "function" && k.onIgnore(he), he.isMatch = !1, $ ? he : !1) : (typeof k.onMatch == "function" && k.onMatch(he), $ ? he : !0); }; return p && (x.state = T), x; }; return a.test = (l, f, p, { glob: v, posix: k } = {}) => { if (typeof l != "string") throw new TypeError("Expected input to be a string"); if (l === "") return { isMatch: !1, output: "" }; const b = p || {}, w = b.format || (k ? n.toPosixSlashes : null); let T = l === v, O = T && w ? w(l) : l; return T === !1 && (O = w ? w(l) : l, T = O === v), (T === !1 || b.capture === !0) && (b.matchBase === !0 || b.basename === !0 ? T = a.matchBase(l, f, p, k) : T = f.exec(O)), { isMatch: !!T, match: T, output: O }; }, a.matchBase = (l, f, p) => (f instanceof RegExp ? f : a.makeRe(f, p)).test(n.basename(l)), a.isMatch = (l, f, p) => a(f, p)(l), a.parse = (l, f) => Array.isArray(l) ? l.map((p) => a.parse(p, f)) : e(l, { ...f, fastpaths: !1 }), a.scan = (l, f) => t(l, f), a.compileRe = (l, f, p = !1, v = !1) => { if (p === !0) return l.output; const k = f || {}, b = k.contains ? "" : "^", w = k.contains ? "" : "$"; let T = `${b}(?:${l.output})${w}`; l && l.negated === !0 && (T = `^(?!${T}).*$`); const O = a.toRegex(T, f); return v === !0 && (O.state = l), O; }, a.makeRe = (l, f = {}, p = !1, v = !1) => { if (!l || typeof l != "string") throw new TypeError("Expected a non-empty string"); let k = { negated: !1, fastpaths: !0 }; return f.fastpaths !== !1 && (l[0] === "." || l[0] === "*") && (k.output = e.fastpaths(l, f)), k.output || (k = e(l, f)), a.compileRe(k, f, p, v); }, a.toRegex = (l, f) => { try { const p = f || {}; return new RegExp(l, p.flags || (p.nocase ? "i" : "")); } catch (p) { if (f && f.debug === !0) throw p; return /$^/; } }, a.constants = i, Vp = a, Vp; } var zp, Ik; function sx() { if (Ik) return zp; Ik = 1; const t = /* @__PURE__ */ ix(), e = /* @__PURE__ */ Of(); function n(i, o, a = !1) { return o && (o.windows === null || o.windows === void 0) && (o = { ...o, windows: e.isWindows() }), t(i, o, a); } return Object.assign(n, t), zp = n, zp; } var ox = /* @__PURE__ */ sx(); const Pk = /* @__PURE__ */ Wl(ox), Lk = "loglevel-patterns", _d = "loglevel:", Hp = "!", ax = en.INFO; class ux { /** * Initializes the service with a specific project name. * @param project - The project for which log levels are managed. */ constructor(e) { de(this, "projectPrefix"); de(this, "patternsCache", null); this.projectPrefix = `${_d}${e}:`; } /** * Retrieves the log level for a given context. * Resolves the most specific match, considering override rules. * @param context - The specific context to retrieve the log level for. * @returns The resolved log level. */ getLevel(e) { const n = this.loadAndUnifyPatterns(); return this.resolveLogLevelFromPatterns(e, n) || ax; } /** * Sets the log level for a specific context as an individual key. * @param context - The specific context for which to set the log level. * @param level - The log level to set, optionally with "!". */ setLevel(e, n) { const { level: i, override: o } = this.parseLogLevel(n), a = `${_d}${e}`, l = o ? `${i}${Hp}` : i; localStorage.setItem(a, l), this.patternsCache = null; } /** * Loads and unifies patterns from both loglevel-patterns and individual keys. * Ensures the process is done only once per app lifecycle. * @returns A unified map of patterns. */ loadAndUnifyPatterns() { if (this.patternsCache) return this.patternsCache; const e = this.readPatternsFromJSON(), n = this.unifyWithIndividualKeys(e); return this.patternsCache = n, n; } /** * Resolves the log level for a context using the unified patterns. * Handles override logic and prioritizes more specific matches. * @param context - The context to resolve the log level for. * @param patterns - The unified patterns map. * @returns The resolved log level, or undefined if no match is found. */ resolveLogLevelFromPatterns(e, n) { let i; for (const [o, { level: a, override: l }] of Object.entries(n)) if (Pk(o.toLowerCase())(e.toLowerCase())) { if (l) return a; (!i || Pk(o)(e)) && (i = a); } return i; } /** * Reads patterns from loglevel-patterns in localStorage. * @returns The parsed patterns map. */ readPatternsFromJSON() { try { const e = localStorage.getItem(Lk); return e ? JSON.parse(e) : {}; } catch { return console.error("Failed to parse loglevel-patterns from localStorage"), {}; } } /** * Unifies patterns from loglevel-patterns with individual keys from localStorage. * @param basePatterns - The base patterns loaded from loglevel-patterns. * @returns A unified map of patterns. */ unifyWithIndividualKeys(e) { const n = { ...e }; for (let i = 0; i < localStorage.length; i++) { const o = localStorage.key(i); if (!o || !o.startsWith(_d) || o === Lk) continue; const a = o.replace(_d, "").toLowerCase(), l = localStorage.getItem(o); if (!l) continue; const { level: f, override: p } = this.parseLogLevel(l); n[a] = { level: f, override: p }; } return n; } /** * Parses a log level string, identifying if it's an override. * @param value - The value to parse (e.g., "ERROR!"). * @returns An object with the level and override flag. */ parseLogLevel(e) { const n = e.endsWith(Hp), i = n ? e.slice(0, -Hp.length) : e; if (!wS(i)) throw new wg(i); return { level: i, override: n }; } } class lx { constructor(e, n) { de(this, "committed", !1); de(this, "chainOptions", {}); de(this, "method", null); de(this, "stack", ""); de(this, "args", []); this.adapter = e, n && (this.chainOptions = { ...n }), Promise.resolve().then(() => this.commit()); } options(e) { return this.chainOptions = { ...this.chainOptions, ...e }, this; } trace(...e) { return this.log("trace", e); } debug(...e) { return this.log("debug", e); } info(...e) { return this.log("info", e); } warn(...e) { return this.log("warn", e); } error(...e) { return this.log("error", e); } fatal(...e) { return this.log("fatal", e); } log(e, n) { return this.method = e, this.args = n, this.stack = new Error().stack ?? "", this; } commit() { if (!this.committed && (this.committed = !0, this.method)) { const e = this.args[0], n = this.args.slice(1), i = { stack: this.stack, content: { message: e, args: n }, options: this.chainOptions }; this.adapter[this.method](i); } } } let SS = class Pm { /** * Private constructor to enforce instantiation through `Logger.create()`. * * @param {LoggerAdapter} adapter - The logging adapter implementation. */ constructor(e) { de(this, "adapter"); this.adapter = e; } /** * Factory Static Method to create a new Logger instance. * * This method accepts a logging adapter and returns a new Logger instance. * * @param {LoggerAdapter} adapter - The logging adapter implementation. * @returns {Logger} A new Logger instance. * * @example * ```ts * const logger = Logger.create(new PinoAdapter(config)); * ``` */ static create(e) { const n = new Pm(e); return n.setMetadata({ account: null, client: CS() }), n; } /** * Creates a child logger with additional context. * * The child logger inherits the parent's configuration and metadata. * * @param {string} name - The context to append to the logger's source. * @param {LoggerMetadata} [metadata={}] - Additional metadata for the child logger. * @returns {Logger} A new child Logger instance. * * @example * ```ts * const userLogger = logger.child('UserService'); * userLogger.info('Fetching user data'); * ``` */ child(e, n = {}) { return new Pm(this.adapter.child(e, n)); } /** * Creates a lazy child logger with delayed initialization. * * The lazy child logger is a proxy that initializes the child logger only when its methods are first accessed. * * @param {string} name - The context name for the lazy child logger. * @param {LoggerMetadata} [metadata={}] - Additional metadata for the lazy child logger. * @returns {Logger} A new lazy child Logger instance. * * @example * ```ts * const lazyLogger = logger.lazyChild('Deferred'); * lazyLogger.info('This is executed only when used'); * ``` */ lazyChild(e, n = {}) { let i; return new Proxy({}, { get: (o, a, l) => (i || (i = this.child(e, n)), Reflect.get(i, a, l)) }); } /** * Sets or updates the metadata for the logger. * * The provided metadata is merged with existing global metadata and included in every log entry. * * @param {LoggerMetadata} metadata - The metadata to set. * * @example * ```ts * logger.setMetadata({ account: '1234', user: 'admin' }); * ``` */ setMetadata(e) { this.adapter.setMetadata(e); } /** * Sets the log level. * * @param {LogLevel} level - The new log level to be set. * @throws {Error} Throws an error if the provided log level is invalid. */ setLevel(e) { if (!wS(e)) throw new wg(e); this.adapter.setLevel(e); } /** * Creates a new instance of LoggerChain for chaining log calls with optional settings. * * @param {LogOptions} [initialOptions] - Optional log options. * @returns {LoggerChain} A new LoggerChain instance. */ createChain(e) { return new lx(this.adapter, e); } /** * Logs a **trace-level** message for deep debugging. * * Use this for very detailed logs that help trace the execution flow. * * @param {...any} args - The log message and optional additional data. * @returns {LoggerChain} A chainable logger instance. * * @example * ```ts * logger.trace('Function execution trace', { function: 'fetchData' }); * ``` */ trace(...e) { return this.createChain().trace(...e); } /** * Logs a **debug-level** message for troubleshooting. * * Use this for diagnostic information useful during development. * * @param {...any} args - The log message and optional additional data. * @returns {LoggerChain} A chainable logger instance. * * @example * ```ts * logger.debug('User session data', session); * ``` */ debug(...e) { return this.createChain().debug(...e); } /** * Logs an **info-level** message for general system events. * * Use this for regular information that tracks system operations. * * @param {...any} args - The log message and optional additional data. * @returns {LoggerChain} A chainable logger instance. * * @example * ```ts * logger.info('User logged in', { userId: 123 }); * ``` */ info(...e) { return this.createChain().info(...e); } /** * Logs a **warning-level** message to indicate potential issues. * * Use this when an unexpected event occurs but the application can continue operating. * * @param {...any} args - The log message and optional additional data. * @returns {LoggerChain} A chainable logger instance. * * @example * ```ts * logger.warn('API response took too long', { duration: 5000 }); * ``` */ warn(...e) { return this.createChain().warn(...e); } /** * Logs an **error-level** message for recoverable failures. * * Use this when an error occurs that does not require immediate termination of the application. * * @param {...any} args - The log message and optional additional data. * @returns {LoggerChain} A chainable logger instance. * * @example * ```ts * logger.error(new Error('Database connection lost')); * ``` */ error(...e) { return this.createChain().error(...e); } /** * Logs a **fatal-level** message for critical failures. * * Use this when an unrecoverable error occurs and the system must be terminated. * * @param {...any} args - The log message and optional additional data. * @returns {LoggerChain} A chainable logger instance. * * @example * ```ts * logger.fatal('Critical system failure', { code: 'SYSTEM_CRASH' }); * ``` */ fatal(...e) { return this.createChain().fatal(...e); } /** * Sets the log options for the current chain. * * This method allows modifying log behavior (e.g., silencing the console output) * before calling a log method. * * @param {LogOptions} opts - The log options to apply. * @returns {LoggerChain} A chainable logger instance. * * @example * ```ts * logger.options({ silent: true }).error(new Error('Silent error')); * ``` */ options(e) { return this.createChain(e); } }; function bg(t) { return nr().logger.lazyChild(t); } function bS(t, e) { return SS.create( new Im({ source: t, levelService: new ux(t), consoleLogger: new ex(), httpLogger: Sg.create({ db: e, project: t }) }) ); } const cx = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"; let dx = (t = 21) => { let e = "", n = crypto.getRandomValues(new Uint8Array(t)); for (; t--; ) e += cx[n[t] & 63]; return e; }; const ro = (t = 8) => dx(t), Yo = (t, e = !1) => { const n = Object.entries(t).reduce((i, [o, a]) => a !== void 0 && (!e || a !== null) ? `${i}${i ? "&" : ""}${o}=${a}` : i, ""); return n ? `?${n}` : ""; }, ES = (t) => { const e = document.getElementById(t); return e ? new URL(e.src).searchParams : new URLSearchParams(); }; function fx() { const t = new Error().stack.split(` `); return t.length < 3 ? "" : t[2].trim().substring(3); } function NS(t) { return new Promise((e) => setTimeout(e, t)); } const xr = class xr { constructor() { de(this, "projectName", "nizza"); de(this, "instanceId", ro()); de(this, "nizzaDB", new zA()); de(this, "logger", bS(this.projectName, this.nizzaDB)); de(this, "coreLogger", this.logger.child("core")); de(this, "_logger", this.coreLogger.child("NizzaStore")); de(this, "_config", null); de(this, "_account"); de(this, "_accountStatus", "idle"); de(this, "_productDataSource"); de(this, "_eventBus", new pS("nizza", this.coreLogger)); // Track the current account fetch request ID de(this, "activeAccountFetchId", null); yA( this, { _config: on, _account: on, _productDataSource: on, _accountStatus: on, config: Ys, account: Ys, accountName: Ys, accountStatus: Ys, setAccount: cr, configure: cr, refetchAccount: cr, setProductDataSource: cr, setAddToCartConfig: cr, setProductId: cr }, { name: "NizzaStore", autoBind: !0 } ), this.refetchAccount = this.refetchAccount.bind(this); } static instance() { var n; if (!!((n = window == null ? void 0 : window.nizza) != null && n.store)) xr._instance = window.nizza.store; else { const i = new xr(); xr._instance = i, xr._instance._logger.debug("Created new NizzaStore instance"); } return window.nizza || (window.nizza = {}, window.nz = {}, xr._instance._logger.debug("Initialized nizza window object")), window.nizza.store = xr._instance, window.nz = window.nizza, xr._instance; } async configure(e) { try { this._logger.debug("Running configure with config:", e), await this.updateConfig(e); } catch (n) { this.setAccountStatus("error"), this._logger.error("Error running configure", n); } } async updateConfig(e = {}) { var o; const { account: n, authToken: i } = this._config ?? {}; this._config = { ...this._config, ...e }, (o = this._config) != null && o.account && (n !== this._config.account || i !== this._config.authToken) ? (this._logger.debug( `Fetching account data for account: ${this._config.account}, authToken provided: ${!!this._config.authToken}` ), this.logger.setMetadata({ account: this._config.account }), await this.fetchAccount(this._config.account, this._config.authToken)) : this._logger.debug( "Skipped fetching account data as the account or authToken did not change" ), e.getProductDataSource && this.setProductDataSource(await e.getProductDataSource()); } async fetchAccount(e, n) { this.setAccountStatus("loading"); const i = ro(); this.activeAccountFetchId = i; try { const o = await BS(e, n); if (this.activeAccountFetchId !== i) { this._logger.debug( "Fetch account request was superseded by a newer request" ); return; } this.setAccount(o), this.setAccountStatus("success"), this._logger.debug("Account fetched and set successfully:", o); } catch (o) { this.activeAccountFetchId === i && (this.setAccountStatus("error"), o instanceof Ng ? this._logger.fatal("Nizza account not found", e).options({ silent: !0 }) : this._logger.fatal("Unexpected error fetching account", o)); } } setAccount(e) { this._account = e; } setAccountStatus(e) { this._accountStatus = e; } setProductDataSource(e) { this._productDataSource = e; } setProductId(e) { this._config && (this._config.productId = e); } setOrderFormId(e) { this._config && (this._config.orderFormId = e); } setAddToCartConfig(e) { if (!this._config) { const n = "You cannot set addToCartConfig before running configure()"; throw this._logger.error(n), new Error(n); } this._config.addToCartConfig = e; } setAuthToken(e) { this.updateConfig({ authToken: e }); } async refetchAccount() { var e; (e = this._config) != null && e.account && await this.fetchAccount(this._config.account, this._config.authToken); } get version() { return xr.version; } get config() { return this._config; } get account() { return this._account; } get accountStatus() { return this._accountStatus; } get accountName() { var e; return (e = this._config) == null ? void 0 : e.account; } isPvtAccount(e) { var n; return !!(e && ((n = this._config) != null && n.authToken)); } isPubAccount(e) { var n; return !!(e && !((n = this._config) != null && n.authToken)); } get productDataSource() { return this._productDataSource; } get eventBus() { return this._eventBus; } }; de(xr, "version", "9"), de(xr, "_instance"); let Xd = xr; const nr = (t) => { const e = Xd.instance(); return nS( () => !!e.account, () => t == null ? void 0 : t(e) ), e; }; function Eg() { return st.useMemo(() => nr(), []); } function AS(t, e) { const n = Eg(); return fS(() => t(n), e); } const { coreLogger: hx } = nr(), px = hx.child("getClientTimeZone"); function xS(t = !1) { var a, l; let e = null, n = null, i = null; try { e = ((l = (a = Intl.DateTimeFormat()) == null ? void 0 : a.resolvedOptions()) == null ? void 0 : l.timeZone) ?? null; const f = -(/* @__PURE__ */ new Date()).getTimezoneOffset(); i = f; const p = f >= 0 ? "+" : "-", v = String( Math.floor(Math.abs(f) / 60) ).padStart(2, "0"), k = String(Math.abs(f) % 60).padStart( 2, "0" ); n = `${p}${v}:${k}`; } catch (f) { px.error("Error obtaining time zone or offset", f); } const o = { offset: n, offsetValue: i, value: e, country: null, included: null, label: null }; if (t) { const { country: f, included: p, label: v, ...k } = o; return k; } return o; } function CS() { const e = typeof navigator < "u" ? navigator.userAgent : "server", n = mx(e), { language: i, languages: o } = gx(), a = yx(), l = vx(), { hardwareConcurrency: f, deviceMemory: p } = kx(), v = _x(); return { userAgent: e, browser: n.browser, os: n.os, device: n.device, language: i, languages: o, screen: a, connection: l, hardwareConcurrency: f, deviceMemory: p, timezone: v }; } function mx(t) { try { const n = new as(t).getResult(); return { browser: { name: n.browser.name || "Unknown", version: n.browser.version || "Unknown" }, os: { name: n.os.name || "Unknown", version: n.os.version || "Unknown" }, device: { model: n.device.model || "Unknown", // For desktop, UAParser.js may not set device.type; fallback to 'Desktop' type: n.device.type || "Desktop", vendor: n.device.vendor || "Unknown" } }; } catch (e) { return console.error("Error parsing user agent:", e), { browser: { name: "Unknown", version: "Unknown" }, os: { name: "Unknown", version: "Unknown" }, device: { model: "Unknown", type: "Desktop", vendor: "Unknown" } }; } } function gx() { return typeof navigator < "u" ? { language: navigator.language || "Unknown", languages: navigator.languages ? [...navigator.languages] : [] } : { language: "Unknown", languages: [] }; } function yx() { return typeof window < "u" && window.screen ? { width: window.screen.width, height: window.screen.height, colorDepth: window.screen.colorDepth } : null; } function vx() { if (typeof navigator < "u" && "connection" in navigator) { const t = navigator.connection; return { downlink: (t == null ? void 0 : t.downlink) ?? 0, effectiveType: (t == null ? void 0 : t.effectiveType) ?? "Unknown", rtt: (t == null ? void 0 : t.rtt) ?? 0, saveData: (t == null ? void 0 : t.saveData) ?? !1 }; } return null; } function kx() { return typeof navigator < "u" ? { hardwareConcurrency: navigator.hardwareConcurrency || null, deviceMemory: navigator.deviceMemory || null } : { hardwareConcurrency: null, deviceMemory: null }; } function _x() { try { return xS(!0); } catch (t) { return console.error("Error retrieving client timezone:", t), { offset: null, offsetValue: null, value: "Unknown", country: null, included: null, label: null }; } } var nu = /* @__PURE__ */ ((t) => (t.VTEX = "VTEX", t.VTEX_IO = "VTEX-IO", t.VTEX_CMS = "PORTAL-VTEX", t.PLATFORM = "PLATFORM", t.UNKNOWN = "UNKNOWN", t))(nu || {}), OS = /* @__PURE__ */ ((t) => (t.PLATFORM = "platform_module", t.ADENDA = "subscription_module", t.APP_STORE = "app_store", t))(OS || {}), TS = /* @__PURE__ */ ((t) => (t.ACTIVE = "active_contract", t.INACTIVE = "inactive_contract", t))(TS || {}), RS = /* @__PURE__ */ ((t) => (t.LITE = "lite", t.STANDARD = "standard", t.PRO = "pro", t))(RS || {}), IS = /* @__PURE__ */ ((t) => (t.LITE = "PLAN_LITE", t.STANDARD = "PLAN_ESTANDAR", t.PRO = "PLAN_PRO", t.NONE = "NO_PLAN", t))(IS || {}), PS = /* @__PURE__ */ ((t) => (t.PAST = "past", t.LIVE = "live", t.FUTURE = "future", t))(PS || {}); class Ng extends fs { constructor(e) { super("NIZZA_ACCOUNT_NOT_FOUND_ERROR", `Error finding account: ${e}`); } } class LS extends fs { constructor(e) { super("NIZZA_PLAN_NOT_FOUND_ERROR", `Error finding plan: ${e}`); } } class DS extends fs { constructor(e) { super("NIZZA_CREATE_PLAN_ERROR", `Error creating plan: ${e.plan}`, e); } } const Dk = `${ds.apiUrls.restV1}/plans`; class FS { async get(e) { const i = `/info${Yo({ planType: e })}`, o = Dk + i, { data: a } = await Jn({ url: o }); return a; } async create(e) { const n = `${Dk}/create`, { success: i } = await Jn({ url: n, method: "POST", body: JSON.stringify(e) }); if (!i) throw new DS(e); } } function wx(t) { const { host: e, account: n, username: i, createdAt: o, subscriptionType: a, installationDateApp: l, ...f } = t; return { ...f, account: n, host: e ?? null, username: i ?? n, createdAt: new Date(o), subscriptionType: a ?? null, installationDateApp: new Date(l) }; } function Sx(t) { const { host: e, ...n } = t; return { ...n, host: e ?? null, plan: {} }; } const bx = `${ds.apiUrls.restV1}/accounts/v2`; class MS { async get(e) { const n = `${bx}/${e}`, { data: i } = await Jn({ url: n }); return i ? Sx(i) : null; } } const Ex = `${ds.apiUrls.restV1}/accounts/v2/pvt`; class Nx { async get(e, n) { const i = `${Ex}/${e}`, { data: o } = await Jn({ url: i, headers: { authorization: `Bearer ${n}` } }); return o ? wx(o) : null; } } class $S { constructor(e, n, i) { this.publicAccountRepo = e, this.privateAccountRepo = n, this.accountPlanRepo = i; } // async get(name: string, authToken: string): Promise; // async get(name: string, authToken?: undefined): Promise; async get(e, n) { try { const i = n ? await this.privateAccountRepo.get(e, n) : await this.publicAccountRepo.get(e); if (!i) throw new Ng(e); const o = await this.accountPlanRepo.get(i.descriptionPlan); if (!o) throw new LS(i.descriptionPlan); return { ...i, plan: o }; } catch (i) { throw new Xn(i); } } } const Ax = new MS(), xx = new Nx(), Cx = new FS(), jS = new $S( Ax, xx, Cx ), US = () => { const { account: t, accountName: e, accountStatus: n, refetchAccount: i, isPvtAccount: o, isPubAccount: a } = AS((v) => ({ account: v.account, accountName: v.accountName, accountStatus: v.accountStatus, refetchAccount: v.refetchAccount, isPvtAccount: v.isPvtAccount, isPubAccount: v.isPubAccount })), l = ["idle", "loading"].includes(n); return { account: t, accountName: e, isLoading: l, isError: n === "error", isSuccess: n === "success", accountStatus: n, refetchAccount: i, isPvtAccount: o, isPubAccount: a }; }; async function BS(t, e) { return jS.get(t, e); } var VS = /* @__PURE__ */ ((t) => (t.Created = "CREATED", t.CreateComplete = "CREATE_COMPLETE", t.Finalized = "FINALIZED", t.Live = "LIVE", t.Starting = "STARTING", t))(VS || {}), zS = /* @__PURE__ */ ((t) => (t.Add = "add", t.Remove = "remove", t))(zS || {}), HS = /* @__PURE__ */ ((t) => (t.Vtex = "VTEX", t))(HS || {}), qS = /* @__PURE__ */ ((t) => (t.Active = "active", t.Inactive = "inactive", t))(qS || {}); const KS = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "AddCollection" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CreateCollectionInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CollectionSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, GS = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "DeleteCollection" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "deleteCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, WS = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FindCollection" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "findCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CollectionSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "description" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }, { kind: "Field", name: { kind: "Name", value: "products" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "title" } }, { kind: "Field", name: { kind: "Name", value: "link" } }, { kind: "Field", name: { kind: "Name", value: "pictures" } }, { kind: "Field", name: { kind: "Name", value: "price" } }, { kind: "Field", name: { kind: "Name", value: "salesprice" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, QS = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetAllCollections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getAllCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CollectionSuccessArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "description" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }, { kind: "Field", name: { kind: "Name", value: "products" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "title" } }, { kind: "Field", name: { kind: "Name", value: "link" } }, { kind: "Field", name: { kind: "Name", value: "pictures" } }, { kind: "Field", name: { kind: "Name", value: "price" } }, { kind: "Field", name: { kind: "Name", value: "salesprice" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, YS = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "ManageCollectionProduct" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ManageCollectionProductInInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "manageCollectionProduct" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, XS = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "SearchCollections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CollectionSuccessArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "description" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }, { kind: "Field", name: { kind: "Name", value: "products" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "title" } }, { kind: "Field", name: { kind: "Name", value: "link" } }, { kind: "Field", name: { kind: "Name", value: "pictures" } }, { kind: "Field", name: { kind: "Name", value: "price" } }, { kind: "Field", name: { kind: "Name", value: "salesprice" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, JS = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "UpdateCollection" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "UpdateCollectionInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updateCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Ox = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FindMinimalEvent" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "FindEventInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "findEvent" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EventData" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "eventName" } }, { kind: "Field", name: { kind: "Name", value: "thumbnailsPath" } }, { kind: "Field", name: { kind: "Name", value: "recordVideoPath" } }, { kind: "Field", name: { kind: "Name", value: "createdAt" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "thumbnails" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Tx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "SearchMinimalEvents" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "SearchEventInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchEvent" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EventArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "eventName" } }, { kind: "Field", name: { kind: "Name", value: "thumbnailsPath" } }, { kind: "Field", name: { kind: "Name", value: "recordVideoPath" } }, { kind: "Field", name: { kind: "Name", value: "createdAt" } }, { kind: "Field", name: { kind: "Name", value: "status" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Rx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "BlockUser" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "BlockUserInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "blockUser" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BlockUserSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }] } }] } }] }, Ix = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "ChangeAccountUsername" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ChangeUsernameInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "changeAccountUsername" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ChangeUsernameSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }] } }] } }] }, Px = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "DeleteChatMessage" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "DeleteChatInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "deleteChatMessage" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "DeleteChatMessageSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }] } }] } }] }, Lx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetAllChatMessage" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "GetAllChatMessageInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getAllChatMessage" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ChatMessageArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "connectionId" } }, { kind: "Field", name: { kind: "Name", value: "data" } }, { kind: "Field", name: { kind: "Name", value: "email" } }, { kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "idEvent" } }, { kind: "Field", name: { kind: "Name", value: "sendDate" } }, { kind: "Field", name: { kind: "Name", value: "sessionId" } }, { kind: "Field", name: { kind: "Name", value: "type" } }, { kind: "Field", name: { kind: "Name", value: "username" } }, { kind: "Field", name: { kind: "Name", value: "isAdmin" } }, { kind: "Field", name: { kind: "Name", value: "urlGif" } }, { kind: "Field", name: { kind: "Name", value: "second" } }, { kind: "Field", name: { kind: "Name", value: "ip" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, ZS = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChatRoomToken" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "GetChatRoomInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getChatRoomToken" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ChatRoomTokenData" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "token" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Dx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "PinChatMessage" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "PinChatInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "pinChatMessage" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "PinChatMessageSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }] } }] } }] }, Fx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "highlightProduct" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "HighlightProductInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "highlightProduct" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "HighlightProductSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }] } }] } }] }, Mx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "deleteAllCustomization" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomPlayerInputAccount" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "deleteAllCustomPlayer" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, $x = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "getAllCustomization" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getAllCustomPlayer" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomPlayerSuccessArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "data" } }, { kind: "Field", name: { kind: "Name", value: "section" } }, { kind: "Field", name: { kind: "Name", value: "id" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, jx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "updateCustomization" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomPlayerInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updateCustomPlayer" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Ux = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "sendAddToCart" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "AddToCartInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "sendAddToCart" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "AddToCartSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }] } }] } }] }, Bx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetTimeLine" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "GetTimeLineInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getTimeLine" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "TimeLineArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "time" } }, { kind: "Field", name: { kind: "Name", value: "likes" } }, { kind: "Field", name: { kind: "Name", value: "comments" } }, { kind: "Field", name: { kind: "Name", value: "viewers" } }, { kind: "Field", name: { kind: "Name", value: "orders" } }, { kind: "Field", name: { kind: "Name", value: "minute" } }, { kind: "Field", name: { kind: "Name", value: "hour" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Vx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "AppendProductsToSnackVideo" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "RelateToProductsSnackVideoInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "appendProductsSnackVideo" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ActionSnackVideoSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, zx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreatePlayList" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CreatePlayListInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createPlayList" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CreatePlayListSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }] } }] } }] }, Hx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreateSnackVideoBatch" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CreateSnackVideoInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createSnackVideos" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SnackVideoArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, qx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "DeleteRelationshipWithSnackVideo" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "SnackVideoRelationshipKeys" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "deleteRelationshipSnackVideo" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ActionSnackVideoSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }] } }] } }] } }] }, Kx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "DeleteSnackVideo" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "DeleteSnackVideoInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "deleteSnackVideo" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ActionSnackVideoSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }] } }] } }] }, Gx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FindManySnackVideos" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "FindManySnackVideoInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "findManySnackVideos" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SnackVideoArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "url" } }, { kind: "Field", name: { kind: "Name", value: "thumbnailUrl" } }, { kind: "Field", name: { kind: "Name", value: "uploadProgress" } }, { kind: "Field", name: { kind: "Name", value: "duration" } }, { kind: "Field", name: { kind: "Name", value: "eventId" } }, { kind: "Field", name: { kind: "Name", value: "eventName" } }, { kind: "Field", name: { kind: "Name", value: "transmitionType" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Wx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetAllSnackVideos" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getAllSnackVideos" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SnackVideoCreatedArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "snackVideos" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "url" } }, { kind: "Field", name: { kind: "Name", value: "thumbnailUrl" } }, { kind: "Field", name: { kind: "Name", value: "uploadProgress" } }, { kind: "Field", name: { kind: "Name", value: "duration" } }, { kind: "Field", name: { kind: "Name", value: "eventId" } }, { kind: "Field", name: { kind: "Name", value: "eventName" } }, { kind: "Field", name: { kind: "Name", value: "created" } }, { kind: "Field", name: { kind: "Name", value: "transmitionType" } }] } }, { kind: "Field", name: { kind: "Name", value: "cursor" } }, { kind: "Field", name: { kind: "Name", value: "totalItems" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Qx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetPlayLists" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getPlayLists" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "PlayListArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "description" } }, { kind: "Field", name: { kind: "Name", value: "created" } }, { kind: "Field", name: { kind: "Name", value: "videoAmount" } }, { kind: "Field", name: { kind: "Name", value: "productAmount" } }, { kind: "Field", name: { kind: "Name", value: "updated" } }, { kind: "Field", name: { kind: "Name", value: "videos" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "thumbnailUrl" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "order" } }, { kind: "Field", name: { kind: "Name", value: "duration" } }, { kind: "Field", name: { kind: "Name", value: "transmitionType" } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Yx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetSnackVideoRelationships" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "SnackVideoRelationshipInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getRelationshipSnackVideos" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "RelationshipSnackVideoArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "sourceEntity" } }, { kind: "Field", name: { kind: "Name", value: "attributeId" } }] } }] } }] } }] } }] }, Xx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "SearchSnackVideos" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "SearchInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchSnackVideos" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SnackVideoCreatedArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "snackVideos" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "url" } }, { kind: "Field", name: { kind: "Name", value: "thumbnailUrl" } }, { kind: "Field", name: { kind: "Name", value: "uploadProgress" } }, { kind: "Field", name: { kind: "Name", value: "duration" } }, { kind: "Field", name: { kind: "Name", value: "eventId" } }, { kind: "Field", name: { kind: "Name", value: "eventName" } }, { kind: "Field", name: { kind: "Name", value: "created" } }] } }, { kind: "Field", name: { kind: "Name", value: "cursor" } }, { kind: "Field", name: { kind: "Name", value: "totalItems" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Jx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "UpdatePlayList" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "UpdatePlayListInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updatePlayList" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "UpdatePlayListSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }] } }] } }] } }] }, Zx = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FindByProductSnackVideo" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "FindByProductSnackVideoInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "findByProductSnackVideo" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SnackVideoArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "url" } }, { kind: "Field", name: { kind: "Name", value: "thumbnailUrl" } }, { kind: "Field", name: { kind: "Name", value: "duration" } }, { kind: "Field", name: { kind: "Name", value: "transmitionType" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, eC = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetPlayList" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "GetPlayListQueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getPlayList" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "PlayListData" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "description" } }, { kind: "Field", name: { kind: "Name", value: "videos" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productId" } }, { kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "url" } }, { kind: "Field", name: { kind: "Name", value: "thumbnailUrl" } }, { kind: "Field", name: { kind: "Name", value: "duration" } }, { kind: "Field", name: { kind: "Name", value: "transmitionType" } }, { kind: "Field", name: { kind: "Name", value: "order" } }, { kind: "Field", name: { kind: "Name", value: "productName" } }, { kind: "Field", name: { kind: "Name", value: "productImageUrl" } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, tC = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, AddCollectionDocument: KS, AppendProductsToSnackVideoDocument: Vx, BlockUserDocument: Rx, ChangeAccountUsernameDocument: Ix, CreatePlayListDocument: zx, CreateSnackVideoBatchDocument: Hx, DeleteAllCustomizationDocument: Mx, DeleteChatMessageDocument: Px, DeleteCollectionDocument: GS, DeleteRelationshipWithSnackVideoDocument: qx, DeleteSnackVideoDocument: Kx, EventStatus: VS, FindByProductSnackVideoDocument: Zx, FindCollectionDocument: WS, FindManySnackVideosDocument: Gx, FindMinimalEventDocument: Ox, GetAllChatMessageDocument: Lx, GetAllCollectionsDocument: QS, GetAllCustomizationDocument: $x, GetAllSnackVideosDocument: Wx, GetChatRoomTokenDocument: ZS, GetPlayListDocument: eC, GetPlayListsDocument: Qx, GetSnackVideoRelationshipsDocument: Yx, GetTimeLineDocument: Bx, HighlightProductDocument: Fx, ManageCollectionProductDocument: YS, Methods: zS, PinChatMessageDocument: Dx, SearchCollectionsDocument: XS, SearchMinimalEventsDocument: Tx, SearchSnackVideosDocument: Xx, SendAddToCartDocument: Ux, SignProvider: HS, Status: qS, UpdateCollectionDocument: JS, UpdateCustomizationDocument: jx, UpdatePlayListDocument: Jx }, Symbol.toStringTag, { value: "Module" })); var Tf = /* @__PURE__ */ ((t) => (t.OPEN_TAB = "openTab", t.OPEN_VARIATION_SELECTOR = "openVariationSelector", t.ADD_TO_CART = "addToCart", t))(Tf || {}); function nC(t) { return { class: t, _value: null, get value() { return this._value || (this._value = new t(), Object.freeze(this)), this._value; } }; } var mr = /* @__PURE__ */ ((t) => (t.Local = "local", t.VtexLegacy = "vtexlegacy", t.VtexIO = "vtexio", t.VtexFastStore = "faststore", t.Platform = "platform", t.External = "external", t))(mr || {}), Ag = /* @__PURE__ */ ((t) => (t.PROD = "prod", t.DEV = "dev", t.LOCAL = "local", t))(Ag || {}); const { coreLogger: rC } = nr(), Lm = rC.child("addToCartHooks"), Dm = { // eslint-disable-next-line sonarjs/no-duplicate-string errorAddingToCart: "addToCartHooks.notification.error", errorOpeningVariationSelector: "addToCartHooks.notification.error", errorOpeningNewTab: "addToCartHooks.notification.error", successAddingToCart: "addToCartHooks.notification.success" }; async function iC(t) { const e = { ...t, action: { type: Tf.ADD_TO_CART, exec: () => Lm.error("action no implemented in validate hook") } }; try { const n = await sC(e), i = await oC(n); await aC(i); } catch (n) { Lm.error("error unhandled", n); } } async function sC(t) { var a; const { context: e, userAddToCartConfig: n } = t, i = (a = n == null ? void 0 : n.hooks) == null ? void 0 : a.transform; let o = t.product; if (i) try { o = await i({ product: { ...o }, data: e.data ?? {} }); } catch (l) { Jd("transform", l); } return { ...t, product: o }; } async function oC(t) { var p; const { context: e, hookStrategy: n, userAddToCartConfig: i, product: o } = t, a = eb(t), l = (p = i == null ? void 0 : i.hooks) == null ? void 0 : p.validate; let f = n.validate({ ...t, actionFactory: a }); if (l) try { f = await l({ product: { ...o }, defaultAction: { ...f }, action: a, data: e.data ?? {} }); } catch (v) { Jd("validate", v); } return { ...t, action: f, actionFactory: a }; } async function aC(t) { var C; const { eventBus: e } = nr(), { product: n, userAddToCartConfig: i, notifyFactory: o, action: a, actionFactory: l } = t, { isVariationSelectorOpen: f, data: p = {} } = t.context, v = (C = i == null ? void 0 : i.hooks) == null ? void 0 : C.end, k = a.type === Tf.ADD_TO_CART; let b = null, w = !1; const T = () => { !k || !f || l.openVariationSelector(!1).exec(); }, O = () => { !k || w || (b ? o.error(Dm.errorAddingToCart) : o.success(Dm.successAddingToCart)); }, x = () => { const $ = { product: n, actionType: a.type, success: !b, error: b }; e.emit(yS.ATCH_ACTION_EXECUTED, $); }; try { if (!a.type || !a.exec) throw new Error("Invalid action object, missing keys 'type' or 'exec'"); await a.exec(); } catch ($) { Jd("end", $), b = $; } if (v) try { w = !!await v({ data: p, error: b, notify: o, actionExecuted: a }); } catch ($) { Jd("end", $); } T(), O(), x(); } function eb(t) { const { actionFactory: e, userAddToCartConfig: n } = t, i = (o) => Object.entries(o ?? {}).reduce( (a, [l, f]) => ({ ...a, [l]: (p) => ({ type: l, exec: () => f(p) }) }), {} ); return { ...i(e), ...i(n == null ? void 0 : n.actionFactory) }; } function Jd(t, e) { Lm.error(`addToCartHooks error running ${t}: `, e); } class tb { constructor(e) { de(this, "aggregate"); de(this, "_numSetPropsApplied", 0); this.aggregate = e; } setProps(e) { for (const [n, i] of Object.entries(e)) n in this.aggregate && (this.aggregate[n] = i); this._numSetPropsApplied++; } get isFirstSetProps() { return this._numSetPropsApplied === 1; } } function Rf(t) { return new tb(t); } class uC { constructor(e) { de(this, "_value"); e !== void 0 && (this._value = e); } get value() { return this._value; } } var Pn = /* @__PURE__ */ ((t) => (t.GENERAL_ERROR = "GENERAL_ERROR", t.AXIOS_ERROR = "AXIOS_ERROR", t.NETWORK_ERROR = "NETWORK_ERROR", t.CONFIG_ERROR = "CONFIG_ERROR", t.TIMEOUT_ERROR = "TIMEOUT_ERROR", t.AUTH_ERROR = "AUTH_ERROR", t.NOT_FOUND = "NOT_FOUND", t.VALIDATION_ERROR = "VALIDATION_ERROR", t.SERVER_ERROR = "SERVER_ERROR", t.BAD_REQUEST = "BAD_REQUEST", t.UNAUTHORIZED = "UNAUTHORIZED", t.FORBIDDEN = "FORBIDDEN", t.CONFLICT = "CONFLICT", t.GONE = "GONE", t.UNSUPPORTED_MEDIA_TYPE = "UNSUPPORTED_MEDIA_TYPE", t.TOO_MANY_REQUESTS = "TOO_MANY_REQUESTS", t.INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR", t.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", t))(Pn || {}); function nb(t, e) { return function() { return t.apply(e, arguments); }; } const { toString: lC } = Object.prototype, { getPrototypeOf: xg } = Object, If = /* @__PURE__ */ ((t) => (e) => { const n = lC.call(e); return t[n] || (t[n] = n.slice(8, -1).toLowerCase()); })(/* @__PURE__ */ Object.create(null)), ni = (t) => (t = t.toLowerCase(), (e) => If(e) === t), Pf = (t) => (e) => typeof e === t, { isArray: _u } = Array, Ul = Pf("undefined"); function cC(t) { return t !== null && !Ul(t) && t.constructor !== null && !Ul(t.constructor) && gr(t.constructor.isBuffer) && t.constructor.isBuffer(t); } const rb = ni("ArrayBuffer"); function dC(t) { let e; return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && rb(t.buffer), e; } const fC = Pf("string"), gr = Pf("function"), ib = Pf("number"), Lf = (t) => t !== null && typeof t == "object", hC = (t) => t === !0 || t === !1, Id = (t) => { if (If(t) !== "object") return !1; const e = xg(t); return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in t) && !(Symbol.iterator in t); }, pC = ni("Date"), mC = ni("File"), gC = ni("Blob"), yC = ni("FileList"), vC = (t) => Lf(t) && gr(t.pipe), kC = (t) => { let e; return t && (typeof FormData == "function" && t instanceof FormData || gr(t.append) && ((e = If(t)) === "formdata" || // detect form-data instance e === "object" && gr(t.toString) && t.toString() === "[object FormData]")); }, _C = ni("URLSearchParams"), [wC, SC, bC, EC] = ["ReadableStream", "Request", "Response", "Headers"].map(ni), NC = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function Zl(t, e, { allOwnKeys: n = !1 } = {}) { if (t === null || typeof t > "u") return; let i, o; if (typeof t != "object" && (t = [t]), _u(t)) for (i = 0, o = t.length; i < o; i++) e.call(null, t[i], i, t); else { const a = n ? Object.getOwnPropertyNames(t) : Object.keys(t), l = a.length; let f; for (i = 0; i < l; i++) f = a[i], e.call(null, t[f], f, t); } } function sb(t, e) { e = e.toLowerCase(); const n = Object.keys(t); let i = n.length, o; for (; i-- > 0; ) if (o = n[i], e === o.toLowerCase()) return o; return null; } const Ko = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ob = (t) => !Ul(t) && t !== Ko; function Fm() { const { caseless: t } = ob(this) && this || {}, e = {}, n = (i, o) => { const a = t && sb(e, o) || o; Id(e[a]) && Id(i) ? e[a] = Fm(e[a], i) : Id(i) ? e[a] = Fm({}, i) : _u(i) ? e[a] = i.slice() : e[a] = i; }; for (let i = 0, o = arguments.length; i < o; i++) arguments[i] && Zl(arguments[i], n); return e; } const AC = (t, e, n, { allOwnKeys: i } = {}) => (Zl(e, (o, a) => { n && gr(o) ? t[a] = nb(o, n) : t[a] = o; }, { allOwnKeys: i }), t), xC = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), CC = (t, e, n, i) => { t.prototype = Object.create(e.prototype, i), t.prototype.constructor = t, Object.defineProperty(t, "super", { value: e.prototype }), n && Object.assign(t.prototype, n); }, OC = (t, e, n, i) => { let o, a, l; const f = {}; if (e = e || {}, t == null) return e; do { for (o = Object.getOwnPropertyNames(t), a = o.length; a-- > 0; ) l = o[a], (!i || i(l, t, e)) && !f[l] && (e[l] = t[l], f[l] = !0); t = n !== !1 && xg(t); } while (t && (!n || n(t, e)) && t !== Object.prototype); return e; }, TC = (t, e, n) => { t = String(t), (n === void 0 || n > t.length) && (n = t.length), n -= e.length; const i = t.indexOf(e, n); return i !== -1 && i === n; }, RC = (t) => { if (!t) return null; if (_u(t)) return t; let e = t.length; if (!ib(e)) return null; const n = new Array(e); for (; e-- > 0; ) n[e] = t[e]; return n; }, IC = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && xg(Uint8Array)), PC = (t, e) => { const i = (t && t[Symbol.iterator]).call(t); let o; for (; (o = i.next()) && !o.done; ) { const a = o.value; e.call(t, a[0], a[1]); } }, LC = (t, e) => { let n; const i = []; for (; (n = t.exec(e)) !== null; ) i.push(n); return i; }, DC = ni("HTMLFormElement"), FC = (t) => t.toLowerCase().replace( /[-_\s]([a-z\d])(\w*)/g, function(n, i, o) { return i.toUpperCase() + o; } ), Fk = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), MC = ni("RegExp"), ab = (t, e) => { const n = Object.getOwnPropertyDescriptors(t), i = {}; Zl(n, (o, a) => { let l; (l = e(o, a, t)) !== !1 && (i[a] = l || o); }), Object.defineProperties(t, i); }, $C = (t) => { ab(t, (e, n) => { if (gr(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1) return !1; const i = t[n]; if (gr(i)) { if (e.enumerable = !1, "writable" in e) { e.writable = !1; return; } e.set || (e.set = () => { throw Error("Can not rewrite read-only method '" + n + "'"); }); } }); }, jC = (t, e) => { const n = {}, i = (o) => { o.forEach((a) => { n[a] = !0; }); }; return _u(t) ? i(t) : i(String(t).split(e)), n; }, UC = () => { }, BC = (t, e) => t != null && Number.isFinite(t = +t) ? t : e, qp = "abcdefghijklmnopqrstuvwxyz", Mk = "0123456789", ub = { DIGIT: Mk, ALPHA: qp, ALPHA_DIGIT: qp + qp.toUpperCase() + Mk }, VC = (t = 16, e = ub.ALPHA_DIGIT) => { let n = ""; const { length: i } = e; for (; t--; ) n += e[Math.random() * i | 0]; return n; }; function zC(t) { return !!(t && gr(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]); } const HC = (t) => { const e = new Array(10), n = (i, o) => { if (Lf(i)) { if (e.indexOf(i) >= 0) return; if (!("toJSON" in i)) { e[o] = i; const a = _u(i) ? [] : {}; return Zl(i, (l, f) => { const p = n(l, o + 1); !Ul(p) && (a[f] = p); }), e[o] = void 0, a; } } return i; }; return n(t, 0); }, qC = ni("AsyncFunction"), KC = (t) => t && (Lf(t) || gr(t)) && gr(t.then) && gr(t.catch), lb = ((t, e) => t ? setImmediate : e ? ((n, i) => (Ko.addEventListener("message", ({ source: o, data: a }) => { o === Ko && a === n && i.length && i.shift()(); }, !1), (o) => { i.push(o), Ko.postMessage(n, "*"); }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))( typeof setImmediate == "function", gr(Ko.postMessage) ), GC = typeof queueMicrotask < "u" ? queueMicrotask.bind(Ko) : typeof process < "u" && process.nextTick || lb, ce = { isArray: _u, isArrayBuffer: rb, isBuffer: cC, isFormData: kC, isArrayBufferView: dC, isString: fC, isNumber: ib, isBoolean: hC, isObject: Lf, isPlainObject: Id, isReadableStream: wC, isRequest: SC, isResponse: bC, isHeaders: EC, isUndefined: Ul, isDate: pC, isFile: mC, isBlob: gC, isRegExp: MC, isFunction: gr, isStream: vC, isURLSearchParams: _C, isTypedArray: IC, isFileList: yC, forEach: Zl, merge: Fm, extend: AC, trim: NC, stripBOM: xC, inherits: CC, toFlatObject: OC, kindOf: If, kindOfTest: ni, endsWith: TC, toArray: RC, forEachEntry: PC, matchAll: LC, isHTMLForm: DC, hasOwnProperty: Fk, hasOwnProp: Fk, // an alias to avoid ESLint no-prototype-builtins detection reduceDescriptors: ab, freezeMethods: $C, toObjectSet: jC, toCamelCase: FC, noop: UC, toFiniteNumber: BC, findKey: sb, global: Ko, isContextDefined: ob, ALPHABET: ub, generateString: VC, isSpecCompliantForm: zC, toJSONObject: HC, isAsyncFn: qC, isThenable: KC, setImmediate: lb, asap: GC }; function yt(t, e, n, i, o) { Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), n && (this.config = n), i && (this.request = i), o && (this.response = o, this.status = o.status ? o.status : null); } ce.inherits(yt, Error, { toJSON: function() { return { // Standard message: this.message, name: this.name, // Microsoft description: this.description, number: this.number, // Mozilla fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, // Axios config: ce.toJSONObject(this.config), code: this.code, status: this.status }; } }); const cb = yt.prototype, db = {}; [ "ERR_BAD_OPTION_VALUE", "ERR_BAD_OPTION", "ECONNABORTED", "ETIMEDOUT", "ERR_NETWORK", "ERR_FR_TOO_MANY_REDIRECTS", "ERR_DEPRECATED", "ERR_BAD_RESPONSE", "ERR_BAD_REQUEST", "ERR_CANCELED", "ERR_NOT_SUPPORT", "ERR_INVALID_URL" // eslint-disable-next-line func-names ].forEach((t) => { db[t] = { value: t }; }); Object.defineProperties(yt, db); Object.defineProperty(cb, "isAxiosError", { value: !0 }); yt.from = (t, e, n, i, o, a) => { const l = Object.create(cb); return ce.toFlatObject(t, l, function(p) { return p !== Error.prototype; }, (f) => f !== "isAxiosError"), yt.call(l, t.message, e, n, i, o), l.cause = t, l.name = t.name, a && Object.assign(l, a), l; }; const WC = null; function Mm(t) { return ce.isPlainObject(t) || ce.isArray(t); } function fb(t) { return ce.endsWith(t, "[]") ? t.slice(0, -2) : t; } function $k(t, e, n) { return t ? t.concat(e).map(function(o, a) { return o = fb(o), !n && a ? "[" + o + "]" : o; }).join(n ? "." : "") : e; } function QC(t) { return ce.isArray(t) && !t.some(Mm); } const YC = ce.toFlatObject(ce, {}, null, function(e) { return /^is[A-Z]/.test(e); }); function Df(t, e, n) { if (!ce.isObject(t)) throw new TypeError("target must be an object"); e = e || new FormData(), n = ce.toFlatObject(n, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function(x, C) { return !ce.isUndefined(C[x]); }); const i = n.metaTokens, o = n.visitor || k, a = n.dots, l = n.indexes, p = (n.Blob || typeof Blob < "u" && Blob) && ce.isSpecCompliantForm(e); if (!ce.isFunction(o)) throw new TypeError("visitor must be a function"); function v(O) { if (O === null) return ""; if (ce.isDate(O)) return O.toISOString(); if (!p && ce.isBlob(O)) throw new yt("Blob is not supported. Use a Buffer instead."); return ce.isArrayBuffer(O) || ce.isTypedArray(O) ? p && typeof Blob == "function" ? new Blob([O]) : Buffer.from(O) : O; } function k(O, x, C) { let $ = O; if (O && !C && typeof O == "object") { if (ce.endsWith(x, "{}")) x = i ? x : x.slice(0, -2), O = JSON.stringify(O); else if (ce.isArray(O) && QC(O) || (ce.isFileList(O) || ce.endsWith(x, "[]")) && ($ = ce.toArray(O))) return x = fb(x), $.forEach(function(le, ne) { !(ce.isUndefined(le) || le === null) && e.append( // eslint-disable-next-line no-nested-ternary l === !0 ? $k([x], ne, a) : l === null ? x : x + "[]", v(le) ); }), !1; } return Mm(O) ? !0 : (e.append($k(C, x, a), v(O)), !1); } const b = [], w = Object.assign(YC, { defaultVisitor: k, convertValue: v, isVisitable: Mm }); function T(O, x) { if (!ce.isUndefined(O)) { if (b.indexOf(O) !== -1) throw Error("Circular reference detected in " + x.join(".")); b.push(O), ce.forEach(O, function($, J) { (!(ce.isUndefined($) || $ === null) && o.call( e, $, ce.isString(J) ? J.trim() : J, x, w )) === !0 && T($, x ? x.concat(J) : [J]); }), b.pop(); } } if (!ce.isObject(t)) throw new TypeError("data must be an object"); return T(t), e; } function jk(t) { const e = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(i) { return e[i]; }); } function Cg(t, e) { this._pairs = [], t && Df(t, this, e); } const hb = Cg.prototype; hb.append = function(e, n) { this._pairs.push([e, n]); }; hb.toString = function(e) { const n = e ? function(i) { return e.call(this, i, jk); } : jk; return this._pairs.map(function(o) { return n(o[0]) + "=" + n(o[1]); }, "").join("&"); }; function XC(t) { return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); } function pb(t, e, n) { if (!e) return t; const i = n && n.encode || XC, o = n && n.serialize; let a; if (o ? a = o(e, n) : a = ce.isURLSearchParams(e) ? e.toString() : new Cg(e, n).toString(i), a) { const l = t.indexOf("#"); l !== -1 && (t = t.slice(0, l)), t += (t.indexOf("?") === -1 ? "?" : "&") + a; } return t; } class Uk { constructor() { this.handlers = []; } /** * Add a new interceptor to the stack * * @param {Function} fulfilled The function to handle `then` for a `Promise` * @param {Function} rejected The function to handle `reject` for a `Promise` * * @return {Number} An ID used to remove interceptor later */ use(e, n, i) { return this.handlers.push({ fulfilled: e, rejected: n, synchronous: i ? i.synchronous : !1, runWhen: i ? i.runWhen : null }), this.handlers.length - 1; } /** * Remove an interceptor from the stack * * @param {Number} id The ID that was returned by `use` * * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise */ eject(e) { this.handlers[e] && (this.handlers[e] = null); } /** * Clear all interceptors from the stack * * @returns {void} */ clear() { this.handlers && (this.handlers = []); } /** * Iterate over all the registered interceptors * * This method is particularly useful for skipping over any * interceptors that may have become `null` calling `eject`. * * @param {Function} fn The function to call for each interceptor * * @returns {void} */ forEach(e) { ce.forEach(this.handlers, function(i) { i !== null && e(i); }); } } const mb = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, JC = typeof URLSearchParams < "u" ? URLSearchParams : Cg, ZC = typeof FormData < "u" ? FormData : null, eO = typeof Blob < "u" ? Blob : null, tO = { isBrowser: !0, classes: { URLSearchParams: JC, FormData: ZC, Blob: eO }, protocols: ["http", "https", "file", "blob", "url", "data"] }, Og = typeof window < "u" && typeof document < "u", $m = typeof navigator == "object" && navigator || void 0, nO = Og && (!$m || ["ReactNative", "NativeScript", "NS"].indexOf($m.product) < 0), rO = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef self instanceof WorkerGlobalScope && typeof self.importScripts == "function", iO = Og && window.location.href || "http://localhost", sO = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, hasBrowserEnv: Og, hasStandardBrowserEnv: nO, hasStandardBrowserWebWorkerEnv: rO, navigator: $m, origin: iO }, Symbol.toStringTag, { value: "Module" })), er = { ...sO, ...tO }; function oO(t, e) { return Df(t, new er.classes.URLSearchParams(), Object.assign({ visitor: function(n, i, o, a) { return er.isNode && ce.isBuffer(n) ? (this.append(i, n.toString("base64")), !1) : a.defaultVisitor.apply(this, arguments); } }, e)); } function aO(t) { return ce.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]); } function uO(t) { const e = {}, n = Object.keys(t); let i; const o = n.length; let a; for (i = 0; i < o; i++) a = n[i], e[a] = t[a]; return e; } function gb(t) { function e(n, i, o, a) { let l = n[a++]; if (l === "__proto__") return !0; const f = Number.isFinite(+l), p = a >= n.length; return l = !l && ce.isArray(o) ? o.length : l, p ? (ce.hasOwnProp(o, l) ? o[l] = [o[l], i] : o[l] = i, !f) : ((!o[l] || !ce.isObject(o[l])) && (o[l] = []), e(n, i, o[l], a) && ce.isArray(o[l]) && (o[l] = uO(o[l])), !f); } if (ce.isFormData(t) && ce.isFunction(t.entries)) { const n = {}; return ce.forEachEntry(t, (i, o) => { e(aO(i), o, n, 0); }), n; } return null; } function lO(t, e, n) { if (ce.isString(t)) try { return (e || JSON.parse)(t), ce.trim(t); } catch (i) { if (i.name !== "SyntaxError") throw i; } return (n || JSON.stringify)(t); } const ec = { transitional: mb, adapter: ["xhr", "http", "fetch"], transformRequest: [function(e, n) { const i = n.getContentType() || "", o = i.indexOf("application/json") > -1, a = ce.isObject(e); if (a && ce.isHTMLForm(e) && (e = new FormData(e)), ce.isFormData(e)) return o ? JSON.stringify(gb(e)) : e; if (ce.isArrayBuffer(e) || ce.isBuffer(e) || ce.isStream(e) || ce.isFile(e) || ce.isBlob(e) || ce.isReadableStream(e)) return e; if (ce.isArrayBufferView(e)) return e.buffer; if (ce.isURLSearchParams(e)) return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString(); let f; if (a) { if (i.indexOf("application/x-www-form-urlencoded") > -1) return oO(e, this.formSerializer).toString(); if ((f = ce.isFileList(e)) || i.indexOf("multipart/form-data") > -1) { const p = this.env && this.env.FormData; return Df( f ? { "files[]": e } : e, p && new p(), this.formSerializer ); } } return a || o ? (n.setContentType("application/json", !1), lO(e)) : e; }], transformResponse: [function(e) { const n = this.transitional || ec.transitional, i = n && n.forcedJSONParsing, o = this.responseType === "json"; if (ce.isResponse(e) || ce.isReadableStream(e)) return e; if (e && ce.isString(e) && (i && !this.responseType || o)) { const l = !(n && n.silentJSONParsing) && o; try { return JSON.parse(e); } catch (f) { if (l) throw f.name === "SyntaxError" ? yt.from(f, yt.ERR_BAD_RESPONSE, this, null, this.response) : f; } } return e; }], /** * A timeout in milliseconds to abort a request. If set to 0 (default) a * timeout is not created. */ timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", maxContentLength: -1, maxBodyLength: -1, env: { FormData: er.classes.FormData, Blob: er.classes.Blob }, validateStatus: function(e) { return e >= 200 && e < 300; }, headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; ce.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => { ec.headers[t] = {}; }); const cO = ce.toObjectSet([ "age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent" ]), dO = (t) => { const e = {}; let n, i, o; return t && t.split(` `).forEach(function(l) { o = l.indexOf(":"), n = l.substring(0, o).trim().toLowerCase(), i = l.substring(o + 1).trim(), !(!n || e[n] && cO[n]) && (n === "set-cookie" ? e[n] ? e[n].push(i) : e[n] = [i] : e[n] = e[n] ? e[n] + ", " + i : i); }), e; }, Bk = Symbol("internals"); function gl(t) { return t && String(t).trim().toLowerCase(); } function Pd(t) { return t === !1 || t == null ? t : ce.isArray(t) ? t.map(Pd) : String(t); } function fO(t) { const e = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; let i; for (; i = n.exec(t); ) e[i[1]] = i[2]; return e; } const hO = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()); function Kp(t, e, n, i, o) { if (ce.isFunction(i)) return i.call(this, e, n); if (o && (e = n), !!ce.isString(e)) { if (ce.isString(i)) return e.indexOf(i) !== -1; if (ce.isRegExp(i)) return i.test(e); } } function pO(t) { return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, i) => n.toUpperCase() + i); } function mO(t, e) { const n = ce.toCamelCase(" " + e); ["get", "set", "has"].forEach((i) => { Object.defineProperty(t, i + n, { value: function(o, a, l) { return this[i].call(this, e, o, a, l); }, configurable: !0 }); }); } let tr = class { constructor(e) { e && this.set(e); } set(e, n, i) { const o = this; function a(f, p, v) { const k = gl(p); if (!k) throw new Error("header name must be a non-empty string"); const b = ce.findKey(o, k); (!b || o[b] === void 0 || v === !0 || v === void 0 && o[b] !== !1) && (o[b || p] = Pd(f)); } const l = (f, p) => ce.forEach(f, (v, k) => a(v, k, p)); if (ce.isPlainObject(e) || e instanceof this.constructor) l(e, n); else if (ce.isString(e) && (e = e.trim()) && !hO(e)) l(dO(e), n); else if (ce.isHeaders(e)) for (const [f, p] of e.entries()) a(p, f, i); else e != null && a(n, e, i); return this; } get(e, n) { if (e = gl(e), e) { const i = ce.findKey(this, e); if (i) { const o = this[i]; if (!n) return o; if (n === !0) return fO(o); if (ce.isFunction(n)) return n.call(this, o, i); if (ce.isRegExp(n)) return n.exec(o); throw new TypeError("parser must be boolean|regexp|function"); } } } has(e, n) { if (e = gl(e), e) { const i = ce.findKey(this, e); return !!(i && this[i] !== void 0 && (!n || Kp(this, this[i], i, n))); } return !1; } delete(e, n) { const i = this; let o = !1; function a(l) { if (l = gl(l), l) { const f = ce.findKey(i, l); f && (!n || Kp(i, i[f], f, n)) && (delete i[f], o = !0); } } return ce.isArray(e) ? e.forEach(a) : a(e), o; } clear(e) { const n = Object.keys(this); let i = n.length, o = !1; for (; i--; ) { const a = n[i]; (!e || Kp(this, this[a], a, e, !0)) && (delete this[a], o = !0); } return o; } normalize(e) { const n = this, i = {}; return ce.forEach(this, (o, a) => { const l = ce.findKey(i, a); if (l) { n[l] = Pd(o), delete n[a]; return; } const f = e ? pO(a) : String(a).trim(); f !== a && delete n[a], n[f] = Pd(o), i[f] = !0; }), this; } concat(...e) { return this.constructor.concat(this, ...e); } toJSON(e) { const n = /* @__PURE__ */ Object.create(null); return ce.forEach(this, (i, o) => { i != null && i !== !1 && (n[o] = e && ce.isArray(i) ? i.join(", ") : i); }), n; } [Symbol.iterator]() { return Object.entries(this.toJSON())[Symbol.iterator](); } toString() { return Object.entries(this.toJSON()).map(([e, n]) => e + ": " + n).join(` `); } get [Symbol.toStringTag]() { return "AxiosHeaders"; } static from(e) { return e instanceof this ? e : new this(e); } static concat(e, ...n) { const i = new this(e); return n.forEach((o) => i.set(o)), i; } static accessor(e) { const i = (this[Bk] = this[Bk] = { accessors: {} }).accessors, o = this.prototype; function a(l) { const f = gl(l); i[f] || (mO(o, l), i[f] = !0); } return ce.isArray(e) ? e.forEach(a) : a(e), this; } }; tr.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); ce.reduceDescriptors(tr.prototype, ({ value: t }, e) => { let n = e[0].toUpperCase() + e.slice(1); return { get: () => t, set(i) { this[n] = i; } }; }); ce.freezeMethods(tr); function Gp(t, e) { const n = this || ec, i = e || n, o = tr.from(i.headers); let a = i.data; return ce.forEach(t, function(f) { a = f.call(n, a, o.normalize(), e ? e.status : void 0); }), o.normalize(), a; } function yb(t) { return !!(t && t.__CANCEL__); } function wu(t, e, n) { yt.call(this, t ?? "canceled", yt.ERR_CANCELED, e, n), this.name = "CanceledError"; } ce.inherits(wu, yt, { __CANCEL__: !0 }); function vb(t, e, n) { const i = n.config.validateStatus; !n.status || !i || i(n.status) ? t(n) : e(new yt( "Request failed with status code " + n.status, [yt.ERR_BAD_REQUEST, yt.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4], n.config, n.request, n )); } function gO(t) { const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t); return e && e[1] || ""; } function yO(t, e) { t = t || 10; const n = new Array(t), i = new Array(t); let o = 0, a = 0, l; return e = e !== void 0 ? e : 1e3, function(p) { const v = Date.now(), k = i[a]; l || (l = v), n[o] = p, i[o] = v; let b = a, w = 0; for (; b !== o; ) w += n[b++], b = b % t; if (o = (o + 1) % t, o === a && (a = (a + 1) % t), v - l < e) return; const T = k && v - k; return T ? Math.round(w * 1e3 / T) : void 0; }; } function vO(t, e) { let n = 0, i = 1e3 / e, o, a; const l = (v, k = Date.now()) => { n = k, o = null, a && (clearTimeout(a), a = null), t.apply(null, v); }; return [(...v) => { const k = Date.now(), b = k - n; b >= i ? l(v, k) : (o = v, a || (a = setTimeout(() => { a = null, l(o); }, i - b))); }, () => o && l(o)]; } const Zd = (t, e, n = 3) => { let i = 0; const o = yO(50, 250); return vO((a) => { const l = a.loaded, f = a.lengthComputable ? a.total : void 0, p = l - i, v = o(p), k = l <= f; i = l; const b = { loaded: l, total: f, progress: f ? l / f : void 0, bytes: p, rate: v || void 0, estimated: v && f && k ? (f - l) / v : void 0, event: a, lengthComputable: f != null, [e ? "download" : "upload"]: !0 }; t(b); }, n); }, Vk = (t, e) => { const n = t != null; return [(i) => e[0]({ lengthComputable: n, total: t, loaded: i }), e[1]]; }, zk = (t) => (...e) => ce.asap(() => t(...e)), kO = er.hasStandardBrowserEnv ? ( // Standard browser envs have full support of the APIs needed to test // whether the request URL is of the same origin as current location. function() { const e = er.navigator && /(msie|trident)/i.test(er.navigator.userAgent), n = document.createElement("a"); let i; function o(a) { let l = a; return e && (n.setAttribute("href", l), l = n.href), n.setAttribute("href", l), { href: n.href, protocol: n.protocol ? n.protocol.replace(/:$/, "") : "", host: n.host, search: n.search ? n.search.replace(/^\?/, "") : "", hash: n.hash ? n.hash.replace(/^#/, "") : "", hostname: n.hostname, port: n.port, pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname }; } return i = o(window.location.href), function(l) { const f = ce.isString(l) ? o(l) : l; return f.protocol === i.protocol && f.host === i.host; }; }() ) : ( // Non standard browser envs (web workers, react-native) lack needed support. /* @__PURE__ */ function() { return function() { return !0; }; }() ), _O = er.hasStandardBrowserEnv ? ( // Standard browser envs support document.cookie { write(t, e, n, i, o, a) { const l = [t + "=" + encodeURIComponent(e)]; ce.isNumber(n) && l.push("expires=" + new Date(n).toGMTString()), ce.isString(i) && l.push("path=" + i), ce.isString(o) && l.push("domain=" + o), a === !0 && l.push("secure"), document.cookie = l.join("; "); }, read(t) { const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)")); return e ? decodeURIComponent(e[3]) : null; }, remove(t) { this.write(t, "", Date.now() - 864e5); } } ) : ( // Non-standard browser env (web workers, react-native) lack needed support. { write() { }, read() { return null; }, remove() { } } ); function wO(t) { return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t); } function SO(t, e) { return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t; } function kb(t, e) { return t && !wO(e) ? SO(t, e) : e; } const Hk = (t) => t instanceof tr ? { ...t } : t; function ea(t, e) { e = e || {}; const n = {}; function i(v, k, b) { return ce.isPlainObject(v) && ce.isPlainObject(k) ? ce.merge.call({ caseless: b }, v, k) : ce.isPlainObject(k) ? ce.merge({}, k) : ce.isArray(k) ? k.slice() : k; } function o(v, k, b) { if (ce.isUndefined(k)) { if (!ce.isUndefined(v)) return i(void 0, v, b); } else return i(v, k, b); } function a(v, k) { if (!ce.isUndefined(k)) return i(void 0, k); } function l(v, k) { if (ce.isUndefined(k)) { if (!ce.isUndefined(v)) return i(void 0, v); } else return i(void 0, k); } function f(v, k, b) { if (b in e) return i(v, k); if (b in t) return i(void 0, v); } const p = { url: a, method: a, data: a, baseURL: l, transformRequest: l, transformResponse: l, paramsSerializer: l, timeout: l, timeoutMessage: l, withCredentials: l, withXSRFToken: l, adapter: l, responseType: l, xsrfCookieName: l, xsrfHeaderName: l, onUploadProgress: l, onDownloadProgress: l, decompress: l, maxContentLength: l, maxBodyLength: l, beforeRedirect: l, transport: l, httpAgent: l, httpsAgent: l, cancelToken: l, socketPath: l, responseEncoding: l, validateStatus: f, headers: (v, k) => o(Hk(v), Hk(k), !0) }; return ce.forEach(Object.keys(Object.assign({}, t, e)), function(k) { const b = p[k] || o, w = b(t[k], e[k], k); ce.isUndefined(w) && b !== f || (n[k] = w); }), n; } const _b = (t) => { const e = ea({}, t); let { data: n, withXSRFToken: i, xsrfHeaderName: o, xsrfCookieName: a, headers: l, auth: f } = e; e.headers = l = tr.from(l), e.url = pb(kb(e.baseURL, e.url), t.params, t.paramsSerializer), f && l.set( "Authorization", "Basic " + btoa((f.username || "") + ":" + (f.password ? unescape(encodeURIComponent(f.password)) : "")) ); let p; if (ce.isFormData(n)) { if (er.hasStandardBrowserEnv || er.hasStandardBrowserWebWorkerEnv) l.setContentType(void 0); else if ((p = l.getContentType()) !== !1) { const [v, ...k] = p ? p.split(";").map((b) => b.trim()).filter(Boolean) : []; l.setContentType([v || "multipart/form-data", ...k].join("; ")); } } if (er.hasStandardBrowserEnv && (i && ce.isFunction(i) && (i = i(e)), i || i !== !1 && kO(e.url))) { const v = o && a && _O.read(a); v && l.set(o, v); } return e; }, bO = typeof XMLHttpRequest < "u", EO = bO && function(t) { return new Promise(function(n, i) { const o = _b(t); let a = o.data; const l = tr.from(o.headers).normalize(); let { responseType: f, onUploadProgress: p, onDownloadProgress: v } = o, k, b, w, T, O; function x() { T && T(), O && O(), o.cancelToken && o.cancelToken.unsubscribe(k), o.signal && o.signal.removeEventListener("abort", k); } let C = new XMLHttpRequest(); C.open(o.method.toUpperCase(), o.url, !0), C.timeout = o.timeout; function $() { if (!C) return; const le = tr.from( "getAllResponseHeaders" in C && C.getAllResponseHeaders() ), he = { data: !f || f === "text" || f === "json" ? C.responseText : C.response, status: C.status, statusText: C.statusText, headers: le, config: t, request: C }; vb(function(me) { n(me), x(); }, function(me) { i(me), x(); }, he), C = null; } "onloadend" in C ? C.onloadend = $ : C.onreadystatechange = function() { !C || C.readyState !== 4 || C.status === 0 && !(C.responseURL && C.responseURL.indexOf("file:") === 0) || setTimeout($); }, C.onabort = function() { C && (i(new yt("Request aborted", yt.ECONNABORTED, t, C)), C = null); }, C.onerror = function() { i(new yt("Network Error", yt.ERR_NETWORK, t, C)), C = null; }, C.ontimeout = function() { let ne = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded"; const he = o.transitional || mb; o.timeoutErrorMessage && (ne = o.timeoutErrorMessage), i(new yt( ne, he.clarifyTimeoutError ? yt.ETIMEDOUT : yt.ECONNABORTED, t, C )), C = null; }, a === void 0 && l.setContentType(null), "setRequestHeader" in C && ce.forEach(l.toJSON(), function(ne, he) { C.setRequestHeader(he, ne); }), ce.isUndefined(o.withCredentials) || (C.withCredentials = !!o.withCredentials), f && f !== "json" && (C.responseType = o.responseType), v && ([w, O] = Zd(v, !0), C.addEventListener("progress", w)), p && C.upload && ([b, T] = Zd(p), C.upload.addEventListener("progress", b), C.upload.addEventListener("loadend", T)), (o.cancelToken || o.signal) && (k = (le) => { C && (i(!le || le.type ? new wu(null, t, C) : le), C.abort(), C = null); }, o.cancelToken && o.cancelToken.subscribe(k), o.signal && (o.signal.aborted ? k() : o.signal.addEventListener("abort", k))); const J = gO(o.url); if (J && er.protocols.indexOf(J) === -1) { i(new yt("Unsupported protocol " + J + ":", yt.ERR_BAD_REQUEST, t)); return; } C.send(a || null); }); }, NO = (t, e) => { const { length: n } = t = t ? t.filter(Boolean) : []; if (e || n) { let i = new AbortController(), o; const a = function(v) { if (!o) { o = !0, f(); const k = v instanceof Error ? v : this.reason; i.abort(k instanceof yt ? k : new wu(k instanceof Error ? k.message : k)); } }; let l = e && setTimeout(() => { l = null, a(new yt(`timeout ${e} of ms exceeded`, yt.ETIMEDOUT)); }, e); const f = () => { t && (l && clearTimeout(l), l = null, t.forEach((v) => { v.unsubscribe ? v.unsubscribe(a) : v.removeEventListener("abort", a); }), t = null); }; t.forEach((v) => v.addEventListener("abort", a)); const { signal: p } = i; return p.unsubscribe = () => ce.asap(f), p; } }, AO = function* (t, e) { let n = t.byteLength; if (n < e) { yield t; return; } let i = 0, o; for (; i < n; ) o = i + e, yield t.slice(i, o), i = o; }, xO = async function* (t, e) { for await (const n of CO(t)) yield* AO(n, e); }, CO = async function* (t) { if (t[Symbol.asyncIterator]) { yield* t; return; } const e = t.getReader(); try { for (; ; ) { const { done: n, value: i } = await e.read(); if (n) break; yield i; } } finally { await e.cancel(); } }, qk = (t, e, n, i) => { const o = xO(t, e); let a = 0, l, f = (p) => { l || (l = !0, i && i(p)); }; return new ReadableStream({ async pull(p) { try { const { done: v, value: k } = await o.next(); if (v) { f(), p.close(); return; } let b = k.byteLength; if (n) { let w = a += b; n(w); } p.enqueue(new Uint8Array(k)); } catch (v) { throw f(v), v; } }, cancel(p) { return f(p), o.return(); } }, { highWaterMark: 2 }); }, Ff = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", wb = Ff && typeof ReadableStream == "function", OO = Ff && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((t) => (e) => t.encode(e))(new TextEncoder()) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())), Sb = (t, ...e) => { try { return !!t(...e); } catch { return !1; } }, TO = wb && Sb(() => { let t = !1; const e = new Request(er.origin, { body: new ReadableStream(), method: "POST", get duplex() { return t = !0, "half"; } }).headers.has("Content-Type"); return t && !e; }), Kk = 64 * 1024, jm = wb && Sb(() => ce.isReadableStream(new Response("").body)), ef = { stream: jm && ((t) => t.body) }; Ff && ((t) => { ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => { !ef[e] && (ef[e] = ce.isFunction(t[e]) ? (n) => n[e]() : (n, i) => { throw new yt(`Response type '${e}' is not supported`, yt.ERR_NOT_SUPPORT, i); }); }); })(new Response()); const RO = async (t) => { if (t == null) return 0; if (ce.isBlob(t)) return t.size; if (ce.isSpecCompliantForm(t)) return (await new Request(er.origin, { method: "POST", body: t }).arrayBuffer()).byteLength; if (ce.isArrayBufferView(t) || ce.isArrayBuffer(t)) return t.byteLength; if (ce.isURLSearchParams(t) && (t = t + ""), ce.isString(t)) return (await OO(t)).byteLength; }, IO = async (t, e) => { const n = ce.toFiniteNumber(t.getContentLength()); return n ?? RO(e); }, PO = Ff && (async (t) => { let { url: e, method: n, data: i, signal: o, cancelToken: a, timeout: l, onDownloadProgress: f, onUploadProgress: p, responseType: v, headers: k, withCredentials: b = "same-origin", fetchOptions: w } = _b(t); v = v ? (v + "").toLowerCase() : "text"; let T = NO([o, a && a.toAbortSignal()], l), O; const x = T && T.unsubscribe && (() => { T.unsubscribe(); }); let C; try { if (p && TO && n !== "get" && n !== "head" && (C = await IO(k, i)) !== 0) { let he = new Request(e, { method: "POST", body: i, duplex: "half" }), ye; if (ce.isFormData(i) && (ye = he.headers.get("content-type")) && k.setContentType(ye), he.body) { const [me, Fe] = Vk( C, Zd(zk(p)) ); i = qk(he.body, Kk, me, Fe); } } ce.isString(b) || (b = b ? "include" : "omit"); const $ = "credentials" in Request.prototype; O = new Request(e, { ...w, signal: T, method: n.toUpperCase(), headers: k.normalize().toJSON(), body: i, duplex: "half", credentials: $ ? b : void 0 }); let J = await fetch(O); const le = jm && (v === "stream" || v === "response"); if (jm && (f || le && x)) { const he = {}; ["status", "statusText", "headers"].forEach((Re) => { he[Re] = J[Re]; }); const ye = ce.toFiniteNumber(J.headers.get("content-length")), [me, Fe] = f && Vk( ye, Zd(zk(f), !0) ) || []; J = new Response( qk(J.body, Kk, me, () => { Fe && Fe(), x && x(); }), he ); } v = v || "text"; let ne = await ef[ce.findKey(ef, v) || "text"](J, t); return !le && x && x(), await new Promise((he, ye) => { vb(he, ye, { data: ne, headers: tr.from(J.headers), status: J.status, statusText: J.statusText, config: t, request: O }); }); } catch ($) { throw x && x(), $ && $.name === "TypeError" && /fetch/i.test($.message) ? Object.assign( new yt("Network Error", yt.ERR_NETWORK, t, O), { cause: $.cause || $ } ) : yt.from($, $ && $.code, t, O); } }), Um = { http: WC, xhr: EO, fetch: PO }; ce.forEach(Um, (t, e) => { if (t) { try { Object.defineProperty(t, "name", { value: e }); } catch { } Object.defineProperty(t, "adapterName", { value: e }); } }); const Gk = (t) => `- ${t}`, LO = (t) => ce.isFunction(t) || t === null || t === !1, bb = { getAdapter: (t) => { t = ce.isArray(t) ? t : [t]; const { length: e } = t; let n, i; const o = {}; for (let a = 0; a < e; a++) { n = t[a]; let l; if (i = n, !LO(n) && (i = Um[(l = String(n)).toLowerCase()], i === void 0)) throw new yt(`Unknown adapter '${l}'`); if (i) break; o[l || "#" + a] = i; } if (!i) { const a = Object.entries(o).map( ([f, p]) => `adapter ${f} ` + (p === !1 ? "is not supported by the environment" : "is not available in the build") ); let l = e ? a.length > 1 ? `since : ` + a.map(Gk).join(` `) : " " + Gk(a[0]) : "as no adapter specified"; throw new yt( "There is no suitable adapter to dispatch the request " + l, "ERR_NOT_SUPPORT" ); } return i; }, adapters: Um }; function Wp(t) { if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted) throw new wu(null, t); } function Wk(t) { return Wp(t), t.headers = tr.from(t.headers), t.data = Gp.call( t, t.transformRequest ), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), bb.getAdapter(t.adapter || ec.adapter)(t).then(function(i) { return Wp(t), i.data = Gp.call( t, t.transformResponse, i ), i.headers = tr.from(i.headers), i; }, function(i) { return yb(i) || (Wp(t), i && i.response && (i.response.data = Gp.call( t, t.transformResponse, i.response ), i.response.headers = tr.from(i.response.headers))), Promise.reject(i); }); } const Eb = "1.7.7", Tg = {}; ["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => { Tg[t] = function(i) { return typeof i === t || "a" + (e < 1 ? "n " : " ") + t; }; }); const Qk = {}; Tg.transitional = function(e, n, i) { function o(a, l) { return "[Axios v" + Eb + "] Transitional option '" + a + "'" + l + (i ? ". " + i : ""); } return (a, l, f) => { if (e === !1) throw new yt( o(l, " has been removed" + (n ? " in " + n : "")), yt.ERR_DEPRECATED ); return n && !Qk[l] && (Qk[l] = !0, console.warn( o( l, " has been deprecated since v" + n + " and will be removed in the near future" ) )), e ? e(a, l, f) : !0; }; }; function DO(t, e, n) { if (typeof t != "object") throw new yt("options must be an object", yt.ERR_BAD_OPTION_VALUE); const i = Object.keys(t); let o = i.length; for (; o-- > 0; ) { const a = i[o], l = e[a]; if (l) { const f = t[a], p = f === void 0 || l(f, a, t); if (p !== !0) throw new yt("option " + a + " must be " + p, yt.ERR_BAD_OPTION_VALUE); continue; } if (n !== !0) throw new yt("Unknown option " + a, yt.ERR_BAD_OPTION); } } const Bm = { assertOptions: DO, validators: Tg }, qs = Bm.validators; let Xo = class { constructor(e) { this.defaults = e, this.interceptors = { request: new Uk(), response: new Uk() }; } /** * Dispatch a request * * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) * @param {?Object} config * * @returns {Promise} The Promise to be fulfilled */ async request(e, n) { try { return await this._request(e, n); } catch (i) { if (i instanceof Error) { let o; Error.captureStackTrace ? Error.captureStackTrace(o = {}) : o = new Error(); const a = o.stack ? o.stack.replace(/^.+\n/, "") : ""; try { i.stack ? a && !String(i.stack).endsWith(a.replace(/^.+\n.+\n/, "")) && (i.stack += ` ` + a) : i.stack = a; } catch { } } throw i; } } _request(e, n) { typeof e == "string" ? (n = n || {}, n.url = e) : n = e || {}, n = ea(this.defaults, n); const { transitional: i, paramsSerializer: o, headers: a } = n; i !== void 0 && Bm.assertOptions(i, { silentJSONParsing: qs.transitional(qs.boolean), forcedJSONParsing: qs.transitional(qs.boolean), clarifyTimeoutError: qs.transitional(qs.boolean) }, !1), o != null && (ce.isFunction(o) ? n.paramsSerializer = { serialize: o } : Bm.assertOptions(o, { encode: qs.function, serialize: qs.function }, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase(); let l = a && ce.merge( a.common, a[n.method] ); a && ce.forEach( ["delete", "get", "head", "post", "put", "patch", "common"], (O) => { delete a[O]; } ), n.headers = tr.concat(l, a); const f = []; let p = !0; this.interceptors.request.forEach(function(x) { typeof x.runWhen == "function" && x.runWhen(n) === !1 || (p = p && x.synchronous, f.unshift(x.fulfilled, x.rejected)); }); const v = []; this.interceptors.response.forEach(function(x) { v.push(x.fulfilled, x.rejected); }); let k, b = 0, w; if (!p) { const O = [Wk.bind(this), void 0]; for (O.unshift.apply(O, f), O.push.apply(O, v), w = O.length, k = Promise.resolve(n); b < w; ) k = k.then(O[b++], O[b++]); return k; } w = f.length; let T = n; for (b = 0; b < w; ) { const O = f[b++], x = f[b++]; try { T = O(T); } catch (C) { x.call(this, C); break; } } try { k = Wk.call(this, T); } catch (O) { return Promise.reject(O); } for (b = 0, w = v.length; b < w; ) k = k.then(v[b++], v[b++]); return k; } getUri(e) { e = ea(this.defaults, e); const n = kb(e.baseURL, e.url); return pb(n, e.params, e.paramsSerializer); } }; ce.forEach(["delete", "get", "head", "options"], function(e) { Xo.prototype[e] = function(n, i) { return this.request(ea(i || {}, { method: e, url: n, data: (i || {}).data })); }; }); ce.forEach(["post", "put", "patch"], function(e) { function n(i) { return function(a, l, f) { return this.request(ea(f || {}, { method: e, headers: i ? { "Content-Type": "multipart/form-data" } : {}, url: a, data: l })); }; } Xo.prototype[e] = n(), Xo.prototype[e + "Form"] = n(!0); }); let FO = class Nb { constructor(e) { if (typeof e != "function") throw new TypeError("executor must be a function."); let n; this.promise = new Promise(function(a) { n = a; }); const i = this; this.promise.then((o) => { if (!i._listeners) return; let a = i._listeners.length; for (; a-- > 0; ) i._listeners[a](o); i._listeners = null; }), this.promise.then = (o) => { let a; const l = new Promise((f) => { i.subscribe(f), a = f; }).then(o); return l.cancel = function() { i.unsubscribe(a); }, l; }, e(function(a, l, f) { i.reason || (i.reason = new wu(a, l, f), n(i.reason)); }); } /** * Throws a `CanceledError` if cancellation has been requested. */ throwIfRequested() { if (this.reason) throw this.reason; } /** * Subscribe to the cancel signal */ subscribe(e) { if (this.reason) { e(this.reason); return; } this._listeners ? this._listeners.push(e) : this._listeners = [e]; } /** * Unsubscribe from the cancel signal */ unsubscribe(e) { if (!this._listeners) return; const n = this._listeners.indexOf(e); n !== -1 && this._listeners.splice(n, 1); } toAbortSignal() { const e = new AbortController(), n = (i) => { e.abort(i); }; return this.subscribe(n), e.signal.unsubscribe = () => this.unsubscribe(n), e.signal; } /** * Returns an object that contains a new `CancelToken` and a function that, when called, * cancels the `CancelToken`. */ static source() { let e; return { token: new Nb(function(o) { e = o; }), cancel: e }; } }; function MO(t) { return function(n) { return t.apply(null, n); }; } function $O(t) { return ce.isObject(t) && t.isAxiosError === !0; } const Vm = { Continue: 100, SwitchingProtocols: 101, Processing: 102, EarlyHints: 103, Ok: 200, Created: 201, Accepted: 202, NonAuthoritativeInformation: 203, NoContent: 204, ResetContent: 205, PartialContent: 206, MultiStatus: 207, AlreadyReported: 208, ImUsed: 226, MultipleChoices: 300, MovedPermanently: 301, Found: 302, SeeOther: 303, NotModified: 304, UseProxy: 305, Unused: 306, TemporaryRedirect: 307, PermanentRedirect: 308, BadRequest: 400, Unauthorized: 401, PaymentRequired: 402, Forbidden: 403, NotFound: 404, MethodNotAllowed: 405, NotAcceptable: 406, ProxyAuthenticationRequired: 407, RequestTimeout: 408, Conflict: 409, Gone: 410, LengthRequired: 411, PreconditionFailed: 412, PayloadTooLarge: 413, UriTooLong: 414, UnsupportedMediaType: 415, RangeNotSatisfiable: 416, ExpectationFailed: 417, ImATeapot: 418, MisdirectedRequest: 421, UnprocessableEntity: 422, Locked: 423, FailedDependency: 424, TooEarly: 425, UpgradeRequired: 426, PreconditionRequired: 428, TooManyRequests: 429, RequestHeaderFieldsTooLarge: 431, UnavailableForLegalReasons: 451, InternalServerError: 500, NotImplemented: 501, BadGateway: 502, ServiceUnavailable: 503, GatewayTimeout: 504, HttpVersionNotSupported: 505, VariantAlsoNegotiates: 506, InsufficientStorage: 507, LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511 }; Object.entries(Vm).forEach(([t, e]) => { Vm[e] = t; }); function Ab(t) { const e = new Xo(t), n = nb(Xo.prototype.request, e); return ce.extend(n, Xo.prototype, e, { allOwnKeys: !0 }), ce.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(o) { return Ab(ea(t, o)); }, n; } const Qt = Ab(ec); Qt.Axios = Xo; Qt.CanceledError = wu; Qt.CancelToken = FO; Qt.isCancel = yb; Qt.VERSION = Eb; Qt.toFormData = Df; Qt.AxiosError = yt; Qt.Cancel = Qt.CanceledError; Qt.all = function(e) { return Promise.all(e); }; Qt.spread = MO; Qt.isAxiosError = $O; Qt.mergeConfig = ea; Qt.AxiosHeaders = tr; Qt.formToJSON = (t) => gb(ce.isHTMLForm(t) ? new FormData(t) : t); Qt.getAdapter = bb.getAdapter; Qt.HttpStatusCode = Vm; Qt.default = Qt; const { Axios: hD, AxiosError: pD, CanceledError: mD, isCancel: gD, CancelToken: yD, VERSION: vD, all: kD, Cancel: _D, isAxiosError: wD, spread: SD, toFormData: bD, AxiosHeaders: ED, HttpStatusCode: ND, formToJSON: AD, getAdapter: xD, mergeConfig: CD } = Qt, jO = { type: "logger", log(t) { this.output("log", t); }, warn(t) { this.output("warn", t); }, error(t) { this.output("error", t); }, output(t, e) { console && console[t] && console[t].apply(console, e); } }; class tf { constructor(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; this.init(e, n); } init(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; this.prefix = n.prefix || "i18next:", this.logger = e || jO, this.options = n, this.debug = n.debug; } log() { for (var e = arguments.length, n = new Array(e), i = 0; i < e; i++) n[i] = arguments[i]; return this.forward(n, "log", "", !0); } warn() { for (var e = arguments.length, n = new Array(e), i = 0; i < e; i++) n[i] = arguments[i]; return this.forward(n, "warn", "", !0); } error() { for (var e = arguments.length, n = new Array(e), i = 0; i < e; i++) n[i] = arguments[i]; return this.forward(n, "error", ""); } deprecate() { for (var e = arguments.length, n = new Array(e), i = 0; i < e; i++) n[i] = arguments[i]; return this.forward(n, "warn", "WARNING DEPRECATED: ", !0); } forward(e, n, i, o) { return o && !this.debug ? null : (typeof e[0] == "string" && (e[0] = `${i}${this.prefix} ${e[0]}`), this.logger[n](e)); } create(e) { return new tf(this.logger, { prefix: `${this.prefix}:${e}:`, ...this.options }); } clone(e) { return e = e || this.options, e.prefix = e.prefix || this.prefix, new tf(this.logger, e); } } var bi = new tf(); class Mf { constructor() { this.observers = {}; } on(e, n) { return e.split(" ").forEach((i) => { this.observers[i] || (this.observers[i] = /* @__PURE__ */ new Map()); const o = this.observers[i].get(n) || 0; this.observers[i].set(n, o + 1); }), this; } off(e, n) { if (this.observers[e]) { if (!n) { delete this.observers[e]; return; } this.observers[e].delete(n); } } emit(e) { for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++) i[o - 1] = arguments[o]; this.observers[e] && Array.from(this.observers[e].entries()).forEach((l) => { let [f, p] = l; for (let v = 0; v < p; v++) f(...i); }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((l) => { let [f, p] = l; for (let v = 0; v < p; v++) f.apply(f, [e, ...i]); }); } } const yl = () => { let t, e; const n = new Promise((i, o) => { t = i, e = o; }); return n.resolve = t, n.reject = e, n; }, Yk = (t) => t == null ? "" : "" + t, UO = (t, e, n) => { t.forEach((i) => { e[i] && (n[i] = e[i]); }); }, BO = /###/g, Xk = (t) => t && t.indexOf("###") > -1 ? t.replace(BO, ".") : t, Jk = (t) => !t || typeof t == "string", Cl = (t, e, n) => { const i = typeof e != "string" ? e : e.split("."); let o = 0; for (; o < i.length - 1; ) { if (Jk(t)) return {}; const a = Xk(i[o]); !t[a] && n && (t[a] = new n()), Object.prototype.hasOwnProperty.call(t, a) ? t = t[a] : t = {}, ++o; } return Jk(t) ? {} : { obj: t, k: Xk(i[o]) }; }, Zk = (t, e, n) => { const { obj: i, k: o } = Cl(t, e, Object); if (i !== void 0 || e.length === 1) { i[o] = n; return; } let a = e[e.length - 1], l = e.slice(0, e.length - 1), f = Cl(t, l, Object); for (; f.obj === void 0 && l.length; ) a = `${l[l.length - 1]}.${a}`, l = l.slice(0, l.length - 1), f = Cl(t, l, Object), f && f.obj && typeof f.obj[`${f.k}.${a}`] < "u" && (f.obj = void 0); f.obj[`${f.k}.${a}`] = n; }, VO = (t, e, n, i) => { const { obj: o, k: a } = Cl(t, e, Object); o[a] = o[a] || [], o[a].push(n); }, nf = (t, e) => { const { obj: n, k: i } = Cl(t, e); if (n) return n[i]; }, zO = (t, e, n) => { const i = nf(t, n); return i !== void 0 ? i : nf(e, n); }, xb = (t, e, n) => { for (const i in e) i !== "__proto__" && i !== "constructor" && (i in t ? typeof t[i] == "string" || t[i] instanceof String || typeof e[i] == "string" || e[i] instanceof String ? n && (t[i] = e[i]) : xb(t[i], e[i], n) : t[i] = e[i]); return t; }, Ga = (t) => t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); var HO = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/" }; const qO = (t) => typeof t == "string" ? t.replace(/[&<>"'\/]/g, (e) => HO[e]) : t; class KO { constructor(e) { this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = []; } getRegExp(e) { const n = this.regExpMap.get(e); if (n !== void 0) return n; const i = new RegExp(e); return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, i), this.regExpQueue.push(e), i; } } const GO = [" ", ",", "?", "!", ";"], WO = new KO(20), QO = (t, e, n) => { e = e || "", n = n || ""; const i = GO.filter((l) => e.indexOf(l) < 0 && n.indexOf(l) < 0); if (i.length === 0) return !0; const o = WO.getRegExp(`(${i.map((l) => l === "?" ? "\\?" : l).join("|")})`); let a = !o.test(t); if (!a) { const l = t.indexOf(n); l > 0 && !o.test(t.substring(0, l)) && (a = !0); } return a; }, zm = function(t, e) { let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "."; if (!t) return; if (t[e]) return t[e]; const i = e.split(n); let o = t; for (let a = 0; a < i.length; ) { if (!o || typeof o != "object") return; let l, f = ""; for (let p = a; p < i.length; ++p) if (p !== a && (f += n), f += i[p], l = o[f], l !== void 0) { if (["string", "number", "boolean"].indexOf(typeof l) > -1 && p < i.length - 1) continue; a += p - a + 1; break; } o = l; } return o; }, rf = (t) => t && t.indexOf("_") > 0 ? t.replace("_", "-") : t; class e_ extends Mf { constructor(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { ns: ["translation"], defaultNS: "translation" }; super(), this.data = e || {}, this.options = n, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0); } addNamespaces(e) { this.options.ns.indexOf(e) < 0 && this.options.ns.push(e); } removeNamespaces(e) { const n = this.options.ns.indexOf(e); n > -1 && this.options.ns.splice(n, 1); } getResource(e, n, i) { let o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; const a = o.keySeparator !== void 0 ? o.keySeparator : this.options.keySeparator, l = o.ignoreJSONStructure !== void 0 ? o.ignoreJSONStructure : this.options.ignoreJSONStructure; let f; e.indexOf(".") > -1 ? f = e.split(".") : (f = [e, n], i && (Array.isArray(i) ? f.push(...i) : typeof i == "string" && a ? f.push(...i.split(a)) : f.push(i))); const p = nf(this.data, f); return !p && !n && !i && e.indexOf(".") > -1 && (e = f[0], n = f[1], i = f.slice(2).join(".")), p || !l || typeof i != "string" ? p : zm(this.data && this.data[e] && this.data[e][n], i, a); } addResource(e, n, i, o) { let a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : { silent: !1 }; const l = a.keySeparator !== void 0 ? a.keySeparator : this.options.keySeparator; let f = [e, n]; i && (f = f.concat(l ? i.split(l) : i)), e.indexOf(".") > -1 && (f = e.split("."), o = n, n = f[1]), this.addNamespaces(n), Zk(this.data, f, o), a.silent || this.emit("added", e, n, i, o); } addResources(e, n, i) { let o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : { silent: !1 }; for (const a in i) (typeof i[a] == "string" || Array.isArray(i[a])) && this.addResource(e, n, a, i[a], { silent: !0 }); o.silent || this.emit("added", e, n, i); } addResourceBundle(e, n, i, o, a) { let l = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : { silent: !1, skipCopy: !1 }, f = [e, n]; e.indexOf(".") > -1 && (f = e.split("."), o = i, i = n, n = f[1]), this.addNamespaces(n); let p = nf(this.data, f) || {}; l.skipCopy || (i = JSON.parse(JSON.stringify(i))), o ? xb(p, i, a) : p = { ...p, ...i }, Zk(this.data, f, p), l.silent || this.emit("added", e, n, i); } removeResourceBundle(e, n) { this.hasResourceBundle(e, n) && delete this.data[e][n], this.removeNamespaces(n), this.emit("removed", e, n); } hasResourceBundle(e, n) { return this.getResource(e, n) !== void 0; } getResourceBundle(e, n) { return n || (n = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? { ...this.getResource(e, n) } : this.getResource(e, n); } getDataByLanguage(e) { return this.data[e]; } hasLanguageSomeTranslations(e) { const n = this.getDataByLanguage(e); return !!(n && Object.keys(n) || []).find((o) => n[o] && Object.keys(n[o]).length > 0); } toJSON() { return this.data; } } var Cb = { processors: {}, addPostProcessor(t) { this.processors[t.name] = t; }, handle(t, e, n, i, o) { return t.forEach((a) => { this.processors[a] && (e = this.processors[a].process(e, n, i, o)); }), e; } }; const t_ = {}; class sf extends Mf { constructor(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; super(), UO(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = n, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = bi.create("translator"); } changeLanguage(e) { e && (this.language = e); } exists(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { interpolation: {} }; if (e == null) return !1; const i = this.resolve(e, n); return i && i.res !== void 0; } extractFromKey(e, n) { let i = n.nsSeparator !== void 0 ? n.nsSeparator : this.options.nsSeparator; i === void 0 && (i = ":"); const o = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator; let a = n.ns || this.options.defaultNS || []; const l = i && e.indexOf(i) > -1, f = !this.options.userDefinedKeySeparator && !n.keySeparator && !this.options.userDefinedNsSeparator && !n.nsSeparator && !QO(e, i, o); if (l && !f) { const p = e.match(this.interpolator.nestingRegexp); if (p && p.length > 0) return { key: e, namespaces: a }; const v = e.split(i); (i !== o || i === o && this.options.ns.indexOf(v[0]) > -1) && (a = v.shift()), e = v.join(o); } return typeof a == "string" && (a = [a]), { key: e, namespaces: a }; } translate(e, n, i) { if (typeof n != "object" && this.options.overloadTranslationOptionHandler && (n = this.options.overloadTranslationOptionHandler(arguments)), typeof n == "object" && (n = { ...n }), n || (n = {}), e == null) return ""; Array.isArray(e) || (e = [String(e)]); const o = n.returnDetails !== void 0 ? n.returnDetails : this.options.returnDetails, a = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, { key: l, namespaces: f } = this.extractFromKey(e[e.length - 1], n), p = f[f.length - 1], v = n.lng || this.language, k = n.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; if (v && v.toLowerCase() === "cimode") { if (k) { const ne = n.nsSeparator || this.options.nsSeparator; return o ? { res: `${p}${ne}${l}`, usedKey: l, exactUsedKey: l, usedLng: v, usedNS: p, usedParams: this.getUsedParamsDetails(n) } : `${p}${ne}${l}`; } return o ? { res: l, usedKey: l, exactUsedKey: l, usedLng: v, usedNS: p, usedParams: this.getUsedParamsDetails(n) } : l; } const b = this.resolve(e, n); let w = b && b.res; const T = b && b.usedKey || l, O = b && b.exactUsedKey || l, x = Object.prototype.toString.apply(w), C = ["[object Number]", "[object Function]", "[object RegExp]"], $ = n.joinArrays !== void 0 ? n.joinArrays : this.options.joinArrays, J = !this.i18nFormat || this.i18nFormat.handleAsObject; if (J && w && (typeof w != "string" && typeof w != "boolean" && typeof w != "number") && C.indexOf(x) < 0 && !(typeof $ == "string" && Array.isArray(w))) { if (!n.returnObjects && !this.options.returnObjects) { this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!"); const ne = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(T, w, { ...n, ns: f }) : `key '${l} (${this.language})' returned an object instead of string.`; return o ? (b.res = ne, b.usedParams = this.getUsedParamsDetails(n), b) : ne; } if (a) { const ne = Array.isArray(w), he = ne ? [] : {}, ye = ne ? O : T; for (const me in w) if (Object.prototype.hasOwnProperty.call(w, me)) { const Fe = `${ye}${a}${me}`; he[me] = this.translate(Fe, { ...n, joinArrays: !1, ns: f }), he[me] === Fe && (he[me] = w[me]); } w = he; } } else if (J && typeof $ == "string" && Array.isArray(w)) w = w.join($), w && (w = this.extendTranslation(w, e, n, i)); else { let ne = !1, he = !1; const ye = n.count !== void 0 && typeof n.count != "string", me = sf.hasDefaultValue(n), Fe = ye ? this.pluralResolver.getSuffix(v, n.count, n) : "", Re = n.ordinal && ye ? this.pluralResolver.getSuffix(v, n.count, { ordinal: !1 }) : "", ut = ye && !n.ordinal && n.count === 0 && this.pluralResolver.shouldUseIntlApi(), He = ut && n[`defaultValue${this.options.pluralSeparator}zero`] || n[`defaultValue${Fe}`] || n[`defaultValue${Re}`] || n.defaultValue; !this.isValidLookup(w) && me && (ne = !0, w = He), this.isValidLookup(w) || (he = !0, w = l); const ot = (n.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && he ? void 0 : w, W = me && He !== w && this.options.updateMissing; if (he || ne || W) { if (this.logger.log(W ? "updateKey" : "missingKey", v, p, l, W ? He : w), a) { const te = this.resolve(l, { ...n, keySeparator: !1 }); te && te.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format."); } let L = []; const oe = this.languageUtils.getFallbackCodes(this.options.fallbackLng, n.lng || this.language); if (this.options.saveMissingTo === "fallback" && oe && oe[0]) for (let te = 0; te < oe.length; te++) L.push(oe[te]); else this.options.saveMissingTo === "all" ? L = this.languageUtils.toResolveHierarchy(n.lng || this.language) : L.push(n.lng || this.language); const ge = (te, ue, M) => { const D = me && M !== w ? M : ot; this.options.missingKeyHandler ? this.options.missingKeyHandler(te, p, ue, D, W, n) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(te, p, ue, D, W, n), this.emit("missingKey", te, p, ue, w); }; this.options.saveMissing && (this.options.saveMissingPlurals && ye ? L.forEach((te) => { const ue = this.pluralResolver.getSuffixes(te, n); ut && n[`defaultValue${this.options.pluralSeparator}zero`] && ue.indexOf(`${this.options.pluralSeparator}zero`) < 0 && ue.push(`${this.options.pluralSeparator}zero`), ue.forEach((M) => { ge([te], l + M, n[`defaultValue${M}`] || He); }); }) : ge(L, l, He)); } w = this.extendTranslation(w, e, n, b, i), he && w === l && this.options.appendNamespaceToMissingKey && (w = `${p}:${l}`), (he || ne) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? w = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${p}:${l}` : l, ne ? w : void 0) : w = this.options.parseMissingKeyHandler(w)); } return o ? (b.res = w, b.usedParams = this.getUsedParamsDetails(n), b) : w; } extendTranslation(e, n, i, o, a) { var l = this; if (this.i18nFormat && this.i18nFormat.parse) e = this.i18nFormat.parse(e, { ...this.options.interpolation.defaultVariables, ...i }, i.lng || this.language || o.usedLng, o.usedNS, o.usedKey, { resolved: o }); else if (!i.skipInterpolation) { i.interpolation && this.interpolator.init({ ...i, interpolation: { ...this.options.interpolation, ...i.interpolation } }); const v = typeof e == "string" && (i && i.interpolation && i.interpolation.skipOnVariables !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables); let k; if (v) { const w = e.match(this.interpolator.nestingRegexp); k = w && w.length; } let b = i.replace && typeof i.replace != "string" ? i.replace : i; if (this.options.interpolation.defaultVariables && (b = { ...this.options.interpolation.defaultVariables, ...b }), e = this.interpolator.interpolate(e, b, i.lng || this.language || o.usedLng, i), v) { const w = e.match(this.interpolator.nestingRegexp), T = w && w.length; k < T && (i.nest = !1); } !i.lng && this.options.compatibilityAPI !== "v1" && o && o.res && (i.lng = this.language || o.usedLng), i.nest !== !1 && (e = this.interpolator.nest(e, function() { for (var w = arguments.length, T = new Array(w), O = 0; O < w; O++) T[O] = arguments[O]; return a && a[0] === T[0] && !i.context ? (l.logger.warn(`It seems you are nesting recursively key: ${T[0]} in key: ${n[0]}`), null) : l.translate(...T, n); }, i)), i.interpolation && this.interpolator.reset(); } const f = i.postProcess || this.options.postProcess, p = typeof f == "string" ? [f] : f; return e != null && p && p.length && i.applyPostProcessor !== !1 && (e = Cb.handle(p, e, n, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...o, usedParams: this.getUsedParamsDetails(i) }, ...i } : i, this)), e; } resolve(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i, o, a, l, f; return typeof e == "string" && (e = [e]), e.forEach((p) => { if (this.isValidLookup(i)) return; const v = this.extractFromKey(p, n), k = v.key; o = k; let b = v.namespaces; this.options.fallbackNS && (b = b.concat(this.options.fallbackNS)); const w = n.count !== void 0 && typeof n.count != "string", T = w && !n.ordinal && n.count === 0 && this.pluralResolver.shouldUseIntlApi(), O = n.context !== void 0 && (typeof n.context == "string" || typeof n.context == "number") && n.context !== "", x = n.lngs ? n.lngs : this.languageUtils.toResolveHierarchy(n.lng || this.language, n.fallbackLng); b.forEach((C) => { this.isValidLookup(i) || (f = C, !t_[`${x[0]}-${C}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(f) && (t_[`${x[0]}-${C}`] = !0, this.logger.warn(`key "${o}" for languages "${x.join(", ")}" won't get resolved as namespace "${f}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), x.forEach(($) => { if (this.isValidLookup(i)) return; l = $; const J = [k]; if (this.i18nFormat && this.i18nFormat.addLookupKeys) this.i18nFormat.addLookupKeys(J, k, $, C, n); else { let ne; w && (ne = this.pluralResolver.getSuffix($, n.count, n)); const he = `${this.options.pluralSeparator}zero`, ye = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`; if (w && (J.push(k + ne), n.ordinal && ne.indexOf(ye) === 0 && J.push(k + ne.replace(ye, this.options.pluralSeparator)), T && J.push(k + he)), O) { const me = `${k}${this.options.contextSeparator}${n.context}`; J.push(me), w && (J.push(me + ne), n.ordinal && ne.indexOf(ye) === 0 && J.push(me + ne.replace(ye, this.options.pluralSeparator)), T && J.push(me + he)); } } let le; for (; le = J.pop(); ) this.isValidLookup(i) || (a = le, i = this.getResource($, C, le, n)); })); }); }), { res: i, usedKey: o, exactUsedKey: a, usedLng: l, usedNS: f }; } isValidLookup(e) { return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === ""); } getResource(e, n, i) { let o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e, n, i, o) : this.resourceStore.getResource(e, n, i, o); } getUsedParamsDetails() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const n = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], i = e.replace && typeof e.replace != "string"; let o = i ? e.replace : e; if (i && typeof e.count < "u" && (o.count = e.count), this.options.interpolation.defaultVariables && (o = { ...this.options.interpolation.defaultVariables, ...o }), !i) { o = { ...o }; for (const a of n) delete o[a]; } return o; } static hasDefaultValue(e) { const n = "defaultValue"; for (const i in e) if (Object.prototype.hasOwnProperty.call(e, i) && n === i.substring(0, n.length) && e[i] !== void 0) return !0; return !1; } } const Qp = (t) => t.charAt(0).toUpperCase() + t.slice(1); class n_ { constructor(e) { this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = bi.create("languageUtils"); } getScriptPartFromCode(e) { if (e = rf(e), !e || e.indexOf("-") < 0) return null; const n = e.split("-"); return n.length === 2 || (n.pop(), n[n.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(n.join("-")); } getLanguagePartFromCode(e) { if (e = rf(e), !e || e.indexOf("-") < 0) return e; const n = e.split("-"); return this.formatLanguageCode(n[0]); } formatLanguageCode(e) { if (typeof e == "string" && e.indexOf("-") > -1) { const n = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"]; let i = e.split("-"); return this.options.lowerCaseLng ? i = i.map((o) => o.toLowerCase()) : i.length === 2 ? (i[0] = i[0].toLowerCase(), i[1] = i[1].toUpperCase(), n.indexOf(i[1].toLowerCase()) > -1 && (i[1] = Qp(i[1].toLowerCase()))) : i.length === 3 && (i[0] = i[0].toLowerCase(), i[1].length === 2 && (i[1] = i[1].toUpperCase()), i[0] !== "sgn" && i[2].length === 2 && (i[2] = i[2].toUpperCase()), n.indexOf(i[1].toLowerCase()) > -1 && (i[1] = Qp(i[1].toLowerCase())), n.indexOf(i[2].toLowerCase()) > -1 && (i[2] = Qp(i[2].toLowerCase()))), i.join("-"); } return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e; } isSupportedCode(e) { return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1; } getBestMatchFromCodes(e) { if (!e) return null; let n; return e.forEach((i) => { if (n) return; const o = this.formatLanguageCode(i); (!this.options.supportedLngs || this.isSupportedCode(o)) && (n = o); }), !n && this.options.supportedLngs && e.forEach((i) => { if (n) return; const o = this.getLanguagePartFromCode(i); if (this.isSupportedCode(o)) return n = o; n = this.options.supportedLngs.find((a) => { if (a === o) return a; if (!(a.indexOf("-") < 0 && o.indexOf("-") < 0) && (a.indexOf("-") > 0 && o.indexOf("-") < 0 && a.substring(0, a.indexOf("-")) === o || a.indexOf(o) === 0 && o.length > 1)) return a; }); }), n || (n = this.getFallbackCodes(this.options.fallbackLng)[0]), n; } getFallbackCodes(e, n) { if (!e) return []; if (typeof e == "function" && (e = e(n)), typeof e == "string" && (e = [e]), Array.isArray(e)) return e; if (!n) return e.default || []; let i = e[n]; return i || (i = e[this.getScriptPartFromCode(n)]), i || (i = e[this.formatLanguageCode(n)]), i || (i = e[this.getLanguagePartFromCode(n)]), i || (i = e.default), i || []; } toResolveHierarchy(e, n) { const i = this.getFallbackCodes(n || this.options.fallbackLng || [], e), o = [], a = (l) => { l && (this.isSupportedCode(l) ? o.push(l) : this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`)); }; return typeof e == "string" && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && a(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && a(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && a(this.getLanguagePartFromCode(e))) : typeof e == "string" && a(this.formatLanguageCode(e)), i.forEach((l) => { o.indexOf(l) < 0 && a(this.formatLanguageCode(l)); }), o; } } let YO = [{ lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"], nr: [1, 2], fc: 1 }, { lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"], nr: [1, 2], fc: 2 }, { lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"], nr: [1], fc: 3 }, { lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"], nr: [1, 2, 5], fc: 4 }, { lngs: ["ar"], nr: [0, 1, 2, 3, 11, 100], fc: 5 }, { lngs: ["cs", "sk"], nr: [1, 2, 5], fc: 6 }, { lngs: ["csb", "pl"], nr: [1, 2, 5], fc: 7 }, { lngs: ["cy"], nr: [1, 2, 3, 8], fc: 8 }, { lngs: ["fr"], nr: [1, 2], fc: 9 }, { lngs: ["ga"], nr: [1, 2, 3, 7, 11], fc: 10 }, { lngs: ["gd"], nr: [1, 2, 3, 20], fc: 11 }, { lngs: ["is"], nr: [1, 2], fc: 12 }, { lngs: ["jv"], nr: [0, 1], fc: 13 }, { lngs: ["kw"], nr: [1, 2, 3, 4], fc: 14 }, { lngs: ["lt"], nr: [1, 2, 10], fc: 15 }, { lngs: ["lv"], nr: [1, 2, 0], fc: 16 }, { lngs: ["mk"], nr: [1, 2], fc: 17 }, { lngs: ["mnk"], nr: [0, 1, 2], fc: 18 }, { lngs: ["mt"], nr: [1, 2, 11, 20], fc: 19 }, { lngs: ["or"], nr: [2, 1], fc: 2 }, { lngs: ["ro"], nr: [1, 2, 20], fc: 20 }, { lngs: ["sl"], nr: [5, 1, 2, 3], fc: 21 }, { lngs: ["he", "iw"], nr: [1, 2, 20, 21], fc: 22 }], XO = { 1: (t) => +(t > 1), 2: (t) => +(t != 1), 3: (t) => 0, 4: (t) => t % 10 == 1 && t % 100 != 11 ? 0 : t % 10 >= 2 && t % 10 <= 4 && (t % 100 < 10 || t % 100 >= 20) ? 1 : 2, 5: (t) => t == 0 ? 0 : t == 1 ? 1 : t == 2 ? 2 : t % 100 >= 3 && t % 100 <= 10 ? 3 : t % 100 >= 11 ? 4 : 5, 6: (t) => t == 1 ? 0 : t >= 2 && t <= 4 ? 1 : 2, 7: (t) => t == 1 ? 0 : t % 10 >= 2 && t % 10 <= 4 && (t % 100 < 10 || t % 100 >= 20) ? 1 : 2, 8: (t) => t == 1 ? 0 : t == 2 ? 1 : t != 8 && t != 11 ? 2 : 3, 9: (t) => +(t >= 2), 10: (t) => t == 1 ? 0 : t == 2 ? 1 : t < 7 ? 2 : t < 11 ? 3 : 4, 11: (t) => t == 1 || t == 11 ? 0 : t == 2 || t == 12 ? 1 : t > 2 && t < 20 ? 2 : 3, 12: (t) => +(t % 10 != 1 || t % 100 == 11), 13: (t) => +(t !== 0), 14: (t) => t == 1 ? 0 : t == 2 ? 1 : t == 3 ? 2 : 3, 15: (t) => t % 10 == 1 && t % 100 != 11 ? 0 : t % 10 >= 2 && (t % 100 < 10 || t % 100 >= 20) ? 1 : 2, 16: (t) => t % 10 == 1 && t % 100 != 11 ? 0 : t !== 0 ? 1 : 2, 17: (t) => t == 1 || t % 10 == 1 && t % 100 != 11 ? 0 : 1, 18: (t) => t == 0 ? 0 : t == 1 ? 1 : 2, 19: (t) => t == 1 ? 0 : t == 0 || t % 100 > 1 && t % 100 < 11 ? 1 : t % 100 > 10 && t % 100 < 20 ? 2 : 3, 20: (t) => t == 1 ? 0 : t == 0 || t % 100 > 0 && t % 100 < 20 ? 1 : 2, 21: (t) => t % 100 == 1 ? 1 : t % 100 == 2 ? 2 : t % 100 == 3 || t % 100 == 4 ? 3 : 0, 22: (t) => t == 1 ? 0 : t == 2 ? 1 : (t < 0 || t > 10) && t % 10 == 0 ? 2 : 3 }; const JO = ["v1", "v2", "v3"], ZO = ["v4"], r_ = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }, eT = () => { const t = {}; return YO.forEach((e) => { e.lngs.forEach((n) => { t[n] = { numbers: e.nr, plurals: XO[e.fc] }; }); }), t; }; class tT { constructor(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; this.languageUtils = e, this.options = n, this.logger = bi.create("pluralResolver"), (!this.options.compatibilityJSON || ZO.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = eT(), this.pluralRulesCache = {}; } addRule(e, n) { this.rules[e] = n; } clearCache() { this.pluralRulesCache = {}; } getRule(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (this.shouldUseIntlApi()) try { const i = rf(e === "dev" ? "en" : e), o = n.ordinal ? "ordinal" : "cardinal", a = JSON.stringify({ cleanedCode: i, type: o }); if (a in this.pluralRulesCache) return this.pluralRulesCache[a]; const l = new Intl.PluralRules(i, { type: o }); return this.pluralRulesCache[a] = l, l; } catch { return; } return this.rules[e] || this.rules[this.languageUtils.getLanguagePartFromCode(e)]; } needsPlural(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const i = this.getRule(e, n); return this.shouldUseIntlApi() ? i && i.resolvedOptions().pluralCategories.length > 1 : i && i.numbers.length > 1; } getPluralFormsOfKey(e, n) { let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; return this.getSuffixes(e, i).map((o) => `${n}${o}`); } getSuffixes(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const i = this.getRule(e, n); return i ? this.shouldUseIntlApi() ? i.resolvedOptions().pluralCategories.sort((o, a) => r_[o] - r_[a]).map((o) => `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${o}`) : i.numbers.map((o) => this.getSuffix(e, o, n)) : []; } getSuffix(e, n) { let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; const o = this.getRule(e, i); return o ? this.shouldUseIntlApi() ? `${this.options.prepend}${i.ordinal ? `ordinal${this.options.prepend}` : ""}${o.select(n)}` : this.getSuffixRetroCompatible(o, n) : (this.logger.warn(`no plural rule found for: ${e}`), ""); } getSuffixRetroCompatible(e, n) { const i = e.noAbs ? e.plurals(n) : e.plurals(Math.abs(n)); let o = e.numbers[i]; this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 && (o === 2 ? o = "plural" : o === 1 && (o = "")); const a = () => this.options.prepend && o.toString() ? this.options.prepend + o.toString() : o.toString(); return this.options.compatibilityJSON === "v1" ? o === 1 ? "" : typeof o == "number" ? `_plural_${o.toString()}` : a() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? a() : this.options.prepend && i.toString() ? this.options.prepend + i.toString() : i.toString(); } shouldUseIntlApi() { return !JO.includes(this.options.compatibilityJSON); } } const i_ = function(t, e, n) { let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = zO(t, e, n); return !a && o && typeof n == "string" && (a = zm(t, n, i), a === void 0 && (a = zm(e, n, i))), a; }, Yp = (t) => t.replace(/\$/g, "$$$$"); class nT { constructor() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; this.logger = bi.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((n) => n), this.init(e); } init() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; e.interpolation || (e.interpolation = { escapeValue: !0 }); const { escape: n, escapeValue: i, useRawValueToEscape: o, prefix: a, prefixEscaped: l, suffix: f, suffixEscaped: p, formatSeparator: v, unescapeSuffix: k, unescapePrefix: b, nestingPrefix: w, nestingPrefixEscaped: T, nestingSuffix: O, nestingSuffixEscaped: x, nestingOptionsSeparator: C, maxReplaces: $, alwaysFormat: J } = e.interpolation; this.escape = n !== void 0 ? n : qO, this.escapeValue = i !== void 0 ? i : !0, this.useRawValueToEscape = o !== void 0 ? o : !1, this.prefix = a ? Ga(a) : l || "{{", this.suffix = f ? Ga(f) : p || "}}", this.formatSeparator = v || ",", this.unescapePrefix = k ? "" : b || "-", this.unescapeSuffix = this.unescapePrefix ? "" : k || "", this.nestingPrefix = w ? Ga(w) : T || Ga("$t("), this.nestingSuffix = O ? Ga(O) : x || Ga(")"), this.nestingOptionsSeparator = C || ",", this.maxReplaces = $ || 1e3, this.alwaysFormat = J !== void 0 ? J : !1, this.resetRegExp(); } reset() { this.options && this.init(this.options); } resetRegExp() { const e = (n, i) => n && n.source === i ? (n.lastIndex = 0, n) : new RegExp(i, "g"); this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`); } interpolate(e, n, i, o) { let a, l, f; const p = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, v = (T) => { if (T.indexOf(this.formatSeparator) < 0) { const $ = i_(n, p, T, this.options.keySeparator, this.options.ignoreJSONStructure); return this.alwaysFormat ? this.format($, void 0, i, { ...o, ...n, interpolationkey: T }) : $; } const O = T.split(this.formatSeparator), x = O.shift().trim(), C = O.join(this.formatSeparator).trim(); return this.format(i_(n, p, x, this.options.keySeparator, this.options.ignoreJSONStructure), C, i, { ...o, ...n, interpolationkey: x }); }; this.resetRegExp(); const k = o && o.missingInterpolationHandler || this.options.missingInterpolationHandler, b = o && o.interpolation && o.interpolation.skipOnVariables !== void 0 ? o.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables; return [{ regex: this.regexpUnescape, safeValue: (T) => Yp(T) }, { regex: this.regexp, safeValue: (T) => this.escapeValue ? Yp(this.escape(T)) : Yp(T) }].forEach((T) => { for (f = 0; a = T.regex.exec(e); ) { const O = a[1].trim(); if (l = v(O), l === void 0) if (typeof k == "function") { const C = k(e, a, o); l = typeof C == "string" ? C : ""; } else if (o && Object.prototype.hasOwnProperty.call(o, O)) l = ""; else if (b) { l = a[0]; continue; } else this.logger.warn(`missed to pass in variable ${O} for interpolating ${e}`), l = ""; else typeof l != "string" && !this.useRawValueToEscape && (l = Yk(l)); const x = T.safeValue(l); if (e = e.replace(a[0], x), b ? (T.regex.lastIndex += l.length, T.regex.lastIndex -= a[0].length) : T.regex.lastIndex = 0, f++, f >= this.maxReplaces) break; } }), e; } nest(e, n) { let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o, a, l; const f = (p, v) => { const k = this.nestingOptionsSeparator; if (p.indexOf(k) < 0) return p; const b = p.split(new RegExp(`${k}[ ]*{`)); let w = `{${b[1]}`; p = b[0], w = this.interpolate(w, l); const T = w.match(/'/g), O = w.match(/"/g); (T && T.length % 2 === 0 && !O || O.length % 2 !== 0) && (w = w.replace(/'/g, '"')); try { l = JSON.parse(w), v && (l = { ...v, ...l }); } catch (x) { return this.logger.warn(`failed parsing options string in nesting for key ${p}`, x), `${p}${k}${w}`; } return l.defaultValue && l.defaultValue.indexOf(this.prefix) > -1 && delete l.defaultValue, p; }; for (; o = this.nestingRegexp.exec(e); ) { let p = []; l = { ...i }, l = l.replace && typeof l.replace != "string" ? l.replace : l, l.applyPostProcessor = !1, delete l.defaultValue; let v = !1; if (o[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(o[1])) { const k = o[1].split(this.formatSeparator).map((b) => b.trim()); o[1] = k.shift(), p = k, v = !0; } if (a = n(f.call(this, o[1].trim(), l), l), a && o[0] === e && typeof a != "string") return a; typeof a != "string" && (a = Yk(a)), a || (this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`), a = ""), v && (a = p.reduce((k, b) => this.format(k, b, i.lng, { ...i, interpolationkey: o[1].trim() }), a.trim())), e = e.replace(o[0], a), this.regexp.lastIndex = 0; } return e; } } const rT = (t) => { let e = t.toLowerCase().trim(); const n = {}; if (t.indexOf("(") > -1) { const i = t.split("("); e = i[0].toLowerCase().trim(); const o = i[1].substring(0, i[1].length - 1); e === "currency" && o.indexOf(":") < 0 ? n.currency || (n.currency = o.trim()) : e === "relativetime" && o.indexOf(":") < 0 ? n.range || (n.range = o.trim()) : o.split(";").forEach((l) => { if (l) { const [f, ...p] = l.split(":"), v = p.join(":").trim().replace(/^'+|'+$/g, ""), k = f.trim(); n[k] || (n[k] = v), v === "false" && (n[k] = !1), v === "true" && (n[k] = !0), isNaN(v) || (n[k] = parseInt(v, 10)); } }); } return { formatName: e, formatOptions: n }; }, Wa = (t) => { const e = {}; return (n, i, o) => { let a = o; o && o.interpolationkey && o.formatParams && o.formatParams[o.interpolationkey] && o[o.interpolationkey] && (a = { ...a, [o.interpolationkey]: void 0 }); const l = i + JSON.stringify(a); let f = e[l]; return f || (f = t(rf(i), o), e[l] = f), f(n); }; }; class iT { constructor() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; this.logger = bi.create("formatter"), this.options = e, this.formats = { number: Wa((n, i) => { const o = new Intl.NumberFormat(n, { ...i }); return (a) => o.format(a); }), currency: Wa((n, i) => { const o = new Intl.NumberFormat(n, { ...i, style: "currency" }); return (a) => o.format(a); }), datetime: Wa((n, i) => { const o = new Intl.DateTimeFormat(n, { ...i }); return (a) => o.format(a); }), relativetime: Wa((n, i) => { const o = new Intl.RelativeTimeFormat(n, { ...i }); return (a) => o.format(a, i.range || "day"); }), list: Wa((n, i) => { const o = new Intl.ListFormat(n, { ...i }); return (a) => o.format(a); }) }, this.init(e); } init(e) { const i = (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { interpolation: {} }).interpolation; this.formatSeparator = i.formatSeparator ? i.formatSeparator : i.formatSeparator || ","; } add(e, n) { this.formats[e.toLowerCase().trim()] = n; } addCached(e, n) { this.formats[e.toLowerCase().trim()] = Wa(n); } format(e, n, i) { let o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; const a = n.split(this.formatSeparator); if (a.length > 1 && a[0].indexOf("(") > 1 && a[0].indexOf(")") < 0 && a.find((f) => f.indexOf(")") > -1)) { const f = a.findIndex((p) => p.indexOf(")") > -1); a[0] = [a[0], ...a.splice(1, f)].join(this.formatSeparator); } return a.reduce((f, p) => { const { formatName: v, formatOptions: k } = rT(p); if (this.formats[v]) { let b = f; try { const w = o && o.formatParams && o.formatParams[o.interpolationkey] || {}, T = w.locale || w.lng || o.locale || o.lng || i; b = this.formats[v](f, T, { ...k, ...o, ...w }); } catch (w) { this.logger.warn(w); } return b; } else this.logger.warn(`there was no format function for ${v}`); return f; }, e); } } const sT = (t, e) => { t.pending[e] !== void 0 && (delete t.pending[e], t.pendingCount--); }; class oT extends Mf { constructor(e, n, i) { let o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; super(), this.backend = e, this.store = n, this.services = i, this.languageUtils = i.languageUtils, this.options = o, this.logger = bi.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = o.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = o.maxRetries >= 0 ? o.maxRetries : 5, this.retryTimeout = o.retryTimeout >= 1 ? o.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(i, o.backend, o); } queueLoad(e, n, i, o) { const a = {}, l = {}, f = {}, p = {}; return e.forEach((v) => { let k = !0; n.forEach((b) => { const w = `${v}|${b}`; !i.reload && this.store.hasResourceBundle(v, b) ? this.state[w] = 2 : this.state[w] < 0 || (this.state[w] === 1 ? l[w] === void 0 && (l[w] = !0) : (this.state[w] = 1, k = !1, l[w] === void 0 && (l[w] = !0), a[w] === void 0 && (a[w] = !0), p[b] === void 0 && (p[b] = !0))); }), k || (f[v] = !0); }), (Object.keys(a).length || Object.keys(l).length) && this.queue.push({ pending: l, pendingCount: Object.keys(l).length, loaded: {}, errors: [], callback: o }), { toLoad: Object.keys(a), pending: Object.keys(l), toLoadLanguages: Object.keys(f), toLoadNamespaces: Object.keys(p) }; } loaded(e, n, i) { const o = e.split("|"), a = o[0], l = o[1]; n && this.emit("failedLoading", a, l, n), !n && i && this.store.addResourceBundle(a, l, i, void 0, void 0, { skipCopy: !0 }), this.state[e] = n ? -1 : 2, n && i && (this.state[e] = 0); const f = {}; this.queue.forEach((p) => { VO(p.loaded, [a], l), sT(p, e), n && p.errors.push(n), p.pendingCount === 0 && !p.done && (Object.keys(p.loaded).forEach((v) => { f[v] || (f[v] = {}); const k = p.loaded[v]; k.length && k.forEach((b) => { f[v][b] === void 0 && (f[v][b] = !0); }); }), p.done = !0, p.errors.length ? p.callback(p.errors) : p.callback()); }), this.emit("loaded", f), this.queue = this.queue.filter((p) => !p.done); } read(e, n, i) { let o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, l = arguments.length > 5 ? arguments[5] : void 0; if (!e.length) return l(null, {}); if (this.readingCalls >= this.maxParallelReads) { this.waitingReads.push({ lng: e, ns: n, fcName: i, tried: o, wait: a, callback: l }); return; } this.readingCalls++; const f = (v, k) => { if (this.readingCalls--, this.waitingReads.length > 0) { const b = this.waitingReads.shift(); this.read(b.lng, b.ns, b.fcName, b.tried, b.wait, b.callback); } if (v && k && o < this.maxRetries) { setTimeout(() => { this.read.call(this, e, n, i, o + 1, a * 2, l); }, a); return; } l(v, k); }, p = this.backend[i].bind(this.backend); if (p.length === 2) { try { const v = p(e, n); v && typeof v.then == "function" ? v.then((k) => f(null, k)).catch(f) : f(null, v); } catch (v) { f(v); } return; } return p(e, n, f); } prepareLoading(e, n) { let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = arguments.length > 3 ? arguments[3] : void 0; if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), o && o(); typeof e == "string" && (e = this.languageUtils.toResolveHierarchy(e)), typeof n == "string" && (n = [n]); const a = this.queueLoad(e, n, i, o); if (!a.toLoad.length) return a.pending.length || o(), null; a.toLoad.forEach((l) => { this.loadOne(l); }); } load(e, n, i) { this.prepareLoading(e, n, {}, i); } reload(e, n, i) { this.prepareLoading(e, n, { reload: !0 }, i); } loadOne(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; const i = e.split("|"), o = i[0], a = i[1]; this.read(o, a, "read", void 0, void 0, (l, f) => { l && this.logger.warn(`${n}loading namespace ${a} for language ${o} failed`, l), !l && f && this.logger.log(`${n}loaded namespace ${a} for language ${o}`, f), this.loaded(e, l, f); }); } saveMissing(e, n, i, o, a) { let l = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, f = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => { }; if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(n)) { this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"); return; } if (!(i == null || i === "")) { if (this.backend && this.backend.create) { const p = { ...l, isUpdate: a }, v = this.backend.create.bind(this.backend); if (v.length < 6) try { let k; v.length === 5 ? k = v(e, n, i, o, p) : k = v(e, n, i, o), k && typeof k.then == "function" ? k.then((b) => f(null, b)).catch(f) : f(null, k); } catch (k) { f(k); } else v(e, n, i, o, f, p); } !e || !e[0] || this.store.addResource(e[0], n, i, o); } } } const s_ = () => ({ debug: !1, initImmediate: !0, ns: ["translation"], defaultNS: ["translation"], fallbackLng: ["dev"], fallbackNS: !1, supportedLngs: !1, nonExplicitSupportedLngs: !1, load: "all", preload: !1, simplifyPluralSuffix: !0, keySeparator: ".", nsSeparator: ":", pluralSeparator: "_", contextSeparator: "_", partialBundledLanguages: !1, saveMissing: !1, updateMissing: !1, saveMissingTo: "fallback", saveMissingPlurals: !0, missingKeyHandler: !1, missingInterpolationHandler: !1, postProcess: !1, postProcessPassResolved: !1, returnNull: !1, returnEmptyString: !0, returnObjects: !1, joinArrays: !1, returnedObjectHandler: !1, parseMissingKeyHandler: !1, appendNamespaceToMissingKey: !1, appendNamespaceToCIMode: !1, overloadTranslationOptionHandler: (t) => { let e = {}; if (typeof t[1] == "object" && (e = t[1]), typeof t[1] == "string" && (e.defaultValue = t[1]), typeof t[2] == "string" && (e.tDescription = t[2]), typeof t[2] == "object" || typeof t[3] == "object") { const n = t[3] || t[2]; Object.keys(n).forEach((i) => { e[i] = n[i]; }); } return e; }, interpolation: { escapeValue: !0, format: (t) => t, prefix: "{{", suffix: "}}", formatSeparator: ",", unescapePrefix: "-", nestingPrefix: "$t(", nestingSuffix: ")", nestingOptionsSeparator: ",", maxReplaces: 1e3, skipOnVariables: !0 } }), o_ = (t) => (typeof t.ns == "string" && (t.ns = [t.ns]), typeof t.fallbackLng == "string" && (t.fallbackLng = [t.fallbackLng]), typeof t.fallbackNS == "string" && (t.fallbackNS = [t.fallbackNS]), t.supportedLngs && t.supportedLngs.indexOf("cimode") < 0 && (t.supportedLngs = t.supportedLngs.concat(["cimode"])), t), wd = () => { }, aT = (t) => { Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((n) => { typeof t[n] == "function" && (t[n] = t[n].bind(t)); }); }; class Bl extends Mf { constructor() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0; if (super(), this.options = o_(e), this.services = {}, this.logger = bi, this.modules = { external: [] }, aT(this), n && !this.isInitialized && !e.isClone) { if (!this.options.initImmediate) return this.init(e, n), this; setTimeout(() => { this.init(e, n); }, 0); } } init() { var e = this; let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = arguments.length > 1 ? arguments[1] : void 0; this.isInitializing = !0, typeof n == "function" && (i = n, n = {}), !n.defaultNS && n.defaultNS !== !1 && n.ns && (typeof n.ns == "string" ? n.defaultNS = n.ns : n.ns.indexOf("translation") < 0 && (n.defaultNS = n.ns[0])); const o = s_(); this.options = { ...o, ...this.options, ...o_(n) }, this.options.compatibilityAPI !== "v1" && (this.options.interpolation = { ...o.interpolation, ...this.options.interpolation }), n.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = n.keySeparator), n.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = n.nsSeparator); const a = (k) => k ? typeof k == "function" ? new k() : k : null; if (!this.options.isClone) { this.modules.logger ? bi.init(a(this.modules.logger), this.options) : bi.init(null, this.options); let k; this.modules.formatter ? k = this.modules.formatter : typeof Intl < "u" && (k = iT); const b = new n_(this.options); this.store = new e_(this.options.resources, this.options); const w = this.services; w.logger = bi, w.resourceStore = this.store, w.languageUtils = b, w.pluralResolver = new tT(b, { prepend: this.options.pluralSeparator, compatibilityJSON: this.options.compatibilityJSON, simplifyPluralSuffix: this.options.simplifyPluralSuffix }), k && (!this.options.interpolation.format || this.options.interpolation.format === o.interpolation.format) && (w.formatter = a(k), w.formatter.init(w, this.options), this.options.interpolation.format = w.formatter.format.bind(w.formatter)), w.interpolator = new nT(this.options), w.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, w.backendConnector = new oT(a(this.modules.backend), w.resourceStore, w, this.options), w.backendConnector.on("*", function(T) { for (var O = arguments.length, x = new Array(O > 1 ? O - 1 : 0), C = 1; C < O; C++) x[C - 1] = arguments[C]; e.emit(T, ...x); }), this.modules.languageDetector && (w.languageDetector = a(this.modules.languageDetector), w.languageDetector.init && w.languageDetector.init(w, this.options.detection, this.options)), this.modules.i18nFormat && (w.i18nFormat = a(this.modules.i18nFormat), w.i18nFormat.init && w.i18nFormat.init(this)), this.translator = new sf(this.services, this.options), this.translator.on("*", function(T) { for (var O = arguments.length, x = new Array(O > 1 ? O - 1 : 0), C = 1; C < O; C++) x[C - 1] = arguments[C]; e.emit(T, ...x); }), this.modules.external.forEach((T) => { T.init && T.init(this); }); } if (this.format = this.options.interpolation.format, i || (i = wd), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) { const k = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); k.length > 0 && k[0] !== "dev" && (this.options.lng = k[0]); } !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((k) => { this[k] = function() { return e.store[k](...arguments); }; }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((k) => { this[k] = function() { return e.store[k](...arguments), e; }; }); const p = yl(), v = () => { const k = (b, w) => { this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), p.resolve(w), i(b, w); }; if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized) return k(null, this.t.bind(this)); this.changeLanguage(this.options.lng, k); }; return this.options.resources || !this.options.initImmediate ? v() : setTimeout(v, 0), p; } loadResources(e) { let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : wd; const o = typeof e == "string" ? e : this.language; if (typeof e == "function" && (i = e), !this.options.resources || this.options.partialBundledLanguages) { if (o && o.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return i(); const a = [], l = (f) => { if (!f || f === "cimode") return; this.services.languageUtils.toResolveHierarchy(f).forEach((v) => { v !== "cimode" && a.indexOf(v) < 0 && a.push(v); }); }; o ? l(o) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((p) => l(p)), this.options.preload && this.options.preload.forEach((f) => l(f)), this.services.backendConnector.load(a, this.options.ns, (f) => { !f && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), i(f); }); } else i(null); } reloadResources(e, n, i) { const o = yl(); return typeof e == "function" && (i = e, e = void 0), typeof n == "function" && (i = n, n = void 0), e || (e = this.languages), n || (n = this.options.ns), i || (i = wd), this.services.backendConnector.reload(e, n, (a) => { o.resolve(), i(a); }), o; } use(e) { if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()"); if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()"); return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && Cb.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this; } setResolvedLanguage(e) { if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) for (let n = 0; n < this.languages.length; n++) { const i = this.languages[n]; if (!(["cimode", "dev"].indexOf(i) > -1) && this.store.hasLanguageSomeTranslations(i)) { this.resolvedLanguage = i; break; } } } changeLanguage(e, n) { var i = this; this.isLanguageChangingTo = e; const o = yl(); this.emit("languageChanging", e); const a = (p) => { this.language = p, this.languages = this.services.languageUtils.toResolveHierarchy(p), this.resolvedLanguage = void 0, this.setResolvedLanguage(p); }, l = (p, v) => { v ? (a(v), this.translator.changeLanguage(v), this.isLanguageChangingTo = void 0, this.emit("languageChanged", v), this.logger.log("languageChanged", v)) : this.isLanguageChangingTo = void 0, o.resolve(function() { return i.t(...arguments); }), n && n(p, function() { return i.t(...arguments); }); }, f = (p) => { !e && !p && this.services.languageDetector && (p = []); const v = typeof p == "string" ? p : this.services.languageUtils.getBestMatchFromCodes(p); v && (this.language || a(v), this.translator.language || this.translator.changeLanguage(v), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(v)), this.loadResources(v, (k) => { l(k, v); }); }; return !e && this.services.languageDetector && !this.services.languageDetector.async ? f(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(f) : this.services.languageDetector.detect(f) : f(e), o; } getFixedT(e, n, i) { var o = this; const a = function(l, f) { let p; if (typeof f != "object") { for (var v = arguments.length, k = new Array(v > 2 ? v - 2 : 0), b = 2; b < v; b++) k[b - 2] = arguments[b]; p = o.options.overloadTranslationOptionHandler([l, f].concat(k)); } else p = { ...f }; p.lng = p.lng || a.lng, p.lngs = p.lngs || a.lngs, p.ns = p.ns || a.ns, p.keyPrefix !== "" && (p.keyPrefix = p.keyPrefix || i || a.keyPrefix); const w = o.options.keySeparator || "."; let T; return p.keyPrefix && Array.isArray(l) ? T = l.map((O) => `${p.keyPrefix}${w}${O}`) : T = p.keyPrefix ? `${p.keyPrefix}${w}${l}` : l, o.t(T, p); }; return typeof e == "string" ? a.lng = e : a.lngs = e, a.ns = n, a.keyPrefix = i, a; } t() { return this.translator && this.translator.translate(...arguments); } exists() { return this.translator && this.translator.exists(...arguments); } setDefaultNamespace(e) { this.options.defaultNS = e; } hasLoadedNamespace(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1; if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1; const i = n.lng || this.resolvedLanguage || this.languages[0], o = this.options ? this.options.fallbackLng : !1, a = this.languages[this.languages.length - 1]; if (i.toLowerCase() === "cimode") return !0; const l = (f, p) => { const v = this.services.backendConnector.state[`${f}|${p}`]; return v === -1 || v === 0 || v === 2; }; if (n.precheck) { const f = n.precheck(this, l); if (f !== void 0) return f; } return !!(this.hasResourceBundle(i, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || l(i, e) && (!o || l(a, e))); } loadNamespaces(e, n) { const i = yl(); return this.options.ns ? (typeof e == "string" && (e = [e]), e.forEach((o) => { this.options.ns.indexOf(o) < 0 && this.options.ns.push(o); }), this.loadResources((o) => { i.resolve(), n && n(o); }), i) : (n && n(), Promise.resolve()); } loadLanguages(e, n) { const i = yl(); typeof e == "string" && (e = [e]); const o = this.options.preload || [], a = e.filter((l) => o.indexOf(l) < 0 && this.services.languageUtils.isSupportedCode(l)); return a.length ? (this.options.preload = o.concat(a), this.loadResources((l) => { i.resolve(), n && n(l); }), i) : (n && n(), Promise.resolve()); } dir(e) { if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e) return "rtl"; const n = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], i = this.services && this.services.languageUtils || new n_(s_()); return n.indexOf(i.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr"; } static createInstance() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0; return new Bl(e, n); } cloneInstance() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : wd; const i = e.forkResourceStore; i && delete e.forkResourceStore; const o = { ...this.options, ...e, isClone: !0 }, a = new Bl(o); return (e.debug !== void 0 || e.prefix !== void 0) && (a.logger = a.logger.clone(e)), ["store", "services", "language"].forEach((f) => { a[f] = this[f]; }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, i && (a.store = new e_(this.store.data, o), a.services.resourceStore = a.store), a.translator = new sf(a.services, o), a.translator.on("*", function(f) { for (var p = arguments.length, v = new Array(p > 1 ? p - 1 : 0), k = 1; k < p; k++) v[k - 1] = arguments[k]; a.emit(f, ...v); }), a.init(o, n), a.translator.options = o, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a; } toJSON() { return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage }; } } const En = Bl.createInstance(); En.createInstance = Bl.createInstance; En.createInstance; En.dir; En.init; En.loadResources; En.reloadResources; En.use; En.changeLanguage; En.getFixedT; const a_ = En.t; En.exists; En.setDefaultNamespace; En.hasLoadedNamespace; En.loadNamespaces; En.loadLanguages; const Ob = (t) => a_(t ? `errorCodes.${t}` : "errorCodes.DEFAULT"); class uT { constructor(e) { de(this, "logger"); de(this, "axiosInstance"); this.logger = e.logger, this.axiosInstance = Qt.create({ baseURL: e.baseUrl, headers: e.accessToken ? { Authorization: `Bearer ${e.accessToken}` } : {} }); } /** * Performs a GET request to the specified path. * * @param {string} path - The endpoint path. * @returns {Promise} - The response data. * @throws {Error} - Throws a user-friendly error message if the request fails. */ async get(e) { try { return (await this.axiosInstance.get(e)).data; } catch (n) { throw this.handleError(n); } } /** * Performs a POST request to the specified path with the provided data. * * @param {string} path - The endpoint path. * @param {PostRequestInput} input - The request config. * @returns {Promise} - The response data. * @throws {Error} - Throws a user-friendly error message if the request fails. */ async post(e, n) { var a; const { data: i = {}, ignoreError: o = !1 } = n; try { return (await this.axiosInstance.post( e, i )).data; } catch (l) { if (o && Qt.isAxiosError(l)) return (a = l.response) == null ? void 0 : a.data; throw this.handleError(l); } } /** * Performs a PUT request to the specified path with the provided data. * * @param {string} path - The endpoint path. * @param {PostRequestInput} input - The request config. * @returns {Promise} - The response data. * @throws {Error} - Throws a user-friendly error message if the request fails. */ async put(e, n) { var a; const { data: i = {}, ignoreError: o = !1 } = n; try { return (await this.axiosInstance.put( e, i )).data; } catch (l) { if (o && Qt.isAxiosError(l)) return (a = l.response) == null ? void 0 : a.data; throw this.handleError(l); } } /** * Performs a DELETE request to the specified path. * * @param {string} path - The endpoint path. * @returns {Promise} - The response data. * @throws {Error} - Throws a user-friendly error message if the request fails. */ async delete(e) { try { return (await this.axiosInstance.delete(e)).data; } catch (n) { throw this.handleError(n); } } /** * Handles errors from Axios requests, logging them and returning a user-friendly error message. * * @param {unknown} error - The error object from Axios. * @returns {Error} - A new error with a user-friendly message. */ handleError(e) { var o; let n = Pn.GENERAL_ERROR; if (Qt.isAxiosError(e)) if (e.response) switch (e.response.status) { case 400: n = Pn.BAD_REQUEST; break; case 401: n = Pn.UNAUTHORIZED; break; case 403: n = Pn.FORBIDDEN; break; case 404: n = Pn.NOT_FOUND; break; case 409: n = Pn.CONFLICT; break; case 410: n = Pn.GONE; break; case 415: n = Pn.UNSUPPORTED_MEDIA_TYPE; break; case 429: n = Pn.TOO_MANY_REQUESTS; break; case 500: n = Pn.INTERNAL_SERVER_ERROR; break; case 503: n = Pn.SERVICE_UNAVAILABLE; break; default: n = Pn.SERVER_ERROR; } else e.request ? n = Pn.NETWORK_ERROR : n = Pn.CONFIG_ERROR; const i = Ob(n); return this.logger.error("Error Code:", n, "Message:", i), this.logger.error("Result Data:", (o = e.response) == null ? void 0 : o.data), new Error(i); } } function lT(t) { return Symbol(t); } function cT(t) { return Symbol(t); } function dT(t) { return { key: t, isOptional: !0 }; } function fT(t, e) { return Object.entries(e).reduce((n, [i, o]) => (n[i] = t.token(o), n), {}); } var Xp = /* @__PURE__ */ new WeakMap(), Tb = /* @__PURE__ */ new Map(), hT = /* @__PURE__ */ new Map(), ta; (function(t) { t[t.Constant = 0] = "Constant", t[t.Instance = 1] = "Instance", t[t.Factory = 2] = "Factory"; })(ta || (ta = {})); var ls; (function(t) { t[t.Container = 0] = "Container", t[t.Resolution = 1] = "Resolution", t[t.Singleton = 2] = "Singleton", t[t.Transient = 3] = "Transient"; })(ls || (ls = {})); var pT = class { constructor(t) { this.impl = t, this.type = ta.Constant; } }, mT = class { constructor(t) { this.impl = t, this.type = ta.Factory; } }, gT = (t) => t.type === ta.Factory, $f = class { constructor(t) { this.impl = t, this.type = ta.Instance; } }, yT = class extends $f { constructor() { super(...arguments), this.scope = ls.Container, this.cache = /* @__PURE__ */ new WeakMap(); } }, vT = class extends $f { constructor() { super(...arguments), this.scope = ls.Resolution; } }, kT = class extends $f { constructor(t) { super(t), this.impl = t, this.scope = ls.Singleton; } }, _T = class extends $f { constructor() { super(...arguments), this.scope = ls.Transient; } }, wT = (t) => t.type === ta.Instance, ST = (t) => t.scope === ls.Container, bT = (t) => t.scope === ls.Resolution, ET = (t) => t.scope === ls.Singleton, Rb = (t) => Symbol(t), NT = (t) => { const e = Symbol(t); return { __t: null, __d: t, __s: e, __o: !1, optional: { __t: null, __d: t, __s: e, __o: !0 } }; }, bl = class { constructor() { this.parent = null, this.map = /* @__PURE__ */ new Map(); } set(t, e, n = bl.notag) { const i = this.map.get(e.__s); i ? i.set(n, t) : this.map.set(e.__s, (/* @__PURE__ */ new Map()).set(n, t)); } find(t, e, n) { const i = this.map.get(t.__s); if (i !== void 0) { if (n) { const o = i.get(n); if (o) return o; } if (e) for (let o = 0, a = e.length; o < a; o += 1) { const l = i.get(e[o]); if (l) return l; } return i.get(bl.notag); } } resolve(t, e, n, i) { const o = this.find(t, n, i); return o === void 0 ? this.parent ? this.parent.resolve(t, e, n, i) : null : o instanceof bl ? (e.vaults.push(o), o.resolve(t, e, n, i)) : o; } get(t, e, n, i) { const o = this.resolve(t, e, n, i); if (o) return o; for (let a = 0, l = e.vaults, f = l.length; a < f; a += 1) { const p = l[a].resolve(t, e, n, i); if (p) return p; } return null; } from(t) { const e = new bl(); return e.parent = this.parent, this.map.forEach((n, i) => { e.map.set(i, t(n)); }), e; } clone() { return this.from((t) => new Map(t)); } }, Ib = bl; Ib.notag = Rb("NO_TAG"); var AT = class { constructor(t, e, n, i) { this.vault = t, this.tokens = e, this.getVault = n, this.condition = i; } from(t) { const { tokens: e } = this; for (let n = 0, i = e.length; n < i; n += 1) this.vault.set(this.getVault(t), e[n], this.condition); } }, xT = class { constructor(t, e, n, i) { this.vault = t, this.impl = e, this.token = n, this.condition = i; } inContainerScope() { this.set(yT); } inResolutionScope() { this.set(vT); } inSingletonScope() { this.set(kT); } inTransientScope() { this.set(_T); } set(t) { this.vault.set(new t(this.impl), this.token, this.condition); } }, CT = class { constructor(t, e, n) { this.vault = t, this.token = e, this.condition = n; } toConstant(t) { this.vault.set(new pT(t), this.token, this.condition); } toFactory(t, e) { this.vault.set(new mT({ creator: t, initializer: e }), this.token, this.condition); } toInstance(t) { return new xT(this.vault, t, this.token, this.condition); } }, Hm = class { constructor(t, e) { this.vault = t, this.condition = e; } static vault(t) { return t.vault; } bind(t) { return new CT(this.vault, t, this.condition); } use(...t) { return new AT(this.vault, t, Hm.vault, this.condition); } }, OT = class extends Hm { when(t) { return new Hm(this.vault, t); } }, TT = class extends OT { constructor() { super(new Ib()); } }, Pb = class { constructor(t = /* @__PURE__ */ new Map(), e = []) { this.instances = t, this.vaults = e; } split() { return new Pb(this.instances, this.vaults.slice()); } }, Ld = class extends TT { constructor() { super(), this.snapshot = null; } extend(t) { return this.vault.parent = t === null ? null : t.vault, this; } clone() { const t = new Ld(); return t.vault = this.vault.clone(), t; } get(t, e) { return this.resolveToken(t, e); } resolveTokens(t, e, n, i) { return t.map((o) => this.resolveToken(o, n, i, e.split())); } resolveToken(t, e, n, i = new Pb()) { const o = this.vault.get(t, i, e, n); if (o) return this.resolveBinding(o, i); if (!t.__o) throw new Error(`No matching bindings found for '${t.__d}' token.`); } resolveBinding(t, e) { return wT(t) ? ET(t) ? this.resolveCache(t, e, () => t.cache, (n) => { t.cache = n; }) : ST(t) ? this.resolveCache(t, e, () => t.cache.get(this.vault), (n) => { t.cache.set(this.vault, n); }) : bT(t) ? this.resolveCache(t, e, () => e.instances.get(t), (n) => { e.instances.set(t, n); }) : this.createInstance(t.impl, e) : gT(t) ? (...n) => { const i = this.createInstance(t.impl.creator, e); return i instanceof Promise ? i.then((o) => Ld.resolveInitialization(o, n, t.impl.initializer)) : Ld.resolveInitialization(i, n, t.impl.initializer); } : t.impl; } resolveCache(t, e, n, i) { const o = n(); if (o !== void 0) return o; const a = this.createInstance(t.impl, e); return i(a), a; } createInstance(t, e) { const n = this.getParameters(t, e), i = Xp.get(t); if (i !== void 0) return i ? t(...n) : new t(...n); try { const o = t(...n); return Xp.set(t, !0), o; } catch { const a = new t(...n); return Xp.set(t, !1), a; } } getParameters(t, e) { const n = Tb.get(t); if (n) return this.resolveTokens(n, e, hT.get(t), t); if (t.length === 0) return []; throw new Error(`Missing required 'injected' registration of '${t.name}'`); } static resolveInitialization(t, e, n) { const i = n == null ? void 0 : n(t, ...e); return i instanceof Promise ? i.then(() => t) : t; } }, u_ = (t, ...e) => (Tb.set(t, e), t); function Rg(t) { return typeof t == "object" && t !== null && t.isOptional === !0; } function Lb(t) { return "useClass" in t; } function Db(t) { return "useValue" in t; } function Fb(t) { return "useFactory" in t; } var Go = /* @__PURE__ */ ((t) => (t.Singleton = "singleton", t.Transient = "transient", t.Container = "container", t.Resolution = "resolution", t))(Go || {}); function Xa(t, e) { return t.has(e) || t.set(e, NT(e.description ?? "unknown_key")), t.get(e); } function Ig(t, e) { return t.has(e) || t.set(e, Rb(e.description ?? "unknown_tag")), t.get(e); } function Mb(t, e) { return typeof e == "symbol" ? Ig(t, e) : e; } function qm(t, e, n) { return e.map((i) => { const o = Rg(i), a = o ? i.key : i, l = t.get(a); if (!l) throw new Error( `DI Error: Dependency key "${String( a.description )}" required by "${String(n.description)}" not found.` ); return o ? l.optional : l; }); } function $b(t, e) { switch (e) { case Go.Singleton: t.inSingletonScope(); break; case Go.Container: t.inContainerScope(); break; case Go.Resolution: t.inResolutionScope(); break; case Go.Transient: default: t.inTransientScope(); break; } } class Pg { /** * Private constructor to enforce creation through static create method. * Initializes the Brandi container. */ constructor() { /** * Brandi container instance used for dependency resolution. * This is exposed to allow direct access to Brandi's features if needed. */ de(this, "container"); /** * Internal mapping of dependency keys to Brandi tokens. * Used for type-safe token resolution. */ de(this, "keyToTokenMap", /* @__PURE__ */ new Map()); /** * Internal mapping of custom tags to Brandi tags. * Used for conditional binding resolution. */ de(this, "tagToBrandiTagMap", /* @__PURE__ */ new Map()); this.container = new Ld(); } /** * Creates and initializes a new DependencyInjector with the given providers. * This is the recommended way to create a new injector instance. * * @param providers - Array of providers to register with the injector * @returns A new configured DependencyInjector instance * @throws Error if provider configuration is invalid */ static create(e) { const n = new Pg(); return n.initializeTokensAndTags(e), n.bindProviders(e), n; } /** * Retrieves a registered token from a dependency key. * This method provides type-safe access to registered tokens. * * @template T - The type of the dependency * @param k - The dependency key to resolve * @returns The corresponding Brandi Token instance * @throws Error if the token is not found */ token(e) { const n = this.keyToTokenMap.get(e); if (!n) throw new Error( `DI Error: Token for key "${String(e.description)}" not found.` ); return n; } /** * Ensures all tokens and tags used in the providers are initialized. * This method is called during injector creation to validate and prepare * all dependencies before binding. * * @param providers - Array of providers to initialize * @throws Error if any dependency is invalid or missing */ initializeTokensAndTags(e) { e.forEach((n) => { Xa(this.keyToTokenMap, n.key), n.when && typeof n.when == "symbol" && Ig(this.tagToBrandiTagMap, n.when), "deps" in n && n.deps && n.deps.forEach((i) => { const o = Rg(i) ? i.key : i; Xa(this.keyToTokenMap, o); }); }); } /** * Binds all providers to the internal container. * This method handles the actual registration of providers with Brandi, * including conditional binding and scope configuration. * * @param providers - Array of providers to bind */ bindProviders(e) { e.forEach((n) => { const i = n.when ? Mb(this.tagToBrandiTagMap, n.when) : void 0, o = i ? this.container.when(i) : this.container; Lb(n) ? this.bindClassProvider(o, n) : Db(n) ? this.bindValueProvider(o, n) : Fb(n) && this.bindFactoryProvider(o, n); }); } /** * Binds a class provider with scope and dependencies. * Handles the registration of class-based services with optional * dependency injection and scope configuration. * * @param binder - The Brandi container binding context * @param config - The class provider configuration */ bindClassProvider(e, n) { const { key: i, useClass: o, deps: a = [], scope: l = Go.Transient } = n, f = Xa(this.keyToTokenMap, i), p = qm( this.keyToTokenMap, a, i ); p.length > 0 && u_(o, ...p); const v = e.bind(f).toInstance(o); $b(v, l); } /** * Binds a value provider. * Registers a constant value with the dependency injection system. * * @param binder - The Brandi container binding context * @param config - The value provider configuration */ bindValueProvider(e, n) { const i = Xa(this.keyToTokenMap, n.key); e.bind(i).toConstant(n.useValue); } /** * Binds a factory provider. * Registers a factory function that can create instances on demand, * with support for dependency injection and initialization. * * @param binder - The Brandi container binding context * @param config - The factory provider configuration */ bindFactoryProvider(e, n) { var p; const { key: i, useFactory: o, deps: a = [], initializer: l } = n, f = Xa(this.keyToTokenMap, i); if (typeof o == "function" && ((p = o.prototype) == null ? void 0 : p.constructor) === o && a.length > 0) { const v = qm( this.keyToTokenMap, a, i ); v.length > 0 && u_(o, ...v); } e.bind(f).toFactory(o, l); } } function jb(t) { const e = Object.values(t); return Object.assign({}, ...e); } function Ub(t) { return Object.entries(t).reduce( (e, [n, i]) => { const o = jb(i); return { ...e, [n]: o }; }, {} ); } function Bb(t, e) { const n = Ub(e); Object.entries(n).forEach(([i, o]) => { t.addResourceBundle(i, "translation", o, !0); }); } const { slice: RT, forEach: IT } = []; function PT(t) { return IT.call(RT.call(arguments, 1), (e) => { if (e) for (const n in e) t[n] === void 0 && (t[n] = e[n]); }), t; } const l_ = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, LT = (t, e, n) => { const i = n || {}; i.path = i.path || "/"; const o = encodeURIComponent(e); let a = `${t}=${o}`; if (i.maxAge > 0) { const l = i.maxAge - 0; if (Number.isNaN(l)) throw new Error("maxAge should be a Number"); a += `; Max-Age=${Math.floor(l)}`; } if (i.domain) { if (!l_.test(i.domain)) throw new TypeError("option domain is invalid"); a += `; Domain=${i.domain}`; } if (i.path) { if (!l_.test(i.path)) throw new TypeError("option path is invalid"); a += `; Path=${i.path}`; } if (i.expires) { if (typeof i.expires.toUTCString != "function") throw new TypeError("option expires is invalid"); a += `; Expires=${i.expires.toUTCString()}`; } if (i.httpOnly && (a += "; HttpOnly"), i.secure && (a += "; Secure"), i.sameSite) switch (typeof i.sameSite == "string" ? i.sameSite.toLowerCase() : i.sameSite) { case !0: a += "; SameSite=Strict"; break; case "lax": a += "; SameSite=Lax"; break; case "strict": a += "; SameSite=Strict"; break; case "none": a += "; SameSite=None"; break; default: throw new TypeError("option sameSite is invalid"); } return a; }, c_ = { create(t, e, n, i) { let o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : { path: "/", sameSite: "strict" }; n && (o.expires = /* @__PURE__ */ new Date(), o.expires.setTime(o.expires.getTime() + n * 60 * 1e3)), i && (o.domain = i), document.cookie = LT(t, encodeURIComponent(e), o); }, read(t) { const e = `${t}=`, n = document.cookie.split(";"); for (let i = 0; i < n.length; i++) { let o = n[i]; for (; o.charAt(0) === " "; ) o = o.substring(1, o.length); if (o.indexOf(e) === 0) return o.substring(e.length, o.length); } return null; }, remove(t) { this.create(t, "", -1); } }; var DT = { name: "cookie", // Deconstruct the options object and extract the lookupCookie property lookup(t) { let { lookupCookie: e } = t; if (e && typeof document < "u") return c_.read(e) || void 0; }, // Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties cacheUserLanguage(t, e) { let { lookupCookie: n, cookieMinutes: i, cookieDomain: o, cookieOptions: a } = e; n && typeof document < "u" && c_.create(n, t, i, o, a); } }, FT = { name: "querystring", // Deconstruct the options object and extract the lookupQuerystring property lookup(t) { var i; let { lookupQuerystring: e } = t, n; if (typeof window < "u") { let { search: o } = window.location; !window.location.search && ((i = window.location.hash) == null ? void 0 : i.indexOf("?")) > -1 && (o = window.location.hash.substring(window.location.hash.indexOf("?"))); const l = o.substring(1).split("&"); for (let f = 0; f < l.length; f++) { const p = l[f].indexOf("="); p > 0 && l[f].substring(0, p) === e && (n = l[f].substring(p + 1)); } } return n; } }; let vl = null; const d_ = () => { if (vl !== null) return vl; try { vl = window !== "undefined" && window.localStorage !== null; const t = "i18next.translate.boo"; window.localStorage.setItem(t, "foo"), window.localStorage.removeItem(t); } catch { vl = !1; } return vl; }; var MT = { name: "localStorage", // Deconstruct the options object and extract the lookupLocalStorage property lookup(t) { let { lookupLocalStorage: e } = t; if (e && d_()) return window.localStorage.getItem(e) || void 0; }, // Deconstruct the options object and extract the lookupLocalStorage property cacheUserLanguage(t, e) { let { lookupLocalStorage: n } = e; n && d_() && window.localStorage.setItem(n, t); } }; let kl = null; const f_ = () => { if (kl !== null) return kl; try { kl = window !== "undefined" && window.sessionStorage !== null; const t = "i18next.translate.boo"; window.sessionStorage.setItem(t, "foo"), window.sessionStorage.removeItem(t); } catch { kl = !1; } return kl; }; var $T = { name: "sessionStorage", lookup(t) { let { lookupSessionStorage: e } = t; if (e && f_()) return window.sessionStorage.getItem(e) || void 0; }, cacheUserLanguage(t, e) { let { lookupSessionStorage: n } = e; n && f_() && window.sessionStorage.setItem(n, t); } }, jT = { name: "navigator", lookup(t) { const e = []; if (typeof navigator < "u") { const { languages: n, userLanguage: i, language: o } = navigator; if (n) for (let a = 0; a < n.length; a++) e.push(n[a]); i && e.push(i), o && e.push(o); } return e.length > 0 ? e : void 0; } }, UT = { name: "htmlTag", // Deconstruct the options object and extract the htmlTag property lookup(t) { let { htmlTag: e } = t, n; const i = e || (typeof document < "u" ? document.documentElement : null); return i && typeof i.getAttribute == "function" && (n = i.getAttribute("lang")), n; } }, BT = { name: "path", // Deconstruct the options object and extract the lookupFromPathIndex property lookup(t) { var o; let { lookupFromPathIndex: e } = t; if (typeof window > "u") return; const n = window.location.pathname.match(/\/([a-zA-Z-]*)/g); return Array.isArray(n) ? (o = n[typeof e == "number" ? e : 0]) == null ? void 0 : o.replace("/", "") : void 0; } }, VT = { name: "subdomain", lookup(t) { var o, a; let { lookupFromSubdomainIndex: e } = t; const n = typeof e == "number" ? e + 1 : 1, i = typeof window < "u" && ((a = (o = window.location) == null ? void 0 : o.hostname) == null ? void 0 : a.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i)); if (i) return i[n]; } }; function zT() { return { order: ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"], lookupQuerystring: "lng", lookupCookie: "i18next", lookupLocalStorage: "i18nextLng", lookupSessionStorage: "i18nextLng", // cache user language caches: ["localStorage"], excludeCacheFor: ["cimode"], // cookieMinutes: 10, // cookieDomain: 'myDomain' convertDetectedLanguage: (t) => t }; } class Vb { constructor(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; this.type = "languageDetector", this.detectors = {}, this.init(e, n); } init(e) { let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; this.services = e || { languageUtils: {} }, this.options = PT(n, this.options || {}, zT()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (o) => o.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = i, this.addDetector(DT), this.addDetector(FT), this.addDetector(MT), this.addDetector($T), this.addDetector(jT), this.addDetector(UT), this.addDetector(BT), this.addDetector(VT); } addDetector(e) { return this.detectors[e.name] = e, this; } detect(e) { e || (e = this.options.order); let n = []; return e.forEach((i) => { if (this.detectors[i]) { let o = this.detectors[i].lookup(this.options); o && typeof o == "string" && (o = [o]), o && (n = n.concat(o)); } }), n = n.map((i) => this.options.convertDetectedLanguage(i)), this.services.languageUtils.getBestMatchFromCodes ? n : n.length > 0 ? n[0] : null; } cacheUserLanguage(e, n) { n || (n = this.options.caches), n && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e) > -1 || n.forEach((i) => { this.detectors[i] && this.detectors[i].cacheUserLanguage(e, this.options); })); } } Vb.type = "languageDetector"; function zb(t, e) { t.use(e).use(Vb).init({ resources: {}, fallbackLng: "en", debug: !1, interpolation: { escapeValue: !1, // not needed for react as it escapes by default format: (n, i, o) => { if (i) { const [a, ...l] = i.split(",").map((f) => f.trim()); if (a === "number") return new Intl.NumberFormat(o).format(n); if (a === "date") return new Intl.DateTimeFormat(o).format(n); if (a === "currency") return new Intl.NumberFormat(o, { style: "currency", currency: l[0] || "USD", currencyDisplay: "narrowSymbol" }).format(n).replace("$", "").trim(); } return n; } }, detection: { // order and from where user language should be detected order: [ "navigator", "cookie", "localStorage", "sessionStorage", "querystring", "htmlTag", "path", "subdomain" ] } }); } const HT = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, qT = { "&": "&", "&": "&", "<": "<", "<": "<", ">": ">", ">": ">", "'": "'", "'": "'", """: '"', """: '"', " ": " ", " ": " ", "©": "©", "©": "©", "®": "®", "®": "®", "…": "…", "…": "…", "/": "/", "/": "/" }, KT = (t) => qT[t], GT = (t) => t.replace(HT, KT); let h_ = { bindI18n: "languageChanged", bindI18nStore: "", transEmptyNodeValue: "", transSupportBasicHtmlNodes: !0, transWrapTextNodes: "", transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"], useSuspense: !0, unescape: GT }; function WT() { let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; h_ = { ...h_, ...t }; } const QT = { type: "3rdParty", init(t) { WT(t.options.react); } }; zb(En, QT); const YT = (t) => Bb(En, t), p_ = { startTime: "UNKNOWN", viewerCount: 0, status: "UNKNOWN" }, XT = () => { const [t, e] = st.useState([]), [n, i] = st.useState(p_); return { realTimeStreamInfo: n, productsInCart: t, onTextMetadataCue: (l) => { const { action: f, data: p, startTime: v, viewerCount: k, status: b } = JSON.parse( l == null ? void 0 : l.text ); switch (f) { case "sendivsdatarealtime": { i({ startTime: v, viewerCount: k, status: b }); break; } case "sendaddtocart": { const { id: w, sessionId: T, productId: O, productImageUrl: x, productName: C } = p; e(($) => [ ...$, { id: w, sessionId: T, productId: O, productImageUrl: x, productName: C } ]); } break; } }, resetRealTimeStreamInfo: () => { i(p_); }, setProductsInCart: e }; }, Lg = JSON, JT = (t) => t.toUpperCase(), ZT = (t) => { const e = {}; return t.forEach((n, i) => { e[i] = n; }), e; }, eR = (t, e, n) => t.document ? t : { document: t, variables: e, requestHeaders: n, signal: void 0 }, tR = (t, e, n) => t.query ? t : { query: t, variables: e, requestHeaders: n, signal: void 0 }, nR = (t, e) => t.documents ? t : { documents: t, requestHeaders: e, signal: void 0 }; function Dd(t, e) { if (!!!t) throw new Error(e); } function rR(t) { return typeof t == "object" && t !== null; } function iR(t, e) { if (!!!t) throw new Error( "Unexpected invariant triggered." ); } const sR = /\r\n|[\n\r]/g; function Km(t, e) { let n = 0, i = 1; for (const o of t.body.matchAll(sR)) { if (typeof o.index == "number" || iR(!1), o.index >= e) break; n = o.index + o[0].length, i += 1; } return { line: i, column: e + 1 - n }; } function oR(t) { return Hb( t.source, Km(t.source, t.start) ); } function Hb(t, e) { const n = t.locationOffset.column - 1, i = "".padStart(n) + t.body, o = e.line - 1, a = t.locationOffset.line - 1, l = e.line + a, f = e.line === 1 ? n : 0, p = e.column + f, v = `${t.name}:${l}:${p} `, k = i.split(/\r\n|[\n\r]/g), b = k[o]; if (b.length > 120) { const w = Math.floor(p / 80), T = p % 80, O = []; for (let x = 0; x < b.length; x += 80) O.push(b.slice(x, x + 80)); return v + m_([ [`${l} |`, O[0]], ...O.slice(1, w + 1).map((x) => ["|", x]), ["|", "^".padStart(T)], ["|", O[w + 1]] ]); } return v + m_([ // Lines specified like this: ["prefix", "string"], [`${l - 1} |`, k[o - 1]], [`${l} |`, b], ["|", "^".padStart(p)], [`${l + 1} |`, k[o + 1]] ]); } function m_(t) { const e = t.filter(([i, o]) => o !== void 0), n = Math.max(...e.map(([i]) => i.length)); return e.map(([i, o]) => i.padStart(n) + (o ? " " + o : "")).join(` `); } function aR(t) { const e = t[0]; return e == null || "kind" in e || "length" in e ? { nodes: e, source: t[1], positions: t[2], path: t[3], originalError: t[4], extensions: t[5] } : e; } class Dg extends Error { /** * An array of `{ line, column }` locations within the source GraphQL document * which correspond to this error. * * Errors during validation often contain multiple locations, for example to * point out two things with the same name. Errors during execution include a * single location, the field which produced the error. * * Enumerable, and appears in the result of JSON.stringify(). */ /** * An array describing the JSON-path into the execution response which * corresponds to this error. Only included for errors during execution. * * Enumerable, and appears in the result of JSON.stringify(). */ /** * An array of GraphQL AST Nodes corresponding to this error. */ /** * The source GraphQL document for the first location of this error. * * Note that if this Error represents more than one node, the source may not * represent nodes after the first node. */ /** * An array of character offsets within the source GraphQL document * which correspond to this error. */ /** * The original error thrown from a field resolver during execution. */ /** * Extension fields to add to the formatted error. */ /** * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead. */ constructor(e, ...n) { var i, o, a; const { nodes: l, source: f, positions: p, path: v, originalError: k, extensions: b } = aR(n); super(e), this.name = "GraphQLError", this.path = v ?? void 0, this.originalError = k ?? void 0, this.nodes = g_( Array.isArray(l) ? l : l ? [l] : void 0 ); const w = g_( (i = this.nodes) === null || i === void 0 ? void 0 : i.map((O) => O.loc).filter((O) => O != null) ); this.source = f ?? (w == null || (o = w[0]) === null || o === void 0 ? void 0 : o.source), this.positions = p ?? (w == null ? void 0 : w.map((O) => O.start)), this.locations = p && f ? p.map((O) => Km(f, O)) : w == null ? void 0 : w.map((O) => Km(O.source, O.start)); const T = rR( k == null ? void 0 : k.extensions ) ? k == null ? void 0 : k.extensions : void 0; this.extensions = (a = b ?? T) !== null && a !== void 0 ? a : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, { message: { writable: !0, enumerable: !0 }, name: { enumerable: !1 }, nodes: { enumerable: !1 }, source: { enumerable: !1 }, positions: { enumerable: !1 }, originalError: { enumerable: !1 } }), k != null && k.stack ? Object.defineProperty(this, "stack", { value: k.stack, writable: !0, configurable: !0 }) : Error.captureStackTrace ? Error.captureStackTrace(this, Dg) : Object.defineProperty(this, "stack", { value: Error().stack, writable: !0, configurable: !0 }); } get [Symbol.toStringTag]() { return "GraphQLError"; } toString() { let e = this.message; if (this.nodes) for (const n of this.nodes) n.loc && (e += ` ` + oR(n.loc)); else if (this.source && this.locations) for (const n of this.locations) e += ` ` + Hb(this.source, n); return e; } toJSON() { const e = { message: this.message }; return this.locations != null && (e.locations = this.locations), this.path != null && (e.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (e.extensions = this.extensions), e; } } function g_(t) { return t === void 0 || t.length === 0 ? void 0 : t; } function _n(t, e, n) { return new Dg(`Syntax Error: ${n}`, { source: t, positions: [e] }); } class uR { /** * The character offset at which this Node begins. */ /** * The character offset at which this Node ends. */ /** * The Token at which this Node begins. */ /** * The Token at which this Node ends. */ /** * The Source document the AST represents. */ constructor(e, n, i) { this.start = e.start, this.end = n.end, this.startToken = e, this.endToken = n, this.source = i; } get [Symbol.toStringTag]() { return "Location"; } toJSON() { return { start: this.start, end: this.end }; } } class qb { /** * The kind of Token. */ /** * The character offset at which this Node begins. */ /** * The character offset at which this Node ends. */ /** * The 1-indexed line number on which this Token appears. */ /** * The 1-indexed column number at which this Token begins. */ /** * For non-punctuation tokens, represents the interpreted value of the token. * * Note: is undefined for punctuation tokens, but typed as string for * convenience in the parser. */ /** * Tokens exist as nodes in a double-linked-list amongst all tokens * including ignored tokens. is always the first node and * the last. */ constructor(e, n, i, o, a, l) { this.kind = e, this.start = n, this.end = i, this.line = o, this.column = a, this.value = l, this.prev = null, this.next = null; } get [Symbol.toStringTag]() { return "Token"; } toJSON() { return { kind: this.kind, value: this.value, line: this.line, column: this.column }; } } const Kb = { Name: [], Document: ["definitions"], OperationDefinition: [ "name", "variableDefinitions", "directives", "selectionSet" ], VariableDefinition: ["variable", "type", "defaultValue", "directives"], Variable: ["name"], SelectionSet: ["selections"], Field: ["alias", "name", "arguments", "directives", "selectionSet"], Argument: ["name", "value"], FragmentSpread: ["name", "directives"], InlineFragment: ["typeCondition", "directives", "selectionSet"], FragmentDefinition: [ "name", // Note: fragment variable definitions are deprecated and will removed in v17.0.0 "variableDefinitions", "typeCondition", "directives", "selectionSet" ], IntValue: [], FloatValue: [], StringValue: [], BooleanValue: [], NullValue: [], EnumValue: [], ListValue: ["values"], ObjectValue: ["fields"], ObjectField: ["name", "value"], Directive: ["name", "arguments"], NamedType: ["name"], ListType: ["type"], NonNullType: ["type"], SchemaDefinition: ["description", "directives", "operationTypes"], OperationTypeDefinition: ["type"], ScalarTypeDefinition: ["description", "name", "directives"], ObjectTypeDefinition: [ "description", "name", "interfaces", "directives", "fields" ], FieldDefinition: ["description", "name", "arguments", "type", "directives"], InputValueDefinition: [ "description", "name", "type", "defaultValue", "directives" ], InterfaceTypeDefinition: [ "description", "name", "interfaces", "directives", "fields" ], UnionTypeDefinition: ["description", "name", "directives", "types"], EnumTypeDefinition: ["description", "name", "directives", "values"], EnumValueDefinition: ["description", "name", "directives"], InputObjectTypeDefinition: ["description", "name", "directives", "fields"], DirectiveDefinition: ["description", "name", "arguments", "locations"], SchemaExtension: ["directives", "operationTypes"], ScalarTypeExtension: ["name", "directives"], ObjectTypeExtension: ["name", "interfaces", "directives", "fields"], InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"], UnionTypeExtension: ["name", "directives", "types"], EnumTypeExtension: ["name", "directives", "values"], InputObjectTypeExtension: ["name", "directives", "fields"] }, lR = new Set(Object.keys(Kb)); function y_(t) { const e = t == null ? void 0 : t.kind; return typeof e == "string" && lR.has(e); } var ru; (function(t) { t.QUERY = "query", t.MUTATION = "mutation", t.SUBSCRIPTION = "subscription"; })(ru || (ru = {})); var Gm; (function(t) { t.QUERY = "QUERY", t.MUTATION = "MUTATION", t.SUBSCRIPTION = "SUBSCRIPTION", t.FIELD = "FIELD", t.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", t.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", t.INLINE_FRAGMENT = "INLINE_FRAGMENT", t.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", t.SCHEMA = "SCHEMA", t.SCALAR = "SCALAR", t.OBJECT = "OBJECT", t.FIELD_DEFINITION = "FIELD_DEFINITION", t.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", t.INTERFACE = "INTERFACE", t.UNION = "UNION", t.ENUM = "ENUM", t.ENUM_VALUE = "ENUM_VALUE", t.INPUT_OBJECT = "INPUT_OBJECT", t.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION"; })(Gm || (Gm = {})); var at; (function(t) { t.NAME = "Name", t.DOCUMENT = "Document", t.OPERATION_DEFINITION = "OperationDefinition", t.VARIABLE_DEFINITION = "VariableDefinition", t.SELECTION_SET = "SelectionSet", t.FIELD = "Field", t.ARGUMENT = "Argument", t.FRAGMENT_SPREAD = "FragmentSpread", t.INLINE_FRAGMENT = "InlineFragment", t.FRAGMENT_DEFINITION = "FragmentDefinition", t.VARIABLE = "Variable", t.INT = "IntValue", t.FLOAT = "FloatValue", t.STRING = "StringValue", t.BOOLEAN = "BooleanValue", t.NULL = "NullValue", t.ENUM = "EnumValue", t.LIST = "ListValue", t.OBJECT = "ObjectValue", t.OBJECT_FIELD = "ObjectField", t.DIRECTIVE = "Directive", t.NAMED_TYPE = "NamedType", t.LIST_TYPE = "ListType", t.NON_NULL_TYPE = "NonNullType", t.SCHEMA_DEFINITION = "SchemaDefinition", t.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", t.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", t.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", t.FIELD_DEFINITION = "FieldDefinition", t.INPUT_VALUE_DEFINITION = "InputValueDefinition", t.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", t.UNION_TYPE_DEFINITION = "UnionTypeDefinition", t.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", t.ENUM_VALUE_DEFINITION = "EnumValueDefinition", t.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", t.DIRECTIVE_DEFINITION = "DirectiveDefinition", t.SCHEMA_EXTENSION = "SchemaExtension", t.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", t.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", t.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", t.UNION_TYPE_EXTENSION = "UnionTypeExtension", t.ENUM_TYPE_EXTENSION = "EnumTypeExtension", t.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension"; })(at || (at = {})); function Wm(t) { return t === 9 || t === 32; } function Vl(t) { return t >= 48 && t <= 57; } function Gb(t) { return t >= 97 && t <= 122 || // A-Z t >= 65 && t <= 90; } function Wb(t) { return Gb(t) || t === 95; } function cR(t) { return Gb(t) || Vl(t) || t === 95; } function dR(t) { var e; let n = Number.MAX_SAFE_INTEGER, i = null, o = -1; for (let l = 0; l < t.length; ++l) { var a; const f = t[l], p = fR(f); p !== f.length && (i = (a = i) !== null && a !== void 0 ? a : l, o = l, l !== 0 && p < n && (n = p)); } return t.map((l, f) => f === 0 ? l : l.slice(n)).slice( (e = i) !== null && e !== void 0 ? e : 0, o + 1 ); } function fR(t) { let e = 0; for (; e < t.length && Wm(t.charCodeAt(e)); ) ++e; return e; } function hR(t, e) { const n = t.replace(/"""/g, '\\"""'), i = n.split(/\r\n|[\n\r]/g), o = i.length === 1, a = i.length > 1 && i.slice(1).every((T) => T.length === 0 || Wm(T.charCodeAt(0))), l = n.endsWith('\\"""'), f = t.endsWith('"') && !l, p = t.endsWith("\\"), v = f || p, k = ( // add leading and trailing new lines only if it improves readability !o || t.length > 70 || v || a || l ); let b = ""; const w = o && Wm(t.charCodeAt(0)); return (k && !w || a) && (b += ` `), b += n, (k || v) && (b += ` `), '"""' + b + '"""'; } var ve; (function(t) { t.SOF = "", t.EOF = "", t.BANG = "!", t.DOLLAR = "$", t.AMP = "&", t.PAREN_L = "(", t.PAREN_R = ")", t.SPREAD = "...", t.COLON = ":", t.EQUALS = "=", t.AT = "@", t.BRACKET_L = "[", t.BRACKET_R = "]", t.BRACE_L = "{", t.PIPE = "|", t.BRACE_R = "}", t.NAME = "Name", t.INT = "Int", t.FLOAT = "Float", t.STRING = "String", t.BLOCK_STRING = "BlockString", t.COMMENT = "Comment"; })(ve || (ve = {})); class pR { /** * The previously focused non-ignored token. */ /** * The currently focused non-ignored token. */ /** * The (1-indexed) line containing the current token. */ /** * The character offset at which the current line begins. */ constructor(e) { const n = new qb(ve.SOF, 0, 0, 0, 0); this.source = e, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0; } get [Symbol.toStringTag]() { return "Lexer"; } /** * Advances the token stream to the next non-ignored token. */ advance() { return this.lastToken = this.token, this.token = this.lookahead(); } /** * Looks ahead and returns the next non-ignored token, but does not change * the state of Lexer. */ lookahead() { let e = this.token; if (e.kind !== ve.EOF) do if (e.next) e = e.next; else { const n = gR(this, e.end); e.next = n, n.prev = e, e = n; } while (e.kind === ve.COMMENT); return e; } } function mR(t) { return t === ve.BANG || t === ve.DOLLAR || t === ve.AMP || t === ve.PAREN_L || t === ve.PAREN_R || t === ve.SPREAD || t === ve.COLON || t === ve.EQUALS || t === ve.AT || t === ve.BRACKET_L || t === ve.BRACKET_R || t === ve.BRACE_L || t === ve.PIPE || t === ve.BRACE_R; } function Su(t) { return t >= 0 && t <= 55295 || t >= 57344 && t <= 1114111; } function jf(t, e) { return Qb(t.charCodeAt(e)) && Yb(t.charCodeAt(e + 1)); } function Qb(t) { return t >= 55296 && t <= 56319; } function Yb(t) { return t >= 56320 && t <= 57343; } function na(t, e) { const n = t.source.body.codePointAt(e); if (n === void 0) return ve.EOF; if (n >= 32 && n <= 126) { const i = String.fromCodePoint(n); return i === '"' ? `'"'` : `"${i}"`; } return "U+" + n.toString(16).toUpperCase().padStart(4, "0"); } function cn(t, e, n, i, o) { const a = t.line, l = 1 + n - t.lineStart; return new qb(e, n, i, a, l, o); } function gR(t, e) { const n = t.source.body, i = n.length; let o = e; for (; o < i; ) { const a = n.charCodeAt(o); switch (a) { // Ignored :: // - UnicodeBOM // - WhiteSpace // - LineTerminator // - Comment // - Comma // // UnicodeBOM :: "Byte Order Mark (U+FEFF)" // // WhiteSpace :: // - "Horizontal Tab (U+0009)" // - "Space (U+0020)" // // Comma :: , case 65279: // case 9: // \t case 32: // case 44: ++o; continue; // LineTerminator :: // - "New Line (U+000A)" // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"] // - "Carriage Return (U+000D)" "New Line (U+000A)" case 10: ++o, ++t.line, t.lineStart = o; continue; case 13: n.charCodeAt(o + 1) === 10 ? o += 2 : ++o, ++t.line, t.lineStart = o; continue; // Comment case 35: return yR(t, o); // Token :: // - Punctuator // - Name // - IntValue // - FloatValue // - StringValue // // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | } case 33: return cn(t, ve.BANG, o, o + 1); case 36: return cn(t, ve.DOLLAR, o, o + 1); case 38: return cn(t, ve.AMP, o, o + 1); case 40: return cn(t, ve.PAREN_L, o, o + 1); case 41: return cn(t, ve.PAREN_R, o, o + 1); case 46: if (n.charCodeAt(o + 1) === 46 && n.charCodeAt(o + 2) === 46) return cn(t, ve.SPREAD, o, o + 3); break; case 58: return cn(t, ve.COLON, o, o + 1); case 61: return cn(t, ve.EQUALS, o, o + 1); case 64: return cn(t, ve.AT, o, o + 1); case 91: return cn(t, ve.BRACKET_L, o, o + 1); case 93: return cn(t, ve.BRACKET_R, o, o + 1); case 123: return cn(t, ve.BRACE_L, o, o + 1); case 124: return cn(t, ve.PIPE, o, o + 1); case 125: return cn(t, ve.BRACE_R, o, o + 1); // StringValue case 34: return n.charCodeAt(o + 1) === 34 && n.charCodeAt(o + 2) === 34 ? bR(t, o) : kR(t, o); } if (Vl(a) || a === 45) return vR(t, o, a); if (Wb(a)) return ER(t, o); throw _n( t.source, o, a === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : Su(a) || jf(n, o) ? `Unexpected character: ${na(t, o)}.` : `Invalid character: ${na(t, o)}.` ); } return cn(t, ve.EOF, i, i); } function yR(t, e) { const n = t.source.body, i = n.length; let o = e + 1; for (; o < i; ) { const a = n.charCodeAt(o); if (a === 10 || a === 13) break; if (Su(a)) ++o; else if (jf(n, o)) o += 2; else break; } return cn( t, ve.COMMENT, e, o, n.slice(e + 1, o) ); } function vR(t, e, n) { const i = t.source.body; let o = e, a = n, l = !1; if (a === 45 && (a = i.charCodeAt(++o)), a === 48) { if (a = i.charCodeAt(++o), Vl(a)) throw _n( t.source, o, `Invalid number, unexpected digit after 0: ${na( t, o )}.` ); } else o = Jp(t, o, a), a = i.charCodeAt(o); if (a === 46 && (l = !0, a = i.charCodeAt(++o), o = Jp(t, o, a), a = i.charCodeAt(o)), (a === 69 || a === 101) && (l = !0, a = i.charCodeAt(++o), (a === 43 || a === 45) && (a = i.charCodeAt(++o)), o = Jp(t, o, a), a = i.charCodeAt(o)), a === 46 || Wb(a)) throw _n( t.source, o, `Invalid number, expected digit but got: ${na( t, o )}.` ); return cn( t, l ? ve.FLOAT : ve.INT, e, o, i.slice(e, o) ); } function Jp(t, e, n) { if (!Vl(n)) throw _n( t.source, e, `Invalid number, expected digit but got: ${na( t, e )}.` ); const i = t.source.body; let o = e + 1; for (; Vl(i.charCodeAt(o)); ) ++o; return o; } function kR(t, e) { const n = t.source.body, i = n.length; let o = e + 1, a = o, l = ""; for (; o < i; ) { const f = n.charCodeAt(o); if (f === 34) return l += n.slice(a, o), cn(t, ve.STRING, e, o + 1, l); if (f === 92) { l += n.slice(a, o); const p = n.charCodeAt(o + 1) === 117 ? n.charCodeAt(o + 2) === 123 ? _R(t, o) : wR(t, o) : SR(t, o); l += p.value, o += p.size, a = o; continue; } if (f === 10 || f === 13) break; if (Su(f)) ++o; else if (jf(n, o)) o += 2; else throw _n( t.source, o, `Invalid character within String: ${na( t, o )}.` ); } throw _n(t.source, o, "Unterminated string."); } function _R(t, e) { const n = t.source.body; let i = 0, o = 3; for (; o < 12; ) { const a = n.charCodeAt(e + o++); if (a === 125) { if (o < 5 || !Su(i)) break; return { value: String.fromCodePoint(i), size: o }; } if (i = i << 4 | El(a), i < 0) break; } throw _n( t.source, e, `Invalid Unicode escape sequence: "${n.slice( e, e + o )}".` ); } function wR(t, e) { const n = t.source.body, i = v_(n, e + 2); if (Su(i)) return { value: String.fromCodePoint(i), size: 6 }; if (Qb(i) && n.charCodeAt(e + 6) === 92 && n.charCodeAt(e + 7) === 117) { const o = v_(n, e + 8); if (Yb(o)) return { value: String.fromCodePoint(i, o), size: 12 }; } throw _n( t.source, e, `Invalid Unicode escape sequence: "${n.slice(e, e + 6)}".` ); } function v_(t, e) { return El(t.charCodeAt(e)) << 12 | El(t.charCodeAt(e + 1)) << 8 | El(t.charCodeAt(e + 2)) << 4 | El(t.charCodeAt(e + 3)); } function El(t) { return t >= 48 && t <= 57 ? t - 48 : t >= 65 && t <= 70 ? t - 55 : t >= 97 && t <= 102 ? t - 87 : -1; } function SR(t, e) { const n = t.source.body; switch (n.charCodeAt(e + 1)) { case 34: return { value: '"', size: 2 }; case 92: return { value: "\\", size: 2 }; case 47: return { value: "/", size: 2 }; case 98: return { value: "\b", size: 2 }; case 102: return { value: "\f", size: 2 }; case 110: return { value: ` `, size: 2 }; case 114: return { value: "\r", size: 2 }; case 116: return { value: " ", size: 2 }; } throw _n( t.source, e, `Invalid character escape sequence: "${n.slice( e, e + 2 )}".` ); } function bR(t, e) { const n = t.source.body, i = n.length; let o = t.lineStart, a = e + 3, l = a, f = ""; const p = []; for (; a < i; ) { const v = n.charCodeAt(a); if (v === 34 && n.charCodeAt(a + 1) === 34 && n.charCodeAt(a + 2) === 34) { f += n.slice(l, a), p.push(f); const k = cn( t, ve.BLOCK_STRING, e, a + 3, // Return a string of the lines joined with U+000A. dR(p).join(` `) ); return t.line += p.length - 1, t.lineStart = o, k; } if (v === 92 && n.charCodeAt(a + 1) === 34 && n.charCodeAt(a + 2) === 34 && n.charCodeAt(a + 3) === 34) { f += n.slice(l, a), l = a + 1, a += 4; continue; } if (v === 10 || v === 13) { f += n.slice(l, a), p.push(f), v === 13 && n.charCodeAt(a + 1) === 10 ? a += 2 : ++a, f = "", l = a, o = a; continue; } if (Su(v)) ++a; else if (jf(n, a)) a += 2; else throw _n( t.source, a, `Invalid character within String: ${na( t, a )}.` ); } throw _n(t.source, a, "Unterminated string."); } function ER(t, e) { const n = t.source.body, i = n.length; let o = e + 1; for (; o < i; ) { const a = n.charCodeAt(o); if (cR(a)) ++o; else break; } return cn( t, ve.NAME, e, o, n.slice(e, o) ); } const NR = 10, Xb = 2; function Fg(t) { return Uf(t, []); } function Uf(t, e) { switch (typeof t) { case "string": return JSON.stringify(t); case "function": return t.name ? `[function ${t.name}]` : "[function]"; case "object": return AR(t, e); default: return String(t); } } function AR(t, e) { if (t === null) return "null"; if (e.includes(t)) return "[Circular]"; const n = [...e, t]; if (xR(t)) { const i = t.toJSON(); if (i !== t) return typeof i == "string" ? i : Uf(i, n); } else if (Array.isArray(t)) return OR(t, n); return CR(t, n); } function xR(t) { return typeof t.toJSON == "function"; } function CR(t, e) { const n = Object.entries(t); return n.length === 0 ? "{}" : e.length > Xb ? "[" + TR(t) + "]" : "{ " + n.map( ([o, a]) => o + ": " + Uf(a, e) ).join(", ") + " }"; } function OR(t, e) { if (t.length === 0) return "[]"; if (e.length > Xb) return "[Array]"; const n = Math.min(NR, t.length), i = t.length - n, o = []; for (let a = 0; a < n; ++a) o.push(Uf(t[a], e)); return i === 1 ? o.push("... 1 more item") : i > 1 && o.push(`... ${i} more items`), "[" + o.join(", ") + "]"; } function TR(t) { const e = Object.prototype.toString.call(t).replace(/^\[object /, "").replace(/]$/, ""); if (e === "Object" && typeof t.constructor == "function") { const n = t.constructor.name; if (typeof n == "string" && n !== "") return n; } return e; } const RR = globalThis.process && // eslint-disable-next-line no-undef !0, IR = ( /* c8 ignore next 6 */ // FIXME: https://github.com/graphql/graphql-js/issues/2317 RR ? function(e, n) { return e instanceof n; } : function(e, n) { if (e instanceof n) return !0; if (typeof e == "object" && e !== null) { var i; const o = n.prototype[Symbol.toStringTag], a = ( // We still need to support constructor's name to detect conflicts with older versions of this library. Symbol.toStringTag in e ? e[Symbol.toStringTag] : (i = e.constructor) === null || i === void 0 ? void 0 : i.name ); if (o === a) { const l = Fg(e); throw new Error(`Cannot use ${o} "${l}" from another module or realm. Ensure that there is only one instance of "graphql" in the node_modules directory. If different versions of "graphql" are the dependencies of other relied on modules, use "resolutions" to ensure only one version is installed. https://yarnpkg.com/en/docs/selective-version-resolutions Duplicate "graphql" modules cannot be used at the same time since different versions may have different capabilities and behavior. The data from one version used in the function from another could produce confusing and spurious results.`); } } return !1; } ); class Jb { constructor(e, n = "GraphQL request", i = { line: 1, column: 1 }) { typeof e == "string" || Dd(!1, `Body must be a string. Received: ${Fg(e)}.`), this.body = e, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Dd( !1, "line in locationOffset is 1-indexed and must be positive." ), this.locationOffset.column > 0 || Dd( !1, "column in locationOffset is 1-indexed and must be positive." ); } get [Symbol.toStringTag]() { return "Source"; } } function PR(t) { return IR(t, Jb); } function LR(t, e) { return new DR(t, e).parseDocument(); } class DR { constructor(e, n = {}) { const i = PR(e) ? e : new Jb(e); this._lexer = new pR(i), this._options = n, this._tokenCounter = 0; } /** * Converts a name lex token into a name parse node. */ parseName() { const e = this.expectToken(ve.NAME); return this.node(e, { kind: at.NAME, value: e.value }); } // Implements the parsing rules in the Document section. /** * Document : Definition+ */ parseDocument() { return this.node(this._lexer.token, { kind: at.DOCUMENT, definitions: this.many( ve.SOF, this.parseDefinition, ve.EOF ) }); } /** * Definition : * - ExecutableDefinition * - TypeSystemDefinition * - TypeSystemExtension * * ExecutableDefinition : * - OperationDefinition * - FragmentDefinition * * TypeSystemDefinition : * - SchemaDefinition * - TypeDefinition * - DirectiveDefinition * * TypeDefinition : * - ScalarTypeDefinition * - ObjectTypeDefinition * - InterfaceTypeDefinition * - UnionTypeDefinition * - EnumTypeDefinition * - InputObjectTypeDefinition */ parseDefinition() { if (this.peek(ve.BRACE_L)) return this.parseOperationDefinition(); const e = this.peekDescription(), n = e ? this._lexer.lookahead() : this._lexer.token; if (n.kind === ve.NAME) { switch (n.value) { case "schema": return this.parseSchemaDefinition(); case "scalar": return this.parseScalarTypeDefinition(); case "type": return this.parseObjectTypeDefinition(); case "interface": return this.parseInterfaceTypeDefinition(); case "union": return this.parseUnionTypeDefinition(); case "enum": return this.parseEnumTypeDefinition(); case "input": return this.parseInputObjectTypeDefinition(); case "directive": return this.parseDirectiveDefinition(); } if (e) throw _n( this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are supported only on type definitions." ); switch (n.value) { case "query": case "mutation": case "subscription": return this.parseOperationDefinition(); case "fragment": return this.parseFragmentDefinition(); case "extend": return this.parseTypeSystemExtension(); } } throw this.unexpected(n); } // Implements the parsing rules in the Operations section. /** * OperationDefinition : * - SelectionSet * - OperationType Name? VariableDefinitions? Directives? SelectionSet */ parseOperationDefinition() { const e = this._lexer.token; if (this.peek(ve.BRACE_L)) return this.node(e, { kind: at.OPERATION_DEFINITION, operation: ru.QUERY, name: void 0, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet() }); const n = this.parseOperationType(); let i; return this.peek(ve.NAME) && (i = this.parseName()), this.node(e, { kind: at.OPERATION_DEFINITION, operation: n, name: i, variableDefinitions: this.parseVariableDefinitions(), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() }); } /** * OperationType : one of query mutation subscription */ parseOperationType() { const e = this.expectToken(ve.NAME); switch (e.value) { case "query": return ru.QUERY; case "mutation": return ru.MUTATION; case "subscription": return ru.SUBSCRIPTION; } throw this.unexpected(e); } /** * VariableDefinitions : ( VariableDefinition+ ) */ parseVariableDefinitions() { return this.optionalMany( ve.PAREN_L, this.parseVariableDefinition, ve.PAREN_R ); } /** * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? */ parseVariableDefinition() { return this.node(this._lexer.token, { kind: at.VARIABLE_DEFINITION, variable: this.parseVariable(), type: (this.expectToken(ve.COLON), this.parseTypeReference()), defaultValue: this.expectOptionalToken(ve.EQUALS) ? this.parseConstValueLiteral() : void 0, directives: this.parseConstDirectives() }); } /** * Variable : $ Name */ parseVariable() { const e = this._lexer.token; return this.expectToken(ve.DOLLAR), this.node(e, { kind: at.VARIABLE, name: this.parseName() }); } /** * ``` * SelectionSet : { Selection+ } * ``` */ parseSelectionSet() { return this.node(this._lexer.token, { kind: at.SELECTION_SET, selections: this.many( ve.BRACE_L, this.parseSelection, ve.BRACE_R ) }); } /** * Selection : * - Field * - FragmentSpread * - InlineFragment */ parseSelection() { return this.peek(ve.SPREAD) ? this.parseFragment() : this.parseField(); } /** * Field : Alias? Name Arguments? Directives? SelectionSet? * * Alias : Name : */ parseField() { const e = this._lexer.token, n = this.parseName(); let i, o; return this.expectOptionalToken(ve.COLON) ? (i = n, o = this.parseName()) : o = n, this.node(e, { kind: at.FIELD, alias: i, name: o, arguments: this.parseArguments(!1), directives: this.parseDirectives(!1), selectionSet: this.peek(ve.BRACE_L) ? this.parseSelectionSet() : void 0 }); } /** * Arguments[Const] : ( Argument[?Const]+ ) */ parseArguments(e) { const n = e ? this.parseConstArgument : this.parseArgument; return this.optionalMany(ve.PAREN_L, n, ve.PAREN_R); } /** * Argument[Const] : Name : Value[?Const] */ parseArgument(e = !1) { const n = this._lexer.token, i = this.parseName(); return this.expectToken(ve.COLON), this.node(n, { kind: at.ARGUMENT, name: i, value: this.parseValueLiteral(e) }); } parseConstArgument() { return this.parseArgument(!0); } // Implements the parsing rules in the Fragments section. /** * Corresponds to both FragmentSpread and InlineFragment in the spec. * * FragmentSpread : ... FragmentName Directives? * * InlineFragment : ... TypeCondition? Directives? SelectionSet */ parseFragment() { const e = this._lexer.token; this.expectToken(ve.SPREAD); const n = this.expectOptionalKeyword("on"); return !n && this.peek(ve.NAME) ? this.node(e, { kind: at.FRAGMENT_SPREAD, name: this.parseFragmentName(), directives: this.parseDirectives(!1) }) : this.node(e, { kind: at.INLINE_FRAGMENT, typeCondition: n ? this.parseNamedType() : void 0, directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() }); } /** * FragmentDefinition : * - fragment FragmentName on TypeCondition Directives? SelectionSet * * TypeCondition : NamedType */ parseFragmentDefinition() { const e = this._lexer.token; return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(e, { kind: at.FRAGMENT_DEFINITION, name: this.parseFragmentName(), variableDefinitions: this.parseVariableDefinitions(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() }) : this.node(e, { kind: at.FRAGMENT_DEFINITION, name: this.parseFragmentName(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() }); } /** * FragmentName : Name but not `on` */ parseFragmentName() { if (this._lexer.token.value === "on") throw this.unexpected(); return this.parseName(); } // Implements the parsing rules in the Values section. /** * Value[Const] : * - [~Const] Variable * - IntValue * - FloatValue * - StringValue * - BooleanValue * - NullValue * - EnumValue * - ListValue[?Const] * - ObjectValue[?Const] * * BooleanValue : one of `true` `false` * * NullValue : `null` * * EnumValue : Name but not `true`, `false` or `null` */ parseValueLiteral(e) { const n = this._lexer.token; switch (n.kind) { case ve.BRACKET_L: return this.parseList(e); case ve.BRACE_L: return this.parseObject(e); case ve.INT: return this.advanceLexer(), this.node(n, { kind: at.INT, value: n.value }); case ve.FLOAT: return this.advanceLexer(), this.node(n, { kind: at.FLOAT, value: n.value }); case ve.STRING: case ve.BLOCK_STRING: return this.parseStringLiteral(); case ve.NAME: switch (this.advanceLexer(), n.value) { case "true": return this.node(n, { kind: at.BOOLEAN, value: !0 }); case "false": return this.node(n, { kind: at.BOOLEAN, value: !1 }); case "null": return this.node(n, { kind: at.NULL }); default: return this.node(n, { kind: at.ENUM, value: n.value }); } case ve.DOLLAR: if (e) if (this.expectToken(ve.DOLLAR), this._lexer.token.kind === ve.NAME) { const i = this._lexer.token.value; throw _n( this._lexer.source, n.start, `Unexpected variable "$${i}" in constant value.` ); } else throw this.unexpected(n); return this.parseVariable(); default: throw this.unexpected(); } } parseConstValueLiteral() { return this.parseValueLiteral(!0); } parseStringLiteral() { const e = this._lexer.token; return this.advanceLexer(), this.node(e, { kind: at.STRING, value: e.value, block: e.kind === ve.BLOCK_STRING }); } /** * ListValue[Const] : * - [ ] * - [ Value[?Const]+ ] */ parseList(e) { const n = () => this.parseValueLiteral(e); return this.node(this._lexer.token, { kind: at.LIST, values: this.any(ve.BRACKET_L, n, ve.BRACKET_R) }); } /** * ``` * ObjectValue[Const] : * - { } * - { ObjectField[?Const]+ } * ``` */ parseObject(e) { const n = () => this.parseObjectField(e); return this.node(this._lexer.token, { kind: at.OBJECT, fields: this.any(ve.BRACE_L, n, ve.BRACE_R) }); } /** * ObjectField[Const] : Name : Value[?Const] */ parseObjectField(e) { const n = this._lexer.token, i = this.parseName(); return this.expectToken(ve.COLON), this.node(n, { kind: at.OBJECT_FIELD, name: i, value: this.parseValueLiteral(e) }); } // Implements the parsing rules in the Directives section. /** * Directives[Const] : Directive[?Const]+ */ parseDirectives(e) { const n = []; for (; this.peek(ve.AT); ) n.push(this.parseDirective(e)); return n; } parseConstDirectives() { return this.parseDirectives(!0); } /** * ``` * Directive[Const] : @ Name Arguments[?Const]? * ``` */ parseDirective(e) { const n = this._lexer.token; return this.expectToken(ve.AT), this.node(n, { kind: at.DIRECTIVE, name: this.parseName(), arguments: this.parseArguments(e) }); } // Implements the parsing rules in the Types section. /** * Type : * - NamedType * - ListType * - NonNullType */ parseTypeReference() { const e = this._lexer.token; let n; if (this.expectOptionalToken(ve.BRACKET_L)) { const i = this.parseTypeReference(); this.expectToken(ve.BRACKET_R), n = this.node(e, { kind: at.LIST_TYPE, type: i }); } else n = this.parseNamedType(); return this.expectOptionalToken(ve.BANG) ? this.node(e, { kind: at.NON_NULL_TYPE, type: n }) : n; } /** * NamedType : Name */ parseNamedType() { return this.node(this._lexer.token, { kind: at.NAMED_TYPE, name: this.parseName() }); } // Implements the parsing rules in the Type Definition section. peekDescription() { return this.peek(ve.STRING) || this.peek(ve.BLOCK_STRING); } /** * Description : StringValue */ parseDescription() { if (this.peekDescription()) return this.parseStringLiteral(); } /** * ``` * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } * ``` */ parseSchemaDefinition() { const e = this._lexer.token, n = this.parseDescription(); this.expectKeyword("schema"); const i = this.parseConstDirectives(), o = this.many( ve.BRACE_L, this.parseOperationTypeDefinition, ve.BRACE_R ); return this.node(e, { kind: at.SCHEMA_DEFINITION, description: n, directives: i, operationTypes: o }); } /** * OperationTypeDefinition : OperationType : NamedType */ parseOperationTypeDefinition() { const e = this._lexer.token, n = this.parseOperationType(); this.expectToken(ve.COLON); const i = this.parseNamedType(); return this.node(e, { kind: at.OPERATION_TYPE_DEFINITION, operation: n, type: i }); } /** * ScalarTypeDefinition : Description? scalar Name Directives[Const]? */ parseScalarTypeDefinition() { const e = this._lexer.token, n = this.parseDescription(); this.expectKeyword("scalar"); const i = this.parseName(), o = this.parseConstDirectives(); return this.node(e, { kind: at.SCALAR_TYPE_DEFINITION, description: n, name: i, directives: o }); } /** * ObjectTypeDefinition : * Description? * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? */ parseObjectTypeDefinition() { const e = this._lexer.token, n = this.parseDescription(); this.expectKeyword("type"); const i = this.parseName(), o = this.parseImplementsInterfaces(), a = this.parseConstDirectives(), l = this.parseFieldsDefinition(); return this.node(e, { kind: at.OBJECT_TYPE_DEFINITION, description: n, name: i, interfaces: o, directives: a, fields: l }); } /** * ImplementsInterfaces : * - implements `&`? NamedType * - ImplementsInterfaces & NamedType */ parseImplementsInterfaces() { return this.expectOptionalKeyword("implements") ? this.delimitedMany(ve.AMP, this.parseNamedType) : []; } /** * ``` * FieldsDefinition : { FieldDefinition+ } * ``` */ parseFieldsDefinition() { return this.optionalMany( ve.BRACE_L, this.parseFieldDefinition, ve.BRACE_R ); } /** * FieldDefinition : * - Description? Name ArgumentsDefinition? : Type Directives[Const]? */ parseFieldDefinition() { const e = this._lexer.token, n = this.parseDescription(), i = this.parseName(), o = this.parseArgumentDefs(); this.expectToken(ve.COLON); const a = this.parseTypeReference(), l = this.parseConstDirectives(); return this.node(e, { kind: at.FIELD_DEFINITION, description: n, name: i, arguments: o, type: a, directives: l }); } /** * ArgumentsDefinition : ( InputValueDefinition+ ) */ parseArgumentDefs() { return this.optionalMany( ve.PAREN_L, this.parseInputValueDef, ve.PAREN_R ); } /** * InputValueDefinition : * - Description? Name : Type DefaultValue? Directives[Const]? */ parseInputValueDef() { const e = this._lexer.token, n = this.parseDescription(), i = this.parseName(); this.expectToken(ve.COLON); const o = this.parseTypeReference(); let a; this.expectOptionalToken(ve.EQUALS) && (a = this.parseConstValueLiteral()); const l = this.parseConstDirectives(); return this.node(e, { kind: at.INPUT_VALUE_DEFINITION, description: n, name: i, type: o, defaultValue: a, directives: l }); } /** * InterfaceTypeDefinition : * - Description? interface Name Directives[Const]? FieldsDefinition? */ parseInterfaceTypeDefinition() { const e = this._lexer.token, n = this.parseDescription(); this.expectKeyword("interface"); const i = this.parseName(), o = this.parseImplementsInterfaces(), a = this.parseConstDirectives(), l = this.parseFieldsDefinition(); return this.node(e, { kind: at.INTERFACE_TYPE_DEFINITION, description: n, name: i, interfaces: o, directives: a, fields: l }); } /** * UnionTypeDefinition : * - Description? union Name Directives[Const]? UnionMemberTypes? */ parseUnionTypeDefinition() { const e = this._lexer.token, n = this.parseDescription(); this.expectKeyword("union"); const i = this.parseName(), o = this.parseConstDirectives(), a = this.parseUnionMemberTypes(); return this.node(e, { kind: at.UNION_TYPE_DEFINITION, description: n, name: i, directives: o, types: a }); } /** * UnionMemberTypes : * - = `|`? NamedType * - UnionMemberTypes | NamedType */ parseUnionMemberTypes() { return this.expectOptionalToken(ve.EQUALS) ? this.delimitedMany(ve.PIPE, this.parseNamedType) : []; } /** * EnumTypeDefinition : * - Description? enum Name Directives[Const]? EnumValuesDefinition? */ parseEnumTypeDefinition() { const e = this._lexer.token, n = this.parseDescription(); this.expectKeyword("enum"); const i = this.parseName(), o = this.parseConstDirectives(), a = this.parseEnumValuesDefinition(); return this.node(e, { kind: at.ENUM_TYPE_DEFINITION, description: n, name: i, directives: o, values: a }); } /** * ``` * EnumValuesDefinition : { EnumValueDefinition+ } * ``` */ parseEnumValuesDefinition() { return this.optionalMany( ve.BRACE_L, this.parseEnumValueDefinition, ve.BRACE_R ); } /** * EnumValueDefinition : Description? EnumValue Directives[Const]? */ parseEnumValueDefinition() { const e = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), o = this.parseConstDirectives(); return this.node(e, { kind: at.ENUM_VALUE_DEFINITION, description: n, name: i, directives: o }); } /** * EnumValue : Name but not `true`, `false` or `null` */ parseEnumValueName() { if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw _n( this._lexer.source, this._lexer.token.start, `${Sd( this._lexer.token )} is reserved and cannot be used for an enum value.` ); return this.parseName(); } /** * InputObjectTypeDefinition : * - Description? input Name Directives[Const]? InputFieldsDefinition? */ parseInputObjectTypeDefinition() { const e = this._lexer.token, n = this.parseDescription(); this.expectKeyword("input"); const i = this.parseName(), o = this.parseConstDirectives(), a = this.parseInputFieldsDefinition(); return this.node(e, { kind: at.INPUT_OBJECT_TYPE_DEFINITION, description: n, name: i, directives: o, fields: a }); } /** * ``` * InputFieldsDefinition : { InputValueDefinition+ } * ``` */ parseInputFieldsDefinition() { return this.optionalMany( ve.BRACE_L, this.parseInputValueDef, ve.BRACE_R ); } /** * TypeSystemExtension : * - SchemaExtension * - TypeExtension * * TypeExtension : * - ScalarTypeExtension * - ObjectTypeExtension * - InterfaceTypeExtension * - UnionTypeExtension * - EnumTypeExtension * - InputObjectTypeDefinition */ parseTypeSystemExtension() { const e = this._lexer.lookahead(); if (e.kind === ve.NAME) switch (e.value) { case "schema": return this.parseSchemaExtension(); case "scalar": return this.parseScalarTypeExtension(); case "type": return this.parseObjectTypeExtension(); case "interface": return this.parseInterfaceTypeExtension(); case "union": return this.parseUnionTypeExtension(); case "enum": return this.parseEnumTypeExtension(); case "input": return this.parseInputObjectTypeExtension(); } throw this.unexpected(e); } /** * ``` * SchemaExtension : * - extend schema Directives[Const]? { OperationTypeDefinition+ } * - extend schema Directives[Const] * ``` */ parseSchemaExtension() { const e = this._lexer.token; this.expectKeyword("extend"), this.expectKeyword("schema"); const n = this.parseConstDirectives(), i = this.optionalMany( ve.BRACE_L, this.parseOperationTypeDefinition, ve.BRACE_R ); if (n.length === 0 && i.length === 0) throw this.unexpected(); return this.node(e, { kind: at.SCHEMA_EXTENSION, directives: n, operationTypes: i }); } /** * ScalarTypeExtension : * - extend scalar Name Directives[Const] */ parseScalarTypeExtension() { const e = this._lexer.token; this.expectKeyword("extend"), this.expectKeyword("scalar"); const n = this.parseName(), i = this.parseConstDirectives(); if (i.length === 0) throw this.unexpected(); return this.node(e, { kind: at.SCALAR_TYPE_EXTENSION, name: n, directives: i }); } /** * ObjectTypeExtension : * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition * - extend type Name ImplementsInterfaces? Directives[Const] * - extend type Name ImplementsInterfaces */ parseObjectTypeExtension() { const e = this._lexer.token; this.expectKeyword("extend"), this.expectKeyword("type"); const n = this.parseName(), i = this.parseImplementsInterfaces(), o = this.parseConstDirectives(), a = this.parseFieldsDefinition(); if (i.length === 0 && o.length === 0 && a.length === 0) throw this.unexpected(); return this.node(e, { kind: at.OBJECT_TYPE_EXTENSION, name: n, interfaces: i, directives: o, fields: a }); } /** * InterfaceTypeExtension : * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition * - extend interface Name ImplementsInterfaces? Directives[Const] * - extend interface Name ImplementsInterfaces */ parseInterfaceTypeExtension() { const e = this._lexer.token; this.expectKeyword("extend"), this.expectKeyword("interface"); const n = this.parseName(), i = this.parseImplementsInterfaces(), o = this.parseConstDirectives(), a = this.parseFieldsDefinition(); if (i.length === 0 && o.length === 0 && a.length === 0) throw this.unexpected(); return this.node(e, { kind: at.INTERFACE_TYPE_EXTENSION, name: n, interfaces: i, directives: o, fields: a }); } /** * UnionTypeExtension : * - extend union Name Directives[Const]? UnionMemberTypes * - extend union Name Directives[Const] */ parseUnionTypeExtension() { const e = this._lexer.token; this.expectKeyword("extend"), this.expectKeyword("union"); const n = this.parseName(), i = this.parseConstDirectives(), o = this.parseUnionMemberTypes(); if (i.length === 0 && o.length === 0) throw this.unexpected(); return this.node(e, { kind: at.UNION_TYPE_EXTENSION, name: n, directives: i, types: o }); } /** * EnumTypeExtension : * - extend enum Name Directives[Const]? EnumValuesDefinition * - extend enum Name Directives[Const] */ parseEnumTypeExtension() { const e = this._lexer.token; this.expectKeyword("extend"), this.expectKeyword("enum"); const n = this.parseName(), i = this.parseConstDirectives(), o = this.parseEnumValuesDefinition(); if (i.length === 0 && o.length === 0) throw this.unexpected(); return this.node(e, { kind: at.ENUM_TYPE_EXTENSION, name: n, directives: i, values: o }); } /** * InputObjectTypeExtension : * - extend input Name Directives[Const]? InputFieldsDefinition * - extend input Name Directives[Const] */ parseInputObjectTypeExtension() { const e = this._lexer.token; this.expectKeyword("extend"), this.expectKeyword("input"); const n = this.parseName(), i = this.parseConstDirectives(), o = this.parseInputFieldsDefinition(); if (i.length === 0 && o.length === 0) throw this.unexpected(); return this.node(e, { kind: at.INPUT_OBJECT_TYPE_EXTENSION, name: n, directives: i, fields: o }); } /** * ``` * DirectiveDefinition : * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations * ``` */ parseDirectiveDefinition() { const e = this._lexer.token, n = this.parseDescription(); this.expectKeyword("directive"), this.expectToken(ve.AT); const i = this.parseName(), o = this.parseArgumentDefs(), a = this.expectOptionalKeyword("repeatable"); this.expectKeyword("on"); const l = this.parseDirectiveLocations(); return this.node(e, { kind: at.DIRECTIVE_DEFINITION, description: n, name: i, arguments: o, repeatable: a, locations: l }); } /** * DirectiveLocations : * - `|`? DirectiveLocation * - DirectiveLocations | DirectiveLocation */ parseDirectiveLocations() { return this.delimitedMany(ve.PIPE, this.parseDirectiveLocation); } /* * DirectiveLocation : * - ExecutableDirectiveLocation * - TypeSystemDirectiveLocation * * ExecutableDirectiveLocation : one of * `QUERY` * `MUTATION` * `SUBSCRIPTION` * `FIELD` * `FRAGMENT_DEFINITION` * `FRAGMENT_SPREAD` * `INLINE_FRAGMENT` * * TypeSystemDirectiveLocation : one of * `SCHEMA` * `SCALAR` * `OBJECT` * `FIELD_DEFINITION` * `ARGUMENT_DEFINITION` * `INTERFACE` * `UNION` * `ENUM` * `ENUM_VALUE` * `INPUT_OBJECT` * `INPUT_FIELD_DEFINITION` */ parseDirectiveLocation() { const e = this._lexer.token, n = this.parseName(); if (Object.prototype.hasOwnProperty.call(Gm, n.value)) return n; throw this.unexpected(e); } // Core parsing utility functions /** * Returns a node that, if configured to do so, sets a "loc" field as a * location object, used to identify the place in the source that created a * given parsed object. */ node(e, n) { return this._options.noLocation !== !0 && (n.loc = new uR( e, this._lexer.lastToken, this._lexer.source )), n; } /** * Determines if the next token is of a given kind */ peek(e) { return this._lexer.token.kind === e; } /** * If the next token is of the given kind, return that token after advancing the lexer. * Otherwise, do not change the parser state and throw an error. */ expectToken(e) { const n = this._lexer.token; if (n.kind === e) return this.advanceLexer(), n; throw _n( this._lexer.source, n.start, `Expected ${Zb(e)}, found ${Sd(n)}.` ); } /** * If the next token is of the given kind, return "true" after advancing the lexer. * Otherwise, do not change the parser state and return "false". */ expectOptionalToken(e) { return this._lexer.token.kind === e ? (this.advanceLexer(), !0) : !1; } /** * If the next token is a given keyword, advance the lexer. * Otherwise, do not change the parser state and throw an error. */ expectKeyword(e) { const n = this._lexer.token; if (n.kind === ve.NAME && n.value === e) this.advanceLexer(); else throw _n( this._lexer.source, n.start, `Expected "${e}", found ${Sd(n)}.` ); } /** * If the next token is a given keyword, return "true" after advancing the lexer. * Otherwise, do not change the parser state and return "false". */ expectOptionalKeyword(e) { const n = this._lexer.token; return n.kind === ve.NAME && n.value === e ? (this.advanceLexer(), !0) : !1; } /** * Helper function for creating an error when an unexpected lexed token is encountered. */ unexpected(e) { const n = e ?? this._lexer.token; return _n( this._lexer.source, n.start, `Unexpected ${Sd(n)}.` ); } /** * Returns a possibly empty list of parse nodes, determined by the parseFn. * This list begins with a lex token of openKind and ends with a lex token of closeKind. * Advances the parser to the next lex token after the closing token. */ any(e, n, i) { this.expectToken(e); const o = []; for (; !this.expectOptionalToken(i); ) o.push(n.call(this)); return o; } /** * Returns a list of parse nodes, determined by the parseFn. * It can be empty only if open token is missing otherwise it will always return non-empty list * that begins with a lex token of openKind and ends with a lex token of closeKind. * Advances the parser to the next lex token after the closing token. */ optionalMany(e, n, i) { if (this.expectOptionalToken(e)) { const o = []; do o.push(n.call(this)); while (!this.expectOptionalToken(i)); return o; } return []; } /** * Returns a non-empty list of parse nodes, determined by the parseFn. * This list begins with a lex token of openKind and ends with a lex token of closeKind. * Advances the parser to the next lex token after the closing token. */ many(e, n, i) { this.expectToken(e); const o = []; do o.push(n.call(this)); while (!this.expectOptionalToken(i)); return o; } /** * Returns a non-empty list of parse nodes, determined by the parseFn. * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. * Advances the parser to the next lex token after last item in the list. */ delimitedMany(e, n) { this.expectOptionalToken(e); const i = []; do i.push(n.call(this)); while (this.expectOptionalToken(e)); return i; } advanceLexer() { const { maxTokens: e } = this._options, n = this._lexer.advance(); if (e !== void 0 && n.kind !== ve.EOF && (++this._tokenCounter, this._tokenCounter > e)) throw _n( this._lexer.source, n.start, `Document contains more that ${e} tokens. Parsing aborted.` ); } } function Sd(t) { const e = t.value; return Zb(t.kind) + (e != null ? ` "${e}"` : ""); } function Zb(t) { return mR(t) ? `"${t}"` : t; } function FR(t) { return `"${t.replace(MR, $R)}"`; } const MR = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g; function $R(t) { return jR[t.charCodeAt(0)]; } const jR = [ "\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\u000B", "\\f", "\\r", "\\u000E", "\\u000F", "\\u0010", "\\u0011", "\\u0012", "\\u0013", "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", "\\u001A", "\\u001B", "\\u001C", "\\u001D", "\\u001E", "\\u001F", "", "", '\\"', "", "", "", "", "", "", "", "", "", "", "", "", "", // 2F "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", // 3F "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", // 4F "", "", "", "", "", "", "", "", "", "", "", "", "\\\\", "", "", "", // 5F "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", // 6F "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "\\u007F", "\\u0080", "\\u0081", "\\u0082", "\\u0083", "\\u0084", "\\u0085", "\\u0086", "\\u0087", "\\u0088", "\\u0089", "\\u008A", "\\u008B", "\\u008C", "\\u008D", "\\u008E", "\\u008F", "\\u0090", "\\u0091", "\\u0092", "\\u0093", "\\u0094", "\\u0095", "\\u0096", "\\u0097", "\\u0098", "\\u0099", "\\u009A", "\\u009B", "\\u009C", "\\u009D", "\\u009E", "\\u009F" ], UR = Object.freeze({}); function BR(t, e, n = Kb) { const i = /* @__PURE__ */ new Map(); for (const $ of Object.values(at)) i.set($, VR(e, $)); let o, a = Array.isArray(t), l = [t], f = -1, p = [], v = t, k, b; const w = [], T = []; do { f++; const $ = f === l.length, J = $ && p.length !== 0; if ($) { if (k = T.length === 0 ? void 0 : w[w.length - 1], v = b, b = T.pop(), J) if (a) { v = v.slice(); let ne = 0; for (const [he, ye] of p) { const me = he - ne; ye === null ? (v.splice(me, 1), ne++) : v[me] = ye; } } else { v = Object.defineProperties( {}, Object.getOwnPropertyDescriptors(v) ); for (const [ne, he] of p) v[ne] = he; } f = o.index, l = o.keys, p = o.edits, a = o.inArray, o = o.prev; } else if (b) { if (k = a ? f : l[f], v = b[k], v == null) continue; w.push(k); } let le; if (!Array.isArray(v)) { var O, x; y_(v) || Dd(!1, `Invalid AST Node: ${Fg(v)}.`); const ne = $ ? (O = i.get(v.kind)) === null || O === void 0 ? void 0 : O.leave : (x = i.get(v.kind)) === null || x === void 0 ? void 0 : x.enter; if (le = ne == null ? void 0 : ne.call(e, v, k, b, w, T), le === UR) break; if (le === !1) { if (!$) { w.pop(); continue; } } else if (le !== void 0 && (p.push([k, le]), !$)) if (y_(le)) v = le; else { w.pop(); continue; } } if (le === void 0 && J && p.push([k, v]), $) w.pop(); else { var C; o = { inArray: a, index: f, keys: l, edits: p, prev: o }, a = Array.isArray(v), l = a ? v : (C = n[v.kind]) !== null && C !== void 0 ? C : [], f = -1, p = [], b && T.push(b), b = v; } } while (o !== void 0); return p.length !== 0 ? p[p.length - 1][1] : t; } function VR(t, e) { const n = t[e]; return typeof n == "object" ? n : typeof n == "function" ? { enter: n, leave: void 0 } : { enter: t.enter, leave: t.leave }; } function zR(t) { return BR(t, qR); } const HR = 80, qR = { Name: { leave: (t) => t.value }, Variable: { leave: (t) => "$" + t.name }, // Document Document: { leave: (t) => Qe(t.definitions, ` `) }, OperationDefinition: { leave(t) { const e = St("(", Qe(t.variableDefinitions, ", "), ")"), n = Qe( [ t.operation, Qe([t.name, e]), Qe(t.directives, " ") ], " " ); return (n === "query" ? "" : n + " ") + t.selectionSet; } }, VariableDefinition: { leave: ({ variable: t, type: e, defaultValue: n, directives: i }) => t + ": " + e + St(" = ", n) + St(" ", Qe(i, " ")) }, SelectionSet: { leave: ({ selections: t }) => Wr(t) }, Field: { leave({ alias: t, name: e, arguments: n, directives: i, selectionSet: o }) { const a = St("", t, ": ") + e; let l = a + St("(", Qe(n, ", "), ")"); return l.length > HR && (l = a + St(`( `, Fd(Qe(n, ` `)), ` )`)), Qe([l, Qe(i, " "), o], " "); } }, Argument: { leave: ({ name: t, value: e }) => t + ": " + e }, // Fragments FragmentSpread: { leave: ({ name: t, directives: e }) => "..." + t + St(" ", Qe(e, " ")) }, InlineFragment: { leave: ({ typeCondition: t, directives: e, selectionSet: n }) => Qe( [ "...", St("on ", t), Qe(e, " "), n ], " " ) }, FragmentDefinition: { leave: ({ name: t, typeCondition: e, variableDefinitions: n, directives: i, selectionSet: o }) => ( // or removed in the future. `fragment ${t}${St("(", Qe(n, ", "), ")")} on ${e} ${St("", Qe(i, " "), " ")}` + o ) }, // Value IntValue: { leave: ({ value: t }) => t }, FloatValue: { leave: ({ value: t }) => t }, StringValue: { leave: ({ value: t, block: e }) => e ? hR(t) : FR(t) }, BooleanValue: { leave: ({ value: t }) => t ? "true" : "false" }, NullValue: { leave: () => "null" }, EnumValue: { leave: ({ value: t }) => t }, ListValue: { leave: ({ values: t }) => "[" + Qe(t, ", ") + "]" }, ObjectValue: { leave: ({ fields: t }) => "{" + Qe(t, ", ") + "}" }, ObjectField: { leave: ({ name: t, value: e }) => t + ": " + e }, // Directive Directive: { leave: ({ name: t, arguments: e }) => "@" + t + St("(", Qe(e, ", "), ")") }, // Type NamedType: { leave: ({ name: t }) => t }, ListType: { leave: ({ type: t }) => "[" + t + "]" }, NonNullType: { leave: ({ type: t }) => t + "!" }, // Type System Definitions SchemaDefinition: { leave: ({ description: t, directives: e, operationTypes: n }) => St("", t, ` `) + Qe(["schema", Qe(e, " "), Wr(n)], " ") }, OperationTypeDefinition: { leave: ({ operation: t, type: e }) => t + ": " + e }, ScalarTypeDefinition: { leave: ({ description: t, name: e, directives: n }) => St("", t, ` `) + Qe(["scalar", e, Qe(n, " ")], " ") }, ObjectTypeDefinition: { leave: ({ description: t, name: e, interfaces: n, directives: i, fields: o }) => St("", t, ` `) + Qe( [ "type", e, St("implements ", Qe(n, " & ")), Qe(i, " "), Wr(o) ], " " ) }, FieldDefinition: { leave: ({ description: t, name: e, arguments: n, type: i, directives: o }) => St("", t, ` `) + e + (k_(n) ? St(`( `, Fd(Qe(n, ` `)), ` )`) : St("(", Qe(n, ", "), ")")) + ": " + i + St(" ", Qe(o, " ")) }, InputValueDefinition: { leave: ({ description: t, name: e, type: n, defaultValue: i, directives: o }) => St("", t, ` `) + Qe( [e + ": " + n, St("= ", i), Qe(o, " ")], " " ) }, InterfaceTypeDefinition: { leave: ({ description: t, name: e, interfaces: n, directives: i, fields: o }) => St("", t, ` `) + Qe( [ "interface", e, St("implements ", Qe(n, " & ")), Qe(i, " "), Wr(o) ], " " ) }, UnionTypeDefinition: { leave: ({ description: t, name: e, directives: n, types: i }) => St("", t, ` `) + Qe( ["union", e, Qe(n, " "), St("= ", Qe(i, " | "))], " " ) }, EnumTypeDefinition: { leave: ({ description: t, name: e, directives: n, values: i }) => St("", t, ` `) + Qe(["enum", e, Qe(n, " "), Wr(i)], " ") }, EnumValueDefinition: { leave: ({ description: t, name: e, directives: n }) => St("", t, ` `) + Qe([e, Qe(n, " ")], " ") }, InputObjectTypeDefinition: { leave: ({ description: t, name: e, directives: n, fields: i }) => St("", t, ` `) + Qe(["input", e, Qe(n, " "), Wr(i)], " ") }, DirectiveDefinition: { leave: ({ description: t, name: e, arguments: n, repeatable: i, locations: o }) => St("", t, ` `) + "directive @" + e + (k_(n) ? St(`( `, Fd(Qe(n, ` `)), ` )`) : St("(", Qe(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + Qe(o, " | ") }, SchemaExtension: { leave: ({ directives: t, operationTypes: e }) => Qe( ["extend schema", Qe(t, " "), Wr(e)], " " ) }, ScalarTypeExtension: { leave: ({ name: t, directives: e }) => Qe(["extend scalar", t, Qe(e, " ")], " ") }, ObjectTypeExtension: { leave: ({ name: t, interfaces: e, directives: n, fields: i }) => Qe( [ "extend type", t, St("implements ", Qe(e, " & ")), Qe(n, " "), Wr(i) ], " " ) }, InterfaceTypeExtension: { leave: ({ name: t, interfaces: e, directives: n, fields: i }) => Qe( [ "extend interface", t, St("implements ", Qe(e, " & ")), Qe(n, " "), Wr(i) ], " " ) }, UnionTypeExtension: { leave: ({ name: t, directives: e, types: n }) => Qe( [ "extend union", t, Qe(e, " "), St("= ", Qe(n, " | ")) ], " " ) }, EnumTypeExtension: { leave: ({ name: t, directives: e, values: n }) => Qe(["extend enum", t, Qe(e, " "), Wr(n)], " ") }, InputObjectTypeExtension: { leave: ({ name: t, directives: e, fields: n }) => Qe(["extend input", t, Qe(e, " "), Wr(n)], " ") } }; function Qe(t, e = "") { var n; return (n = t == null ? void 0 : t.filter((i) => i).join(e)) !== null && n !== void 0 ? n : ""; } function Wr(t) { return St(`{ `, Fd(Qe(t, ` `)), ` }`); } function St(t, e, n = "") { return e != null && e !== "" ? t + e + n : ""; } function Fd(t) { return St(" ", t.replace(/\n/g, ` `)); } function k_(t) { var e; return (e = t == null ? void 0 : t.some((n) => n.includes(` `))) !== null && e !== void 0 ? e : !1; } const __ = (t) => { var i, o; let e; const n = t.definitions.filter((a) => a.kind === "OperationDefinition"); return n.length === 1 && (e = (o = (i = n[0]) == null ? void 0 : i.name) == null ? void 0 : o.value), e; }, Zp = (t) => { if (typeof t == "string") { let n; try { const i = LR(t); n = __(i); } catch { } return { query: t, operationName: n }; } const e = __(t); return { query: zR(t), operationName: e }; }; class Ol extends Error { constructor(e, n) { const i = `${Ol.extractMessage(e)}: ${JSON.stringify({ response: e, request: n })}`; super(i), Object.setPrototypeOf(this, Ol.prototype), this.response = e, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, Ol); } static extractMessage(e) { var n, i; return ((i = (n = e.errors) == null ? void 0 : n[0]) == null ? void 0 : i.message) ?? `GraphQL Error (Code: ${e.status})`; } } var Nl = { exports: {} }, KR = Nl.exports, w_; function GR() { return w_ || (w_ = 1, function(t, e) { var n = typeof self < "u" ? self : KR, i = function() { function a() { this.fetch = !1, this.DOMException = n.DOMException; } return a.prototype = n, new a(); }(); (function(a) { (function(l) { var f = { searchParams: "URLSearchParams" in a, iterable: "Symbol" in a && "iterator" in Symbol, blob: "FileReader" in a && "Blob" in a && function() { try { return new Blob(), !0; } catch { return !1; } }(), formData: "FormData" in a, arrayBuffer: "ArrayBuffer" in a }; function p(W) { return W && DataView.prototype.isPrototypeOf(W); } if (f.arrayBuffer) var v = [ "[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]" ], k = ArrayBuffer.isView || function(W) { return W && v.indexOf(Object.prototype.toString.call(W)) > -1; }; function b(W) { if (typeof W != "string" && (W = String(W)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(W)) throw new TypeError("Invalid character in header field name"); return W.toLowerCase(); } function w(W) { return typeof W != "string" && (W = String(W)), W; } function T(W) { var L = { next: function() { var oe = W.shift(); return { done: oe === void 0, value: oe }; } }; return f.iterable && (L[Symbol.iterator] = function() { return L; }), L; } function O(W) { this.map = {}, W instanceof O ? W.forEach(function(L, oe) { this.append(oe, L); }, this) : Array.isArray(W) ? W.forEach(function(L) { this.append(L[0], L[1]); }, this) : W && Object.getOwnPropertyNames(W).forEach(function(L) { this.append(L, W[L]); }, this); } O.prototype.append = function(W, L) { W = b(W), L = w(L); var oe = this.map[W]; this.map[W] = oe ? oe + ", " + L : L; }, O.prototype.delete = function(W) { delete this.map[b(W)]; }, O.prototype.get = function(W) { return W = b(W), this.has(W) ? this.map[W] : null; }, O.prototype.has = function(W) { return this.map.hasOwnProperty(b(W)); }, O.prototype.set = function(W, L) { this.map[b(W)] = w(L); }, O.prototype.forEach = function(W, L) { for (var oe in this.map) this.map.hasOwnProperty(oe) && W.call(L, this.map[oe], oe, this); }, O.prototype.keys = function() { var W = []; return this.forEach(function(L, oe) { W.push(oe); }), T(W); }, O.prototype.values = function() { var W = []; return this.forEach(function(L) { W.push(L); }), T(W); }, O.prototype.entries = function() { var W = []; return this.forEach(function(L, oe) { W.push([oe, L]); }), T(W); }, f.iterable && (O.prototype[Symbol.iterator] = O.prototype.entries); function x(W) { if (W.bodyUsed) return Promise.reject(new TypeError("Already read")); W.bodyUsed = !0; } function C(W) { return new Promise(function(L, oe) { W.onload = function() { L(W.result); }, W.onerror = function() { oe(W.error); }; }); } function $(W) { var L = new FileReader(), oe = C(L); return L.readAsArrayBuffer(W), oe; } function J(W) { var L = new FileReader(), oe = C(L); return L.readAsText(W), oe; } function le(W) { for (var L = new Uint8Array(W), oe = new Array(L.length), ge = 0; ge < L.length; ge++) oe[ge] = String.fromCharCode(L[ge]); return oe.join(""); } function ne(W) { if (W.slice) return W.slice(0); var L = new Uint8Array(W.byteLength); return L.set(new Uint8Array(W)), L.buffer; } function he() { return this.bodyUsed = !1, this._initBody = function(W) { this._bodyInit = W, W ? typeof W == "string" ? this._bodyText = W : f.blob && Blob.prototype.isPrototypeOf(W) ? this._bodyBlob = W : f.formData && FormData.prototype.isPrototypeOf(W) ? this._bodyFormData = W : f.searchParams && URLSearchParams.prototype.isPrototypeOf(W) ? this._bodyText = W.toString() : f.arrayBuffer && f.blob && p(W) ? (this._bodyArrayBuffer = ne(W.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : f.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(W) || k(W)) ? this._bodyArrayBuffer = ne(W) : this._bodyText = W = Object.prototype.toString.call(W) : this._bodyText = "", this.headers.get("content-type") || (typeof W == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : f.searchParams && URLSearchParams.prototype.isPrototypeOf(W) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8")); }, f.blob && (this.blob = function() { var W = x(this); if (W) return W; if (this._bodyBlob) return Promise.resolve(this._bodyBlob); if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer])); if (this._bodyFormData) throw new Error("could not read FormData body as blob"); return Promise.resolve(new Blob([this._bodyText])); }, this.arrayBuffer = function() { return this._bodyArrayBuffer ? x(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then($); }), this.text = function() { var W = x(this); if (W) return W; if (this._bodyBlob) return J(this._bodyBlob); if (this._bodyArrayBuffer) return Promise.resolve(le(this._bodyArrayBuffer)); if (this._bodyFormData) throw new Error("could not read FormData body as text"); return Promise.resolve(this._bodyText); }, f.formData && (this.formData = function() { return this.text().then(Re); }), this.json = function() { return this.text().then(JSON.parse); }, this; } var ye = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"]; function me(W) { var L = W.toUpperCase(); return ye.indexOf(L) > -1 ? L : W; } function Fe(W, L) { L = L || {}; var oe = L.body; if (W instanceof Fe) { if (W.bodyUsed) throw new TypeError("Already read"); this.url = W.url, this.credentials = W.credentials, L.headers || (this.headers = new O(W.headers)), this.method = W.method, this.mode = W.mode, this.signal = W.signal, !oe && W._bodyInit != null && (oe = W._bodyInit, W.bodyUsed = !0); } else this.url = String(W); if (this.credentials = L.credentials || this.credentials || "same-origin", (L.headers || !this.headers) && (this.headers = new O(L.headers)), this.method = me(L.method || this.method || "GET"), this.mode = L.mode || this.mode || null, this.signal = L.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && oe) throw new TypeError("Body not allowed for GET or HEAD requests"); this._initBody(oe); } Fe.prototype.clone = function() { return new Fe(this, { body: this._bodyInit }); }; function Re(W) { var L = new FormData(); return W.trim().split("&").forEach(function(oe) { if (oe) { var ge = oe.split("="), te = ge.shift().replace(/\+/g, " "), ue = ge.join("=").replace(/\+/g, " "); L.append(decodeURIComponent(te), decodeURIComponent(ue)); } }), L; } function ut(W) { var L = new O(), oe = W.replace(/\r?\n[\t ]+/g, " "); return oe.split(/\r?\n/).forEach(function(ge) { var te = ge.split(":"), ue = te.shift().trim(); if (ue) { var M = te.join(":").trim(); L.append(ue, M); } }), L; } he.call(Fe.prototype); function He(W, L) { L || (L = {}), this.type = "default", this.status = L.status === void 0 ? 200 : L.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in L ? L.statusText : "OK", this.headers = new O(L.headers), this.url = L.url || "", this._initBody(W); } he.call(He.prototype), He.prototype.clone = function() { return new He(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new O(this.headers), url: this.url }); }, He.error = function() { var W = new He(null, { status: 0, statusText: "" }); return W.type = "error", W; }; var We = [301, 302, 303, 307, 308]; He.redirect = function(W, L) { if (We.indexOf(L) === -1) throw new RangeError("Invalid status code"); return new He(null, { status: L, headers: { location: W } }); }, l.DOMException = a.DOMException; try { new l.DOMException(); } catch { l.DOMException = function(L, oe) { this.message = L, this.name = oe; var ge = Error(L); this.stack = ge.stack; }, l.DOMException.prototype = Object.create(Error.prototype), l.DOMException.prototype.constructor = l.DOMException; } function ot(W, L) { return new Promise(function(oe, ge) { var te = new Fe(W, L); if (te.signal && te.signal.aborted) return ge(new l.DOMException("Aborted", "AbortError")); var ue = new XMLHttpRequest(); function M() { ue.abort(); } ue.onload = function() { var D = { status: ue.status, statusText: ue.statusText, headers: ut(ue.getAllResponseHeaders() || "") }; D.url = "responseURL" in ue ? ue.responseURL : D.headers.get("X-Request-URL"); var ae = "response" in ue ? ue.response : ue.responseText; oe(new He(ae, D)); }, ue.onerror = function() { ge(new TypeError("Network request failed")); }, ue.ontimeout = function() { ge(new TypeError("Network request failed")); }, ue.onabort = function() { ge(new l.DOMException("Aborted", "AbortError")); }, ue.open(te.method, te.url, !0), te.credentials === "include" ? ue.withCredentials = !0 : te.credentials === "omit" && (ue.withCredentials = !1), "responseType" in ue && f.blob && (ue.responseType = "blob"), te.headers.forEach(function(D, ae) { ue.setRequestHeader(ae, D); }), te.signal && (te.signal.addEventListener("abort", M), ue.onreadystatechange = function() { ue.readyState === 4 && te.signal.removeEventListener("abort", M); }), ue.send(typeof te._bodyInit > "u" ? null : te._bodyInit); }); } return ot.polyfill = !0, a.fetch || (a.fetch = ot, a.Headers = O, a.Request = Fe, a.Response = He), l.Headers = O, l.Request = Fe, l.Response = He, l.fetch = ot, Object.defineProperty(l, "__esModule", { value: !0 }), l; })({}); })(i), i.fetch.ponyfill = !0, delete i.fetch.polyfill; var o = i; e = o.fetch, e.default = o.fetch, e.fetch = o.fetch, e.Headers = o.Headers, e.Request = o.Request, e.Response = o.Response, t.exports = e; }(Nl, Nl.exports)), Nl.exports; } var of = GR(); const Md = /* @__PURE__ */ Wl(of), WR = /* @__PURE__ */ VE({ __proto__: null, default: Md }, [of]), Qa = (t) => { let e = {}; return t && (typeof Headers < "u" && t instanceof Headers || WR && of.Headers && t instanceof of.Headers ? e = ZT(t) : Array.isArray(t) ? t.forEach(([n, i]) => { n && i !== void 0 && (e[n] = i); }) : e = t), e; }, S_ = (t) => t.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), QR = (t) => { if (!Array.isArray(t.query)) { const i = t, o = [`query=${encodeURIComponent(S_(i.query))}`]; return t.variables && o.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && o.push(`operationName=${encodeURIComponent(i.operationName)}`), o.join("&"); } if (typeof t.variables < "u" && !Array.isArray(t.variables)) throw new Error("Cannot create query with given variable type, array expected"); const e = t, n = t.query.reduce((i, o, a) => (i.push({ query: S_(o), variables: e.variables ? e.jsonSerializer.stringify(e.variables[a]) : void 0 }), i), []); return `query=${encodeURIComponent(e.jsonSerializer.stringify(n))}`; }, YR = (t) => async (e) => { const { url: n, query: i, variables: o, operationName: a, fetch: l, fetchOptions: f, middleware: p } = e, v = { ...e.headers }; let k = "", b; t === "POST" ? (b = XR(i, o, a, f.jsonSerializer), typeof b == "string" && (v["Content-Type"] = "application/json")) : k = QR({ query: i, variables: o, operationName: a, jsonSerializer: f.jsonSerializer ?? Lg }); const w = { method: t, headers: v, body: b, ...f }; let T = n, O = w; if (p) { const x = await Promise.resolve(p({ ...w, url: n, operationName: a, variables: o })), { url: C, ...$ } = x; T = C, O = $; } return k && (T = `${T}?${k}`), await l(T, O); }; class e0 { constructor(e, n = {}) { this.url = e, this.requestConfig = n, this.rawRequest = async (...i) => { const [o, a, l] = i, f = tR(o, a, l), { headers: p, fetch: v = Md, method: k = "POST", requestMiddleware: b, responseMiddleware: w, ...T } = this.requestConfig, { url: O } = this; f.signal !== void 0 && (T.signal = f.signal); const { operationName: x } = Zp(f.query); return em({ url: O, query: f.query, variables: f.variables, headers: { ...Qa(tm(p)), ...Qa(f.requestHeaders) }, operationName: x, fetch: v, method: k, fetchOptions: T, middleware: b }).then((C) => (w && w(C), C)).catch((C) => { throw w && w(C), C; }); }; } async request(e, ...n) { const [i, o] = n, a = eR(e, i, o), { headers: l, fetch: f = Md, method: p = "POST", requestMiddleware: v, responseMiddleware: k, ...b } = this.requestConfig, { url: w } = this; a.signal !== void 0 && (b.signal = a.signal); const { query: T, operationName: O } = Zp(a.document); return em({ url: w, query: T, variables: a.variables, headers: { ...Qa(tm(l)), ...Qa(a.requestHeaders) }, operationName: O, fetch: f, method: p, fetchOptions: b, middleware: v }).then((x) => (k && k(x), x.data)).catch((x) => { throw k && k(x), x; }); } // prettier-ignore batchRequests(e, n) { const i = nR(e, n), { headers: o, ...a } = this.requestConfig; i.signal !== void 0 && (a.signal = i.signal); const l = i.documents.map(({ document: p }) => Zp(p).query), f = i.documents.map(({ variables: p }) => p); return em({ url: this.url, query: l, // @ts-expect-error TODO reconcile batch variables into system. variables: f, headers: { ...Qa(tm(o)), ...Qa(i.requestHeaders) }, operationName: void 0, fetch: this.requestConfig.fetch ?? Md, method: this.requestConfig.method || "POST", fetchOptions: a, middleware: this.requestConfig.requestMiddleware }).then((p) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p.data)).catch((p) => { throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p; }); } setHeaders(e) { return this.requestConfig.headers = e, this; } /** * Attach a header to the client. All subsequent requests will have this header. */ setHeader(e, n) { const { headers: i } = this.requestConfig; return i ? i[e] = n : this.requestConfig.headers = { [e]: n }, this; } /** * Change the client endpoint. All subsequent requests will send to this endpoint. */ setEndpoint(e) { return this.url = e, this; } } const em = async (t) => { const { query: e, variables: n, fetchOptions: i } = t, o = YR(JT(t.method ?? "post")), a = Array.isArray(t.query), l = await o(t), f = await JR(l, i.jsonSerializer ?? Lg), p = Array.isArray(f) ? !f.some(({ data: k }) => !k) : !!f.data, v = Array.isArray(f) || !f.errors || Array.isArray(f.errors) && !f.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore"; if (l.ok && v && p) { const { errors: k, ...b } = (Array.isArray(f), f), w = i.errorPolicy === "ignore" ? b : f; return { ...a ? { data: w } : w, headers: l.headers, status: l.status }; } else { const k = typeof f == "string" ? { error: f } : f; throw new Ol( // @ts-expect-error TODO { ...k, status: l.status, headers: l.headers }, { query: e, variables: n } ); } }, XR = (t, e, n, i) => { const o = i ?? Lg; if (!Array.isArray(t)) return o.stringify({ query: t, variables: e, operationName: n }); if (typeof e < "u" && !Array.isArray(e)) throw new Error("Cannot create request body with given variable type, array expected"); const a = t.reduce((l, f, p) => (l.push({ query: f, variables: e ? e[p] : void 0 }), l), []); return o.stringify(a); }, JR = async (t, e) => { let n; return t.headers.forEach((i, o) => { o.toLowerCase() === "content-type" && (n = i); }), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? e.parse(await t.text()) : t.text(); }, tm = (t) => typeof t == "function" ? t() : t; class t0 extends fs { constructor() { super( "EVENT_CHAT_ROOM_TOKEN_ERROR", "Error getting chat room connection token" ); } } class Bf { constructor(e) { de(this, "root", Rf(this)); de(this, "token"); this.root.setProps(e); } static toDomain(e) { const n = { token: e.token }; return new Bf(n); } toPrimitives() { const { root: e, ...n } = this; return { ...n }; } } const ZR = ds.apiUrls.graphql; class n0 { constructor() { de(this, "client"); this.client = new e0(ZR); } async getChatRoom(e) { var o; const { getChatRoomToken: n } = await this.client.request( ZS, { data: { account: e.account, idEvent: e.eventId, userName: e.userName } } ); this.propagateGraphqlErrorIfExists( n ); const i = (o = n.data) == null ? void 0 : o.token; if (!i) throw new t0(); return Bf.toDomain({ token: i }); } propagateGraphqlErrorIfExists(e) { if (e.__typename === "ErrorGeneral") throw new Error(e.message); } } class r0 { constructor(e) { de(this, "account"); this.eventChatRoomRepository = e; } async get(e) { this.validateAccount(); try { return await this.eventChatRoomRepository.getChatRoom({ ...e, account: this.account }); } catch (n) { throw new Xn(n); } } setAccount(e) { this.account = e; } validateAccount() { if (!this.account) throw new pf(); } } const eI = new n0(), Qm = new r0( eI ), Vf = Zi(void 0); Vf.debugLabel = "chatSocketAtom"; const zf = Zi(!1); zf.debugLabel = "chatIsConnectedAtom"; const tc = Zi([]); tc.debugLabel = "chatMessageListAtom"; const i0 = (t) => { t.data = t.data.replace("replace_gif", t.urlGif ?? ""); const e = t.data.indexOf("::question__") > -1; if (e) { const [n, i] = t.data.split("::") || ["none", "none"], o = i.split("question__")[1], a = { response: n.replace("response__", ""), question: JSON.parse(o) }; return { ...t, data: a.response, isResponse: e, responseData: t.data, question: e ? a.question : null }; } return t; }, s0 = (t) => { const { url: e, token: n, onOpen: i, onClose: o, onMessage: a, onError: l } = t, f = new WebSocket(e, n); return f.onopen = (p) => i(p), f.onclose = (p) => o(p), f.onerror = (p) => l(p), f.onmessage = (p) => a(p), f; }, o0 = () => { const t = "0123456789ABCDEF"; let e = "#"; for (let n = 0; n < 6; n += 1) e += t[Math.floor(Math.random() * 16)]; return e; }, Mg = (t, e) => { var w; const { Content: n, Attributes: i, Sender: { Attributes: o } } = e, { username: a, type: l, email: f } = i, { isAdmin: p } = o, v = (i == null ? void 0 : i.id) ?? ro(8), k = ((w = t.find((T) => T.username === a)) == null ? void 0 : w.color) || o0(), b = { id: v, type: l, color: k, username: a, email: f, data: n, sendDate: i.sendDate, isAdmin: p === "true", responseAdmin: !1, question: null, account: i.account, idEvent: i.idEvent, urlGif: i.urlGif, ip: i.ip }; return i0(b); }, a0 = (t) => { const { eventId: e, userName: n, enabled: i = !0 } = t, { accountName: o } = US(), [a, l] = st.useState(""), f = () => { i && o && (Qm.setAccount(o), Qm.get({ eventId: e, userName: n }).then((p) => { l(p.token); })); }; return st.useEffect(() => { f(); }, [o, i]), { getQuery: { refetch: f }, token: a }; }, { coreLogger: tI } = nr(), Gn = tI.child("useConnectChatSocket"), nI = ds.publicUrls.wssIVSChat, rI = 10, iI = (t) => Math.min(1e4, 1e3 * Math.pow(2, t)), sI = (t, e, n) => { const i = JSON.parse(t.data); switch (i.Type) { case "EVENT": e == null || e(i); break; case "MESSAGE": n == null || n(i); break; case "ERROR": Gn.error("Chat room error:", i); break; default: Gn.error("Unknown chat room event:", t); } }, u0 = (t) => { const { onMessage: e, eventId: n, enabled: i = !0, userName: o, onEvent: a } = t, { token: l, getQuery: f } = a0({ eventId: n, userName: o, enabled: i }), [p, v] = kp(Vf), [k, b] = kp(zf), [w, T] = kp(tc), O = st.useRef(0), x = st.useCallback( (ne) => Gn.error("Chat room socket error:", ne), [] ), C = st.useCallback(() => { b(!0), O.current = 0, Gn.debug("Successfully connected to the chat room"); }, [b]), $ = st.useCallback(() => { if (O.current >= rI) { Gn.error( "Max reconnection attempts reached. No further attempts will be made." ); return; } b(!1), O.current += 1; const ne = iI(O.current); Gn.debug( `Disconnected from chat room. Reconnecting in ${ne / 1e3} seconds... (Attempt ${O.current})` ), setTimeout(() => f.refetch(), ne); }, [f, b]), J = st.useCallback(() => { if (!l) { Gn.debug("No token available. Connection aborted."); return; } if ((p == null ? void 0 : p.readyState) === WebSocket.OPEN) { Gn.debug("WebSocket is already open. No need to reconnect."); return; } Gn.debug("Connecting to the chat room..."); const ne = s0({ token: l, url: nI, onOpen: C, onClose: $, onError: x, onMessage: (he) => sI(he, a, e) }); v(ne); }, [ l, p, a, e, C, $, x, v ]), le = st.useCallback(() => { if (!p || p.readyState !== WebSocket.OPEN) { Gn.debug("No open socket to close."); return; } Gn.debug("Closing chat room socket..."), p.close(); }, [p]); return st.useEffect(() => { if (!i) { Gn.debug("Chat is disabled, skipping connection."); return; } if (!l) { Gn.debug("Token not available, skipping connection."); return; } return Gn.debug("Initializing connection with token:", l), le(), J(), le; }, [l, i]), { socket: p, chatIsConnected: k, chatMessageList: w, setChatMessageList: T }; }, oI = () => { const t = Ud(Vf), e = Ud(zf); return { sendMessage: st.useCallback( (i, o) => { if (!t || !e) return; const a = { id: o.id, sendDate: /* @__PURE__ */ new Date(), content: i, action: "SEND_MESSAGE", attributes: o }, l = JSON.stringify(a); t.send(l); }, [e, t] ) }; }, l0 = () => { const t = ug(tc); return { handleEvent: (i) => { var o; if (i.EventName === "senddeletemessage") { const a = JSON.parse((o = i.Attributes) == null ? void 0 : o.data); t((l) => l.filter((f) => f.id !== a.id)); } }, handleMessage: (i) => { t((o) => [...o, Mg(o, i)]); } }; }, aI = (t) => { const { eventId: e, userName: n } = t, [i, o] = st.useState(!1), [a, l] = st.useState(), [f, p] = st.useState(), [v, k] = st.useState([]), { handleEvent: b } = l0(), w = ug(tc), T = (J) => { w((le) => [Mg(le, J), ...le]), o(!1); }, O = (J) => { var le, ne, he; if (b(J), J.EventName === "sendpinmessage") { const ye = JSON.parse((le = J.Attributes) == null ? void 0 : le.data); l({ data: ye.data, id: ye.id, username: ye.username }); } if (J.EventName === "sendunpinmessage" && l(void 0), J.EventName === "sendhighlightproduct") { const ye = JSON.parse((ne = J.Attributes) == null ? void 0 : ne.data); p({ products: ye.productIds, collection: ye.collection, livestreamingId: ye.idEvent }); } if (J.EventName === "sendaddtocart") { const ye = JSON.parse((he = J.Attributes) == null ? void 0 : he.data); k((me) => [ ...me, { id: ye.id, sessionId: ye.sessionId, productId: ye.productId, productImageUrl: ye.productImageUrl, productName: ye.productName } ]); } }, { socket: x, chatMessageList: C, setChatMessageList: $ } = u0({ onMessage: T, onEvent: O, eventId: e, userName: n }); return { socket: x, chat: C, showLoader: i, pinnedMessage: a, highlightProduct: f, productsInCart: v, setChat: $, setShowLoader: o, setPinnedMessage: l, setProductsInCart: k }; }; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const $d = globalThis, $g = $d.ShadowRoot && ($d.ShadyCSS === void 0 || $d.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, jg = Symbol(), b_ = /* @__PURE__ */ new WeakMap(); let c0 = class { constructor(e, n, i) { if (this._$cssResult$ = !0, i !== jg) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); this.cssText = e, this.t = n; } get styleSheet() { let e = this.o; const n = this.t; if ($g && e === void 0) { const i = n !== void 0 && n.length === 1; i && (e = b_.get(n)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && b_.set(n, e)); } return e; } toString() { return this.cssText; } }; const uI = (t) => new c0(typeof t == "string" ? t : t + "", void 0, jg), lI = (t, ...e) => { const n = t.length === 1 ? t[0] : e.reduce((i, o, a) => i + ((l) => { if (l._$cssResult$ === !0) return l.cssText; if (typeof l == "number") return l; throw Error("Value passed to 'css' function must be a 'css' function result: " + l + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); })(o) + t[a + 1], t[0]); return new c0(n, t, jg); }, cI = (t, e) => { if ($g) t.adoptedStyleSheets = e.map((n) => n instanceof CSSStyleSheet ? n : n.styleSheet); else for (const n of e) { const i = document.createElement("style"), o = $d.litNonce; o !== void 0 && i.setAttribute("nonce", o), i.textContent = n.cssText, t.appendChild(i); } }, E_ = $g ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => { let n = ""; for (const i of e.cssRules) n += i.cssText; return uI(n); })(t) : t; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const { is: dI, defineProperty: fI, getOwnPropertyDescriptor: hI, getOwnPropertyNames: pI, getOwnPropertySymbols: mI, getPrototypeOf: gI } = Object, Zs = globalThis, N_ = Zs.trustedTypes, yI = N_ ? N_.emptyScript : "", nm = Zs.reactiveElementPolyfillSupport, Tl = (t, e) => t, Ym = { toAttribute(t, e) { switch (e) { case Boolean: t = t ? yI : null; break; case Object: case Array: t = t == null ? t : JSON.stringify(t); } return t; }, fromAttribute(t, e) { let n = t; switch (e) { case Boolean: n = t !== null; break; case Number: n = t === null ? null : Number(t); break; case Object: case Array: try { n = JSON.parse(t); } catch { n = null; } } return n; } }, d0 = (t, e) => !dI(t, e), A_ = { attribute: !0, type: String, converter: Ym, reflect: !1, hasChanged: d0 }; Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), Zs.litPropertyMetadata ?? (Zs.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); class Ja extends HTMLElement { static addInitializer(e) { this._$Ei(), (this.l ?? (this.l = [])).push(e); } static get observedAttributes() { return this.finalize(), this._$Eh && [...this._$Eh.keys()]; } static createProperty(e, n = A_) { if (n.state && (n.attribute = !1), this._$Ei(), this.elementProperties.set(e, n), !n.noAccessor) { const i = Symbol(), o = this.getPropertyDescriptor(e, i, n); o !== void 0 && fI(this.prototype, e, o); } } static getPropertyDescriptor(e, n, i) { const { get: o, set: a } = hI(this.prototype, e) ?? { get() { return this[n]; }, set(l) { this[n] = l; } }; return { get() { return o == null ? void 0 : o.call(this); }, set(l) { const f = o == null ? void 0 : o.call(this); a.call(this, l), this.requestUpdate(e, f, i); }, configurable: !0, enumerable: !0 }; } static getPropertyOptions(e) { return this.elementProperties.get(e) ?? A_; } static _$Ei() { if (this.hasOwnProperty(Tl("elementProperties"))) return; const e = gI(this); e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties); } static finalize() { if (this.hasOwnProperty(Tl("finalized"))) return; if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(Tl("properties"))) { const n = this.properties, i = [...pI(n), ...mI(n)]; for (const o of i) this.createProperty(o, n[o]); } const e = this[Symbol.metadata]; if (e !== null) { const n = litPropertyMetadata.get(e); if (n !== void 0) for (const [i, o] of n) this.elementProperties.set(i, o); } this._$Eh = /* @__PURE__ */ new Map(); for (const [n, i] of this.elementProperties) { const o = this._$Eu(n, i); o !== void 0 && this._$Eh.set(o, n); } this.elementStyles = this.finalizeStyles(this.styles); } static finalizeStyles(e) { const n = []; if (Array.isArray(e)) { const i = new Set(e.flat(1 / 0).reverse()); for (const o of i) n.unshift(E_(o)); } else e !== void 0 && n.push(E_(e)); return n; } static _$Eu(e, n) { const i = n.attribute; return i === !1 ? void 0 : typeof i == "string" ? i : typeof e == "string" ? e.toLowerCase() : void 0; } constructor() { super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev(); } _$Ev() { var e; this._$ES = new Promise((n) => this.enableUpdating = n), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (e = this.constructor.l) == null || e.forEach((n) => n(this)); } addController(e) { var n; (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(e), this.renderRoot !== void 0 && this.isConnected && ((n = e.hostConnected) == null || n.call(e)); } removeController(e) { var n; (n = this._$EO) == null || n.delete(e); } _$E_() { const e = /* @__PURE__ */ new Map(), n = this.constructor.elementProperties; for (const i of n.keys()) this.hasOwnProperty(i) && (e.set(i, this[i]), delete this[i]); e.size > 0 && (this._$Ep = e); } createRenderRoot() { const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); return cI(e, this.constructor.elementStyles), e; } connectedCallback() { var e; this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$EO) == null || e.forEach((n) => { var i; return (i = n.hostConnected) == null ? void 0 : i.call(n); }); } enableUpdating(e) { } disconnectedCallback() { var e; (e = this._$EO) == null || e.forEach((n) => { var i; return (i = n.hostDisconnected) == null ? void 0 : i.call(n); }); } attributeChangedCallback(e, n, i) { this._$AK(e, i); } _$EC(e, n) { var a; const i = this.constructor.elementProperties.get(e), o = this.constructor._$Eu(e, i); if (o !== void 0 && i.reflect === !0) { const l = (((a = i.converter) == null ? void 0 : a.toAttribute) !== void 0 ? i.converter : Ym).toAttribute(n, i.type); this._$Em = e, l == null ? this.removeAttribute(o) : this.setAttribute(o, l), this._$Em = null; } } _$AK(e, n) { var a; const i = this.constructor, o = i._$Eh.get(e); if (o !== void 0 && this._$Em !== o) { const l = i.getPropertyOptions(o), f = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((a = l.converter) == null ? void 0 : a.fromAttribute) !== void 0 ? l.converter : Ym; this._$Em = o, this[o] = f.fromAttribute(n, l.type), this._$Em = null; } } requestUpdate(e, n, i) { if (e !== void 0) { if (i ?? (i = this.constructor.getPropertyOptions(e)), !(i.hasChanged ?? d0)(this[e], n)) return; this.P(e, n, i); } this.isUpdatePending === !1 && (this._$ES = this._$ET()); } P(e, n, i) { this._$AL.has(e) || this._$AL.set(e, n), i.reflect === !0 && this._$Em !== e && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(e); } async _$ET() { this.isUpdatePending = !0; try { await this._$ES; } catch (n) { Promise.reject(n); } const e = this.scheduleUpdate(); return e != null && await e, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); } performUpdate() { var i; if (!this.isUpdatePending) return; if (!this.hasUpdated) { if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) { for (const [a, l] of this._$Ep) this[a] = l; this._$Ep = void 0; } const o = this.constructor.elementProperties; if (o.size > 0) for (const [a, l] of o) l.wrapped !== !0 || this._$AL.has(a) || this[a] === void 0 || this.P(a, this[a], l); } let e = !1; const n = this._$AL; try { e = this.shouldUpdate(n), e ? (this.willUpdate(n), (i = this._$EO) == null || i.forEach((o) => { var a; return (a = o.hostUpdate) == null ? void 0 : a.call(o); }), this.update(n)) : this._$EU(); } catch (o) { throw e = !1, this._$EU(), o; } e && this._$AE(n); } willUpdate(e) { } _$AE(e) { var n; (n = this._$EO) == null || n.forEach((i) => { var o; return (o = i.hostUpdated) == null ? void 0 : o.call(i); }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e); } _$EU() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1; } get updateComplete() { return this.getUpdateComplete(); } getUpdateComplete() { return this._$ES; } shouldUpdate(e) { return !0; } update(e) { this._$Ej && (this._$Ej = this._$Ej.forEach((n) => this._$EC(n, this[n]))), this._$EU(); } updated(e) { } firstUpdated(e) { } } Ja.elementStyles = [], Ja.shadowRootOptions = { mode: "open" }, Ja[Tl("elementProperties")] = /* @__PURE__ */ new Map(), Ja[Tl("finalized")] = /* @__PURE__ */ new Map(), nm == null || nm({ ReactiveElement: Ja }), (Zs.reactiveElementVersions ?? (Zs.reactiveElementVersions = [])).push("2.0.4"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const Rl = globalThis, af = Rl.trustedTypes, x_ = af ? af.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, f0 = "$lit$", Ws = `lit$${Math.random().toFixed(9).slice(2)}$`, h0 = "?" + Ws, vI = `<${h0}>`, ra = document, zl = () => ra.createComment(""), Hl = (t) => t === null || typeof t != "object" && typeof t != "function", Ug = Array.isArray, kI = (t) => Ug(t) || typeof (t == null ? void 0 : t[Symbol.iterator]) == "function", rm = `[ \f\r]`, _l = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, C_ = /-->/g, O_ = />/g, Vo = RegExp(`>|${rm}(?:([^\\s"'>=/]+)(${rm}*=${rm}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"), T_ = /'/g, R_ = /"/g, p0 = /^(?:script|style|textarea|title)$/i, _I = (t) => (e, ...n) => ({ _$litType$: t, strings: e, values: n }), wI = _I(1), fu = Symbol.for("lit-noChange"), dn = Symbol.for("lit-nothing"), I_ = /* @__PURE__ */ new WeakMap(), Wo = ra.createTreeWalker(ra, 129); function m0(t, e) { if (!Ug(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array"); return x_ !== void 0 ? x_.createHTML(e) : e; } const SI = (t, e) => { const n = t.length - 1, i = []; let o, a = e === 2 ? "" : e === 3 ? "" : "", l = _l; for (let f = 0; f < n; f++) { const p = t[f]; let v, k, b = -1, w = 0; for (; w < p.length && (l.lastIndex = w, k = l.exec(p), k !== null); ) w = l.lastIndex, l === _l ? k[1] === "!--" ? l = C_ : k[1] !== void 0 ? l = O_ : k[2] !== void 0 ? (p0.test(k[2]) && (o = RegExp("" ? (l = o ?? _l, b = -1) : k[1] === void 0 ? b = -2 : (b = l.lastIndex - k[2].length, v = k[1], l = k[3] === void 0 ? Vo : k[3] === '"' ? R_ : T_) : l === R_ || l === T_ ? l = Vo : l === C_ || l === O_ ? l = _l : (l = Vo, o = void 0); const T = l === Vo && t[f + 1].startsWith("/>") ? " " : ""; a += l === _l ? p + vI : b >= 0 ? (i.push(v), p.slice(0, b) + f0 + p.slice(b) + Ws + T) : p + Ws + (b === -2 ? f : T); } return [m0(t, a + (t[n] || "") + (e === 2 ? "" : e === 3 ? "" : "")), i]; }; class ql { constructor({ strings: e, _$litType$: n }, i) { let o; this.parts = []; let a = 0, l = 0; const f = e.length - 1, p = this.parts, [v, k] = SI(e, n); if (this.el = ql.createElement(v, i), Wo.currentNode = this.el.content, n === 2 || n === 3) { const b = this.el.content.firstChild; b.replaceWith(...b.childNodes); } for (; (o = Wo.nextNode()) !== null && p.length < f; ) { if (o.nodeType === 1) { if (o.hasAttributes()) for (const b of o.getAttributeNames()) if (b.endsWith(f0)) { const w = k[l++], T = o.getAttribute(b).split(Ws), O = /([.?@])?(.*)/.exec(w); p.push({ type: 1, index: a, name: O[2], strings: T, ctor: O[1] === "." ? EI : O[1] === "?" ? NI : O[1] === "@" ? AI : Hf }), o.removeAttribute(b); } else b.startsWith(Ws) && (p.push({ type: 6, index: a }), o.removeAttribute(b)); if (p0.test(o.tagName)) { const b = o.textContent.split(Ws), w = b.length - 1; if (w > 0) { o.textContent = af ? af.emptyScript : ""; for (let T = 0; T < w; T++) o.append(b[T], zl()), Wo.nextNode(), p.push({ type: 2, index: ++a }); o.append(b[w], zl()); } } } else if (o.nodeType === 8) if (o.data === h0) p.push({ type: 2, index: a }); else { let b = -1; for (; (b = o.data.indexOf(Ws, b + 1)) !== -1; ) p.push({ type: 7, index: a }), b += Ws.length - 1; } a++; } } static createElement(e, n) { const i = ra.createElement("template"); return i.innerHTML = e, i; } } function hu(t, e, n = t, i) { var l, f; if (e === fu) return e; let o = i !== void 0 ? (l = n.o) == null ? void 0 : l[i] : n.l; const a = Hl(e) ? void 0 : e._$litDirective$; return (o == null ? void 0 : o.constructor) !== a && ((f = o == null ? void 0 : o._$AO) == null || f.call(o, !1), a === void 0 ? o = void 0 : (o = new a(t), o._$AT(t, n, i)), i !== void 0 ? (n.o ?? (n.o = []))[i] = o : n.l = o), o !== void 0 && (e = hu(t, o._$AS(t, e.values), o, i)), e; } class bI { constructor(e, n) { this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = n; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } u(e) { const { el: { content: n }, parts: i } = this._$AD, o = ((e == null ? void 0 : e.creationScope) ?? ra).importNode(n, !0); Wo.currentNode = o; let a = Wo.nextNode(), l = 0, f = 0, p = i[0]; for (; p !== void 0; ) { if (l === p.index) { let v; p.type === 2 ? v = new nc(a, a.nextSibling, this, e) : p.type === 1 ? v = new p.ctor(a, p.name, p.strings, this, e) : p.type === 6 && (v = new xI(a, this, e)), this._$AV.push(v), p = i[++f]; } l !== (p == null ? void 0 : p.index) && (a = Wo.nextNode(), l++); } return Wo.currentNode = ra, o; } p(e) { let n = 0; for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, n), n += i.strings.length - 2) : i._$AI(e[n])), n++; } } class nc { get _$AU() { var e; return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this.v; } constructor(e, n, i, o) { this.type = 2, this._$AH = dn, this._$AN = void 0, this._$AA = e, this._$AB = n, this._$AM = i, this.options = o, this.v = (o == null ? void 0 : o.isConnected) ?? !0; } get parentNode() { let e = this._$AA.parentNode; const n = this._$AM; return n !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = n.parentNode), e; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(e, n = this) { e = hu(this, e, n), Hl(e) ? e === dn || e == null || e === "" ? (this._$AH !== dn && this._$AR(), this._$AH = dn) : e !== this._$AH && e !== fu && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : kI(e) ? this.k(e) : this._(e); } O(e) { return this._$AA.parentNode.insertBefore(e, this._$AB); } T(e) { this._$AH !== e && (this._$AR(), this._$AH = this.O(e)); } _(e) { this._$AH !== dn && Hl(this._$AH) ? this._$AA.nextSibling.data = e : this.T(ra.createTextNode(e)), this._$AH = e; } $(e) { var a; const { values: n, _$litType$: i } = e, o = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ql.createElement(m0(i.h, i.h[0]), this.options)), i); if (((a = this._$AH) == null ? void 0 : a._$AD) === o) this._$AH.p(n); else { const l = new bI(o, this), f = l.u(this.options); l.p(n), this.T(f), this._$AH = l; } } _$AC(e) { let n = I_.get(e.strings); return n === void 0 && I_.set(e.strings, n = new ql(e)), n; } k(e) { Ug(this._$AH) || (this._$AH = [], this._$AR()); const n = this._$AH; let i, o = 0; for (const a of e) o === n.length ? n.push(i = new nc(this.O(zl()), this.O(zl()), this, this.options)) : i = n[o], i._$AI(a), o++; o < n.length && (this._$AR(i && i._$AB.nextSibling, o), n.length = o); } _$AR(e = this._$AA.nextSibling, n) { var i; for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, n); e && e !== this._$AB; ) { const o = e.nextSibling; e.remove(), e = o; } } setConnected(e) { var n; this._$AM === void 0 && (this.v = e, (n = this._$AP) == null || n.call(this, e)); } } class Hf { get tagName() { return this.element.tagName; } get _$AU() { return this._$AM._$AU; } constructor(e, n, i, o, a) { this.type = 1, this._$AH = dn, this._$AN = void 0, this.element = e, this.name = n, this._$AM = o, this.options = a, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = dn; } _$AI(e, n = this, i, o) { const a = this.strings; let l = !1; if (a === void 0) e = hu(this, e, n, 0), l = !Hl(e) || e !== this._$AH && e !== fu, l && (this._$AH = e); else { const f = e; let p, v; for (e = a[0], p = 0; p < a.length - 1; p++) v = hu(this, f[i + p], n, p), v === fu && (v = this._$AH[p]), l || (l = !Hl(v) || v !== this._$AH[p]), v === dn ? e = dn : e !== dn && (e += (v ?? "") + a[p + 1]), this._$AH[p] = v; } l && !o && this.j(e); } j(e) { e === dn ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? ""); } } class EI extends Hf { constructor() { super(...arguments), this.type = 3; } j(e) { this.element[this.name] = e === dn ? void 0 : e; } } class NI extends Hf { constructor() { super(...arguments), this.type = 4; } j(e) { this.element.toggleAttribute(this.name, !!e && e !== dn); } } class AI extends Hf { constructor(e, n, i, o, a) { super(e, n, i, o, a), this.type = 5; } _$AI(e, n = this) { if ((e = hu(this, e, n, 0) ?? dn) === fu) return; const i = this._$AH, o = e === dn && i !== dn || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, a = e !== dn && (i === dn || o); o && this.element.removeEventListener(this.name, this, i), a && this.element.addEventListener(this.name, this, e), this._$AH = e; } handleEvent(e) { var n; typeof this._$AH == "function" ? this._$AH.call(((n = this.options) == null ? void 0 : n.host) ?? this.element, e) : this._$AH.handleEvent(e); } } class xI { constructor(e, n, i) { this.element = e, this.type = 6, this._$AN = void 0, this._$AM = n, this.options = i; } get _$AU() { return this._$AM._$AU; } _$AI(e) { hu(this, e); } } const im = Rl.litHtmlPolyfillSupport; im == null || im(ql, nc), (Rl.litHtmlVersions ?? (Rl.litHtmlVersions = [])).push("3.2.0"); const Bg = (t, e, n) => { const i = (n == null ? void 0 : n.renderBefore) ?? e; let o = i._$litPart$; if (o === void 0) { const a = (n == null ? void 0 : n.renderBefore) ?? null; i._$litPart$ = o = new nc(e.insertBefore(zl(), a), a, void 0, n ?? {}); } return o._$AI(t), o; }; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ class Il extends Ja { constructor() { super(...arguments), this.renderOptions = { host: this }, this.o = void 0; } createRenderRoot() { var n; const e = super.createRenderRoot(); return (n = this.renderOptions).renderBefore ?? (n.renderBefore = e.firstChild), e; } update(e) { const n = this.render(); this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this.o = Bg(n, this.renderRoot, this.renderOptions); } connectedCallback() { var e; super.connectedCallback(), (e = this.o) == null || e.setConnected(!0); } disconnectedCallback() { var e; super.disconnectedCallback(), (e = this.o) == null || e.setConnected(!1); } render() { return fu; } } var tw; Il._$litElement$ = !0, Il.finalized = !0, (tw = globalThis.litElementHydrateSupport) == null || tw.call(globalThis, { LitElement: Il }); const sm = globalThis.litElementPolyfillSupport; sm == null || sm({ LitElement: Il }); (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.0"); /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const CI = (t) => t.strings === void 0; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const OI = { CHILD: 2 }, TI = (t) => (...e) => ({ _$litDirective$: t, values: e }); class RI { constructor(e) { } get _$AU() { return this._$AM._$AU; } _$AT(e, n, i) { this.t = e, this._$AM = n, this.i = i; } _$AS(e, n) { return this.update(e, n); } update(e, n) { return this.render(...n); } } /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const Pl = (t, e) => { var i; const n = t._$AN; if (n === void 0) return !1; for (const o of n) (i = o._$AO) == null || i.call(o, e, !1), Pl(o, e); return !0; }, uf = (t) => { let e, n; do { if ((e = t._$AM) === void 0) break; n = e._$AN, n.delete(t), t = e; } while ((n == null ? void 0 : n.size) === 0); }, g0 = (t) => { for (let e; e = t._$AM; t = e) { let n = e._$AN; if (n === void 0) e._$AN = n = /* @__PURE__ */ new Set(); else if (n.has(t)) break; n.add(t), LI(e); } }; function II(t) { this._$AN !== void 0 ? (uf(this), this._$AM = t, g0(this)) : this._$AM = t; } function PI(t, e = !1, n = 0) { const i = this._$AH, o = this._$AN; if (o !== void 0 && o.size !== 0) if (e) if (Array.isArray(i)) for (let a = n; a < i.length; a++) Pl(i[a], !1), uf(i[a]); else i != null && (Pl(i, !1), uf(i)); else Pl(this, t); } const LI = (t) => { t.type == OI.CHILD && (t._$AP ?? (t._$AP = PI), t._$AQ ?? (t._$AQ = II)); }; class DI extends RI { constructor() { super(...arguments), this._$AN = void 0; } _$AT(e, n, i) { super._$AT(e, n, i), g0(this), this.isConnected = e._$AU; } _$AO(e, n = !0) { var i, o; e !== this.isConnected && (this.isConnected = e, e ? (i = this.reconnected) == null || i.call(this) : (o = this.disconnected) == null || o.call(this)), n && (Pl(this, e), uf(this)); } setValue(e) { if (CI(this.t)) this.t._$AI(e, this); else { const n = [...this.t._$AH]; n[this.i] = e, this.t._$AI(n, this, 0); } } disconnected() { } reconnected() { } } /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const FI = () => new MI(); class MI { } const om = /* @__PURE__ */ new WeakMap(), $I = TI(class extends DI { render(t) { return dn; } update(t, [e]) { var i; const n = e !== this.Y; return n && this.Y !== void 0 && this.rt(void 0), (n || this.lt !== this.ct) && (this.Y = e, this.ht = (i = t.options) == null ? void 0 : i.host, this.rt(this.ct = t.element)), dn; } rt(t) { if (this.isConnected || (t = void 0), typeof this.Y == "function") { const e = this.ht ?? globalThis; let n = om.get(e); n === void 0 && (n = /* @__PURE__ */ new WeakMap(), om.set(e, n)), n.get(this.Y) !== void 0 && this.Y.call(this.ht, void 0), n.set(this.Y, t), t !== void 0 && this.Y.call(this.ht, t); } else this.Y.value = t; } get lt() { var t, e; return typeof this.Y == "function" ? (t = om.get(this.ht ?? globalThis)) == null ? void 0 : t.get(this.Y) : (e = this.Y) == null ? void 0 : e.value; } disconnected() { this.lt === this.ct && this.rt(void 0); } reconnected() { this.rt(this.ct); } }); var bd = {}, am = { exports: {} }, Kn = {}, um = { exports: {} }, lm = {}; /** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var P_; function jI() { return P_ || (P_ = 1, function(t) { function e(te, ue) { var M = te.length; te.push(ue); e: for (; 0 < M; ) { var D = M - 1 >>> 1, ae = te[D]; if (0 < o(ae, ue)) te[D] = ue, te[M] = ae, M = D; else break e; } } function n(te) { return te.length === 0 ? null : te[0]; } function i(te) { if (te.length === 0) return null; var ue = te[0], M = te.pop(); if (M !== ue) { te[0] = M; e: for (var D = 0, ae = te.length, Ve = ae >>> 1; D < Ve; ) { var F = 2 * (D + 1) - 1, Y = te[F], nt = F + 1, Te = te[nt]; if (0 > o(Y, M)) nt < ae && 0 > o(Te, Y) ? (te[D] = Te, te[nt] = M, D = nt) : (te[D] = Y, te[F] = M, D = F); else if (nt < ae && 0 > o(Te, M)) te[D] = Te, te[nt] = M, D = nt; else break e; } } return ue; } function o(te, ue) { var M = te.sortIndex - ue.sortIndex; return M !== 0 ? M : te.id - ue.id; } if (typeof performance == "object" && typeof performance.now == "function") { var a = performance; t.unstable_now = function() { return a.now(); }; } else { var l = Date, f = l.now(); t.unstable_now = function() { return l.now() - f; }; } var p = [], v = [], k = 1, b = null, w = 3, T = !1, O = !1, x = !1, C = typeof setTimeout == "function" ? setTimeout : null, $ = typeof clearTimeout == "function" ? clearTimeout : null, J = typeof setImmediate < "u" ? setImmediate : null; typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling); function le(te) { for (var ue = n(v); ue !== null; ) { if (ue.callback === null) i(v); else if (ue.startTime <= te) i(v), ue.sortIndex = ue.expirationTime, e(p, ue); else break; ue = n(v); } } function ne(te) { if (x = !1, le(te), !O) if (n(p) !== null) O = !0, oe(he); else { var ue = n(v); ue !== null && ge(ne, ue.startTime - te); } } function he(te, ue) { O = !1, x && (x = !1, $(Fe), Fe = -1), T = !0; var M = w; try { for (le(ue), b = n(p); b !== null && (!(b.expirationTime > ue) || te && !He()); ) { var D = b.callback; if (typeof D == "function") { b.callback = null, w = b.priorityLevel; var ae = D(b.expirationTime <= ue); ue = t.unstable_now(), typeof ae == "function" ? b.callback = ae : b === n(p) && i(p), le(ue); } else i(p); b = n(p); } if (b !== null) var Ve = !0; else { var F = n(v); F !== null && ge(ne, F.startTime - ue), Ve = !1; } return Ve; } finally { b = null, w = M, T = !1; } } var ye = !1, me = null, Fe = -1, Re = 5, ut = -1; function He() { return !(t.unstable_now() - ut < Re); } function We() { if (me !== null) { var te = t.unstable_now(); ut = te; var ue = !0; try { ue = me(!0, te); } finally { ue ? ot() : (ye = !1, me = null); } } else ye = !1; } var ot; if (typeof J == "function") ot = function() { J(We); }; else if (typeof MessageChannel < "u") { var W = new MessageChannel(), L = W.port2; W.port1.onmessage = We, ot = function() { L.postMessage(null); }; } else ot = function() { C(We, 0); }; function oe(te) { me = te, ye || (ye = !0, ot()); } function ge(te, ue) { Fe = C(function() { te(t.unstable_now()); }, ue); } t.unstable_IdlePriority = 5, t.unstable_ImmediatePriority = 1, t.unstable_LowPriority = 4, t.unstable_NormalPriority = 3, t.unstable_Profiling = null, t.unstable_UserBlockingPriority = 2, t.unstable_cancelCallback = function(te) { te.callback = null; }, t.unstable_continueExecution = function() { O || T || (O = !0, oe(he)); }, t.unstable_forceFrameRate = function(te) { 0 > te || 125 < te ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : Re = 0 < te ? Math.floor(1e3 / te) : 5; }, t.unstable_getCurrentPriorityLevel = function() { return w; }, t.unstable_getFirstCallbackNode = function() { return n(p); }, t.unstable_next = function(te) { switch (w) { case 1: case 2: case 3: var ue = 3; break; default: ue = w; } var M = w; w = ue; try { return te(); } finally { w = M; } }, t.unstable_pauseExecution = function() { }, t.unstable_requestPaint = function() { }, t.unstable_runWithPriority = function(te, ue) { switch (te) { case 1: case 2: case 3: case 4: case 5: break; default: te = 3; } var M = w; w = te; try { return ue(); } finally { w = M; } }, t.unstable_scheduleCallback = function(te, ue, M) { var D = t.unstable_now(); switch (typeof M == "object" && M !== null ? (M = M.delay, M = typeof M == "number" && 0 < M ? D + M : D) : M = D, te) { case 1: var ae = -1; break; case 2: ae = 250; break; case 5: ae = 1073741823; break; case 4: ae = 1e4; break; default: ae = 5e3; } return ae = M + ae, te = { id: k++, callback: ue, priorityLevel: te, startTime: M, expirationTime: ae, sortIndex: -1 }, M > D ? (te.sortIndex = M, e(v, te), n(p) === null && te === n(v) && (x ? ($(Fe), Fe = -1) : x = !0, ge(ne, M - D))) : (te.sortIndex = ae, e(p, te), O || T || (O = !0, oe(he))), te; }, t.unstable_shouldYield = He, t.unstable_wrapCallback = function(te) { var ue = w; return function() { var M = w; w = ue; try { return te.apply(this, arguments); } finally { w = M; } }; }; }(lm)), lm; } var L_; function UI() { return L_ || (L_ = 1, um.exports = jI()), um.exports; } /** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var D_; function BI() { if (D_) return Kn; D_ = 1; var t = ag(), e = UI(); function n(r) { for (var s = "https://reactjs.org/docs/error-decoder.html?invariant=" + r, u = 1; u < arguments.length; u++) s += "&args[]=" + encodeURIComponent(arguments[u]); return "Minified React error #" + r + "; visit " + s + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; } var i = /* @__PURE__ */ new Set(), o = {}; function a(r, s) { l(r, s), l(r + "Capture", s); } function l(r, s) { for (o[r] = s, r = 0; r < s.length; r++) i.add(s[r]); } var f = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), p = Object.prototype.hasOwnProperty, v = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, k = {}, b = {}; function w(r) { return p.call(b, r) ? !0 : p.call(k, r) ? !1 : v.test(r) ? b[r] = !0 : (k[r] = !0, !1); } function T(r, s, u, d) { if (u !== null && u.type === 0) return !1; switch (typeof s) { case "function": case "symbol": return !0; case "boolean": return d ? !1 : u !== null ? !u.acceptsBooleans : (r = r.toLowerCase().slice(0, 5), r !== "data-" && r !== "aria-"); default: return !1; } } function O(r, s, u, d) { if (s === null || typeof s > "u" || T(r, s, u, d)) return !0; if (d) return !1; if (u !== null) switch (u.type) { case 3: return !s; case 4: return s === !1; case 5: return isNaN(s); case 6: return isNaN(s) || 1 > s; } return !1; } function x(r, s, u, d, m, y, E) { this.acceptsBooleans = s === 2 || s === 3 || s === 4, this.attributeName = d, this.attributeNamespace = m, this.mustUseProperty = u, this.propertyName = r, this.type = s, this.sanitizeURL = y, this.removeEmptyString = E; } var C = {}; "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r) { C[r] = new x(r, 0, !1, r, null, !1, !1); }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(r) { var s = r[0]; C[s] = new x(s, 1, !1, r[1], null, !1, !1); }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(r) { C[r] = new x(r, 2, !1, r.toLowerCase(), null, !1, !1); }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(r) { C[r] = new x(r, 2, !1, r, null, !1, !1); }), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r) { C[r] = new x(r, 3, !1, r.toLowerCase(), null, !1, !1); }), ["checked", "multiple", "muted", "selected"].forEach(function(r) { C[r] = new x(r, 3, !0, r, null, !1, !1); }), ["capture", "download"].forEach(function(r) { C[r] = new x(r, 4, !1, r, null, !1, !1); }), ["cols", "rows", "size", "span"].forEach(function(r) { C[r] = new x(r, 6, !1, r, null, !1, !1); }), ["rowSpan", "start"].forEach(function(r) { C[r] = new x(r, 5, !1, r.toLowerCase(), null, !1, !1); }); var $ = /[\-:]([a-z])/g; function J(r) { return r[1].toUpperCase(); } "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r) { var s = r.replace( $, J ); C[s] = new x(s, 1, !1, r, null, !1, !1); }), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r) { var s = r.replace($, J); C[s] = new x(s, 1, !1, r, "http://www.w3.org/1999/xlink", !1, !1); }), ["xml:base", "xml:lang", "xml:space"].forEach(function(r) { var s = r.replace($, J); C[s] = new x(s, 1, !1, r, "http://www.w3.org/XML/1998/namespace", !1, !1); }), ["tabIndex", "crossOrigin"].forEach(function(r) { C[r] = new x(r, 1, !1, r.toLowerCase(), null, !1, !1); }), C.xlinkHref = new x("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1), ["src", "href", "action", "formAction"].forEach(function(r) { C[r] = new x(r, 1, !1, r.toLowerCase(), null, !0, !0); }); function le(r, s, u, d) { var m = C.hasOwnProperty(s) ? C[s] : null; (m !== null ? m.type !== 0 : d || !(2 < s.length) || s[0] !== "o" && s[0] !== "O" || s[1] !== "n" && s[1] !== "N") && (O(s, u, m, d) && (u = null), d || m === null ? w(s) && (u === null ? r.removeAttribute(s) : r.setAttribute(s, "" + u)) : m.mustUseProperty ? r[m.propertyName] = u === null ? m.type === 3 ? !1 : "" : u : (s = m.attributeName, d = m.attributeNamespace, u === null ? r.removeAttribute(s) : (m = m.type, u = m === 3 || m === 4 && u === !0 ? "" : "" + u, d ? r.setAttributeNS(d, s, u) : r.setAttribute(s, u)))); } var ne = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, he = Symbol.for("react.element"), ye = Symbol.for("react.portal"), me = Symbol.for("react.fragment"), Fe = Symbol.for("react.strict_mode"), Re = Symbol.for("react.profiler"), ut = Symbol.for("react.provider"), He = Symbol.for("react.context"), We = Symbol.for("react.forward_ref"), ot = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), oe = Symbol.for("react.lazy"), ge = Symbol.for("react.offscreen"), te = Symbol.iterator; function ue(r) { return r === null || typeof r != "object" ? null : (r = te && r[te] || r["@@iterator"], typeof r == "function" ? r : null); } var M = Object.assign, D; function ae(r) { if (D === void 0) try { throw Error(); } catch (u) { var s = u.stack.trim().match(/\n( *(at )?)/); D = s && s[1] || ""; } return ` ` + D + r; } var Ve = !1; function F(r, s) { if (!r || Ve) return ""; Ve = !0; var u = Error.prepareStackTrace; Error.prepareStackTrace = void 0; try { if (s) if (s = function() { throw Error(); }, Object.defineProperty(s.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(s, []); } catch (re) { var d = re; } Reflect.construct(r, [], s); } else { try { s.call(); } catch (re) { d = re; } r.call(s.prototype); } else { try { throw Error(); } catch (re) { d = re; } r(); } } catch (re) { if (re && d && typeof re.stack == "string") { for (var m = re.stack.split(` `), y = d.stack.split(` `), E = m.length - 1, R = y.length - 1; 1 <= E && 0 <= R && m[E] !== y[R]; ) R--; for (; 1 <= E && 0 <= R; E--, R--) if (m[E] !== y[R]) { if (E !== 1 || R !== 1) do if (E--, R--, 0 > R || m[E] !== y[R]) { var j = ` ` + m[E].replace(" at new ", " at "); return r.displayName && j.includes("") && (j = j.replace("", r.displayName)), j; } while (1 <= E && 0 <= R); break; } } } finally { Ve = !1, Error.prepareStackTrace = u; } return (r = r ? r.displayName || r.name : "") ? ae(r) : ""; } function Y(r) { switch (r.tag) { case 5: return ae(r.type); case 16: return ae("Lazy"); case 13: return ae("Suspense"); case 19: return ae("SuspenseList"); case 0: case 2: case 15: return r = F(r.type, !1), r; case 11: return r = F(r.type.render, !1), r; case 1: return r = F(r.type, !0), r; default: return ""; } } function nt(r) { if (r == null) return null; if (typeof r == "function") return r.displayName || r.name || null; if (typeof r == "string") return r; switch (r) { case me: return "Fragment"; case ye: return "Portal"; case Re: return "Profiler"; case Fe: return "StrictMode"; case ot: return "Suspense"; case W: return "SuspenseList"; } if (typeof r == "object") switch (r.$$typeof) { case He: return (r.displayName || "Context") + ".Consumer"; case ut: return (r._context.displayName || "Context") + ".Provider"; case We: var s = r.render; return r = r.displayName, r || (r = s.displayName || s.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r; case L: return s = r.displayName || null, s !== null ? s : nt(r.type) || "Memo"; case oe: s = r._payload, r = r._init; try { return nt(r(s)); } catch { } } return null; } function Te(r) { var s = r.type; switch (r.tag) { case 24: return "Cache"; case 9: return (s.displayName || "Context") + ".Consumer"; case 10: return (s._context.displayName || "Context") + ".Provider"; case 18: return "DehydratedFragment"; case 11: return r = s.render, r = r.displayName || r.name || "", s.displayName || (r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"); case 7: return "Fragment"; case 5: return s; case 4: return "Portal"; case 3: return "Root"; case 6: return "Text"; case 16: return nt(s); case 8: return s === Fe ? "StrictMode" : "Mode"; case 22: return "Offscreen"; case 12: return "Profiler"; case 21: return "Scope"; case 13: return "Suspense"; case 19: return "SuspenseList"; case 25: return "TracingMarker"; case 1: case 0: case 17: case 2: case 14: case 15: if (typeof s == "function") return s.displayName || s.name || null; if (typeof s == "string") return s; } return null; } function ze(r) { switch (typeof r) { case "boolean": case "number": case "string": case "undefined": return r; case "object": return r; default: return ""; } } function Ce(r) { var s = r.type; return (r = r.nodeName) && r.toLowerCase() === "input" && (s === "checkbox" || s === "radio"); } function kt(r) { var s = Ce(r) ? "checked" : "value", u = Object.getOwnPropertyDescriptor(r.constructor.prototype, s), d = "" + r[s]; if (!r.hasOwnProperty(s) && typeof u < "u" && typeof u.get == "function" && typeof u.set == "function") { var m = u.get, y = u.set; return Object.defineProperty(r, s, { configurable: !0, get: function() { return m.call(this); }, set: function(E) { d = "" + E, y.call(this, E); } }), Object.defineProperty(r, s, { enumerable: u.enumerable }), { getValue: function() { return d; }, setValue: function(E) { d = "" + E; }, stopTracking: function() { r._valueTracker = null, delete r[s]; } }; } } function wt(r) { r._valueTracker || (r._valueTracker = kt(r)); } function et(r) { if (!r) return !1; var s = r._valueTracker; if (!s) return !0; var u = s.getValue(), d = ""; return r && (d = Ce(r) ? r.checked ? "true" : "false" : r.value), r = d, r !== u ? (s.setValue(r), !0) : !1; } function tn(r) { if (r = r || (typeof document < "u" ? document : void 0), typeof r > "u") return null; try { return r.activeElement || r.body; } catch { return r.body; } } function Bt(r, s) { var u = s.checked; return M({}, s, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: u ?? r._wrapperState.initialChecked }); } function Ze(r, s) { var u = s.defaultValue == null ? "" : s.defaultValue, d = s.checked != null ? s.checked : s.defaultChecked; u = ze(s.value != null ? s.value : u), r._wrapperState = { initialChecked: d, initialValue: u, controlled: s.type === "checkbox" || s.type === "radio" ? s.checked != null : s.value != null }; } function Yt(r, s) { s = s.checked, s != null && le(r, "checked", s, !1); } function Lt(r, s) { Yt(r, s); var u = ze(s.value), d = s.type; if (u != null) d === "number" ? (u === 0 && r.value === "" || r.value != u) && (r.value = "" + u) : r.value !== "" + u && (r.value = "" + u); else if (d === "submit" || d === "reset") { r.removeAttribute("value"); return; } s.hasOwnProperty("value") ? Et(r, s.type, u) : s.hasOwnProperty("defaultValue") && Et(r, s.type, ze(s.defaultValue)), s.checked == null && s.defaultChecked != null && (r.defaultChecked = !!s.defaultChecked); } function $e(r, s, u) { if (s.hasOwnProperty("value") || s.hasOwnProperty("defaultValue")) { var d = s.type; if (!(d !== "submit" && d !== "reset" || s.value !== void 0 && s.value !== null)) return; s = "" + r._wrapperState.initialValue, u || s === r.value || (r.value = s), r.defaultValue = s; } u = r.name, u !== "" && (r.name = ""), r.defaultChecked = !!r._wrapperState.initialChecked, u !== "" && (r.name = u); } function Et(r, s, u) { (s !== "number" || tn(r.ownerDocument) !== r) && (u == null ? r.defaultValue = "" + r._wrapperState.initialValue : r.defaultValue !== "" + u && (r.defaultValue = "" + u)); } var Oe = Array.isArray; function tt(r, s, u, d) { if (r = r.options, s) { s = {}; for (var m = 0; m < u.length; m++) s["$" + u[m]] = !0; for (u = 0; u < r.length; u++) m = s.hasOwnProperty("$" + r[u].value), r[u].selected !== m && (r[u].selected = m), m && d && (r[u].defaultSelected = !0); } else { for (u = "" + ze(u), s = null, m = 0; m < r.length; m++) { if (r[m].value === u) { r[m].selected = !0, d && (r[m].defaultSelected = !0); return; } s !== null || r[m].disabled || (s = r[m]); } s !== null && (s.selected = !0); } } function Rt(r, s) { if (s.dangerouslySetInnerHTML != null) throw Error(n(91)); return M({}, s, { value: void 0, defaultValue: void 0, children: "" + r._wrapperState.initialValue }); } function Kt(r, s) { var u = s.value; if (u == null) { if (u = s.children, s = s.defaultValue, u != null) { if (s != null) throw Error(n(92)); if (Oe(u)) { if (1 < u.length) throw Error(n(93)); u = u[0]; } s = u; } s == null && (s = ""), u = s; } r._wrapperState = { initialValue: ze(u) }; } function Vt(r, s) { var u = ze(s.value), d = ze(s.defaultValue); u != null && (u = "" + u, u !== r.value && (r.value = u), s.defaultValue == null && r.defaultValue !== u && (r.defaultValue = u)), d != null && (r.defaultValue = "" + d); } function vr(r) { var s = r.textContent; s === r._wrapperState.initialValue && s !== "" && s !== null && (r.value = s); } function Dn(r) { switch (r) { case "svg": return "http://www.w3.org/2000/svg"; case "math": return "http://www.w3.org/1998/Math/MathML"; default: return "http://www.w3.org/1999/xhtml"; } } function Lr(r, s) { return r == null || r === "http://www.w3.org/1999/xhtml" ? Dn(s) : r === "http://www.w3.org/2000/svg" && s === "foreignObject" ? "http://www.w3.org/1999/xhtml" : r; } var hs, ps = function(r) { return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(s, u, d, m) { MSApp.execUnsafeLocalFunction(function() { return r(s, u, d, m); }); } : r; }(function(r, s) { if (r.namespaceURI !== "http://www.w3.org/2000/svg" || "innerHTML" in r) r.innerHTML = s; else { for (hs = hs || document.createElement("div"), hs.innerHTML = "" + s.valueOf().toString() + "", s = hs.firstChild; r.firstChild; ) r.removeChild(r.firstChild); for (; s.firstChild; ) r.appendChild(s.firstChild); } }); function Ci(r, s) { if (s) { var u = r.firstChild; if (u && u === r.lastChild && u.nodeType === 3) { u.nodeValue = s; return; } } r.textContent = s; } var ri = { animationIterationCount: !0, aspectRatio: !0, borderImageOutset: !0, borderImageSlice: !0, borderImageWidth: !0, boxFlex: !0, boxFlexGroup: !0, boxOrdinalGroup: !0, columnCount: !0, columns: !0, flex: !0, flexGrow: !0, flexPositive: !0, flexShrink: !0, flexNegative: !0, flexOrder: !0, gridArea: !0, gridRow: !0, gridRowEnd: !0, gridRowSpan: !0, gridRowStart: !0, gridColumn: !0, gridColumnEnd: !0, gridColumnSpan: !0, gridColumnStart: !0, fontWeight: !0, lineClamp: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, tabSize: !0, widows: !0, zIndex: !0, zoom: !0, fillOpacity: !0, floodOpacity: !0, stopOpacity: !0, strokeDasharray: !0, strokeDashoffset: !0, strokeMiterlimit: !0, strokeOpacity: !0, strokeWidth: !0 }, Oi = ["Webkit", "ms", "Moz", "O"]; Object.keys(ri).forEach(function(r) { Oi.forEach(function(s) { s = s + r.charAt(0).toUpperCase() + r.substring(1), ri[s] = ri[r]; }); }); function ao(r, s, u) { return s == null || typeof s == "boolean" || s === "" ? "" : u || typeof s != "number" || s === 0 || ri.hasOwnProperty(r) && ri[r] ? ("" + s).trim() : s + "px"; } function ua(r, s) { r = r.style; for (var u in s) if (s.hasOwnProperty(u)) { var d = u.indexOf("--") === 0, m = ao(u, s[u], d); u === "float" && (u = "cssFloat"), d ? r.setProperty(u, m) : r[u] = m; } } var ii = M({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 }); function Ye(r, s) { if (s) { if (ii[r] && (s.children != null || s.dangerouslySetInnerHTML != null)) throw Error(n(137, r)); if (s.dangerouslySetInnerHTML != null) { if (s.children != null) throw Error(n(60)); if (typeof s.dangerouslySetInnerHTML != "object" || !("__html" in s.dangerouslySetInnerHTML)) throw Error(n(61)); } if (s.style != null && typeof s.style != "object") throw Error(n(62)); } } function Ti(r, s) { if (r.indexOf("-") === -1) return typeof s.is == "string"; switch (r) { case "annotation-xml": case "color-profile": case "font-face": case "font-face-src": case "font-face-uri": case "font-face-format": case "font-face-name": case "missing-glyph": return !1; default: return !0; } } var Dr = null; function ms(r) { return r = r.target || r.srcElement || window, r.correspondingUseElement && (r = r.correspondingUseElement), r.nodeType === 3 ? r.parentNode : r; } var je = null, si = null, Ri = null; function la(r) { if (r = qu(r)) { if (typeof je != "function") throw Error(n(280)); var s = r.stateNode; s && (s = Oc(s), je(r.stateNode, r.type, s)); } } function Eu(r) { si ? Ri ? Ri.push(r) : Ri = [r] : si = r; } function ca() { if (si) { var r = si, s = Ri; if (Ri = si = null, la(r), s) for (r = 0; r < s.length; r++) la(s[r]); } } function rc(r, s) { return r(s); } function ic() { } var oi = !1; function Ii(r, s, u) { if (oi) return r(s, u); oi = !0; try { return rc(r, s, u); } finally { oi = !1, (si !== null || Ri !== null) && (ic(), ca()); } } function Pi(r, s) { var u = r.stateNode; if (u === null) return null; var d = Oc(u); if (d === null) return null; u = d[s]; e: switch (s) { case "onClick": case "onClickCapture": case "onDoubleClick": case "onDoubleClickCapture": case "onMouseDown": case "onMouseDownCapture": case "onMouseMove": case "onMouseMoveCapture": case "onMouseUp": case "onMouseUpCapture": case "onMouseEnter": (d = !d.disabled) || (r = r.type, d = !(r === "button" || r === "input" || r === "select" || r === "textarea")), r = !d; break e; default: r = !1; } if (r) return null; if (u && typeof u != "function") throw Error(n(231, s, typeof u)); return u; } var gs = !1; if (f) try { var It = {}; Object.defineProperty(It, "passive", { get: function() { gs = !0; } }), window.addEventListener("test", It, It), window.removeEventListener("test", It, It); } catch { gs = !1; } function an(r, s, u, d, m, y, E, R, j) { var re = Array.prototype.slice.call(arguments, 3); try { s.apply(u, re); } catch (Se) { this.onError(Se); } } var uo = !1, Li = null, Di = !1, ys = null, Wf = { onError: function(r) { uo = !0, Li = r; } }; function ai(r, s, u, d, m, y, E, R, j) { uo = !1, Li = null, an.apply(Wf, arguments); } function vs(r, s, u, d, m, y, E, R, j) { if (ai.apply(this, arguments), uo) { if (uo) { var re = Li; uo = !1, Li = null; } else throw Error(n(198)); Di || (Di = !0, ys = re); } } function Nn(r) { var s = r, u = r; if (r.alternate) for (; s.return; ) s = s.return; else { r = s; do s = r, s.flags & 4098 && (u = s.return), r = s.return; while (r); } return s.tag === 3 ? u : null; } function lo(r) { if (r.tag === 13) { var s = r.memoizedState; if (s === null && (r = r.alternate, r !== null && (s = r.memoizedState)), s !== null) return s.dehydrated; } return null; } function sc(r) { if (Nn(r) !== r) throw Error(n(188)); } function ui(r) { var s = r.alternate; if (!s) { if (s = Nn(r), s === null) throw Error(n(188)); return s !== r ? null : r; } for (var u = r, d = s; ; ) { var m = u.return; if (m === null) break; var y = m.alternate; if (y === null) { if (d = m.return, d !== null) { u = d; continue; } break; } if (m.child === y.child) { for (y = m.child; y; ) { if (y === u) return sc(m), r; if (y === d) return sc(m), s; y = y.sibling; } throw Error(n(188)); } if (u.return !== d.return) u = m, d = y; else { for (var E = !1, R = m.child; R; ) { if (R === u) { E = !0, u = m, d = y; break; } if (R === d) { E = !0, d = m, u = y; break; } R = R.sibling; } if (!E) { for (R = y.child; R; ) { if (R === u) { E = !0, u = y, d = m; break; } if (R === d) { E = !0, d = y, u = m; break; } R = R.sibling; } if (!E) throw Error(n(189)); } } if (u.alternate !== d) throw Error(n(190)); } if (u.tag !== 3) throw Error(n(188)); return u.stateNode.current === u ? r : s; } function Nu(r) { return r = ui(r), r !== null ? li(r) : null; } function li(r) { if (r.tag === 5 || r.tag === 6) return r; for (r = r.child; r !== null; ) { var s = li(r); if (s !== null) return s; r = r.sibling; } return null; } var Au = e.unstable_scheduleCallback, da = e.unstable_cancelCallback, Xt = e.unstable_shouldYield, Fi = e.unstable_requestPaint, Ot = e.unstable_now, oc = e.unstable_getCurrentPriorityLevel, ci = e.unstable_ImmediatePriority, co = e.unstable_UserBlockingPriority, ks = e.unstable_NormalPriority, xu = e.unstable_LowPriority, di = e.unstable_IdlePriority, fo = null, Fn = null; function ac(r) { if (Fn && typeof Fn.onCommitFiberRoot == "function") try { Fn.onCommitFiberRoot(fo, r, void 0, (r.current.flags & 128) === 128); } catch { } } var lt = Math.clz32 ? Math.clz32 : cc, uc = Math.log, lc = Math.LN2; function cc(r) { return r >>>= 0, r === 0 ? 32 : 31 - (uc(r) / lc | 0) | 0; } var Pt = 64, fi = 4194304; function Fr(r) { switch (r & -r) { case 1: return 1; case 2: return 2; case 4: return 4; case 8: return 8; case 16: return 16; case 32: return 32; case 64: case 128: case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: return r & 4194240; case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: return r & 130023424; case 134217728: return 134217728; case 268435456: return 268435456; case 536870912: return 536870912; case 1073741824: return 1073741824; default: return r; } } function Mr(r, s) { var u = r.pendingLanes; if (u === 0) return 0; var d = 0, m = r.suspendedLanes, y = r.pingedLanes, E = u & 268435455; if (E !== 0) { var R = E & ~m; R !== 0 ? d = Fr(R) : (y &= E, y !== 0 && (d = Fr(y))); } else E = u & ~m, E !== 0 ? d = Fr(E) : y !== 0 && (d = Fr(y)); if (d === 0) return 0; if (s !== 0 && s !== d && !(s & m) && (m = d & -d, y = s & -s, m >= y || m === 16 && (y & 4194240) !== 0)) return s; if (d & 4 && (d |= u & 16), s = r.entangledLanes, s !== 0) for (r = r.entanglements, s &= d; 0 < s; ) u = 31 - lt(s), m = 1 << u, d |= r[u], s &= ~m; return d; } function Cu(r, s) { switch (r) { case 1: case 2: case 4: return s + 250; case 8: case 16: case 32: case 64: case 128: case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: return s + 5e3; case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: return -1; case 134217728: case 268435456: case 536870912: case 1073741824: return -1; default: return -1; } } function Ou(r, s) { for (var u = r.suspendedLanes, d = r.pingedLanes, m = r.expirationTimes, y = r.pendingLanes; 0 < y; ) { var E = 31 - lt(y), R = 1 << E, j = m[E]; j === -1 ? (!(R & u) || R & d) && (m[E] = Cu(R, s)) : j <= s && (r.expiredLanes |= R), y &= ~R; } } function _s(r) { return r = r.pendingLanes & -1073741825, r !== 0 ? r : r & 1073741824 ? 1073741824 : 0; } function Tu() { var r = Pt; return Pt <<= 1, !(Pt & 4194240) && (Pt = 64), r; } function ws(r) { for (var s = [], u = 0; 31 > u; u++) s.push(r); return s; } function Ss(r, s, u) { r.pendingLanes |= s, s !== 536870912 && (r.suspendedLanes = 0, r.pingedLanes = 0), r = r.eventTimes, s = 31 - lt(s), r[s] = u; } function ho(r, s) { var u = r.pendingLanes & ~s; r.pendingLanes = s, r.suspendedLanes = 0, r.pingedLanes = 0, r.expiredLanes &= s, r.mutableReadLanes &= s, r.entangledLanes &= s, s = r.entanglements; var d = r.eventTimes; for (r = r.expirationTimes; 0 < u; ) { var m = 31 - lt(u), y = 1 << m; s[m] = 0, d[m] = -1, r[m] = -1, u &= ~y; } } function fa(r, s) { var u = r.entangledLanes |= s; for (r = r.entanglements; u; ) { var d = 31 - lt(u), m = 1 << d; m & s | r[d] & s && (r[d] |= s), u &= ~m; } } var Tt = 0; function bt(r) { return r &= -r, 1 < r ? 4 < r ? r & 268435455 ? 16 : 536870912 : 4 : 1; } var ha, Ru, dc, An, Mi, bs = !1, rr = [], $r = null, jr = null, Mt = null, xn = /* @__PURE__ */ new Map(), Ur = /* @__PURE__ */ new Map(), jn = [], Iu = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); function Br(r, s) { switch (r) { case "focusin": case "focusout": $r = null; break; case "dragenter": case "dragleave": jr = null; break; case "mouseover": case "mouseout": Mt = null; break; case "pointerover": case "pointerout": xn.delete(s.pointerId); break; case "gotpointercapture": case "lostpointercapture": Ur.delete(s.pointerId); } } function po(r, s, u, d, m, y) { return r === null || r.nativeEvent !== y ? (r = { blockedOn: s, domEventName: u, eventSystemFlags: d, nativeEvent: y, targetContainers: [m] }, s !== null && (s = qu(s), s !== null && Ru(s)), r) : (r.eventSystemFlags |= d, s = r.targetContainers, m !== null && s.indexOf(m) === -1 && s.push(m), r); } function kr(r, s, u, d, m) { switch (s) { case "focusin": return $r = po($r, r, s, u, d, m), !0; case "dragenter": return jr = po(jr, r, s, u, d, m), !0; case "mouseover": return Mt = po(Mt, r, s, u, d, m), !0; case "pointerover": var y = m.pointerId; return xn.set(y, po(xn.get(y) || null, r, s, u, d, m)), !0; case "gotpointercapture": return y = m.pointerId, Ur.set(y, po(Ur.get(y) || null, r, s, u, d, m)), !0; } return !1; } function pa(r) { var s = Co(r.target); if (s !== null) { var u = Nn(s); if (u !== null) { if (s = u.tag, s === 13) { if (s = lo(u), s !== null) { r.blockedOn = s, Mi(r.priority, function() { dc(u); }); return; } } else if (s === 3 && u.stateNode.current.memoizedState.isDehydrated) { r.blockedOn = u.tag === 3 ? u.stateNode.containerInfo : null; return; } } } r.blockedOn = null; } function mo(r) { if (r.blockedOn !== null) return !1; for (var s = r.targetContainers; 0 < s.length; ) { var u = yo(r.domEventName, r.eventSystemFlags, s[0], r.nativeEvent); if (u === null) { u = r.nativeEvent; var d = new u.constructor(u.type, u); Dr = d, u.target.dispatchEvent(d), Dr = null; } else return s = qu(u), s !== null && Ru(s), r.blockedOn = u, !1; s.shift(); } return !0; } function ma(r, s, u) { mo(r) && u.delete(s); } function go() { bs = !1, $r !== null && mo($r) && ($r = null), jr !== null && mo(jr) && (jr = null), Mt !== null && mo(Mt) && (Mt = null), xn.forEach(ma), Ur.forEach(ma); } function $i(r, s) { r.blockedOn === s && (r.blockedOn = null, bs || (bs = !0, e.unstable_scheduleCallback(e.unstable_NormalPriority, go))); } function Es(r) { function s(m) { return $i(m, r); } if (0 < rr.length) { $i(rr[0], r); for (var u = 1; u < rr.length; u++) { var d = rr[u]; d.blockedOn === r && (d.blockedOn = null); } } for ($r !== null && $i($r, r), jr !== null && $i(jr, r), Mt !== null && $i(Mt, r), xn.forEach(s), Ur.forEach(s), u = 0; u < jn.length; u++) d = jn[u], d.blockedOn === r && (d.blockedOn = null); for (; 0 < jn.length && (u = jn[0], u.blockedOn === null); ) pa(u), u.blockedOn === null && jn.shift(); } var Ns = ne.ReactCurrentBatchConfig, hi = !0; function Qf(r, s, u, d) { var m = Tt, y = Ns.transition; Ns.transition = null; try { Tt = 1, As(r, s, u, d); } finally { Tt = m, Ns.transition = y; } } function Yf(r, s, u, d) { var m = Tt, y = Ns.transition; Ns.transition = null; try { Tt = 4, As(r, s, u, d); } finally { Tt = m, Ns.transition = y; } } function As(r, s, u, d) { if (hi) { var m = yo(r, s, u, d); if (m === null) ih(r, s, d, ji, u), Br(r, d); else if (kr(m, r, s, u, d)) d.stopPropagation(); else if (Br(r, d), s & 4 && -1 < Iu.indexOf(r)) { for (; m !== null; ) { var y = qu(m); if (y !== null && ha(y), y = yo(r, s, u, d), y === null && ih(r, s, d, ji, u), y === m) break; m = y; } m !== null && d.stopPropagation(); } else ih(r, s, d, null, u); } } var ji = null; function yo(r, s, u, d) { if (ji = null, r = ms(d), r = Co(r), r !== null) if (s = Nn(r), s === null) r = null; else if (u = s.tag, u === 13) { if (r = lo(s), r !== null) return r; r = null; } else if (u === 3) { if (s.stateNode.current.memoizedState.isDehydrated) return s.tag === 3 ? s.stateNode.containerInfo : null; r = null; } else s !== r && (r = null); return ji = r, null; } function fc(r) { switch (r) { case "cancel": case "click": case "close": case "contextmenu": case "copy": case "cut": case "auxclick": case "dblclick": case "dragend": case "dragstart": case "drop": case "focusin": case "focusout": case "input": case "invalid": case "keydown": case "keypress": case "keyup": case "mousedown": case "mouseup": case "paste": case "pause": case "play": case "pointercancel": case "pointerdown": case "pointerup": case "ratechange": case "reset": case "resize": case "seeked": case "submit": case "touchcancel": case "touchend": case "touchstart": case "volumechange": case "change": case "selectionchange": case "textInput": case "compositionstart": case "compositionend": case "compositionupdate": case "beforeblur": case "afterblur": case "beforeinput": case "blur": case "fullscreenchange": case "focus": case "hashchange": case "popstate": case "select": case "selectstart": return 1; case "drag": case "dragenter": case "dragexit": case "dragleave": case "dragover": case "mousemove": case "mouseout": case "mouseover": case "pointermove": case "pointerout": case "pointerover": case "scroll": case "toggle": case "touchmove": case "wheel": case "mouseenter": case "mouseleave": case "pointerenter": case "pointerleave": return 4; case "message": switch (oc()) { case ci: return 1; case co: return 4; case ks: case xu: return 16; case di: return 536870912; default: return 16; } default: return 16; } } var pi = null, Pu = null, xs = null; function ga() { if (xs) return xs; var r, s = Pu, u = s.length, d, m = "value" in pi ? pi.value : pi.textContent, y = m.length; for (r = 0; r < u && s[r] === m[r]; r++) ; var E = u - r; for (d = 1; d <= E && s[u - d] === m[y - d]; d++) ; return xs = m.slice(r, 1 < d ? 1 - d : void 0); } function vo(r) { var s = r.keyCode; return "charCode" in r ? (r = r.charCode, r === 0 && s === 13 && (r = 13)) : r = s, r === 10 && (r = 13), 32 <= r || r === 13 ? r : 0; } function Ui() { return !0; } function ko() { return !1; } function gn(r) { function s(u, d, m, y, E) { this._reactName = u, this._targetInst = m, this.type = d, this.nativeEvent = y, this.target = E, this.currentTarget = null; for (var R in r) r.hasOwnProperty(R) && (u = r[R], this[R] = u ? u(y) : y[R]); return this.isDefaultPrevented = (y.defaultPrevented != null ? y.defaultPrevented : y.returnValue === !1) ? Ui : ko, this.isPropagationStopped = ko, this; } return M(s.prototype, { preventDefault: function() { this.defaultPrevented = !0; var u = this.nativeEvent; u && (u.preventDefault ? u.preventDefault() : typeof u.returnValue != "unknown" && (u.returnValue = !1), this.isDefaultPrevented = Ui); }, stopPropagation: function() { var u = this.nativeEvent; u && (u.stopPropagation ? u.stopPropagation() : typeof u.cancelBubble != "unknown" && (u.cancelBubble = !0), this.isPropagationStopped = Ui); }, persist: function() { }, isPersistent: Ui }), s; } var Bi = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(r) { return r.timeStamp || Date.now(); }, defaultPrevented: 0, isTrusted: 0 }, Lu = gn(Bi), mi = M({}, Bi, { view: 0, detail: 0 }), Du = gn(mi), _o, wo, Vi, rn = M({}, mi, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: bo, button: 0, buttons: 0, relatedTarget: function(r) { return r.relatedTarget === void 0 ? r.fromElement === r.srcElement ? r.toElement : r.fromElement : r.relatedTarget; }, movementX: function(r) { return "movementX" in r ? r.movementX : (r !== Vi && (Vi && r.type === "mousemove" ? (_o = r.screenX - Vi.screenX, wo = r.screenY - Vi.screenY) : wo = _o = 0, Vi = r), _o); }, movementY: function(r) { return "movementY" in r ? r.movementY : wo; } }), Cs = gn(rn), So = M({}, rn, { dataTransfer: 0 }), hc = gn(So), ya = M({}, mi, { relatedTarget: 0 }), va = gn(ya), pc = M({}, Bi, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), ka = gn(pc), Fu = M({}, Bi, { clipboardData: function(r) { return "clipboardData" in r ? r.clipboardData : window.clipboardData; } }), zi = gn(Fu), Mu = M({}, Bi, { data: 0 }), _a = gn(Mu), wa = { Esc: "Escape", Spacebar: " ", Left: "ArrowLeft", Up: "ArrowUp", Right: "ArrowRight", Down: "ArrowDown", Del: "Delete", Win: "OS", Menu: "ContextMenu", Apps: "ContextMenu", Scroll: "ScrollLock", MozPrintableKey: "Unidentified" }, $u = { 8: "Backspace", 9: "Tab", 12: "Clear", 13: "Enter", 16: "Shift", 17: "Control", 18: "Alt", 19: "Pause", 20: "CapsLock", 27: "Escape", 32: " ", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "ArrowLeft", 38: "ArrowUp", 39: "ArrowRight", 40: "ArrowDown", 45: "Insert", 46: "Delete", 112: "F1", 113: "F2", 114: "F3", 115: "F4", 116: "F5", 117: "F6", 118: "F7", 119: "F8", 120: "F9", 121: "F10", 122: "F11", 123: "F12", 144: "NumLock", 145: "ScrollLock", 224: "Meta" }, mc = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; function Xf(r) { var s = this.nativeEvent; return s.getModifierState ? s.getModifierState(r) : (r = mc[r]) ? !!s[r] : !1; } function bo() { return Xf; } var Sa = M({}, mi, { key: function(r) { if (r.key) { var s = wa[r.key] || r.key; if (s !== "Unidentified") return s; } return r.type === "keypress" ? (r = vo(r), r === 13 ? "Enter" : String.fromCharCode(r)) : r.type === "keydown" || r.type === "keyup" ? $u[r.keyCode] || "Unidentified" : ""; }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: bo, charCode: function(r) { return r.type === "keypress" ? vo(r) : 0; }, keyCode: function(r) { return r.type === "keydown" || r.type === "keyup" ? r.keyCode : 0; }, which: function(r) { return r.type === "keypress" ? vo(r) : r.type === "keydown" || r.type === "keyup" ? r.keyCode : 0; } }), Jf = gn(Sa), ju = M({}, rn, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), ba = gn(ju), Zf = M({}, mi, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: bo }), gc = gn(Zf), eh = M({}, Bi, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), yc = gn(eh), vc = M({}, rn, { deltaX: function(r) { return "deltaX" in r ? r.deltaX : "wheelDeltaX" in r ? -r.wheelDeltaX : 0; }, deltaY: function(r) { return "deltaY" in r ? r.deltaY : "wheelDeltaY" in r ? -r.wheelDeltaY : "wheelDelta" in r ? -r.wheelDelta : 0; }, deltaZ: 0, deltaMode: 0 }), th = gn(vc), kc = [9, 13, 27, 32], Eo = f && "CompositionEvent" in window, Os = null; f && "documentMode" in document && (Os = document.documentMode); var _c = f && "TextEvent" in window && !Os, wc = f && (!Eo || Os && 8 < Os && 11 >= Os), Sc = " ", bc = !1; function No(r, s) { switch (r) { case "keyup": return kc.indexOf(s.keyCode) !== -1; case "keydown": return s.keyCode !== 229; case "keypress": case "mousedown": case "focusout": return !0; default: return !1; } } function _r(r) { return r = r.detail, typeof r == "object" && "data" in r ? r.data : null; } var Dt = !1; function Ea(r, s) { switch (r) { case "compositionend": return _r(s); case "keypress": return s.which !== 32 ? null : (bc = !0, Sc); case "textInput": return r = s.data, r === Sc && bc ? null : r; default: return null; } } function Un(r, s) { if (Dt) return r === "compositionend" || !Eo && No(r, s) ? (r = ga(), xs = Pu = pi = null, Dt = !1, r) : null; switch (r) { case "paste": return null; case "keypress": if (!(s.ctrlKey || s.altKey || s.metaKey) || s.ctrlKey && s.altKey) { if (s.char && 1 < s.char.length) return s.char; if (s.which) return String.fromCharCode(s.which); } return null; case "compositionend": return wc && s.locale !== "ko" ? null : s.data; default: return null; } } var nh = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0 }; function Na(r) { var s = r && r.nodeName && r.nodeName.toLowerCase(); return s === "input" ? !!nh[r.type] : s === "textarea"; } function Uu(r, s, u, d) { Eu(d), s = Ac(s, "onChange"), 0 < s.length && (u = new Lu("onChange", "change", null, u, d), r.push({ event: u, listeners: s })); } var ir = null, Hi = null; function Ts(r) { Jg(r, 0); } function sr(r) { var s = Ca(r); if (et(s)) return r; } function Ec(r, s) { if (r === "change") return s; } var c = !1; if (f) { var h; if (f) { var g = "oninput" in document; if (!g) { var _ = document.createElement("div"); _.setAttribute("oninput", "return;"), g = typeof _.oninput == "function"; } h = g; } else h = !1; c = h && (!document.documentMode || 9 < document.documentMode); } function S() { ir && (ir.detachEvent("onpropertychange", N), Hi = ir = null); } function N(r) { if (r.propertyName === "value" && sr(Hi)) { var s = []; Uu(s, Hi, r, ms(r)), Ii(Ts, s); } } function A(r, s, u) { r === "focusin" ? (S(), ir = s, Hi = u, ir.attachEvent("onpropertychange", N)) : r === "focusout" && S(); } function I(r) { if (r === "selectionchange" || r === "keyup" || r === "keydown") return sr(Hi); } function U(r, s) { if (r === "click") return sr(s); } function V(r, s) { if (r === "input" || r === "change") return sr(s); } function K(r, s) { return r === s && (r !== 0 || 1 / r === 1 / s) || r !== r && s !== s; } var P = typeof Object.is == "function" ? Object.is : K; function G(r, s) { if (P(r, s)) return !0; if (typeof r != "object" || r === null || typeof s != "object" || s === null) return !1; var u = Object.keys(r), d = Object.keys(s); if (u.length !== d.length) return !1; for (d = 0; d < u.length; d++) { var m = u[d]; if (!p.call(s, m) || !P(r[m], s[m])) return !1; } return !0; } function B(r) { for (; r && r.firstChild; ) r = r.firstChild; return r; } function q(r, s) { var u = B(r); r = 0; for (var d; u; ) { if (u.nodeType === 3) { if (d = r + u.textContent.length, r <= s && d >= s) return { node: u, offset: s - r }; r = d; } e: { for (; u; ) { if (u.nextSibling) { u = u.nextSibling; break e; } u = u.parentNode; } u = void 0; } u = B(u); } } function Q(r, s) { return r && s ? r === s ? !0 : r && r.nodeType === 3 ? !1 : s && s.nodeType === 3 ? Q(r, s.parentNode) : "contains" in r ? r.contains(s) : r.compareDocumentPosition ? !!(r.compareDocumentPosition(s) & 16) : !1 : !1; } function H() { for (var r = window, s = tn(); s instanceof r.HTMLIFrameElement; ) { try { var u = typeof s.contentWindow.location.href == "string"; } catch { u = !1; } if (u) r = s.contentWindow; else break; s = tn(r.document); } return s; } function Z(r) { var s = r && r.nodeName && r.nodeName.toLowerCase(); return s && (s === "input" && (r.type === "text" || r.type === "search" || r.type === "tel" || r.type === "url" || r.type === "password") || s === "textarea" || r.contentEditable === "true"); } function ie(r) { var s = H(), u = r.focusedElem, d = r.selectionRange; if (s !== u && u && u.ownerDocument && Q(u.ownerDocument.documentElement, u)) { if (d !== null && Z(u)) { if (s = d.start, r = d.end, r === void 0 && (r = s), "selectionStart" in u) u.selectionStart = s, u.selectionEnd = Math.min(r, u.value.length); else if (r = (s = u.ownerDocument || document) && s.defaultView || window, r.getSelection) { r = r.getSelection(); var m = u.textContent.length, y = Math.min(d.start, m); d = d.end === void 0 ? y : Math.min(d.end, m), !r.extend && y > d && (m = d, d = y, y = m), m = q(u, y); var E = q( u, d ); m && E && (r.rangeCount !== 1 || r.anchorNode !== m.node || r.anchorOffset !== m.offset || r.focusNode !== E.node || r.focusOffset !== E.offset) && (s = s.createRange(), s.setStart(m.node, m.offset), r.removeAllRanges(), y > d ? (r.addRange(s), r.extend(E.node, E.offset)) : (s.setEnd(E.node, E.offset), r.addRange(s))); } } for (s = [], r = u; r = r.parentNode; ) r.nodeType === 1 && s.push({ element: r, left: r.scrollLeft, top: r.scrollTop }); for (typeof u.focus == "function" && u.focus(), u = 0; u < s.length; u++) r = s[u], r.element.scrollLeft = r.left, r.element.scrollTop = r.top; } } var se = f && "documentMode" in document && 11 >= document.documentMode, fe = null, Ae = null, De = null, xe = !1; function Ie(r, s, u) { var d = u.window === u ? u.document : u.nodeType === 9 ? u : u.ownerDocument; xe || fe == null || fe !== tn(d) || (d = fe, "selectionStart" in d && Z(d) ? d = { start: d.selectionStart, end: d.selectionEnd } : (d = (d.ownerDocument && d.ownerDocument.defaultView || window).getSelection(), d = { anchorNode: d.anchorNode, anchorOffset: d.anchorOffset, focusNode: d.focusNode, focusOffset: d.focusOffset }), De && G(De, d) || (De = d, d = Ac(Ae, "onSelect"), 0 < d.length && (s = new Lu("onSelect", "select", null, s, u), r.push({ event: s, listeners: d }), s.target = fe))); } function Me(r, s) { var u = {}; return u[r.toLowerCase()] = s.toLowerCase(), u["Webkit" + r] = "webkit" + s, u["Moz" + r] = "moz" + s, u; } var Pe = { animationend: Me("Animation", "AnimationEnd"), animationiteration: Me("Animation", "AnimationIteration"), animationstart: Me("Animation", "AnimationStart"), transitionend: Me("Transition", "TransitionEnd") }, Ue = {}, ht = {}; f && (ht = document.createElement("div").style, "AnimationEvent" in window || (delete Pe.animationend.animation, delete Pe.animationiteration.animation, delete Pe.animationstart.animation), "TransitionEvent" in window || delete Pe.transitionend.transition); function mt(r) { if (Ue[r]) return Ue[r]; if (!Pe[r]) return r; var s = Pe[r], u; for (u in s) if (s.hasOwnProperty(u) && u in ht) return Ue[r] = s[u]; return r; } var vt = mt("animationend"), Cn = mt("animationiteration"), ft = mt("animationstart"), fn = mt("transitionend"), hn = /* @__PURE__ */ new Map(), Ao = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); function Gt(r, s) { hn.set(r, s), a(s, [r]); } for (var Vr = 0; Vr < Ao.length; Vr++) { var xo = Ao[Vr], Q0 = xo.toLowerCase(), Y0 = xo[0].toUpperCase() + xo.slice(1); Gt(Q0, "on" + Y0); } Gt(vt, "onAnimationEnd"), Gt(Cn, "onAnimationIteration"), Gt(ft, "onAnimationStart"), Gt("dblclick", "onDoubleClick"), Gt("focusin", "onFocus"), Gt("focusout", "onBlur"), Gt(fn, "onTransitionEnd"), l("onMouseEnter", ["mouseout", "mouseover"]), l("onMouseLeave", ["mouseout", "mouseover"]), l("onPointerEnter", ["pointerout", "pointerover"]), l("onPointerLeave", ["pointerout", "pointerover"]), a("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")), a("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")), a("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), a("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")), a("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")), a("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); var Bu = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), X0 = new Set("cancel close invalid load scroll toggle".split(" ").concat(Bu)); function Xg(r, s, u) { var d = r.type || "unknown-event"; r.currentTarget = u, vs(d, s, void 0, r), r.currentTarget = null; } function Jg(r, s) { s = (s & 4) !== 0; for (var u = 0; u < r.length; u++) { var d = r[u], m = d.event; d = d.listeners; e: { var y = void 0; if (s) for (var E = d.length - 1; 0 <= E; E--) { var R = d[E], j = R.instance, re = R.currentTarget; if (R = R.listener, j !== y && m.isPropagationStopped()) break e; Xg(m, R, re), y = j; } else for (E = 0; E < d.length; E++) { if (R = d[E], j = R.instance, re = R.currentTarget, R = R.listener, j !== y && m.isPropagationStopped()) break e; Xg(m, R, re), y = j; } } } if (Di) throw r = ys, Di = !1, ys = null, r; } function zt(r, s) { var u = s[ch]; u === void 0 && (u = s[ch] = /* @__PURE__ */ new Set()); var d = r + "__bubble"; u.has(d) || (Zg(s, r, 2, !1), u.add(d)); } function rh(r, s, u) { var d = 0; s && (d |= 4), Zg(u, r, d, s); } var Nc = "_reactListening" + Math.random().toString(36).slice(2); function Vu(r) { if (!r[Nc]) { r[Nc] = !0, i.forEach(function(u) { u !== "selectionchange" && (X0.has(u) || rh(u, !1, r), rh(u, !0, r)); }); var s = r.nodeType === 9 ? r : r.ownerDocument; s === null || s[Nc] || (s[Nc] = !0, rh("selectionchange", !1, s)); } } function Zg(r, s, u, d) { switch (fc(s)) { case 1: var m = Qf; break; case 4: m = Yf; break; default: m = As; } u = m.bind(null, s, u, r), m = void 0, !gs || s !== "touchstart" && s !== "touchmove" && s !== "wheel" || (m = !0), d ? m !== void 0 ? r.addEventListener(s, u, { capture: !0, passive: m }) : r.addEventListener(s, u, !0) : m !== void 0 ? r.addEventListener(s, u, { passive: m }) : r.addEventListener(s, u, !1); } function ih(r, s, u, d, m) { var y = d; if (!(s & 1) && !(s & 2) && d !== null) e: for (; ; ) { if (d === null) return; var E = d.tag; if (E === 3 || E === 4) { var R = d.stateNode.containerInfo; if (R === m || R.nodeType === 8 && R.parentNode === m) break; if (E === 4) for (E = d.return; E !== null; ) { var j = E.tag; if ((j === 3 || j === 4) && (j = E.stateNode.containerInfo, j === m || j.nodeType === 8 && j.parentNode === m)) return; E = E.return; } for (; R !== null; ) { if (E = Co(R), E === null) return; if (j = E.tag, j === 5 || j === 6) { d = y = E; continue e; } R = R.parentNode; } } d = d.return; } Ii(function() { var re = y, Se = ms(u), Ee = []; e: { var _e = hn.get(r); if (_e !== void 0) { var Be = Lu, Ge = r; switch (r) { case "keypress": if (vo(u) === 0) break e; case "keydown": case "keyup": Be = Jf; break; case "focusin": Ge = "focus", Be = va; break; case "focusout": Ge = "blur", Be = va; break; case "beforeblur": case "afterblur": Be = va; break; case "click": if (u.button === 2) break e; case "auxclick": case "dblclick": case "mousedown": case "mousemove": case "mouseup": case "mouseout": case "mouseover": case "contextmenu": Be = Cs; break; case "drag": case "dragend": case "dragenter": case "dragexit": case "dragleave": case "dragover": case "dragstart": case "drop": Be = hc; break; case "touchcancel": case "touchend": case "touchmove": case "touchstart": Be = gc; break; case vt: case Cn: case ft: Be = ka; break; case fn: Be = yc; break; case "scroll": Be = Du; break; case "wheel": Be = th; break; case "copy": case "cut": case "paste": Be = zi; break; case "gotpointercapture": case "lostpointercapture": case "pointercancel": case "pointerdown": case "pointermove": case "pointerout": case "pointerover": case "pointerup": Be = ba; } var Xe = (s & 4) !== 0, sn = !Xe && r === "scroll", X = Xe ? _e !== null ? _e + "Capture" : null : _e; Xe = []; for (var z = re, ee; z !== null; ) { ee = z; var Le = ee.stateNode; if (ee.tag === 5 && Le !== null && (ee = Le, X !== null && (Le = Pi(z, X), Le != null && Xe.push(zu(z, Le, ee)))), sn) break; z = z.return; } 0 < Xe.length && (_e = new Be(_e, Ge, null, u, Se), Ee.push({ event: _e, listeners: Xe })); } } if (!(s & 7)) { e: { if (_e = r === "mouseover" || r === "pointerover", Be = r === "mouseout" || r === "pointerout", _e && u !== Dr && (Ge = u.relatedTarget || u.fromElement) && (Co(Ge) || Ge[qi])) break e; if ((Be || _e) && (_e = Se.window === Se ? Se : (_e = Se.ownerDocument) ? _e.defaultView || _e.parentWindow : window, Be ? (Ge = u.relatedTarget || u.toElement, Be = re, Ge = Ge ? Co(Ge) : null, Ge !== null && (sn = Nn(Ge), Ge !== sn || Ge.tag !== 5 && Ge.tag !== 6) && (Ge = null)) : (Be = null, Ge = re), Be !== Ge)) { if (Xe = Cs, Le = "onMouseLeave", X = "onMouseEnter", z = "mouse", (r === "pointerout" || r === "pointerover") && (Xe = ba, Le = "onPointerLeave", X = "onPointerEnter", z = "pointer"), sn = Be == null ? _e : Ca(Be), ee = Ge == null ? _e : Ca(Ge), _e = new Xe(Le, z + "leave", Be, u, Se), _e.target = sn, _e.relatedTarget = ee, Le = null, Co(Se) === re && (Xe = new Xe(X, z + "enter", Ge, u, Se), Xe.target = ee, Xe.relatedTarget = sn, Le = Xe), sn = Le, Be && Ge) t: { for (Xe = Be, X = Ge, z = 0, ee = Xe; ee; ee = Aa(ee)) z++; for (ee = 0, Le = X; Le; Le = Aa(Le)) ee++; for (; 0 < z - ee; ) Xe = Aa(Xe), z--; for (; 0 < ee - z; ) X = Aa(X), ee--; for (; z--; ) { if (Xe === X || X !== null && Xe === X.alternate) break t; Xe = Aa(Xe), X = Aa(X); } Xe = null; } else Xe = null; Be !== null && ey(Ee, _e, Be, Xe, !1), Ge !== null && sn !== null && ey(Ee, sn, Ge, Xe, !0); } } e: { if (_e = re ? Ca(re) : window, Be = _e.nodeName && _e.nodeName.toLowerCase(), Be === "select" || Be === "input" && _e.type === "file") var Je = Ec; else if (Na(_e)) if (c) Je = V; else { Je = I; var rt = A; } else (Be = _e.nodeName) && Be.toLowerCase() === "input" && (_e.type === "checkbox" || _e.type === "radio") && (Je = U); if (Je && (Je = Je(r, re))) { Uu(Ee, Je, u, Se); break e; } rt && rt(r, _e, re), r === "focusout" && (rt = _e._wrapperState) && rt.controlled && _e.type === "number" && Et(_e, "number", _e.value); } switch (rt = re ? Ca(re) : window, r) { case "focusin": (Na(rt) || rt.contentEditable === "true") && (fe = rt, Ae = re, De = null); break; case "focusout": De = Ae = fe = null; break; case "mousedown": xe = !0; break; case "contextmenu": case "mouseup": case "dragend": xe = !1, Ie(Ee, u, Se); break; case "selectionchange": if (se) break; case "keydown": case "keyup": Ie(Ee, u, Se); } var it; if (Eo) e: { switch (r) { case "compositionstart": var ct = "onCompositionStart"; break e; case "compositionend": ct = "onCompositionEnd"; break e; case "compositionupdate": ct = "onCompositionUpdate"; break e; } ct = void 0; } else Dt ? No(r, u) && (ct = "onCompositionEnd") : r === "keydown" && u.keyCode === 229 && (ct = "onCompositionStart"); ct && (wc && u.locale !== "ko" && (Dt || ct !== "onCompositionStart" ? ct === "onCompositionEnd" && Dt && (it = ga()) : (pi = Se, Pu = "value" in pi ? pi.value : pi.textContent, Dt = !0)), rt = Ac(re, ct), 0 < rt.length && (ct = new _a(ct, r, null, u, Se), Ee.push({ event: ct, listeners: rt }), it ? ct.data = it : (it = _r(u), it !== null && (ct.data = it)))), (it = _c ? Ea(r, u) : Un(r, u)) && (re = Ac(re, "onBeforeInput"), 0 < re.length && (Se = new _a("onBeforeInput", "beforeinput", null, u, Se), Ee.push({ event: Se, listeners: re }), Se.data = it)); } Jg(Ee, s); }); } function zu(r, s, u) { return { instance: r, listener: s, currentTarget: u }; } function Ac(r, s) { for (var u = s + "Capture", d = []; r !== null; ) { var m = r, y = m.stateNode; m.tag === 5 && y !== null && (m = y, y = Pi(r, u), y != null && d.unshift(zu(r, y, m)), y = Pi(r, s), y != null && d.push(zu(r, y, m))), r = r.return; } return d; } function Aa(r) { if (r === null) return null; do r = r.return; while (r && r.tag !== 5); return r || null; } function ey(r, s, u, d, m) { for (var y = s._reactName, E = []; u !== null && u !== d; ) { var R = u, j = R.alternate, re = R.stateNode; if (j !== null && j === d) break; R.tag === 5 && re !== null && (R = re, m ? (j = Pi(u, y), j != null && E.unshift(zu(u, j, R))) : m || (j = Pi(u, y), j != null && E.push(zu(u, j, R)))), u = u.return; } E.length !== 0 && r.push({ event: s, listeners: E }); } var J0 = /\r\n?/g, Z0 = /\u0000|\uFFFD/g; function ty(r) { return (typeof r == "string" ? r : "" + r).replace(J0, ` `).replace(Z0, ""); } function xc(r, s, u) { if (s = ty(s), ty(r) !== s && u) throw Error(n(425)); } function Cc() { } var sh = null, oh = null; function ah(r, s) { return r === "textarea" || r === "noscript" || typeof s.children == "string" || typeof s.children == "number" || typeof s.dangerouslySetInnerHTML == "object" && s.dangerouslySetInnerHTML !== null && s.dangerouslySetInnerHTML.__html != null; } var uh = typeof setTimeout == "function" ? setTimeout : void 0, eE = typeof clearTimeout == "function" ? clearTimeout : void 0, ny = typeof Promise == "function" ? Promise : void 0, tE = typeof queueMicrotask == "function" ? queueMicrotask : typeof ny < "u" ? function(r) { return ny.resolve(null).then(r).catch(nE); } : uh; function nE(r) { setTimeout(function() { throw r; }); } function lh(r, s) { var u = s, d = 0; do { var m = u.nextSibling; if (r.removeChild(u), m && m.nodeType === 8) if (u = m.data, u === "/$") { if (d === 0) { r.removeChild(m), Es(s); return; } d--; } else u !== "$" && u !== "$?" && u !== "$!" || d++; u = m; } while (u); Es(s); } function Rs(r) { for (; r != null; r = r.nextSibling) { var s = r.nodeType; if (s === 1 || s === 3) break; if (s === 8) { if (s = r.data, s === "$" || s === "$!" || s === "$?") break; if (s === "/$") return null; } } return r; } function ry(r) { r = r.previousSibling; for (var s = 0; r; ) { if (r.nodeType === 8) { var u = r.data; if (u === "$" || u === "$!" || u === "$?") { if (s === 0) return r; s--; } else u === "/$" && s++; } r = r.previousSibling; } return null; } var xa = Math.random().toString(36).slice(2), gi = "__reactFiber$" + xa, Hu = "__reactProps$" + xa, qi = "__reactContainer$" + xa, ch = "__reactEvents$" + xa, rE = "__reactListeners$" + xa, iE = "__reactHandles$" + xa; function Co(r) { var s = r[gi]; if (s) return s; for (var u = r.parentNode; u; ) { if (s = u[qi] || u[gi]) { if (u = s.alternate, s.child !== null || u !== null && u.child !== null) for (r = ry(r); r !== null; ) { if (u = r[gi]) return u; r = ry(r); } return s; } r = u, u = r.parentNode; } return null; } function qu(r) { return r = r[gi] || r[qi], !r || r.tag !== 5 && r.tag !== 6 && r.tag !== 13 && r.tag !== 3 ? null : r; } function Ca(r) { if (r.tag === 5 || r.tag === 6) return r.stateNode; throw Error(n(33)); } function Oc(r) { return r[Hu] || null; } var dh = [], Oa = -1; function Is(r) { return { current: r }; } function Ht(r) { 0 > Oa || (r.current = dh[Oa], dh[Oa] = null, Oa--); } function jt(r, s) { Oa++, dh[Oa] = r.current, r.current = s; } var Ps = {}, On = Is(Ps), Bn = Is(!1), Oo = Ps; function Ta(r, s) { var u = r.type.contextTypes; if (!u) return Ps; var d = r.stateNode; if (d && d.__reactInternalMemoizedUnmaskedChildContext === s) return d.__reactInternalMemoizedMaskedChildContext; var m = {}, y; for (y in u) m[y] = s[y]; return d && (r = r.stateNode, r.__reactInternalMemoizedUnmaskedChildContext = s, r.__reactInternalMemoizedMaskedChildContext = m), m; } function Vn(r) { return r = r.childContextTypes, r != null; } function Tc() { Ht(Bn), Ht(On); } function iy(r, s, u) { if (On.current !== Ps) throw Error(n(168)); jt(On, s), jt(Bn, u); } function sy(r, s, u) { var d = r.stateNode; if (s = s.childContextTypes, typeof d.getChildContext != "function") return u; d = d.getChildContext(); for (var m in d) if (!(m in s)) throw Error(n(108, Te(r) || "Unknown", m)); return M({}, u, d); } function Rc(r) { return r = (r = r.stateNode) && r.__reactInternalMemoizedMergedChildContext || Ps, Oo = On.current, jt(On, r), jt(Bn, Bn.current), !0; } function oy(r, s, u) { var d = r.stateNode; if (!d) throw Error(n(169)); u ? (r = sy(r, s, Oo), d.__reactInternalMemoizedMergedChildContext = r, Ht(Bn), Ht(On), jt(On, r)) : Ht(Bn), jt(Bn, u); } var Ki = null, Ic = !1, fh = !1; function ay(r) { Ki === null ? Ki = [r] : Ki.push(r); } function sE(r) { Ic = !0, ay(r); } function Ls() { if (!fh && Ki !== null) { fh = !0; var r = 0, s = Tt; try { var u = Ki; for (Tt = 1; r < u.length; r++) { var d = u[r]; do d = d(!0); while (d !== null); } Ki = null, Ic = !1; } catch (m) { throw Ki !== null && (Ki = Ki.slice(r + 1)), Au(ci, Ls), m; } finally { Tt = s, fh = !1; } } return null; } var Ra = [], Ia = 0, Pc = null, Lc = 0, wr = [], Sr = 0, To = null, Gi = 1, Wi = ""; function Ro(r, s) { Ra[Ia++] = Lc, Ra[Ia++] = Pc, Pc = r, Lc = s; } function uy(r, s, u) { wr[Sr++] = Gi, wr[Sr++] = Wi, wr[Sr++] = To, To = r; var d = Gi; r = Wi; var m = 32 - lt(d) - 1; d &= ~(1 << m), u += 1; var y = 32 - lt(s) + m; if (30 < y) { var E = m - m % 5; y = (d & (1 << E) - 1).toString(32), d >>= E, m -= E, Gi = 1 << 32 - lt(s) + m | u << m | d, Wi = y + r; } else Gi = 1 << y | u << m | d, Wi = r; } function hh(r) { r.return !== null && (Ro(r, 1), uy(r, 1, 0)); } function ph(r) { for (; r === Pc; ) Pc = Ra[--Ia], Ra[Ia] = null, Lc = Ra[--Ia], Ra[Ia] = null; for (; r === To; ) To = wr[--Sr], wr[Sr] = null, Wi = wr[--Sr], wr[Sr] = null, Gi = wr[--Sr], wr[Sr] = null; } var or = null, ar = null, Wt = !1, zr = null; function ly(r, s) { var u = Ar(5, null, null, 0); u.elementType = "DELETED", u.stateNode = s, u.return = r, s = r.deletions, s === null ? (r.deletions = [u], r.flags |= 16) : s.push(u); } function cy(r, s) { switch (r.tag) { case 5: var u = r.type; return s = s.nodeType !== 1 || u.toLowerCase() !== s.nodeName.toLowerCase() ? null : s, s !== null ? (r.stateNode = s, or = r, ar = Rs(s.firstChild), !0) : !1; case 6: return s = r.pendingProps === "" || s.nodeType !== 3 ? null : s, s !== null ? (r.stateNode = s, or = r, ar = null, !0) : !1; case 13: return s = s.nodeType !== 8 ? null : s, s !== null ? (u = To !== null ? { id: Gi, overflow: Wi } : null, r.memoizedState = { dehydrated: s, treeContext: u, retryLane: 1073741824 }, u = Ar(18, null, null, 0), u.stateNode = s, u.return = r, r.child = u, or = r, ar = null, !0) : !1; default: return !1; } } function mh(r) { return (r.mode & 1) !== 0 && (r.flags & 128) === 0; } function gh(r) { if (Wt) { var s = ar; if (s) { var u = s; if (!cy(r, s)) { if (mh(r)) throw Error(n(418)); s = Rs(u.nextSibling); var d = or; s && cy(r, s) ? ly(d, u) : (r.flags = r.flags & -4097 | 2, Wt = !1, or = r); } } else { if (mh(r)) throw Error(n(418)); r.flags = r.flags & -4097 | 2, Wt = !1, or = r; } } } function dy(r) { for (r = r.return; r !== null && r.tag !== 5 && r.tag !== 3 && r.tag !== 13; ) r = r.return; or = r; } function Dc(r) { if (r !== or) return !1; if (!Wt) return dy(r), Wt = !0, !1; var s; if ((s = r.tag !== 3) && !(s = r.tag !== 5) && (s = r.type, s = s !== "head" && s !== "body" && !ah(r.type, r.memoizedProps)), s && (s = ar)) { if (mh(r)) throw fy(), Error(n(418)); for (; s; ) ly(r, s), s = Rs(s.nextSibling); } if (dy(r), r.tag === 13) { if (r = r.memoizedState, r = r !== null ? r.dehydrated : null, !r) throw Error(n(317)); e: { for (r = r.nextSibling, s = 0; r; ) { if (r.nodeType === 8) { var u = r.data; if (u === "/$") { if (s === 0) { ar = Rs(r.nextSibling); break e; } s--; } else u !== "$" && u !== "$!" && u !== "$?" || s++; } r = r.nextSibling; } ar = null; } } else ar = or ? Rs(r.stateNode.nextSibling) : null; return !0; } function fy() { for (var r = ar; r; ) r = Rs(r.nextSibling); } function Pa() { ar = or = null, Wt = !1; } function yh(r) { zr === null ? zr = [r] : zr.push(r); } var oE = ne.ReactCurrentBatchConfig; function Ku(r, s, u) { if (r = u.ref, r !== null && typeof r != "function" && typeof r != "object") { if (u._owner) { if (u = u._owner, u) { if (u.tag !== 1) throw Error(n(309)); var d = u.stateNode; } if (!d) throw Error(n(147, r)); var m = d, y = "" + r; return s !== null && s.ref !== null && typeof s.ref == "function" && s.ref._stringRef === y ? s.ref : (s = function(E) { var R = m.refs; E === null ? delete R[y] : R[y] = E; }, s._stringRef = y, s); } if (typeof r != "string") throw Error(n(284)); if (!u._owner) throw Error(n(290, r)); } return r; } function Fc(r, s) { throw r = Object.prototype.toString.call(s), Error(n(31, r === "[object Object]" ? "object with keys {" + Object.keys(s).join(", ") + "}" : r)); } function hy(r) { var s = r._init; return s(r._payload); } function py(r) { function s(X, z) { if (r) { var ee = X.deletions; ee === null ? (X.deletions = [z], X.flags |= 16) : ee.push(z); } } function u(X, z) { if (!r) return null; for (; z !== null; ) s(X, z), z = z.sibling; return null; } function d(X, z) { for (X = /* @__PURE__ */ new Map(); z !== null; ) z.key !== null ? X.set(z.key, z) : X.set(z.index, z), z = z.sibling; return X; } function m(X, z) { return X = Vs(X, z), X.index = 0, X.sibling = null, X; } function y(X, z, ee) { return X.index = ee, r ? (ee = X.alternate, ee !== null ? (ee = ee.index, ee < z ? (X.flags |= 2, z) : ee) : (X.flags |= 2, z)) : (X.flags |= 1048576, z); } function E(X) { return r && X.alternate === null && (X.flags |= 2), X; } function R(X, z, ee, Le) { return z === null || z.tag !== 6 ? (z = up(ee, X.mode, Le), z.return = X, z) : (z = m(z, ee), z.return = X, z); } function j(X, z, ee, Le) { var Je = ee.type; return Je === me ? Se(X, z, ee.props.children, Le, ee.key) : z !== null && (z.elementType === Je || typeof Je == "object" && Je !== null && Je.$$typeof === oe && hy(Je) === z.type) ? (Le = m(z, ee.props), Le.ref = Ku(X, z, ee), Le.return = X, Le) : (Le = od(ee.type, ee.key, ee.props, null, X.mode, Le), Le.ref = Ku(X, z, ee), Le.return = X, Le); } function re(X, z, ee, Le) { return z === null || z.tag !== 4 || z.stateNode.containerInfo !== ee.containerInfo || z.stateNode.implementation !== ee.implementation ? (z = lp(ee, X.mode, Le), z.return = X, z) : (z = m(z, ee.children || []), z.return = X, z); } function Se(X, z, ee, Le, Je) { return z === null || z.tag !== 7 ? (z = jo(ee, X.mode, Le, Je), z.return = X, z) : (z = m(z, ee), z.return = X, z); } function Ee(X, z, ee) { if (typeof z == "string" && z !== "" || typeof z == "number") return z = up("" + z, X.mode, ee), z.return = X, z; if (typeof z == "object" && z !== null) { switch (z.$$typeof) { case he: return ee = od(z.type, z.key, z.props, null, X.mode, ee), ee.ref = Ku(X, null, z), ee.return = X, ee; case ye: return z = lp(z, X.mode, ee), z.return = X, z; case oe: var Le = z._init; return Ee(X, Le(z._payload), ee); } if (Oe(z) || ue(z)) return z = jo(z, X.mode, ee, null), z.return = X, z; Fc(X, z); } return null; } function _e(X, z, ee, Le) { var Je = z !== null ? z.key : null; if (typeof ee == "string" && ee !== "" || typeof ee == "number") return Je !== null ? null : R(X, z, "" + ee, Le); if (typeof ee == "object" && ee !== null) { switch (ee.$$typeof) { case he: return ee.key === Je ? j(X, z, ee, Le) : null; case ye: return ee.key === Je ? re(X, z, ee, Le) : null; case oe: return Je = ee._init, _e( X, z, Je(ee._payload), Le ); } if (Oe(ee) || ue(ee)) return Je !== null ? null : Se(X, z, ee, Le, null); Fc(X, ee); } return null; } function Be(X, z, ee, Le, Je) { if (typeof Le == "string" && Le !== "" || typeof Le == "number") return X = X.get(ee) || null, R(z, X, "" + Le, Je); if (typeof Le == "object" && Le !== null) { switch (Le.$$typeof) { case he: return X = X.get(Le.key === null ? ee : Le.key) || null, j(z, X, Le, Je); case ye: return X = X.get(Le.key === null ? ee : Le.key) || null, re(z, X, Le, Je); case oe: var rt = Le._init; return Be(X, z, ee, rt(Le._payload), Je); } if (Oe(Le) || ue(Le)) return X = X.get(ee) || null, Se(z, X, Le, Je, null); Fc(z, Le); } return null; } function Ge(X, z, ee, Le) { for (var Je = null, rt = null, it = z, ct = z = 0, kn = null; it !== null && ct < ee.length; ct++) { it.index > ct ? (kn = it, it = null) : kn = it.sibling; var At = _e(X, it, ee[ct], Le); if (At === null) { it === null && (it = kn); break; } r && it && At.alternate === null && s(X, it), z = y(At, z, ct), rt === null ? Je = At : rt.sibling = At, rt = At, it = kn; } if (ct === ee.length) return u(X, it), Wt && Ro(X, ct), Je; if (it === null) { for (; ct < ee.length; ct++) it = Ee(X, ee[ct], Le), it !== null && (z = y(it, z, ct), rt === null ? Je = it : rt.sibling = it, rt = it); return Wt && Ro(X, ct), Je; } for (it = d(X, it); ct < ee.length; ct++) kn = Be(it, X, ct, ee[ct], Le), kn !== null && (r && kn.alternate !== null && it.delete(kn.key === null ? ct : kn.key), z = y(kn, z, ct), rt === null ? Je = kn : rt.sibling = kn, rt = kn); return r && it.forEach(function(zs) { return s(X, zs); }), Wt && Ro(X, ct), Je; } function Xe(X, z, ee, Le) { var Je = ue(ee); if (typeof Je != "function") throw Error(n(150)); if (ee = Je.call(ee), ee == null) throw Error(n(151)); for (var rt = Je = null, it = z, ct = z = 0, kn = null, At = ee.next(); it !== null && !At.done; ct++, At = ee.next()) { it.index > ct ? (kn = it, it = null) : kn = it.sibling; var zs = _e(X, it, At.value, Le); if (zs === null) { it === null && (it = kn); break; } r && it && zs.alternate === null && s(X, it), z = y(zs, z, ct), rt === null ? Je = zs : rt.sibling = zs, rt = zs, it = kn; } if (At.done) return u( X, it ), Wt && Ro(X, ct), Je; if (it === null) { for (; !At.done; ct++, At = ee.next()) At = Ee(X, At.value, Le), At !== null && (z = y(At, z, ct), rt === null ? Je = At : rt.sibling = At, rt = At); return Wt && Ro(X, ct), Je; } for (it = d(X, it); !At.done; ct++, At = ee.next()) At = Be(it, X, ct, At.value, Le), At !== null && (r && At.alternate !== null && it.delete(At.key === null ? ct : At.key), z = y(At, z, ct), rt === null ? Je = At : rt.sibling = At, rt = At); return r && it.forEach(function(jE) { return s(X, jE); }), Wt && Ro(X, ct), Je; } function sn(X, z, ee, Le) { if (typeof ee == "object" && ee !== null && ee.type === me && ee.key === null && (ee = ee.props.children), typeof ee == "object" && ee !== null) { switch (ee.$$typeof) { case he: e: { for (var Je = ee.key, rt = z; rt !== null; ) { if (rt.key === Je) { if (Je = ee.type, Je === me) { if (rt.tag === 7) { u(X, rt.sibling), z = m(rt, ee.props.children), z.return = X, X = z; break e; } } else if (rt.elementType === Je || typeof Je == "object" && Je !== null && Je.$$typeof === oe && hy(Je) === rt.type) { u(X, rt.sibling), z = m(rt, ee.props), z.ref = Ku(X, rt, ee), z.return = X, X = z; break e; } u(X, rt); break; } else s(X, rt); rt = rt.sibling; } ee.type === me ? (z = jo(ee.props.children, X.mode, Le, ee.key), z.return = X, X = z) : (Le = od(ee.type, ee.key, ee.props, null, X.mode, Le), Le.ref = Ku(X, z, ee), Le.return = X, X = Le); } return E(X); case ye: e: { for (rt = ee.key; z !== null; ) { if (z.key === rt) if (z.tag === 4 && z.stateNode.containerInfo === ee.containerInfo && z.stateNode.implementation === ee.implementation) { u(X, z.sibling), z = m(z, ee.children || []), z.return = X, X = z; break e; } else { u(X, z); break; } else s(X, z); z = z.sibling; } z = lp(ee, X.mode, Le), z.return = X, X = z; } return E(X); case oe: return rt = ee._init, sn(X, z, rt(ee._payload), Le); } if (Oe(ee)) return Ge(X, z, ee, Le); if (ue(ee)) return Xe(X, z, ee, Le); Fc(X, ee); } return typeof ee == "string" && ee !== "" || typeof ee == "number" ? (ee = "" + ee, z !== null && z.tag === 6 ? (u(X, z.sibling), z = m(z, ee), z.return = X, X = z) : (u(X, z), z = up(ee, X.mode, Le), z.return = X, X = z), E(X)) : u(X, z); } return sn; } var La = py(!0), my = py(!1), Mc = Is(null), $c = null, Da = null, vh = null; function kh() { vh = Da = $c = null; } function _h(r) { var s = Mc.current; Ht(Mc), r._currentValue = s; } function wh(r, s, u) { for (; r !== null; ) { var d = r.alternate; if ((r.childLanes & s) !== s ? (r.childLanes |= s, d !== null && (d.childLanes |= s)) : d !== null && (d.childLanes & s) !== s && (d.childLanes |= s), r === u) break; r = r.return; } } function Fa(r, s) { $c = r, vh = Da = null, r = r.dependencies, r !== null && r.firstContext !== null && (r.lanes & s && (zn = !0), r.firstContext = null); } function br(r) { var s = r._currentValue; if (vh !== r) if (r = { context: r, memoizedValue: s, next: null }, Da === null) { if ($c === null) throw Error(n(308)); Da = r, $c.dependencies = { lanes: 0, firstContext: r }; } else Da = Da.next = r; return s; } var Io = null; function Sh(r) { Io === null ? Io = [r] : Io.push(r); } function gy(r, s, u, d) { var m = s.interleaved; return m === null ? (u.next = u, Sh(s)) : (u.next = m.next, m.next = u), s.interleaved = u, Qi(r, d); } function Qi(r, s) { r.lanes |= s; var u = r.alternate; for (u !== null && (u.lanes |= s), u = r, r = r.return; r !== null; ) r.childLanes |= s, u = r.alternate, u !== null && (u.childLanes |= s), u = r, r = r.return; return u.tag === 3 ? u.stateNode : null; } var Ds = !1; function bh(r) { r.updateQueue = { baseState: r.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null }; } function yy(r, s) { r = r.updateQueue, s.updateQueue === r && (s.updateQueue = { baseState: r.baseState, firstBaseUpdate: r.firstBaseUpdate, lastBaseUpdate: r.lastBaseUpdate, shared: r.shared, effects: r.effects }); } function Yi(r, s) { return { eventTime: r, lane: s, tag: 0, payload: null, callback: null, next: null }; } function Fs(r, s, u) { var d = r.updateQueue; if (d === null) return null; if (d = d.shared, Nt & 2) { var m = d.pending; return m === null ? s.next = s : (s.next = m.next, m.next = s), d.pending = s, Qi(r, u); } return m = d.interleaved, m === null ? (s.next = s, Sh(d)) : (s.next = m.next, m.next = s), d.interleaved = s, Qi(r, u); } function jc(r, s, u) { if (s = s.updateQueue, s !== null && (s = s.shared, (u & 4194240) !== 0)) { var d = s.lanes; d &= r.pendingLanes, u |= d, s.lanes = u, fa(r, u); } } function vy(r, s) { var u = r.updateQueue, d = r.alternate; if (d !== null && (d = d.updateQueue, u === d)) { var m = null, y = null; if (u = u.firstBaseUpdate, u !== null) { do { var E = { eventTime: u.eventTime, lane: u.lane, tag: u.tag, payload: u.payload, callback: u.callback, next: null }; y === null ? m = y = E : y = y.next = E, u = u.next; } while (u !== null); y === null ? m = y = s : y = y.next = s; } else m = y = s; u = { baseState: d.baseState, firstBaseUpdate: m, lastBaseUpdate: y, shared: d.shared, effects: d.effects }, r.updateQueue = u; return; } r = u.lastBaseUpdate, r === null ? u.firstBaseUpdate = s : r.next = s, u.lastBaseUpdate = s; } function Uc(r, s, u, d) { var m = r.updateQueue; Ds = !1; var y = m.firstBaseUpdate, E = m.lastBaseUpdate, R = m.shared.pending; if (R !== null) { m.shared.pending = null; var j = R, re = j.next; j.next = null, E === null ? y = re : E.next = re, E = j; var Se = r.alternate; Se !== null && (Se = Se.updateQueue, R = Se.lastBaseUpdate, R !== E && (R === null ? Se.firstBaseUpdate = re : R.next = re, Se.lastBaseUpdate = j)); } if (y !== null) { var Ee = m.baseState; E = 0, Se = re = j = null, R = y; do { var _e = R.lane, Be = R.eventTime; if ((d & _e) === _e) { Se !== null && (Se = Se.next = { eventTime: Be, lane: 0, tag: R.tag, payload: R.payload, callback: R.callback, next: null }); e: { var Ge = r, Xe = R; switch (_e = s, Be = u, Xe.tag) { case 1: if (Ge = Xe.payload, typeof Ge == "function") { Ee = Ge.call(Be, Ee, _e); break e; } Ee = Ge; break e; case 3: Ge.flags = Ge.flags & -65537 | 128; case 0: if (Ge = Xe.payload, _e = typeof Ge == "function" ? Ge.call(Be, Ee, _e) : Ge, _e == null) break e; Ee = M({}, Ee, _e); break e; case 2: Ds = !0; } } R.callback !== null && R.lane !== 0 && (r.flags |= 64, _e = m.effects, _e === null ? m.effects = [R] : _e.push(R)); } else Be = { eventTime: Be, lane: _e, tag: R.tag, payload: R.payload, callback: R.callback, next: null }, Se === null ? (re = Se = Be, j = Ee) : Se = Se.next = Be, E |= _e; if (R = R.next, R === null) { if (R = m.shared.pending, R === null) break; _e = R, R = _e.next, _e.next = null, m.lastBaseUpdate = _e, m.shared.pending = null; } } while (!0); if (Se === null && (j = Ee), m.baseState = j, m.firstBaseUpdate = re, m.lastBaseUpdate = Se, s = m.shared.interleaved, s !== null) { m = s; do E |= m.lane, m = m.next; while (m !== s); } else y === null && (m.shared.lanes = 0); Do |= E, r.lanes = E, r.memoizedState = Ee; } } function ky(r, s, u) { if (r = s.effects, s.effects = null, r !== null) for (s = 0; s < r.length; s++) { var d = r[s], m = d.callback; if (m !== null) { if (d.callback = null, d = u, typeof m != "function") throw Error(n(191, m)); m.call(d); } } } var Gu = {}, yi = Is(Gu), Wu = Is(Gu), Qu = Is(Gu); function Po(r) { if (r === Gu) throw Error(n(174)); return r; } function Eh(r, s) { switch (jt(Qu, s), jt(Wu, r), jt(yi, Gu), r = s.nodeType, r) { case 9: case 11: s = (s = s.documentElement) ? s.namespaceURI : Lr(null, ""); break; default: r = r === 8 ? s.parentNode : s, s = r.namespaceURI || null, r = r.tagName, s = Lr(s, r); } Ht(yi), jt(yi, s); } function Ma() { Ht(yi), Ht(Wu), Ht(Qu); } function _y(r) { Po(Qu.current); var s = Po(yi.current), u = Lr(s, r.type); s !== u && (jt(Wu, r), jt(yi, u)); } function Nh(r) { Wu.current === r && (Ht(yi), Ht(Wu)); } var Jt = Is(0); function Bc(r) { for (var s = r; s !== null; ) { if (s.tag === 13) { var u = s.memoizedState; if (u !== null && (u = u.dehydrated, u === null || u.data === "$?" || u.data === "$!")) return s; } else if (s.tag === 19 && s.memoizedProps.revealOrder !== void 0) { if (s.flags & 128) return s; } else if (s.child !== null) { s.child.return = s, s = s.child; continue; } if (s === r) break; for (; s.sibling === null; ) { if (s.return === null || s.return === r) return null; s = s.return; } s.sibling.return = s.return, s = s.sibling; } return null; } var Ah = []; function xh() { for (var r = 0; r < Ah.length; r++) Ah[r]._workInProgressVersionPrimary = null; Ah.length = 0; } var Vc = ne.ReactCurrentDispatcher, Ch = ne.ReactCurrentBatchConfig, Lo = 0, Zt = null, pn = null, yn = null, zc = !1, Yu = !1, Xu = 0, aE = 0; function Tn() { throw Error(n(321)); } function Oh(r, s) { if (s === null) return !1; for (var u = 0; u < s.length && u < r.length; u++) if (!P(r[u], s[u])) return !1; return !0; } function Th(r, s, u, d, m, y) { if (Lo = y, Zt = s, s.memoizedState = null, s.updateQueue = null, s.lanes = 0, Vc.current = r === null || r.memoizedState === null ? dE : fE, r = u(d, m), Yu) { y = 0; do { if (Yu = !1, Xu = 0, 25 <= y) throw Error(n(301)); y += 1, yn = pn = null, s.updateQueue = null, Vc.current = hE, r = u(d, m); } while (Yu); } if (Vc.current = Kc, s = pn !== null && pn.next !== null, Lo = 0, yn = pn = Zt = null, zc = !1, s) throw Error(n(300)); return r; } function Rh() { var r = Xu !== 0; return Xu = 0, r; } function vi() { var r = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; return yn === null ? Zt.memoizedState = yn = r : yn = yn.next = r, yn; } function Er() { if (pn === null) { var r = Zt.alternate; r = r !== null ? r.memoizedState : null; } else r = pn.next; var s = yn === null ? Zt.memoizedState : yn.next; if (s !== null) yn = s, pn = r; else { if (r === null) throw Error(n(310)); pn = r, r = { memoizedState: pn.memoizedState, baseState: pn.baseState, baseQueue: pn.baseQueue, queue: pn.queue, next: null }, yn === null ? Zt.memoizedState = yn = r : yn = yn.next = r; } return yn; } function Ju(r, s) { return typeof s == "function" ? s(r) : s; } function Ih(r) { var s = Er(), u = s.queue; if (u === null) throw Error(n(311)); u.lastRenderedReducer = r; var d = pn, m = d.baseQueue, y = u.pending; if (y !== null) { if (m !== null) { var E = m.next; m.next = y.next, y.next = E; } d.baseQueue = m = y, u.pending = null; } if (m !== null) { y = m.next, d = d.baseState; var R = E = null, j = null, re = y; do { var Se = re.lane; if ((Lo & Se) === Se) j !== null && (j = j.next = { lane: 0, action: re.action, hasEagerState: re.hasEagerState, eagerState: re.eagerState, next: null }), d = re.hasEagerState ? re.eagerState : r(d, re.action); else { var Ee = { lane: Se, action: re.action, hasEagerState: re.hasEagerState, eagerState: re.eagerState, next: null }; j === null ? (R = j = Ee, E = d) : j = j.next = Ee, Zt.lanes |= Se, Do |= Se; } re = re.next; } while (re !== null && re !== y); j === null ? E = d : j.next = R, P(d, s.memoizedState) || (zn = !0), s.memoizedState = d, s.baseState = E, s.baseQueue = j, u.lastRenderedState = d; } if (r = u.interleaved, r !== null) { m = r; do y = m.lane, Zt.lanes |= y, Do |= y, m = m.next; while (m !== r); } else m === null && (u.lanes = 0); return [s.memoizedState, u.dispatch]; } function Ph(r) { var s = Er(), u = s.queue; if (u === null) throw Error(n(311)); u.lastRenderedReducer = r; var d = u.dispatch, m = u.pending, y = s.memoizedState; if (m !== null) { u.pending = null; var E = m = m.next; do y = r(y, E.action), E = E.next; while (E !== m); P(y, s.memoizedState) || (zn = !0), s.memoizedState = y, s.baseQueue === null && (s.baseState = y), u.lastRenderedState = y; } return [y, d]; } function wy() { } function Sy(r, s) { var u = Zt, d = Er(), m = s(), y = !P(d.memoizedState, m); if (y && (d.memoizedState = m, zn = !0), d = d.queue, Lh(Ny.bind(null, u, d, r), [r]), d.getSnapshot !== s || y || yn !== null && yn.memoizedState.tag & 1) { if (u.flags |= 2048, Zu(9, Ey.bind(null, u, d, m, s), void 0, null), vn === null) throw Error(n(349)); Lo & 30 || by(u, s, m); } return m; } function by(r, s, u) { r.flags |= 16384, r = { getSnapshot: s, value: u }, s = Zt.updateQueue, s === null ? (s = { lastEffect: null, stores: null }, Zt.updateQueue = s, s.stores = [r]) : (u = s.stores, u === null ? s.stores = [r] : u.push(r)); } function Ey(r, s, u, d) { s.value = u, s.getSnapshot = d, Ay(s) && xy(r); } function Ny(r, s, u) { return u(function() { Ay(s) && xy(r); }); } function Ay(r) { var s = r.getSnapshot; r = r.value; try { var u = s(); return !P(r, u); } catch { return !0; } } function xy(r) { var s = Qi(r, 1); s !== null && Gr(s, r, 1, -1); } function Cy(r) { var s = vi(); return typeof r == "function" && (r = r()), s.memoizedState = s.baseState = r, r = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: Ju, lastRenderedState: r }, s.queue = r, r = r.dispatch = cE.bind(null, Zt, r), [s.memoizedState, r]; } function Zu(r, s, u, d) { return r = { tag: r, create: s, destroy: u, deps: d, next: null }, s = Zt.updateQueue, s === null ? (s = { lastEffect: null, stores: null }, Zt.updateQueue = s, s.lastEffect = r.next = r) : (u = s.lastEffect, u === null ? s.lastEffect = r.next = r : (d = u.next, u.next = r, r.next = d, s.lastEffect = r)), r; } function Oy() { return Er().memoizedState; } function Hc(r, s, u, d) { var m = vi(); Zt.flags |= r, m.memoizedState = Zu(1 | s, u, void 0, d === void 0 ? null : d); } function qc(r, s, u, d) { var m = Er(); d = d === void 0 ? null : d; var y = void 0; if (pn !== null) { var E = pn.memoizedState; if (y = E.destroy, d !== null && Oh(d, E.deps)) { m.memoizedState = Zu(s, u, y, d); return; } } Zt.flags |= r, m.memoizedState = Zu(1 | s, u, y, d); } function Ty(r, s) { return Hc(8390656, 8, r, s); } function Lh(r, s) { return qc(2048, 8, r, s); } function Ry(r, s) { return qc(4, 2, r, s); } function Iy(r, s) { return qc(4, 4, r, s); } function Py(r, s) { if (typeof s == "function") return r = r(), s(r), function() { s(null); }; if (s != null) return r = r(), s.current = r, function() { s.current = null; }; } function Ly(r, s, u) { return u = u != null ? u.concat([r]) : null, qc(4, 4, Py.bind(null, s, r), u); } function Dh() { } function Dy(r, s) { var u = Er(); s = s === void 0 ? null : s; var d = u.memoizedState; return d !== null && s !== null && Oh(s, d[1]) ? d[0] : (u.memoizedState = [r, s], r); } function Fy(r, s) { var u = Er(); s = s === void 0 ? null : s; var d = u.memoizedState; return d !== null && s !== null && Oh(s, d[1]) ? d[0] : (r = r(), u.memoizedState = [r, s], r); } function My(r, s, u) { return Lo & 21 ? (P(u, s) || (u = Tu(), Zt.lanes |= u, Do |= u, r.baseState = !0), s) : (r.baseState && (r.baseState = !1, zn = !0), r.memoizedState = u); } function uE(r, s) { var u = Tt; Tt = u !== 0 && 4 > u ? u : 4, r(!0); var d = Ch.transition; Ch.transition = {}; try { r(!1), s(); } finally { Tt = u, Ch.transition = d; } } function $y() { return Er().memoizedState; } function lE(r, s, u) { var d = Us(r); if (u = { lane: d, action: u, hasEagerState: !1, eagerState: null, next: null }, jy(r)) Uy(s, u); else if (u = gy(r, s, u, d), u !== null) { var m = $n(); Gr(u, r, d, m), By(u, s, d); } } function cE(r, s, u) { var d = Us(r), m = { lane: d, action: u, hasEagerState: !1, eagerState: null, next: null }; if (jy(r)) Uy(s, m); else { var y = r.alternate; if (r.lanes === 0 && (y === null || y.lanes === 0) && (y = s.lastRenderedReducer, y !== null)) try { var E = s.lastRenderedState, R = y(E, u); if (m.hasEagerState = !0, m.eagerState = R, P(R, E)) { var j = s.interleaved; j === null ? (m.next = m, Sh(s)) : (m.next = j.next, j.next = m), s.interleaved = m; return; } } catch { } finally { } u = gy(r, s, m, d), u !== null && (m = $n(), Gr(u, r, d, m), By(u, s, d)); } } function jy(r) { var s = r.alternate; return r === Zt || s !== null && s === Zt; } function Uy(r, s) { Yu = zc = !0; var u = r.pending; u === null ? s.next = s : (s.next = u.next, u.next = s), r.pending = s; } function By(r, s, u) { if (u & 4194240) { var d = s.lanes; d &= r.pendingLanes, u |= d, s.lanes = u, fa(r, u); } } var Kc = { readContext: br, useCallback: Tn, useContext: Tn, useEffect: Tn, useImperativeHandle: Tn, useInsertionEffect: Tn, useLayoutEffect: Tn, useMemo: Tn, useReducer: Tn, useRef: Tn, useState: Tn, useDebugValue: Tn, useDeferredValue: Tn, useTransition: Tn, useMutableSource: Tn, useSyncExternalStore: Tn, useId: Tn, unstable_isNewReconciler: !1 }, dE = { readContext: br, useCallback: function(r, s) { return vi().memoizedState = [r, s === void 0 ? null : s], r; }, useContext: br, useEffect: Ty, useImperativeHandle: function(r, s, u) { return u = u != null ? u.concat([r]) : null, Hc( 4194308, 4, Py.bind(null, s, r), u ); }, useLayoutEffect: function(r, s) { return Hc(4194308, 4, r, s); }, useInsertionEffect: function(r, s) { return Hc(4, 2, r, s); }, useMemo: function(r, s) { var u = vi(); return s = s === void 0 ? null : s, r = r(), u.memoizedState = [r, s], r; }, useReducer: function(r, s, u) { var d = vi(); return s = u !== void 0 ? u(s) : s, d.memoizedState = d.baseState = s, r = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: r, lastRenderedState: s }, d.queue = r, r = r.dispatch = lE.bind(null, Zt, r), [d.memoizedState, r]; }, useRef: function(r) { var s = vi(); return r = { current: r }, s.memoizedState = r; }, useState: Cy, useDebugValue: Dh, useDeferredValue: function(r) { return vi().memoizedState = r; }, useTransition: function() { var r = Cy(!1), s = r[0]; return r = uE.bind(null, r[1]), vi().memoizedState = r, [s, r]; }, useMutableSource: function() { }, useSyncExternalStore: function(r, s, u) { var d = Zt, m = vi(); if (Wt) { if (u === void 0) throw Error(n(407)); u = u(); } else { if (u = s(), vn === null) throw Error(n(349)); Lo & 30 || by(d, s, u); } m.memoizedState = u; var y = { value: u, getSnapshot: s }; return m.queue = y, Ty(Ny.bind( null, d, y, r ), [r]), d.flags |= 2048, Zu(9, Ey.bind(null, d, y, u, s), void 0, null), u; }, useId: function() { var r = vi(), s = vn.identifierPrefix; if (Wt) { var u = Wi, d = Gi; u = (d & ~(1 << 32 - lt(d) - 1)).toString(32) + u, s = ":" + s + "R" + u, u = Xu++, 0 < u && (s += "H" + u.toString(32)), s += ":"; } else u = aE++, s = ":" + s + "r" + u.toString(32) + ":"; return r.memoizedState = s; }, unstable_isNewReconciler: !1 }, fE = { readContext: br, useCallback: Dy, useContext: br, useEffect: Lh, useImperativeHandle: Ly, useInsertionEffect: Ry, useLayoutEffect: Iy, useMemo: Fy, useReducer: Ih, useRef: Oy, useState: function() { return Ih(Ju); }, useDebugValue: Dh, useDeferredValue: function(r) { var s = Er(); return My(s, pn.memoizedState, r); }, useTransition: function() { var r = Ih(Ju)[0], s = Er().memoizedState; return [r, s]; }, useMutableSource: wy, useSyncExternalStore: Sy, useId: $y, unstable_isNewReconciler: !1 }, hE = { readContext: br, useCallback: Dy, useContext: br, useEffect: Lh, useImperativeHandle: Ly, useInsertionEffect: Ry, useLayoutEffect: Iy, useMemo: Fy, useReducer: Ph, useRef: Oy, useState: function() { return Ph(Ju); }, useDebugValue: Dh, useDeferredValue: function(r) { var s = Er(); return pn === null ? s.memoizedState = r : My(s, pn.memoizedState, r); }, useTransition: function() { var r = Ph(Ju)[0], s = Er().memoizedState; return [r, s]; }, useMutableSource: wy, useSyncExternalStore: Sy, useId: $y, unstable_isNewReconciler: !1 }; function Hr(r, s) { if (r && r.defaultProps) { s = M({}, s), r = r.defaultProps; for (var u in r) s[u] === void 0 && (s[u] = r[u]); return s; } return s; } function Fh(r, s, u, d) { s = r.memoizedState, u = u(d, s), u = u == null ? s : M({}, s, u), r.memoizedState = u, r.lanes === 0 && (r.updateQueue.baseState = u); } var Gc = { isMounted: function(r) { return (r = r._reactInternals) ? Nn(r) === r : !1; }, enqueueSetState: function(r, s, u) { r = r._reactInternals; var d = $n(), m = Us(r), y = Yi(d, m); y.payload = s, u != null && (y.callback = u), s = Fs(r, y, m), s !== null && (Gr(s, r, m, d), jc(s, r, m)); }, enqueueReplaceState: function(r, s, u) { r = r._reactInternals; var d = $n(), m = Us(r), y = Yi(d, m); y.tag = 1, y.payload = s, u != null && (y.callback = u), s = Fs(r, y, m), s !== null && (Gr(s, r, m, d), jc(s, r, m)); }, enqueueForceUpdate: function(r, s) { r = r._reactInternals; var u = $n(), d = Us(r), m = Yi(u, d); m.tag = 2, s != null && (m.callback = s), s = Fs(r, m, d), s !== null && (Gr(s, r, d, u), jc(s, r, d)); } }; function Vy(r, s, u, d, m, y, E) { return r = r.stateNode, typeof r.shouldComponentUpdate == "function" ? r.shouldComponentUpdate(d, y, E) : s.prototype && s.prototype.isPureReactComponent ? !G(u, d) || !G(m, y) : !0; } function zy(r, s, u) { var d = !1, m = Ps, y = s.contextType; return typeof y == "object" && y !== null ? y = br(y) : (m = Vn(s) ? Oo : On.current, d = s.contextTypes, y = (d = d != null) ? Ta(r, m) : Ps), s = new s(u, y), r.memoizedState = s.state !== null && s.state !== void 0 ? s.state : null, s.updater = Gc, r.stateNode = s, s._reactInternals = r, d && (r = r.stateNode, r.__reactInternalMemoizedUnmaskedChildContext = m, r.__reactInternalMemoizedMaskedChildContext = y), s; } function Hy(r, s, u, d) { r = s.state, typeof s.componentWillReceiveProps == "function" && s.componentWillReceiveProps(u, d), typeof s.UNSAFE_componentWillReceiveProps == "function" && s.UNSAFE_componentWillReceiveProps(u, d), s.state !== r && Gc.enqueueReplaceState(s, s.state, null); } function Mh(r, s, u, d) { var m = r.stateNode; m.props = u, m.state = r.memoizedState, m.refs = {}, bh(r); var y = s.contextType; typeof y == "object" && y !== null ? m.context = br(y) : (y = Vn(s) ? Oo : On.current, m.context = Ta(r, y)), m.state = r.memoizedState, y = s.getDerivedStateFromProps, typeof y == "function" && (Fh(r, s, y, u), m.state = r.memoizedState), typeof s.getDerivedStateFromProps == "function" || typeof m.getSnapshotBeforeUpdate == "function" || typeof m.UNSAFE_componentWillMount != "function" && typeof m.componentWillMount != "function" || (s = m.state, typeof m.componentWillMount == "function" && m.componentWillMount(), typeof m.UNSAFE_componentWillMount == "function" && m.UNSAFE_componentWillMount(), s !== m.state && Gc.enqueueReplaceState(m, m.state, null), Uc(r, u, m, d), m.state = r.memoizedState), typeof m.componentDidMount == "function" && (r.flags |= 4194308); } function $a(r, s) { try { var u = "", d = s; do u += Y(d), d = d.return; while (d); var m = u; } catch (y) { m = ` Error generating stack: ` + y.message + ` ` + y.stack; } return { value: r, source: s, stack: m, digest: null }; } function $h(r, s, u) { return { value: r, source: null, stack: u ?? null, digest: s ?? null }; } function jh(r, s) { try { console.error(s.value); } catch (u) { setTimeout(function() { throw u; }); } } var pE = typeof WeakMap == "function" ? WeakMap : Map; function qy(r, s, u) { u = Yi(-1, u), u.tag = 3, u.payload = { element: null }; var d = s.value; return u.callback = function() { ed || (ed = !0, ep = d), jh(r, s); }, u; } function Ky(r, s, u) { u = Yi(-1, u), u.tag = 3; var d = r.type.getDerivedStateFromError; if (typeof d == "function") { var m = s.value; u.payload = function() { return d(m); }, u.callback = function() { jh(r, s); }; } var y = r.stateNode; return y !== null && typeof y.componentDidCatch == "function" && (u.callback = function() { jh(r, s), typeof d != "function" && ($s === null ? $s = /* @__PURE__ */ new Set([this]) : $s.add(this)); var E = s.stack; this.componentDidCatch(s.value, { componentStack: E !== null ? E : "" }); }), u; } function Gy(r, s, u) { var d = r.pingCache; if (d === null) { d = r.pingCache = new pE(); var m = /* @__PURE__ */ new Set(); d.set(s, m); } else m = d.get(s), m === void 0 && (m = /* @__PURE__ */ new Set(), d.set(s, m)); m.has(u) || (m.add(u), r = CE.bind(null, r, s, u), s.then(r, r)); } function Wy(r) { do { var s; if ((s = r.tag === 13) && (s = r.memoizedState, s = s !== null ? s.dehydrated !== null : !0), s) return r; r = r.return; } while (r !== null); return null; } function Qy(r, s, u, d, m) { return r.mode & 1 ? (r.flags |= 65536, r.lanes = m, r) : (r === s ? r.flags |= 65536 : (r.flags |= 128, u.flags |= 131072, u.flags &= -52805, u.tag === 1 && (u.alternate === null ? u.tag = 17 : (s = Yi(-1, 1), s.tag = 2, Fs(u, s, 1))), u.lanes |= 1), r); } var mE = ne.ReactCurrentOwner, zn = !1; function Mn(r, s, u, d) { s.child = r === null ? my(s, null, u, d) : La(s, r.child, u, d); } function Yy(r, s, u, d, m) { u = u.render; var y = s.ref; return Fa(s, m), d = Th(r, s, u, d, y, m), u = Rh(), r !== null && !zn ? (s.updateQueue = r.updateQueue, s.flags &= -2053, r.lanes &= ~m, Xi(r, s, m)) : (Wt && u && hh(s), s.flags |= 1, Mn(r, s, d, m), s.child); } function Xy(r, s, u, d, m) { if (r === null) { var y = u.type; return typeof y == "function" && !ap(y) && y.defaultProps === void 0 && u.compare === null && u.defaultProps === void 0 ? (s.tag = 15, s.type = y, Jy(r, s, y, d, m)) : (r = od(u.type, null, d, s, s.mode, m), r.ref = s.ref, r.return = s, s.child = r); } if (y = r.child, !(r.lanes & m)) { var E = y.memoizedProps; if (u = u.compare, u = u !== null ? u : G, u(E, d) && r.ref === s.ref) return Xi(r, s, m); } return s.flags |= 1, r = Vs(y, d), r.ref = s.ref, r.return = s, s.child = r; } function Jy(r, s, u, d, m) { if (r !== null) { var y = r.memoizedProps; if (G(y, d) && r.ref === s.ref) if (zn = !1, s.pendingProps = d = y, (r.lanes & m) !== 0) r.flags & 131072 && (zn = !0); else return s.lanes = r.lanes, Xi(r, s, m); } return Uh(r, s, u, d, m); } function Zy(r, s, u) { var d = s.pendingProps, m = d.children, y = r !== null ? r.memoizedState : null; if (d.mode === "hidden") if (!(s.mode & 1)) s.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, jt(Ua, ur), ur |= u; else { if (!(u & 1073741824)) return r = y !== null ? y.baseLanes | u : u, s.lanes = s.childLanes = 1073741824, s.memoizedState = { baseLanes: r, cachePool: null, transitions: null }, s.updateQueue = null, jt(Ua, ur), ur |= r, null; s.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, d = y !== null ? y.baseLanes : u, jt(Ua, ur), ur |= d; } else y !== null ? (d = y.baseLanes | u, s.memoizedState = null) : d = u, jt(Ua, ur), ur |= d; return Mn(r, s, m, u), s.child; } function ev(r, s) { var u = s.ref; (r === null && u !== null || r !== null && r.ref !== u) && (s.flags |= 512, s.flags |= 2097152); } function Uh(r, s, u, d, m) { var y = Vn(u) ? Oo : On.current; return y = Ta(s, y), Fa(s, m), u = Th(r, s, u, d, y, m), d = Rh(), r !== null && !zn ? (s.updateQueue = r.updateQueue, s.flags &= -2053, r.lanes &= ~m, Xi(r, s, m)) : (Wt && d && hh(s), s.flags |= 1, Mn(r, s, u, m), s.child); } function tv(r, s, u, d, m) { if (Vn(u)) { var y = !0; Rc(s); } else y = !1; if (Fa(s, m), s.stateNode === null) Qc(r, s), zy(s, u, d), Mh(s, u, d, m), d = !0; else if (r === null) { var E = s.stateNode, R = s.memoizedProps; E.props = R; var j = E.context, re = u.contextType; typeof re == "object" && re !== null ? re = br(re) : (re = Vn(u) ? Oo : On.current, re = Ta(s, re)); var Se = u.getDerivedStateFromProps, Ee = typeof Se == "function" || typeof E.getSnapshotBeforeUpdate == "function"; Ee || typeof E.UNSAFE_componentWillReceiveProps != "function" && typeof E.componentWillReceiveProps != "function" || (R !== d || j !== re) && Hy(s, E, d, re), Ds = !1; var _e = s.memoizedState; E.state = _e, Uc(s, d, E, m), j = s.memoizedState, R !== d || _e !== j || Bn.current || Ds ? (typeof Se == "function" && (Fh(s, u, Se, d), j = s.memoizedState), (R = Ds || Vy(s, u, R, d, _e, j, re)) ? (Ee || typeof E.UNSAFE_componentWillMount != "function" && typeof E.componentWillMount != "function" || (typeof E.componentWillMount == "function" && E.componentWillMount(), typeof E.UNSAFE_componentWillMount == "function" && E.UNSAFE_componentWillMount()), typeof E.componentDidMount == "function" && (s.flags |= 4194308)) : (typeof E.componentDidMount == "function" && (s.flags |= 4194308), s.memoizedProps = d, s.memoizedState = j), E.props = d, E.state = j, E.context = re, d = R) : (typeof E.componentDidMount == "function" && (s.flags |= 4194308), d = !1); } else { E = s.stateNode, yy(r, s), R = s.memoizedProps, re = s.type === s.elementType ? R : Hr(s.type, R), E.props = re, Ee = s.pendingProps, _e = E.context, j = u.contextType, typeof j == "object" && j !== null ? j = br(j) : (j = Vn(u) ? Oo : On.current, j = Ta(s, j)); var Be = u.getDerivedStateFromProps; (Se = typeof Be == "function" || typeof E.getSnapshotBeforeUpdate == "function") || typeof E.UNSAFE_componentWillReceiveProps != "function" && typeof E.componentWillReceiveProps != "function" || (R !== Ee || _e !== j) && Hy(s, E, d, j), Ds = !1, _e = s.memoizedState, E.state = _e, Uc(s, d, E, m); var Ge = s.memoizedState; R !== Ee || _e !== Ge || Bn.current || Ds ? (typeof Be == "function" && (Fh(s, u, Be, d), Ge = s.memoizedState), (re = Ds || Vy(s, u, re, d, _e, Ge, j) || !1) ? (Se || typeof E.UNSAFE_componentWillUpdate != "function" && typeof E.componentWillUpdate != "function" || (typeof E.componentWillUpdate == "function" && E.componentWillUpdate(d, Ge, j), typeof E.UNSAFE_componentWillUpdate == "function" && E.UNSAFE_componentWillUpdate(d, Ge, j)), typeof E.componentDidUpdate == "function" && (s.flags |= 4), typeof E.getSnapshotBeforeUpdate == "function" && (s.flags |= 1024)) : (typeof E.componentDidUpdate != "function" || R === r.memoizedProps && _e === r.memoizedState || (s.flags |= 4), typeof E.getSnapshotBeforeUpdate != "function" || R === r.memoizedProps && _e === r.memoizedState || (s.flags |= 1024), s.memoizedProps = d, s.memoizedState = Ge), E.props = d, E.state = Ge, E.context = j, d = re) : (typeof E.componentDidUpdate != "function" || R === r.memoizedProps && _e === r.memoizedState || (s.flags |= 4), typeof E.getSnapshotBeforeUpdate != "function" || R === r.memoizedProps && _e === r.memoizedState || (s.flags |= 1024), d = !1); } return Bh(r, s, u, d, y, m); } function Bh(r, s, u, d, m, y) { ev(r, s); var E = (s.flags & 128) !== 0; if (!d && !E) return m && oy(s, u, !1), Xi(r, s, y); d = s.stateNode, mE.current = s; var R = E && typeof u.getDerivedStateFromError != "function" ? null : d.render(); return s.flags |= 1, r !== null && E ? (s.child = La(s, r.child, null, y), s.child = La(s, null, R, y)) : Mn(r, s, R, y), s.memoizedState = d.state, m && oy(s, u, !0), s.child; } function nv(r) { var s = r.stateNode; s.pendingContext ? iy(r, s.pendingContext, s.pendingContext !== s.context) : s.context && iy(r, s.context, !1), Eh(r, s.containerInfo); } function rv(r, s, u, d, m) { return Pa(), yh(m), s.flags |= 256, Mn(r, s, u, d), s.child; } var Vh = { dehydrated: null, treeContext: null, retryLane: 0 }; function zh(r) { return { baseLanes: r, cachePool: null, transitions: null }; } function iv(r, s, u) { var d = s.pendingProps, m = Jt.current, y = !1, E = (s.flags & 128) !== 0, R; if ((R = E) || (R = r !== null && r.memoizedState === null ? !1 : (m & 2) !== 0), R ? (y = !0, s.flags &= -129) : (r === null || r.memoizedState !== null) && (m |= 1), jt(Jt, m & 1), r === null) return gh(s), r = s.memoizedState, r !== null && (r = r.dehydrated, r !== null) ? (s.mode & 1 ? r.data === "$!" ? s.lanes = 8 : s.lanes = 1073741824 : s.lanes = 1, null) : (E = d.children, r = d.fallback, y ? (d = s.mode, y = s.child, E = { mode: "hidden", children: E }, !(d & 1) && y !== null ? (y.childLanes = 0, y.pendingProps = E) : y = ad(E, d, 0, null), r = jo(r, d, u, null), y.return = s, r.return = s, y.sibling = r, s.child = y, s.child.memoizedState = zh(u), s.memoizedState = Vh, r) : Hh(s, E)); if (m = r.memoizedState, m !== null && (R = m.dehydrated, R !== null)) return gE(r, s, E, d, R, m, u); if (y) { y = d.fallback, E = s.mode, m = r.child, R = m.sibling; var j = { mode: "hidden", children: d.children }; return !(E & 1) && s.child !== m ? (d = s.child, d.childLanes = 0, d.pendingProps = j, s.deletions = null) : (d = Vs(m, j), d.subtreeFlags = m.subtreeFlags & 14680064), R !== null ? y = Vs(R, y) : (y = jo(y, E, u, null), y.flags |= 2), y.return = s, d.return = s, d.sibling = y, s.child = d, d = y, y = s.child, E = r.child.memoizedState, E = E === null ? zh(u) : { baseLanes: E.baseLanes | u, cachePool: null, transitions: E.transitions }, y.memoizedState = E, y.childLanes = r.childLanes & ~u, s.memoizedState = Vh, d; } return y = r.child, r = y.sibling, d = Vs(y, { mode: "visible", children: d.children }), !(s.mode & 1) && (d.lanes = u), d.return = s, d.sibling = null, r !== null && (u = s.deletions, u === null ? (s.deletions = [r], s.flags |= 16) : u.push(r)), s.child = d, s.memoizedState = null, d; } function Hh(r, s) { return s = ad({ mode: "visible", children: s }, r.mode, 0, null), s.return = r, r.child = s; } function Wc(r, s, u, d) { return d !== null && yh(d), La(s, r.child, null, u), r = Hh(s, s.pendingProps.children), r.flags |= 2, s.memoizedState = null, r; } function gE(r, s, u, d, m, y, E) { if (u) return s.flags & 256 ? (s.flags &= -257, d = $h(Error(n(422))), Wc(r, s, E, d)) : s.memoizedState !== null ? (s.child = r.child, s.flags |= 128, null) : (y = d.fallback, m = s.mode, d = ad({ mode: "visible", children: d.children }, m, 0, null), y = jo(y, m, E, null), y.flags |= 2, d.return = s, y.return = s, d.sibling = y, s.child = d, s.mode & 1 && La(s, r.child, null, E), s.child.memoizedState = zh(E), s.memoizedState = Vh, y); if (!(s.mode & 1)) return Wc(r, s, E, null); if (m.data === "$!") { if (d = m.nextSibling && m.nextSibling.dataset, d) var R = d.dgst; return d = R, y = Error(n(419)), d = $h(y, d, void 0), Wc(r, s, E, d); } if (R = (E & r.childLanes) !== 0, zn || R) { if (d = vn, d !== null) { switch (E & -E) { case 4: m = 2; break; case 16: m = 8; break; case 64: case 128: case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: m = 32; break; case 536870912: m = 268435456; break; default: m = 0; } m = m & (d.suspendedLanes | E) ? 0 : m, m !== 0 && m !== y.retryLane && (y.retryLane = m, Qi(r, m), Gr(d, r, m, -1)); } return op(), d = $h(Error(n(421))), Wc(r, s, E, d); } return m.data === "$?" ? (s.flags |= 128, s.child = r.child, s = OE.bind(null, r), m._reactRetry = s, null) : (r = y.treeContext, ar = Rs(m.nextSibling), or = s, Wt = !0, zr = null, r !== null && (wr[Sr++] = Gi, wr[Sr++] = Wi, wr[Sr++] = To, Gi = r.id, Wi = r.overflow, To = s), s = Hh(s, d.children), s.flags |= 4096, s); } function sv(r, s, u) { r.lanes |= s; var d = r.alternate; d !== null && (d.lanes |= s), wh(r.return, s, u); } function qh(r, s, u, d, m) { var y = r.memoizedState; y === null ? r.memoizedState = { isBackwards: s, rendering: null, renderingStartTime: 0, last: d, tail: u, tailMode: m } : (y.isBackwards = s, y.rendering = null, y.renderingStartTime = 0, y.last = d, y.tail = u, y.tailMode = m); } function ov(r, s, u) { var d = s.pendingProps, m = d.revealOrder, y = d.tail; if (Mn(r, s, d.children, u), d = Jt.current, d & 2) d = d & 1 | 2, s.flags |= 128; else { if (r !== null && r.flags & 128) e: for (r = s.child; r !== null; ) { if (r.tag === 13) r.memoizedState !== null && sv(r, u, s); else if (r.tag === 19) sv(r, u, s); else if (r.child !== null) { r.child.return = r, r = r.child; continue; } if (r === s) break e; for (; r.sibling === null; ) { if (r.return === null || r.return === s) break e; r = r.return; } r.sibling.return = r.return, r = r.sibling; } d &= 1; } if (jt(Jt, d), !(s.mode & 1)) s.memoizedState = null; else switch (m) { case "forwards": for (u = s.child, m = null; u !== null; ) r = u.alternate, r !== null && Bc(r) === null && (m = u), u = u.sibling; u = m, u === null ? (m = s.child, s.child = null) : (m = u.sibling, u.sibling = null), qh(s, !1, m, u, y); break; case "backwards": for (u = null, m = s.child, s.child = null; m !== null; ) { if (r = m.alternate, r !== null && Bc(r) === null) { s.child = m; break; } r = m.sibling, m.sibling = u, u = m, m = r; } qh(s, !0, u, null, y); break; case "together": qh(s, !1, null, null, void 0); break; default: s.memoizedState = null; } return s.child; } function Qc(r, s) { !(s.mode & 1) && r !== null && (r.alternate = null, s.alternate = null, s.flags |= 2); } function Xi(r, s, u) { if (r !== null && (s.dependencies = r.dependencies), Do |= s.lanes, !(u & s.childLanes)) return null; if (r !== null && s.child !== r.child) throw Error(n(153)); if (s.child !== null) { for (r = s.child, u = Vs(r, r.pendingProps), s.child = u, u.return = s; r.sibling !== null; ) r = r.sibling, u = u.sibling = Vs(r, r.pendingProps), u.return = s; u.sibling = null; } return s.child; } function yE(r, s, u) { switch (s.tag) { case 3: nv(s), Pa(); break; case 5: _y(s); break; case 1: Vn(s.type) && Rc(s); break; case 4: Eh(s, s.stateNode.containerInfo); break; case 10: var d = s.type._context, m = s.memoizedProps.value; jt(Mc, d._currentValue), d._currentValue = m; break; case 13: if (d = s.memoizedState, d !== null) return d.dehydrated !== null ? (jt(Jt, Jt.current & 1), s.flags |= 128, null) : u & s.child.childLanes ? iv(r, s, u) : (jt(Jt, Jt.current & 1), r = Xi(r, s, u), r !== null ? r.sibling : null); jt(Jt, Jt.current & 1); break; case 19: if (d = (u & s.childLanes) !== 0, r.flags & 128) { if (d) return ov(r, s, u); s.flags |= 128; } if (m = s.memoizedState, m !== null && (m.rendering = null, m.tail = null, m.lastEffect = null), jt(Jt, Jt.current), d) break; return null; case 22: case 23: return s.lanes = 0, Zy(r, s, u); } return Xi(r, s, u); } var av, Kh, uv, lv; av = function(r, s) { for (var u = s.child; u !== null; ) { if (u.tag === 5 || u.tag === 6) r.appendChild(u.stateNode); else if (u.tag !== 4 && u.child !== null) { u.child.return = u, u = u.child; continue; } if (u === s) break; for (; u.sibling === null; ) { if (u.return === null || u.return === s) return; u = u.return; } u.sibling.return = u.return, u = u.sibling; } }, Kh = function() { }, uv = function(r, s, u, d) { var m = r.memoizedProps; if (m !== d) { r = s.stateNode, Po(yi.current); var y = null; switch (u) { case "input": m = Bt(r, m), d = Bt(r, d), y = []; break; case "select": m = M({}, m, { value: void 0 }), d = M({}, d, { value: void 0 }), y = []; break; case "textarea": m = Rt(r, m), d = Rt(r, d), y = []; break; default: typeof m.onClick != "function" && typeof d.onClick == "function" && (r.onclick = Cc); } Ye(u, d); var E; u = null; for (re in m) if (!d.hasOwnProperty(re) && m.hasOwnProperty(re) && m[re] != null) if (re === "style") { var R = m[re]; for (E in R) R.hasOwnProperty(E) && (u || (u = {}), u[E] = ""); } else re !== "dangerouslySetInnerHTML" && re !== "children" && re !== "suppressContentEditableWarning" && re !== "suppressHydrationWarning" && re !== "autoFocus" && (o.hasOwnProperty(re) ? y || (y = []) : (y = y || []).push(re, null)); for (re in d) { var j = d[re]; if (R = m != null ? m[re] : void 0, d.hasOwnProperty(re) && j !== R && (j != null || R != null)) if (re === "style") if (R) { for (E in R) !R.hasOwnProperty(E) || j && j.hasOwnProperty(E) || (u || (u = {}), u[E] = ""); for (E in j) j.hasOwnProperty(E) && R[E] !== j[E] && (u || (u = {}), u[E] = j[E]); } else u || (y || (y = []), y.push( re, u )), u = j; else re === "dangerouslySetInnerHTML" ? (j = j ? j.__html : void 0, R = R ? R.__html : void 0, j != null && R !== j && (y = y || []).push(re, j)) : re === "children" ? typeof j != "string" && typeof j != "number" || (y = y || []).push(re, "" + j) : re !== "suppressContentEditableWarning" && re !== "suppressHydrationWarning" && (o.hasOwnProperty(re) ? (j != null && re === "onScroll" && zt("scroll", r), y || R === j || (y = [])) : (y = y || []).push(re, j)); } u && (y = y || []).push("style", u); var re = y; (s.updateQueue = re) && (s.flags |= 4); } }, lv = function(r, s, u, d) { u !== d && (s.flags |= 4); }; function el(r, s) { if (!Wt) switch (r.tailMode) { case "hidden": s = r.tail; for (var u = null; s !== null; ) s.alternate !== null && (u = s), s = s.sibling; u === null ? r.tail = null : u.sibling = null; break; case "collapsed": u = r.tail; for (var d = null; u !== null; ) u.alternate !== null && (d = u), u = u.sibling; d === null ? s || r.tail === null ? r.tail = null : r.tail.sibling = null : d.sibling = null; } } function Rn(r) { var s = r.alternate !== null && r.alternate.child === r.child, u = 0, d = 0; if (s) for (var m = r.child; m !== null; ) u |= m.lanes | m.childLanes, d |= m.subtreeFlags & 14680064, d |= m.flags & 14680064, m.return = r, m = m.sibling; else for (m = r.child; m !== null; ) u |= m.lanes | m.childLanes, d |= m.subtreeFlags, d |= m.flags, m.return = r, m = m.sibling; return r.subtreeFlags |= d, r.childLanes = u, s; } function vE(r, s, u) { var d = s.pendingProps; switch (ph(s), s.tag) { case 2: case 16: case 15: case 0: case 11: case 7: case 8: case 12: case 9: case 14: return Rn(s), null; case 1: return Vn(s.type) && Tc(), Rn(s), null; case 3: return d = s.stateNode, Ma(), Ht(Bn), Ht(On), xh(), d.pendingContext && (d.context = d.pendingContext, d.pendingContext = null), (r === null || r.child === null) && (Dc(s) ? s.flags |= 4 : r === null || r.memoizedState.isDehydrated && !(s.flags & 256) || (s.flags |= 1024, zr !== null && (rp(zr), zr = null))), Kh(r, s), Rn(s), null; case 5: Nh(s); var m = Po(Qu.current); if (u = s.type, r !== null && s.stateNode != null) uv(r, s, u, d, m), r.ref !== s.ref && (s.flags |= 512, s.flags |= 2097152); else { if (!d) { if (s.stateNode === null) throw Error(n(166)); return Rn(s), null; } if (r = Po(yi.current), Dc(s)) { d = s.stateNode, u = s.type; var y = s.memoizedProps; switch (d[gi] = s, d[Hu] = y, r = (s.mode & 1) !== 0, u) { case "dialog": zt("cancel", d), zt("close", d); break; case "iframe": case "object": case "embed": zt("load", d); break; case "video": case "audio": for (m = 0; m < Bu.length; m++) zt(Bu[m], d); break; case "source": zt("error", d); break; case "img": case "image": case "link": zt( "error", d ), zt("load", d); break; case "details": zt("toggle", d); break; case "input": Ze(d, y), zt("invalid", d); break; case "select": d._wrapperState = { wasMultiple: !!y.multiple }, zt("invalid", d); break; case "textarea": Kt(d, y), zt("invalid", d); } Ye(u, y), m = null; for (var E in y) if (y.hasOwnProperty(E)) { var R = y[E]; E === "children" ? typeof R == "string" ? d.textContent !== R && (y.suppressHydrationWarning !== !0 && xc(d.textContent, R, r), m = ["children", R]) : typeof R == "number" && d.textContent !== "" + R && (y.suppressHydrationWarning !== !0 && xc( d.textContent, R, r ), m = ["children", "" + R]) : o.hasOwnProperty(E) && R != null && E === "onScroll" && zt("scroll", d); } switch (u) { case "input": wt(d), $e(d, y, !0); break; case "textarea": wt(d), vr(d); break; case "select": case "option": break; default: typeof y.onClick == "function" && (d.onclick = Cc); } d = m, s.updateQueue = d, d !== null && (s.flags |= 4); } else { E = m.nodeType === 9 ? m : m.ownerDocument, r === "http://www.w3.org/1999/xhtml" && (r = Dn(u)), r === "http://www.w3.org/1999/xhtml" ? u === "script" ? (r = E.createElement("div"), r.innerHTML = "