const MF = "modulepreload"
  , DF = function(t) {
    return "/" + t
}
  , AE = {}
  , Uf = function(e, n, r) {
    if (!n || n.length === 0)
        return e();
    const i = document.getElementsByTagName("link");
    return Promise.all(n.map(o => {
        if (o = DF(o),
        o in AE)
            return;
        AE[o] = !0;
        const s = o.endsWith(".css")
          , a = s ? '[rel="stylesheet"]' : "";
        if (!!r)
            for (let u = i.length - 1; u >= 0; u--) {
                const f = i[u];
                if (f.href === o && (!s || f.rel === "stylesheet"))
                    return
            }
        else if (document.querySelector(`link[href="${o}"]${a}`))
            return;
        const c = document.createElement("link");
        if (c.rel = s ? "stylesheet" : MF,
        s || (c.as = "script",
        c.crossOrigin = ""),
        c.href = o,
        document.head.appendChild(c),
        s)
            return new Promise( (u, f) => {
                c.addEventListener("load", u),
                c.addEventListener("error", () => f(new Error(`Unable to preload CSS for ${o}`)))
            }
            )
    }
    )).then( () => e()).catch(o => {
        const s = new Event("vite:preloadError",{
            cancelable: !0
        });
        if (s.payload = o,
        window.dispatchEvent(s),
        !s.defaultPrevented)
            throw o
    }
    )
};
function BF(t, e) {
    const n = Object.create(null)
      , r = t.split(",");
    for (let i = 0; i < r.length; i++)
        n[r[i]] = !0;
    return e ? i => !!n[i.toLowerCase()] : i => !!n[i]
}
const Ad = Object.assign
  , kF = Object.prototype.hasOwnProperty
  , J0 = (t, e) => kF.call(t, e)
  , jo = Array.isArray
  , uf = t => $I(t) === "[object Map]"
  , Gx = t => typeof t == "function"
  , NF = t => typeof t == "string"
  , Hx = t => typeof t == "symbol"
  , Td = t => t !== null && typeof t == "object"
  , FF = Object.prototype.toString
  , $I = t => FF.call(t)
  , UI = t => $I(t).slice(8, -1)
  , Vx = t => NF(t) && t !== "NaN" && t[0] !== "-" && "" + parseInt(t, 10) === t
  , LF = t => {
    const e = Object.create(null);
    return n => e[n] || (e[n] = t(n))
}
  , $F = LF(t => t.charAt(0).toUpperCase() + t.slice(1))
  , zx = (t, e) => !Object.is(t, e)
  , UF = (t, e, n) => {
    Object.defineProperty(t, e, {
        configurable: !0,
        enumerable: !1,
        value: n
    })
}
;
function qp(t, ...e) {
    console.warn(`[Vue warn] ${t}`, ...e)
}
let Lr;
class jx {
    constructor(e=!1) {
        this.detached = e,
        this._active = !0,
        this.effects = [],
        this.cleanups = [],
        this.parent = Lr,
        !e && Lr && (this.index = (Lr.scopes || (Lr.scopes = [])).push(this) - 1)
    }
    get active() {
        return this._active
    }
    run(e) {
        if (this._active) {
            const n = Lr;
            try {
                return Lr = this,
                e()
            } finally {
                Lr = n
            }
        } else
            qp("cannot run an inactive effect scope.")
    }
    on() {
        Lr = this
    }
    off() {
        Lr = this.parent
    }
    stop(e) {
        if (this._active) {
            let n, r;
            for (n = 0,
            r = this.effects.length; n < r; n++)
                this.effects[n].stop();
            for (n = 0,
            r = this.cleanups.length; n < r; n++)
                this.cleanups[n]();
            if (this.scopes)
                for (n = 0,
                r = this.scopes.length; n < r; n++)
                    this.scopes[n].stop(!0);
            if (!this.detached && this.parent && !e) {
                const i = this.parent.scopes.pop();
                i && i !== this && (this.parent.scopes[this.index] = i,
                i.index = this.index)
            }
            this.parent = void 0,
            this._active = !1
        }
    }
}
function Pd(t) {
    return new jx(t)
}
function GI(t, e=Lr) {
    e && e.active && e.effects.push(t)
}
function Id() {
    return Lr
}
function Wx(t) {
    Lr ? Lr.cleanups.push(t) : qp("onScopeDispose() is called when there is no active effect scope to be associated with.")
}
const Yx = t => {
    const e = new Set(t);
    return e.w = 0,
    e.n = 0,
    e
}
  , HI = t => (t.w & Js) > 0
  , VI = t => (t.n & Js) > 0
  , GF = ({deps: t}) => {
    if (t.length)
        for (let e = 0; e < t.length; e++)
            t[e].w |= Js
}
  , HF = t => {
    const {deps: e} = t;
    if (e.length) {
        let n = 0;
        for (let r = 0; r < e.length; r++) {
            const i = e[r];
            HI(i) && !VI(i) ? i.delete(t) : e[n++] = i,
            i.w &= ~Js,
            i.n &= ~Js
        }
        e.length = n
    }
}
  , Zp = new WeakMap;
let Ju = 0
  , Js = 1;
const oy = 30;
let cr;
const qa = Symbol("iterate")
  , sy = Symbol("Map key iterate");
class Od {
    constructor(e, n=null, r) {
        this.fn = e,
        this.scheduler = n,
        this.active = !0,
        this.deps = [],
        this.parent = void 0,
        GI(this, r)
    }
    run() {
        if (!this.active)
            return this.fn();
        let e = cr
          , n = Hs;
        for (; e; ) {
            if (e === this)
                return;
            e = e.parent
        }
        try {
            return this.parent = cr,
            cr = this,
            Hs = !0,
            Js = 1 << ++Ju,
            Ju <= oy ? GF(this) : TE(this),
            this.fn()
        } finally {
            Ju <= oy && HF(this),
            Js = 1 << --Ju,
            cr = this.parent,
            Hs = n,
            this.parent = void 0,
            this.deferStop && this.stop()
        }
    }
    stop() {
        cr === this ? this.deferStop = !0 : this.active && (TE(this),
        this.onStop && this.onStop(),
        this.active = !1)
    }
}
function TE(t) {
    const {deps: e} = t;
    if (e.length) {
        for (let n = 0; n < e.length; n++)
            e[n].delete(t);
        e.length = 0
    }
}
function VF(t, e) {
    t.effect && (t = t.effect.fn);
    const n = new Od(t);
    e && (Ad(n, e),
    e.scope && GI(n, e.scope)),
    (!e || !e.lazy) && n.run();
    const r = n.run.bind(n);
    return r.effect = n,
    r
}
function zF(t) {
    t.effect.stop()
}
let Hs = !0;
const zI = [];
function Tl() {
    zI.push(Hs),
    Hs = !1
}
function Pl() {
    const t = zI.pop();
    Hs = t === void 0 ? !0 : t
}
function er(t, e, n) {
    if (Hs && cr) {
        let r = Zp.get(t);
        r || Zp.set(t, r = new Map);
        let i = r.get(n);
        i || r.set(n, i = Yx()),
        jI(i, {
            effect: cr,
            target: t,
            type: e,
            key: n
        })
    }
}
function jI(t, e) {
    let n = !1;
    Ju <= oy ? VI(t) || (t.n |= Js,
    n = !HI(t)) : n = !t.has(cr),
    n && (t.add(cr),
    cr.deps.push(t),
    cr.onTrack && cr.onTrack(Ad({
        effect: cr
    }, e)))
}
function uo(t, e, n, r, i, o) {
    const s = Zp.get(t);
    if (!s)
        return;
    let a = [];
    if (e === "clear")
        a = [...s.values()];
    else if (n === "length" && jo(t)) {
        const c = Number(r);
        s.forEach( (u, f) => {
            (f === "length" || f >= c) && a.push(u)
        }
        )
    } else
        switch (n !== void 0 && a.push(s.get(n)),
        e) {
        case "add":
            jo(t) ? Vx(n) && a.push(s.get("length")) : (a.push(s.get(qa)),
            uf(t) && a.push(s.get(sy)));
            break;
        case "delete":
            jo(t) || (a.push(s.get(qa)),
            uf(t) && a.push(s.get(sy)));
            break;
        case "set":
            uf(t) && a.push(s.get(qa));
            break
        }
    const l = {
        target: t,
        type: e,
        key: n,
        newValue: r,
        oldValue: i,
        oldTarget: o
    };
    if (a.length === 1)
        a[0] && ay(a[0], l);
    else {
        const c = [];
        for (const u of a)
            u && c.push(...u);
        ay(Yx(c), l)
    }
}
function ay(t, e) {
    const n = jo(t) ? t : [...t];
    for (const r of n)
        r.computed && PE(r, e);
    for (const r of n)
        r.computed || PE(r, e)
}
function PE(t, e) {
    (t !== cr || t.allowRecurse) && (t.onTrigger && t.onTrigger(Ad({
        effect: t
    }, e)),
    t.scheduler ? t.scheduler() : t.run())
}
function jF(t, e) {
    var n;
    return (n = Zp.get(t)) == null ? void 0 : n.get(e)
}
const WF = BF("__proto__,__v_isRef,__isVue")
  , WI = new Set(Object.getOwnPropertyNames(Symbol).filter(t => t !== "arguments" && t !== "caller").map(t => Symbol[t]).filter(Hx))
  , YF = Q0()
  , XF = Q0(!1, !0)
  , KF = Q0(!0)
  , qF = Q0(!0, !0)
  , IE = ZF();
function ZF() {
    const t = {};
    return ["includes", "indexOf", "lastIndexOf"].forEach(e => {
        t[e] = function(...n) {
            const r = Le(this);
            for (let o = 0, s = this.length; o < s; o++)
                er(r, "get", o + "");
            const i = r[e](...n);
            return i === -1 || i === !1 ? r[e](...n.map(Le)) : i
        }
    }
    ),
    ["push", "pop", "shift", "unshift", "splice"].forEach(e => {
        t[e] = function(...n) {
            Tl();
            const r = Le(this)[e].apply(this, n);
            return Pl(),
            r
        }
    }
    ),
    t
}
function JF(t) {
    const e = Le(this);
    return er(e, "has", t),
    e.hasOwnProperty(t)
}
function Q0(t=!1, e=!1) {
    return function(r, i, o) {
        if (i === "__v_isReactive")
            return !t;
        if (i === "__v_isReadonly")
            return t;
        if (i === "__v_isShallow")
            return e;
        if (i === "__v_raw" && o === (t ? e ? e4 : QI : e ? JI : ZI).get(r))
            return r;
        const s = jo(r);
        if (!t) {
            if (s && J0(IE, i))
                return Reflect.get(IE, i, o);
            if (i === "hasOwnProperty")
                return JF
        }
        const a = Reflect.get(r, i, o);
        return (Hx(i) ? WI.has(i) : WF(i)) || (t || er(r, "get", i),
        e) ? a : pt(a) ? s && Vx(i) ? a : a.value : Td(a) ? t ? Il(a) : Mt(a) : a
    }
}
const QF = YI()
  , eL = YI(!0);
function YI(t=!1) {
    return function(n, r, i, o) {
        let s = n[r];
        if (ts(s) && pt(s) && !pt(i))
            return !1;
        if (!t && (!Gf(i) && !ts(i) && (s = Le(s),
        i = Le(i)),
        !jo(n) && pt(s) && !pt(i)))
            return s.value = i,
            !0;
        const a = jo(n) && Vx(r) ? Number(r) < n.length : J0(n, r)
          , l = Reflect.set(n, r, i, o);
        return n === Le(o) && (a ? zx(i, s) && uo(n, "set", r, i, s) : uo(n, "add", r, i)),
        l
    }
}
function tL(t, e) {
    const n = J0(t, e)
      , r = t[e]
      , i = Reflect.deleteProperty(t, e);
    return i && n && uo(t, "delete", e, void 0, r),
    i
}
function nL(t, e) {
    const n = Reflect.has(t, e);
    return (!Hx(e) || !WI.has(e)) && er(t, "has", e),
    n
}
function rL(t) {
    return er(t, "iterate", jo(t) ? "length" : qa),
    Reflect.ownKeys(t)
}
const XI = {
    get: YF,
    set: QF,
    deleteProperty: tL,
    has: nL,
    ownKeys: rL
}
  , KI = {
    get: KF,
    set(t, e) {
        return qp(`Set operation on key "${String(e)}" failed: target is readonly.`, t),
        !0
    },
    deleteProperty(t, e) {
        return qp(`Delete operation on key "${String(e)}" failed: target is readonly.`, t),
        !0
    }
}
  , iL = Ad({}, XI, {
    get: XF,
    set: eL
})
  , oL = Ad({}, KI, {
    get: qF
})
  , Xx = t => t
  , eg = t => Reflect.getPrototypeOf(t);
function vh(t, e, n=!1, r=!1) {
    t = t.__v_raw;
    const i = Le(t)
      , o = Le(e);
    n || (e !== o && er(i, "get", e),
    er(i, "get", o));
    const {has: s} = eg(i)
      , a = r ? Xx : n ? Kx : Vf;
    if (s.call(i, e))
        return a(t.get(e));
    if (s.call(i, o))
        return a(t.get(o));
    t !== i && t.get(e)
}
function yh(t, e=!1) {
    const n = this.__v_raw
      , r = Le(n)
      , i = Le(t);
    return e || (t !== i && er(r, "has", t),
    er(r, "has", i)),
    t === i ? n.has(t) : n.has(t) || n.has(i)
}
function _h(t, e=!1) {
    return t = t.__v_raw,
    !e && er(Le(t), "iterate", qa),
    Reflect.get(t, "size", t)
}
function OE(t) {
    t = Le(t);
    const e = Le(this);
    return eg(e).has.call(e, t) || (e.add(t),
    uo(e, "add", t, t)),
    this
}
function RE(t, e) {
    e = Le(e);
    const n = Le(this)
      , {has: r, get: i} = eg(n);
    let o = r.call(n, t);
    o ? qI(n, r, t) : (t = Le(t),
    o = r.call(n, t));
    const s = i.call(n, t);
    return n.set(t, e),
    o ? zx(e, s) && uo(n, "set", t, e, s) : uo(n, "add", t, e),
    this
}
function ME(t) {
    const e = Le(this)
      , {has: n, get: r} = eg(e);
    let i = n.call(e, t);
    i ? qI(e, n, t) : (t = Le(t),
    i = n.call(e, t));
    const o = r ? r.call(e, t) : void 0
      , s = e.delete(t);
    return i && uo(e, "delete", t, void 0, o),
    s
}
function DE() {
    const t = Le(this)
      , e = t.size !== 0
      , n = uf(t) ? new Map(t) : new Set(t)
      , r = t.clear();
    return e && uo(t, "clear", void 0, void 0, n),
    r
}
function xh(t, e) {
    return function(r, i) {
        const o = this
          , s = o.__v_raw
          , a = Le(s)
          , l = e ? Xx : t ? Kx : Vf;
        return !t && er(a, "iterate", qa),
        s.forEach( (c, u) => r.call(i, l(c), l(u), o))
    }
}
function bh(t, e, n) {
    return function(...r) {
        const i = this.__v_raw
          , o = Le(i)
          , s = uf(o)
          , a = t === "entries" || t === Symbol.iterator && s
          , l = t === "keys" && s
          , c = i[t](...r)
          , u = n ? Xx : e ? Kx : Vf;
        return !e && er(o, "iterate", l ? sy : qa),
        {
            next() {
                const {value: f, done: d} = c.next();
                return d ? {
                    value: f,
                    done: d
                } : {
                    value: a ? [u(f[0]), u(f[1])] : u(f),
                    done: d
                }
            },
            [Symbol.iterator]() {
                return this
            }
        }
    }
}
function ps(t) {
    return function(...e) {
        {
            const n = e[0] ? `on key "${e[0]}" ` : "";
            console.warn(`${$F(t)} operation ${n}failed: target is readonly.`, Le(this))
        }
        return t === "delete" ? !1 : this
    }
}
function sL() {
    const t = {
        get(o) {
            return vh(this, o)
        },
        get size() {
            return _h(this)
        },
        has: yh,
        add: OE,
        set: RE,
        delete: ME,
        clear: DE,
        forEach: xh(!1, !1)
    }
      , e = {
        get(o) {
            return vh(this, o, !1, !0)
        },
        get size() {
            return _h(this)
        },
        has: yh,
        add: OE,
        set: RE,
        delete: ME,
        clear: DE,
        forEach: xh(!1, !0)
    }
      , n = {
        get(o) {
            return vh(this, o, !0)
        },
        get size() {
            return _h(this, !0)
        },
        has(o) {
            return yh.call(this, o, !0)
        },
        add: ps("add"),
        set: ps("set"),
        delete: ps("delete"),
        clear: ps("clear"),
        forEach: xh(!0, !1)
    }
      , r = {
        get(o) {
            return vh(this, o, !0, !0)
        },
        get size() {
            return _h(this, !0)
        },
        has(o) {
            return yh.call(this, o, !0)
        },
        add: ps("add"),
        set: ps("set"),
        delete: ps("delete"),
        clear: ps("clear"),
        forEach: xh(!0, !0)
    };
    return ["keys", "values", "entries", Symbol.iterator].forEach(o => {
        t[o] = bh(o, !1, !1),
        n[o] = bh(o, !0, !1),
        e[o] = bh(o, !1, !0),
        r[o] = bh(o, !0, !0)
    }
    ),
    [t, n, e, r]
}
const [aL,lL,cL,uL] = sL();
function tg(t, e) {
    const n = e ? t ? uL : cL : t ? lL : aL;
    return (r, i, o) => i === "__v_isReactive" ? !t : i === "__v_isReadonly" ? t : i === "__v_raw" ? r : Reflect.get(J0(n, i) && i in r ? n : r, i, o)
}
const fL = {
    get: tg(!1, !1)
}
  , dL = {
    get: tg(!1, !0)
}
  , hL = {
    get: tg(!0, !1)
}
  , pL = {
    get: tg(!0, !0)
};
function qI(t, e, n) {
    const r = Le(n);
    if (r !== n && e.call(t, r)) {
        const i = UI(t);
        console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i === "Map" ? " as keys" : ""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)
    }
}
const ZI = new WeakMap
  , JI = new WeakMap
  , QI = new WeakMap
  , e4 = new WeakMap;
function gL(t) {
    switch (t) {
    case "Object":
    case "Array":
        return 1;
    case "Map":
    case "Set":
    case "WeakMap":
    case "WeakSet":
        return 2;
    default:
        return 0
    }
}
function mL(t) {
    return t.__v_skip || !Object.isExtensible(t) ? 0 : gL(UI(t))
}
function Mt(t) {
    return ts(t) ? t : ng(t, !1, XI, fL, ZI)
}
function t4(t) {
    return ng(t, !1, iL, dL, JI)
}
function Il(t) {
    return ng(t, !0, KI, hL, QI)
}
function gc(t) {
    return ng(t, !0, oL, pL, e4)
}
function ng(t, e, n, r, i) {
    if (!Td(t))
        return console.warn(`value cannot be made reactive: ${String(t)}`),
        t;
    if (t.__v_raw && !(e && t.__v_isReactive))
        return t;
    const o = i.get(t);
    if (o)
        return o;
    const s = mL(t);
    if (s === 0)
        return t;
    const a = new Proxy(t,s === 2 ? r : n);
    return i.set(t, a),
    a
}
function Bi(t) {
    return ts(t) ? Bi(t.__v_raw) : !!(t && t.__v_isReactive)
}
function ts(t) {
    return !!(t && t.__v_isReadonly)
}
function Gf(t) {
    return !!(t && t.__v_isShallow)
}
function Hf(t) {
    return Bi(t) || ts(t)
}
function Le(t) {
    const e = t && t.__v_raw;
    return e ? Le(e) : t
}
function ro(t) {
    return UF(t, "__v_skip", !0),
    t
}
const Vf = t => Td(t) ? Mt(t) : t
  , Kx = t => Td(t) ? Il(t) : t;
function qx(t) {
    Hs && cr && (t = Le(t),
    jI(t.dep || (t.dep = Yx()), {
        target: t,
        type: "get",
        key: "value"
    }))
}
function rg(t, e) {
    t = Le(t);
    const n = t.dep;
    n && ay(n, {
        target: t,
        type: "set",
        key: "value",
        newValue: e
    })
}
function pt(t) {
    return !!(t && t.__v_isRef === !0)
}
function Z(t) {
    return n4(t, !1)
}
function ig(t) {
    return n4(t, !0)
}
function n4(t, e) {
    return pt(t) ? t : new vL(t,e)
}
class vL {
    constructor(e, n) {
        this.__v_isShallow = n,
        this.dep = void 0,
        this.__v_isRef = !0,
        this._rawValue = n ? e : Le(e),
        this._value = n ? e : Vf(e)
    }
    get value() {
        return qx(this),
        this._value
    }
    set value(e) {
        const n = this.__v_isShallow || Gf(e) || ts(e);
        e = n ? e : Le(e),
        zx(e, this._rawValue) && (this._rawValue = e,
        this._value = n ? e : Vf(e),
        rg(this, e))
    }
}
function yL(t) {
    rg(t, t.value)
}
function dr(t) {
    return pt(t) ? t.value : t
}
function _L(t) {
    return Gx(t) ? t() : dr(t)
}
const xL = {
    get: (t, e, n) => dr(Reflect.get(t, e, n)),
    set: (t, e, n, r) => {
        const i = t[e];
        return pt(i) && !pt(n) ? (i.value = n,
        !0) : Reflect.set(t, e, n, r)
    }
};
function Zx(t) {
    return Bi(t) ? t : new Proxy(t,xL)
}
class bL {
    constructor(e) {
        this.dep = void 0,
        this.__v_isRef = !0;
        const {get: n, set: r} = e( () => qx(this), () => rg(this));
        this._get = n,
        this._set = r
    }
    get value() {
        return this._get()
    }
    set value(e) {
        this._set(e)
    }
}
function r4(t) {
    return new bL(t)
}
function ly(t) {
    Hf(t) || console.warn("toRefs() expects a reactive object but received a plain one.");
    const e = jo(t) ? new Array(t.length) : {};
    for (const n in t)
        e[n] = i4(t, n);
    return e
}
class wL {
    constructor(e, n, r) {
        this._object = e,
        this._key = n,
        this._defaultValue = r,
        this.__v_isRef = !0
    }
    get value() {
        const e = this._object[this._key];
        return e === void 0 ? this._defaultValue : e
    }
    set value(e) {
        this._object[this._key] = e
    }
    get dep() {
        return jF(Le(this._object), this._key)
    }
}
class EL {
    constructor(e) {
        this._getter = e,
        this.__v_isRef = !0,
        this.__v_isReadonly = !0
    }
    get value() {
        return this._getter()
    }
}
function ff(t, e, n) {
    return pt(t) ? t : Gx(t) ? new EL(t) : Td(t) && arguments.length > 1 ? i4(t, e, n) : Z(t)
}
function i4(t, e, n) {
    const r = t[e];
    return pt(r) ? r : new wL(t,e,n)
}
class SL {
    constructor(e, n, r, i) {
        this._setter = n,
        this.dep = void 0,
        this.__v_isRef = !0,
        this.__v_isReadonly = !1,
        this._dirty = !0,
        this.effect = new Od(e, () => {
            this._dirty || (this._dirty = !0,
            rg(this))
        }
        ),
        this.effect.computed = this,
        this.effect.active = this._cacheable = !i,
        this.__v_isReadonly = r
    }
    get value() {
        const e = Le(this);
        return qx(e),
        (e._dirty || !e._cacheable) && (e._dirty = !1,
        e._value = e.effect.run()),
        e._value
    }
    set value(e) {
        this._setter(e)
    }
}
function CL(t, e, n=!1) {
    let r, i;
    const o = Gx(t);
    o ? (r = t,
    i = () => {
        console.warn("Write operation failed: computed value is readonly")
    }
    ) : (r = t.get,
    i = t.set);
    const s = new SL(r,i,o || !i,n);
    return e && !n && (s.effect.onTrack = e.onTrack,
    s.effect.onTrigger = e.onTrigger),
    s
}
function Rd(t, e) {
    const n = Object.create(null)
      , r = t.split(",");
    for (let i = 0; i < r.length; i++)
        n[r[i]] = !0;
    return e ? i => !!n[i.toLowerCase()] : i => !!n[i]
}
const St = Object.freeze({})
  , Sc = Object.freeze([])
  , Cr = () => {}
  , o4 = () => !1
  , AL = /^on[^a-z]/
  , Md = t => AL.test(t)
  , cy = t => t.startsWith("onUpdate:")
  , Xt = Object.assign
  , Jx = (t, e) => {
    const n = t.indexOf(e);
    n > -1 && t.splice(n, 1)
}
  , TL = Object.prototype.hasOwnProperty
  , lt = (t, e) => TL.call(t, e)
  , He = Array.isArray
  , s4 = t => Dd(t) === "[object Map]"
  , a4 = t => Dd(t) === "[object Set]"
  , PL = t => Dd(t) === "[object RegExp]"
  , Ge = t => typeof t == "function"
  , nn = t => typeof t == "string"
  , Tt = t => t !== null && typeof t == "object"
  , og = t => Tt(t) && Ge(t.then) && Ge(t.catch)
  , l4 = Object.prototype.toString
  , Dd = t => l4.call(t)
  , IL = t => Dd(t).slice(8, -1)
  , c4 = t => Dd(t) === "[object Object]"
  , df = Rd(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted")
  , OL = Rd("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo")
  , sg = t => {
    const e = Object.create(null);
    return n => e[n] || (e[n] = t(n))
}
  , RL = /-(\w)/g
  , Fi = sg(t => t.replace(RL, (e, n) => n ? n.toUpperCase() : ""))
  , ML = /\B([A-Z])/g
  , Bc = sg(t => t.replace(ML, "-$1").toLowerCase())
  , kc = sg(t => t.charAt(0).toUpperCase() + t.slice(1))
  , Lo = sg(t => t ? `on${kc(t)}` : "")
  , uy = (t, e) => !Object.is(t, e)
  , ka = (t, e) => {
    for (let n = 0; n < t.length; n++)
        t[n](e)
}
  , fy = (t, e, n) => {
    Object.defineProperty(t, e, {
        configurable: !0,
        enumerable: !1,
        value: n
    })
}
  , DL = t => {
    const e = parseFloat(t);
    return isNaN(e) ? t : e
}
  , BL = t => {
    const e = nn(t) ? Number(t) : NaN;
    return isNaN(e) ? t : e
}
;
let BE;
const Jp = () => BE || (BE = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {})
  , kL = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console"
  , NL = Rd(kL);
function Bd(t) {
    if (He(t)) {
        const e = {};
        for (let n = 0; n < t.length; n++) {
            const r = t[n]
              , i = nn(r) ? UL(r) : Bd(r);
            if (i)
                for (const o in i)
                    e[o] = i[o]
        }
        return e
    } else {
        if (nn(t))
            return t;
        if (Tt(t))
            return t
    }
}
const FL = /;(?![^(]*\))/g
  , LL = /:([^]+)/
  , $L = /\/\*[^]*?\*\//g;
function UL(t) {
    const e = {};
    return t.replace($L, "").split(FL).forEach(n => {
        if (n) {
            const r = n.split(LL);
            r.length > 1 && (e[r[0].trim()] = r[1].trim())
        }
    }
    ),
    e
}
function kd(t) {
    let e = "";
    if (nn(t))
        e = t;
    else if (He(t))
        for (let n = 0; n < t.length; n++) {
            const r = kd(t[n]);
            r && (e += r + " ")
        }
    else if (Tt(t))
        for (const n in t)
            t[n] && (e += n + " ");
    return e.trim()
}
function GL(t) {
    if (!t)
        return null;
    let {class: e, style: n} = t;
    return e && !nn(e) && (t.class = kd(e)),
    n && (t.style = Bd(n)),
    t
}
const HL = t => nn(t) ? t : t == null ? "" : He(t) || Tt(t) && (t.toString === l4 || !Ge(t.toString)) ? JSON.stringify(t, u4, 2) : String(t)
  , u4 = (t, e) => e && e.__v_isRef ? u4(t, e.value) : s4(e) ? {
    [`Map(${e.size})`]: [...e.entries()].reduce( (n, [r,i]) => (n[`${r} =>`] = i,
    n), {})
} : a4(e) ? {
    [`Set(${e.size})`]: [...e.values()]
} : Tt(e) && !He(e) && !c4(e) ? String(e) : e
  , Za = [];
function hf(t) {
    Za.push(t)
}
function pf() {
    Za.pop()
}
function se(t, ...e) {
    Tl();
    const n = Za.length ? Za[Za.length - 1].component : null
      , r = n && n.appContext.config.warnHandler
      , i = VL();
    if (r)
        so(r, n, 11, [t + e.join(""), n && n.proxy, i.map( ({vnode: o}) => `at <${yg(n, o.type)}>`).join(`
`), i]);
    else {
        const o = [`[Vue warn]: ${t}`, ...e];
        i.length && o.push(`
`, ...zL(i)),
        console.warn(...o)
    }
    Pl()
}
function VL() {
    let t = Za[Za.length - 1];
    if (!t)
        return [];
    const e = [];
    for (; t; ) {
        const n = e[0];
        n && n.vnode === t ? n.recurseCount++ : e.push({
            vnode: t,
            recurseCount: 0
        });
        const r = t.component && t.component.parent;
        t = r && r.vnode
    }
    return e
}
function zL(t) {
    const e = [];
    return t.forEach( (n, r) => {
        e.push(...r === 0 ? [] : [`
`], ...jL(n))
    }
    ),
    e
}
function jL({vnode: t, recurseCount: e}) {
    const n = e > 0 ? `... (${e} recursive calls)` : ""
      , r = t.component ? t.component.parent == null : !1
      , i = ` at <${yg(t.component, t.type, r)}`
      , o = ">" + n;
    return t.props ? [i, ...WL(t.props), o] : [i + o]
}
function WL(t) {
    const e = []
      , n = Object.keys(t);
    return n.slice(0, 3).forEach(r => {
        e.push(...f4(r, t[r]))
    }
    ),
    n.length > 3 && e.push(" ..."),
    e
}
function f4(t, e, n) {
    return nn(e) ? (e = JSON.stringify(e),
    n ? e : [`${t}=${e}`]) : typeof e == "number" || typeof e == "boolean" || e == null ? n ? e : [`${t}=${e}`] : pt(e) ? (e = f4(t, Le(e.value), !0),
    n ? e : [`${t}=Ref<`, e, ">"]) : Ge(e) ? [`${t}=fn${e.name ? `<${e.name}>` : ""}`] : (e = Le(e),
    n ? e : [`${t}=`, e])
}
function Qx(t, e) {
    t !== void 0 && (typeof t != "number" ? se(`${e} is not a valid number - got ${JSON.stringify(t)}.`) : isNaN(t) && se(`${e} is NaN - the duration expression might be incorrect.`))
}
const eb = {
    sp: "serverPrefetch hook",
    bc: "beforeCreate hook",
    c: "created hook",
    bm: "beforeMount hook",
    m: "mounted hook",
    bu: "beforeUpdate hook",
    u: "updated",
    bum: "beforeUnmount hook",
    um: "unmounted hook",
    a: "activated hook",
    da: "deactivated hook",
    ec: "errorCaptured hook",
    rtc: "renderTracked hook",
    rtg: "renderTriggered hook",
    0: "setup function",
    1: "render function",
    2: "watcher getter",
    3: "watcher callback",
    4: "watcher cleanup function",
    5: "native event handler",
    6: "component event handler",
    7: "vnode hook",
    8: "directive hook",
    9: "transition hook",
    10: "app errorHandler",
    11: "app warnHandler",
    12: "ref function",
    13: "async component loader",
    14: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
};
function so(t, e, n, r) {
    let i;
    try {
        i = r ? t(...r) : t()
    } catch (o) {
        Ol(o, e, n)
    }
    return i
}
function Hr(t, e, n, r) {
    if (Ge(t)) {
        const o = so(t, e, n, r);
        return o && og(o) && o.catch(s => {
            Ol(s, e, n)
        }
        ),
        o
    }
    const i = [];
    for (let o = 0; o < t.length; o++)
        i.push(Hr(t[o], e, n, r));
    return i
}
function Ol(t, e, n, r=!0) {
    const i = e ? e.vnode : null;
    if (e) {
        let o = e.parent;
        const s = e.proxy
          , a = eb[n];
        for (; o; ) {
            const c = o.ec;
            if (c) {
                for (let u = 0; u < c.length; u++)
                    if (c[u](t, s, a) === !1)
                        return
            }
            o = o.parent
        }
        const l = e.appContext.config.errorHandler;
        if (l) {
            so(l, null, 10, [t, s, a]);
            return
        }
    }
    YL(t, n, i, r)
}
function YL(t, e, n, r=!0) {
    {
        const i = eb[e];
        if (n && hf(n),
        se(`Unhandled error${i ? ` during execution of ${i}` : ""}`),
        n && pf(),
        r)
            throw t;
        console.error(t)
    }
}
let zf = !1
  , dy = !1;
const Kn = [];
let to = 0;
const Cc = [];
let qi = null
  , As = 0;
const d4 = Promise.resolve();
let tb = null;
const XL = 100;
function Xe(t) {
    const e = tb || d4;
    return t ? e.then(this ? t.bind(this) : t) : e
}
function KL(t) {
    let e = to + 1
      , n = Kn.length;
    for (; e < n; ) {
        const r = e + n >>> 1;
        jf(Kn[r]) < t ? e = r + 1 : n = r
    }
    return e
}
function Nd(t) {
    (!Kn.length || !Kn.includes(t, zf && t.allowRecurse ? to + 1 : to)) && (t.id == null ? Kn.push(t) : Kn.splice(KL(t.id), 0, t),
    h4())
}
function h4() {
    !zf && !dy && (dy = !0,
    tb = d4.then(p4))
}
function qL(t) {
    const e = Kn.indexOf(t);
    e > to && Kn.splice(e, 1)
}
function ag(t) {
    He(t) ? Cc.push(...t) : (!qi || !qi.includes(t, t.allowRecurse ? As + 1 : As)) && Cc.push(t),
    h4()
}
function kE(t, e=zf ? to + 1 : 0) {
    for (t = t || new Map; e < Kn.length; e++) {
        const n = Kn[e];
        if (n && n.pre) {
            if (nb(t, n))
                continue;
            Kn.splice(e, 1),
            e--,
            n()
        }
    }
}
function Qp(t) {
    if (Cc.length) {
        const e = [...new Set(Cc)];
        if (Cc.length = 0,
        qi) {
            qi.push(...e);
            return
        }
        for (qi = e,
        t = t || new Map,
        qi.sort( (n, r) => jf(n) - jf(r)),
        As = 0; As < qi.length; As++)
            nb(t, qi[As]) || qi[As]();
        qi = null,
        As = 0
    }
}
const jf = t => t.id == null ? 1 / 0 : t.id
  , ZL = (t, e) => {
    const n = jf(t) - jf(e);
    if (n === 0) {
        if (t.pre && !e.pre)
            return -1;
        if (e.pre && !t.pre)
            return 1
    }
    return n
}
;
function p4(t) {
    dy = !1,
    zf = !0,
    t = t || new Map,
    Kn.sort(ZL);
    const e = n => nb(t, n);
    try {
        for (to = 0; to < Kn.length; to++) {
            const n = Kn[to];
            if (n && n.active !== !1) {
                if (e(n))
                    continue;
                so(n, null, 14)
            }
        }
    } finally {
        to = 0,
        Kn.length = 0,
        Qp(t),
        zf = !1,
        tb = null,
        (Kn.length || Cc.length) && p4(t)
    }
}
function nb(t, e) {
    if (!t.has(e))
        t.set(e, 1);
    else {
        const n = t.get(e);
        if (n > XL) {
            const r = e.ownerInstance
              , i = r && qf(r.type);
            return se(`Maximum recursive updates exceeded${i ? ` in component <${i}>` : ""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),
            !0
        } else
            t.set(e, n + 1)
    }
}
let Vs = !1;
const uc = new Set;
Jp().__VUE_HMR_RUNTIME__ = {
    createRecord: Am(g4),
    rerender: Am(e7),
    reload: Am(t7)
};
const al = new Map;
function JL(t) {
    const e = t.type.__hmrId;
    let n = al.get(e);
    n || (g4(e, t.type),
    n = al.get(e)),
    n.instances.add(t)
}
function QL(t) {
    al.get(t.type.__hmrId).instances.delete(t)
}
function g4(t, e) {
    return al.has(t) ? !1 : (al.set(t, {
        initialDef: gf(e),
        instances: new Set
    }),
    !0)
}
function gf(t) {
    return oO(t) ? t.__vccOpts : t
}
function e7(t, e) {
    const n = al.get(t);
    n && (n.initialDef.render = e,
    [...n.instances].forEach(r => {
        e && (r.render = e,
        gf(r.type).render = e),
        r.renderCache = [],
        Vs = !0,
        r.update(),
        Vs = !1
    }
    ))
}
function t7(t, e) {
    const n = al.get(t);
    if (!n)
        return;
    e = gf(e),
    NE(n.initialDef, e);
    const r = [...n.instances];
    for (const i of r) {
        const o = gf(i.type);
        uc.has(o) || (o !== n.initialDef && NE(o, e),
        uc.add(o)),
        i.appContext.propsCache.delete(i.type),
        i.appContext.emitsCache.delete(i.type),
        i.appContext.optionsCache.delete(i.type),
        i.ceReload ? (uc.add(o),
        i.ceReload(e.styles),
        uc.delete(o)) : i.parent ? Nd(i.parent.update) : i.appContext.reload ? i.appContext.reload() : typeof window < "u" ? window.location.reload() : console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")
    }
    ag( () => {
        for (const i of r)
            uc.delete(gf(i.type))
    }
    )
}
function NE(t, e) {
    Xt(t, e);
    for (const n in t)
        n !== "__file" && !(n in e) && delete t[n]
}
function Am(t) {
    return (e, n) => {
        try {
            return t(e, n)
        } catch (r) {
            console.error(r),
            console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")
        }
    }
}
let Ci, Qu = [], hy = !1;
function Fd(t, ...e) {
    Ci ? Ci.emit(t, ...e) : hy || Qu.push({
        event: t,
        args: e
    })
}
function rb(t, e) {
    var n, r;
    Ci = t,
    Ci ? (Ci.enabled = !0,
    Qu.forEach( ({event: i, args: o}) => Ci.emit(i, ...o)),
    Qu = []) : typeof window < "u" && window.HTMLElement && !((r = (n = window.navigator) == null ? void 0 : n.userAgent) != null && r.includes("jsdom")) ? ((e.__VUE_DEVTOOLS_HOOK_REPLAY__ = e.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push(o => {
        rb(o, e)
    }
    ),
    setTimeout( () => {
        Ci || (e.__VUE_DEVTOOLS_HOOK_REPLAY__ = null,
        hy = !0,
        Qu = [])
    }
    , 3e3)) : (hy = !0,
    Qu = [])
}
function n7(t, e) {
    Fd("app:init", t, e, {
        Fragment: Ft,
        Text: fo,
        Comment: en,
        Static: zs
    })
}
function r7(t) {
    Fd("app:unmount", t)
}
const py = ib("component:added")
  , m4 = ib("component:updated")
  , i7 = ib("component:removed")
  , o7 = t => {
    Ci && typeof Ci.cleanupBuffer == "function" && !Ci.cleanupBuffer(t) && i7(t)
}
;
function ib(t) {
    return e => {
        Fd(t, e.appContext.app, e.uid, e.parent ? e.parent.uid : void 0, e)
    }
}
const s7 = v4("perf:start")
  , a7 = v4("perf:end");
function v4(t) {
    return (e, n, r) => {
        Fd(t, e.appContext.app, e.uid, e, n, r)
    }
}
function l7(t, e, n) {
    Fd("component:emit", t.appContext.app, t, e, n)
}
function c7(t, e, ...n) {
    if (t.isUnmounted)
        return;
    const r = t.vnode.props || St;
    {
        const {emitsOptions: u, propsOptions: [f]} = t;
        if (u)
            if (!(e in u))
                (!f || !(Lo(e)in f)) && se(`Component emitted event "${e}" but it is neither declared in the emits option nor as an "${Lo(e)}" prop.`);
            else {
                const d = u[e];
                Ge(d) && (d(...n) || se(`Invalid event arguments: event validation failed for event "${e}".`))
            }
    }
    let i = n;
    const o = e.startsWith("update:")
      , s = o && e.slice(7);
    if (s && s in r) {
        const u = `${s === "modelValue" ? "model" : s}Modifiers`
          , {number: f, trim: d} = r[u] || St;
        d && (i = n.map(h => nn(h) ? h.trim() : h)),
        f && (i = n.map(DL))
    }
    l7(t, e, i);
    {
        const u = e.toLowerCase();
        u !== e && r[Lo(u)] && se(`Event "${u}" is emitted in component ${yg(t, t.type)} but the handler is registered for "${e}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Bc(e)}" instead of "${e}".`)
    }
    let a, l = r[a = Lo(e)] || r[a = Lo(Fi(e))];
    !l && o && (l = r[a = Lo(Bc(e))]),
    l && Hr(l, t, 6, i);
    const c = r[a + "Once"];
    if (c) {
        if (!t.emitted)
            t.emitted = {};
        else if (t.emitted[a])
            return;
        t.emitted[a] = !0,
        Hr(c, t, 6, i)
    }
}
function y4(t, e, n=!1) {
    const r = e.emitsCache
      , i = r.get(t);
    if (i !== void 0)
        return i;
    const o = t.emits;
    let s = {}
      , a = !1;
    if (!Ge(t)) {
        const l = c => {
            const u = y4(c, e, !0);
            u && (a = !0,
            Xt(s, u))
        }
        ;
        !n && e.mixins.length && e.mixins.forEach(l),
        t.extends && l(t.extends),
        t.mixins && t.mixins.forEach(l)
    }
    return !o && !a ? (Tt(t) && r.set(t, null),
    null) : (He(o) ? o.forEach(l => s[l] = null) : Xt(s, o),
    Tt(t) && r.set(t, s),
    s)
}
function lg(t, e) {
    return !t || !Md(e) ? !1 : (e = e.slice(2).replace(/Once$/, ""),
    lt(t, e[0].toLowerCase() + e.slice(1)) || lt(t, Bc(e)) || lt(t, e))
}
let ln = null
  , cg = null;
function Wf(t) {
    const e = ln;
    return ln = t,
    cg = t && t.type.__scopeId || null,
    e
}
function u7(t) {
    cg = t
}
function f7() {
    cg = null
}
const d7 = t => ob;
function ob(t, e=ln, n) {
    if (!e || t._n)
        return t;
    const r = (...i) => {
        r._d && wy(-1);
        const o = Wf(e);
        let s;
        try {
            s = t(...i)
        } finally {
            Wf(o),
            r._d && wy(1)
        }
        return m4(e),
        s
    }
    ;
    return r._n = !0,
    r._c = !0,
    r._d = !0,
    r
}
let gy = !1;
function e0() {
    gy = !0
}
function Ep(t) {
    const {type: e, vnode: n, proxy: r, withProxy: i, props: o, propsOptions: [s], slots: a, attrs: l, emit: c, render: u, renderCache: f, data: d, setupState: h, ctx: p, inheritAttrs: y} = t;
    let v, g;
    const m = Wf(t);
    gy = !1;
    try {
        if (n.shapeFlag & 4) {
            const b = i || r;
            v = wr(u.call(b, b, f, o, h, d, p)),
            g = l
        } else {
            const b = e;
            l === o && e0(),
            v = wr(b.length > 1 ? b(o, {
                get attrs() {
                    return e0(),
                    l
                },
                slots: a,
                emit: c
            }) : b(o, null)),
            g = e.props ? l : p7(l)
        }
    } catch (b) {
        vf.length = 0,
        Ol(b, t, 1),
        v = R(en)
    }
    let _ = v, x;
    if (v.patchFlag > 0 && v.patchFlag & 2048 && ([_,x] = h7(v)),
    g && y !== !1) {
        const b = Object.keys(g)
          , {shapeFlag: w} = _;
        if (b.length) {
            if (w & 7)
                s && b.some(cy) && (g = g7(g, s)),
                _ = vi(_, g);
            else if (!gy && _.type !== en) {
                const E = Object.keys(l)
                  , S = []
                  , P = [];
                for (let C = 0, A = E.length; C < A; C++) {
                    const T = E[C];
                    Md(T) ? cy(T) || S.push(T[2].toLowerCase() + T.slice(3)) : P.push(T)
                }
                P.length && se(`Extraneous non-props attributes (${P.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`),
                S.length && se(`Extraneous non-emits event listeners (${S.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)
            }
        }
    }
    return n.dirs && (FE(_) || se("Runtime directive used on component with non-element root node. The directives will not function as intended."),
    _ = vi(_),
    _.dirs = _.dirs ? _.dirs.concat(n.dirs) : n.dirs),
    n.transition && (FE(_) || se("Component inside <Transition> renders non-element root node that cannot be animated."),
    _.transition = n.transition),
    x ? x(_) : v = _,
    Wf(m),
    v
}
const h7 = t => {
    const e = t.children
      , n = t.dynamicChildren
      , r = sb(e);
    if (!r)
        return [t, void 0];
    const i = e.indexOf(r)
      , o = n ? n.indexOf(r) : -1
      , s = a => {
        e[i] = a,
        n && (o > -1 ? n[o] = a : a.patchFlag > 0 && (t.dynamicChildren = [...n, a]))
    }
    ;
    return [wr(r), s]
}
;
function sb(t) {
    let e;
    for (let n = 0; n < t.length; n++) {
        const r = t[n];
        if (ho(r)) {
            if (r.type !== en || r.children === "v-if") {
                if (e)
                    return;
                e = r
            }
        } else
            return
    }
    return e
}
const p7 = t => {
    let e;
    for (const n in t)
        (n === "class" || n === "style" || Md(n)) && ((e || (e = {}))[n] = t[n]);
    return e
}
  , g7 = (t, e) => {
    const n = {};
    for (const r in t)
        (!cy(r) || !(r.slice(9)in e)) && (n[r] = t[r]);
    return n
}
  , FE = t => t.shapeFlag & 7 || t.type === en;
function m7(t, e, n) {
    const {props: r, children: i, component: o} = t
      , {props: s, children: a, patchFlag: l} = e
      , c = o.emitsOptions;
    if ((i || a) && Vs || e.dirs || e.transition)
        return !0;
    if (n && l >= 0) {
        if (l & 1024)
            return !0;
        if (l & 16)
            return r ? LE(r, s, c) : !!s;
        if (l & 8) {
            const u = e.dynamicProps;
            for (let f = 0; f < u.length; f++) {
                const d = u[f];
                if (s[d] !== r[d] && !lg(c, d))
                    return !0
            }
        }
    } else
        return (i || a) && (!a || !a.$stable) ? !0 : r === s ? !1 : r ? s ? LE(r, s, c) : !0 : !!s;
    return !1
}
function LE(t, e, n) {
    const r = Object.keys(e);
    if (r.length !== Object.keys(t).length)
        return !0;
    for (let i = 0; i < r.length; i++) {
        const o = r[i];
        if (e[o] !== t[o] && !lg(n, o))
            return !0
    }
    return !1
}
function ab({vnode: t, parent: e}, n) {
    for (; e && e.subTree === t; )
        (t = e.vnode).el = n,
        e = e.parent
}
const _4 = t => t.__isSuspense
  , v7 = {
    name: "Suspense",
    __isSuspense: !0,
    process(t, e, n, r, i, o, s, a, l, c) {
        t == null ? _7(e, n, r, i, o, s, a, l, c) : x7(t, e, n, r, i, s, a, l, c)
    },
    hydrate: b7,
    create: lb,
    normalize: w7
}
  , y7 = v7;
function Yf(t, e) {
    const n = t.props && t.props[e];
    Ge(n) && n()
}
function _7(t, e, n, r, i, o, s, a, l) {
    const {p: c, o: {createElement: u}} = l
      , f = u("div")
      , d = t.suspense = lb(t, i, r, e, f, n, o, s, a, l);
    c(null, d.pendingBranch = t.ssContent, f, null, r, d, o, s),
    d.deps > 0 ? (Yf(t, "onPending"),
    Yf(t, "onFallback"),
    c(null, t.ssFallback, e, n, r, null, o, s),
    Ac(d, t.ssFallback)) : d.resolve(!1, !0)
}
function x7(t, e, n, r, i, o, s, a, {p: l, um: c, o: {createElement: u}}) {
    const f = e.suspense = t.suspense;
    f.vnode = e,
    e.el = t.el;
    const d = e.ssContent
      , h = e.ssFallback
      , {activeBranch: p, pendingBranch: y, isInFallback: v, isHydrating: g} = f;
    if (y)
        f.pendingBranch = d,
        Ai(d, y) ? (l(y, d, f.hiddenContainer, null, i, f, o, s, a),
        f.deps <= 0 ? f.resolve() : v && (l(p, h, n, r, i, null, o, s, a),
        Ac(f, h))) : (f.pendingId++,
        g ? (f.isHydrating = !1,
        f.activeBranch = y) : c(y, i, f),
        f.deps = 0,
        f.effects.length = 0,
        f.hiddenContainer = u("div"),
        v ? (l(null, d, f.hiddenContainer, null, i, f, o, s, a),
        f.deps <= 0 ? f.resolve() : (l(p, h, n, r, i, null, o, s, a),
        Ac(f, h))) : p && Ai(d, p) ? (l(p, d, n, r, i, f, o, s, a),
        f.resolve(!0)) : (l(null, d, f.hiddenContainer, null, i, f, o, s, a),
        f.deps <= 0 && f.resolve()));
    else if (p && Ai(d, p))
        l(p, d, n, r, i, f, o, s, a),
        Ac(f, d);
    else if (Yf(e, "onPending"),
    f.pendingBranch = d,
    f.pendingId++,
    l(null, d, f.hiddenContainer, null, i, f, o, s, a),
    f.deps <= 0)
        f.resolve();
    else {
        const {timeout: m, pendingId: _} = f;
        m > 0 ? setTimeout( () => {
            f.pendingId === _ && f.fallback(h)
        }
        , m) : m === 0 && f.fallback(h)
    }
}
let $E = !1;
function lb(t, e, n, r, i, o, s, a, l, c, u=!1) {
    $E || ($E = !0,
    console[console.info ? "info" : "log"]("<Suspense> is an experimental feature and its API will likely change."));
    const {p: f, m: d, um: h, n: p, o: {parentNode: y, remove: v}} = c;
    let g;
    const m = E7(t);
    m && e != null && e.pendingBranch && (g = e.pendingId,
    e.deps++);
    const _ = t.props ? BL(t.props.timeout) : void 0;
    Qx(_, "Suspense timeout");
    const x = {
        vnode: t,
        parent: e,
        parentComponent: n,
        isSVG: s,
        container: r,
        hiddenContainer: i,
        anchor: o,
        deps: 0,
        pendingId: 0,
        timeout: typeof _ == "number" ? _ : -1,
        activeBranch: null,
        pendingBranch: null,
        isInFallback: !0,
        isHydrating: u,
        isUnmounted: !1,
        effects: [],
        resolve(b=!1, w=!1) {
            {
                if (!b && !x.pendingBranch)
                    throw new Error("suspense.resolve() is called without a pending branch.");
                if (x.isUnmounted)
                    throw new Error("suspense.resolve() is called on an already unmounted suspense boundary.")
            }
            const {vnode: E, activeBranch: S, pendingBranch: P, pendingId: C, effects: A, parentComponent: T, container: I} = x;
            if (x.isHydrating)
                x.isHydrating = !1;
            else if (!b) {
                const N = S && P.transition && P.transition.mode === "out-in";
                N && (S.transition.afterLeave = () => {
                    C === x.pendingId && d(P, I, U, 0)
                }
                );
                let {anchor: U} = x;
                S && (U = p(S),
                h(S, T, x, !0)),
                N || d(P, I, U, 0)
            }
            Ac(x, P),
            x.pendingBranch = null,
            x.isInFallback = !1;
            let B = x.parent
              , G = !1;
            for (; B; ) {
                if (B.pendingBranch) {
                    B.effects.push(...A),
                    G = !0;
                    break
                }
                B = B.parent
            }
            G || ag(A),
            x.effects = [],
            m && e && e.pendingBranch && g === e.pendingId && (e.deps--,
            e.deps === 0 && !w && e.resolve()),
            Yf(E, "onResolve")
        },
        fallback(b) {
            if (!x.pendingBranch)
                return;
            const {vnode: w, activeBranch: E, parentComponent: S, container: P, isSVG: C} = x;
            Yf(w, "onFallback");
            const A = p(E)
              , T = () => {
                x.isInFallback && (f(null, b, P, A, S, null, C, a, l),
                Ac(x, b))
            }
              , I = b.transition && b.transition.mode === "out-in";
            I && (E.transition.afterLeave = T),
            x.isInFallback = !0,
            h(E, S, null, !0),
            I || T()
        },
        move(b, w, E) {
            x.activeBranch && d(x.activeBranch, b, w, E),
            x.container = b
        },
        next() {
            return x.activeBranch && p(x.activeBranch)
        },
        registerDep(b, w) {
            const E = !!x.pendingBranch;
            E && x.deps++;
            const S = b.vnode.el;
            b.asyncDep.catch(P => {
                Ol(P, b, 0)
            }
            ).then(P => {
                if (b.isUnmounted || x.isUnmounted || x.pendingId !== b.suspenseId)
                    return;
                b.asyncResolved = !0;
                const {vnode: C} = b;
                hf(C),
                Cy(b, P, !1),
                S && (C.el = S);
                const A = !S && b.subTree.el;
                w(b, C, y(S || b.subTree.el), S ? null : p(b.subTree), x, s, l),
                A && v(A),
                ab(b, C.el),
                pf(),
                E && --x.deps === 0 && x.resolve()
            }
            )
        },
        unmount(b, w) {
            x.isUnmounted = !0,
            x.activeBranch && h(x.activeBranch, n, b, w),
            x.pendingBranch && h(x.pendingBranch, n, b, w)
        }
    };
    return x
}
function b7(t, e, n, r, i, o, s, a, l) {
    const c = e.suspense = lb(e, r, n, t.parentNode, document.createElement("div"), null, i, o, s, a, !0)
      , u = l(t, c.pendingBranch = e.ssContent, n, c, o, s);
    return c.deps === 0 && c.resolve(!1, !0),
    u
}
function w7(t) {
    const {shapeFlag: e, children: n} = t
      , r = e & 32;
    t.ssContent = UE(r ? n.default : n),
    t.ssFallback = r ? UE(n.fallback) : R(en)
}
function UE(t) {
    let e;
    if (Ge(t)) {
        const n = cl && t._c;
        n && (t._d = !1,
        pg()),
        t = t(),
        n && (t._d = !0,
        e = Ar,
        K4())
    }
    if (He(t)) {
        const n = sb(t);
        n || se("<Suspense> slots expect a single root node."),
        t = n
    }
    return t = wr(t),
    e && !t.dynamicChildren && (t.dynamicChildren = e.filter(n => n !== t)),
    t
}
function x4(t, e) {
    e && e.pendingBranch ? He(t) ? e.effects.push(...t) : e.effects.push(t) : ag(t)
}
function Ac(t, e) {
    t.activeBranch = e;
    const {vnode: n, parentComponent: r} = t
      , i = n.el = e.el;
    r && r.subTree === n && (r.vnode.el = i,
    ab(r, i))
}
function E7(t) {
    var e;
    return ((e = t.props) == null ? void 0 : e.suspensible) != null && t.props.suspensible !== !1
}
function fu(t, e) {
    return Ld(t, null, e)
}
function b4(t, e) {
    return Ld(t, null, Xt({}, e, {
        flush: "post"
    }))
}
function S7(t, e) {
    return Ld(t, null, Xt({}, e, {
        flush: "sync"
    }))
}
const wh = {};
function ve(t, e, n) {
    return Ge(e) || se("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),
    Ld(t, e, n)
}
function Ld(t, e, {immediate: n, deep: r, flush: i, onTrack: o, onTrigger: s}=St) {
    var a;
    e || (n !== void 0 && se('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),
    r !== void 0 && se('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));
    const l = b => {
        se("Invalid watch source: ", b, "A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")
    }
      , c = Id() === ((a = an) == null ? void 0 : a.scope) ? an : null;
    let u, f = !1, d = !1;
    if (pt(t) ? (u = () => t.value,
    f = Gf(t)) : Bi(t) ? (u = () => t,
    r = !0) : He(t) ? (d = !0,
    f = t.some(b => Bi(b) || Gf(b)),
    u = () => t.map(b => {
        if (pt(b))
            return b.value;
        if (Bi(b))
            return $a(b);
        if (Ge(b))
            return so(b, c, 2);
        l(b)
    }
    )) : Ge(t) ? e ? u = () => so(t, c, 2) : u = () => {
        if (!(c && c.isUnmounted))
            return h && h(),
            Hr(t, c, 3, [p])
    }
    : (u = Cr,
    l(t)),
    e && r) {
        const b = u;
        u = () => $a(b())
    }
    let h, p = b => {
        h = _.onStop = () => {
            so(b, c, 4)
        }
    }
    , y;
    if (Fc)
        if (p = Cr,
        e ? n && Hr(e, c, 3, [u(), d ? [] : void 0, p]) : u(),
        i === "sync") {
            const b = aO();
            y = b.__watcherHandles || (b.__watcherHandles = [])
        } else
            return Cr;
    let v = d ? new Array(t.length).fill(wh) : wh;
    const g = () => {
        if (_.active)
            if (e) {
                const b = _.run();
                (r || f || (d ? b.some( (w, E) => uy(w, v[E])) : uy(b, v))) && (h && h(),
                Hr(e, c, 3, [b, v === wh ? void 0 : d && v[0] === wh ? [] : v, p]),
                v = b)
            } else
                _.run()
    }
    ;
    g.allowRecurse = !!e;
    let m;
    i === "sync" ? m = g : i === "post" ? m = () => Ln(g, c && c.suspense) : (g.pre = !0,
    c && (g.id = c.uid),
    m = () => Nd(g));
    const _ = new Od(u,m);
    _.onTrack = o,
    _.onTrigger = s,
    e ? n ? g() : v = _.run() : i === "post" ? Ln(_.run.bind(_), c && c.suspense) : _.run();
    const x = () => {
        _.stop(),
        c && c.scope && Jx(c.scope.effects, _)
    }
    ;
    return y && y.push(x),
    x
}
function C7(t, e, n) {
    const r = this.proxy
      , i = nn(t) ? t.includes(".") ? w4(r, t) : () => r[t] : t.bind(r, r);
    let o;
    Ge(e) ? o = e : (o = e.handler,
    n = e);
    const s = an;
    Qs(this);
    const a = Ld(i, o.bind(r), n);
    return s ? Qs(s) : js(),
    a
}
function w4(t, e) {
    const n = e.split(".");
    return () => {
        let r = t;
        for (let i = 0; i < n.length && r; i++)
            r = r[n[i]];
        return r
    }
}
function $a(t, e) {
    if (!Tt(t) || t.__v_skip || (e = e || new Set,
    e.has(t)))
        return t;
    if (e.add(t),
    pt(t))
        $a(t.value, e);
    else if (He(t))
        for (let n = 0; n < t.length; n++)
            $a(t[n], e);
    else if (a4(t) || s4(t))
        t.forEach(n => {
            $a(n, e)
        }
        );
    else if (c4(t))
        for (const n in t)
            $a(t[n], e);
    return t
}
function E4(t) {
    OL(t) && se("Do not use built-in directive ids as custom directive id: " + t)
}
function di(t, e) {
    const n = ln;
    if (n === null)
        return se("withDirectives can only be used inside render functions."),
        t;
    const r = vg(n) || n.proxy
      , i = t.dirs || (t.dirs = []);
    for (let o = 0; o < e.length; o++) {
        let[s,a,l,c=St] = e[o];
        s && (Ge(s) && (s = {
            mounted: s,
            updated: s
        }),
        s.deep && $a(a),
        i.push({
            dir: s,
            instance: r,
            value: a,
            oldValue: void 0,
            arg: l,
            modifiers: c
        }))
    }
    return t
}
function Ji(t, e, n, r) {
    const i = t.dirs
      , o = e && e.dirs;
    for (let s = 0; s < i.length; s++) {
        const a = i[s];
        o && (a.oldValue = o[s].value);
        let l = a.dir[r];
        l && (Tl(),
        Hr(l, n, 8, [t.el, a, t, e]),
        Pl())
    }
}
function cb() {
    const t = {
        isMounted: !1,
        isLeaving: !1,
        isUnmounting: !1,
        leavingVNodes: new Map
    };
    return Ht( () => {
        t.isMounted = !0
    }
    ),
    qr( () => {
        t.isUnmounting = !0
    }
    ),
    t
}
const ei = [Function, Array]
  , ub = {
    mode: String,
    appear: Boolean,
    persisted: Boolean,
    onBeforeEnter: ei,
    onEnter: ei,
    onAfterEnter: ei,
    onEnterCancelled: ei,
    onBeforeLeave: ei,
    onLeave: ei,
    onAfterLeave: ei,
    onLeaveCancelled: ei,
    onBeforeAppear: ei,
    onAppear: ei,
    onAfterAppear: ei,
    onAppearCancelled: ei
}
  , A7 = {
    name: "BaseTransition",
    props: ub,
    setup(t, {slots: e}) {
        const n = yt()
          , r = cb();
        let i;
        return () => {
            const o = e.default && ug(e.default(), !0);
            if (!o || !o.length)
                return;
            let s = o[0];
            if (o.length > 1) {
                let y = !1;
                for (const v of o)
                    if (v.type !== en) {
                        if (y) {
                            se("<transition> can only be used on a single element or component. Use <transition-group> for lists.");
                            break
                        }
                        s = v,
                        y = !0
                    }
            }
            const a = Le(t)
              , {mode: l} = a;
            if (l && l !== "in-out" && l !== "out-in" && l !== "default" && se(`invalid <transition> mode: ${l}`),
            r.isLeaving)
                return Tm(s);
            const c = GE(s);
            if (!c)
                return Tm(s);
            const u = Nc(c, a, r, n);
            ll(c, u);
            const f = n.subTree
              , d = f && GE(f);
            let h = !1;
            const {getTransitionKey: p} = c.type;
            if (p) {
                const y = p();
                i === void 0 ? i = y : y !== i && (i = y,
                h = !0)
            }
            if (d && d.type !== en && (!Ai(c, d) || h)) {
                const y = Nc(d, a, r, n);
                if (ll(d, y),
                l === "out-in")
                    return r.isLeaving = !0,
                    y.afterLeave = () => {
                        r.isLeaving = !1,
                        n.update.active !== !1 && n.update()
                    }
                    ,
                    Tm(s);
                l === "in-out" && c.type !== en && (y.delayLeave = (v, g, m) => {
                    const _ = C4(r, d);
                    _[String(d.key)] = d,
                    v._leaveCb = () => {
                        g(),
                        v._leaveCb = void 0,
                        delete u.delayedLeave
                    }
                    ,
                    u.delayedLeave = m
                }
                )
            }
            return s
        }
    }
}
  , S4 = A7;
function C4(t, e) {
    const {leavingVNodes: n} = t;
    let r = n.get(e.type);
    return r || (r = Object.create(null),
    n.set(e.type, r)),
    r
}
function Nc(t, e, n, r) {
    const {appear: i, mode: o, persisted: s=!1, onBeforeEnter: a, onEnter: l, onAfterEnter: c, onEnterCancelled: u, onBeforeLeave: f, onLeave: d, onAfterLeave: h, onLeaveCancelled: p, onBeforeAppear: y, onAppear: v, onAfterAppear: g, onAppearCancelled: m} = e
      , _ = String(t.key)
      , x = C4(n, t)
      , b = (S, P) => {
        S && Hr(S, r, 9, P)
    }
      , w = (S, P) => {
        const C = P[1];
        b(S, P),
        He(S) ? S.every(A => A.length <= 1) && C() : S.length <= 1 && C()
    }
      , E = {
        mode: o,
        persisted: s,
        beforeEnter(S) {
            let P = a;
            if (!n.isMounted)
                if (i)
                    P = y || a;
                else
                    return;
            S._leaveCb && S._leaveCb(!0);
            const C = x[_];
            C && Ai(t, C) && C.el._leaveCb && C.el._leaveCb(),
            b(P, [S])
        },
        enter(S) {
            let P = l
              , C = c
              , A = u;
            if (!n.isMounted)
                if (i)
                    P = v || l,
                    C = g || c,
                    A = m || u;
                else
                    return;
            let T = !1;
            const I = S._enterCb = B => {
                T || (T = !0,
                B ? b(A, [S]) : b(C, [S]),
                E.delayedLeave && E.delayedLeave(),
                S._enterCb = void 0)
            }
            ;
            P ? w(P, [S, I]) : I()
        },
        leave(S, P) {
            const C = String(t.key);
            if (S._enterCb && S._enterCb(!0),
            n.isUnmounting)
                return P();
            b(f, [S]);
            let A = !1;
            const T = S._leaveCb = I => {
                A || (A = !0,
                P(),
                I ? b(p, [S]) : b(h, [S]),
                S._leaveCb = void 0,
                x[C] === t && delete x[C])
            }
            ;
            x[C] = t,
            d ? w(d, [S, T]) : T()
        },
        clone(S) {
            return Nc(S, e, n, r)
        }
    };
    return E
}
function Tm(t) {
    if (du(t))
        return t = vi(t),
        t.children = null,
        t
}
function GE(t) {
    return du(t) ? t.children ? t.children[0] : void 0 : t
}
function ll(t, e) {
    t.shapeFlag & 6 && t.component ? ll(t.component.subTree, e) : t.shapeFlag & 128 ? (t.ssContent.transition = e.clone(t.ssContent),
    t.ssFallback.transition = e.clone(t.ssFallback)) : t.transition = e
}
function ug(t, e=!1, n) {
    let r = []
      , i = 0;
    for (let o = 0; o < t.length; o++) {
        let s = t[o];
        const a = n == null ? s.key : String(n) + String(s.key != null ? s.key : o);
        s.type === Ft ? (s.patchFlag & 128 && i++,
        r = r.concat(ug(s.children, e, a))) : (e || s.type !== en) && r.push(a != null ? vi(s, {
            key: a
        }) : s)
    }
    if (i > 1)
        for (let o = 0; o < r.length; o++)
            r[o].patchFlag = -2;
    return r
}
function we(t, e) {
    return Ge(t) ? ( () => Xt({
        name: t.name
    }, e, {
        setup: t
    }))() : t
}
const Ja = t => !!t.type.__asyncLoader;
function T7(t) {
    Ge(t) && (t = {
        loader: t
    });
    const {loader: e, loadingComponent: n, errorComponent: r, delay: i=200, timeout: o, suspensible: s=!0, onError: a} = t;
    let l = null, c, u = 0;
    const f = () => (u++,
    l = null,
    d())
      , d = () => {
        let h;
        return l || (h = l = e().catch(p => {
            if (p = p instanceof Error ? p : new Error(String(p)),
            a)
                return new Promise( (y, v) => {
                    a(p, () => y(f()), () => v(p), u + 1)
                }
                );
            throw p
        }
        ).then(p => {
            if (h !== l && l)
                return l;
            if (p || se("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),
            p && (p.__esModule || p[Symbol.toStringTag] === "Module") && (p = p.default),
            p && !Tt(p) && !Ge(p))
                throw new Error(`Invalid async component load result: ${p}`);
            return c = p,
            p
        }
        ))
    }
    ;
    return we({
        name: "AsyncComponentWrapper",
        __asyncLoader: d,
        get __asyncResolved() {
            return c
        },
        setup() {
            const h = an;
            if (c)
                return () => Pm(c, h);
            const p = m => {
                l = null,
                Ol(m, h, 13, !r)
            }
            ;
            if (s && h.suspense || Fc)
                return d().then(m => () => Pm(m, h)).catch(m => (p(m),
                () => r ? R(r, {
                    error: m
                }) : null));
            const y = Z(!1)
              , v = Z()
              , g = Z(!!i);
            return i && setTimeout( () => {
                g.value = !1
            }
            , i),
            o != null && setTimeout( () => {
                if (!y.value && !v.value) {
                    const m = new Error(`Async component timed out after ${o}ms.`);
                    p(m),
                    v.value = m
                }
            }
            , o),
            d().then( () => {
                y.value = !0,
                h.parent && du(h.parent.vnode) && Nd(h.parent.update)
            }
            ).catch(m => {
                p(m),
                v.value = m
            }
            ),
            () => {
                if (y.value && c)
                    return Pm(c, h);
                if (v.value && r)
                    return R(r, {
                        error: v.value
                    });
                if (n && !g.value)
                    return R(n)
            }
        }
    })
}
function Pm(t, e) {
    const {ref: n, props: r, children: i, ce: o} = e.vnode
      , s = R(t, r, i);
    return s.ref = n,
    s.ce = o,
    delete e.vnode.ce,
    s
}
const du = t => t.type.__isKeepAlive
  , P7 = {
    name: "KeepAlive",
    __isKeepAlive: !0,
    props: {
        include: [String, RegExp, Array],
        exclude: [String, RegExp, Array],
        max: [String, Number]
    },
    setup(t, {slots: e}) {
        const n = yt()
          , r = n.ctx;
        if (!r.renderer)
            return () => {
                const m = e.default && e.default();
                return m && m.length === 1 ? m[0] : m
            }
            ;
        const i = new Map
          , o = new Set;
        let s = null;
        n.__v_cache = i;
        const a = n.suspense
          , {renderer: {p: l, m: c, um: u, o: {createElement: f}}} = r
          , d = f("div");
        r.activate = (m, _, x, b, w) => {
            const E = m.component;
            c(m, _, x, 0, a),
            l(E.vnode, m, _, x, E, a, b, m.slotScopeIds, w),
            Ln( () => {
                E.isDeactivated = !1,
                E.a && ka(E.a);
                const S = m.props && m.props.onVnodeMounted;
                S && _r(S, E.parent, m)
            }
            , a),
            py(E)
        }
        ,
        r.deactivate = m => {
            const _ = m.component;
            c(m, d, null, 1, a),
            Ln( () => {
                _.da && ka(_.da);
                const x = m.props && m.props.onVnodeUnmounted;
                x && _r(x, _.parent, m),
                _.isDeactivated = !0
            }
            , a),
            py(_)
        }
        ;
        function h(m) {
            Im(m),
            u(m, n, a, !0)
        }
        function p(m) {
            i.forEach( (_, x) => {
                const b = qf(_.type);
                b && (!m || !m(b)) && y(x)
            }
            )
        }
        function y(m) {
            const _ = i.get(m);
            !s || !Ai(_, s) ? h(_) : s && Im(s),
            i.delete(m),
            o.delete(m)
        }
        ve( () => [t.include, t.exclude], ([m,_]) => {
            m && p(x => ef(m, x)),
            _ && p(x => !ef(_, x))
        }
        , {
            flush: "post",
            deep: !0
        });
        let v = null;
        const g = () => {
            v != null && i.set(v, Om(n.subTree))
        }
        ;
        return Ht(g),
        Rl(g),
        qr( () => {
            i.forEach(m => {
                const {subTree: _, suspense: x} = n
                  , b = Om(_);
                if (m.type === b.type && m.key === b.key) {
                    Im(b);
                    const w = b.component.da;
                    w && Ln(w, x);
                    return
                }
                h(m)
            }
            )
        }
        ),
        () => {
            if (v = null,
            !e.default)
                return null;
            const m = e.default()
              , _ = m[0];
            if (m.length > 1)
                return se("KeepAlive should contain exactly one component child."),
                s = null,
                m;
            if (!ho(_) || !(_.shapeFlag & 4) && !(_.shapeFlag & 128))
                return s = null,
                _;
            let x = Om(_);
            const b = x.type
              , w = qf(Ja(x) ? x.type.__asyncResolved || {} : b)
              , {include: E, exclude: S, max: P} = t;
            if (E && (!w || !ef(E, w)) || S && w && ef(S, w))
                return s = x,
                _;
            const C = x.key == null ? b : x.key
              , A = i.get(C);
            return x.el && (x = vi(x),
            _.shapeFlag & 128 && (_.ssContent = x)),
            v = C,
            A ? (x.el = A.el,
            x.component = A.component,
            x.transition && ll(x, x.transition),
            x.shapeFlag |= 512,
            o.delete(C),
            o.add(C)) : (o.add(C),
            P && o.size > parseInt(P, 10) && y(o.values().next().value)),
            x.shapeFlag |= 256,
            s = x,
            _4(_.type) ? _ : x
        }
    }
}
  , I7 = P7;
function ef(t, e) {
    return He(t) ? t.some(n => ef(n, e)) : nn(t) ? t.split(",").includes(e) : PL(t) ? t.test(e) : !1
}
function cs(t, e) {
    A4(t, "a", e)
}
function bo(t, e) {
    A4(t, "da", e)
}
function A4(t, e, n=an) {
    const r = t.__wdc || (t.__wdc = () => {
        let i = n;
        for (; i; ) {
            if (i.isDeactivated)
                return;
            i = i.parent
        }
        return t()
    }
    );
    if (fg(e, r, n),
    n) {
        let i = n.parent;
        for (; i && i.parent; )
            du(i.parent.vnode) && O7(r, e, n, i),
            i = i.parent
    }
}
function O7(t, e, n, r) {
    const i = fg(e, t, r, !0);
    fs( () => {
        Jx(r[e], i)
    }
    , n)
}
function Im(t) {
    t.shapeFlag &= -257,
    t.shapeFlag &= -513
}
function Om(t) {
    return t.shapeFlag & 128 ? t.ssContent : t
}
function fg(t, e, n=an, r=!1) {
    if (n) {
        const i = n[t] || (n[t] = [])
          , o = e.__weh || (e.__weh = (...s) => {
            if (n.isUnmounted)
                return;
            Tl(),
            Qs(n);
            const a = Hr(e, n, t, s);
            return js(),
            Pl(),
            a
        }
        );
        return r ? i.unshift(o) : i.push(o),
        o
    } else {
        const i = Lo(eb[t].replace(/ hook$/, ""));
        se(`${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)
    }
}
const us = t => (e, n=an) => (!Fc || t === "sp") && fg(t, (...r) => e(...r), n)
  , T4 = us("bm")
  , Ht = us("m")
  , dg = us("bu")
  , Rl = us("u")
  , qr = us("bum")
  , fs = us("um")
  , P4 = us("sp")
  , I4 = us("rtg")
  , O4 = us("rtc");
function R4(t, e=an) {
    fg("ec", t, e)
}
const t0 = "components"
  , R7 = "directives";
function M7(t, e) {
    return fb(t0, t, !0, e) || t
}
const M4 = Symbol.for("v-ndc");
function D7(t) {
    return nn(t) ? fb(t0, t, !1) || t : t || M4
}
function D4(t) {
    return fb(R7, t)
}
function fb(t, e, n=!0, r=!1) {
    const i = ln || an;
    if (i) {
        const o = i.type;
        if (t === t0) {
            const a = qf(o, !1);
            if (a && (a === e || a === Fi(e) || a === kc(Fi(e))))
                return o
        }
        const s = HE(i[t] || o[t], e) || HE(i.appContext[t], e);
        if (!s && r)
            return o;
        if (n && !s) {
            const a = t === t0 ? `
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : "";
            se(`Failed to resolve ${t.slice(0, -1)}: ${e}${a}`)
        }
        return s
    } else
        se(`resolve${kc(t.slice(0, -1))} can only be used in render() or setup().`)
}
function HE(t, e) {
    return t && (t[e] || t[Fi(e)] || t[kc(Fi(e))])
}
function B7(t, e, n, r) {
    let i;
    const o = n && n[r];
    if (He(t) || nn(t)) {
        i = new Array(t.length);
        for (let s = 0, a = t.length; s < a; s++)
            i[s] = e(t[s], s, void 0, o && o[s])
    } else if (typeof t == "number") {
        Number.isInteger(t) || se(`The v-for range expect an integer value but got ${t}.`),
        i = new Array(t);
        for (let s = 0; s < t; s++)
            i[s] = e(s + 1, s, void 0, o && o[s])
    } else if (Tt(t))
        if (t[Symbol.iterator])
            i = Array.from(t, (s, a) => e(s, a, void 0, o && o[a]));
        else {
            const s = Object.keys(t);
            i = new Array(s.length);
            for (let a = 0, l = s.length; a < l; a++) {
                const c = s[a];
                i[a] = e(t[c], c, a, o && o[a])
            }
        }
    else
        i = [];
    return n && (n[r] = i),
    i
}
function k7(t, e) {
    for (let n = 0; n < e.length; n++) {
        const r = e[n];
        if (He(r))
            for (let i = 0; i < r.length; i++)
                t[r[i].name] = r[i].fn;
        else
            r && (t[r.name] = r.key ? (...i) => {
                const o = r.fn(...i);
                return o && (o.key = r.key),
                o
            }
            : r.fn)
    }
    return t
}
function N7(t, e, n={}, r, i) {
    if (ln.isCE || ln.parent && Ja(ln.parent) && ln.parent.isCE)
        return e !== "default" && (n.name = e),
        R("slot", n, r && r());
    let o = t[e];
    o && o.length > 1 && (se("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),
    o = () => []),
    o && o._c && (o._d = !1),
    pg();
    const s = o && B4(o(n))
      , a = gb(Ft, {
        key: n.key || s && s.key || `_${e}`
    }, s || (r ? r() : []), s && t._ === 1 ? 64 : -2);
    return !i && a.scopeId && (a.slotScopeIds = [a.scopeId + "-s"]),
    o && o._c && (o._d = !0),
    a
}
function B4(t) {
    return t.some(e => ho(e) ? !(e.type === en || e.type === Ft && !B4(e.children)) : !0) ? t : null
}
function F7(t, e) {
    const n = {};
    if (!Tt(t))
        return se("v-on with no argument expects an object value."),
        n;
    for (const r in t)
        n[e && /[A-Z]/.test(r) ? `on:${r}` : Lo(r)] = t[r];
    return n
}
const my = t => t ? tO(t) ? vg(t) || t.proxy : my(t.parent) : null
  , Qa = Xt(Object.create(null), {
    $: t => t,
    $el: t => t.vnode.el,
    $data: t => t.data,
    $props: t => gc(t.props),
    $attrs: t => gc(t.attrs),
    $slots: t => gc(t.slots),
    $refs: t => gc(t.refs),
    $parent: t => my(t.parent),
    $root: t => my(t.root),
    $emit: t => t.emit,
    $options: t => hb(t),
    $forceUpdate: t => t.f || (t.f = () => Nd(t.update)),
    $nextTick: t => t.n || (t.n = Xe.bind(t.proxy)),
    $watch: t => C7.bind(t)
})
  , db = t => t === "_" || t === "$"
  , Rm = (t, e) => t !== St && !t.__isScriptSetup && lt(t, e)
  , mf = {
    get({_: t}, e) {
        const {ctx: n, setupState: r, data: i, props: o, accessCache: s, type: a, appContext: l} = t;
        if (e === "__isVue")
            return !0;
        let c;
        if (e[0] !== "$") {
            const h = s[e];
            if (h !== void 0)
                switch (h) {
                case 1:
                    return r[e];
                case 2:
                    return i[e];
                case 4:
                    return n[e];
                case 3:
                    return o[e]
                }
            else {
                if (Rm(r, e))
                    return s[e] = 1,
                    r[e];
                if (i !== St && lt(i, e))
                    return s[e] = 2,
                    i[e];
                if ((c = t.propsOptions[0]) && lt(c, e))
                    return s[e] = 3,
                    o[e];
                if (n !== St && lt(n, e))
                    return s[e] = 4,
                    n[e];
                vy && (s[e] = 0)
            }
        }
        const u = Qa[e];
        let f, d;
        if (u)
            return e === "$attrs" ? (er(t, "get", e),
            e0()) : e === "$slots" && er(t, "get", e),
            u(t);
        if ((f = a.__cssModules) && (f = f[e]))
            return f;
        if (n !== St && lt(n, e))
            return s[e] = 4,
            n[e];
        if (d = l.config.globalProperties,
        lt(d, e))
            return d[e];
        ln && (!nn(e) || e.indexOf("__v") !== 0) && (i !== St && db(e[0]) && lt(i, e) ? se(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`) : t === ln && se(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))
    },
    set({_: t}, e, n) {
        const {data: r, setupState: i, ctx: o} = t;
        return Rm(i, e) ? (i[e] = n,
        !0) : i.__isScriptSetup && lt(i, e) ? (se(`Cannot mutate <script setup> binding "${e}" from Options API.`),
        !1) : r !== St && lt(r, e) ? (r[e] = n,
        !0) : lt(t.props, e) ? (se(`Attempting to mutate prop "${e}". Props are readonly.`),
        !1) : e[0] === "$" && e.slice(1)in t ? (se(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),
        !1) : (e in t.appContext.config.globalProperties ? Object.defineProperty(o, e, {
            enumerable: !0,
            configurable: !0,
            value: n
        }) : o[e] = n,
        !0)
    },
    has({_: {data: t, setupState: e, accessCache: n, ctx: r, appContext: i, propsOptions: o}}, s) {
        let a;
        return !!n[s] || t !== St && lt(t, s) || Rm(e, s) || (a = o[0]) && lt(a, s) || lt(r, s) || lt(Qa, s) || lt(i.config.globalProperties, s)
    },
    defineProperty(t, e, n) {
        return n.get != null ? t._.accessCache[e] = 0 : lt(n, "value") && this.set(t, e, n.value, null),
        Reflect.defineProperty(t, e, n)
    }
};
mf.ownKeys = t => (se("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),
Reflect.ownKeys(t));
const L7 = Xt({}, mf, {
    get(t, e) {
        if (e !== Symbol.unscopables)
            return mf.get(t, e, t)
    },
    has(t, e) {
        const n = e[0] !== "_" && !NL(e);
        return !n && mf.has(t, e) && se(`Property ${JSON.stringify(e)} should not start with _ which is a reserved prefix for Vue internals.`),
        n
    }
});
function $7(t) {
    const e = {};
    return Object.defineProperty(e, "_", {
        configurable: !0,
        enumerable: !1,
        get: () => t
    }),
    Object.keys(Qa).forEach(n => {
        Object.defineProperty(e, n, {
            configurable: !0,
            enumerable: !1,
            get: () => Qa[n](t),
            set: Cr
        })
    }
    ),
    e
}
function U7(t) {
    const {ctx: e, propsOptions: [n]} = t;
    n && Object.keys(n).forEach(r => {
        Object.defineProperty(e, r, {
            enumerable: !0,
            configurable: !0,
            get: () => t.props[r],
            set: Cr
        })
    }
    )
}
function G7(t) {
    const {ctx: e, setupState: n} = t;
    Object.keys(Le(n)).forEach(r => {
        if (!n.__isScriptSetup) {
            if (db(r[0])) {
                se(`setup() return property ${JSON.stringify(r)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);
                return
            }
            Object.defineProperty(e, r, {
                enumerable: !0,
                configurable: !0,
                get: () => n[r],
                set: Cr
            })
        }
    }
    )
}
const Ml = t => se(`${t}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`);
function H7() {
    return Ml("defineProps"),
    null
}
function V7() {
    return Ml("defineEmits"),
    null
}
function z7(t) {
    Ml("defineExpose")
}
function j7(t) {
    Ml("defineOptions")
}
function W7() {
    return Ml("defineSlots"),
    null
}
function Y7() {
    Ml("defineModel")
}
function X7(t, e) {
    return Ml("withDefaults"),
    null
}
function K7() {
    return k4().slots
}
function q7() {
    return k4().attrs
}
function Z7(t, e, n) {
    const r = yt();
    if (!r)
        return se("useModel() called without active instance."),
        Z();
    if (!r.propsOptions[0][e])
        return se(`useModel() called with prop "${e}" which is not declared.`),
        Z();
    if (n && n.local) {
        const i = Z(t[e]);
        return ve( () => t[e], o => i.value = o),
        ve(i, o => {
            o !== t[e] && r.emit(`update:${e}`, o)
        }
        ),
        i
    } else
        return {
            __v_isRef: !0,
            get value() {
                return t[e]
            },
            set value(i) {
                r.emit(`update:${e}`, i)
            }
        }
}
function k4() {
    const t = yt();
    return t || se("useContext() called without active instance."),
    t.setupContext || (t.setupContext = iO(t))
}
function Xf(t) {
    return He(t) ? t.reduce( (e, n) => (e[n] = null,
    e), {}) : t
}
function J7(t, e) {
    const n = Xf(t);
    for (const r in e) {
        if (r.startsWith("__skip"))
            continue;
        let i = n[r];
        i ? He(i) || Ge(i) ? i = n[r] = {
            type: i,
            default: e[r]
        } : i.default = e[r] : i === null ? i = n[r] = {
            default: e[r]
        } : se(`props default key "${r}" has no corresponding declaration.`),
        i && e[`__skip_${r}`] && (i.skipFactory = !0)
    }
    return n
}
function Q7(t, e) {
    return !t || !e ? t || e : He(t) && He(e) ? t.concat(e) : Xt({}, Xf(t), Xf(e))
}
function e$(t, e) {
    const n = {};
    for (const r in t)
        e.includes(r) || Object.defineProperty(n, r, {
            enumerable: !0,
            get: () => t[r]
        });
    return n
}
function t$(t) {
    const e = yt();
    e || se("withAsyncContext called without active current instance. This is likely a bug.");
    let n = t();
    return js(),
    og(n) && (n = n.catch(r => {
        throw Qs(e),
        r
    }
    )),
    [n, () => Qs(e)]
}
function n$() {
    const t = Object.create(null);
    return (e, n) => {
        t[n] ? se(`${e} property "${n}" is already defined in ${t[n]}.`) : t[n] = e
    }
}
let vy = !0;
function r$(t) {
    const e = hb(t)
      , n = t.proxy
      , r = t.ctx;
    vy = !1,
    e.beforeCreate && VE(e.beforeCreate, t, "bc");
    const {data: i, computed: o, methods: s, watch: a, provide: l, inject: c, created: u, beforeMount: f, mounted: d, beforeUpdate: h, updated: p, activated: y, deactivated: v, beforeDestroy: g, beforeUnmount: m, destroyed: _, unmounted: x, render: b, renderTracked: w, renderTriggered: E, errorCaptured: S, serverPrefetch: P, expose: C, inheritAttrs: A, components: T, directives: I, filters: B} = e
      , G = n$();
    {
        const [U] = t.propsOptions;
        if (U)
            for (const W in U)
                G("Props", W)
    }
    if (c && i$(c, r, G),
    s)
        for (const U in s) {
            const W = s[U];
            Ge(W) ? (Object.defineProperty(r, U, {
                value: W.bind(n),
                configurable: !0,
                enumerable: !0,
                writable: !0
            }),
            G("Methods", U)) : se(`Method "${U}" has type "${typeof W}" in the component definition. Did you reference the function correctly?`)
        }
    if (i) {
        Ge(i) || se("The data option must be a function. Plain object usage is no longer supported.");
        const U = i.call(n, n);
        if (og(U) && se("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),
        !Tt(U))
            se("data() should return an object.");
        else {
            t.data = Mt(U);
            for (const W in U)
                G("Data", W),
                db(W[0]) || Object.defineProperty(r, W, {
                    configurable: !0,
                    enumerable: !0,
                    get: () => U[W],
                    set: Cr
                })
        }
    }
    if (vy = !0,
    o)
        for (const U in o) {
            const W = o[U]
              , K = Ge(W) ? W.bind(n, n) : Ge(W.get) ? W.get.bind(n, n) : Cr;
            K === Cr && se(`Computed property "${U}" has no getter.`);
            const fe = !Ge(W) && Ge(W.set) ? W.set.bind(n) : () => {
                se(`Write operation failed: computed property "${U}" is readonly.`)
            }
              , ue = re({
                get: K,
                set: fe
            });
            Object.defineProperty(r, U, {
                enumerable: !0,
                configurable: !0,
                get: () => ue.value,
                set: X => ue.value = X
            }),
            G("Computed", U)
        }
    if (a)
        for (const U in a)
            N4(a[U], r, n, U);
    if (l) {
        const U = Ge(l) ? l.call(n) : l;
        Reflect.ownKeys(U).forEach(W => {
            hi(W, U[W])
        }
        )
    }
    u && VE(u, t, "c");
    function N(U, W) {
        He(W) ? W.forEach(K => U(K.bind(n))) : W && U(W.bind(n))
    }
    if (N(T4, f),
    N(Ht, d),
    N(dg, h),
    N(Rl, p),
    N(cs, y),
    N(bo, v),
    N(R4, S),
    N(O4, w),
    N(I4, E),
    N(qr, m),
    N(fs, x),
    N(P4, P),
    He(C))
        if (C.length) {
            const U = t.exposed || (t.exposed = {});
            C.forEach(W => {
                Object.defineProperty(U, W, {
                    get: () => n[W],
                    set: K => n[W] = K
                })
            }
            )
        } else
            t.exposed || (t.exposed = {});
    b && t.render === Cr && (t.render = b),
    A != null && (t.inheritAttrs = A),
    T && (t.components = T),
    I && (t.directives = I)
}
function i$(t, e, n=Cr) {
    He(t) && (t = yy(t));
    for (const r in t) {
        const i = t[r];
        let o;
        Tt(i) ? "default"in i ? o = dn(i.from || r, i.default, !0) : o = dn(i.from || r) : o = dn(i),
        pt(o) ? Object.defineProperty(e, r, {
            enumerable: !0,
            configurable: !0,
            get: () => o.value,
            set: s => o.value = s
        }) : e[r] = o,
        n("Inject", r)
    }
}
function VE(t, e, n) {
    Hr(He(t) ? t.map(r => r.bind(e.proxy)) : t.bind(e.proxy), e, n)
}
function N4(t, e, n, r) {
    const i = r.includes(".") ? w4(n, r) : () => n[r];
    if (nn(t)) {
        const o = e[t];
        Ge(o) ? ve(i, o) : se(`Invalid watch handler specified by key "${t}"`, o)
    } else if (Ge(t))
        ve(i, t.bind(n));
    else if (Tt(t))
        if (He(t))
            t.forEach(o => N4(o, e, n, r));
        else {
            const o = Ge(t.handler) ? t.handler.bind(n) : e[t.handler];
            Ge(o) ? ve(i, o, t) : se(`Invalid watch handler specified by key "${t.handler}"`, o)
        }
    else
        se(`Invalid watch option: "${r}"`, t)
}
function hb(t) {
    const e = t.type
      , {mixins: n, extends: r} = e
      , {mixins: i, optionsCache: o, config: {optionMergeStrategies: s}} = t.appContext
      , a = o.get(e);
    let l;
    return a ? l = a : !i.length && !n && !r ? l = e : (l = {},
    i.length && i.forEach(c => n0(l, c, s, !0)),
    n0(l, e, s)),
    Tt(e) && o.set(e, l),
    l
}
function n0(t, e, n, r=!1) {
    const {mixins: i, extends: o} = e;
    o && n0(t, o, n, !0),
    i && i.forEach(s => n0(t, s, n, !0));
    for (const s in e)
        if (r && s === "expose")
            se('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');
        else {
            const a = o$[s] || n && n[s];
            t[s] = a ? a(t[s], e[s]) : e[s]
        }
    return t
}
const o$ = {
    data: zE,
    props: jE,
    emits: jE,
    methods: tf,
    computed: tf,
    beforeCreate: or,
    created: or,
    beforeMount: or,
    mounted: or,
    beforeUpdate: or,
    updated: or,
    beforeDestroy: or,
    beforeUnmount: or,
    destroyed: or,
    unmounted: or,
    activated: or,
    deactivated: or,
    errorCaptured: or,
    serverPrefetch: or,
    components: tf,
    directives: tf,
    watch: a$,
    provide: zE,
    inject: s$
};
function zE(t, e) {
    return e ? t ? function() {
        return Xt(Ge(t) ? t.call(this, this) : t, Ge(e) ? e.call(this, this) : e)
    }
    : e : t
}
function s$(t, e) {
    return tf(yy(t), yy(e))
}
function yy(t) {
    if (He(t)) {
        const e = {};
        for (let n = 0; n < t.length; n++)
            e[t[n]] = t[n];
        return e
    }
    return t
}
function or(t, e) {
    return t ? [...new Set([].concat(t, e))] : e
}
function tf(t, e) {
    return t ? Xt(Object.create(null), t, e) : e
}
function jE(t, e) {
    return t ? He(t) && He(e) ? [...new Set([...t, ...e])] : Xt(Object.create(null), Xf(t), Xf(e ?? {})) : e
}
function a$(t, e) {
    if (!t)
        return e;
    if (!e)
        return t;
    const n = Xt(Object.create(null), t);
    for (const r in e)
        n[r] = or(t[r], e[r]);
    return n
}
function F4() {
    return {
        app: null,
        config: {
            isNativeTag: o4,
            performance: !1,
            globalProperties: {},
            optionMergeStrategies: {},
            errorHandler: void 0,
            warnHandler: void 0,
            compilerOptions: {}
        },
        mixins: [],
        components: {},
        directives: {},
        provides: Object.create(null),
        optionsCache: new WeakMap,
        propsCache: new WeakMap,
        emitsCache: new WeakMap
    }
}
let l$ = 0;
function c$(t, e) {
    return function(r, i=null) {
        Ge(r) || (r = Xt({}, r)),
        i != null && !Tt(i) && (se("root props passed to app.mount() must be an object."),
        i = null);
        const o = F4();
        Object.defineProperty(o.config, "unwrapInjectedRef", {
            get() {
                return !0
            },
            set() {
                se("app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.")
            }
        });
        const s = new Set;
        let a = !1;
        const l = o.app = {
            _uid: l$++,
            _component: r,
            _props: i,
            _container: null,
            _context: o,
            _instance: null,
            version: Ty,
            get config() {
                return o.config
            },
            set config(c) {
                se("app.config cannot be replaced. Modify individual options instead.")
            },
            use(c, ...u) {
                return s.has(c) ? se("Plugin has already been applied to target app.") : c && Ge(c.install) ? (s.add(c),
                c.install(l, ...u)) : Ge(c) ? (s.add(c),
                c(l, ...u)) : se('A plugin must either be a function or an object with an "install" function.'),
                l
            },
            mixin(c) {
                return o.mixins.includes(c) ? se("Mixin has already been applied to target app" + (c.name ? `: ${c.name}` : "")) : o.mixins.push(c),
                l
            },
            component(c, u) {
                return Sy(c, o.config),
                u ? (o.components[c] && se(`Component "${c}" has already been registered in target app.`),
                o.components[c] = u,
                l) : o.components[c]
            },
            directive(c, u) {
                return E4(c),
                u ? (o.directives[c] && se(`Directive "${c}" has already been registered in target app.`),
                o.directives[c] = u,
                l) : o.directives[c]
            },
            mount(c, u, f) {
                if (a)
                    se("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");
                else {
                    c.__vue_app__ && se("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");
                    const d = R(r, i);
                    return d.appContext = o,
                    o.reload = () => {
                        t(vi(d), c, f)
                    }
                    ,
                    u && e ? e(d, c) : t(d, c, f),
                    a = !0,
                    l._container = c,
                    c.__vue_app__ = l,
                    l._instance = d.component,
                    n7(l, Ty),
                    vg(d.component) || d.component.proxy
                }
            },
            unmount() {
                a ? (t(null, l._container),
                l._instance = null,
                r7(l),
                delete l._container.__vue_app__) : se("Cannot unmount an app that is not mounted.")
            },
            provide(c, u) {
                return c in o.provides && se(`App already provides property with key "${String(c)}". It will be overwritten with the new value.`),
                o.provides[c] = u,
                l
            },
            runWithContext(c) {
                Kf = l;
                try {
                    return c()
                } finally {
                    Kf = null
                }
            }
        };
        return l
    }
}
let Kf = null;
function hi(t, e) {
    if (!an)
        se("provide() can only be used inside setup().");
    else {
        let n = an.provides;
        const r = an.parent && an.parent.provides;
        r === n && (n = an.provides = Object.create(r)),
        n[t] = e
    }
}
function dn(t, e, n=!1) {
    const r = an || ln;
    if (r || Kf) {
        const i = r ? r.parent == null ? r.vnode.appContext && r.vnode.appContext.provides : r.parent.provides : Kf._context.provides;
        if (i && t in i)
            return i[t];
        if (arguments.length > 1)
            return n && Ge(e) ? e.call(r && r.proxy) : e;
        se(`injection "${String(t)}" not found.`)
    } else
        se("inject() can only be used inside setup() or functional components.")
}
function L4() {
    return !!(an || ln || Kf)
}
function u$(t, e, n, r=!1) {
    const i = {}
      , o = {};
    fy(o, gg, 1),
    t.propsDefaults = Object.create(null),
    $4(t, e, i, o);
    for (const s in t.propsOptions[0])
        s in i || (i[s] = void 0);
    G4(e || {}, i, t),
    n ? t.props = r ? i : t4(i) : t.type.props ? t.props = i : t.props = o,
    t.attrs = o
}
function f$(t) {
    for (; t; ) {
        if (t.type.__hmrId)
            return !0;
        t = t.parent
    }
}
function d$(t, e, n, r) {
    const {props: i, attrs: o, vnode: {patchFlag: s}} = t
      , a = Le(i)
      , [l] = t.propsOptions;
    let c = !1;
    if (!f$(t) && (r || s > 0) && !(s & 16)) {
        if (s & 8) {
            const u = t.vnode.dynamicProps;
            for (let f = 0; f < u.length; f++) {
                let d = u[f];
                if (lg(t.emitsOptions, d))
                    continue;
                const h = e[d];
                if (l)
                    if (lt(o, d))
                        h !== o[d] && (o[d] = h,
                        c = !0);
                    else {
                        const p = Fi(d);
                        i[p] = _y(l, a, p, h, t, !1)
                    }
                else
                    h !== o[d] && (o[d] = h,
                    c = !0)
            }
        }
    } else {
        $4(t, e, i, o) && (c = !0);
        let u;
        for (const f in a)
            (!e || !lt(e, f) && ((u = Bc(f)) === f || !lt(e, u))) && (l ? n && (n[f] !== void 0 || n[u] !== void 0) && (i[f] = _y(l, a, f, void 0, t, !0)) : delete i[f]);
        if (o !== a)
            for (const f in o)
                (!e || !lt(e, f)) && (delete o[f],
                c = !0)
    }
    c && uo(t, "set", "$attrs"),
    G4(e || {}, i, t)
}
function $4(t, e, n, r) {
    const [i,o] = t.propsOptions;
    let s = !1, a;
    if (e)
        for (let l in e) {
            if (df(l))
                continue;
            const c = e[l];
            let u;
            i && lt(i, u = Fi(l)) ? !o || !o.includes(u) ? n[u] = c : (a || (a = {}))[u] = c : lg(t.emitsOptions, l) || (!(l in r) || c !== r[l]) && (r[l] = c,
            s = !0)
        }
    if (o) {
        const l = Le(n)
          , c = a || St;
        for (let u = 0; u < o.length; u++) {
            const f = o[u];
            n[f] = _y(i, l, f, c[f], t, !lt(c, f))
        }
    }
    return s
}
function _y(t, e, n, r, i, o) {
    const s = t[n];
    if (s != null) {
        const a = lt(s, "default");
        if (a && r === void 0) {
            const l = s.default;
            if (s.type !== Function && !s.skipFactory && Ge(l)) {
                const {propsDefaults: c} = i;
                n in c ? r = c[n] : (Qs(i),
                r = c[n] = l.call(null, e),
                js())
            } else
                r = l
        }
        s[0] && (o && !a ? r = !1 : s[1] && (r === "" || r === Bc(n)) && (r = !0))
    }
    return r
}
function U4(t, e, n=!1) {
    const r = e.propsCache
      , i = r.get(t);
    if (i)
        return i;
    const o = t.props
      , s = {}
      , a = [];
    let l = !1;
    if (!Ge(t)) {
        const u = f => {
            l = !0;
            const [d,h] = U4(f, e, !0);
            Xt(s, d),
            h && a.push(...h)
        }
        ;
        !n && e.mixins.length && e.mixins.forEach(u),
        t.extends && u(t.extends),
        t.mixins && t.mixins.forEach(u)
    }
    if (!o && !l)
        return Tt(t) && r.set(t, Sc),
        Sc;
    if (He(o))
        for (let u = 0; u < o.length; u++) {
            nn(o[u]) || se("props must be strings when using array syntax.", o[u]);
            const f = Fi(o[u]);
            WE(f) && (s[f] = St)
        }
    else if (o) {
        Tt(o) || se("invalid props options", o);
        for (const u in o) {
            const f = Fi(u);
            if (WE(f)) {
                const d = o[u]
                  , h = s[f] = He(d) || Ge(d) ? {
                    type: d
                } : Xt({}, d);
                if (h) {
                    const p = XE(Boolean, h.type)
                      , y = XE(String, h.type);
                    h[0] = p > -1,
                    h[1] = y < 0 || p < y,
                    (p > -1 || lt(h, "default")) && a.push(f)
                }
            }
        }
    }
    const c = [s, a];
    return Tt(t) && r.set(t, c),
    c
}
function WE(t) {
    return t[0] !== "$" ? !0 : (se(`Invalid prop name: "${t}" is a reserved property.`),
    !1)
}
function xy(t) {
    const e = t && t.toString().match(/^\s*(function|class) (\w+)/);
    return e ? e[2] : t === null ? "null" : ""
}
function YE(t, e) {
    return xy(t) === xy(e)
}
function XE(t, e) {
    return He(e) ? e.findIndex(n => YE(n, t)) : Ge(e) && YE(e, t) ? 0 : -1
}
function G4(t, e, n) {
    const r = Le(e)
      , i = n.propsOptions[0];
    for (const o in i) {
        let s = i[o];
        s != null && h$(o, r[o], s, !lt(t, o) && !lt(t, Bc(o)))
    }
}
function h$(t, e, n, r) {
    const {type: i, required: o, validator: s, skipCheck: a} = n;
    if (o && r) {
        se('Missing required prop: "' + t + '"');
        return
    }
    if (!(e == null && !o)) {
        if (i != null && i !== !0 && !a) {
            let l = !1;
            const c = He(i) ? i : [i]
              , u = [];
            for (let f = 0; f < c.length && !l; f++) {
                const {valid: d, expectedType: h} = g$(e, c[f]);
                u.push(h || ""),
                l = d
            }
            if (!l) {
                se(m$(t, e, u));
                return
            }
        }
        s && !s(e) && se('Invalid prop: custom validator check failed for prop "' + t + '".')
    }
}
const p$ = Rd("String,Number,Boolean,Function,Symbol,BigInt");
function g$(t, e) {
    let n;
    const r = xy(e);
    if (p$(r)) {
        const i = typeof t;
        n = i === r.toLowerCase(),
        !n && i === "object" && (n = t instanceof e)
    } else
        r === "Object" ? n = Tt(t) : r === "Array" ? n = He(t) : r === "null" ? n = t === null : n = t instanceof e;
    return {
        valid: n,
        expectedType: r
    }
}
function m$(t, e, n) {
    let r = `Invalid prop: type check failed for prop "${t}". Expected ${n.map(kc).join(" | ")}`;
    const i = n[0]
      , o = IL(e)
      , s = KE(e, i)
      , a = KE(e, o);
    return n.length === 1 && qE(i) && !v$(i, o) && (r += ` with value ${s}`),
    r += `, got ${o} `,
    qE(o) && (r += `with value ${a}.`),
    r
}
function KE(t, e) {
    return e === "String" ? `"${t}"` : e === "Number" ? `${Number(t)}` : `${t}`
}
function qE(t) {
    return ["string", "number", "boolean"].some(n => t.toLowerCase() === n)
}
function v$(...t) {
    return t.some(e => e.toLowerCase() === "boolean")
}
const H4 = t => t[0] === "_" || t === "$stable"
  , pb = t => He(t) ? t.map(wr) : [wr(t)]
  , y$ = (t, e, n) => {
    if (e._n)
        return e;
    const r = ob( (...i) => (an && se(`Slot "${t}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),
    pb(e(...i))), n);
    return r._c = !1,
    r
}
  , V4 = (t, e, n) => {
    const r = t._ctx;
    for (const i in t) {
        if (H4(i))
            continue;
        const o = t[i];
        if (Ge(o))
            e[i] = y$(i, o, r);
        else if (o != null) {
            se(`Non-function value encountered for slot "${i}". Prefer function slots for better performance.`);
            const s = pb(o);
            e[i] = () => s
        }
    }
}
  , z4 = (t, e) => {
    du(t.vnode) || se("Non-function value encountered for default slot. Prefer function slots for better performance.");
    const n = pb(e);
    t.slots.default = () => n
}
  , _$ = (t, e) => {
    if (t.vnode.shapeFlag & 32) {
        const n = e._;
        n ? (t.slots = Le(e),
        fy(e, "_", n)) : V4(e, t.slots = {})
    } else
        t.slots = {},
        e && z4(t, e);
    fy(t.slots, gg, 1)
}
  , x$ = (t, e, n) => {
    const {vnode: r, slots: i} = t;
    let o = !0
      , s = St;
    if (r.shapeFlag & 32) {
        const a = e._;
        a ? Vs ? (Xt(i, e),
        uo(t, "set", "$slots")) : n && a === 1 ? o = !1 : (Xt(i, e),
        !n && a === 1 && delete i._) : (o = !e.$stable,
        V4(e, i)),
        s = e
    } else
        e && (z4(t, e),
        s = {
            default: 1
        });
    if (o)
        for (const a in i)
            !H4(a) && !(a in s) && delete i[a]
}
;
function r0(t, e, n, r, i=!1) {
    if (He(t)) {
        t.forEach( (d, h) => r0(d, e && (He(e) ? e[h] : e), n, r, i));
        return
    }
    if (Ja(r) && !i)
        return;
    const o = r.shapeFlag & 4 ? vg(r.component) || r.component.proxy : r.el
      , s = i ? null : o
      , {i: a, r: l} = t;
    if (!a) {
        se("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");
        return
    }
    const c = e && e.r
      , u = a.refs === St ? a.refs = {} : a.refs
      , f = a.setupState;
    if (c != null && c !== l && (nn(c) ? (u[c] = null,
    lt(f, c) && (f[c] = null)) : pt(c) && (c.value = null)),
    Ge(l))
        so(l, a, 12, [s, u]);
    else {
        const d = nn(l)
          , h = pt(l);
        if (d || h) {
            const p = () => {
                if (t.f) {
                    const y = d ? lt(f, l) ? f[l] : u[l] : l.value;
                    i ? He(y) && Jx(y, o) : He(y) ? y.includes(o) || y.push(o) : d ? (u[l] = [o],
                    lt(f, l) && (f[l] = u[l])) : (l.value = [o],
                    t.k && (u[t.k] = l.value))
                } else
                    d ? (u[l] = s,
                    lt(f, l) && (f[l] = s)) : h ? (l.value = s,
                    t.k && (u[t.k] = s)) : se("Invalid template ref type:", l, `(${typeof l})`)
            }
            ;
            s ? (p.id = -1,
            Ln(p, n)) : p()
        } else
            se("Invalid template ref type:", l, `(${typeof l})`)
    }
}
let gs = !1;
const Eh = t => /svg/.test(t.namespaceURI) && t.tagName !== "foreignObject"
  , Au = t => t.nodeType === 8;
function b$(t) {
    const {mt: e, p: n, o: {patchProp: r, createText: i, nextSibling: o, parentNode: s, remove: a, insert: l, createComment: c}} = t
      , u = (g, m) => {
        if (!m.hasChildNodes()) {
            se("Attempting to hydrate existing markup but container is empty. Performing full mount instead."),
            n(null, g, m),
            Qp(),
            m._vnode = g;
            return
        }
        gs = !1,
        f(m.firstChild, g, null, null, null),
        Qp(),
        m._vnode = g,
        gs && console.error("Hydration completed but contains mismatches.")
    }
      , f = (g, m, _, x, b, w=!1) => {
        const E = Au(g) && g.data === "["
          , S = () => y(g, m, _, x, b, E)
          , {type: P, ref: C, shapeFlag: A, patchFlag: T} = m;
        let I = g.nodeType;
        m.el = g,
        T === -2 && (w = !1,
        m.dynamicChildren = null);
        let B = null;
        switch (P) {
        case fo:
            I !== 3 ? m.children === "" ? (l(m.el = i(""), s(g), g),
            B = g) : B = S() : (g.data !== m.children && (gs = !0,
            se(`Hydration text mismatch:
- Client: ${JSON.stringify(g.data)}
- Server: ${JSON.stringify(m.children)}`),
            g.data = m.children),
            B = o(g));
            break;
        case en:
            I !== 8 || E ? B = S() : B = o(g);
            break;
        case zs:
            if (E && (g = o(g),
            I = g.nodeType),
            I === 1 || I === 3) {
                B = g;
                const G = !m.children.length;
                for (let N = 0; N < m.staticCount; N++)
                    G && (m.children += B.nodeType === 1 ? B.outerHTML : B.data),
                    N === m.staticCount - 1 && (m.anchor = B),
                    B = o(B);
                return E ? o(B) : B
            } else
                S();
            break;
        case Ft:
            E ? B = p(g, m, _, x, b, w) : B = S();
            break;
        default:
            if (A & 1)
                I !== 1 || m.type.toLowerCase() !== g.tagName.toLowerCase() ? B = S() : B = d(g, m, _, x, b, w);
            else if (A & 6) {
                m.slotScopeIds = b;
                const G = s(g);
                if (e(m, G, null, _, x, Eh(G), w),
                B = E ? v(g) : o(g),
                B && Au(B) && B.data === "teleport end" && (B = o(B)),
                Ja(m)) {
                    let N;
                    E ? (N = R(Ft),
                    N.anchor = B ? B.previousSibling : G.lastChild) : N = g.nodeType === 3 ? mg("") : R("div"),
                    N.el = g,
                    m.component.subTree = N
                }
            } else
                A & 64 ? I !== 8 ? B = S() : B = m.type.hydrate(g, m, _, x, b, w, t, h) : A & 128 ? B = m.type.hydrate(g, m, _, x, Eh(s(g)), b, w, t, f) : se("Invalid HostVNode type:", P, `(${typeof P})`)
        }
        return C != null && r0(C, null, x, m),
        B
    }
      , d = (g, m, _, x, b, w) => {
        w = w || !!m.dynamicChildren;
        const {type: E, props: S, patchFlag: P, shapeFlag: C, dirs: A} = m
          , T = E === "input" && A || E === "option";
        {
            if (A && Ji(m, null, _, "created"),
            S)
                if (T || !w || P & 48)
                    for (const B in S)
                        (T && B.endsWith("value") || Md(B) && !df(B)) && r(g, B, null, S[B], !1, void 0, _);
                else
                    S.onClick && r(g, "onClick", null, S.onClick, !1, void 0, _);
            let I;
            if ((I = S && S.onVnodeBeforeMount) && _r(I, _, m),
            A && Ji(m, null, _, "beforeMount"),
            ((I = S && S.onVnodeMounted) || A) && x4( () => {
                I && _r(I, _, m),
                A && Ji(m, null, _, "mounted")
            }
            , x),
            C & 16 && !(S && (S.innerHTML || S.textContent))) {
                let B = h(g.firstChild, m, g, _, x, b, w)
                  , G = !1;
                for (; B; ) {
                    gs = !0,
                    G || (se(`Hydration children mismatch in <${m.type}>: server rendered element contains more child nodes than client vdom.`),
                    G = !0);
                    const N = B;
                    B = B.nextSibling,
                    a(N)
                }
            } else
                C & 8 && g.textContent !== m.children && (gs = !0,
                se(`Hydration text content mismatch in <${m.type}>:
- Client: ${g.textContent}
- Server: ${m.children}`),
                g.textContent = m.children)
        }
        return g.nextSibling
    }
      , h = (g, m, _, x, b, w, E) => {
        E = E || !!m.dynamicChildren;
        const S = m.children
          , P = S.length;
        let C = !1;
        for (let A = 0; A < P; A++) {
            const T = E ? S[A] : S[A] = wr(S[A]);
            if (g)
                g = f(g, T, x, b, w, E);
            else {
                if (T.type === fo && !T.children)
                    continue;
                gs = !0,
                C || (se(`Hydration children mismatch in <${_.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`),
                C = !0),
                n(null, T, _, null, x, b, Eh(_), w)
            }
        }
        return g
    }
      , p = (g, m, _, x, b, w) => {
        const {slotScopeIds: E} = m;
        E && (b = b ? b.concat(E) : E);
        const S = s(g)
          , P = h(o(g), m, S, _, x, b, w);
        return P && Au(P) && P.data === "]" ? o(m.anchor = P) : (gs = !0,
        l(m.anchor = c("]"), S, P),
        P)
    }
      , y = (g, m, _, x, b, w) => {
        if (gs = !0,
        se(`Hydration node mismatch:
- Client vnode:`, m.type, `
- Server rendered DOM:`, g, g.nodeType === 3 ? "(text)" : Au(g) && g.data === "[" ? "(start of fragment)" : ""),
        m.el = null,
        w) {
            const P = v(g);
            for (; ; ) {
                const C = o(g);
                if (C && C !== P)
                    a(C);
                else
                    break
            }
        }
        const E = o(g)
          , S = s(g);
        return a(g),
        n(null, m, S, E, _, x, Eh(S), b),
        E
    }
      , v = g => {
        let m = 0;
        for (; g; )
            if (g = o(g),
            g && Au(g) && (g.data === "[" && m++,
            g.data === "]")) {
                if (m === 0)
                    return o(g);
                m--
            }
        return g
    }
    ;
    return [u, f]
}
let Tu, Os;
function Mo(t, e) {
    t.appContext.config.performance && i0() && Os.mark(`vue-${e}-${t.uid}`),
    s7(t, e, i0() ? Os.now() : Date.now())
}
function Do(t, e) {
    if (t.appContext.config.performance && i0()) {
        const n = `vue-${e}-${t.uid}`
          , r = n + ":end";
        Os.mark(r),
        Os.measure(`<${yg(t, t.type)}> ${e}`, n, r),
        Os.clearMarks(n),
        Os.clearMarks(r)
    }
    a7(t, e, i0() ? Os.now() : Date.now())
}
function i0() {
    return Tu !== void 0 || (typeof window < "u" && window.performance ? (Tu = !0,
    Os = window.performance) : Tu = !1),
    Tu
}
function w$() {
    const t = [];
    if (t.length) {
        const e = t.length > 1;
        console.warn(`Feature flag${e ? "s" : ""} ${t.join(", ")} ${e ? "are" : "is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.

For more details, see https://link.vuejs.org/feature-flags.`)
    }
}
const Ln = x4;
function j4(t) {
    return Y4(t)
}
function W4(t) {
    return Y4(t, b$)
}
function Y4(t, e) {
    w$();
    const n = Jp();
    n.__VUE__ = !0,
    rb(n.__VUE_DEVTOOLS_GLOBAL_HOOK__, n);
    const {insert: r, remove: i, patchProp: o, createElement: s, createText: a, createComment: l, setText: c, setElementText: u, parentNode: f, nextSibling: d, setScopeId: h=Cr, insertStaticContent: p} = t
      , y = (O, $, j, ae=null, ce=null, M=null, k=!1, H=null, Q=Vs ? !1 : !!$.dynamicChildren) => {
        if (O === $)
            return;
        O && !Ai(O, $) && (ae = ee(O),
        ie(O, ce, M, !0),
        O = null),
        $.patchFlag === -2 && (Q = !1,
        $.dynamicChildren = null);
        const {type: le, ref: ye, shapeFlag: he} = $;
        switch (le) {
        case fo:
            v(O, $, j, ae);
            break;
        case en:
            g(O, $, j, ae);
            break;
        case zs:
            O == null ? m($, j, ae, k) : _(O, $, j, k);
            break;
        case Ft:
            I(O, $, j, ae, ce, M, k, H, Q);
            break;
        default:
            he & 1 ? w(O, $, j, ae, ce, M, k, H, Q) : he & 6 ? B(O, $, j, ae, ce, M, k, H, Q) : he & 64 || he & 128 ? le.process(O, $, j, ae, ce, M, k, H, Q, de) : se("Invalid VNode type:", le, `(${typeof le})`)
        }
        ye != null && ce && r0(ye, O && O.ref, M, $ || O, !$)
    }
      , v = (O, $, j, ae) => {
        if (O == null)
            r($.el = a($.children), j, ae);
        else {
            const ce = $.el = O.el;
            $.children !== O.children && c(ce, $.children)
        }
    }
      , g = (O, $, j, ae) => {
        O == null ? r($.el = l($.children || ""), j, ae) : $.el = O.el
    }
      , m = (O, $, j, ae) => {
        [O.el,O.anchor] = p(O.children, $, j, ae, O.el, O.anchor)
    }
      , _ = (O, $, j, ae) => {
        if ($.children !== O.children) {
            const ce = d(O.anchor);
            b(O),
            [$.el,$.anchor] = p($.children, j, ce, ae)
        } else
            $.el = O.el,
            $.anchor = O.anchor
    }
      , x = ({el: O, anchor: $}, j, ae) => {
        let ce;
        for (; O && O !== $; )
            ce = d(O),
            r(O, j, ae),
            O = ce;
        r($, j, ae)
    }
      , b = ({el: O, anchor: $}) => {
        let j;
        for (; O && O !== $; )
            j = d(O),
            i(O),
            O = j;
        i($)
    }
      , w = (O, $, j, ae, ce, M, k, H, Q) => {
        k = k || $.type === "svg",
        O == null ? E($, j, ae, ce, M, k, H, Q) : C(O, $, ce, M, k, H, Q)
    }
      , E = (O, $, j, ae, ce, M, k, H) => {
        let Q, le;
        const {type: ye, props: he, shapeFlag: z, transition: ne, dirs: Ce} = O;
        if (Q = O.el = s(O.type, M, he && he.is, he),
        z & 8 ? u(Q, O.children) : z & 16 && P(O.children, Q, null, ae, ce, M && ye !== "foreignObject", k, H),
        Ce && Ji(O, null, ae, "created"),
        S(Q, O, O.scopeId, k, ae),
        he) {
            for (const et in he)
                et !== "value" && !df(et) && o(Q, et, null, he[et], M, O.children, ae, ce, L);
            "value"in he && o(Q, "value", null, he.value),
            (le = he.onVnodeBeforeMount) && _r(le, ae, O)
        }
        Object.defineProperty(Q, "__vnode", {
            value: O,
            enumerable: !1
        }),
        Object.defineProperty(Q, "__vueParentComponent", {
            value: ae,
            enumerable: !1
        }),
        Ce && Ji(O, null, ae, "beforeMount");
        const Ue = (!ce || ce && !ce.pendingBranch) && ne && !ne.persisted;
        Ue && ne.beforeEnter(Q),
        r(Q, $, j),
        ((le = he && he.onVnodeMounted) || Ue || Ce) && Ln( () => {
            le && _r(le, ae, O),
            Ue && ne.enter(Q),
            Ce && Ji(O, null, ae, "mounted")
        }
        , ce)
    }
      , S = (O, $, j, ae, ce) => {
        if (j && h(O, j),
        ae)
            for (let M = 0; M < ae.length; M++)
                h(O, ae[M]);
        if (ce) {
            let M = ce.subTree;
            if (M.patchFlag > 0 && M.patchFlag & 2048 && (M = sb(M.children) || M),
            $ === M) {
                const k = ce.vnode;
                S(O, k, k.scopeId, k.slotScopeIds, ce.parent)
            }
        }
    }
      , P = (O, $, j, ae, ce, M, k, H, Q=0) => {
        for (let le = Q; le < O.length; le++) {
            const ye = O[le] = H ? Ts(O[le]) : wr(O[le]);
            y(null, ye, $, j, ae, ce, M, k, H)
        }
    }
      , C = (O, $, j, ae, ce, M, k) => {
        const H = $.el = O.el;
        let {patchFlag: Q, dynamicChildren: le, dirs: ye} = $;
        Q |= O.patchFlag & 16;
        const he = O.props || St
          , z = $.props || St;
        let ne;
        j && ya(j, !1),
        (ne = z.onVnodeBeforeUpdate) && _r(ne, j, $, O),
        ye && Ji($, O, j, "beforeUpdate"),
        j && ya(j, !0),
        Vs && (Q = 0,
        k = !1,
        le = null);
        const Ce = ce && $.type !== "foreignObject";
        if (le ? (A(O.dynamicChildren, le, H, j, ae, Ce, M),
        o0(O, $)) : k || K(O, $, H, null, j, ae, Ce, M, !1),
        Q > 0) {
            if (Q & 16)
                T(H, $, he, z, j, ae, ce);
            else if (Q & 2 && he.class !== z.class && o(H, "class", null, z.class, ce),
            Q & 4 && o(H, "style", he.style, z.style, ce),
            Q & 8) {
                const Ue = $.dynamicProps;
                for (let et = 0; et < Ue.length; et++) {
                    const Dt = Ue[et]
                      , An = he[Dt]
                      , vr = z[Dt];
                    (vr !== An || Dt === "value") && o(H, Dt, An, vr, ce, O.children, j, ae, L)
                }
            }
            Q & 1 && O.children !== $.children && u(H, $.children)
        } else
            !k && le == null && T(H, $, he, z, j, ae, ce);
        ((ne = z.onVnodeUpdated) || ye) && Ln( () => {
            ne && _r(ne, j, $, O),
            ye && Ji($, O, j, "updated")
        }
        , ae)
    }
      , A = (O, $, j, ae, ce, M, k) => {
        for (let H = 0; H < $.length; H++) {
            const Q = O[H]
              , le = $[H]
              , ye = Q.el && (Q.type === Ft || !Ai(Q, le) || Q.shapeFlag & 70) ? f(Q.el) : j;
            y(Q, le, ye, null, ae, ce, M, k, !0)
        }
    }
      , T = (O, $, j, ae, ce, M, k) => {
        if (j !== ae) {
            if (j !== St)
                for (const H in j)
                    !df(H) && !(H in ae) && o(O, H, j[H], null, k, $.children, ce, M, L);
            for (const H in ae) {
                if (df(H))
                    continue;
                const Q = ae[H]
                  , le = j[H];
                Q !== le && H !== "value" && o(O, H, le, Q, k, $.children, ce, M, L)
            }
            "value"in ae && o(O, "value", j.value, ae.value)
        }
    }
      , I = (O, $, j, ae, ce, M, k, H, Q) => {
        const le = $.el = O ? O.el : a("")
          , ye = $.anchor = O ? O.anchor : a("");
        let {patchFlag: he, dynamicChildren: z, slotScopeIds: ne} = $;
        (Vs || he & 2048) && (he = 0,
        Q = !1,
        z = null),
        ne && (H = H ? H.concat(ne) : ne),
        O == null ? (r(le, j, ae),
        r(ye, j, ae),
        P($.children, j, ye, ce, M, k, H, Q)) : he > 0 && he & 64 && z && O.dynamicChildren ? (A(O.dynamicChildren, z, j, ce, M, k, H),
        o0(O, $)) : K(O, $, j, ye, ce, M, k, H, Q)
    }
      , B = (O, $, j, ae, ce, M, k, H, Q) => {
        $.slotScopeIds = H,
        O == null ? $.shapeFlag & 512 ? ce.ctx.activate($, j, ae, k, Q) : G($, j, ae, ce, M, k, Q) : N(O, $, Q)
    }
      , G = (O, $, j, ae, ce, M, k) => {
        const H = O.component = eO(O, ae, ce);
        if (H.type.__hmrId && JL(H),
        hf(O),
        Mo(H, "mount"),
        du(O) && (H.ctx.renderer = de),
        Mo(H, "init"),
        nO(H),
        Do(H, "init"),
        H.asyncDep) {
            if (ce && ce.registerDep(H, U),
            !O.el) {
                const Q = H.subTree = R(en);
                g(null, Q, $, j)
            }
            return
        }
        U(H, O, $, j, ce, M, k),
        pf(),
        Do(H, "mount")
    }
      , N = (O, $, j) => {
        const ae = $.component = O.component;
        if (m7(O, $, j))
            if (ae.asyncDep && !ae.asyncResolved) {
                hf($),
                W(ae, $, j),
                pf();
                return
            } else
                ae.next = $,
                qL(ae.update),
                ae.update();
        else
            $.el = O.el,
            ae.vnode = $
    }
      , U = (O, $, j, ae, ce, M, k) => {
        const H = () => {
            if (O.isMounted) {
                let {next: ye, bu: he, u: z, parent: ne, vnode: Ce} = O, Ue = ye, et;
                hf(ye || O.vnode),
                ya(O, !1),
                ye ? (ye.el = Ce.el,
                W(O, ye, k)) : ye = Ce,
                he && ka(he),
                (et = ye.props && ye.props.onVnodeBeforeUpdate) && _r(et, ne, ye, Ce),
                ya(O, !0),
                Mo(O, "render");
                const Dt = Ep(O);
                Do(O, "render");
                const An = O.subTree;
                O.subTree = Dt,
                Mo(O, "patch"),
                y(An, Dt, f(An.el), ee(An), O, ce, M),
                Do(O, "patch"),
                ye.el = Dt.el,
                Ue === null && ab(O, Dt.el),
                z && Ln(z, ce),
                (et = ye.props && ye.props.onVnodeUpdated) && Ln( () => _r(et, ne, ye, Ce), ce),
                m4(O),
                pf()
            } else {
                let ye;
                const {el: he, props: z} = $
                  , {bm: ne, m: Ce, parent: Ue} = O
                  , et = Ja($);
                if (ya(O, !1),
                ne && ka(ne),
                !et && (ye = z && z.onVnodeBeforeMount) && _r(ye, Ue, $),
                ya(O, !0),
                he && xe) {
                    const Dt = () => {
                        Mo(O, "render"),
                        O.subTree = Ep(O),
                        Do(O, "render"),
                        Mo(O, "hydrate"),
                        xe(he, O.subTree, O, ce, null),
                        Do(O, "hydrate")
                    }
                    ;
                    et ? $.type.__asyncLoader().then( () => !O.isUnmounted && Dt()) : Dt()
                } else {
                    Mo(O, "render");
                    const Dt = O.subTree = Ep(O);
                    Do(O, "render"),
                    Mo(O, "patch"),
                    y(null, Dt, j, ae, O, ce, M),
                    Do(O, "patch"),
                    $.el = Dt.el
                }
                if (Ce && Ln(Ce, ce),
                !et && (ye = z && z.onVnodeMounted)) {
                    const Dt = $;
                    Ln( () => _r(ye, Ue, Dt), ce)
                }
                ($.shapeFlag & 256 || Ue && Ja(Ue.vnode) && Ue.vnode.shapeFlag & 256) && O.a && Ln(O.a, ce),
                O.isMounted = !0,
                py(O),
                $ = j = ae = null
            }
        }
          , Q = O.effect = new Od(H, () => Nd(le),O.scope)
          , le = O.update = () => Q.run();
        le.id = O.uid,
        ya(O, !0),
        Q.onTrack = O.rtc ? ye => ka(O.rtc, ye) : void 0,
        Q.onTrigger = O.rtg ? ye => ka(O.rtg, ye) : void 0,
        le.ownerInstance = O,
        le()
    }
      , W = (O, $, j) => {
        $.component = O;
        const ae = O.vnode.props;
        O.vnode = $,
        O.next = null,
        d$(O, $.props, ae, j),
        x$(O, $.children, j),
        Tl(),
        kE(),
        Pl()
    }
      , K = (O, $, j, ae, ce, M, k, H, Q=!1) => {
        const le = O && O.children
          , ye = O ? O.shapeFlag : 0
          , he = $.children
          , {patchFlag: z, shapeFlag: ne} = $;
        if (z > 0) {
            if (z & 128) {
                ue(le, he, j, ae, ce, M, k, H, Q);
                return
            } else if (z & 256) {
                fe(le, he, j, ae, ce, M, k, H, Q);
                return
            }
        }
        ne & 8 ? (ye & 16 && L(le, ce, M),
        he !== le && u(j, he)) : ye & 16 ? ne & 16 ? ue(le, he, j, ae, ce, M, k, H, Q) : L(le, ce, M, !0) : (ye & 8 && u(j, ""),
        ne & 16 && P(he, j, ae, ce, M, k, H, Q))
    }
      , fe = (O, $, j, ae, ce, M, k, H, Q) => {
        O = O || Sc,
        $ = $ || Sc;
        const le = O.length
          , ye = $.length
          , he = Math.min(le, ye);
        let z;
        for (z = 0; z < he; z++) {
            const ne = $[z] = Q ? Ts($[z]) : wr($[z]);
            y(O[z], ne, j, null, ce, M, k, H, Q)
        }
        le > ye ? L(O, ce, M, !0, !1, he) : P($, j, ae, ce, M, k, H, Q, he)
    }
      , ue = (O, $, j, ae, ce, M, k, H, Q) => {
        let le = 0;
        const ye = $.length;
        let he = O.length - 1
          , z = ye - 1;
        for (; le <= he && le <= z; ) {
            const ne = O[le]
              , Ce = $[le] = Q ? Ts($[le]) : wr($[le]);
            if (Ai(ne, Ce))
                y(ne, Ce, j, null, ce, M, k, H, Q);
            else
                break;
            le++
        }
        for (; le <= he && le <= z; ) {
            const ne = O[he]
              , Ce = $[z] = Q ? Ts($[z]) : wr($[z]);
            if (Ai(ne, Ce))
                y(ne, Ce, j, null, ce, M, k, H, Q);
            else
                break;
            he--,
            z--
        }
        if (le > he) {
            if (le <= z) {
                const ne = z + 1
                  , Ce = ne < ye ? $[ne].el : ae;
                for (; le <= z; )
                    y(null, $[le] = Q ? Ts($[le]) : wr($[le]), j, Ce, ce, M, k, H, Q),
                    le++
            }
        } else if (le > z)
            for (; le <= he; )
                ie(O[le], ce, M, !0),
                le++;
        else {
            const ne = le
              , Ce = le
              , Ue = new Map;
            for (le = Ce; le <= z; le++) {
                const nr = $[le] = Q ? Ts($[le]) : wr($[le]);
                nr.key != null && (Ue.has(nr.key) && se("Duplicate keys found during update:", JSON.stringify(nr.key), "Make sure keys are unique."),
                Ue.set(nr.key, le))
            }
            let et, Dt = 0;
            const An = z - Ce + 1;
            let vr = !1
              , mh = 0;
            const hs = new Array(An);
            for (le = 0; le < An; le++)
                hs[le] = 0;
            for (le = ne; le <= he; le++) {
                const nr = O[le];
                if (Dt >= An) {
                    ie(nr, ce, M, !0);
                    continue
                }
                let Vi;
                if (nr.key != null)
                    Vi = Ue.get(nr.key);
                else
                    for (et = Ce; et <= z; et++)
                        if (hs[et - Ce] === 0 && Ai(nr, $[et])) {
                            Vi = et;
                            break
                        }
                Vi === void 0 ? ie(nr, ce, M, !0) : (hs[Vi - Ce] = le + 1,
                Vi >= mh ? mh = Vi : vr = !0,
                y(nr, $[Vi], j, null, ce, M, k, H, Q),
                Dt++)
            }
            const SE = vr ? E$(hs) : Sc;
            for (et = SE.length - 1,
            le = An - 1; le >= 0; le--) {
                const nr = Ce + le
                  , Vi = $[nr]
                  , CE = nr + 1 < ye ? $[nr + 1].el : ae;
                hs[le] === 0 ? y(null, Vi, j, CE, ce, M, k, H, Q) : vr && (et < 0 || le !== SE[et] ? X(Vi, j, CE, 2) : et--)
            }
        }
    }
      , X = (O, $, j, ae, ce=null) => {
        const {el: M, type: k, transition: H, children: Q, shapeFlag: le} = O;
        if (le & 6) {
            X(O.component.subTree, $, j, ae);
            return
        }
        if (le & 128) {
            O.suspense.move($, j, ae);
            return
        }
        if (le & 64) {
            k.move(O, $, j, de);
            return
        }
        if (k === Ft) {
            r(M, $, j);
            for (let he = 0; he < Q.length; he++)
                X(Q[he], $, j, ae);
            r(O.anchor, $, j);
            return
        }
        if (k === zs) {
            x(O, $, j);
            return
        }
        if (ae !== 2 && le & 1 && H)
            if (ae === 0)
                H.beforeEnter(M),
                r(M, $, j),
                Ln( () => H.enter(M), ce);
            else {
                const {leave: he, delayLeave: z, afterLeave: ne} = H
                  , Ce = () => r(M, $, j)
                  , Ue = () => {
                    he(M, () => {
                        Ce(),
                        ne && ne()
                    }
                    )
                }
                ;
                z ? z(M, Ce, Ue) : Ue()
            }
        else
            r(M, $, j)
    }
      , ie = (O, $, j, ae=!1, ce=!1) => {
        const {type: M, props: k, ref: H, children: Q, dynamicChildren: le, shapeFlag: ye, patchFlag: he, dirs: z} = O;
        if (H != null && r0(H, null, j, O, !0),
        ye & 256) {
            $.ctx.deactivate(O);
            return
        }
        const ne = ye & 1 && z
          , Ce = !Ja(O);
        let Ue;
        if (Ce && (Ue = k && k.onVnodeBeforeUnmount) && _r(Ue, $, O),
        ye & 6)
            q(O.component, j, ae);
        else {
            if (ye & 128) {
                O.suspense.unmount(j, ae);
                return
            }
            ne && Ji(O, null, $, "beforeUnmount"),
            ye & 64 ? O.type.remove(O, $, j, ce, de, ae) : le && (M !== Ft || he > 0 && he & 64) ? L(le, $, j, !1, !0) : (M === Ft && he & 384 || !ce && ye & 16) && L(Q, $, j),
            ae && ge(O)
        }
        (Ce && (Ue = k && k.onVnodeUnmounted) || ne) && Ln( () => {
            Ue && _r(Ue, $, O),
            ne && Ji(O, null, $, "unmounted")
        }
        , j)
    }
      , ge = O => {
        const {type: $, el: j, anchor: ae, transition: ce} = O;
        if ($ === Ft) {
            O.patchFlag > 0 && O.patchFlag & 2048 && ce && !ce.persisted ? O.children.forEach(k => {
                k.type === en ? i(k.el) : ge(k)
            }
            ) : F(j, ae);
            return
        }
        if ($ === zs) {
            b(O);
            return
        }
        const M = () => {
            i(j),
            ce && !ce.persisted && ce.afterLeave && ce.afterLeave()
        }
        ;
        if (O.shapeFlag & 1 && ce && !ce.persisted) {
            const {leave: k, delayLeave: H} = ce
              , Q = () => k(j, M);
            H ? H(O.el, M, Q) : Q()
        } else
            M()
    }
      , F = (O, $) => {
        let j;
        for (; O !== $; )
            j = d(O),
            i(O),
            O = j;
        i($)
    }
      , q = (O, $, j) => {
        O.type.__hmrId && QL(O);
        const {bum: ae, scope: ce, update: M, subTree: k, um: H} = O;
        ae && ka(ae),
        ce.stop(),
        M && (M.active = !1,
        ie(k, O, $, j)),
        H && Ln(H, $),
        Ln( () => {
            O.isUnmounted = !0
        }
        , $),
        $ && $.pendingBranch && !$.isUnmounted && O.asyncDep && !O.asyncResolved && O.suspenseId === $.pendingId && ($.deps--,
        $.deps === 0 && $.resolve()),
        o7(O)
    }
      , L = (O, $, j, ae=!1, ce=!1, M=0) => {
        for (let k = M; k < O.length; k++)
            ie(O[k], $, j, ae, ce)
    }
      , ee = O => O.shapeFlag & 6 ? ee(O.component.subTree) : O.shapeFlag & 128 ? O.suspense.next() : d(O.anchor || O.el)
      , J = (O, $, j) => {
        O == null ? $._vnode && ie($._vnode, null, null, !0) : y($._vnode || null, O, $, null, null, null, j),
        kE(),
        Qp(),
        $._vnode = O
    }
      , de = {
        p: y,
        um: ie,
        m: X,
        r: ge,
        mt: G,
        mc: P,
        pc: K,
        pbc: A,
        n: ee,
        o: t
    };
    let pe, xe;
    return e && ([pe,xe] = e(de)),
    {
        render: J,
        hydrate: pe,
        createApp: c$(J, pe)
    }
}
function ya({effect: t, update: e}, n) {
    t.allowRecurse = e.allowRecurse = n
}
function o0(t, e, n=!1) {
    const r = t.children
      , i = e.children;
    if (He(r) && He(i))
        for (let o = 0; o < r.length; o++) {
            const s = r[o];
            let a = i[o];
            a.shapeFlag & 1 && !a.dynamicChildren && ((a.patchFlag <= 0 || a.patchFlag === 32) && (a = i[o] = Ts(i[o]),
            a.el = s.el),
            n || o0(s, a)),
            a.type === fo && (a.el = s.el),
            a.type === en && !a.el && (a.el = s.el)
        }
}
function E$(t) {
    const e = t.slice()
      , n = [0];
    let r, i, o, s, a;
    const l = t.length;
    for (r = 0; r < l; r++) {
        const c = t[r];
        if (c !== 0) {
            if (i = n[n.length - 1],
            t[i] < c) {
                e[r] = i,
                n.push(r);
                continue
            }
            for (o = 0,
            s = n.length - 1; o < s; )
                a = o + s >> 1,
                t[n[a]] < c ? o = a + 1 : s = a;
            c < t[n[o]] && (o > 0 && (e[r] = n[o - 1]),
            n[o] = r)
        }
    }
    for (o = n.length,
    s = n[o - 1]; o-- > 0; )
        n[o] = s,
        s = e[s];
    return n
}
const S$ = t => t.__isTeleport
  , Tc = t => t && (t.disabled || t.disabled === "")
  , ZE = t => typeof SVGElement < "u" && t instanceof SVGElement
  , by = (t, e) => {
    const n = t && t.to;
    if (nn(n))
        if (e) {
            const r = e(n);
            return r || se(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),
            r
        } else
            return se("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),
            null;
    else
        return !n && !Tc(t) && se(`Invalid Teleport target: ${n}`),
        n
}
  , C$ = {
    __isTeleport: !0,
    process(t, e, n, r, i, o, s, a, l, c) {
        const {mc: u, pc: f, pbc: d, o: {insert: h, querySelector: p, createText: y, createComment: v}} = c
          , g = Tc(e.props);
        let {shapeFlag: m, children: _, dynamicChildren: x} = e;
        if (Vs && (l = !1,
        x = null),
        t == null) {
            const b = e.el = v("teleport start")
              , w = e.anchor = v("teleport end");
            h(b, n, r),
            h(w, n, r);
            const E = e.target = by(e.props, p)
              , S = e.targetAnchor = y("");
            E ? (h(S, E),
            s = s || ZE(E)) : g || se("Invalid Teleport target on mount:", E, `(${typeof E})`);
            const P = (C, A) => {
                m & 16 && u(_, C, A, i, o, s, a, l)
            }
            ;
            g ? P(n, w) : E && P(E, S)
        } else {
            e.el = t.el;
            const b = e.anchor = t.anchor
              , w = e.target = t.target
              , E = e.targetAnchor = t.targetAnchor
              , S = Tc(t.props)
              , P = S ? n : w
              , C = S ? b : E;
            if (s = s || ZE(w),
            x ? (d(t.dynamicChildren, x, P, i, o, s, a),
            o0(t, e, !0)) : l || f(t, e, P, C, i, o, s, a, !1),
            g)
                S || Sh(e, n, b, c, 1);
            else if ((e.props && e.props.to) !== (t.props && t.props.to)) {
                const A = e.target = by(e.props, p);
                A ? Sh(e, A, null, c, 0) : se("Invalid Teleport target on update:", w, `(${typeof w})`)
            } else
                S && Sh(e, w, E, c, 1)
        }
        X4(e)
    },
    remove(t, e, n, r, {um: i, o: {remove: o}}, s) {
        const {shapeFlag: a, children: l, anchor: c, targetAnchor: u, target: f, props: d} = t;
        if (f && o(u),
        (s || !Tc(d)) && (o(c),
        a & 16))
            for (let h = 0; h < l.length; h++) {
                const p = l[h];
                i(p, e, n, !0, !!p.dynamicChildren)
            }
    },
    move: Sh,
    hydrate: A$
};
function Sh(t, e, n, {o: {insert: r}, m: i}, o=2) {
    o === 0 && r(t.targetAnchor, e, n);
    const {el: s, anchor: a, shapeFlag: l, children: c, props: u} = t
      , f = o === 2;
    if (f && r(s, e, n),
    (!f || Tc(u)) && l & 16)
        for (let d = 0; d < c.length; d++)
            i(c[d], e, n, 2);
    f && r(a, e, n)
}
function A$(t, e, n, r, i, o, {o: {nextSibling: s, parentNode: a, querySelector: l}}, c) {
    const u = e.target = by(e.props, l);
    if (u) {
        const f = u._lpa || u.firstChild;
        if (e.shapeFlag & 16)
            if (Tc(e.props))
                e.anchor = c(s(t), e, a(t), n, r, i, o),
                e.targetAnchor = f;
            else {
                e.anchor = s(t);
                let d = f;
                for (; d; )
                    if (d = s(d),
                    d && d.nodeType === 8 && d.data === "teleport anchor") {
                        e.targetAnchor = d,
                        u._lpa = e.targetAnchor && s(e.targetAnchor);
                        break
                    }
                c(f, e, u, n, r, i, o)
            }
        X4(e)
    }
    return e.anchor && s(e.anchor)
}
const hg = C$;
function X4(t) {
    const e = t.ctx;
    if (e && e.ut) {
        let n = t.children[0].el;
        for (; n !== t.targetAnchor; )
            n.nodeType === 1 && n.setAttribute("data-v-owner", e.uid),
            n = n.nextSibling;
        e.ut()
    }
}
const Ft = Symbol.for("v-fgt")
  , fo = Symbol.for("v-txt")
  , en = Symbol.for("v-cmt")
  , zs = Symbol.for("v-stc")
  , vf = [];
let Ar = null;
function pg(t=!1) {
    vf.push(Ar = t ? null : [])
}
function K4() {
    vf.pop(),
    Ar = vf[vf.length - 1] || null
}
let cl = 1;
function wy(t) {
    cl += t
}
function q4(t) {
    return t.dynamicChildren = cl > 0 ? Ar || Sc : null,
    K4(),
    cl > 0 && Ar && Ar.push(t),
    t
}
function T$(t, e, n, r, i, o) {
    return q4(mb(t, e, n, r, i, o, !0))
}
function gb(t, e, n, r, i) {
    return q4(R(t, e, n, r, i, !0))
}
function ho(t) {
    return t ? t.__v_isVNode === !0 : !1
}
function Ai(t, e) {
    return e.shapeFlag & 6 && uc.has(e.type) ? (t.shapeFlag &= -257,
    e.shapeFlag &= -513,
    !1) : t.type === e.type && t.key === e.key
}
let Ey;
function P$(t) {
    Ey = t
}
const I$ = (...t) => O$(...Ey ? Ey(t, ln) : t)
  , gg = "__vInternal"
  , Z4 = ({key: t}) => t ?? null
  , Sp = ({ref: t, ref_key: e, ref_for: n}) => (typeof t == "number" && (t = "" + t),
t != null ? nn(t) || pt(t) || Ge(t) ? {
    i: ln,
    r: t,
    k: e,
    f: !!n
} : t : null);
function mb(t, e=null, n=null, r=0, i=null, o=t === Ft ? 0 : 1, s=!1, a=!1) {
    const l = {
        __v_isVNode: !0,
        __v_skip: !0,
        type: t,
        props: e,
        key: e && Z4(e),
        ref: e && Sp(e),
        scopeId: cg,
        slotScopeIds: null,
        children: n,
        component: null,
        suspense: null,
        ssContent: null,
        ssFallback: null,
        dirs: null,
        transition: null,
        el: null,
        anchor: null,
        target: null,
        targetAnchor: null,
        staticCount: 0,
        shapeFlag: o,
        patchFlag: r,
        dynamicProps: i,
        dynamicChildren: null,
        appContext: null,
        ctx: ln
    };
    return a ? (vb(l, n),
    o & 128 && t.normalize(l)) : n && (l.shapeFlag |= nn(n) ? 8 : 16),
    l.key !== l.key && se("VNode created with invalid key (NaN). VNode type:", l.type),
    cl > 0 && !s && Ar && (l.patchFlag > 0 || o & 6) && l.patchFlag !== 32 && Ar.push(l),
    l
}
const R = I$;
function O$(t, e=null, n=null, r=0, i=null, o=!1) {
    if ((!t || t === M4) && (t || se(`Invalid vnode type when creating vnode: ${t}.`),
    t = en),
    ho(t)) {
        const a = vi(t, e, !0);
        return n && vb(a, n),
        cl > 0 && !o && Ar && (a.shapeFlag & 6 ? Ar[Ar.indexOf(t)] = a : Ar.push(a)),
        a.patchFlag |= -2,
        a
    }
    if (oO(t) && (t = t.__vccOpts),
    e) {
        e = J4(e);
        let {class: a, style: l} = e;
        a && !nn(a) && (e.class = kd(a)),
        Tt(l) && (Hf(l) && !He(l) && (l = Xt({}, l)),
        e.style = Bd(l))
    }
    const s = nn(t) ? 1 : _4(t) ? 128 : S$(t) ? 64 : Tt(t) ? 4 : Ge(t) ? 2 : 0;
    return s & 4 && Hf(t) && (t = Le(t),
    se("Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.", `
Component that was made reactive: `, t)),
    mb(t, e, n, r, i, s, o, !0)
}
function J4(t) {
    return t ? Hf(t) || gg in t ? Xt({}, t) : t : null
}
function vi(t, e, n=!1) {
    const {props: r, ref: i, patchFlag: o, children: s} = t
      , a = e ? st(r || {}, e) : r;
    return {
        __v_isVNode: !0,
        __v_skip: !0,
        type: t.type,
        props: a,
        key: a && Z4(a),
        ref: e && e.ref ? n && i ? He(i) ? i.concat(Sp(e)) : [i, Sp(e)] : Sp(e) : i,
        scopeId: t.scopeId,
        slotScopeIds: t.slotScopeIds,
        children: o === -1 && He(s) ? s.map(Q4) : s,
        target: t.target,
        targetAnchor: t.targetAnchor,
        staticCount: t.staticCount,
        shapeFlag: t.shapeFlag,
        patchFlag: e && t.type !== Ft ? o === -1 ? 16 : o | 16 : o,
        dynamicProps: t.dynamicProps,
        dynamicChildren: t.dynamicChildren,
        appContext: t.appContext,
        dirs: t.dirs,
        transition: t.transition,
        component: t.component,
        suspense: t.suspense,
        ssContent: t.ssContent && vi(t.ssContent),
        ssFallback: t.ssFallback && vi(t.ssFallback),
        el: t.el,
        anchor: t.anchor,
        ctx: t.ctx,
        ce: t.ce
    }
}
function Q4(t) {
    const e = vi(t);
    return He(t.children) && (e.children = t.children.map(Q4)),
    e
}
function mg(t=" ", e=0) {
    return R(fo, null, t, e)
}
function R$(t, e) {
    const n = R(zs, null, t);
    return n.staticCount = e,
    n
}
function M$(t="", e=!1) {
    return e ? (pg(),
    gb(en, null, t)) : R(en, null, t)
}
function wr(t) {
    return t == null || typeof t == "boolean" ? R(en) : He(t) ? R(Ft, null, t.slice()) : typeof t == "object" ? Ts(t) : R(fo, null, String(t))
}
function Ts(t) {
    return t.el === null && t.patchFlag !== -1 || t.memo ? t : vi(t)
}
function vb(t, e) {
    let n = 0;
    const {shapeFlag: r} = t;
    if (e == null)
        e = null;
    else if (He(e))
        n = 16;
    else if (typeof e == "object")
        if (r & 65) {
            const i = e.default;
            i && (i._c && (i._d = !1),
            vb(t, i()),
            i._c && (i._d = !0));
            return
        } else {
            n = 32;
            const i = e._;
            !i && !(gg in e) ? e._ctx = ln : i === 3 && ln && (ln.slots._ === 1 ? e._ = 1 : (e._ = 2,
            t.patchFlag |= 1024))
        }
    else
        Ge(e) ? (e = {
            default: e,
            _ctx: ln
        },
        n = 32) : (e = String(e),
        r & 64 ? (n = 16,
        e = [mg(e)]) : n = 8);
    t.children = e,
    t.shapeFlag |= n
}
function st(...t) {
    const e = {};
    for (let n = 0; n < t.length; n++) {
        const r = t[n];
        for (const i in r)
            if (i === "class")
                e.class !== r.class && (e.class = kd([e.class, r.class]));
            else if (i === "style")
                e.style = Bd([e.style, r.style]);
            else if (Md(i)) {
                const o = e[i]
                  , s = r[i];
                s && o !== s && !(He(o) && o.includes(s)) && (e[i] = o ? [].concat(o, s) : s)
            } else
                i !== "" && (e[i] = r[i])
    }
    return e
}
function _r(t, e, n, r=null) {
    Hr(t, e, 7, [n, r])
}
const D$ = F4();
let B$ = 0;
function eO(t, e, n) {
    const r = t.type
      , i = (e ? e.appContext : t.appContext) || D$
      , o = {
        uid: B$++,
        vnode: t,
        type: r,
        parent: e,
        appContext: i,
        root: null,
        next: null,
        subTree: null,
        effect: null,
        update: null,
        scope: new jx(!0),
        render: null,
        proxy: null,
        exposed: null,
        exposeProxy: null,
        withProxy: null,
        provides: e ? e.provides : Object.create(i.provides),
        accessCache: null,
        renderCache: [],
        components: null,
        directives: null,
        propsOptions: U4(r, i),
        emitsOptions: y4(r, i),
        emit: null,
        emitted: null,
        propsDefaults: St,
        inheritAttrs: r.inheritAttrs,
        ctx: St,
        data: St,
        props: St,
        attrs: St,
        slots: St,
        refs: St,
        setupState: St,
        setupContext: null,
        attrsProxy: null,
        slotsProxy: null,
        suspense: n,
        suspenseId: n ? n.pendingId : 0,
        asyncDep: null,
        asyncResolved: !1,
        isMounted: !1,
        isUnmounted: !1,
        isDeactivated: !1,
        bc: null,
        c: null,
        bm: null,
        m: null,
        bu: null,
        u: null,
        um: null,
        bum: null,
        da: null,
        a: null,
        rtg: null,
        rtc: null,
        ec: null,
        sp: null
    };
    return o.ctx = $7(o),
    o.root = e ? e.root : o,
    o.emit = c7.bind(null, o),
    t.ce && t.ce(o),
    o
}
let an = null;
const yt = () => an || ln;
let yb, Gl, JE = "__VUE_INSTANCE_SETTERS__";
(Gl = Jp()[JE]) || (Gl = Jp()[JE] = []),
Gl.push(t => an = t),
yb = t => {
    Gl.length > 1 ? Gl.forEach(e => e(t)) : Gl[0](t)
}
;
const Qs = t => {
    yb(t),
    t.scope.on()
}
  , js = () => {
    an && an.scope.off(),
    yb(null)
}
  , k$ = Rd("slot,component");
function Sy(t, e) {
    const n = e.isNativeTag || o4;
    (k$(t) || n(t)) && se("Do not use built-in or reserved HTML elements as component id: " + t)
}
function tO(t) {
    return t.vnode.shapeFlag & 4
}
let Fc = !1;
function nO(t, e=!1) {
    Fc = e;
    const {props: n, children: r} = t.vnode
      , i = tO(t);
    u$(t, n, i, e),
    _$(t, r);
    const o = i ? N$(t, e) : void 0;
    return Fc = !1,
    o
}
function N$(t, e) {
    var n;
    const r = t.type;
    {
        if (r.name && Sy(r.name, t.appContext.config),
        r.components) {
            const o = Object.keys(r.components);
            for (let s = 0; s < o.length; s++)
                Sy(o[s], t.appContext.config)
        }
        if (r.directives) {
            const o = Object.keys(r.directives);
            for (let s = 0; s < o.length; s++)
                E4(o[s])
        }
        r.compilerOptions && _b() && se('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')
    }
    t.accessCache = Object.create(null),
    t.proxy = ro(new Proxy(t.ctx,mf)),
    U7(t);
    const {setup: i} = r;
    if (i) {
        const o = t.setupContext = i.length > 1 ? iO(t) : null;
        Qs(t),
        Tl();
        const s = so(i, t, 0, [gc(t.props), o]);
        if (Pl(),
        js(),
        og(s)) {
            if (s.then(js, js),
            e)
                return s.then(a => {
                    Cy(t, a, e)
                }
                ).catch(a => {
                    Ol(a, t, 0)
                }
                );
            if (t.asyncDep = s,
            !t.suspense) {
                const a = (n = r.name) != null ? n : "Anonymous";
                se(`Component <${a}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)
            }
        } else
            Cy(t, s, e)
    } else
        rO(t, e)
}
function Cy(t, e, n) {
    Ge(e) ? t.type.__ssrInlineRender ? t.ssrRender = e : t.render = e : Tt(e) ? (ho(e) && se("setup() should not return VNodes directly - return a render function instead."),
    t.devtoolsRawSetupState = e,
    t.setupState = Zx(e),
    G7(t)) : e !== void 0 && se(`setup() should return an object. Received: ${e === null ? "null" : typeof e}`),
    rO(t, n)
}
let yf, Ay;
function F$(t) {
    yf = t,
    Ay = e => {
        e.render._rc && (e.withProxy = new Proxy(e.ctx,L7))
    }
}
const _b = () => !yf;
function rO(t, e, n) {
    const r = t.type;
    if (!t.render) {
        if (!e && yf && !r.render) {
            const i = r.template || hb(t).template;
            if (i) {
                Mo(t, "compile");
                const {isCustomElement: o, compilerOptions: s} = t.appContext.config
                  , {delimiters: a, compilerOptions: l} = r
                  , c = Xt(Xt({
                    isCustomElement: o,
                    delimiters: a
                }, s), l);
                r.render = yf(i, c),
                Do(t, "compile")
            }
        }
        t.render = r.render || Cr,
        Ay && Ay(t)
    }
    Qs(t),
    Tl(),
    r$(t),
    Pl(),
    js(),
    !r.render && t.render === Cr && !e && (!yf && r.template ? se('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".') : se("Component is missing template or render function."))
}
function L$(t) {
    return t.attrsProxy || (t.attrsProxy = new Proxy(t.attrs,{
        get(e, n) {
            return e0(),
            er(t, "get", "$attrs"),
            e[n]
        },
        set() {
            return se("setupContext.attrs is readonly."),
            !1
        },
        deleteProperty() {
            return se("setupContext.attrs is readonly."),
            !1
        }
    }))
}
function $$(t) {
    return t.slotsProxy || (t.slotsProxy = new Proxy(t.slots,{
        get(e, n) {
            return er(t, "get", "$slots"),
            e[n]
        }
    }))
}
function iO(t) {
    return Object.freeze({
        get attrs() {
            return L$(t)
        },
        get slots() {
            return $$(t)
        },
        get emit() {
            return (n, ...r) => t.emit(n, ...r)
        },
        expose: n => {
            if (t.exposed && se("expose() should be called only once per setup()."),
            n != null) {
                let r = typeof n;
                r === "object" && (He(n) ? r = "array" : pt(n) && (r = "ref")),
                r !== "object" && se(`expose() should be passed a plain object, received ${r}.`)
            }
            t.exposed = n || {}
        }
    })
}
function vg(t) {
    if (t.exposed)
        return t.exposeProxy || (t.exposeProxy = new Proxy(Zx(ro(t.exposed)),{
            get(e, n) {
                if (n in e)
                    return e[n];
                if (n in Qa)
                    return Qa[n](t)
            },
            has(e, n) {
                return n in e || n in Qa
            }
        }))
}
const U$ = /(?:^|[-_])(\w)/g
  , G$ = t => t.replace(U$, e => e.toUpperCase()).replace(/[-_]/g, "");
function qf(t, e=!0) {
    return Ge(t) ? t.displayName || t.name : t.name || e && t.__name
}
function yg(t, e, n=!1) {
    let r = qf(e);
    if (!r && e.__file) {
        const i = e.__file.match(/([^/\\]+)\.\w+$/);
        i && (r = i[1])
    }
    if (!r && t && t.parent) {
        const i = o => {
            for (const s in o)
                if (o[s] === e)
                    return s
        }
        ;
        r = i(t.components || t.parent.type.components) || i(t.appContext.components)
    }
    return r ? G$(r) : n ? "App" : "Anonymous"
}
function oO(t) {
    return Ge(t) && "__vccOpts"in t
}
const re = (t, e) => CL(t, e, Fc);
function Mn(t, e, n) {
    const r = arguments.length;
    return r === 2 ? Tt(e) && !He(e) ? ho(e) ? R(t, null, [e]) : R(t, e) : R(t, null, e) : (r > 3 ? n = Array.prototype.slice.call(arguments, 2) : r === 3 && ho(n) && (n = [n]),
    R(t, e, n))
}
const sO = Symbol.for("v-scx")
  , aO = () => {
    {
        const t = dn(sO);
        return t || se("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),
        t
    }
}
;
function Mm(t) {
    return !!(t && t.__v_isShallow)
}
function lO() {
    if (typeof window > "u")
        return;
    const t = {
        style: "color:#3ba776"
    }
      , e = {
        style: "color:#0b1bc9"
    }
      , n = {
        style: "color:#b62e24"
    }
      , r = {
        style: "color:#9d288c"
    }
      , i = {
        header(f) {
            return Tt(f) ? f.__isVue ? ["div", t, "VueInstance"] : pt(f) ? ["div", {}, ["span", t, u(f)], "<", a(f.value), ">"] : Bi(f) ? ["div", {}, ["span", t, Mm(f) ? "ShallowReactive" : "Reactive"], "<", a(f), `>${ts(f) ? " (readonly)" : ""}`] : ts(f) ? ["div", {}, ["span", t, Mm(f) ? "ShallowReadonly" : "Readonly"], "<", a(f), ">"] : null : null
        },
        hasBody(f) {
            return f && f.__isVue
        },
        body(f) {
            if (f && f.__isVue)
                return ["div", {}, ...o(f.$)]
        }
    };
    function o(f) {
        const d = [];
        f.type.props && f.props && d.push(s("props", Le(f.props))),
        f.setupState !== St && d.push(s("setup", f.setupState)),
        f.data !== St && d.push(s("data", Le(f.data)));
        const h = l(f, "computed");
        h && d.push(s("computed", h));
        const p = l(f, "inject");
        return p && d.push(s("injected", p)),
        d.push(["div", {}, ["span", {
            style: r.style + ";opacity:0.66"
        }, "$ (internal): "], ["object", {
            object: f
        }]]),
        d
    }
    function s(f, d) {
        return d = Xt({}, d),
        Object.keys(d).length ? ["div", {
            style: "line-height:1.25em;margin-bottom:0.6em"
        }, ["div", {
            style: "color:#476582"
        }, f], ["div", {
            style: "padding-left:1.25em"
        }, ...Object.keys(d).map(h => ["div", {}, ["span", r, h + ": "], a(d[h], !1)])]] : ["span", {}]
    }
    function a(f, d=!0) {
        return typeof f == "number" ? ["span", e, f] : typeof f == "string" ? ["span", n, JSON.stringify(f)] : typeof f == "boolean" ? ["span", r, f] : Tt(f) ? ["object", {
            object: d ? Le(f) : f
        }] : ["span", n, String(f)]
    }
    function l(f, d) {
        const h = f.type;
        if (Ge(h))
            return;
        const p = {};
        for (const y in f.ctx)
            c(h, y, d) && (p[y] = f.ctx[y]);
        return p
    }
    function c(f, d, h) {
        const p = f[h];
        if (He(p) && p.includes(d) || Tt(p) && d in p || f.extends && c(f.extends, d, h) || f.mixins && f.mixins.some(y => c(y, d, h)))
            return !0
    }
    function u(f) {
        return Mm(f) ? "ShallowRef" : f.effect ? "ComputedRef" : "Ref"
    }
    window.devtoolsFormatters ? window.devtoolsFormatters.push(i) : window.devtoolsFormatters = [i]
}
function H$(t, e, n, r) {
    const i = n[r];
    if (i && cO(i, t))
        return i;
    const o = e();
    return o.memo = t.slice(),
    n[r] = o
}
function cO(t, e) {
    const n = t.memo;
    if (n.length != e.length)
        return !1;
    for (let r = 0; r < n.length; r++)
        if (uy(n[r], e[r]))
            return !1;
    return cl > 0 && Ar && Ar.push(t),
    !0
}
const Ty = "3.3.4"
  , V$ = {
    createComponentInstance: eO,
    setupComponent: nO,
    renderComponentRoot: Ep,
    setCurrentRenderingInstance: Wf,
    isVNode: ho,
    normalizeVNode: wr
}
  , z$ = V$
  , j$ = null
  , W$ = null;
function xb(t, e) {
    const n = Object.create(null)
      , r = t.split(",");
    for (let i = 0; i < r.length; i++)
        n[r[i]] = !0;
    return e ? i => !!n[i.toLowerCase()] : i => !!n[i]
}
const Dm = Object.freeze({})
  , Y$ = /^on[^a-z]/
  , X$ = t => Y$.test(t)
  , K$ = t => t.startsWith("onUpdate:")
  , $d = Object.assign
  , Rr = Array.isArray
  , Ud = t => fO(t) === "[object Set]"
  , QE = t => fO(t) === "[object Date]"
  , uO = t => typeof t == "function"
  , Zf = t => typeof t == "string"
  , eS = t => typeof t == "symbol"
  , Py = t => t !== null && typeof t == "object"
  , q$ = Object.prototype.toString
  , fO = t => q$.call(t)
  , bb = t => {
    const e = Object.create(null);
    return n => e[n] || (e[n] = t(n))
}
  , Z$ = /-(\w)/g
  , Bm = bb(t => t.replace(Z$, (e, n) => n ? n.toUpperCase() : ""))
  , J$ = /\B([A-Z])/g
  , Rs = bb(t => t.replace(J$, "-$1").toLowerCase())
  , Q$ = bb(t => t.charAt(0).toUpperCase() + t.slice(1))
  , eU = (t, e) => {
    for (let n = 0; n < t.length; n++)
        t[n](e)
}
  , Iy = t => {
    const e = parseFloat(t);
    return isNaN(e) ? t : e
}
  , Oy = t => {
    const e = Zf(t) ? Number(t) : NaN;
    return isNaN(e) ? t : e
}
  , tU = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"
  , nU = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"
  , rU = xb(tU)
  , iU = xb(nU)
  , oU = "itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly"
  , sU = xb(oU);
function dO(t) {
    return !!t || t === ""
}
function aU(t, e) {
    if (t.length !== e.length)
        return !1;
    let n = !0;
    for (let r = 0; n && r < t.length; r++)
        n = ea(t[r], e[r]);
    return n
}
function ea(t, e) {
    if (t === e)
        return !0;
    let n = QE(t)
      , r = QE(e);
    if (n || r)
        return n && r ? t.getTime() === e.getTime() : !1;
    if (n = eS(t),
    r = eS(e),
    n || r)
        return t === e;
    if (n = Rr(t),
    r = Rr(e),
    n || r)
        return n && r ? aU(t, e) : !1;
    if (n = Py(t),
    r = Py(e),
    n || r) {
        if (!n || !r)
            return !1;
        const i = Object.keys(t).length
          , o = Object.keys(e).length;
        if (i !== o)
            return !1;
        for (const s in t) {
            const a = t.hasOwnProperty(s)
              , l = e.hasOwnProperty(s);
            if (a && !l || !a && l || !ea(t[s], e[s]))
                return !1
        }
    }
    return String(t) === String(e)
}
function _g(t, e) {
    return t.findIndex(n => ea(n, e))
}
const lU = "http://www.w3.org/2000/svg"
  , Na = typeof document < "u" ? document : null
  , tS = Na && Na.createElement("template")
  , cU = {
    insert: (t, e, n) => {
        e.insertBefore(t, n || null)
    }
    ,
    remove: t => {
        const e = t.parentNode;
        e && e.removeChild(t)
    }
    ,
    createElement: (t, e, n, r) => {
        const i = e ? Na.createElementNS(lU, t) : Na.createElement(t, n ? {
            is: n
        } : void 0);
        return t === "select" && r && r.multiple != null && i.setAttribute("multiple", r.multiple),
        i
    }
    ,
    createText: t => Na.createTextNode(t),
    createComment: t => Na.createComment(t),
    setText: (t, e) => {
        t.nodeValue = e
    }
    ,
    setElementText: (t, e) => {
        t.textContent = e
    }
    ,
    parentNode: t => t.parentNode,
    nextSibling: t => t.nextSibling,
    querySelector: t => Na.querySelector(t),
    setScopeId(t, e) {
        t.setAttribute(e, "")
    },
    insertStaticContent(t, e, n, r, i, o) {
        const s = n ? n.previousSibling : e.lastChild;
        if (i && (i === o || i.nextSibling))
            for (; e.insertBefore(i.cloneNode(!0), n),
            !(i === o || !(i = i.nextSibling)); )
                ;
        else {
            tS.innerHTML = r ? `<svg>${t}</svg>` : t;
            const a = tS.content;
            if (r) {
                const l = a.firstChild;
                for (; l.firstChild; )
                    a.appendChild(l.firstChild);
                a.removeChild(l)
            }
            e.insertBefore(a, n)
        }
        return [s ? s.nextSibling : e.firstChild, n ? n.previousSibling : e.lastChild]
    }
};
function uU(t, e, n) {
    const r = t._vtc;
    r && (e = (e ? [e, ...r] : [...r]).join(" ")),
    e == null ? t.removeAttribute("class") : n ? t.setAttribute("class", e) : t.className = e
}
function fU(t, e, n) {
    const r = t.style
      , i = Zf(n);
    if (n && !i) {
        if (e && !Zf(e))
            for (const o in e)
                n[o] == null && Ry(r, o, "");
        for (const o in n)
            Ry(r, o, n[o])
    } else {
        const o = r.display;
        i ? e !== n && (r.cssText = n) : e && t.removeAttribute("style"),
        "_vod"in t && (r.display = o)
    }
}
const dU = /[^\\];\s*$/
  , nS = /\s*!important$/;
function Ry(t, e, n) {
    if (Rr(n))
        n.forEach(r => Ry(t, e, r));
    else if (n == null && (n = ""),
    dU.test(n) && se(`Unexpected semicolon at the end of '${e}' style value: '${n}'`),
    e.startsWith("--"))
        t.setProperty(e, n);
    else {
        const r = hU(t, e);
        nS.test(n) ? t.setProperty(Rs(r), n.replace(nS, ""), "important") : t[r] = n
    }
}
const rS = ["Webkit", "Moz", "ms"]
  , km = {};
function hU(t, e) {
    const n = km[e];
    if (n)
        return n;
    let r = Fi(e);
    if (r !== "filter" && r in t)
        return km[e] = r;
    r = Q$(r);
    for (let i = 0; i < rS.length; i++) {
        const o = rS[i] + r;
        if (o in t)
            return km[e] = o
    }
    return e
}
const iS = "http://www.w3.org/1999/xlink";
function pU(t, e, n, r, i) {
    if (r && e.startsWith("xlink:"))
        n == null ? t.removeAttributeNS(iS, e.slice(6, e.length)) : t.setAttributeNS(iS, e, n);
    else {
        const o = sU(e);
        n == null || o && !dO(n) ? t.removeAttribute(e) : t.setAttribute(e, o ? "" : n)
    }
}
function gU(t, e, n, r, i, o, s) {
    if (e === "innerHTML" || e === "textContent") {
        r && s(r, i, o),
        t[e] = n ?? "";
        return
    }
    const a = t.tagName;
    if (e === "value" && a !== "PROGRESS" && !a.includes("-")) {
        t._value = n;
        const c = a === "OPTION" ? t.getAttribute("value") : t.value
          , u = n ?? "";
        c !== u && (t.value = u),
        n == null && t.removeAttribute(e);
        return
    }
    let l = !1;
    if (n === "" || n == null) {
        const c = typeof t[e];
        c === "boolean" ? n = dO(n) : n == null && c === "string" ? (n = "",
        l = !0) : c === "number" && (n = 0,
        l = !0)
    }
    try {
        t[e] = n
    } catch (c) {
        l || se(`Failed setting prop "${e}" on <${a.toLowerCase()}>: value ${n} is invalid.`, c)
    }
    l && t.removeAttribute(e)
}
function Go(t, e, n, r) {
    t.addEventListener(e, n, r)
}
function mU(t, e, n, r) {
    t.removeEventListener(e, n, r)
}
function vU(t, e, n, r, i=null) {
    const o = t._vei || (t._vei = {})
      , s = o[e];
    if (r && s)
        s.value = r;
    else {
        const [a,l] = yU(e);
        if (r) {
            const c = o[e] = bU(r, i);
            Go(t, a, c, l)
        } else
            s && (mU(t, a, s, l),
            o[e] = void 0)
    }
}
const oS = /(?:Once|Passive|Capture)$/;
function yU(t) {
    let e;
    if (oS.test(t)) {
        e = {};
        let r;
        for (; r = t.match(oS); )
            t = t.slice(0, t.length - r[0].length),
            e[r[0].toLowerCase()] = !0
    }
    return [t[2] === ":" ? t.slice(3) : Rs(t.slice(2)), e]
}
let Nm = 0;
const _U = Promise.resolve()
  , xU = () => Nm || (_U.then( () => Nm = 0),
Nm = Date.now());
function bU(t, e) {
    const n = r => {
        if (!r._vts)
            r._vts = Date.now();
        else if (r._vts <= n.attached)
            return;
        Hr(wU(r, n.value), e, 5, [r])
    }
    ;
    return n.value = t,
    n.attached = xU(),
    n
}
function wU(t, e) {
    if (Rr(e)) {
        const n = t.stopImmediatePropagation;
        return t.stopImmediatePropagation = () => {
            n.call(t),
            t._stopped = !0
        }
        ,
        e.map(r => i => !i._stopped && r && r(i))
    } else
        return e
}
const sS = /^on[a-z]/
  , EU = (t, e, n, r, i=!1, o, s, a, l) => {
    e === "class" ? uU(t, r, i) : e === "style" ? fU(t, n, r) : X$(e) ? K$(e) || vU(t, e, n, r, s) : (e[0] === "." ? (e = e.slice(1),
    !0) : e[0] === "^" ? (e = e.slice(1),
    !1) : SU(t, e, r, i)) ? gU(t, e, r, o, s, a, l) : (e === "true-value" ? t._trueValue = r : e === "false-value" && (t._falseValue = r),
    pU(t, e, r, i))
}
;
function SU(t, e, n, r) {
    return r ? !!(e === "innerHTML" || e === "textContent" || e in t && sS.test(e) && uO(n)) : e === "spellcheck" || e === "draggable" || e === "translate" || e === "form" || e === "list" && t.tagName === "INPUT" || e === "type" && t.tagName === "TEXTAREA" || sS.test(e) && Zf(n) ? !1 : e in t
}
function hO(t, e) {
    const n = we(t);
    class r extends xg {
        constructor(o) {
            super(n, o, e)
        }
    }
    return r.def = n,
    r
}
const CU = t => hO(t, IO)
  , AU = typeof HTMLElement < "u" ? HTMLElement : class {
}
;
class xg extends AU {
    constructor(e, n={}, r) {
        super(),
        this._def = e,
        this._props = n,
        this._instance = null,
        this._connected = !1,
        this._resolved = !1,
        this._numberProps = null,
        this.shadowRoot && r ? r(this._createVNode(), this.shadowRoot) : (this.shadowRoot && se("Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use `defineSSRCustomElement`."),
        this.attachShadow({
            mode: "open"
        }),
        this._def.__asyncLoader || this._resolveProps(this._def))
    }
    connectedCallback() {
        this._connected = !0,
        this._instance || (this._resolved ? this._update() : this._resolveDef())
    }
    disconnectedCallback() {
        this._connected = !1,
        Xe( () => {
            this._connected || (By(null, this.shadowRoot),
            this._instance = null)
        }
        )
    }
    _resolveDef() {
        this._resolved = !0;
        for (let r = 0; r < this.attributes.length; r++)
            this._setAttr(this.attributes[r].name);
        new MutationObserver(r => {
            for (const i of r)
                this._setAttr(i.attributeName)
        }
        ).observe(this, {
            attributes: !0
        });
        const e = (r, i=!1) => {
            const {props: o, styles: s} = r;
            let a;
            if (o && !Rr(o))
                for (const l in o) {
                    const c = o[l];
                    (c === Number || c && c.type === Number) && (l in this._props && (this._props[l] = Oy(this._props[l])),
                    (a || (a = Object.create(null)))[Bm(l)] = !0)
                }
            this._numberProps = a,
            i && this._resolveProps(r),
            this._applyStyles(s),
            this._update()
        }
          , n = this._def.__asyncLoader;
        n ? n().then(r => e(r, !0)) : e(this._def)
    }
    _resolveProps(e) {
        const {props: n} = e
          , r = Rr(n) ? n : Object.keys(n || {});
        for (const i of Object.keys(this))
            i[0] !== "_" && r.includes(i) && this._setProp(i, this[i], !0, !1);
        for (const i of r.map(Bm))
            Object.defineProperty(this, i, {
                get() {
                    return this._getProp(i)
                },
                set(o) {
                    this._setProp(i, o)
                }
            })
    }
    _setAttr(e) {
        let n = this.getAttribute(e);
        const r = Bm(e);
        this._numberProps && this._numberProps[r] && (n = Oy(n)),
        this._setProp(r, n, !1)
    }
    _getProp(e) {
        return this._props[e]
    }
    _setProp(e, n, r=!0, i=!0) {
        n !== this._props[e] && (this._props[e] = n,
        i && this._instance && this._update(),
        r && (n === !0 ? this.setAttribute(Rs(e), "") : typeof n == "string" || typeof n == "number" ? this.setAttribute(Rs(e), n + "") : n || this.removeAttribute(Rs(e))))
    }
    _update() {
        By(this._createVNode(), this.shadowRoot)
    }
    _createVNode() {
        const e = R(this._def, $d({}, this._props));
        return this._instance || (e.ce = n => {
            this._instance = n,
            n.isCE = !0,
            n.ceReload = o => {
                this._styles && (this._styles.forEach(s => this.shadowRoot.removeChild(s)),
                this._styles.length = 0),
                this._applyStyles(o),
                this._instance = null,
                this._update()
            }
            ;
            const r = (o, s) => {
                this.dispatchEvent(new CustomEvent(o,{
                    detail: s
                }))
            }
            ;
            n.emit = (o, ...s) => {
                r(o, s),
                Rs(o) !== o && r(Rs(o), s)
            }
            ;
            let i = this;
            for (; i = i && (i.parentNode || i.host); )
                if (i instanceof xg) {
                    n.parent = i._instance,
                    n.provides = i._instance.provides;
                    break
                }
        }
        ),
        e
    }
    _applyStyles(e) {
        e && e.forEach(n => {
            const r = document.createElement("style");
            r.textContent = n,
            this.shadowRoot.appendChild(r),
            (this._styles || (this._styles = [])).push(r)
        }
        )
    }
}
function TU(t="$style") {
    {
        const e = yt();
        if (!e)
            return se("useCssModule must be called inside setup()"),
            Dm;
        const n = e.type.__cssModules;
        if (!n)
            return se("Current instance does not have CSS modules injected."),
            Dm;
        const r = n[t];
        return r || (se(`Current instance does not have CSS module named "${t}".`),
        Dm)
    }
}
function PU(t) {
    const e = yt();
    if (!e) {
        se("useCssVars is called without current active component instance.");
        return
    }
    const n = e.ut = (i=t(e.proxy)) => {
        Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(o => Dy(o, i))
    }
      , r = () => {
        const i = t(e.proxy);
        My(e.subTree, i),
        n(i)
    }
    ;
    b4(r),
    Ht( () => {
        const i = new MutationObserver(r);
        i.observe(e.subTree.el.parentNode, {
            childList: !0
        }),
        fs( () => i.disconnect())
    }
    )
}
function My(t, e) {
    if (t.shapeFlag & 128) {
        const n = t.suspense;
        t = n.activeBranch,
        n.pendingBranch && !n.isHydrating && n.effects.push( () => {
            My(n.activeBranch, e)
        }
        )
    }
    for (; t.component; )
        t = t.component.subTree;
    if (t.shapeFlag & 1 && t.el)
        Dy(t.el, e);
    else if (t.type === Ft)
        t.children.forEach(n => My(n, e));
    else if (t.type === zs) {
        let {el: n, anchor: r} = t;
        for (; n && (Dy(n, e),
        n !== r); )
            n = n.nextSibling
    }
}
function Dy(t, e) {
    if (t.nodeType === 1) {
        const n = t.style;
        for (const r in e)
            n.setProperty(`--${r}`, e[r])
    }
}
const ms = "transition"
  , Pu = "animation"
  , Gd = (t, {slots: e}) => Mn(S4, gO(t), e);
Gd.displayName = "Transition";
const pO = {
    name: String,
    type: String,
    css: {
        type: Boolean,
        default: !0
    },
    duration: [String, Number, Object],
    enterFromClass: String,
    enterActiveClass: String,
    enterToClass: String,
    appearFromClass: String,
    appearActiveClass: String,
    appearToClass: String,
    leaveFromClass: String,
    leaveActiveClass: String,
    leaveToClass: String
}
  , IU = Gd.props = $d({}, ub, pO)
  , _a = (t, e=[]) => {
    Rr(t) ? t.forEach(n => n(...e)) : t && t(...e)
}
  , aS = t => t ? Rr(t) ? t.some(e => e.length > 1) : t.length > 1 : !1;
function gO(t) {
    const e = {};
    for (const T in t)
        T in pO || (e[T] = t[T]);
    if (t.css === !1)
        return e;
    const {name: n="v", type: r, duration: i, enterFromClass: o=`${n}-enter-from`, enterActiveClass: s=`${n}-enter-active`, enterToClass: a=`${n}-enter-to`, appearFromClass: l=o, appearActiveClass: c=s, appearToClass: u=a, leaveFromClass: f=`${n}-leave-from`, leaveActiveClass: d=`${n}-leave-active`, leaveToClass: h=`${n}-leave-to`} = t
      , p = OU(i)
      , y = p && p[0]
      , v = p && p[1]
      , {onBeforeEnter: g, onEnter: m, onEnterCancelled: _, onLeave: x, onLeaveCancelled: b, onBeforeAppear: w=g, onAppear: E=m, onAppearCancelled: S=_} = e
      , P = (T, I, B) => {
        Cs(T, I ? u : a),
        Cs(T, I ? c : s),
        B && B()
    }
      , C = (T, I) => {
        T._isLeaving = !1,
        Cs(T, f),
        Cs(T, h),
        Cs(T, d),
        I && I()
    }
      , A = T => (I, B) => {
        const G = T ? E : m
          , N = () => P(I, T, B);
        _a(G, [I, N]),
        lS( () => {
            Cs(I, T ? l : o),
            Bo(I, T ? u : a),
            aS(G) || cS(I, r, y, N)
        }
        )
    }
    ;
    return $d(e, {
        onBeforeEnter(T) {
            _a(g, [T]),
            Bo(T, o),
            Bo(T, s)
        },
        onBeforeAppear(T) {
            _a(w, [T]),
            Bo(T, l),
            Bo(T, c)
        },
        onEnter: A(!1),
        onAppear: A(!0),
        onLeave(T, I) {
            T._isLeaving = !0;
            const B = () => C(T, I);
            Bo(T, f),
            vO(),
            Bo(T, d),
            lS( () => {
                T._isLeaving && (Cs(T, f),
                Bo(T, h),
                aS(x) || cS(T, r, v, B))
            }
            ),
            _a(x, [T, B])
        },
        onEnterCancelled(T) {
            P(T, !1),
            _a(_, [T])
        },
        onAppearCancelled(T) {
            P(T, !0),
            _a(S, [T])
        },
        onLeaveCancelled(T) {
            C(T),
            _a(b, [T])
        }
    })
}
function OU(t) {
    if (t == null)
        return null;
    if (Py(t))
        return [Fm(t.enter), Fm(t.leave)];
    {
        const e = Fm(t);
        return [e, e]
    }
}
function Fm(t) {
    const e = Oy(t);
    return Qx(e, "<transition> explicit duration"),
    e
}
function Bo(t, e) {
    e.split(/\s+/).forEach(n => n && t.classList.add(n)),
    (t._vtc || (t._vtc = new Set)).add(e)
}
function Cs(t, e) {
    e.split(/\s+/).forEach(r => r && t.classList.remove(r));
    const {_vtc: n} = t;
    n && (n.delete(e),
    n.size || (t._vtc = void 0))
}
function lS(t) {
    requestAnimationFrame( () => {
        requestAnimationFrame(t)
    }
    )
}
let RU = 0;
function cS(t, e, n, r) {
    const i = t._endId = ++RU
      , o = () => {
        i === t._endId && r()
    }
    ;
    if (n)
        return setTimeout(o, n);
    const {type: s, timeout: a, propCount: l} = mO(t, e);
    if (!s)
        return r();
    const c = s + "end";
    let u = 0;
    const f = () => {
        t.removeEventListener(c, d),
        o()
    }
      , d = h => {
        h.target === t && ++u >= l && f()
    }
    ;
    setTimeout( () => {
        u < l && f()
    }
    , a + 1),
    t.addEventListener(c, d)
}
function mO(t, e) {
    const n = window.getComputedStyle(t)
      , r = p => (n[p] || "").split(", ")
      , i = r(`${ms}Delay`)
      , o = r(`${ms}Duration`)
      , s = uS(i, o)
      , a = r(`${Pu}Delay`)
      , l = r(`${Pu}Duration`)
      , c = uS(a, l);
    let u = null
      , f = 0
      , d = 0;
    e === ms ? s > 0 && (u = ms,
    f = s,
    d = o.length) : e === Pu ? c > 0 && (u = Pu,
    f = c,
    d = l.length) : (f = Math.max(s, c),
    u = f > 0 ? s > c ? ms : Pu : null,
    d = u ? u === ms ? o.length : l.length : 0);
    const h = u === ms && /\b(transform|all)(,|$)/.test(r(`${ms}Property`).toString());
    return {
        type: u,
        timeout: f,
        propCount: d,
        hasTransform: h
    }
}
function uS(t, e) {
    for (; t.length < e.length; )
        t = t.concat(t);
    return Math.max(...e.map( (n, r) => fS(n) + fS(t[r])))
}
function fS(t) {
    return Number(t.slice(0, -1).replace(",", ".")) * 1e3
}
function vO() {
    return document.body.offsetHeight
}
const yO = new WeakMap
  , _O = new WeakMap
  , xO = {
    name: "TransitionGroup",
    props: $d({}, IU, {
        tag: String,
        moveClass: String
    }),
    setup(t, {slots: e}) {
        const n = yt()
          , r = cb();
        let i, o;
        return Rl( () => {
            if (!i.length)
                return;
            const s = t.moveClass || `${t.name || "v"}-move`;
            if (!FU(i[0].el, n.vnode.el, s))
                return;
            i.forEach(BU),
            i.forEach(kU);
            const a = i.filter(NU);
            vO(),
            a.forEach(l => {
                const c = l.el
                  , u = c.style;
                Bo(c, s),
                u.transform = u.webkitTransform = u.transitionDuration = "";
                const f = c._moveCb = d => {
                    d && d.target !== c || (!d || /transform$/.test(d.propertyName)) && (c.removeEventListener("transitionend", f),
                    c._moveCb = null,
                    Cs(c, s))
                }
                ;
                c.addEventListener("transitionend", f)
            }
            )
        }
        ),
        () => {
            const s = Le(t)
              , a = gO(s);
            let l = s.tag || Ft;
            i = o,
            o = e.default ? ug(e.default()) : [];
            for (let c = 0; c < o.length; c++) {
                const u = o[c];
                u.key != null ? ll(u, Nc(u, a, r, n)) : se("<TransitionGroup> children must be keyed.")
            }
            if (i)
                for (let c = 0; c < i.length; c++) {
                    const u = i[c];
                    ll(u, Nc(u, a, r, n)),
                    yO.set(u, u.el.getBoundingClientRect())
                }
            return R(l, null, o)
        }
    }
}
  , MU = t => delete t.mode;
xO.props;
const DU = xO;
function BU(t) {
    const e = t.el;
    e._moveCb && e._moveCb(),
    e._enterCb && e._enterCb()
}
function kU(t) {
    _O.set(t, t.el.getBoundingClientRect())
}
function NU(t) {
    const e = yO.get(t)
      , n = _O.get(t)
      , r = e.left - n.left
      , i = e.top - n.top;
    if (r || i) {
        const o = t.el.style;
        return o.transform = o.webkitTransform = `translate(${r}px,${i}px)`,
        o.transitionDuration = "0s",
        t
    }
}
function FU(t, e, n) {
    const r = t.cloneNode();
    t._vtc && t._vtc.forEach(s => {
        s.split(/\s+/).forEach(a => a && r.classList.remove(a))
    }
    ),
    n.split(/\s+/).forEach(s => s && r.classList.add(s)),
    r.style.display = "none";
    const i = e.nodeType === 1 ? e : e.parentNode;
    i.appendChild(r);
    const {hasTransform: o} = mO(r);
    return i.removeChild(r),
    o
}
const ta = t => {
    const e = t.props["onUpdate:modelValue"] || !1;
    return Rr(e) ? n => eU(e, n) : e
}
;
function LU(t) {
    t.target.composing = !0
}
function dS(t) {
    const e = t.target;
    e.composing && (e.composing = !1,
    e.dispatchEvent(new Event("input")))
}
const s0 = {
    created(t, {modifiers: {lazy: e, trim: n, number: r}}, i) {
        t._assign = ta(i);
        const o = r || i.props && i.props.type === "number";
        Go(t, e ? "change" : "input", s => {
            if (s.target.composing)
                return;
            let a = t.value;
            n && (a = a.trim()),
            o && (a = Iy(a)),
            t._assign(a)
        }
        ),
        n && Go(t, "change", () => {
            t.value = t.value.trim()
        }
        ),
        e || (Go(t, "compositionstart", LU),
        Go(t, "compositionend", dS),
        Go(t, "change", dS))
    },
    mounted(t, {value: e}) {
        t.value = e ?? ""
    },
    beforeUpdate(t, {value: e, modifiers: {lazy: n, trim: r, number: i}}, o) {
        if (t._assign = ta(o),
        t.composing || document.activeElement === t && t.type !== "range" && (n || r && t.value.trim() === e || (i || t.type === "number") && Iy(t.value) === e))
            return;
        const s = e ?? "";
        t.value !== s && (t.value = s)
    }
}
  , wb = {
    deep: !0,
    created(t, e, n) {
        t._assign = ta(n),
        Go(t, "change", () => {
            const r = t._modelValue
              , i = Lc(t)
              , o = t.checked
              , s = t._assign;
            if (Rr(r)) {
                const a = _g(r, i)
                  , l = a !== -1;
                if (o && !l)
                    s(r.concat(i));
                else if (!o && l) {
                    const c = [...r];
                    c.splice(a, 1),
                    s(c)
                }
            } else if (Ud(r)) {
                const a = new Set(r);
                o ? a.add(i) : a.delete(i),
                s(a)
            } else
                s(wO(t, o))
        }
        )
    },
    mounted: hS,
    beforeUpdate(t, e, n) {
        t._assign = ta(n),
        hS(t, e, n)
    }
};
function hS(t, {value: e, oldValue: n}, r) {
    t._modelValue = e,
    Rr(e) ? t.checked = _g(e, r.props.value) > -1 : Ud(e) ? t.checked = e.has(r.props.value) : e !== n && (t.checked = ea(e, wO(t, !0)))
}
const Eb = {
    created(t, {value: e}, n) {
        t.checked = ea(e, n.props.value),
        t._assign = ta(n),
        Go(t, "change", () => {
            t._assign(Lc(t))
        }
        )
    },
    beforeUpdate(t, {value: e, oldValue: n}, r) {
        t._assign = ta(r),
        e !== n && (t.checked = ea(e, r.props.value))
    }
}
  , bO = {
    deep: !0,
    created(t, {value: e, modifiers: {number: n}}, r) {
        const i = Ud(e);
        Go(t, "change", () => {
            const o = Array.prototype.filter.call(t.options, s => s.selected).map(s => n ? Iy(Lc(s)) : Lc(s));
            t._assign(t.multiple ? i ? new Set(o) : o : o[0])
        }
        ),
        t._assign = ta(r)
    },
    mounted(t, {value: e}) {
        pS(t, e)
    },
    beforeUpdate(t, e, n) {
        t._assign = ta(n)
    },
    updated(t, {value: e}) {
        pS(t, e)
    }
};
function pS(t, e) {
    const n = t.multiple;
    if (n && !Rr(e) && !Ud(e)) {
        se(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(e).slice(8, -1)}.`);
        return
    }
    for (let r = 0, i = t.options.length; r < i; r++) {
        const o = t.options[r]
          , s = Lc(o);
        if (n)
            Rr(e) ? o.selected = _g(e, s) > -1 : o.selected = e.has(s);
        else if (ea(Lc(o), e)) {
            t.selectedIndex !== r && (t.selectedIndex = r);
            return
        }
    }
    !n && t.selectedIndex !== -1 && (t.selectedIndex = -1)
}
function Lc(t) {
    return "_value"in t ? t._value : t.value
}
function wO(t, e) {
    const n = e ? "_trueValue" : "_falseValue";
    return n in t ? t[n] : e
}
const EO = {
    created(t, e, n) {
        Ch(t, e, n, null, "created")
    },
    mounted(t, e, n) {
        Ch(t, e, n, null, "mounted")
    },
    beforeUpdate(t, e, n, r) {
        Ch(t, e, n, r, "beforeUpdate")
    },
    updated(t, e, n, r) {
        Ch(t, e, n, r, "updated")
    }
};
function SO(t, e) {
    switch (t) {
    case "SELECT":
        return bO;
    case "TEXTAREA":
        return s0;
    default:
        switch (e) {
        case "checkbox":
            return wb;
        case "radio":
            return Eb;
        default:
            return s0
        }
    }
}
function Ch(t, e, n, r, i) {
    const s = SO(t.tagName, n.props && n.props.type)[i];
    s && s(t, e, n, r)
}
function $U() {
    s0.getSSRProps = ({value: t}) => ({
        value: t
    }),
    Eb.getSSRProps = ({value: t}, e) => {
        if (e.props && ea(e.props.value, t))
            return {
                checked: !0
            }
    }
    ,
    wb.getSSRProps = ({value: t}, e) => {
        if (Rr(t)) {
            if (e.props && _g(t, e.props.value) > -1)
                return {
                    checked: !0
                }
        } else if (Ud(t)) {
            if (e.props && t.has(e.props.value))
                return {
                    checked: !0
                }
        } else if (t)
            return {
                checked: !0
            }
    }
    ,
    EO.getSSRProps = (t, e) => {
        if (typeof e.type != "string")
            return;
        const n = SO(e.type.toUpperCase(), e.props && e.props.type);
        if (n.getSSRProps)
            return n.getSSRProps(t, e)
    }
}
const UU = ["ctrl", "shift", "alt", "meta"]
  , GU = {
    stop: t => t.stopPropagation(),
    prevent: t => t.preventDefault(),
    self: t => t.target !== t.currentTarget,
    ctrl: t => !t.ctrlKey,
    shift: t => !t.shiftKey,
    alt: t => !t.altKey,
    meta: t => !t.metaKey,
    left: t => "button"in t && t.button !== 0,
    middle: t => "button"in t && t.button !== 1,
    right: t => "button"in t && t.button !== 2,
    exact: (t, e) => UU.some(n => t[`${n}Key`] && !e.includes(n))
}
  , HU = (t, e) => (n, ...r) => {
    for (let i = 0; i < e.length; i++) {
        const o = GU[e[i]];
        if (o && o(n, e))
            return
    }
    return t(n, ...r)
}
  , VU = {
    esc: "escape",
    space: " ",
    up: "arrow-up",
    left: "arrow-left",
    right: "arrow-right",
    down: "arrow-down",
    delete: "backspace"
}
  , CO = (t, e) => n => {
    if (!("key"in n))
        return;
    const r = Rs(n.key);
    if (e.some(i => i === r || VU[i] === r))
        return t(n)
}
  , pi = {
    beforeMount(t, {value: e}, {transition: n}) {
        t._vod = t.style.display === "none" ? "" : t.style.display,
        n && e ? n.beforeEnter(t) : Iu(t, e)
    },
    mounted(t, {value: e}, {transition: n}) {
        n && e && n.enter(t)
    },
    updated(t, {value: e, oldValue: n}, {transition: r}) {
        !e != !n && (r ? e ? (r.beforeEnter(t),
        Iu(t, !0),
        r.enter(t)) : r.leave(t, () => {
            Iu(t, !1)
        }
        ) : Iu(t, e))
    },
    beforeUnmount(t, {value: e}) {
        Iu(t, e)
    }
};
function Iu(t, e) {
    t.style.display = e ? t._vod : "none"
}
function zU() {
    pi.getSSRProps = ({value: t}) => {
        if (!t)
            return {
                style: {
                    display: "none"
                }
            }
    }
}
const AO = $d({
    patchProp: EU
}, cU);
let _f, gS = !1;
function TO() {
    return _f || (_f = j4(AO))
}
function PO() {
    return _f = gS ? _f : W4(AO),
    gS = !0,
    _f
}
const By = (...t) => {
    TO().render(...t)
}
  , IO = (...t) => {
    PO().hydrate(...t)
}
  , OO = (...t) => {
    const e = TO().createApp(...t);
    RO(e),
    MO(e);
    const {mount: n} = e;
    return e.mount = r => {
        const i = DO(r);
        if (!i)
            return;
        const o = e._component;
        !uO(o) && !o.render && !o.template && (o.template = i.innerHTML),
        i.innerHTML = "";
        const s = n(i, !1, i instanceof SVGElement);
        return i instanceof Element && (i.removeAttribute("v-cloak"),
        i.setAttribute("data-v-app", "")),
        s
    }
    ,
    e
}
  , jU = (...t) => {
    const e = PO().createApp(...t);
    RO(e),
    MO(e);
    const {mount: n} = e;
    return e.mount = r => {
        const i = DO(r);
        if (i)
            return n(i, !0, i instanceof SVGElement)
    }
    ,
    e
}
;
function RO(t) {
    Object.defineProperty(t.config, "isNativeTag", {
        value: e => rU(e) || iU(e),
        writable: !1
    })
}
function MO(t) {
    if (_b()) {
        const e = t.config.isCustomElement;
        Object.defineProperty(t.config, "isCustomElement", {
            get() {
                return e
            },
            set() {
                se("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")
            }
        });
        const n = t.config.compilerOptions
          , r = 'The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';
        Object.defineProperty(t.config, "compilerOptions", {
            get() {
                return se(r),
                n
            },
            set() {
                se(r)
            }
        })
    }
}
function DO(t) {
    if (Zf(t)) {
        const e = document.querySelector(t);
        return e || se(`Failed to mount app: mount target selector "${t}" returned null.`),
        e
    }
    return window.ShadowRoot && t instanceof window.ShadowRoot && t.mode === "closed" && se('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),
    t
}
let mS = !1;
const WU = () => {
    mS || (mS = !0,
    $U(),
    zU())
}
;
function YU() {
    lO()
}
YU();
const XU = () => {
    se('Runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".')
}
  , KU = Object.freeze(Object.defineProperty({
    __proto__: null,
    BaseTransition: S4,
    BaseTransitionPropsValidators: ub,
    Comment: en,
    EffectScope: jx,
    Fragment: Ft,
    KeepAlive: I7,
    ReactiveEffect: Od,
    Static: zs,
    Suspense: y7,
    Teleport: hg,
    Text: fo,
    Transition: Gd,
    TransitionGroup: DU,
    VueElement: xg,
    assertNumber: Qx,
    callWithAsyncErrorHandling: Hr,
    callWithErrorHandling: so,
    camelize: Fi,
    capitalize: kc,
    cloneVNode: vi,
    compatUtils: W$,
    compile: XU,
    computed: re,
    createApp: OO,
    createBlock: gb,
    createCommentVNode: M$,
    createElementBlock: T$,
    createElementVNode: mb,
    createHydrationRenderer: W4,
    createPropsRestProxy: e$,
    createRenderer: j4,
    createSSRApp: jU,
    createSlots: k7,
    createStaticVNode: R$,
    createTextVNode: mg,
    createVNode: R,
    customRef: r4,
    defineAsyncComponent: T7,
    defineComponent: we,
    defineCustomElement: hO,
    defineEmits: V7,
    defineExpose: z7,
    defineModel: Y7,
    defineOptions: j7,
    defineProps: H7,
    defineSSRCustomElement: CU,
    defineSlots: W7,
    get devtools() {
        return Ci
    },
    effect: VF,
    effectScope: Pd,
    getCurrentInstance: yt,
    getCurrentScope: Id,
    getTransitionRawChildren: ug,
    guardReactiveProps: J4,
    h: Mn,
    handleError: Ol,
    hasInjectionContext: L4,
    hydrate: IO,
    initCustomFormatter: lO,
    initDirectivesForSSR: WU,
    inject: dn,
    isMemoSame: cO,
    isProxy: Hf,
    isReactive: Bi,
    isReadonly: ts,
    isRef: pt,
    isRuntimeOnly: _b,
    isShallow: Gf,
    isVNode: ho,
    markRaw: ro,
    mergeDefaults: J7,
    mergeModels: Q7,
    mergeProps: st,
    nextTick: Xe,
    normalizeClass: kd,
    normalizeProps: GL,
    normalizeStyle: Bd,
    onActivated: cs,
    onBeforeMount: T4,
    onBeforeUnmount: qr,
    onBeforeUpdate: dg,
    onDeactivated: bo,
    onErrorCaptured: R4,
    onMounted: Ht,
    onRenderTracked: O4,
    onRenderTriggered: I4,
    onScopeDispose: Wx,
    onServerPrefetch: P4,
    onUnmounted: fs,
    onUpdated: Rl,
    openBlock: pg,
    popScopeId: f7,
    provide: hi,
    proxyRefs: Zx,
    pushScopeId: u7,
    queuePostFlushCb: ag,
    reactive: Mt,
    readonly: Il,
    ref: Z,
    registerRuntimeCompiler: F$,
    render: By,
    renderList: B7,
    renderSlot: N7,
    resolveComponent: M7,
    resolveDirective: D4,
    resolveDynamicComponent: D7,
    resolveFilter: j$,
    resolveTransitionHooks: Nc,
    setBlockTracking: wy,
    setDevtoolsHook: rb,
    setTransitionHooks: ll,
    shallowReactive: t4,
    shallowReadonly: gc,
    shallowRef: ig,
    ssrContextKey: sO,
    ssrUtils: z$,
    stop: zF,
    toDisplayString: HL,
    toHandlerKey: Lo,
    toHandlers: F7,
    toRaw: Le,
    toRef: ff,
    toRefs: ly,
    toValue: _L,
    transformVNodeArgs: P$,
    triggerRef: yL,
    unref: dr,
    useAttrs: q7,
    useCssModule: TU,
    useCssVars: PU,
    useModel: Z7,
    useSSRContext: aO,
    useSlots: K7,
    useTransitionState: cb,
    vModelCheckbox: wb,
    vModelDynamic: EO,
    vModelRadio: Eb,
    vModelSelect: bO,
    vModelText: s0,
    vShow: pi,
    version: Ty,
    warn: se,
    watch: ve,
    watchEffect: fu,
    watchPostEffect: b4,
    watchSyncEffect: S7,
    withAsyncContext: t$,
    withCtx: ob,
    withDefaults: X7,
    withDirectives: di,
    withKeys: CO,
    withMemo: H$,
    withModifiers: HU,
    withScopeId: d7
}, Symbol.toStringTag, {
    value: "Module"
}));
var qU = !1;
function Ah(t, e, n) {
    return Array.isArray(t) ? (t.length = Math.max(t.length, e),
    t.splice(e, 1, n),
    n) : (t[e] = n,
    n)
}
function Lm(t, e) {
    if (Array.isArray(t)) {
        t.splice(e, 1);
        return
    }
    delete t[e]
}
function ZU() {
    return BO().__VUE_DEVTOOLS_GLOBAL_HOOK__
}
function BO() {
    return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {}
}
const JU = typeof Proxy == "function"
  , QU = "devtools-plugin:setup"
  , eG = "plugin:settings:set";
let Hl, ky;
function tG() {
    var t;
    return Hl !== void 0 || (typeof window < "u" && window.performance ? (Hl = !0,
    ky = window.performance) : typeof globalThis < "u" && (!((t = globalThis.perf_hooks) === null || t === void 0) && t.performance) ? (Hl = !0,
    ky = globalThis.perf_hooks.performance) : Hl = !1),
    Hl
}
function nG() {
    return tG() ? ky.now() : Date.now()
}
class rG {
    constructor(e, n) {
        this.target = null,
        this.targetQueue = [],
        this.onQueue = [],
        this.plugin = e,
        this.hook = n;
        const r = {};
        if (e.settings)
            for (const s in e.settings) {
                const a = e.settings[s];
                r[s] = a.defaultValue
            }
        const i = `__vue-devtools-plugin-settings__${e.id}`;
        let o = Object.assign({}, r);
        try {
            const s = localStorage.getItem(i)
              , a = JSON.parse(s);
            Object.assign(o, a)
        } catch {}
        this.fallbacks = {
            getSettings() {
                return o
            },
            setSettings(s) {
                try {
                    localStorage.setItem(i, JSON.stringify(s))
                } catch {}
                o = s
            },
            now() {
                return nG()
            }
        },
        n && n.on(eG, (s, a) => {
            s === this.plugin.id && this.fallbacks.setSettings(a)
        }
        ),
        this.proxiedOn = new Proxy({},{
            get: (s, a) => this.target ? this.target.on[a] : (...l) => {
                this.onQueue.push({
                    method: a,
                    args: l
                })
            }
        }),
        this.proxiedTarget = new Proxy({},{
            get: (s, a) => this.target ? this.target[a] : a === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(a) ? (...l) => (this.targetQueue.push({
                method: a,
                args: l,
                resolve: () => {}
            }),
            this.fallbacks[a](...l)) : (...l) => new Promise(c => {
                this.targetQueue.push({
                    method: a,
                    args: l,
                    resolve: c
                })
            }
            )
        })
    }
    async setRealTarget(e) {
        this.target = e;
        for (const n of this.onQueue)
            this.target.on[n.method](...n.args);
        for (const n of this.targetQueue)
            n.resolve(await this.target[n.method](...n.args))
    }
}
function bg(t, e) {
    const n = t
      , r = BO()
      , i = ZU()
      , o = JU && n.enableEarlyProxy;
    if (i && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !o))
        i.emit(QU, t, e);
    else {
        const s = o ? new rG(n,i) : null;
        (r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
            pluginDescriptor: n,
            setupFn: e,
            proxy: s
        }),
        s && e(s.proxiedTarget)
    }
}
/*!
 * pinia v2.3.1
 * (c) 2025 Eduardo San Martin Morote
 * @license MIT
 */
let Ny;
const Jf = t => Ny = t
  , kO = Symbol("pinia");
function ul(t) {
    return t && typeof t == "object" && Object.prototype.toString.call(t) === "[object Object]" && typeof t.toJSON != "function"
}
var ao;
(function(t) {
    t.direct = "direct",
    t.patchObject = "patch object",
    t.patchFunction = "patch function"
}
)(ao || (ao = {}));
const el = typeof window < "u"
  , vS = ( () => typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof global == "object" && global.global === global ? global : typeof globalThis == "object" ? globalThis : {
    HTMLElement: null
})();
function iG(t, {autoBom: e=!1}={}) {
    return e && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type) ? new Blob([String.fromCharCode(65279), t],{
        type: t.type
    }) : t
}
function Sb(t, e, n) {
    const r = new XMLHttpRequest;
    r.open("GET", t),
    r.responseType = "blob",
    r.onload = function() {
        LO(r.response, e, n)
    }
    ,
    r.onerror = function() {
        console.error("could not download file")
    }
    ,
    r.send()
}
function NO(t) {
    const e = new XMLHttpRequest;
    e.open("HEAD", t, !1);
    try {
        e.send()
    } catch {}
    return e.status >= 200 && e.status <= 299
}
function Cp(t) {
    try {
        t.dispatchEvent(new MouseEvent("click"))
    } catch {
        const n = document.createEvent("MouseEvents");
        n.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null),
        t.dispatchEvent(n)
    }
}
const Ap = typeof navigator == "object" ? navigator : {
    userAgent: ""
}
  , FO = ( () => /Macintosh/.test(Ap.userAgent) && /AppleWebKit/.test(Ap.userAgent) && !/Safari/.test(Ap.userAgent))()
  , LO = el ? typeof HTMLAnchorElement < "u" && "download"in HTMLAnchorElement.prototype && !FO ? oG : "msSaveOrOpenBlob"in Ap ? sG : aG : () => {}
;
function oG(t, e="download", n) {
    const r = document.createElement("a");
    r.download = e,
    r.rel = "noopener",
    typeof t == "string" ? (r.href = t,
    r.origin !== location.origin ? NO(r.href) ? Sb(t, e, n) : (r.target = "_blank",
    Cp(r)) : Cp(r)) : (r.href = URL.createObjectURL(t),
    setTimeout(function() {
        URL.revokeObjectURL(r.href)
    }, 4e4),
    setTimeout(function() {
        Cp(r)
    }, 0))
}
function sG(t, e="download", n) {
    if (typeof t == "string")
        if (NO(t))
            Sb(t, e, n);
        else {
            const r = document.createElement("a");
            r.href = t,
            r.target = "_blank",
            setTimeout(function() {
                Cp(r)
            })
        }
    else
        navigator.msSaveOrOpenBlob(iG(t, n), e)
}
function aG(t, e, n, r) {
    if (r = r || open("", "_blank"),
    r && (r.document.title = r.document.body.innerText = "downloading..."),
    typeof t == "string")
        return Sb(t, e, n);
    const i = t.type === "application/octet-stream"
      , o = /constructor/i.test(String(vS.HTMLElement)) || "safari"in vS
      , s = /CriOS\/[\d]+/.test(navigator.userAgent);
    if ((s || i && o || FO) && typeof FileReader < "u") {
        const a = new FileReader;
        a.onloadend = function() {
            let l = a.result;
            if (typeof l != "string")
                throw r = null,
                new Error("Wrong reader.result type");
            l = s ? l : l.replace(/^data:[^;]*;/, "data:attachment/file;"),
            r ? r.location.href = l : location.assign(l),
            r = null
        }
        ,
        a.readAsDataURL(t)
    } else {
        const a = URL.createObjectURL(t);
        r ? r.location.assign(a) : location.href = a,
        r = null,
        setTimeout(function() {
            URL.revokeObjectURL(a)
        }, 4e4)
    }
}
function Rn(t, e) {
    const n = "🍍 " + t;
    typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(n, e) : e === "error" ? console.error(n) : e === "warn" ? console.warn(n) : console.log(n)
}
function Cb(t) {
    return "_a"in t && "install"in t
}
function $O() {
    if (!("clipboard"in navigator))
        return Rn("Your browser doesn't support the Clipboard API", "error"),
        !0
}
function UO(t) {
    return t instanceof Error && t.message.toLowerCase().includes("document is not focused") ? (Rn('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn"),
    !0) : !1
}
async function lG(t) {
    if (!$O())
        try {
            await navigator.clipboard.writeText(JSON.stringify(t.state.value)),
            Rn("Global state copied to clipboard.")
        } catch (e) {
            if (UO(e))
                return;
            Rn("Failed to serialize the state. Check the console for more details.", "error"),
            console.error(e)
        }
}
async function cG(t) {
    if (!$O())
        try {
            GO(t, JSON.parse(await navigator.clipboard.readText())),
            Rn("Global state pasted from clipboard.")
        } catch (e) {
            if (UO(e))
                return;
            Rn("Failed to deserialize the state from clipboard. Check the console for more details.", "error"),
            console.error(e)
        }
}
async function uG(t) {
    try {
        LO(new Blob([JSON.stringify(t.state.value)],{
            type: "text/plain;charset=utf-8"
        }), "pinia-state.json")
    } catch (e) {
        Rn("Failed to export the state as JSON. Check the console for more details.", "error"),
        console.error(e)
    }
}
let Ao;
function fG() {
    Ao || (Ao = document.createElement("input"),
    Ao.type = "file",
    Ao.accept = ".json");
    function t() {
        return new Promise( (e, n) => {
            Ao.onchange = async () => {
                const r = Ao.files;
                if (!r)
                    return e(null);
                const i = r.item(0);
                return e(i ? {
                    text: await i.text(),
                    file: i
                } : null)
            }
            ,
            Ao.oncancel = () => e(null),
            Ao.onerror = n,
            Ao.click()
        }
        )
    }
    return t
}
async function dG(t) {
    try {
        const n = await fG()();
        if (!n)
            return;
        const {text: r, file: i} = n;
        GO(t, JSON.parse(r)),
        Rn(`Global state imported from "${i.name}".`)
    } catch (e) {
        Rn("Failed to import the state from JSON. Check the console for more details.", "error"),
        console.error(e)
    }
}
function GO(t, e) {
    for (const n in e) {
        const r = t.state.value[n];
        r ? Object.assign(r, e[n]) : t.state.value[n] = e[n]
    }
}
function Si(t) {
    return {
        _custom: {
            display: t
        }
    }
}
const HO = "🍍 Pinia (root)"
  , Tp = "_root";
function hG(t) {
    return Cb(t) ? {
        id: Tp,
        label: HO
    } : {
        id: t.$id,
        label: t.$id
    }
}
function pG(t) {
    if (Cb(t)) {
        const n = Array.from(t._s.keys())
          , r = t._s;
        return {
            state: n.map(o => ({
                editable: !0,
                key: o,
                value: t.state.value[o]
            })),
            getters: n.filter(o => r.get(o)._getters).map(o => {
                const s = r.get(o);
                return {
                    editable: !1,
                    key: o,
                    value: s._getters.reduce( (a, l) => (a[l] = s[l],
                    a), {})
                }
            }
            )
        }
    }
    const e = {
        state: Object.keys(t.$state).map(n => ({
            editable: !0,
            key: n,
            value: t.$state[n]
        }))
    };
    return t._getters && t._getters.length && (e.getters = t._getters.map(n => ({
        editable: !1,
        key: n,
        value: t[n]
    }))),
    t._customProperties.size && (e.customProperties = Array.from(t._customProperties).map(n => ({
        editable: !0,
        key: n,
        value: t[n]
    }))),
    e
}
function gG(t) {
    return t ? Array.isArray(t) ? t.reduce( (e, n) => (e.keys.push(n.key),
    e.operations.push(n.type),
    e.oldValue[n.key] = n.oldValue,
    e.newValue[n.key] = n.newValue,
    e), {
        oldValue: {},
        keys: [],
        operations: [],
        newValue: {}
    }) : {
        operation: Si(t.type),
        key: Si(t.key),
        oldValue: t.oldValue,
        newValue: t.newValue
    } : {}
}
function mG(t) {
    switch (t) {
    case ao.direct:
        return "mutation";
    case ao.patchFunction:
        return "$patch";
    case ao.patchObject:
        return "$patch";
    default:
        return "unknown"
    }
}
let mc = !0;
const Pp = []
  , Pa = "pinia:mutations"
  , Yn = "pinia"
  , {assign: vG} = Object
  , a0 = t => "🍍 " + t;
function yG(t, e) {
    bg({
        id: "dev.esm.pinia",
        label: "Pinia 🍍",
        logo: "https://pinia.vuejs.org/logo.svg",
        packageName: "pinia",
        homepage: "https://pinia.vuejs.org",
        componentStateTypes: Pp,
        app: t
    }, n => {
        typeof n.now != "function" && Rn("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),
        n.addTimelineLayer({
            id: Pa,
            label: "Pinia 🍍",
            color: 15064968
        }),
        n.addInspector({
            id: Yn,
            label: "Pinia 🍍",
            icon: "storage",
            treeFilterPlaceholder: "Search stores",
            actions: [{
                icon: "content_copy",
                action: () => {
                    lG(e)
                }
                ,
                tooltip: "Serialize and copy the state"
            }, {
                icon: "content_paste",
                action: async () => {
                    await cG(e),
                    n.sendInspectorTree(Yn),
                    n.sendInspectorState(Yn)
                }
                ,
                tooltip: "Replace the state with the content of your clipboard"
            }, {
                icon: "save",
                action: () => {
                    uG(e)
                }
                ,
                tooltip: "Save the state as a JSON file"
            }, {
                icon: "folder_open",
                action: async () => {
                    await dG(e),
                    n.sendInspectorTree(Yn),
                    n.sendInspectorState(Yn)
                }
                ,
                tooltip: "Import the state from a JSON file"
            }],
            nodeActions: [{
                icon: "restore",
                tooltip: 'Reset the state (with "$reset")',
                action: r => {
                    const i = e._s.get(r);
                    i ? typeof i.$reset != "function" ? Rn(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`, "warn") : (i.$reset(),
                    Rn(`Store "${r}" reset.`)) : Rn(`Cannot reset "${r}" store because it wasn't found.`, "warn")
                }
            }]
        }),
        n.on.inspectComponent( (r, i) => {
            const o = r.componentInstance && r.componentInstance.proxy;
            if (o && o._pStores) {
                const s = r.componentInstance.proxy._pStores;
                Object.values(s).forEach(a => {
                    r.instanceData.state.push({
                        type: a0(a.$id),
                        key: "state",
                        editable: !0,
                        value: a._isOptionsAPI ? {
                            _custom: {
                                value: Le(a.$state),
                                actions: [{
                                    icon: "restore",
                                    tooltip: "Reset the state of this store",
                                    action: () => a.$reset()
                                }]
                            }
                        } : Object.keys(a.$state).reduce( (l, c) => (l[c] = a.$state[c],
                        l), {})
                    }),
                    a._getters && a._getters.length && r.instanceData.state.push({
                        type: a0(a.$id),
                        key: "getters",
                        editable: !1,
                        value: a._getters.reduce( (l, c) => {
                            try {
                                l[c] = a[c]
                            } catch (u) {
                                l[c] = u
                            }
                            return l
                        }
                        , {})
                    })
                }
                )
            }
        }
        ),
        n.on.getInspectorTree(r => {
            if (r.app === t && r.inspectorId === Yn) {
                let i = [e];
                i = i.concat(Array.from(e._s.values())),
                r.rootNodes = (r.filter ? i.filter(o => "$id"in o ? o.$id.toLowerCase().includes(r.filter.toLowerCase()) : HO.toLowerCase().includes(r.filter.toLowerCase())) : i).map(hG)
            }
        }
        ),
        globalThis.$pinia = e,
        n.on.getInspectorState(r => {
            if (r.app === t && r.inspectorId === Yn) {
                const i = r.nodeId === Tp ? e : e._s.get(r.nodeId);
                if (!i)
                    return;
                i && (r.nodeId !== Tp && (globalThis.$store = Le(i)),
                r.state = pG(i))
            }
        }
        ),
        n.on.editInspectorState( (r, i) => {
            if (r.app === t && r.inspectorId === Yn) {
                const o = r.nodeId === Tp ? e : e._s.get(r.nodeId);
                if (!o)
                    return Rn(`store "${r.nodeId}" not found`, "error");
                const {path: s} = r;
                Cb(o) ? s.unshift("state") : (s.length !== 1 || !o._customProperties.has(s[0]) || s[0]in o.$state) && s.unshift("$state"),
                mc = !1,
                r.set(o, s, r.state.value),
                mc = !0
            }
        }
        ),
        n.on.editComponentState(r => {
            if (r.type.startsWith("🍍")) {
                const i = r.type.replace(/^🍍\s*/, "")
                  , o = e._s.get(i);
                if (!o)
                    return Rn(`store "${i}" not found`, "error");
                const {path: s} = r;
                if (s[0] !== "state")
                    return Rn(`Invalid path for store "${i}":
${s}
Only state can be modified.`);
                s[0] = "$state",
                mc = !1,
                r.set(o, s, r.state.value),
                mc = !0
            }
        }
        )
    }
    )
}
function _G(t, e) {
    Pp.includes(a0(e.$id)) || Pp.push(a0(e.$id)),
    bg({
        id: "dev.esm.pinia",
        label: "Pinia 🍍",
        logo: "https://pinia.vuejs.org/logo.svg",
        packageName: "pinia",
        homepage: "https://pinia.vuejs.org",
        componentStateTypes: Pp,
        app: t,
        settings: {
            logStoreChanges: {
                label: "Notify about new/deleted stores",
                type: "boolean",
                defaultValue: !0
            }
        }
    }, n => {
        const r = typeof n.now == "function" ? n.now.bind(n) : Date.now;
        e.$onAction( ({after: s, onError: a, name: l, args: c}) => {
            const u = VO++;
            n.addTimelineEvent({
                layerId: Pa,
                event: {
                    time: r(),
                    title: "🛫 " + l,
                    subtitle: "start",
                    data: {
                        store: Si(e.$id),
                        action: Si(l),
                        args: c
                    },
                    groupId: u
                }
            }),
            s(f => {
                Bs = void 0,
                n.addTimelineEvent({
                    layerId: Pa,
                    event: {
                        time: r(),
                        title: "🛬 " + l,
                        subtitle: "end",
                        data: {
                            store: Si(e.$id),
                            action: Si(l),
                            args: c,
                            result: f
                        },
                        groupId: u
                    }
                })
            }
            ),
            a(f => {
                Bs = void 0,
                n.addTimelineEvent({
                    layerId: Pa,
                    event: {
                        time: r(),
                        logType: "error",
                        title: "💥 " + l,
                        subtitle: "end",
                        data: {
                            store: Si(e.$id),
                            action: Si(l),
                            args: c,
                            error: f
                        },
                        groupId: u
                    }
                })
            }
            )
        }
        , !0),
        e._customProperties.forEach(s => {
            ve( () => dr(e[s]), (a, l) => {
                n.notifyComponentUpdate(),
                n.sendInspectorState(Yn),
                mc && n.addTimelineEvent({
                    layerId: Pa,
                    event: {
                        time: r(),
                        title: "Change",
                        subtitle: s,
                        data: {
                            newValue: a,
                            oldValue: l
                        },
                        groupId: Bs
                    }
                })
            }
            , {
                deep: !0
            })
        }
        ),
        e.$subscribe( ({events: s, type: a}, l) => {
            if (n.notifyComponentUpdate(),
            n.sendInspectorState(Yn),
            !mc)
                return;
            const c = {
                time: r(),
                title: mG(a),
                data: vG({
                    store: Si(e.$id)
                }, gG(s)),
                groupId: Bs
            };
            a === ao.patchFunction ? c.subtitle = "⤵️" : a === ao.patchObject ? c.subtitle = "🧩" : s && !Array.isArray(s) && (c.subtitle = s.type),
            s && (c.data["rawEvent(s)"] = {
                _custom: {
                    display: "DebuggerEvent",
                    type: "object",
                    tooltip: "raw DebuggerEvent[]",
                    value: s
                }
            }),
            n.addTimelineEvent({
                layerId: Pa,
                event: c
            })
        }
        , {
            detached: !0,
            flush: "sync"
        });
        const i = e._hotUpdate;
        e._hotUpdate = ro(s => {
            i(s),
            n.addTimelineEvent({
                layerId: Pa,
                event: {
                    time: r(),
                    title: "🔥 " + e.$id,
                    subtitle: "HMR update",
                    data: {
                        store: Si(e.$id),
                        info: Si("HMR update")
                    }
                }
            }),
            n.notifyComponentUpdate(),
            n.sendInspectorTree(Yn),
            n.sendInspectorState(Yn)
        }
        );
        const {$dispose: o} = e;
        e.$dispose = () => {
            o(),
            n.notifyComponentUpdate(),
            n.sendInspectorTree(Yn),
            n.sendInspectorState(Yn),
            n.getSettings().logStoreChanges && Rn(`Disposed "${e.$id}" store 🗑`)
        }
        ,
        n.notifyComponentUpdate(),
        n.sendInspectorTree(Yn),
        n.sendInspectorState(Yn),
        n.getSettings().logStoreChanges && Rn(`"${e.$id}" store installed 🆕`)
    }
    )
}
let VO = 0, Bs;
function yS(t, e, n) {
    const r = e.reduce( (i, o) => (i[o] = Le(t)[o],
    i), {});
    for (const i in r)
        t[i] = function() {
            const o = VO
              , s = n ? new Proxy(t,{
                get(...l) {
                    return Bs = o,
                    Reflect.get(...l)
                },
                set(...l) {
                    return Bs = o,
                    Reflect.set(...l)
                }
            }) : t;
            Bs = o;
            const a = r[i].apply(s, arguments);
            return Bs = void 0,
            a
        }
}
function xG({app: t, store: e, options: n}) {
    if (!e.$id.startsWith("__hot:")) {
        if (e._isOptionsAPI = !!n.state,
        !e._p._testing) {
            yS(e, Object.keys(n.actions), e._isOptionsAPI);
            const r = e._hotUpdate;
            Le(e)._hotUpdate = function(i) {
                r.apply(this, arguments),
                yS(e, Object.keys(i._hmrPayload.actions), !!e._isOptionsAPI)
            }
        }
        _G(t, e)
    }
}
function jTe() {
    const t = Pd(!0)
      , e = t.run( () => Z({}));
    let n = []
      , r = [];
    const i = ro({
        install(o) {
            Jf(i),
            i._a = o,
            o.provide(kO, i),
            o.config.globalProperties.$pinia = i,
            el && yG(o, i),
            r.forEach(s => n.push(s)),
            r = []
        },
        use(o) {
            return !this._a && !qU ? r.push(o) : n.push(o),
            this
        },
        _p: n,
        _a: null,
        _e: t,
        _s: new Map,
        state: e
    });
    return el && typeof Proxy < "u" && i.use(xG),
    i
}
function zO(t, e) {
    for (const n in e) {
        const r = e[n];
        if (!(n in t))
            continue;
        const i = t[n];
        ul(i) && ul(r) && !pt(r) && !Bi(r) ? t[n] = zO(i, r) : t[n] = r
    }
    return t
}
const bG = () => {}
;
function _S(t, e, n, r=bG) {
    t.push(e);
    const i = () => {
        const o = t.indexOf(e);
        o > -1 && (t.splice(o, 1),
        r())
    }
    ;
    return !n && Id() && Wx(i),
    i
}
function Vl(t, ...e) {
    t.slice().forEach(n => {
        n(...e)
    }
    )
}
const wG = t => t()
  , xS = Symbol()
  , $m = Symbol();
function Fy(t, e) {
    t instanceof Map && e instanceof Map ? e.forEach( (n, r) => t.set(r, n)) : t instanceof Set && e instanceof Set && e.forEach(t.add, t);
    for (const n in e) {
        if (!e.hasOwnProperty(n))
            continue;
        const r = e[n]
          , i = t[n];
        ul(i) && ul(r) && t.hasOwnProperty(n) && !pt(r) && !Bi(r) ? t[n] = Fy(i, r) : t[n] = r
    }
    return t
}
const EG = Symbol("pinia:skipHydration");
function SG(t) {
    return !ul(t) || !t.hasOwnProperty(EG)
}
const {assign: ii} = Object;
function bS(t) {
    return !!(pt(t) && t.effect)
}
function wS(t, e, n, r) {
    const {state: i, actions: o, getters: s} = e
      , a = n.state.value[t];
    let l;
    function c() {
        !a && !r && (n.state.value[t] = i ? i() : {});
        const u = ly(r ? Z(i ? i() : {}).value : n.state.value[t]);
        return ii(u, o, Object.keys(s || {}).reduce( (f, d) => (d in u && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${d}" in store "${t}".`),
        f[d] = ro(re( () => {
            Jf(n);
            const h = n._s.get(t);
            return s[d].call(h, h)
        }
        )),
        f), {}))
    }
    return l = Ly(t, c, e, n, r, !0),
    l
}
function Ly(t, e, n={}, r, i, o) {
    let s;
    const a = ii({
        actions: {}
    }, n);
    if (!r._e.active)
        throw new Error("Pinia destroyed");
    const l = {
        deep: !0
    };
    l.onTrigger = C => {
        c ? h = C : c == !1 && !E._hotUpdating && (Array.isArray(h) ? h.push(C) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))
    }
    ;
    let c, u, f = [], d = [], h;
    const p = r.state.value[t];
    !o && !p && !i && (r.state.value[t] = {});
    const y = Z({});
    let v;
    function g(C) {
        let A;
        c = u = !1,
        h = [],
        typeof C == "function" ? (C(r.state.value[t]),
        A = {
            type: ao.patchFunction,
            storeId: t,
            events: h
        }) : (Fy(r.state.value[t], C),
        A = {
            type: ao.patchObject,
            payload: C,
            storeId: t,
            events: h
        });
        const T = v = Symbol();
        Xe().then( () => {
            v === T && (c = !0)
        }
        ),
        u = !0,
        Vl(f, A, r.state.value[t])
    }
    const m = o ? function() {
        const {state: A} = n
          , T = A ? A() : {};
        this.$patch(I => {
            ii(I, T)
        }
        )
    }
    : () => {
        throw new Error(`🍍: Store "${t}" is built using the setup syntax and does not implement $reset().`)
    }
    ;
    function _() {
        s.stop(),
        f = [],
        d = [],
        r._s.delete(t)
    }
    const x = (C, A="") => {
        if (xS in C)
            return C[$m] = A,
            C;
        const T = function() {
            Jf(r);
            const I = Array.from(arguments)
              , B = []
              , G = [];
            function N(K) {
                B.push(K)
            }
            function U(K) {
                G.push(K)
            }
            Vl(d, {
                args: I,
                name: T[$m],
                store: E,
                after: N,
                onError: U
            });
            let W;
            try {
                W = C.apply(this && this.$id === t ? this : E, I)
            } catch (K) {
                throw Vl(G, K),
                K
            }
            return W instanceof Promise ? W.then(K => (Vl(B, K),
            K)).catch(K => (Vl(G, K),
            Promise.reject(K))) : (Vl(B, W),
            W)
        };
        return T[xS] = !0,
        T[$m] = A,
        T
    }
      , b = ro({
        actions: {},
        getters: {},
        state: [],
        hotState: y
    })
      , w = {
        _p: r,
        $id: t,
        $onAction: _S.bind(null, d),
        $patch: g,
        $reset: m,
        $subscribe(C, A={}) {
            const T = _S(f, C, A.detached, () => I())
              , I = s.run( () => ve( () => r.state.value[t], B => {
                (A.flush === "sync" ? u : c) && C({
                    storeId: t,
                    type: ao.direct,
                    events: h
                }, B)
            }
            , ii({}, l, A)));
            return T
        },
        $dispose: _
    }
      , E = Mt(ii({
        _hmrPayload: b,
        _customProperties: ro(new Set)
    }, w));
    r._s.set(t, E);
    const P = (r._a && r._a.runWithContext || wG)( () => r._e.run( () => (s = Pd()).run( () => e({
        action: x
    }))));
    for (const C in P) {
        const A = P[C];
        if (pt(A) && !bS(A) || Bi(A))
            i ? Ah(y.value, C, ff(P, C)) : o || (p && SG(A) && (pt(A) ? A.value = p[C] : Fy(A, p[C])),
            r.state.value[t][C] = A),
            b.state.push(C);
        else if (typeof A == "function") {
            const T = i ? A : x(A, C);
            P[C] = T,
            b.actions[C] = A,
            a.actions[C] = A
        } else
            bS(A) && (b.getters[C] = o ? n.getters[C] : A,
            el && (P._getters || (P._getters = ro([]))).push(C))
    }
    if (ii(E, P),
    ii(Le(E), P),
    Object.defineProperty(E, "$state", {
        get: () => i ? y.value : r.state.value[t],
        set: C => {
            if (i)
                throw new Error("cannot set hotState");
            g(A => {
                ii(A, C)
            }
            )
        }
    }),
    E._hotUpdate = ro(C => {
        E._hotUpdating = !0,
        C._hmrPayload.state.forEach(A => {
            if (A in E.$state) {
                const T = C.$state[A]
                  , I = E.$state[A];
                typeof T == "object" && ul(T) && ul(I) ? zO(T, I) : C.$state[A] = I
            }
            Ah(E, A, ff(C.$state, A))
        }
        ),
        Object.keys(E.$state).forEach(A => {
            A in C.$state || Lm(E, A)
        }
        ),
        c = !1,
        u = !1,
        r.state.value[t] = ff(C._hmrPayload, "hotState"),
        u = !0,
        Xe().then( () => {
            c = !0
        }
        );
        for (const A in C._hmrPayload.actions) {
            const T = C[A];
            Ah(E, A, x(T, A))
        }
        for (const A in C._hmrPayload.getters) {
            const T = C._hmrPayload.getters[A]
              , I = o ? re( () => (Jf(r),
            T.call(E, E))) : T;
            Ah(E, A, I)
        }
        Object.keys(E._hmrPayload.getters).forEach(A => {
            A in C._hmrPayload.getters || Lm(E, A)
        }
        ),
        Object.keys(E._hmrPayload.actions).forEach(A => {
            A in C._hmrPayload.actions || Lm(E, A)
        }
        ),
        E._hmrPayload = C._hmrPayload,
        E._getters = C._getters,
        E._hotUpdating = !1
    }
    ),
    el) {
        const C = {
            writable: !0,
            configurable: !0,
            enumerable: !1
        };
        ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach(A => {
            Object.defineProperty(E, A, ii({
                value: E[A]
            }, C))
        }
        )
    }
    return r._p.forEach(C => {
        if (el) {
            const A = s.run( () => C({
                store: E,
                app: r._a,
                pinia: r,
                options: a
            }));
            Object.keys(A || {}).forEach(T => E._customProperties.add(T)),
            ii(E, A)
        } else
            ii(E, s.run( () => C({
                store: E,
                app: r._a,
                pinia: r,
                options: a
            })))
    }
    ),
    E.$state && typeof E.$state == "object" && typeof E.$state.constructor == "function" && !E.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
	state: () => new MyClass()
Found in store "${E.$id}".`),
    p && o && n.hydrate && n.hydrate(E.$state, p),
    c = !0,
    u = !0,
    E
}
/*! #__NO_SIDE_EFFECTS__ */
function WTe(t, e, n) {
    let r, i;
    const o = typeof e == "function";
    if (typeof t == "string")
        r = t,
        i = o ? n : e;
    else if (i = t,
    r = t.id,
    typeof r != "string")
        throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');
    function s(a, l) {
        const c = L4();
        if (a = a || (c ? dn(kO, null) : null),
        a && Jf(a),
        !Ny)
            throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
This will fail in production.`);
        a = Ny,
        a._s.has(r) || (o ? Ly(r, e, i, a) : wS(r, i, a),
        s._pinia = a);
        const u = a._s.get(r);
        if (l) {
            const f = "__hot:" + r
              , d = o ? Ly(f, e, i, a, !0) : wS(f, ii({}, i), a, !0);
            l._hotUpdate(d),
            delete a.state.value[f],
            a._s.delete(f)
        }
        if (el) {
            const f = yt();
            if (f && f.proxy && !l) {
                const d = f.proxy
                  , h = "_pStores"in d ? d._pStores : d._pStores = {};
                h[r] = u
            }
        }
        return u
    }
    return s.$id = r,
    s
}
(function(t, e) {
    var n = t.document, r = n.documentElement, i = n.querySelector('meta[name="viewport"]'), o = n.querySelector('meta[name="flexible"]'), s = 0, a = 0, l, c = e.flexible || (e.flexible = {});
    if (i) {
        console.warn("");
        var u = i.getAttribute("content").match(/initial\-scale=([\d\.]+)/);
        u && (a = parseFloat(u[1]),
        s = parseInt(1 / a))
    } else if (o) {
        var f = o.getAttribute("content");
        if (f) {
            var d = f.match(/initial\-dpr=([\d\.]+)/)
              , h = f.match(/maximum\-dpr=([\d\.]+)/);
            d && (s = parseFloat(d[1]),
            a = parseFloat((1 / s).toFixed(2))),
            h && (s = parseFloat(h[1]),
            a = parseFloat((1 / s).toFixed(2)))
        }
    }
    if (!s && !a) {
        t.navigator.appVersion.match(/android/gi);
        var p = t.navigator.appVersion.match(/iphone/gi)
          , y = t.devicePixelRatio;
        p ? y >= 3 && (!s || s >= 3) ? s = 3 : y >= 2 && (!s || s >= 2) ? s = 2 : s = 1 : s = 1,
        a = 1 / s
    }
    if (r.setAttribute("data-dpr", s),
    !i)
        if (i = n.createElement("meta"),
        i.setAttribute("name", "viewport"),
        i.setAttribute("content", "initial-scale=" + a + ", maximum-scale=" + a + ", minimum-scale=" + a + ", user-scalable=no"),
        r.firstElementChild)
            r.firstElementChild.appendChild(i);
        else {
            var v = n.createElement("div");
            v.appendChild(i),
            n.write(v.innerHTML)
        }
    function g() {
        var m = r.getBoundingClientRect().width;
        m / s > 540 && (m = 540 * s);
        var _ = m / 10;
        r.style.fontSize = _ + "px",
        c.rem = t.rem = _
    }
    t.addEventListener("resize", function() {
        clearTimeout(l),
        l = setTimeout(g, 300)
    }, !1),
    t.addEventListener("pageshow", function(m) {
        m.persisted && (clearTimeout(l),
        l = setTimeout(g, 300))
    }, !1),
    n.readyState === "complete" ? n.body.style.fontSize = 12 * s + "px" : n.addEventListener("DOMContentLoaded", function(m) {
        n.body.style.fontSize = 12 * s + "px"
    }, !1),
    g(),
    c.dpr = t.dpr = s,
    c.refreshRem = g,
    c.rem2px = function(m) {
        var _ = parseFloat(m) * this.rem;
        return typeof m == "string" && m.match(/rem$/) && (_ += "px"),
        _
    }
    ,
    c.px2rem = function(m) {
        var _ = parseFloat(m) / this.rem;
        return typeof m == "string" && m.match(/px$/) && (_ += "rem"),
        _
    }
}
)(window, window.lib || (window.lib = {}));
function CG(t) {
    return typeof t == "object" && t !== null
}
function ES(t, e) {
    return t = CG(t) ? t : Object.create(null),
    new Proxy(t,{
        get(n, r, i) {
            return r === "key" ? Reflect.get(n, r, i) : Reflect.get(n, r, i) || Reflect.get(e, r, i)
        }
    })
}
function AG(t, e) {
    return e.reduce( (n, r) => n == null ? void 0 : n[r], t)
}
function TG(t, e, n) {
    return e.slice(0, -1).reduce( (r, i) => /^(__proto__)$/.test(i) ? {} : r[i] = r[i] || {}, t)[e[e.length - 1]] = n,
    t
}
function PG(t, e) {
    return e.reduce( (n, r) => {
        const i = r.split(".");
        return TG(n, i, AG(t, i))
    }
    , {})
}
function IG(t, e) {
    return n => {
        var r;
        try {
            const {storage: i=localStorage, beforeRestore: o=void 0, afterRestore: s=void 0, serializer: a={
                serialize: JSON.stringify,
                deserialize: JSON.parse
            }, key: l=e.$id, paths: c=null, debug: u=!1} = n;
            return {
                storage: i,
                beforeRestore: o,
                afterRestore: s,
                serializer: a,
                key: ((r = t.key) != null ? r : f => f)(typeof l == "string" ? l : l(e.$id)),
                paths: c,
                debug: u
            }
        } catch (i) {
            return n.debug && console.error("[pinia-plugin-persistedstate]", i),
            null
        }
    }
}
function SS(t, {storage: e, serializer: n, key: r, debug: i}) {
    try {
        const o = e == null ? void 0 : e.getItem(r);
        o && t.$patch(n == null ? void 0 : n.deserialize(o))
    } catch (o) {
        i && console.error("[pinia-plugin-persistedstate]", o)
    }
}
function CS(t, {storage: e, serializer: n, key: r, paths: i, debug: o}) {
    try {
        const s = Array.isArray(i) ? PG(t, i) : t;
        e.setItem(r, n.serialize(s))
    } catch (s) {
        o && console.error("[pinia-plugin-persistedstate]", s)
    }
}
function OG(t={}) {
    return e => {
        const {auto: n=!1} = t
          , {options: {persist: r=n}, store: i, pinia: o} = e;
        if (!r)
            return;
        if (!(i.$id in o.state.value)) {
            const a = o._s.get(i.$id.replace("__hot:", ""));
            a && Promise.resolve().then( () => a.$persist());
            return
        }
        const s = (Array.isArray(r) ? r.map(a => ES(a, t)) : [ES(r, t)]).map(IG(t, i)).filter(Boolean);
        i.$persist = () => {
            s.forEach(a => {
                CS(i.$state, a)
            }
            )
        }
        ,
        i.$hydrate = ({runHooks: a=!0}={}) => {
            s.forEach(l => {
                const {beforeRestore: c, afterRestore: u} = l;
                a && (c == null || c(e)),
                SS(i, l),
                a && (u == null || u(e))
            }
            )
        }
        ,
        s.forEach(a => {
            const {beforeRestore: l, afterRestore: c} = a;
            l == null || l(e),
            SS(i, a),
            c == null || c(e),
            i.$subscribe( (u, f) => {
                CS(f, a)
            }
            , {
                detached: !0
            })
        }
        )
    }
}
var YTe = OG()
  , fl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function hu(t) {
    return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t
}
function Ab(t) {
    if (t.__esModule)
        return t;
    var e = t.default;
    if (typeof e == "function") {
        var n = function r() {
            return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments)
        };
        n.prototype = e.prototype
    } else
        n = {};
    return Object.defineProperty(n, "__esModule", {
        value: !0
    }),
    Object.keys(t).forEach(function(r) {
        var i = Object.getOwnPropertyDescriptor(t, r);
        Object.defineProperty(n, r, i.get ? i : {
            enumerable: !0,
            get: function() {
                return t[r]
            }
        })
    }),
    n
}
const zn = Ab(KU);
var jO = {
    exports: {}
}
  , Tb = Object.defineProperty
  , RG = Object.getOwnPropertyDescriptor
  , MG = Object.getOwnPropertyNames
  , DG = Object.prototype.hasOwnProperty
  , BG = (t, e) => {
    for (var n in e)
        Tb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , kG = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of MG(e))
            !DG.call(t, i) && i !== n && Tb(t, i, {
                get: () => e[i],
                enumerable: !(r = RG(e, i)) || r.enumerable
            });
    return t
}
  , NG = t => kG(Tb({}, "__esModule", {
    value: !0
}), t)
  , WO = {};
BG(WO, {
    extend: () => LG,
    flat: () => KG,
    get: () => jG,
    inBrowser: () => YO,
    isDate: () => GG,
    isDef: () => $G,
    isFunction: () => $y,
    isIOS: () => zG,
    isMobile: () => HG,
    isNumeric: () => VG,
    isObject: () => Pb,
    isPromise: () => UG,
    isSameValue: () => YG,
    noop: () => FG,
    pick: () => WG,
    toArray: () => XG
});
var la = NG(WO);
function FG() {}
const LG = Object.assign
  , YO = typeof window < "u"
  , Pb = t => t !== null && typeof t == "object"
  , $G = t => t != null
  , $y = t => typeof t == "function"
  , UG = t => Pb(t) && $y(t.then) && $y(t.catch)
  , GG = t => Object.prototype.toString.call(t) === "[object Date]" && !Number.isNaN(t.getTime());
function HG(t) {
    return t = t.replace(/[^-|\d]/g, ""),
    /^((\+86)|(86))?(1)\d{10}$/.test(t) || /^0[0-9-]{10,13}$/.test(t)
}
const VG = t => typeof t == "number" || /^\d+(\.\d+)?$/.test(t)
  , zG = () => YO ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : !1;
function jG(t, e) {
    const n = e.split(".");
    let r = t;
    return n.forEach(i => {
        var o;
        r = Pb(r) && (o = r[i]) != null ? o : ""
    }
    ),
    r
}
function WG(t, e, n) {
    return e.reduce( (r, i) => ((!n || t[i] !== void 0) && (r[i] = t[i]),
    r), {})
}
const YG = (t, e) => JSON.stringify(t) === JSON.stringify(e)
  , XG = t => Array.isArray(t) ? t : [t]
  , KG = t => t.reduce( (e, n) => e.concat(n), []);
var Ib = Object.defineProperty
  , qG = Object.getOwnPropertyDescriptor
  , ZG = Object.getOwnPropertyNames
  , JG = Object.prototype.hasOwnProperty
  , QG = (t, e) => {
    for (var n in e)
        Ib(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , eH = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of ZG(e))
            !JG.call(t, i) && i !== n && Ib(t, i, {
                get: () => e[i],
                enumerable: !(r = qG(e, i)) || r.enumerable
            });
    return t
}
  , tH = t => eH(Ib({}, "__esModule", {
    value: !0
}), t)
  , XO = {};
QG(XO, {
    makeArrayProp: () => sH,
    makeNumberProp: () => aH,
    makeNumericProp: () => lH,
    makeRequiredProp: () => oH,
    makeStringProp: () => cH,
    numericProp: () => KO,
    truthProp: () => iH,
    unknownProp: () => rH
});
var nH = tH(XO);
const rH = null
  , KO = [Number, String]
  , iH = {
    type: Boolean,
    default: !0
}
  , oH = t => ({
    type: t,
    required: !0
})
  , sH = () => ({
    type: Array,
    default: () => []
})
  , aH = t => ({
    type: Number,
    default: t
})
  , lH = t => ({
    type: KO,
    default: t
})
  , cH = t => ({
    type: String,
    default: t
});
var wo = typeof window < "u"
  , uH = !0;
function hr(t) {
    return wo ? requestAnimationFrame(t) : -1
}
function Hd(t) {
    wo && cancelAnimationFrame(t)
}
function Ua(t) {
    hr( () => hr(t))
}
var fH = t => t === window
  , AS = (t, e) => ({
    top: 0,
    left: 0,
    right: t,
    bottom: e,
    width: t,
    height: e
})
  , wn = t => {
    const e = dr(t);
    if (fH(e)) {
        const n = e.innerWidth
          , r = e.innerHeight;
        return AS(n, r)
    }
    return e != null && e.getBoundingClientRect ? e.getBoundingClientRect() : AS(0, 0)
}
;
function qO(t=!1) {
    const e = Z(t);
    return [e, (r=!e.value) => {
        e.value = r
    }
    ]
}
function Zr(t) {
    const e = dn(t, null);
    if (e) {
        const n = yt()
          , {link: r, unlink: i, internalChildren: o} = e;
        r(n),
        fs( () => i(n));
        const s = re( () => o.indexOf(n));
        return {
            parent: e,
            index: s
        }
    }
    return {
        parent: null,
        index: Z(-1)
    }
}
function ZO(t) {
    const e = []
      , n = r => {
        Array.isArray(r) && r.forEach(i => {
            var o;
            ho(i) && (e.push(i),
            (o = i.component) != null && o.subTree && (e.push(i.component.subTree),
            n(i.component.subTree.children)),
            i.children && n(i.children))
        }
        )
    }
    ;
    return n(t),
    e
}
var TS = (t, e) => {
    const n = t.indexOf(e);
    return n === -1 ? t.findIndex(r => e.key !== void 0 && e.key !== null && r.type === e.type && r.key === e.key) : n
}
;
function JO(t, e, n) {
    const r = ZO(t.subTree.children);
    n.sort( (o, s) => TS(r, o.vnode) - TS(r, s.vnode));
    const i = n.map(o => o.proxy);
    e.sort( (o, s) => {
        const a = i.indexOf(o)
          , l = i.indexOf(s);
        return a - l
    }
    )
}
function Ui(t) {
    const e = Mt([])
      , n = Mt([])
      , r = yt();
    return {
        children: e,
        linkChildren: o => {
            hi(t, Object.assign({
                link: l => {
                    l.proxy && (n.push(l),
                    e.push(l.proxy),
                    JO(r, e, n))
                }
                ,
                unlink: l => {
                    const c = n.indexOf(l);
                    e.splice(c, 1),
                    n.splice(c, 1)
                }
                ,
                children: e,
                internalChildren: n
            }, o))
        }
    }
}
var Uy = 1e3
  , Gy = 60 * Uy
  , Hy = 60 * Gy
  , PS = 24 * Hy;
function dH(t) {
    const e = Math.floor(t / PS)
      , n = Math.floor(t % PS / Hy)
      , r = Math.floor(t % Hy / Gy)
      , i = Math.floor(t % Gy / Uy)
      , o = Math.floor(t % Uy);
    return {
        total: t,
        days: e,
        hours: n,
        minutes: r,
        seconds: i,
        milliseconds: o
    }
}
function hH(t, e) {
    return Math.floor(t / 1e3) === Math.floor(e / 1e3)
}
function QO(t) {
    let e, n, r, i;
    const o = Z(t.time)
      , s = re( () => dH(o.value))
      , a = () => {
        r = !1,
        Hd(e)
    }
      , l = () => Math.max(n - Date.now(), 0)
      , c = y => {
        var v, g;
        o.value = y,
        (v = t.onChange) == null || v.call(t, s.value),
        y === 0 && (a(),
        (g = t.onFinish) == null || g.call(t))
    }
      , u = () => {
        e = hr( () => {
            r && (c(l()),
            o.value > 0 && u())
        }
        )
    }
      , f = () => {
        e = hr( () => {
            if (r) {
                const y = l();
                (!hH(y, o.value) || y === 0) && c(y),
                o.value > 0 && f()
            }
        }
        )
    }
      , d = () => {
        wo && (t.millisecond ? u() : f())
    }
      , h = () => {
        r || (n = Date.now() + o.value,
        r = !0,
        d())
    }
      , p = (y=t.time) => {
        a(),
        o.value = y
    }
    ;
    return qr(a),
    cs( () => {
        i && (r = !0,
        i = !1,
        d())
    }
    ),
    bo( () => {
        r && (a(),
        i = !0)
    }
    ),
    {
        start: h,
        pause: a,
        reset: p,
        current: s
    }
}
function pu(t) {
    let e;
    Ht( () => {
        t(),
        Xe( () => {
            e = !0
        }
        )
    }
    ),
    cs( () => {
        e && t()
    }
    )
}
function mr(t, e, n={}) {
    if (!wo)
        return;
    const {target: r=window, passive: i=!1, capture: o=!1} = n;
    let s = !1, a;
    const l = f => {
        if (s)
            return;
        const d = dr(f);
        d && !a && (d.addEventListener(t, e, {
            capture: o,
            passive: i
        }),
        a = !0)
    }
      , c = f => {
        if (s)
            return;
        const d = dr(f);
        d && a && (d.removeEventListener(t, e, o),
        a = !1)
    }
    ;
    fs( () => c(r)),
    bo( () => c(r)),
    pu( () => l(r));
    let u;
    return pt(r) && (u = ve(r, (f, d) => {
        c(d),
        l(f)
    }
    )),
    () => {
        u == null || u(),
        c(r),
        s = !0
    }
}
function eR(t, e, n={}) {
    if (!wo)
        return;
    const {eventName: r="click"} = n;
    mr(r, o => {
        (Array.isArray(t) ? t : [t]).every(l => {
            const c = dr(l);
            return c && !c.contains(o.target)
        }
        ) && e(o)
    }
    , {
        target: document
    })
}
var Th, Um;
function tR() {
    if (!Th && (Th = Z(0),
    Um = Z(0),
    wo)) {
        const t = () => {
            Th.value = window.innerWidth,
            Um.value = window.innerHeight
        }
        ;
        t(),
        window.addEventListener("resize", t, {
            passive: !0
        }),
        window.addEventListener("orientationchange", t, {
            passive: !0
        })
    }
    return {
        width: Th,
        height: Um
    }
}
var pH = /scroll|auto|overlay/i
  , nR = wo ? window : void 0;
function gH(t) {
    return t.tagName !== "HTML" && t.tagName !== "BODY" && t.nodeType === 1
}
function Ob(t, e=nR) {
    let n = t;
    for (; n && n !== e && gH(n); ) {
        const {overflowY: r} = window.getComputedStyle(n);
        if (pH.test(r))
            return n;
        n = n.parentNode
    }
    return e
}
function Vd(t, e=nR) {
    const n = Z();
    return Ht( () => {
        t.value && (n.value = Ob(t.value, e))
    }
    ),
    n
}
var Ph;
function rR() {
    if (!Ph && (Ph = Z("visible"),
    wo)) {
        const t = () => {
            Ph.value = document.hidden ? "hidden" : "visible"
        }
        ;
        t(),
        window.addEventListener("visibilitychange", t)
    }
    return Ph
}
var Rb = Symbol("van-field");
function Dl(t) {
    const e = dn(Rb, null);
    e && !e.customValue.value && (e.customValue.value = t,
    ve(t, () => {
        e.resetValidation(),
        e.validateWithTrigger("onChange")
    }
    ))
}
function mH(t, e) {
    if (wo) {
        const {interval: n=0, isLoop: r=!1} = e || {};
        let i, o = !1, s;
        const a = () => {
            o = !0,
            cancelAnimationFrame(s)
        }
          , l = c => {
            if (!o) {
                if (i === void 0)
                    i = c;
                else if (c - i > n && (t(c),
                i = c,
                !r)) {
                    a();
                    return
                }
                s = requestAnimationFrame(l)
            }
        }
        ;
        return s = requestAnimationFrame(l),
        a
    }
    return () => {}
}
const vH = Object.freeze(Object.defineProperty({
    __proto__: null,
    CUSTOM_FIELD_INJECTION_KEY: Rb,
    cancelRaf: Hd,
    doubleRaf: Ua,
    flattenVNodes: ZO,
    getScrollParent: Ob,
    inBrowser: wo,
    onMountedOrActivated: pu,
    raf: hr,
    sortChildren: JO,
    supportsPassive: uH,
    useChildren: Ui,
    useClickAway: eR,
    useCountDown: QO,
    useCustomFieldValue: Dl,
    useEventListener: mr,
    usePageVisibility: rR,
    useParent: Zr,
    useRaf: mH,
    useRect: wn,
    useScrollParent: Vd,
    useToggle: qO,
    useWindowSize: tR
}, Symbol.toStringTag, {
    value: "Module"
}))
  , wg = Ab(vH);
var Mb = Object.defineProperty
  , yH = Object.getOwnPropertyDescriptor
  , _H = Object.getOwnPropertyNames
  , xH = Object.prototype.hasOwnProperty
  , bH = (t, e) => {
    for (var n in e)
        Mb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , wH = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of _H(e))
            !xH.call(t, i) && i !== n && Mb(t, i, {
                get: () => e[i],
                enumerable: !(r = yH(e, i)) || r.enumerable
            });
    return t
}
  , EH = t => wH(Mb({}, "__esModule", {
    value: !0
}), t)
  , iR = {};
bH(iR, {
    getContainingBlock: () => BH,
    getElementTop: () => AH,
    getRootScrollTop: () => Db,
    getScrollTop: () => aR,
    isHidden: () => OH,
    preventDefault: () => IH,
    resetScroll: () => PH,
    setRootScrollTop: () => lR,
    setScrollTop: () => Vy,
    stopPropagation: () => cR,
    windowHeight: () => MH,
    windowWidth: () => RH
});
var oR = EH(iR)
  , sR = wg
  , SH = zn
  , CH = la;
function aR(t) {
    const e = "scrollTop"in t ? t.scrollTop : t.pageYOffset;
    return Math.max(e, 0)
}
function Vy(t, e) {
    "scrollTop"in t ? t.scrollTop = e : t.scrollTo(t.scrollX, e)
}
function Db() {
    return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0
}
function lR(t) {
    Vy(window, t),
    Vy(document.body, t)
}
function AH(t, e) {
    if (t === window)
        return 0;
    const n = e ? aR(e) : Db();
    return (0,
    sR.useRect)(t).top + n
}
const TH = (0,
CH.isIOS)();
function PH() {
    TH && lR(Db())
}
const cR = t => t.stopPropagation();
function IH(t, e) {
    (typeof t.cancelable != "boolean" || t.cancelable) && t.preventDefault(),
    e && cR(t)
}
function OH(t) {
    const e = (0,
    SH.unref)(t);
    if (!e)
        return !1;
    const n = window.getComputedStyle(e)
      , r = n.display === "none"
      , i = e.offsetParent === null && n.position !== "fixed";
    return r || i
}
const {width: RH, height: MH} = (0,
sR.useWindowSize)();
function DH(t) {
    const e = window.getComputedStyle(t);
    return e.transform !== "none" || e.perspective !== "none" || ["transform", "perspective", "filter"].some(n => (e.willChange || "").includes(n))
}
function BH(t) {
    let e = t.parentElement;
    for (; e; ) {
        if (e && e.tagName !== "HTML" && e.tagName !== "BODY" && DH(e))
            return e;
        e = e.parentElement
    }
    return null
}
var Bb = Object.defineProperty
  , kH = Object.getOwnPropertyDescriptor
  , NH = Object.getOwnPropertyNames
  , FH = Object.prototype.hasOwnProperty
  , LH = (t, e) => {
    for (var n in e)
        Bb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , $H = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of NH(e))
            !FH.call(t, i) && i !== n && Bb(t, i, {
                get: () => e[i],
                enumerable: !(r = kH(e, i)) || r.enumerable
            });
    return t
}
  , UH = t => $H(Bb({}, "__esModule", {
    value: !0
}), t)
  , uR = {};
LH(uR, {
    addNumber: () => tV,
    addUnit: () => Ip,
    camelize: () => qH,
    clamp: () => QH,
    formatNumber: () => eV,
    getSizeStyle: () => HH,
    getZIndexStyle: () => VH,
    kebabCase: () => ZH,
    padZero: () => JH,
    unitToPx: () => XH
});
var kb = UH(uR)
  , GH = la
  , fR = oR
  , zy = la;
function Ip(t) {
    if ((0,
    zy.isDef)(t))
        return (0,
        zy.isNumeric)(t) ? `${t}px` : String(t)
}
function HH(t) {
    if ((0,
    zy.isDef)(t)) {
        if (Array.isArray(t))
            return {
                width: Ip(t[0]),
                height: Ip(t[1])
            };
        const e = Ip(t);
        return {
            width: e,
            height: e
        }
    }
}
function VH(t) {
    const e = {};
    return t !== void 0 && (e.zIndex = +t),
    e
}
let Gm;
function zH() {
    if (!Gm) {
        const t = document.documentElement
          , e = t.style.fontSize || window.getComputedStyle(t).fontSize;
        Gm = parseFloat(e)
    }
    return Gm
}
function jH(t) {
    return t = t.replace(/rem/g, ""),
    +t * zH()
}
function WH(t) {
    return t = t.replace(/vw/g, ""),
    +t * fR.windowWidth.value / 100
}
function YH(t) {
    return t = t.replace(/vh/g, ""),
    +t * fR.windowHeight.value / 100
}
function XH(t) {
    if (typeof t == "number")
        return t;
    if (GH.inBrowser) {
        if (t.includes("rem"))
            return jH(t);
        if (t.includes("vw"))
            return WH(t);
        if (t.includes("vh"))
            return YH(t)
    }
    return parseFloat(t)
}
const KH = /-(\w)/g
  , qH = t => t.replace(KH, (e, n) => n.toUpperCase())
  , ZH = t => t.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
function JH(t, e=2) {
    let n = t + "";
    for (; n.length < e; )
        n = "0" + n;
    return n
}
const QH = (t, e, n) => Math.min(Math.max(t, e), n);
function IS(t, e, n) {
    const r = t.indexOf(e);
    return r === -1 ? t : e === "-" && r !== 0 ? t.slice(0, r) : t.slice(0, r + 1) + t.slice(r).replace(n, "")
}
function eV(t, e=!0, n=!0) {
    e ? t = IS(t, ".", /\./g) : t = t.split(".")[0],
    n ? t = IS(t, "-", /-/g) : t = t.replace(/-/, "");
    const r = e ? /[^-0-9.]/g : /[^-0-9]/g;
    return t.replace(r, "")
}
function tV(t, e) {
    return Math.round((t + e) * 1e10) / 1e10
}
var Nb = Object.defineProperty
  , nV = Object.getOwnPropertyDescriptor
  , rV = Object.getOwnPropertyNames
  , iV = Object.prototype.hasOwnProperty
  , oV = (t, e) => {
    for (var n in e)
        Nb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , sV = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of rV(e))
            !iV.call(t, i) && i !== n && Nb(t, i, {
                get: () => e[i],
                enumerable: !(r = nV(e, i)) || r.enumerable
            });
    return t
}
  , aV = t => sV(Nb({}, "__esModule", {
    value: !0
}), t)
  , dR = {};
oV(dR, {
    deepAssign: () => hR
});
var lV = aV(dR)
  , OS = la;
const {hasOwnProperty: cV} = Object.prototype;
function uV(t, e, n) {
    const r = e[n];
    (0,
    OS.isDef)(r) && (!cV.call(t, n) || !(0,
    OS.isObject)(r) ? t[n] = r : t[n] = hR(Object(t[n]), r))
}
function hR(t, e) {
    return Object.keys(e).forEach(n => {
        uV(t, e, n)
    }
    ),
    t
}
var Fb = Object.defineProperty
  , fV = Object.getOwnPropertyDescriptor
  , dV = Object.getOwnPropertyNames
  , hV = Object.prototype.hasOwnProperty
  , pV = (t, e) => {
    for (var n in e)
        Fb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , gV = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of dV(e))
            !hV.call(t, i) && i !== n && Fb(t, i, {
                get: () => e[i],
                enumerable: !(r = fV(e, i)) || r.enumerable
            });
    return t
}
  , mV = t => gV(Fb({}, "__esModule", {
    value: !0
}), t)
  , pR = {};
pV(pR, {
    default: () => yV
});
var vV = mV(pR)
  , yV = {
    name: "姓名",
    tel: "电话",
    save: "保存",
    clear: "清空",
    cancel: "取消",
    confirm: "确认",
    delete: "删除",
    loading: "加载中...",
    noCoupon: "暂无优惠券",
    nameEmpty: "请填写姓名",
    addContact: "添加联系人",
    telInvalid: "请填写正确的电话",
    vanCalendar: {
        end: "结束",
        start: "开始",
        title: "日期选择",
        weekdays: ["日", "一", "二", "三", "四", "五", "六"],
        monthTitle: (t, e) => `${t}年${e}月`,
        rangePrompt: t => `最多选择 ${t} 天`
    },
    vanCascader: {
        select: "请选择"
    },
    vanPagination: {
        prev: "上一页",
        next: "下一页"
    },
    vanPullRefresh: {
        pulling: "下拉即可刷新...",
        loosing: "释放即可刷新..."
    },
    vanSubmitBar: {
        label: "合计:"
    },
    vanCoupon: {
        unlimited: "无门槛",
        discount: t => `${t}折`,
        condition: t => `满${t}元可用`
    },
    vanCouponCell: {
        title: "优惠券",
        count: t => `${t}张可用`
    },
    vanCouponList: {
        exchange: "兑换",
        close: "不使用",
        enable: "可用",
        disabled: "不可用",
        placeholder: "输入优惠码"
    },
    vanAddressEdit: {
        area: "地区",
        areaEmpty: "请选择地区",
        addressEmpty: "请填写详细地址",
        addressDetail: "详细地址",
        defaultAddress: "设为默认收货地址"
    },
    vanAddressList: {
        add: "新增地址"
    }
}
  , _V = Object.create
  , Eg = Object.defineProperty
  , xV = Object.getOwnPropertyDescriptor
  , bV = Object.getOwnPropertyNames
  , wV = Object.getPrototypeOf
  , EV = Object.prototype.hasOwnProperty
  , SV = (t, e) => {
    for (var n in e)
        Eg(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , gR = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of bV(e))
            !EV.call(t, i) && i !== n && Eg(t, i, {
                get: () => e[i],
                enumerable: !(r = xV(e, i)) || r.enumerable
            });
    return t
}
  , CV = (t, e, n) => (n = t != null ? _V(wV(t)) : {},
gR(e || !t || !t.__esModule ? Eg(n, "default", {
    value: t,
    enumerable: !0
}) : n, t))
  , AV = t => gR(Eg({}, "__esModule", {
    value: !0
}), t)
  , mR = {};
SV(mR, {
    Locale: () => yR,
    default: () => RV,
    useCurrentLang: () => OV
});
var TV = AV(mR)
  , vR = zn
  , PV = lV
  , IV = CV(vV);
const jy = (0,
vR.ref)("zh-CN")
  , RS = (0,
vR.reactive)({
    "zh-CN": IV.default
})
  , yR = {
    messages() {
        return RS[jy.value]
    },
    use(t, e) {
        jy.value = t,
        this.add({
            [t]: e
        })
    },
    add(t={}) {
        (0,
        PV.deepAssign)(RS, t)
    }
}
  , OV = () => jy;
var RV = yR
  , MV = Object.create
  , Sg = Object.defineProperty
  , DV = Object.getOwnPropertyDescriptor
  , BV = Object.getOwnPropertyNames
  , kV = Object.getPrototypeOf
  , NV = Object.prototype.hasOwnProperty
  , FV = (t, e) => {
    for (var n in e)
        Sg(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , _R = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of BV(e))
            !NV.call(t, i) && i !== n && Sg(t, i, {
                get: () => e[i],
                enumerable: !(r = DV(e, i)) || r.enumerable
            });
    return t
}
  , LV = (t, e, n) => (n = t != null ? MV(kV(t)) : {},
_R(e || !t || !t.__esModule ? Sg(n, "default", {
    value: t,
    enumerable: !0
}) : n, t))
  , $V = t => _R(Sg({}, "__esModule", {
    value: !0
}), t)
  , xR = {};
FV(xR, {
    createBEM: () => wR,
    createNamespace: () => VV,
    createTranslate: () => bR
});
var UV = $V(xR)
  , Hm = la
  , GV = kb
  , HV = LV(TV);
function bR(t) {
    const e = (0,
    GV.camelize)(t) + ".";
    return (n, ...r) => {
        const i = HV.default.messages()
          , o = (0,
        Hm.get)(i, e + n) || (0,
        Hm.get)(i, n);
        return (0,
        Hm.isFunction)(o) ? o(...r) : o
    }
}
function Wy(t, e) {
    return e ? typeof e == "string" ? ` ${t}--${e}` : Array.isArray(e) ? e.reduce( (n, r) => n + Wy(t, r), "") : Object.keys(e).reduce( (n, r) => n + (e[r] ? Wy(t, r) : ""), "") : ""
}
function wR(t) {
    return (e, n) => (e && typeof e != "string" && (n = e,
    e = ""),
    e = e ? `${t}__${e}` : t,
    `${e}${Wy(e, n)}`)
}
function VV(t) {
    const e = `van-${t}`;
    return [e, wR(e), bR(e)]
}
var Lb = Object.defineProperty
  , zV = Object.getOwnPropertyDescriptor
  , jV = Object.getOwnPropertyNames
  , WV = Object.prototype.hasOwnProperty
  , YV = (t, e) => {
    for (var n in e)
        Lb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , XV = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of jV(e))
            !WV.call(t, i) && i !== n && Lb(t, i, {
                get: () => e[i],
                enumerable: !(r = zV(e, i)) || r.enumerable
            });
    return t
}
  , KV = t => XV(Lb({}, "__esModule", {
    value: !0
}), t)
  , ER = {};
YV(ER, {
    BORDER: () => ca,
    BORDER_BOTTOM: () => ez,
    BORDER_LEFT: () => JV,
    BORDER_RIGHT: () => QV,
    BORDER_SURROUND: () => tz,
    BORDER_TOP: () => ZV,
    BORDER_TOP_BOTTOM: () => nz,
    BORDER_UNSET_TOP_BOTTOM: () => rz,
    FORM_KEY: () => oz,
    HAPTICS_FEEDBACK: () => iz,
    LONG_PRESS_START_TIME: () => sz,
    TAP_OFFSET: () => az
});
var qV = KV(ER);
const ca = "van-hairline"
  , ZV = `${ca}--top`
  , JV = `${ca}--left`
  , QV = `${ca}--right`
  , ez = `${ca}--bottom`
  , tz = `${ca}--surround`
  , nz = `${ca}--top-bottom`
  , rz = `${ca}-unset--top-bottom`
  , iz = "van-haptics-feedback"
  , oz = Symbol("van-form")
  , sz = 500
  , az = 5;
var $b = Object.defineProperty
  , lz = Object.getOwnPropertyDescriptor
  , cz = Object.getOwnPropertyNames
  , uz = Object.prototype.hasOwnProperty
  , fz = (t, e) => {
    for (var n in e)
        $b(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , dz = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of cz(e))
            !uz.call(t, i) && i !== n && $b(t, i, {
                get: () => e[i],
                enumerable: !(r = lz(e, i)) || r.enumerable
            });
    return t
}
  , hz = t => dz($b({}, "__esModule", {
    value: !0
}), t)
  , SR = {};
fz(SR, {
    callInterceptor: () => gz
});
var pz = hz(SR)
  , MS = la;
function gz(t, {args: e=[], done: n, canceled: r, error: i}) {
    if (t) {
        const o = t.apply(null, e);
        (0,
        MS.isPromise)(o) ? o.then(s => {
            s ? n() : r && r()
        }
        ).catch(i || MS.noop) : o ? n() : r && r()
    } else
        n()
}
var Ub = Object.defineProperty
  , mz = Object.getOwnPropertyDescriptor
  , vz = Object.getOwnPropertyNames
  , yz = Object.prototype.hasOwnProperty
  , _z = (t, e) => {
    for (var n in e)
        Ub(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , xz = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of vz(e))
            !yz.call(t, i) && i !== n && Ub(t, i, {
                get: () => e[i],
                enumerable: !(r = mz(e, i)) || r.enumerable
            });
    return t
}
  , bz = t => xz(Ub({}, "__esModule", {
    value: !0
}), t)
  , CR = {};
_z(CR, {
    withInstall: () => Sz
});
var wz = bz(CR)
  , Ez = kb;
function Sz(t) {
    return t.install = e => {
        const {name: n} = t;
        n && (e.component(n, t),
        e.component((0,
        Ez.camelize)(`-${n}`), t))
    }
    ,
    t
}
var Gb = Object.defineProperty
  , Cz = Object.getOwnPropertyDescriptor
  , Az = Object.getOwnPropertyNames
  , Tz = Object.prototype.hasOwnProperty
  , Pz = (t, e) => {
    for (var n in e)
        Gb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , Iz = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of Az(e))
            !Tz.call(t, i) && i !== n && Gb(t, i, {
                get: () => e[i],
                enumerable: !(r = Cz(e, i)) || r.enumerable
            });
    return t
}
  , Oz = t => Iz(Gb({}, "__esModule", {
    value: !0
}), t)
  , AR = {};
Pz(AR, {
    closest: () => Mz
});
var Rz = Oz(AR);
function Mz(t, e) {
    return t.reduce( (n, r) => Math.abs(n - e) < Math.abs(r - e) ? n : r)
}
(function(t) {
    var e = Object.defineProperty
      , n = Object.getOwnPropertyDescriptor
      , r = Object.getOwnPropertyNames
      , i = Object.prototype.hasOwnProperty
      , o = (c, u, f, d) => {
        if (u && typeof u == "object" || typeof u == "function")
            for (let h of r(u))
                !i.call(c, h) && h !== f && e(c, h, {
                    get: () => u[h],
                    enumerable: !(d = n(u, h)) || d.enumerable
                });
        return c
    }
      , s = (c, u, f) => (o(c, u, "default"),
    f && o(f, u, "default"))
      , a = c => o(e({}, "__esModule", {
        value: !0
    }), c)
      , l = {};
    t.exports = a(l),
    s(l, la, t.exports),
    s(l, nH, t.exports),
    s(l, oR, t.exports),
    s(l, UV, t.exports),
    s(l, kb, t.exports),
    s(l, qV, t.exports),
    s(l, pz, t.exports),
    s(l, wz, t.exports),
    s(l, Rz, t.exports)
}
)(jO);
var jn = jO.exports
  , Hb = Object.defineProperty
  , Dz = Object.getOwnPropertyDescriptor
  , Bz = Object.getOwnPropertyNames
  , kz = Object.prototype.hasOwnProperty
  , Nz = (t, e) => {
    for (var n in e)
        Hb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , Fz = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of Bz(e))
            !kz.call(t, i) && i !== n && Hb(t, i, {
                get: () => e[i],
                enumerable: !(r = Dz(e, i)) || r.enumerable
            });
    return t
}
  , Lz = t => Fz(Hb({}, "__esModule", {
    value: !0
}), t)
  , TR = {};
Nz(TR, {
    useExpose: () => Gz
});
var PR = Lz(TR)
  , $z = zn
  , Uz = jn;
function Gz(t) {
    const e = (0,
    $z.getCurrentInstance)();
    e && (0,
    Uz.extend)(e.proxy, t)
}
var Vb = Object.defineProperty
  , Hz = Object.getOwnPropertyDescriptor
  , Vz = Object.getOwnPropertyNames
  , zz = Object.prototype.hasOwnProperty
  , jz = (t, e) => {
    for (var n in e)
        Vb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , Wz = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of Vz(e))
            !zz.call(t, i) && i !== n && Vb(t, i, {
                get: () => e[i],
                enumerable: !(r = Hz(e, i)) || r.enumerable
            });
    return t
}
  , Yz = t => Wz(Vb({}, "__esModule", {
    value: !0
}), t)
  , IR = {};
jz(IR, {
    mountComponent: () => Jz,
    usePopupState: () => Zz
});
var Xz = Yz(IR)
  , OR = zn
  , Kz = la
  , qz = PR;
function Zz() {
    const t = (0,
    OR.reactive)({
        show: !1
    })
      , e = i => {
        t.show = i
    }
      , n = i => {
        (0,
        Kz.extend)(t, i, {
            transitionAppear: !0
        }),
        e(!0)
    }
      , r = () => e(!1);
    return (0,
    qz.useExpose)({
        open: n,
        close: r,
        toggle: e
    }),
    {
        open: n,
        close: r,
        state: t,
        toggle: e
    }
}
function Jz(t) {
    const e = (0,
    OR.createApp)(t)
      , n = document.createElement("div");
    return document.body.appendChild(n),
    {
        instance: e.mount(n),
        unmount() {
            e.unmount(),
            document.body.removeChild(n)
        }
    }
}
var zb = Object.defineProperty
  , Qz = Object.getOwnPropertyDescriptor
  , ej = Object.getOwnPropertyNames
  , tj = Object.prototype.hasOwnProperty
  , nj = (t, e) => {
    for (var n in e)
        zb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , rj = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of ej(e))
            !tj.call(t, i) && i !== n && zb(t, i, {
                get: () => e[i],
                enumerable: !(r = Qz(e, i)) || r.enumerable
            });
    return t
}
  , ij = t => rj(zb({}, "__esModule", {
    value: !0
}), t)
  , RR = {};
nj(RR, {
    lockClick: () => sj
});
var oj = ij(RR);
let Ou = 0;
function sj(t) {
    t ? (Ou || document.body.classList.add("van-toast--unclickable"),
    Ou++) : Ou && (Ou--,
    Ou || document.body.classList.remove("van-toast--unclickable"))
}
var jb = Object.defineProperty
  , aj = Object.getOwnPropertyDescriptor
  , lj = Object.getOwnPropertyNames
  , cj = Object.prototype.hasOwnProperty
  , uj = (t, e) => {
    for (var n in e)
        jb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , fj = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of lj(e))
            !cj.call(t, i) && i !== n && jb(t, i, {
                get: () => e[i],
                enumerable: !(r = aj(e, i)) || r.enumerable
            });
    return t
}
  , dj = t => fj(jb({}, "__esModule", {
    value: !0
}), t)
  , MR = {};
uj(MR, {
    badgeProps: () => BR,
    default: () => pj
});
var DR = dj(MR)
  , Ih = zn
  , lr = jn;
const [hj,DS] = (0,
lr.createNamespace)("badge")
  , BR = {
    dot: Boolean,
    max: lr.numericProp,
    tag: (0,
    lr.makeStringProp)("div"),
    color: String,
    offset: Array,
    content: lr.numericProp,
    showZero: lr.truthProp,
    position: (0,
    lr.makeStringProp)("top-right")
};
var pj = (0,
Ih.defineComponent)({
    name: hj,
    props: BR,
    setup(t, {slots: e}) {
        const n = () => {
            if (e.content)
                return !0;
            const {content: a, showZero: l} = t;
            return (0,
            lr.isDef)(a) && a !== "" && (l || a !== 0 && a !== "0")
        }
          , r = () => {
            const {dot: a, max: l, content: c} = t;
            if (!a && n())
                return e.content ? e.content() : (0,
                lr.isDef)(l) && (0,
                lr.isNumeric)(c) && +c > +l ? `${l}+` : c
        }
          , i = a => a.startsWith("-") ? a.replace("-", "") : `-${a}`
          , o = (0,
        Ih.computed)( () => {
            const a = {
                background: t.color
            };
            if (t.offset) {
                const [l,c] = t.offset
                  , {position: u} = t
                  , [f,d] = u.split("-");
                e.default ? (typeof c == "number" ? a[f] = (0,
                lr.addUnit)(f === "top" ? c : -c) : a[f] = f === "top" ? (0,
                lr.addUnit)(c) : i(c),
                typeof l == "number" ? a[d] = (0,
                lr.addUnit)(d === "left" ? l : -l) : a[d] = d === "left" ? (0,
                lr.addUnit)(l) : i(l)) : (a.marginTop = (0,
                lr.addUnit)(c),
                a.marginLeft = (0,
                lr.addUnit)(l))
            }
            return a
        }
        )
          , s = () => {
            if (n() || t.dot)
                return (0,
                Ih.createVNode)("div", {
                    class: DS([t.position, {
                        dot: t.dot,
                        fixed: !!e.default
                    }]),
                    style: o.value
                }, [r()])
        }
        ;
        return () => {
            if (e.default) {
                const {tag: a} = t;
                return (0,
                Ih.createVNode)(a, {
                    class: DS("wrapper")
                }, {
                    default: () => [e.default(), s()]
                })
            }
            return s()
        }
    }
})
  , gj = Object.create
  , Cg = Object.defineProperty
  , mj = Object.getOwnPropertyDescriptor
  , vj = Object.getOwnPropertyNames
  , yj = Object.getPrototypeOf
  , _j = Object.prototype.hasOwnProperty
  , xj = (t, e) => {
    for (var n in e)
        Cg(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , kR = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of vj(e))
            !_j.call(t, i) && i !== n && Cg(t, i, {
                get: () => e[i],
                enumerable: !(r = mj(e, i)) || r.enumerable
            });
    return t
}
  , bj = (t, e, n) => (n = t != null ? gj(yj(t)) : {},
kR(e || !t || !t.__esModule ? Cg(n, "default", {
    value: t,
    enumerable: !0
}) : n, t))
  , wj = t => kR(Cg({}, "__esModule", {
    value: !0
}), t)
  , NR = {};
xj(NR, {
    Badge: () => FR,
    badgeProps: () => Aj.badgeProps,
    default: () => Tj
});
var Ej = wj(NR)
  , Sj = jn
  , Cj = bj(DR)
  , Aj = DR;
const FR = (0,
Sj.withInstall)(Cj.default);
var Tj = FR
  , Wb = Object.defineProperty
  , Pj = Object.getOwnPropertyDescriptor
  , Ij = Object.getOwnPropertyNames
  , Oj = Object.prototype.hasOwnProperty
  , Rj = (t, e) => {
    for (var n in e)
        Wb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , Mj = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of Ij(e))
            !Oj.call(t, i) && i !== n && Wb(t, i, {
                get: () => e[i],
                enumerable: !(r = Pj(e, i)) || r.enumerable
            });
    return t
}
  , Dj = t => Mj(Wb({}, "__esModule", {
    value: !0
}), t)
  , LR = {};
Rj(LR, {
    setGlobalZIndex: () => kj,
    useGlobalZIndex: () => Bj
});
var $R = Dj(LR);
let UR = 2e3;
const Bj = () => ++UR
  , kj = t => {
    UR = t
}
;
var Yb = Object.defineProperty
  , Nj = Object.getOwnPropertyDescriptor
  , Fj = Object.getOwnPropertyNames
  , Lj = Object.prototype.hasOwnProperty
  , $j = (t, e) => {
    for (var n in e)
        Yb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , Uj = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of Fj(e))
            !Lj.call(t, i) && i !== n && Yb(t, i, {
                get: () => e[i],
                enumerable: !(r = Nj(e, i)) || r.enumerable
            });
    return t
}
  , Gj = t => Uj(Yb({}, "__esModule", {
    value: !0
}), t)
  , GR = {};
$j(GR, {
    CONFIG_PROVIDER_KEY: () => VR,
    configProviderProps: () => zR,
    default: () => Yj
});
var Hj = Gj(GR)
  , _i = zn
  , tl = jn
  , Vj = $R;
const [HR,zj] = (0,
tl.createNamespace)("config-provider")
  , VR = Symbol(HR)
  , zR = {
    tag: (0,
    tl.makeStringProp)("div"),
    theme: (0,
    tl.makeStringProp)("light"),
    zIndex: Number,
    themeVars: Object,
    themeVarsDark: Object,
    themeVarsLight: Object,
    themeVarsScope: (0,
    tl.makeStringProp)("local"),
    iconPrefix: String
};
function jj(t) {
    return t.replace(/([a-zA-Z])(\d)/g, "$1-$2")
}
function Wj(t) {
    const e = {};
    return Object.keys(t).forEach(n => {
        const r = jj((0,
        tl.kebabCase)(n));
        e[`--van-${r}`] = t[n]
    }
    ),
    e
}
function Oh(t={}, e={}) {
    Object.keys(t).forEach(n => {
        t[n] !== e[n] && document.documentElement.style.setProperty(n, t[n])
    }
    ),
    Object.keys(e).forEach(n => {
        t[n] || document.documentElement.style.removeProperty(n)
    }
    )
}
var Yj = (0,
_i.defineComponent)({
    name: HR,
    props: zR,
    setup(t, {slots: e}) {
        const n = (0,
        _i.computed)( () => Wj((0,
        tl.extend)({}, t.themeVars, t.theme === "dark" ? t.themeVarsDark : t.themeVarsLight)));
        if (tl.inBrowser) {
            const r = () => {
                document.documentElement.classList.add(`van-theme-${t.theme}`)
            }
              , i = (o=t.theme) => {
                document.documentElement.classList.remove(`van-theme-${o}`)
            }
            ;
            (0,
            _i.watch)( () => t.theme, (o, s) => {
                s && i(s),
                r()
            }
            , {
                immediate: !0
            }),
            (0,
            _i.onActivated)(r),
            (0,
            _i.onDeactivated)(i),
            (0,
            _i.onBeforeUnmount)(i),
            (0,
            _i.watch)(n, (o, s) => {
                t.themeVarsScope === "global" && Oh(o, s)
            }
            ),
            (0,
            _i.watch)( () => t.themeVarsScope, (o, s) => {
                s === "global" && Oh({}, n.value),
                o === "global" && Oh(n.value, {})
            }
            ),
            t.themeVarsScope === "global" && Oh(n.value, {})
        }
        return (0,
        _i.provide)(VR, t),
        (0,
        _i.watchEffect)( () => {
            t.zIndex !== void 0 && (0,
            Vj.setGlobalZIndex)(t.zIndex)
        }
        ),
        () => (0,
        _i.createVNode)(t.tag, {
            class: zj(),
            style: t.themeVarsScope === "local" ? n.value : void 0
        }, {
            default: () => {
                var r;
                return [(r = e.default) == null ? void 0 : r.call(e)]
            }
        })
    }
})
  , Xb = Object.defineProperty
  , Xj = Object.getOwnPropertyDescriptor
  , Kj = Object.getOwnPropertyNames
  , qj = Object.prototype.hasOwnProperty
  , Zj = (t, e) => {
    for (var n in e)
        Xb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , Jj = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of Kj(e))
            !qj.call(t, i) && i !== n && Xb(t, i, {
                get: () => e[i],
                enumerable: !(r = Xj(e, i)) || r.enumerable
            });
    return t
}
  , Qj = t => Jj(Xb({}, "__esModule", {
    value: !0
}), t)
  , jR = {};
Zj(jR, {
    default: () => iW,
    iconProps: () => YR
});
var WR = Qj(jR)
  , zl = zn
  , xf = jn
  , eW = Ej
  , tW = Hj;
const [nW,BS] = (0,
xf.createNamespace)("icon")
  , rW = t => t == null ? void 0 : t.includes("/")
  , YR = {
    dot: Boolean,
    tag: (0,
    xf.makeStringProp)("i"),
    name: String,
    size: xf.numericProp,
    badge: xf.numericProp,
    color: String,
    badgeProps: Object,
    classPrefix: String
};
var iW = (0,
zl.defineComponent)({
    name: nW,
    props: YR,
    setup(t, {slots: e}) {
        const n = (0,
        zl.inject)(tW.CONFIG_PROVIDER_KEY, null)
          , r = (0,
        zl.computed)( () => t.classPrefix || (n == null ? void 0 : n.iconPrefix) || BS());
        return () => {
            const {tag: i, dot: o, name: s, size: a, badge: l, color: c} = t
              , u = rW(s);
            return (0,
            zl.createVNode)(eW.Badge, (0,
            zl.mergeProps)({
                dot: o,
                tag: i,
                class: [r.value, u ? "" : `${r.value}-${s}`],
                style: {
                    color: c,
                    fontSize: (0,
                    xf.addUnit)(a)
                },
                content: l
            }, t.badgeProps), {
                default: () => {
                    var f;
                    return [(f = e.default) == null ? void 0 : f.call(e), u && (0,
                    zl.createVNode)("img", {
                        class: BS("image"),
                        src: s
                    }, null)]
                }
            })
        }
    }
})
  , oW = Object.create
  , Ag = Object.defineProperty
  , sW = Object.getOwnPropertyDescriptor
  , aW = Object.getOwnPropertyNames
  , lW = Object.getPrototypeOf
  , cW = Object.prototype.hasOwnProperty
  , uW = (t, e) => {
    for (var n in e)
        Ag(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , XR = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of aW(e))
            !cW.call(t, i) && i !== n && Ag(t, i, {
                get: () => e[i],
                enumerable: !(r = sW(e, i)) || r.enumerable
            });
    return t
}
  , fW = (t, e, n) => (n = t != null ? oW(lW(t)) : {},
XR(e || !t || !t.__esModule ? Ag(n, "default", {
    value: t,
    enumerable: !0
}) : n, t))
  , dW = t => XR(Ag({}, "__esModule", {
    value: !0
}), t)
  , KR = {};
uW(KR, {
    Icon: () => ZR,
    default: () => mW,
    iconProps: () => gW.iconProps
});
var qR = dW(KR)
  , hW = jn
  , pW = fW(WR)
  , gW = WR;
const ZR = (0,
hW.withInstall)(pW.default);
var mW = ZR
  , Kb = Object.defineProperty
  , vW = Object.getOwnPropertyDescriptor
  , yW = Object.getOwnPropertyNames
  , _W = Object.prototype.hasOwnProperty
  , xW = (t, e) => {
    for (var n in e)
        Kb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , bW = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of yW(e))
            !_W.call(t, i) && i !== n && Kb(t, i, {
                get: () => e[i],
                enumerable: !(r = vW(e, i)) || r.enumerable
            });
    return t
}
  , wW = t => bW(Kb({}, "__esModule", {
    value: !0
}), t)
  , JR = {};
xW(JR, {
    popupSharedPropKeys: () => SW,
    popupSharedProps: () => QR
});
var EW = wW(JR)
  , xa = jn;
const QR = {
    show: Boolean,
    zIndex: xa.numericProp,
    overlay: xa.truthProp,
    duration: xa.numericProp,
    teleport: [String, Object],
    lockScroll: xa.truthProp,
    lazyRender: xa.truthProp,
    beforeClose: Function,
    overlayProps: Object,
    overlayStyle: Object,
    overlayClass: xa.unknownProp,
    transitionAppear: Boolean,
    closeOnClickOverlay: xa.truthProp
}
  , SW = Object.keys(QR);
var qb = Object.defineProperty
  , CW = Object.getOwnPropertyDescriptor
  , AW = Object.getOwnPropertyNames
  , TW = Object.prototype.hasOwnProperty
  , PW = (t, e) => {
    for (var n in e)
        qb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , IW = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of AW(e))
            !TW.call(t, i) && i !== n && qb(t, i, {
                get: () => e[i],
                enumerable: !(r = CW(e, i)) || r.enumerable
            });
    return t
}
  , OW = t => IW(qb({}, "__esModule", {
    value: !0
}), t)
  , e8 = {};
PW(e8, {
    useTouch: () => DW
});
var RW = OW(e8)
  , vs = zn
  , kS = jn;
function MW(t, e) {
    return t > e ? "horizontal" : e > t ? "vertical" : ""
}
function DW() {
    const t = (0,
    vs.ref)(0)
      , e = (0,
    vs.ref)(0)
      , n = (0,
    vs.ref)(0)
      , r = (0,
    vs.ref)(0)
      , i = (0,
    vs.ref)(0)
      , o = (0,
    vs.ref)(0)
      , s = (0,
    vs.ref)("")
      , a = (0,
    vs.ref)(!0)
      , l = () => s.value === "vertical"
      , c = () => s.value === "horizontal"
      , u = () => {
        n.value = 0,
        r.value = 0,
        i.value = 0,
        o.value = 0,
        s.value = "",
        a.value = !0
    }
    ;
    return {
        move: h => {
            const p = h.touches[0];
            n.value = (p.clientX < 0 ? 0 : p.clientX) - t.value,
            r.value = p.clientY - e.value,
            i.value = Math.abs(n.value),
            o.value = Math.abs(r.value);
            const y = 10;
            (!s.value || i.value < y && o.value < y) && (s.value = MW(i.value, o.value)),
            a.value && (i.value > kS.TAP_OFFSET || o.value > kS.TAP_OFFSET) && (a.value = !1)
        }
        ,
        start: h => {
            u(),
            t.value = h.touches[0].clientX,
            e.value = h.touches[0].clientY
        }
        ,
        reset: u,
        startX: t,
        startY: e,
        deltaX: n,
        deltaY: r,
        offsetX: i,
        offsetY: o,
        direction: s,
        isVertical: l,
        isHorizontal: c,
        isTap: a
    }
}
var Zb = Object.defineProperty
  , BW = Object.getOwnPropertyDescriptor
  , kW = Object.getOwnPropertyNames
  , NW = Object.prototype.hasOwnProperty
  , FW = (t, e) => {
    for (var n in e)
        Zb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , LW = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of kW(e))
            !NW.call(t, i) && i !== n && Zb(t, i, {
                get: () => e[i],
                enumerable: !(r = BW(e, i)) || r.enumerable
            });
    return t
}
  , $W = t => LW(Zb({}, "__esModule", {
    value: !0
}), t)
  , t8 = {};
FW(t8, {
    useLockScroll: () => VW
});
var UW = $W(t8)
  , Vm = zn
  , NS = wg
  , GW = RW
  , HW = jn;
let Ru = 0;
const FS = "van-overflow-hidden";
function VW(t, e) {
    const n = (0,
    GW.useTouch)()
      , r = "01"
      , i = "10"
      , o = u => {
        n.move(u);
        const f = n.deltaY.value > 0 ? i : r
          , d = (0,
        NS.getScrollParent)(u.target, t.value)
          , {scrollHeight: h, offsetHeight: p, scrollTop: y} = d;
        let v = "11";
        y === 0 ? v = p >= h ? "00" : "01" : y + p >= h && (v = "10"),
        v !== "11" && n.isVertical() && !(parseInt(v, 2) & parseInt(f, 2)) && (0,
        HW.preventDefault)(u, !0)
    }
      , s = () => {
        document.addEventListener("touchstart", n.start),
        document.addEventListener("touchmove", o, {
            passive: !1
        }),
        Ru || document.body.classList.add(FS),
        Ru++
    }
      , a = () => {
        Ru && (document.removeEventListener("touchstart", n.start),
        document.removeEventListener("touchmove", o),
        Ru--,
        Ru || document.body.classList.remove(FS))
    }
      , l = () => e() && s()
      , c = () => e() && a();
    (0,
    NS.onMountedOrActivated)(l),
    (0,
    Vm.onDeactivated)(c),
    (0,
    Vm.onBeforeUnmount)(c),
    (0,
    Vm.watch)(e, u => {
        u ? s() : a()
    }
    )
}
var Jb = Object.defineProperty
  , zW = Object.getOwnPropertyDescriptor
  , jW = Object.getOwnPropertyNames
  , WW = Object.prototype.hasOwnProperty
  , YW = (t, e) => {
    for (var n in e)
        Jb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , XW = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of jW(e))
            !WW.call(t, i) && i !== n && Jb(t, i, {
                get: () => e[i],
                enumerable: !(r = zW(e, i)) || r.enumerable
            });
    return t
}
  , KW = t => XW(Jb({}, "__esModule", {
    value: !0
}), t)
  , n8 = {};
YW(n8, {
    useLazyRender: () => qW
});
var r8 = KW(n8)
  , LS = zn;
function qW(t) {
    const e = (0,
    LS.ref)(!1);
    return (0,
    LS.watch)(t, n => {
        n && (e.value = n)
    }
    , {
        immediate: !0
    }),
    n => () => e.value ? n() : null
}
var Qb = Object.defineProperty
  , ZW = Object.getOwnPropertyDescriptor
  , JW = Object.getOwnPropertyNames
  , QW = Object.prototype.hasOwnProperty
  , eY = (t, e) => {
    for (var n in e)
        Qb(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , tY = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of JW(e))
            !QW.call(t, i) && i !== n && Qb(t, i, {
                get: () => e[i],
                enumerable: !(r = ZW(e, i)) || r.enumerable
            });
    return t
}
  , nY = t => tY(Qb({}, "__esModule", {
    value: !0
}), t)
  , i8 = {};
eY(i8, {
    POPUP_TOGGLE_KEY: () => o8,
    onPopupReopen: () => iY
});
var rY = nY(i8)
  , $S = zn;
const o8 = Symbol();
function iY(t) {
    const e = (0,
    $S.inject)(o8, null);
    e && (0,
    $S.watch)(e, n => {
        n && t()
    }
    )
}
var ew = Object.defineProperty
  , oY = Object.getOwnPropertyDescriptor
  , sY = Object.getOwnPropertyNames
  , aY = Object.prototype.hasOwnProperty
  , lY = (t, e) => {
    for (var n in e)
        ew(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , cY = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of sY(e))
            !aY.call(t, i) && i !== n && ew(t, i, {
                get: () => e[i],
                enumerable: !(r = oY(e, i)) || r.enumerable
            });
    return t
}
  , uY = t => cY(ew({}, "__esModule", {
    value: !0
}), t)
  , s8 = {};
lY(s8, {
    useScopeId: () => hY
});
var fY = uY(s8)
  , dY = zn;
const hY = () => {
    var t;
    const {scopeId: e} = ((t = (0,
    dY.getCurrentInstance)()) == null ? void 0 : t.vnode) || {};
    return e ? {
        [e]: ""
    } : null
}
;
var tw = Object.defineProperty
  , pY = Object.getOwnPropertyDescriptor
  , gY = Object.getOwnPropertyNames
  , mY = Object.prototype.hasOwnProperty
  , vY = (t, e) => {
    for (var n in e)
        tw(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , yY = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of gY(e))
            !mY.call(t, i) && i !== n && tw(t, i, {
                get: () => e[i],
                enumerable: !(r = pY(e, i)) || r.enumerable
            });
    return t
}
  , _Y = t => yY(tw({}, "__esModule", {
    value: !0
}), t)
  , a8 = {};
vY(a8, {
    default: () => SY,
    overlayProps: () => c8
});
var l8 = _Y(a8)
  , zi = zn
  , no = jn
  , xY = wg
  , bY = r8;
const [wY,EY] = (0,
no.createNamespace)("overlay")
  , c8 = {
    show: Boolean,
    zIndex: no.numericProp,
    duration: no.numericProp,
    className: no.unknownProp,
    lockScroll: no.truthProp,
    lazyRender: no.truthProp,
    customStyle: Object,
    teleport: [String, Object]
};
var SY = (0,
zi.defineComponent)({
    name: wY,
    inheritAttrs: !1,
    props: c8,
    setup(t, {attrs: e, slots: n}) {
        const r = (0,
        zi.ref)()
          , i = (0,
        bY.useLazyRender)( () => t.show || !t.lazyRender)
          , o = a => {
            t.lockScroll && (0,
            no.preventDefault)(a, !0)
        }
          , s = i( () => {
            var a;
            const l = (0,
            no.extend)((0,
            no.getZIndexStyle)(t.zIndex), t.customStyle);
            return (0,
            no.isDef)(t.duration) && (l.animationDuration = `${t.duration}s`),
            (0,
            zi.withDirectives)((0,
            zi.createVNode)("div", (0,
            zi.mergeProps)({
                ref: r,
                style: l,
                class: [EY(), t.className]
            }, e), [(a = n.default) == null ? void 0 : a.call(n)]), [[zi.vShow, t.show]])
        }
        );
        return (0,
        xY.useEventListener)("touchmove", o, {
            target: r
        }),
        () => {
            const a = (0,
            zi.createVNode)(zi.Transition, {
                name: "van-fade",
                appear: !0
            }, {
                default: s
            });
            return t.teleport ? (0,
            zi.createVNode)(zi.Teleport, {
                to: t.teleport
            }, {
                default: () => [a]
            }) : a
        }
    }
})
  , CY = Object.create
  , Tg = Object.defineProperty
  , AY = Object.getOwnPropertyDescriptor
  , TY = Object.getOwnPropertyNames
  , PY = Object.getPrototypeOf
  , IY = Object.prototype.hasOwnProperty
  , OY = (t, e) => {
    for (var n in e)
        Tg(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , u8 = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of TY(e))
            !IY.call(t, i) && i !== n && Tg(t, i, {
                get: () => e[i],
                enumerable: !(r = AY(e, i)) || r.enumerable
            });
    return t
}
  , RY = (t, e, n) => (n = t != null ? CY(PY(t)) : {},
u8(e || !t || !t.__esModule ? Tg(n, "default", {
    value: t,
    enumerable: !0
}) : n, t))
  , MY = t => u8(Tg({}, "__esModule", {
    value: !0
}), t)
  , f8 = {};
OY(f8, {
    Overlay: () => d8,
    default: () => FY,
    overlayProps: () => NY.overlayProps
});
var DY = MY(f8)
  , BY = jn
  , kY = RY(l8)
  , NY = l8;
const d8 = (0,
BY.withInstall)(kY.default);
var FY = d8
  , nw = Object.defineProperty
  , LY = Object.getOwnPropertyDescriptor
  , $Y = Object.getOwnPropertyNames
  , UY = Object.prototype.hasOwnProperty
  , GY = (t, e) => {
    for (var n in e)
        nw(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , HY = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of $Y(e))
            !UY.call(t, i) && i !== n && nw(t, i, {
                get: () => e[i],
                enumerable: !(r = LY(e, i)) || r.enumerable
            });
    return t
}
  , VY = t => HY(nw({}, "__esModule", {
    value: !0
}), t)
  , h8 = {};
GY(h8, {
    default: () => eX,
    popupProps: () => g8
});
var p8 = VY(h8)
  , Vt = zn
  , zY = EW
  , Vo = jn
  , jY = wg
  , WY = PR
  , YY = UW
  , XY = r8
  , KY = rY
  , qY = $R
  , US = fY
  , ZY = qR
  , JY = DY;
const g8 = (0,
Vo.extend)({}, zY.popupSharedProps, {
    round: Boolean,
    position: (0,
    Vo.makeStringProp)("center"),
    closeIcon: (0,
    Vo.makeStringProp)("cross"),
    closeable: Boolean,
    transition: String,
    iconPrefix: String,
    closeOnPopstate: Boolean,
    closeIconPosition: (0,
    Vo.makeStringProp)("top-right"),
    destroyOnClose: Boolean,
    safeAreaInsetTop: Boolean,
    safeAreaInsetBottom: Boolean
})
  , [QY,GS] = (0,
Vo.createNamespace)("popup");
var eX = (0,
Vt.defineComponent)({
    name: QY,
    inheritAttrs: !1,
    props: g8,
    emits: ["open", "close", "opened", "closed", "keydown", "update:show", "clickOverlay", "clickCloseIcon"],
    setup(t, {emit: e, attrs: n, slots: r}) {
        let i, o;
        const s = (0,
        Vt.ref)()
          , a = (0,
        Vt.ref)()
          , l = (0,
        XY.useLazyRender)( () => t.show || !t.lazyRender)
          , c = (0,
        Vt.computed)( () => {
            const w = {
                zIndex: s.value
            };
            if ((0,
            Vo.isDef)(t.duration)) {
                const E = t.position === "center" ? "animationDuration" : "transitionDuration";
                w[E] = `${t.duration}s`
            }
            return w
        }
        )
          , u = () => {
            i || (i = !0,
            s.value = t.zIndex !== void 0 ? +t.zIndex : (0,
            qY.useGlobalZIndex)(),
            e("open"))
        }
          , f = () => {
            i && (0,
            Vo.callInterceptor)(t.beforeClose, {
                done() {
                    i = !1,
                    e("close"),
                    e("update:show", !1)
                }
            })
        }
          , d = w => {
            e("clickOverlay", w),
            t.closeOnClickOverlay && f()
        }
          , h = () => {
            if (t.overlay) {
                const w = (0,
                Vo.extend)({
                    show: t.show,
                    class: t.overlayClass,
                    zIndex: s.value,
                    duration: t.duration,
                    customStyle: t.overlayStyle,
                    role: t.closeOnClickOverlay ? "button" : void 0,
                    tabindex: t.closeOnClickOverlay ? 0 : void 0
                }, t.overlayProps);
                return (0,
                Vt.createVNode)(JY.Overlay, (0,
                Vt.mergeProps)(w, (0,
                US.useScopeId)(), {
                    onClick: d
                }), {
                    default: r["overlay-content"]
                })
            }
        }
          , p = w => {
            e("clickCloseIcon", w),
            f()
        }
          , y = () => {
            if (t.closeable)
                return (0,
                Vt.createVNode)(ZY.Icon, {
                    role: "button",
                    tabindex: 0,
                    name: t.closeIcon,
                    class: [GS("close-icon", t.closeIconPosition), Vo.HAPTICS_FEEDBACK],
                    classPrefix: t.iconPrefix,
                    onClick: p
                }, null)
        }
        ;
        let v;
        const g = () => {
            v && clearTimeout(v),
            v = setTimeout( () => {
                e("opened")
            }
            )
        }
          , m = () => e("closed")
          , _ = w => e("keydown", w)
          , x = l( () => {
            var w;
            const {destroyOnClose: E, round: S, position: P, safeAreaInsetTop: C, safeAreaInsetBottom: A, show: T} = t;
            if (!(!T && E))
                return (0,
                Vt.withDirectives)((0,
                Vt.createVNode)("div", (0,
                Vt.mergeProps)({
                    ref: a,
                    style: c.value,
                    role: "dialog",
                    tabindex: 0,
                    class: [GS({
                        round: S,
                        [P]: P
                    }), {
                        "van-safe-area-top": C,
                        "van-safe-area-bottom": A
                    }],
                    onKeydown: _
                }, n, (0,
                US.useScopeId)()), [(w = r.default) == null ? void 0 : w.call(r), y()]), [[Vt.vShow, T]])
        }
        )
          , b = () => {
            const {position: w, transition: E, transitionAppear: S} = t
              , P = w === "center" ? "van-fade" : `van-popup-slide-${w}`;
            return (0,
            Vt.createVNode)(Vt.Transition, {
                name: E || P,
                appear: S,
                onAfterEnter: g,
                onAfterLeave: m
            }, {
                default: x
            })
        }
        ;
        return (0,
        Vt.watch)( () => t.show, w => {
            w && !i && (u(),
            n.tabindex === 0 && (0,
            Vt.nextTick)( () => {
                var E;
                (E = a.value) == null || E.focus()
            }
            )),
            !w && i && (i = !1,
            e("close"))
        }
        ),
        (0,
        WY.useExpose)({
            popupRef: a
        }),
        (0,
        YY.useLockScroll)(a, () => t.show && t.lockScroll),
        (0,
        jY.useEventListener)("popstate", () => {
            t.closeOnPopstate && (f(),
            o = !1)
        }
        ),
        (0,
        Vt.onMounted)( () => {
            t.show && u()
        }
        ),
        (0,
        Vt.onActivated)( () => {
            o && (e("update:show", !0),
            o = !1)
        }
        ),
        (0,
        Vt.onDeactivated)( () => {
            t.show && t.teleport && (f(),
            o = !0)
        }
        ),
        (0,
        Vt.provide)(KY.POPUP_TOGGLE_KEY, () => t.show),
        () => t.teleport ? (0,
        Vt.createVNode)(Vt.Teleport, {
            to: t.teleport
        }, {
            default: () => [h(), b()]
        }) : (0,
        Vt.createVNode)(Vt.Fragment, null, [h(), b()])
    }
})
  , tX = Object.create
  , Pg = Object.defineProperty
  , nX = Object.getOwnPropertyDescriptor
  , rX = Object.getOwnPropertyNames
  , iX = Object.getPrototypeOf
  , oX = Object.prototype.hasOwnProperty
  , sX = (t, e) => {
    for (var n in e)
        Pg(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , m8 = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of rX(e))
            !oX.call(t, i) && i !== n && Pg(t, i, {
                get: () => e[i],
                enumerable: !(r = nX(e, i)) || r.enumerable
            });
    return t
}
  , aX = (t, e, n) => (n = t != null ? tX(iX(t)) : {},
m8(e || !t || !t.__esModule ? Pg(n, "default", {
    value: t,
    enumerable: !0
}) : n, t))
  , lX = t => m8(Pg({}, "__esModule", {
    value: !0
}), t)
  , v8 = {};
sX(v8, {
    Popup: () => y8,
    default: () => hX,
    popupProps: () => dX.popupProps
});
var cX = lX(v8)
  , uX = jn
  , fX = aX(p8)
  , dX = p8;
const y8 = (0,
uX.withInstall)(fX.default);
var hX = y8
  , rw = Object.defineProperty
  , pX = Object.getOwnPropertyDescriptor
  , gX = Object.getOwnPropertyNames
  , mX = Object.prototype.hasOwnProperty
  , vX = (t, e) => {
    for (var n in e)
        rw(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , yX = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of gX(e))
            !mX.call(t, i) && i !== n && rw(t, i, {
                get: () => e[i],
                enumerable: !(r = pX(e, i)) || r.enumerable
            });
    return t
}
  , _X = t => yX(rw({}, "__esModule", {
    value: !0
}), t)
  , _8 = {};
vX(_8, {
    default: () => EX,
    loadingProps: () => b8
});
var x8 = _X(_8)
  , Ms = zn
  , nl = jn;
const [xX,bf] = (0,
nl.createNamespace)("loading")
  , bX = Array(12).fill(null).map( (t, e) => (0,
Ms.createVNode)("i", {
    class: bf("line", String(e + 1))
}, null))
  , wX = (0,
Ms.createVNode)("svg", {
    class: bf("circular"),
    viewBox: "25 25 50 50"
}, [(0,
Ms.createVNode)("circle", {
    cx: "50",
    cy: "50",
    r: "20",
    fill: "none"
}, null)])
  , b8 = {
    size: nl.numericProp,
    type: (0,
    nl.makeStringProp)("circular"),
    color: String,
    vertical: Boolean,
    textSize: nl.numericProp,
    textColor: String
};
var EX = (0,
Ms.defineComponent)({
    name: xX,
    props: b8,
    setup(t, {slots: e}) {
        const n = (0,
        Ms.computed)( () => (0,
        nl.extend)({
            color: t.color
        }, (0,
        nl.getSizeStyle)(t.size)))
          , r = () => {
            const o = t.type === "spinner" ? bX : wX;
            return (0,
            Ms.createVNode)("span", {
                class: bf("spinner", t.type),
                style: n.value
            }, [e.icon ? e.icon() : o])
        }
          , i = () => {
            var o;
            if (e.default)
                return (0,
                Ms.createVNode)("span", {
                    class: bf("text"),
                    style: {
                        fontSize: (0,
                        nl.addUnit)(t.textSize),
                        color: (o = t.textColor) != null ? o : t.color
                    }
                }, [e.default()])
        }
        ;
        return () => {
            const {type: o, vertical: s} = t;
            return (0,
            Ms.createVNode)("div", {
                class: bf([o, {
                    vertical: s
                }]),
                "aria-live": "polite",
                "aria-busy": !0
            }, [r(), i()])
        }
    }
})
  , SX = Object.create
  , Ig = Object.defineProperty
  , CX = Object.getOwnPropertyDescriptor
  , AX = Object.getOwnPropertyNames
  , TX = Object.getPrototypeOf
  , PX = Object.prototype.hasOwnProperty
  , IX = (t, e) => {
    for (var n in e)
        Ig(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , w8 = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of AX(e))
            !PX.call(t, i) && i !== n && Ig(t, i, {
                get: () => e[i],
                enumerable: !(r = CX(e, i)) || r.enumerable
            });
    return t
}
  , OX = (t, e, n) => (n = t != null ? SX(TX(t)) : {},
w8(e || !t || !t.__esModule ? Ig(n, "default", {
    value: t,
    enumerable: !0
}) : n, t))
  , RX = t => w8(Ig({}, "__esModule", {
    value: !0
}), t)
  , E8 = {};
IX(E8, {
    Loading: () => S8,
    default: () => NX,
    loadingProps: () => kX.loadingProps
});
var MX = RX(E8)
  , DX = jn
  , BX = OX(x8)
  , kX = x8;
const S8 = (0,
DX.withInstall)(BX.default);
var NX = S8
  , iw = Object.defineProperty
  , FX = Object.getOwnPropertyDescriptor
  , LX = Object.getOwnPropertyNames
  , $X = Object.prototype.hasOwnProperty
  , UX = (t, e) => {
    for (var n in e)
        iw(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , GX = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of LX(e))
            !$X.call(t, i) && i !== n && iw(t, i, {
                get: () => e[i],
                enumerable: !(r = FX(e, i)) || r.enumerable
            });
    return t
}
  , HX = t => GX(iw({}, "__esModule", {
    value: !0
}), t)
  , C8 = {};
UX(C8, {
    default: () => qX,
    toastProps: () => A8
});
var VX = HX(C8)
  , ti = zn
  , si = jn
  , zX = oj
  , jX = qR
  , WX = cX
  , YX = MX;
const [XX,jl] = (0,
si.createNamespace)("toast")
  , KX = ["show", "overlay", "teleport", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay", "zIndex"]
  , A8 = {
    icon: String,
    show: Boolean,
    type: (0,
    si.makeStringProp)("text"),
    overlay: Boolean,
    message: si.numericProp,
    iconSize: si.numericProp,
    duration: (0,
    si.makeNumberProp)(2e3),
    position: (0,
    si.makeStringProp)("middle"),
    teleport: [String, Object],
    wordBreak: String,
    className: si.unknownProp,
    iconPrefix: String,
    transition: (0,
    si.makeStringProp)("van-fade"),
    loadingType: String,
    forbidClick: Boolean,
    overlayClass: si.unknownProp,
    overlayStyle: Object,
    closeOnClick: Boolean,
    closeOnClickOverlay: Boolean,
    zIndex: si.numericProp
};
var qX = (0,
ti.defineComponent)({
    name: XX,
    props: A8,
    emits: ["update:show"],
    setup(t, {emit: e, slots: n}) {
        let r, i = !1;
        const o = () => {
            const f = t.show && t.forbidClick;
            i !== f && (i = f,
            (0,
            zX.lockClick)(i))
        }
          , s = f => e("update:show", f)
          , a = () => {
            t.closeOnClick && s(!1)
        }
          , l = () => clearTimeout(r)
          , c = () => {
            const {icon: f, type: d, iconSize: h, iconPrefix: p, loadingType: y} = t;
            if (f || d === "success" || d === "fail")
                return (0,
                ti.createVNode)(jX.Icon, {
                    name: f || d,
                    size: h,
                    class: jl("icon"),
                    classPrefix: p
                }, null);
            if (d === "loading")
                return (0,
                ti.createVNode)(YX.Loading, {
                    class: jl("loading"),
                    size: h,
                    type: y
                }, null)
        }
          , u = () => {
            const {type: f, message: d} = t;
            if (n.message)
                return (0,
                ti.createVNode)("div", {
                    class: jl("text")
                }, [n.message()]);
            if ((0,
            si.isDef)(d) && d !== "")
                return f === "html" ? (0,
                ti.createVNode)("div", {
                    key: 0,
                    class: jl("text"),
                    innerHTML: String(d)
                }, null) : (0,
                ti.createVNode)("div", {
                    class: jl("text")
                }, [d])
        }
        ;
        return (0,
        ti.watch)( () => [t.show, t.forbidClick], o),
        (0,
        ti.watch)( () => [t.show, t.type, t.message, t.duration], () => {
            l(),
            t.show && t.duration > 0 && (r = setTimeout( () => {
                s(!1)
            }
            , t.duration))
        }
        ),
        (0,
        ti.onMounted)(o),
        (0,
        ti.onUnmounted)(o),
        () => (0,
        ti.createVNode)(WX.Popup, (0,
        ti.mergeProps)({
            class: [jl([t.position, t.wordBreak === "normal" ? "break-normal" : t.wordBreak, {
                [t.type]: !t.icon
            }]), t.className],
            lockScroll: !1,
            onClick: a,
            onClosed: l,
            "onUpdate:show": s
        }, (0,
        si.pick)(t, KX)), {
            default: () => [c(), u()]
        })
    }
})
  , ZX = Object.create
  , Og = Object.defineProperty
  , JX = Object.getOwnPropertyDescriptor
  , QX = Object.getOwnPropertyNames
  , eK = Object.getPrototypeOf
  , tK = Object.prototype.hasOwnProperty
  , nK = (t, e) => {
    for (var n in e)
        Og(t, n, {
            get: e[n],
            enumerable: !0
        })
}
  , T8 = (t, e, n, r) => {
    if (e && typeof e == "object" || typeof e == "function")
        for (let i of QX(e))
            !tK.call(t, i) && i !== n && Og(t, i, {
                get: () => e[i],
                enumerable: !(r = JX(e, i)) || r.enumerable
            });
    return t
}
  , rK = (t, e, n) => (n = t != null ? ZX(eK(t)) : {},
T8(e || !t || !t.__esModule ? Og(n, "default", {
    value: t,
    enumerable: !0
}) : n, t))
  , iK = t => T8(Og({}, "__esModule", {
    value: !0
}), t)
  , P8 = {};
nK(P8, {
    allowMultipleToast: () => pK,
    closeToast: () => fK,
    resetToastDefaultOptions: () => hK,
    setToastDefaultOptions: () => dK,
    showFailToast: () => uK,
    showLoadingToast: () => lK,
    showSuccessToast: () => cK,
    showToast: () => R8
});
var XTe = iK(P8)
  , Mu = zn
  , dl = jn
  , HS = Xz
  , oK = rK(VX);
const I8 = {
    icon: "",
    type: "text",
    message: "",
    className: "",
    overlay: !1,
    onClose: void 0,
    onOpened: void 0,
    duration: 2e3,
    teleport: "body",
    iconSize: void 0,
    iconPrefix: void 0,
    position: "middle",
    transition: "van-fade",
    forbidClick: !1,
    loadingType: void 0,
    overlayClass: "",
    overlayStyle: void 0,
    closeOnClick: !1,
    closeOnClickOverlay: !1
};
let Ti = []
  , Rg = !1
  , l0 = (0,
dl.extend)({}, I8);
const c0 = new Map;
function O8(t) {
    return (0,
    dl.isObject)(t) ? t : {
        message: t
    }
}
function sK() {
    const {instance: t, unmount: e} = (0,
    HS.mountComponent)({
        setup() {
            const n = (0,
            Mu.ref)("")
              , {open: r, state: i, close: o, toggle: s} = (0,
            HS.usePopupState)()
              , a = () => {
                Rg && (Ti = Ti.filter(c => c !== t),
                e())
            }
              , l = () => {
                const c = {
                    onClosed: a,
                    "onUpdate:show": s
                };
                return (0,
                Mu.createVNode)(oK.default, (0,
                Mu.mergeProps)(i, c), null)
            }
            ;
            return (0,
            Mu.watch)(n, c => {
                i.message = c
            }
            ),
            (0,
            Mu.getCurrentInstance)().render = l,
            {
                open: r,
                close: o,
                message: n
            }
        }
    });
    return t
}
function aK() {
    if (!Ti.length || Rg) {
        const t = sK();
        Ti.push(t)
    }
    return Ti[Ti.length - 1]
}
function R8(t={}) {
    if (!dl.inBrowser)
        return {};
    const e = aK()
      , n = O8(t);
    return e.open((0,
    dl.extend)({}, l0, c0.get(n.type || l0.type), n)),
    e
}
const ow = t => e => R8((0,
dl.extend)({
    type: t
}, O8(e)))
  , lK = ow("loading")
  , cK = ow("success")
  , uK = ow("fail")
  , fK = t => {
    var e;
    Ti.length && (t ? (Ti.forEach(n => {
        n.close()
    }
    ),
    Ti = []) : Rg ? (e = Ti.shift()) == null || e.close() : Ti[0].close())
}
;
function dK(t, e) {
    typeof t == "string" ? c0.set(t, e) : (0,
    dl.extend)(l0, t)
}
const hK = t => {
    typeof t == "string" ? c0.delete(t) : (l0 = (0,
    dl.extend)({}, I8),
    c0.clear())
}
  , pK = (t=!0) => {
    Rg = t
}
;
var M8 = {
    exports: {}
};
(function(t, e) {
    (function(n) {
        t.exports = n()
    }
    )(function(n) {
        var r = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
        function i(g, m) {
            var _ = g[0]
              , x = g[1]
              , b = g[2]
              , w = g[3];
            _ += (x & b | ~x & w) + m[0] - 680876936 | 0,
            _ = (_ << 7 | _ >>> 25) + x | 0,
            w += (_ & x | ~_ & b) + m[1] - 389564586 | 0,
            w = (w << 12 | w >>> 20) + _ | 0,
            b += (w & _ | ~w & x) + m[2] + 606105819 | 0,
            b = (b << 17 | b >>> 15) + w | 0,
            x += (b & w | ~b & _) + m[3] - 1044525330 | 0,
            x = (x << 22 | x >>> 10) + b | 0,
            _ += (x & b | ~x & w) + m[4] - 176418897 | 0,
            _ = (_ << 7 | _ >>> 25) + x | 0,
            w += (_ & x | ~_ & b) + m[5] + 1200080426 | 0,
            w = (w << 12 | w >>> 20) + _ | 0,
            b += (w & _ | ~w & x) + m[6] - 1473231341 | 0,
            b = (b << 17 | b >>> 15) + w | 0,
            x += (b & w | ~b & _) + m[7] - 45705983 | 0,
            x = (x << 22 | x >>> 10) + b | 0,
            _ += (x & b | ~x & w) + m[8] + 1770035416 | 0,
            _ = (_ << 7 | _ >>> 25) + x | 0,
            w += (_ & x | ~_ & b) + m[9] - 1958414417 | 0,
            w = (w << 12 | w >>> 20) + _ | 0,
            b += (w & _ | ~w & x) + m[10] - 42063 | 0,
            b = (b << 17 | b >>> 15) + w | 0,
            x += (b & w | ~b & _) + m[11] - 1990404162 | 0,
            x = (x << 22 | x >>> 10) + b | 0,
            _ += (x & b | ~x & w) + m[12] + 1804603682 | 0,
            _ = (_ << 7 | _ >>> 25) + x | 0,
            w += (_ & x | ~_ & b) + m[13] - 40341101 | 0,
            w = (w << 12 | w >>> 20) + _ | 0,
            b += (w & _ | ~w & x) + m[14] - 1502002290 | 0,
            b = (b << 17 | b >>> 15) + w | 0,
            x += (b & w | ~b & _) + m[15] + 1236535329 | 0,
            x = (x << 22 | x >>> 10) + b | 0,
            _ += (x & w | b & ~w) + m[1] - 165796510 | 0,
            _ = (_ << 5 | _ >>> 27) + x | 0,
            w += (_ & b | x & ~b) + m[6] - 1069501632 | 0,
            w = (w << 9 | w >>> 23) + _ | 0,
            b += (w & x | _ & ~x) + m[11] + 643717713 | 0,
            b = (b << 14 | b >>> 18) + w | 0,
            x += (b & _ | w & ~_) + m[0] - 373897302 | 0,
            x = (x << 20 | x >>> 12) + b | 0,
            _ += (x & w | b & ~w) + m[5] - 701558691 | 0,
            _ = (_ << 5 | _ >>> 27) + x | 0,
            w += (_ & b | x & ~b) + m[10] + 38016083 | 0,
            w = (w << 9 | w >>> 23) + _ | 0,
            b += (w & x | _ & ~x) + m[15] - 660478335 | 0,
            b = (b << 14 | b >>> 18) + w | 0,
            x += (b & _ | w & ~_) + m[4] - 405537848 | 0,
            x = (x << 20 | x >>> 12) + b | 0,
            _ += (x & w | b & ~w) + m[9] + 568446438 | 0,
            _ = (_ << 5 | _ >>> 27) + x | 0,
            w += (_ & b | x & ~b) + m[14] - 1019803690 | 0,
            w = (w << 9 | w >>> 23) + _ | 0,
            b += (w & x | _ & ~x) + m[3] - 187363961 | 0,
            b = (b << 14 | b >>> 18) + w | 0,
            x += (b & _ | w & ~_) + m[8] + 1163531501 | 0,
            x = (x << 20 | x >>> 12) + b | 0,
            _ += (x & w | b & ~w) + m[13] - 1444681467 | 0,
            _ = (_ << 5 | _ >>> 27) + x | 0,
            w += (_ & b | x & ~b) + m[2] - 51403784 | 0,
            w = (w << 9 | w >>> 23) + _ | 0,
            b += (w & x | _ & ~x) + m[7] + 1735328473 | 0,
            b = (b << 14 | b >>> 18) + w | 0,
            x += (b & _ | w & ~_) + m[12] - 1926607734 | 0,
            x = (x << 20 | x >>> 12) + b | 0,
            _ += (x ^ b ^ w) + m[5] - 378558 | 0,
            _ = (_ << 4 | _ >>> 28) + x | 0,
            w += (_ ^ x ^ b) + m[8] - 2022574463 | 0,
            w = (w << 11 | w >>> 21) + _ | 0,
            b += (w ^ _ ^ x) + m[11] + 1839030562 | 0,
            b = (b << 16 | b >>> 16) + w | 0,
            x += (b ^ w ^ _) + m[14] - 35309556 | 0,
            x = (x << 23 | x >>> 9) + b | 0,
            _ += (x ^ b ^ w) + m[1] - 1530992060 | 0,
            _ = (_ << 4 | _ >>> 28) + x | 0,
            w += (_ ^ x ^ b) + m[4] + 1272893353 | 0,
            w = (w << 11 | w >>> 21) + _ | 0,
            b += (w ^ _ ^ x) + m[7] - 155497632 | 0,
            b = (b << 16 | b >>> 16) + w | 0,
            x += (b ^ w ^ _) + m[10] - 1094730640 | 0,
            x = (x << 23 | x >>> 9) + b | 0,
            _ += (x ^ b ^ w) + m[13] + 681279174 | 0,
            _ = (_ << 4 | _ >>> 28) + x | 0,
            w += (_ ^ x ^ b) + m[0] - 358537222 | 0,
            w = (w << 11 | w >>> 21) + _ | 0,
            b += (w ^ _ ^ x) + m[3] - 722521979 | 0,
            b = (b << 16 | b >>> 16) + w | 0,
            x += (b ^ w ^ _) + m[6] + 76029189 | 0,
            x = (x << 23 | x >>> 9) + b | 0,
            _ += (x ^ b ^ w) + m[9] - 640364487 | 0,
            _ = (_ << 4 | _ >>> 28) + x | 0,
            w += (_ ^ x ^ b) + m[12] - 421815835 | 0,
            w = (w << 11 | w >>> 21) + _ | 0,
            b += (w ^ _ ^ x) + m[15] + 530742520 | 0,
            b = (b << 16 | b >>> 16) + w | 0,
            x += (b ^ w ^ _) + m[2] - 995338651 | 0,
            x = (x << 23 | x >>> 9) + b | 0,
            _ += (b ^ (x | ~w)) + m[0] - 198630844 | 0,
            _ = (_ << 6 | _ >>> 26) + x | 0,
            w += (x ^ (_ | ~b)) + m[7] + 1126891415 | 0,
            w = (w << 10 | w >>> 22) + _ | 0,
            b += (_ ^ (w | ~x)) + m[14] - 1416354905 | 0,
            b = (b << 15 | b >>> 17) + w | 0,
            x += (w ^ (b | ~_)) + m[5] - 57434055 | 0,
            x = (x << 21 | x >>> 11) + b | 0,
            _ += (b ^ (x | ~w)) + m[12] + 1700485571 | 0,
            _ = (_ << 6 | _ >>> 26) + x | 0,
            w += (x ^ (_ | ~b)) + m[3] - 1894986606 | 0,
            w = (w << 10 | w >>> 22) + _ | 0,
            b += (_ ^ (w | ~x)) + m[10] - 1051523 | 0,
            b = (b << 15 | b >>> 17) + w | 0,
            x += (w ^ (b | ~_)) + m[1] - 2054922799 | 0,
            x = (x << 21 | x >>> 11) + b | 0,
            _ += (b ^ (x | ~w)) + m[8] + 1873313359 | 0,
            _ = (_ << 6 | _ >>> 26) + x | 0,
            w += (x ^ (_ | ~b)) + m[15] - 30611744 | 0,
            w = (w << 10 | w >>> 22) + _ | 0,
            b += (_ ^ (w | ~x)) + m[6] - 1560198380 | 0,
            b = (b << 15 | b >>> 17) + w | 0,
            x += (w ^ (b | ~_)) + m[13] + 1309151649 | 0,
            x = (x << 21 | x >>> 11) + b | 0,
            _ += (b ^ (x | ~w)) + m[4] - 145523070 | 0,
            _ = (_ << 6 | _ >>> 26) + x | 0,
            w += (x ^ (_ | ~b)) + m[11] - 1120210379 | 0,
            w = (w << 10 | w >>> 22) + _ | 0,
            b += (_ ^ (w | ~x)) + m[2] + 718787259 | 0,
            b = (b << 15 | b >>> 17) + w | 0,
            x += (w ^ (b | ~_)) + m[9] - 343485551 | 0,
            x = (x << 21 | x >>> 11) + b | 0,
            g[0] = _ + g[0] | 0,
            g[1] = x + g[1] | 0,
            g[2] = b + g[2] | 0,
            g[3] = w + g[3] | 0
        }
        function o(g) {
            var m = [], _;
            for (_ = 0; _ < 64; _ += 4)
                m[_ >> 2] = g.charCodeAt(_) + (g.charCodeAt(_ + 1) << 8) + (g.charCodeAt(_ + 2) << 16) + (g.charCodeAt(_ + 3) << 24);
            return m
        }
        function s(g) {
            var m = [], _;
            for (_ = 0; _ < 64; _ += 4)
                m[_ >> 2] = g[_] + (g[_ + 1] << 8) + (g[_ + 2] << 16) + (g[_ + 3] << 24);
            return m
        }
        function a(g) {
            var m = g.length, _ = [1732584193, -271733879, -1732584194, 271733878], x, b, w, E, S, P;
            for (x = 64; x <= m; x += 64)
                i(_, o(g.substring(x - 64, x)));
            for (g = g.substring(x - 64),
            b = g.length,
            w = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
            x = 0; x < b; x += 1)
                w[x >> 2] |= g.charCodeAt(x) << (x % 4 << 3);
            if (w[x >> 2] |= 128 << (x % 4 << 3),
            x > 55)
                for (i(_, w),
                x = 0; x < 16; x += 1)
                    w[x] = 0;
            return E = m * 8,
            E = E.toString(16).match(/(.*?)(.{0,8})$/),
            S = parseInt(E[2], 16),
            P = parseInt(E[1], 16) || 0,
            w[14] = S,
            w[15] = P,
            i(_, w),
            _
        }
        function l(g) {
            var m = g.length, _ = [1732584193, -271733879, -1732584194, 271733878], x, b, w, E, S, P;
            for (x = 64; x <= m; x += 64)
                i(_, s(g.subarray(x - 64, x)));
            for (g = x - 64 < m ? g.subarray(x - 64) : new Uint8Array(0),
            b = g.length,
            w = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
            x = 0; x < b; x += 1)
                w[x >> 2] |= g[x] << (x % 4 << 3);
            if (w[x >> 2] |= 128 << (x % 4 << 3),
            x > 55)
                for (i(_, w),
                x = 0; x < 16; x += 1)
                    w[x] = 0;
            return E = m * 8,
            E = E.toString(16).match(/(.*?)(.{0,8})$/),
            S = parseInt(E[2], 16),
            P = parseInt(E[1], 16) || 0,
            w[14] = S,
            w[15] = P,
            i(_, w),
            _
        }
        function c(g) {
            var m = "", _;
            for (_ = 0; _ < 4; _ += 1)
                m += r[g >> _ * 8 + 4 & 15] + r[g >> _ * 8 & 15];
            return m
        }
        function u(g) {
            var m;
            for (m = 0; m < g.length; m += 1)
                g[m] = c(g[m]);
            return g.join("")
        }
        u(a("hello")),
        typeof ArrayBuffer < "u" && !ArrayBuffer.prototype.slice && function() {
            function g(m, _) {
                return m = m | 0 || 0,
                m < 0 ? Math.max(m + _, 0) : Math.min(m, _)
            }
            ArrayBuffer.prototype.slice = function(m, _) {
                var x = this.byteLength, b = g(m, x), w = x, E, S, P, C;
                return _ !== n && (w = g(_, x)),
                b > w ? new ArrayBuffer(0) : (E = w - b,
                S = new ArrayBuffer(E),
                P = new Uint8Array(S),
                C = new Uint8Array(this,b,E),
                P.set(C),
                S)
            }
        }();
        function f(g) {
            return /[\u0080-\uFFFF]/.test(g) && (g = unescape(encodeURIComponent(g))),
            g
        }
        function d(g, m) {
            var _ = g.length, x = new ArrayBuffer(_), b = new Uint8Array(x), w;
            for (w = 0; w < _; w += 1)
                b[w] = g.charCodeAt(w);
            return m ? b : x
        }
        function h(g) {
            return String.fromCharCode.apply(null, new Uint8Array(g))
        }
        function p(g, m, _) {
            var x = new Uint8Array(g.byteLength + m.byteLength);
            return x.set(new Uint8Array(g)),
            x.set(new Uint8Array(m), g.byteLength),
            _ ? x : x.buffer
        }
        function y(g) {
            var m = [], _ = g.length, x;
            for (x = 0; x < _ - 1; x += 2)
                m.push(parseInt(g.substr(x, 2), 16));
            return String.fromCharCode.apply(String, m)
        }
        function v() {
            this.reset()
        }
        return v.prototype.append = function(g) {
            return this.appendBinary(f(g)),
            this
        }
        ,
        v.prototype.appendBinary = function(g) {
            this._buff += g,
            this._length += g.length;
            var m = this._buff.length, _;
            for (_ = 64; _ <= m; _ += 64)
                i(this._hash, o(this._buff.substring(_ - 64, _)));
            return this._buff = this._buff.substring(_ - 64),
            this
        }
        ,
        v.prototype.end = function(g) {
            var m = this._buff, _ = m.length, x, b = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], w;
            for (x = 0; x < _; x += 1)
                b[x >> 2] |= m.charCodeAt(x) << (x % 4 << 3);
            return this._finish(b, _),
            w = u(this._hash),
            g && (w = y(w)),
            this.reset(),
            w
        }
        ,
        v.prototype.reset = function() {
            return this._buff = "",
            this._length = 0,
            this._hash = [1732584193, -271733879, -1732584194, 271733878],
            this
        }
        ,
        v.prototype.getState = function() {
            return {
                buff: this._buff,
                length: this._length,
                hash: this._hash.slice()
            }
        }
        ,
        v.prototype.setState = function(g) {
            return this._buff = g.buff,
            this._length = g.length,
            this._hash = g.hash,
            this
        }
        ,
        v.prototype.destroy = function() {
            delete this._hash,
            delete this._buff,
            delete this._length
        }
        ,
        v.prototype._finish = function(g, m) {
            var _ = m, x, b, w;
            if (g[_ >> 2] |= 128 << (_ % 4 << 3),
            _ > 55)
                for (i(this._hash, g),
                _ = 0; _ < 16; _ += 1)
                    g[_] = 0;
            x = this._length * 8,
            x = x.toString(16).match(/(.*?)(.{0,8})$/),
            b = parseInt(x[2], 16),
            w = parseInt(x[1], 16) || 0,
            g[14] = b,
            g[15] = w,
            i(this._hash, g)
        }
        ,
        v.hash = function(g, m) {
            return v.hashBinary(f(g), m)
        }
        ,
        v.hashBinary = function(g, m) {
            var _ = a(g)
              , x = u(_);
            return m ? y(x) : x
        }
        ,
        v.ArrayBuffer = function() {
            this.reset()
        }
        ,
        v.ArrayBuffer.prototype.append = function(g) {
            var m = p(this._buff.buffer, g, !0), _ = m.length, x;
            for (this._length += g.byteLength,
            x = 64; x <= _; x += 64)
                i(this._hash, s(m.subarray(x - 64, x)));
            return this._buff = x - 64 < _ ? new Uint8Array(m.buffer.slice(x - 64)) : new Uint8Array(0),
            this
        }
        ,
        v.ArrayBuffer.prototype.end = function(g) {
            var m = this._buff, _ = m.length, x = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], b, w;
            for (b = 0; b < _; b += 1)
                x[b >> 2] |= m[b] << (b % 4 << 3);
            return this._finish(x, _),
            w = u(this._hash),
            g && (w = y(w)),
            this.reset(),
            w
        }
        ,
        v.ArrayBuffer.prototype.reset = function() {
            return this._buff = new Uint8Array(0),
            this._length = 0,
            this._hash = [1732584193, -271733879, -1732584194, 271733878],
            this
        }
        ,
        v.ArrayBuffer.prototype.getState = function() {
            var g = v.prototype.getState.call(this);
            return g.buff = h(g.buff),
            g
        }
        ,
        v.ArrayBuffer.prototype.setState = function(g) {
            return g.buff = d(g.buff, !0),
            v.prototype.setState.call(this, g)
        }
        ,
        v.ArrayBuffer.prototype.destroy = v.prototype.destroy,
        v.ArrayBuffer.prototype._finish = v.prototype._finish,
        v.ArrayBuffer.hash = function(g, m) {
            var _ = l(new Uint8Array(g))
              , x = u(_);
            return m ? y(x) : x
        }
        ,
        v
    })
}
)(M8);
var gK = M8.exports;
const KTe = hu(gK);
var D8 = {
    exports: {}
};
(function(t, e) {
    (function(n, r) {
        t.exports = r()
    }
    )(fl, function() {
        var n = 1e3
          , r = 6e4
          , i = 36e5
          , o = "millisecond"
          , s = "second"
          , a = "minute"
          , l = "hour"
          , c = "day"
          , u = "week"
          , f = "month"
          , d = "quarter"
          , h = "year"
          , p = "date"
          , y = "Invalid Date"
          , v = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/
          , g = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g
          , m = {
            name: "en",
            weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
            months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
            ordinal: function(B) {
                var G = ["th", "st", "nd", "rd"]
                  , N = B % 100;
                return "[" + B + (G[(N - 20) % 10] || G[N] || G[0]) + "]"
            }
        }
          , _ = function(B, G, N) {
            var U = String(B);
            return !U || U.length >= G ? B : "" + Array(G + 1 - U.length).join(N) + B
        }
          , x = {
            s: _,
            z: function(B) {
                var G = -B.utcOffset()
                  , N = Math.abs(G)
                  , U = Math.floor(N / 60)
                  , W = N % 60;
                return (G <= 0 ? "+" : "-") + _(U, 2, "0") + ":" + _(W, 2, "0")
            },
            m: function B(G, N) {
                if (G.date() < N.date())
                    return -B(N, G);
                var U = 12 * (N.year() - G.year()) + (N.month() - G.month())
                  , W = G.clone().add(U, f)
                  , K = N - W < 0
                  , fe = G.clone().add(U + (K ? -1 : 1), f);
                return +(-(U + (N - W) / (K ? W - fe : fe - W)) || 0)
            },
            a: function(B) {
                return B < 0 ? Math.ceil(B) || 0 : Math.floor(B)
            },
            p: function(B) {
                return {
                    M: f,
                    y: h,
                    w: u,
                    d: c,
                    D: p,
                    h: l,
                    m: a,
                    s,
                    ms: o,
                    Q: d
                }[B] || String(B || "").toLowerCase().replace(/s$/, "")
            },
            u: function(B) {
                return B === void 0
            }
        }
          , b = "en"
          , w = {};
        w[b] = m;
        var E = "$isDayjsObject"
          , S = function(B) {
            return B instanceof T || !(!B || !B[E])
        }
          , P = function B(G, N, U) {
            var W;
            if (!G)
                return b;
            if (typeof G == "string") {
                var K = G.toLowerCase();
                w[K] && (W = K),
                N && (w[K] = N,
                W = K);
                var fe = G.split("-");
                if (!W && fe.length > 1)
                    return B(fe[0])
            } else {
                var ue = G.name;
                w[ue] = G,
                W = ue
            }
            return !U && W && (b = W),
            W || !U && b
        }
          , C = function(B, G) {
            if (S(B))
                return B.clone();
            var N = typeof G == "object" ? G : {};
            return N.date = B,
            N.args = arguments,
            new T(N)
        }
          , A = x;
        A.l = P,
        A.i = S,
        A.w = function(B, G) {
            return C(B, {
                locale: G.$L,
                utc: G.$u,
                x: G.$x,
                $offset: G.$offset
            })
        }
        ;
        var T = function() {
            function B(N) {
                this.$L = P(N.locale, null, !0),
                this.parse(N),
                this.$x = this.$x || N.x || {},
                this[E] = !0
            }
            var G = B.prototype;
            return G.parse = function(N) {
                this.$d = function(U) {
                    var W = U.date
                      , K = U.utc;
                    if (W === null)
                        return new Date(NaN);
                    if (A.u(W))
                        return new Date;
                    if (W instanceof Date)
                        return new Date(W);
                    if (typeof W == "string" && !/Z$/i.test(W)) {
                        var fe = W.match(v);
                        if (fe) {
                            var ue = fe[2] - 1 || 0
                              , X = (fe[7] || "0").substring(0, 3);
                            return K ? new Date(Date.UTC(fe[1], ue, fe[3] || 1, fe[4] || 0, fe[5] || 0, fe[6] || 0, X)) : new Date(fe[1],ue,fe[3] || 1,fe[4] || 0,fe[5] || 0,fe[6] || 0,X)
                        }
                    }
                    return new Date(W)
                }(N),
                this.init()
            }
            ,
            G.init = function() {
                var N = this.$d;
                this.$y = N.getFullYear(),
                this.$M = N.getMonth(),
                this.$D = N.getDate(),
                this.$W = N.getDay(),
                this.$H = N.getHours(),
                this.$m = N.getMinutes(),
                this.$s = N.getSeconds(),
                this.$ms = N.getMilliseconds()
            }
            ,
            G.$utils = function() {
                return A
            }
            ,
            G.isValid = function() {
                return this.$d.toString() !== y
            }
            ,
            G.isSame = function(N, U) {
                var W = C(N);
                return this.startOf(U) <= W && W <= this.endOf(U)
            }
            ,
            G.isAfter = function(N, U) {
                return C(N) < this.startOf(U)
            }
            ,
            G.isBefore = function(N, U) {
                return this.endOf(U) < C(N)
            }
            ,
            G.$g = function(N, U, W) {
                return A.u(N) ? this[U] : this.set(W, N)
            }
            ,
            G.unix = function() {
                return Math.floor(this.valueOf() / 1e3)
            }
            ,
            G.valueOf = function() {
                return this.$d.getTime()
            }
            ,
            G.startOf = function(N, U) {
                var W = this
                  , K = !!A.u(U) || U
                  , fe = A.p(N)
                  , ue = function(J, de) {
                    var pe = A.w(W.$u ? Date.UTC(W.$y, de, J) : new Date(W.$y,de,J), W);
                    return K ? pe : pe.endOf(c)
                }
                  , X = function(J, de) {
                    return A.w(W.toDate()[J].apply(W.toDate("s"), (K ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(de)), W)
                }
                  , ie = this.$W
                  , ge = this.$M
                  , F = this.$D
                  , q = "set" + (this.$u ? "UTC" : "");
                switch (fe) {
                case h:
                    return K ? ue(1, 0) : ue(31, 11);
                case f:
                    return K ? ue(1, ge) : ue(0, ge + 1);
                case u:
                    var L = this.$locale().weekStart || 0
                      , ee = (ie < L ? ie + 7 : ie) - L;
                    return ue(K ? F - ee : F + (6 - ee), ge);
                case c:
                case p:
                    return X(q + "Hours", 0);
                case l:
                    return X(q + "Minutes", 1);
                case a:
                    return X(q + "Seconds", 2);
                case s:
                    return X(q + "Milliseconds", 3);
                default:
                    return this.clone()
                }
            }
            ,
            G.endOf = function(N) {
                return this.startOf(N, !1)
            }
            ,
            G.$set = function(N, U) {
                var W, K = A.p(N), fe = "set" + (this.$u ? "UTC" : ""), ue = (W = {},
                W[c] = fe + "Date",
                W[p] = fe + "Date",
                W[f] = fe + "Month",
                W[h] = fe + "FullYear",
                W[l] = fe + "Hours",
                W[a] = fe + "Minutes",
                W[s] = fe + "Seconds",
                W[o] = fe + "Milliseconds",
                W)[K], X = K === c ? this.$D + (U - this.$W) : U;
                if (K === f || K === h) {
                    var ie = this.clone().set(p, 1);
                    ie.$d[ue](X),
                    ie.init(),
                    this.$d = ie.set(p, Math.min(this.$D, ie.daysInMonth())).$d
                } else
                    ue && this.$d[ue](X);
                return this.init(),
                this
            }
            ,
            G.set = function(N, U) {
                return this.clone().$set(N, U)
            }
            ,
            G.get = function(N) {
                return this[A.p(N)]()
            }
            ,
            G.add = function(N, U) {
                var W, K = this;
                N = Number(N);
                var fe = A.p(U)
                  , ue = function(ge) {
                    var F = C(K);
                    return A.w(F.date(F.date() + Math.round(ge * N)), K)
                };
                if (fe === f)
                    return this.set(f, this.$M + N);
                if (fe === h)
                    return this.set(h, this.$y + N);
                if (fe === c)
                    return ue(1);
                if (fe === u)
                    return ue(7);
                var X = (W = {},
                W[a] = r,
                W[l] = i,
                W[s] = n,
                W)[fe] || 1
                  , ie = this.$d.getTime() + N * X;
                return A.w(ie, this)
            }
            ,
            G.subtract = function(N, U) {
                return this.add(-1 * N, U)
            }
            ,
            G.format = function(N) {
                var U = this
                  , W = this.$locale();
                if (!this.isValid())
                    return W.invalidDate || y;
                var K = N || "YYYY-MM-DDTHH:mm:ssZ"
                  , fe = A.z(this)
                  , ue = this.$H
                  , X = this.$m
                  , ie = this.$M
                  , ge = W.weekdays
                  , F = W.months
                  , q = W.meridiem
                  , L = function(de, pe, xe, O) {
                    return de && (de[pe] || de(U, K)) || xe[pe].slice(0, O)
                }
                  , ee = function(de) {
                    return A.s(ue % 12 || 12, de, "0")
                }
                  , J = q || function(de, pe, xe) {
                    var O = de < 12 ? "AM" : "PM";
                    return xe ? O.toLowerCase() : O
                }
                ;
                return K.replace(g, function(de, pe) {
                    return pe || function(xe) {
                        switch (xe) {
                        case "YY":
                            return String(U.$y).slice(-2);
                        case "YYYY":
                            return A.s(U.$y, 4, "0");
                        case "M":
                            return ie + 1;
                        case "MM":
                            return A.s(ie + 1, 2, "0");
                        case "MMM":
                            return L(W.monthsShort, ie, F, 3);
                        case "MMMM":
                            return L(F, ie);
                        case "D":
                            return U.$D;
                        case "DD":
                            return A.s(U.$D, 2, "0");
                        case "d":
                            return String(U.$W);
                        case "dd":
                            return L(W.weekdaysMin, U.$W, ge, 2);
                        case "ddd":
                            return L(W.weekdaysShort, U.$W, ge, 3);
                        case "dddd":
                            return ge[U.$W];
                        case "H":
                            return String(ue);
                        case "HH":
                            return A.s(ue, 2, "0");
                        case "h":
                            return ee(1);
                        case "hh":
                            return ee(2);
                        case "a":
                            return J(ue, X, !0);
                        case "A":
                            return J(ue, X, !1);
                        case "m":
                            return String(X);
                        case "mm":
                            return A.s(X, 2, "0");
                        case "s":
                            return String(U.$s);
                        case "ss":
                            return A.s(U.$s, 2, "0");
                        case "SSS":
                            return A.s(U.$ms, 3, "0");
                        case "Z":
                            return fe
                        }
                        return null
                    }(de) || fe.replace(":", "")
                })
            }
            ,
            G.utcOffset = function() {
                return 15 * -Math.round(this.$d.getTimezoneOffset() / 15)
            }
            ,
            G.diff = function(N, U, W) {
                var K, fe = this, ue = A.p(U), X = C(N), ie = (X.utcOffset() - this.utcOffset()) * r, ge = this - X, F = function() {
                    return A.m(fe, X)
                };
                switch (ue) {
                case h:
                    K = F() / 12;
                    break;
                case f:
                    K = F();
                    break;
                case d:
                    K = F() / 3;
                    break;
                case u:
                    K = (ge - ie) / 6048e5;
                    break;
                case c:
                    K = (ge - ie) / 864e5;
                    break;
                case l:
                    K = ge / i;
                    break;
                case a:
                    K = ge / r;
                    break;
                case s:
                    K = ge / n;
                    break;
                default:
                    K = ge
                }
                return W ? K : A.a(K)
            }
            ,
            G.daysInMonth = function() {
                return this.endOf(f).$D
            }
            ,
            G.$locale = function() {
                return w[this.$L]
            }
            ,
            G.locale = function(N, U) {
                if (!N)
                    return this.$L;
                var W = this.clone()
                  , K = P(N, U, !0);
                return K && (W.$L = K),
                W
            }
            ,
            G.clone = function() {
                return A.w(this.$d, this)
            }
            ,
            G.toDate = function() {
                return new Date(this.valueOf())
            }
            ,
            G.toJSON = function() {
                return this.isValid() ? this.toISOString() : null
            }
            ,
            G.toISOString = function() {
                return this.$d.toISOString()
            }
            ,
            G.toString = function() {
                return this.$d.toUTCString()
            }
            ,
            B
        }()
          , I = T.prototype;
        return C.prototype = I,
        [["$ms", o], ["$s", s], ["$m", a], ["$H", l], ["$W", c], ["$M", f], ["$y", h], ["$D", p]].forEach(function(B) {
            I[B[1]] = function(G) {
                return this.$g(G, B[0], B[1])
            }
        }),
        C.extend = function(B, G) {
            return B.$i || (B(G, T, C),
            B.$i = !0),
            C
        }
        ,
        C.locale = P,
        C.isDayjs = S,
        C.unix = function(B) {
            return C(1e3 * B)
        }
        ,
        C.en = w[b],
        C.Ls = w,
        C.p = {},
        C
    })
}
)(D8);
var sw = D8.exports;
const qTe = hu(sw);
function Yy() {}
const We = Object.assign
  , po = typeof window < "u"
  , go = t => t !== null && typeof t == "object"
  , Lt = t => t != null
  , $c = t => typeof t == "function"
  , aw = t => go(t) && $c(t.then) && $c(t.catch)
  , Qf = t => Object.prototype.toString.call(t) === "[object Date]" && !Number.isNaN(t.getTime())
  , B8 = t => typeof t == "number" || /^\d+(\.\d+)?$/.test(t)
  , mK = () => po ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : !1;
function VS(t, e) {
    const n = e.split(".");
    let r = t;
    return n.forEach(i => {
        var o;
        r = go(r) && (o = r[i]) != null ? o : ""
    }
    ),
    r
}
function $t(t, e, n) {
    return e.reduce( (r, i) => ((!n || t[i] !== void 0) && (r[i] = t[i]),
    r), {})
}
const Ws = (t, e) => JSON.stringify(t) === JSON.stringify(e)
  , u0 = t => Array.isArray(t) ? t : [t]
  , hn = null
  , Se = [Number, String]
  , _e = {
    type: Boolean,
    default: !0
}
  , ur = t => ({
    type: t,
    required: !0
})
  , ns = () => ({
    type: Array,
    default: () => []
})
  , Mg = t => ({
    type: Number,
    default: t
})
  , ze = t => ({
    type: Se,
    default: t
})
  , Me = t => ({
    type: String,
    default: t
});
function zd(t) {
    const e = "scrollTop"in t ? t.scrollTop : t.pageYOffset;
    return Math.max(e, 0)
}
function f0(t, e) {
    "scrollTop"in t ? t.scrollTop = e : t.scrollTo(t.scrollX, e)
}
function lw() {
    return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0
}
function cw(t) {
    f0(window, t),
    f0(document.body, t)
}
function zS(t, e) {
    if (t === window)
        return 0;
    const n = e ? zd(e) : lw();
    return wn(t).top + n
}
const vK = mK();
function k8() {
    vK && cw(lw())
}
const N8 = t => t.stopPropagation();
function Bn(t, e) {
    (typeof t.cancelable != "boolean" || t.cancelable) && t.preventDefault(),
    e && N8(t)
}
function Uc(t) {
    const e = dr(t);
    if (!e)
        return !1;
    const n = window.getComputedStyle(e)
      , r = n.display === "none"
      , i = e.offsetParent === null && n.position !== "fixed";
    return r || i
}
const {width: Wo, height: Ys} = tR();
function tt(t) {
    if (Lt(t))
        return B8(t) ? `${t}px` : String(t)
}
function Bl(t) {
    if (Lt(t)) {
        if (Array.isArray(t))
            return {
                width: tt(t[0]),
                height: tt(t[1])
            };
        const e = tt(t);
        return {
            width: e,
            height: e
        }
    }
}
function F8(t) {
    const e = {};
    return t !== void 0 && (e.zIndex = +t),
    e
}
let zm;
function yK() {
    if (!zm) {
        const t = document.documentElement
          , e = t.style.fontSize || window.getComputedStyle(t).fontSize;
        zm = parseFloat(e)
    }
    return zm
}
function _K(t) {
    return t = t.replace(/rem/g, ""),
    +t * yK()
}
function xK(t) {
    return t = t.replace(/vw/g, ""),
    +t * Wo.value / 100
}
function bK(t) {
    return t = t.replace(/vh/g, ""),
    +t * Ys.value / 100
}
function uw(t) {
    if (typeof t == "number")
        return t;
    if (po) {
        if (t.includes("rem"))
            return _K(t);
        if (t.includes("vw"))
            return xK(t);
        if (t.includes("vh"))
            return bK(t)
    }
    return parseFloat(t)
}
const wK = /-(\w)/g
  , L8 = t => t.replace(wK, (e, n) => n.toUpperCase());
function Fa(t, e=2) {
    let n = t + "";
    for (; n.length < e; )
        n = "0" + n;
    return n
}
const $n = (t, e, n) => Math.min(Math.max(t, e), n);
function jS(t, e, n) {
    const r = t.indexOf(e);
    return r === -1 ? t : e === "-" && r !== 0 ? t.slice(0, r) : t.slice(0, r + 1) + t.slice(r).replace(n, "")
}
function Xy(t, e=!0, n=!0) {
    e ? t = jS(t, ".", /\./g) : t = t.split(".")[0],
    n ? t = jS(t, "-", /-/g) : t = t.replace(/-/, "");
    const r = e ? /[^-0-9.]/g : /[^-0-9]/g;
    return t.replace(r, "")
}
function $8(t, e) {
    return Math.round((t + e) * 1e10) / 1e10
}
const {hasOwnProperty: EK} = Object.prototype;
function SK(t, e, n) {
    const r = e[n];
    Lt(r) && (!EK.call(t, n) || !go(r) ? t[n] = r : t[n] = U8(Object(t[n]), r))
}
function U8(t, e) {
    return Object.keys(e).forEach(n => {
        SK(t, e, n)
    }
    ),
    t
}
var CK = {
    name: "姓名",
    tel: "电话",
    save: "保存",
    clear: "清空",
    cancel: "取消",
    confirm: "确认",
    delete: "删除",
    loading: "加载中...",
    noCoupon: "暂无优惠券",
    nameEmpty: "请填写姓名",
    addContact: "添加联系人",
    telInvalid: "请填写正确的电话",
    vanCalendar: {
        end: "结束",
        start: "开始",
        title: "日期选择",
        weekdays: ["日", "一", "二", "三", "四", "五", "六"],
        monthTitle: (t, e) => `${t}年${e}月`,
        rangePrompt: t => `最多选择 ${t} 天`
    },
    vanCascader: {
        select: "请选择"
    },
    vanPagination: {
        prev: "上一页",
        next: "下一页"
    },
    vanPullRefresh: {
        pulling: "下拉即可刷新...",
        loosing: "释放即可刷新..."
    },
    vanSubmitBar: {
        label: "合计:"
    },
    vanCoupon: {
        unlimited: "无门槛",
        discount: t => `${t}折`,
        condition: t => `满${t}元可用`
    },
    vanCouponCell: {
        title: "优惠券",
        count: t => `${t}张可用`
    },
    vanCouponList: {
        exchange: "兑换",
        close: "不使用",
        enable: "可用",
        disabled: "不可用",
        placeholder: "输入优惠码"
    },
    vanAddressEdit: {
        area: "地区",
        areaEmpty: "请选择地区",
        addressEmpty: "请填写详细地址",
        addressDetail: "详细地址",
        defaultAddress: "设为默认收货地址"
    },
    vanAddressList: {
        add: "新增地址"
    }
};
const WS = Z("zh-CN")
  , YS = Mt({
    "zh-CN": CK
})
  , AK = {
    messages() {
        return YS[WS.value]
    },
    use(t, e) {
        WS.value = t,
        this.add({
            [t]: e
        })
    },
    add(t={}) {
        U8(YS, t)
    }
};
var TK = AK;
function PK(t) {
    const e = L8(t) + ".";
    return (n, ...r) => {
        const i = TK.messages()
          , o = VS(i, e + n) || VS(i, n);
        return $c(o) ? o(...r) : o
    }
}
function Ky(t, e) {
    return e ? typeof e == "string" ? ` ${t}--${e}` : Array.isArray(e) ? e.reduce( (n, r) => n + Ky(t, r), "") : Object.keys(e).reduce( (n, r) => n + (e[r] ? Ky(t, r) : ""), "") : ""
}
function IK(t) {
    return (e, n) => (e && typeof e != "string" && (n = e,
    e = ""),
    e = e ? `${t}__${e}` : t,
    `${e}${Ky(e, n)}`)
}
function Te(t) {
    const e = `van-${t}`;
    return [e, IK(e), PK(e)]
}
const ua = "van-hairline"
  , G8 = `${ua}--top`
  , OK = `${ua}--left`
  , RK = `${ua}--right`
  , MK = `${ua}--bottom`
  , Op = `${ua}--surround`
  , H8 = `${ua}--top-bottom`
  , DK = `${ua}-unset--top-bottom`
  , rs = "van-haptics-feedback"
  , V8 = Symbol("van-form")
  , z8 = 500
  , XS = 5;
function gu(t, {args: e=[], done: n, canceled: r, error: i}) {
    if (t) {
        const o = t.apply(null, e);
        aw(o) ? o.then(s => {
            s ? n() : r && r()
        }
        ).catch(i || Yy) : o ? n() : r && r()
    } else
        n()
}
function De(t) {
    return t.install = e => {
        const {name: n} = t;
        n && (e.component(n, t),
        e.component(L8(`-${n}`), t))
    }
    ,
    t
}
function KS(t, e) {
    return t.reduce( (n, r) => Math.abs(n - e) < Math.abs(r - e) ? n : r)
}
const j8 = Symbol();
function fw(t) {
    const e = dn(j8, null);
    e && ve(e, n => {
        n && t()
    }
    )
}
const W8 = (t, e) => {
    const n = Z()
      , r = () => {
        n.value = wn(t).height
    }
    ;
    return Ht( () => {
        if (Xe(r),
        e)
            for (let i = 1; i <= 3; i++)
                setTimeout(r, 100 * i)
    }
    ),
    fw( () => Xe(r)),
    ve([Wo, Ys], r),
    n
}
;
function BK(t, e) {
    const n = W8(t, !0);
    return r => R("div", {
        class: e("placeholder"),
        style: {
            height: n.value ? `${n.value}px` : void 0
        }
    }, [r()])
}
const [Y8,qS] = Te("action-bar")
  , X8 = Symbol(Y8)
  , kK = {
    placeholder: Boolean,
    safeAreaInsetBottom: _e
};
var NK = we({
    name: Y8,
    props: kK,
    setup(t, {slots: e}) {
        const n = Z()
          , r = BK(n, qS)
          , {linkChildren: i} = Ui(X8);
        i();
        const o = () => {
            var s;
            return R("div", {
                ref: n,
                class: [qS(), {
                    "van-safe-area-bottom": t.safeAreaInsetBottom
                }]
            }, [(s = e.default) == null ? void 0 : s.call(e)])
        }
        ;
        return () => t.placeholder ? r(o) : o()
    }
});
const FK = De(NK);
function Kt(t) {
    const e = yt();
    e && We(e.proxy, t)
}
const mu = {
    to: [String, Object],
    url: String,
    replace: Boolean
};
function K8({to: t, url: e, replace: n, $router: r}) {
    t && r ? r[n ? "replace" : "push"](t) : e && (n ? location.replace(e) : location.href = e)
}
function jd() {
    const t = yt().proxy;
    return () => K8(t)
}
const [LK,ZS] = Te("badge")
  , $K = {
    dot: Boolean,
    max: Se,
    tag: Me("div"),
    color: String,
    offset: Array,
    content: Se,
    showZero: _e,
    position: Me("top-right")
};
var UK = we({
    name: LK,
    props: $K,
    setup(t, {slots: e}) {
        const n = () => {
            if (e.content)
                return !0;
            const {content: a, showZero: l} = t;
            return Lt(a) && a !== "" && (l || a !== 0 && a !== "0")
        }
          , r = () => {
            const {dot: a, max: l, content: c} = t;
            if (!a && n())
                return e.content ? e.content() : Lt(l) && B8(c) && +c > +l ? `${l}+` : c
        }
          , i = a => a.startsWith("-") ? a.replace("-", "") : `-${a}`
          , o = re( () => {
            const a = {
                background: t.color
            };
            if (t.offset) {
                const [l,c] = t.offset
                  , {position: u} = t
                  , [f,d] = u.split("-");
                e.default ? (typeof c == "number" ? a[f] = tt(f === "top" ? c : -c) : a[f] = f === "top" ? tt(c) : i(c),
                typeof l == "number" ? a[d] = tt(d === "left" ? l : -l) : a[d] = d === "left" ? tt(l) : i(l)) : (a.marginTop = tt(c),
                a.marginLeft = tt(l))
            }
            return a
        }
        )
          , s = () => {
            if (n() || t.dot)
                return R("div", {
                    class: ZS([t.position, {
                        dot: t.dot,
                        fixed: !!e.default
                    }]),
                    style: o.value
                }, [r()])
        }
        ;
        return () => {
            if (e.default) {
                const {tag: a} = t;
                return R(a, {
                    class: ZS("wrapper")
                }, {
                    default: () => [e.default(), s()]
                })
            }
            return s()
        }
    }
});
const Dg = De(UK);
let GK = 2e3;
const HK = () => ++GK
  , [VK,ZTe] = Te("config-provider")
  , zK = Symbol(VK)
  , [jK,JS] = Te("icon")
  , WK = t => t == null ? void 0 : t.includes("/")
  , YK = {
    dot: Boolean,
    tag: Me("i"),
    name: String,
    size: Se,
    badge: Se,
    color: String,
    badgeProps: Object,
    classPrefix: String
};
var XK = we({
    name: jK,
    props: YK,
    setup(t, {slots: e}) {
        const n = dn(zK, null)
          , r = re( () => t.classPrefix || (n == null ? void 0 : n.iconPrefix) || JS());
        return () => {
            const {tag: i, dot: o, name: s, size: a, badge: l, color: c} = t
              , u = WK(s);
            return R(Dg, st({
                dot: o,
                tag: i,
                class: [r.value, u ? "" : `${r.value}-${s}`],
                style: {
                    color: c,
                    fontSize: tt(a)
                },
                content: l
            }, t.badgeProps), {
                default: () => {
                    var f;
                    return [(f = e.default) == null ? void 0 : f.call(e), u && R("img", {
                        class: JS("image"),
                        src: s
                    }, null)]
                }
            })
        }
    }
});
const tn = De(XK);
var KK = tn;
const [qK,wf] = Te("loading")
  , ZK = Array(12).fill(null).map( (t, e) => R("i", {
    class: wf("line", String(e + 1))
}, null))
  , JK = R("svg", {
    class: wf("circular"),
    viewBox: "25 25 50 50"
}, [R("circle", {
    cx: "50",
    cy: "50",
    r: "20",
    fill: "none"
}, null)])
  , QK = {
    size: Se,
    type: Me("circular"),
    color: String,
    vertical: Boolean,
    textSize: Se,
    textColor: String
};
var eq = we({
    name: qK,
    props: QK,
    setup(t, {slots: e}) {
        const n = re( () => We({
            color: t.color
        }, Bl(t.size)))
          , r = () => {
            const o = t.type === "spinner" ? ZK : JK;
            return R("span", {
                class: wf("spinner", t.type),
                style: n.value
            }, [e.icon ? e.icon() : o])
        }
          , i = () => {
            var o;
            if (e.default)
                return R("span", {
                    class: wf("text"),
                    style: {
                        fontSize: tt(t.textSize),
                        color: (o = t.textColor) != null ? o : t.color
                    }
                }, [e.default()])
        }
        ;
        return () => {
            const {type: o, vertical: s} = t;
            return R("div", {
                class: wf([o, {
                    vertical: s
                }]),
                "aria-live": "polite",
                "aria-busy": !0
            }, [r(), i()])
        }
    }
});
const ds = De(eq)
  , [tq,Wl] = Te("button")
  , nq = We({}, mu, {
    tag: Me("button"),
    text: String,
    icon: String,
    type: Me("default"),
    size: Me("normal"),
    color: String,
    block: Boolean,
    plain: Boolean,
    round: Boolean,
    square: Boolean,
    loading: Boolean,
    hairline: Boolean,
    disabled: Boolean,
    iconPrefix: String,
    nativeType: Me("button"),
    loadingSize: Se,
    loadingText: String,
    loadingType: String,
    iconPosition: Me("left")
});
var rq = we({
    name: tq,
    props: nq,
    emits: ["click"],
    setup(t, {emit: e, slots: n}) {
        const r = jd()
          , i = () => n.loading ? n.loading() : R(ds, {
            size: t.loadingSize,
            type: t.loadingType,
            class: Wl("loading")
        }, null)
          , o = () => {
            if (t.loading)
                return i();
            if (n.icon)
                return R("div", {
                    class: Wl("icon")
                }, [n.icon()]);
            if (t.icon)
                return R(tn, {
                    name: t.icon,
                    class: Wl("icon"),
                    classPrefix: t.iconPrefix
                }, null)
        }
          , s = () => {
            let c;
            if (t.loading ? c = t.loadingText : c = n.default ? n.default() : t.text,
            c)
                return R("span", {
                    class: Wl("text")
                }, [c])
        }
          , a = () => {
            const {color: c, plain: u} = t;
            if (c) {
                const f = {
                    color: u ? c : "white"
                };
                return u || (f.background = c),
                c.includes("gradient") ? f.border = 0 : f.borderColor = c,
                f
            }
        }
          , l = c => {
            t.loading ? Bn(c) : t.disabled || (e("click", c),
            r())
        }
        ;
        return () => {
            const {tag: c, type: u, size: f, block: d, round: h, plain: p, square: y, loading: v, disabled: g, hairline: m, nativeType: _, iconPosition: x} = t
              , b = [Wl([u, f, {
                plain: p,
                block: d,
                round: h,
                square: y,
                loading: v,
                disabled: g,
                hairline: m
            }]), {
                [Op]: m
            }];
            return R(c, {
                type: _,
                class: b,
                style: a(),
                disabled: g,
                onClick: l
            }, {
                default: () => [R("div", {
                    class: Wl("content")
                }, [x === "left" && o(), s(), x === "right" && o()])]
            })
        }
    }
});
const d0 = De(rq)
  , [iq,oq] = Te("action-bar-button")
  , sq = We({}, mu, {
    type: String,
    text: String,
    icon: String,
    color: String,
    loading: Boolean,
    disabled: Boolean
});
var aq = we({
    name: iq,
    props: sq,
    setup(t, {slots: e}) {
        const n = jd()
          , {parent: r, index: i} = Zr(X8)
          , o = re( () => {
            if (r) {
                const a = r.children[i.value - 1];
                return !(a && "isButton"in a)
            }
        }
        )
          , s = re( () => {
            if (r) {
                const a = r.children[i.value + 1];
                return !(a && "isButton"in a)
            }
        }
        );
        return Kt({
            isButton: !0
        }),
        () => {
            const {type: a, icon: l, text: c, color: u, loading: f, disabled: d} = t;
            return R(d0, {
                class: oq([a, {
                    last: s.value,
                    first: o.value
                }]),
                size: "large",
                type: a,
                icon: l,
                color: u,
                loading: f,
                disabled: d,
                onClick: n
            }, {
                default: () => [e.default ? e.default() : c]
            })
        }
    }
});
const QS = De(aq)
  , Wd = {
    show: Boolean,
    zIndex: Se,
    overlay: _e,
    duration: Se,
    teleport: [String, Object],
    lockScroll: _e,
    lazyRender: _e,
    beforeClose: Function,
    overlayProps: Object,
    overlayStyle: Object,
    overlayClass: hn,
    transitionAppear: Boolean,
    closeOnClickOverlay: _e
}
  , q8 = Object.keys(Wd);
function lq(t, e) {
    return t > e ? "horizontal" : e > t ? "vertical" : ""
}
function kl() {
    const t = Z(0)
      , e = Z(0)
      , n = Z(0)
      , r = Z(0)
      , i = Z(0)
      , o = Z(0)
      , s = Z("")
      , a = Z(!0)
      , l = () => s.value === "vertical"
      , c = () => s.value === "horizontal"
      , u = () => {
        n.value = 0,
        r.value = 0,
        i.value = 0,
        o.value = 0,
        s.value = "",
        a.value = !0
    }
    ;
    return {
        move: h => {
            const p = h.touches[0];
            n.value = (p.clientX < 0 ? 0 : p.clientX) - t.value,
            r.value = p.clientY - e.value,
            i.value = Math.abs(n.value),
            o.value = Math.abs(r.value);
            const y = 10;
            (!s.value || i.value < y && o.value < y) && (s.value = lq(i.value, o.value)),
            a.value && (i.value > XS || o.value > XS) && (a.value = !1)
        }
        ,
        start: h => {
            u(),
            t.value = h.touches[0].clientX,
            e.value = h.touches[0].clientY
        }
        ,
        reset: u,
        startX: t,
        startY: e,
        deltaX: n,
        deltaY: r,
        offsetX: i,
        offsetY: o,
        direction: s,
        isVertical: l,
        isHorizontal: c,
        isTap: a
    }
}
let Du = 0;
const eC = "van-overflow-hidden";
function cq(t, e) {
    const n = kl()
      , r = "01"
      , i = "10"
      , o = u => {
        n.move(u);
        const f = n.deltaY.value > 0 ? i : r
          , d = Ob(u.target, t.value)
          , {scrollHeight: h, offsetHeight: p, scrollTop: y} = d;
        let v = "11";
        y === 0 ? v = p >= h ? "00" : "01" : y + p >= h && (v = "10"),
        v !== "11" && n.isVertical() && !(parseInt(v, 2) & parseInt(f, 2)) && Bn(u, !0)
    }
      , s = () => {
        document.addEventListener("touchstart", n.start),
        document.addEventListener("touchmove", o, {
            passive: !1
        }),
        Du || document.body.classList.add(eC),
        Du++
    }
      , a = () => {
        Du && (document.removeEventListener("touchstart", n.start),
        document.removeEventListener("touchmove", o),
        Du--,
        Du || document.body.classList.remove(eC))
    }
      , l = () => e() && s()
      , c = () => e() && a();
    pu(l),
    bo(c),
    qr(c),
    ve(e, u => {
        u ? s() : a()
    }
    )
}
function dw(t) {
    const e = Z(!1);
    return ve(t, n => {
        n && (e.value = n)
    }
    , {
        immediate: !0
    }),
    n => () => e.value ? n() : null
}
const qy = () => {
    var t;
    const {scopeId: e} = ((t = yt()) == null ? void 0 : t.vnode) || {};
    return e ? {
        [e]: ""
    } : null
}
  , [uq,fq] = Te("overlay")
  , dq = {
    show: Boolean,
    zIndex: Se,
    duration: Se,
    className: hn,
    lockScroll: _e,
    lazyRender: _e,
    customStyle: Object,
    teleport: [String, Object]
};
var hq = we({
    name: uq,
    inheritAttrs: !1,
    props: dq,
    setup(t, {attrs: e, slots: n}) {
        const r = Z()
          , i = dw( () => t.show || !t.lazyRender)
          , o = a => {
            t.lockScroll && Bn(a, !0)
        }
          , s = i( () => {
            var a;
            const l = We(F8(t.zIndex), t.customStyle);
            return Lt(t.duration) && (l.animationDuration = `${t.duration}s`),
            di(R("div", st({
                ref: r,
                style: l,
                class: [fq(), t.className]
            }, e), [(a = n.default) == null ? void 0 : a.call(n)]), [[pi, t.show]])
        }
        );
        return mr("touchmove", o, {
            target: r
        }),
        () => {
            const a = R(Gd, {
                name: "van-fade",
                appear: !0
            }, {
                default: s
            });
            return t.teleport ? R(hg, {
                to: t.teleport
            }, {
                default: () => [a]
            }) : a
        }
    }
});
const pq = De(hq)
  , gq = We({}, Wd, {
    round: Boolean,
    position: Me("center"),
    closeIcon: Me("cross"),
    closeable: Boolean,
    transition: String,
    iconPrefix: String,
    closeOnPopstate: Boolean,
    closeIconPosition: Me("top-right"),
    destroyOnClose: Boolean,
    safeAreaInsetTop: Boolean,
    safeAreaInsetBottom: Boolean
})
  , [mq,tC] = Te("popup");
var vq = we({
    name: mq,
    inheritAttrs: !1,
    props: gq,
    emits: ["open", "close", "opened", "closed", "keydown", "update:show", "clickOverlay", "clickCloseIcon"],
    setup(t, {emit: e, attrs: n, slots: r}) {
        let i, o;
        const s = Z()
          , a = Z()
          , l = dw( () => t.show || !t.lazyRender)
          , c = re( () => {
            const w = {
                zIndex: s.value
            };
            if (Lt(t.duration)) {
                const E = t.position === "center" ? "animationDuration" : "transitionDuration";
                w[E] = `${t.duration}s`
            }
            return w
        }
        )
          , u = () => {
            i || (i = !0,
            s.value = t.zIndex !== void 0 ? +t.zIndex : HK(),
            e("open"))
        }
          , f = () => {
            i && gu(t.beforeClose, {
                done() {
                    i = !1,
                    e("close"),
                    e("update:show", !1)
                }
            })
        }
          , d = w => {
            e("clickOverlay", w),
            t.closeOnClickOverlay && f()
        }
          , h = () => {
            if (t.overlay) {
                const w = We({
                    show: t.show,
                    class: t.overlayClass,
                    zIndex: s.value,
                    duration: t.duration,
                    customStyle: t.overlayStyle,
                    role: t.closeOnClickOverlay ? "button" : void 0,
                    tabindex: t.closeOnClickOverlay ? 0 : void 0
                }, t.overlayProps);
                return R(pq, st(w, qy(), {
                    onClick: d
                }), {
                    default: r["overlay-content"]
                })
            }
        }
          , p = w => {
            e("clickCloseIcon", w),
            f()
        }
          , y = () => {
            if (t.closeable)
                return R(tn, {
                    role: "button",
                    tabindex: 0,
                    name: t.closeIcon,
                    class: [tC("close-icon", t.closeIconPosition), rs],
                    classPrefix: t.iconPrefix,
                    onClick: p
                }, null)
        }
        ;
        let v;
        const g = () => {
            v && clearTimeout(v),
            v = setTimeout( () => {
                e("opened")
            }
            )
        }
          , m = () => e("closed")
          , _ = w => e("keydown", w)
          , x = l( () => {
            var w;
            const {destroyOnClose: E, round: S, position: P, safeAreaInsetTop: C, safeAreaInsetBottom: A, show: T} = t;
            if (!(!T && E))
                return di(R("div", st({
                    ref: a,
                    style: c.value,
                    role: "dialog",
                    tabindex: 0,
                    class: [tC({
                        round: S,
                        [P]: P
                    }), {
                        "van-safe-area-top": C,
                        "van-safe-area-bottom": A
                    }],
                    onKeydown: _
                }, n, qy()), [(w = r.default) == null ? void 0 : w.call(r), y()]), [[pi, T]])
        }
        )
          , b = () => {
            const {position: w, transition: E, transitionAppear: S} = t
              , P = w === "center" ? "van-fade" : `van-popup-slide-${w}`;
            return R(Gd, {
                name: E || P,
                appear: S,
                onAfterEnter: g,
                onAfterLeave: m
            }, {
                default: x
            })
        }
        ;
        return ve( () => t.show, w => {
            w && !i && (u(),
            n.tabindex === 0 && Xe( () => {
                var E;
                (E = a.value) == null || E.focus()
            }
            )),
            !w && i && (i = !1,
            e("close"))
        }
        ),
        Kt({
            popupRef: a
        }),
        cq(a, () => t.show && t.lockScroll),
        mr("popstate", () => {
            t.closeOnPopstate && (f(),
            o = !1)
        }
        ),
        Ht( () => {
            t.show && u()
        }
        ),
        cs( () => {
            o && (e("update:show", !0),
            o = !1)
        }
        ),
        bo( () => {
            t.show && t.teleport && (f(),
            o = !0)
        }
        ),
        hi(j8, () => t.show),
        () => t.teleport ? R(hg, {
            to: t.teleport
        }, {
            default: () => [h(), b()]
        }) : R(Ft, null, [h(), b()])
    }
});
const Nl = De(vq)
  , [yq,ni] = Te("action-sheet")
  , _q = We({}, Wd, {
    title: String,
    round: _e,
    actions: ns(),
    closeIcon: Me("cross"),
    closeable: _e,
    cancelText: String,
    description: String,
    closeOnPopstate: _e,
    closeOnClickAction: Boolean,
    safeAreaInsetBottom: _e
})
  , xq = [...q8, "round", "closeOnPopstate", "safeAreaInsetBottom"];
var bq = we({
    name: yq,
    props: _q,
    emits: ["select", "cancel", "update:show"],
    setup(t, {slots: e, emit: n}) {
        const r = f => n("update:show", f)
          , i = () => {
            r(!1),
            n("cancel")
        }
          , o = () => {
            if (t.title)
                return R("div", {
                    class: ni("header")
                }, [t.title, t.closeable && R(tn, {
                    name: t.closeIcon,
                    class: [ni("close"), rs],
                    onClick: i
                }, null)])
        }
          , s = () => {
            if (e.cancel || t.cancelText)
                return [R("div", {
                    class: ni("gap")
                }, null), R("button", {
                    type: "button",
                    class: ni("cancel"),
                    onClick: i
                }, [e.cancel ? e.cancel() : t.cancelText])]
        }
          , a = f => {
            if (f.icon)
                return R(tn, {
                    class: ni("item-icon"),
                    name: f.icon
                }, null)
        }
          , l = (f, d) => f.loading ? R(ds, {
            class: ni("loading-icon")
        }, null) : e.action ? e.action({
            action: f,
            index: d
        }) : [R("span", {
            class: ni("name")
        }, [f.name]), f.subname && R("div", {
            class: ni("subname")
        }, [f.subname])]
          , c = (f, d) => {
            const {color: h, loading: p, callback: y, disabled: v, className: g} = f
              , m = () => {
                v || p || (y && y(f),
                t.closeOnClickAction && r(!1),
                Xe( () => n("select", f, d)))
            }
            ;
            return R("button", {
                type: "button",
                style: {
                    color: h
                },
                class: [ni("item", {
                    loading: p,
                    disabled: v
                }), g],
                onClick: m
            }, [a(f), l(f, d)])
        }
          , u = () => {
            if (t.description || e.description) {
                const f = e.description ? e.description() : t.description;
                return R("div", {
                    class: ni("description")
                }, [f])
            }
        }
        ;
        return () => R(Nl, st({
            class: ni(),
            position: "bottom",
            "onUpdate:show": r
        }, $t(t, xq)), {
            default: () => {
                var f;
                return [o(), u(), R("div", {
                    class: ni("content")
                }, [t.actions.map(c), (f = e.default) == null ? void 0 : f.call(e)]), s()]
            }
        })
    }
});
const JTe = De(bq)
  , [wq,Ho,nC] = Te("picker")
  , Z8 = t => t.find(e => !e.disabled) || t[0];
function Eq(t, e) {
    const n = t[0];
    if (n) {
        if (Array.isArray(n))
            return "multiple";
        if (e.children in n)
            return "cascade"
    }
    return "default"
}
function Rp(t, e) {
    e = $n(e, 0, t.length);
    for (let n = e; n < t.length; n++)
        if (!t[n].disabled)
            return n;
    for (let n = e - 1; n >= 0; n--)
        if (!t[n].disabled)
            return n;
    return 0
}
const rC = (t, e, n) => e !== void 0 && t.some(r => r[n.value] === e);
function Zy(t, e, n) {
    const r = t.findIndex(o => o[n.value] === e)
      , i = Rp(t, r);
    return t[i]
}
function Sq(t, e, n) {
    const r = [];
    let i = {
        [e.children]: t
    }
      , o = 0;
    for (; i && i[e.children]; ) {
        const s = i[e.children]
          , a = n.value[o];
        if (i = Lt(a) ? Zy(s, a, e) : void 0,
        !i && s.length) {
            const l = Z8(s)[e.value];
            i = Zy(s, l, e)
        }
        o++,
        r.push(s)
    }
    return r
}
function Cq(t) {
    const {transform: e} = window.getComputedStyle(t)
      , n = e.slice(7, e.length - 1).split(", ")[5];
    return Number(n)
}
function Aq(t) {
    return We({
        text: "text",
        value: "value",
        children: "children"
    }, t)
}
const iC = 200
  , oC = 300
  , Tq = 15
  , [J8,jm] = Te("picker-column")
  , Q8 = Symbol(J8);
var Pq = we({
    name: J8,
    props: {
        value: Se,
        fields: ur(Object),
        options: ns(),
        readonly: Boolean,
        allowHtml: Boolean,
        optionHeight: ur(Number),
        swipeDuration: ur(Se),
        visibleOptionNum: ur(Se)
    },
    emits: ["change", "clickOption", "scrollInto"],
    setup(t, {emit: e, slots: n}) {
        let r, i, o, s, a;
        const l = Z()
          , c = Z()
          , u = Z(0)
          , f = Z(0)
          , d = kl()
          , h = () => t.options.length
          , p = () => t.optionHeight * (+t.visibleOptionNum - 1) / 2
          , y = C => {
            let A = Rp(t.options, C);
            const T = -A * t.optionHeight
              , I = () => {
                A > h() - 1 && (A = Rp(t.options, C));
                const B = t.options[A][t.fields.value];
                B !== t.value && e("change", B)
            }
            ;
            r && T !== u.value ? a = I : I(),
            u.value = T
        }
          , v = () => t.readonly || !t.options.length
          , g = C => {
            r || v() || (a = null,
            f.value = iC,
            y(C),
            e("clickOption", t.options[C]))
        }
          , m = C => $n(Math.round(-C / t.optionHeight), 0, h() - 1)
          , _ = re( () => m(u.value))
          , x = (C, A) => {
            const T = Math.abs(C / A);
            C = u.value + T / .003 * (C < 0 ? -1 : 1);
            const I = m(C);
            f.value = +t.swipeDuration,
            y(I)
        }
          , b = () => {
            r = !1,
            f.value = 0,
            a && (a(),
            a = null)
        }
          , w = C => {
            if (!v()) {
                if (d.start(C),
                r) {
                    const A = Cq(c.value);
                    u.value = Math.min(0, A - p())
                }
                f.value = 0,
                i = u.value,
                o = Date.now(),
                s = i,
                a = null
            }
        }
          , E = C => {
            if (v())
                return;
            d.move(C),
            d.isVertical() && (r = !0,
            Bn(C, !0));
            const A = $n(i + d.deltaY.value, -(h() * t.optionHeight), t.optionHeight)
              , T = m(A);
            T !== _.value && e("scrollInto", t.options[T]),
            u.value = A;
            const I = Date.now();
            I - o > oC && (o = I,
            s = A)
        }
          , S = () => {
            if (v())
                return;
            const C = u.value - s
              , A = Date.now() - o;
            if (A < oC && Math.abs(C) > Tq) {
                x(C, A);
                return
            }
            const I = m(u.value);
            f.value = iC,
            y(I),
            setTimeout( () => {
                r = !1
            }
            , 0)
        }
          , P = () => {
            const C = {
                height: `${t.optionHeight}px`
            };
            return t.options.map( (A, T) => {
                const I = A[t.fields.text]
                  , {disabled: B} = A
                  , G = A[t.fields.value]
                  , N = {
                    role: "button",
                    style: C,
                    tabindex: B ? -1 : 0,
                    class: [jm("item", {
                        disabled: B,
                        selected: G === t.value
                    }), A.className],
                    onClick: () => g(T)
                }
                  , U = {
                    class: "van-ellipsis",
                    [t.allowHtml ? "innerHTML" : "textContent"]: I
                };
                return R("li", N, [n.option ? n.option(A, T) : R("div", U, null)])
            }
            )
        }
        ;
        return Zr(Q8),
        Kt({
            stopMomentum: b
        }),
        fu( () => {
            const C = r ? Math.floor(-u.value / t.optionHeight) : t.options.findIndex(I => I[t.fields.value] === t.value)
              , A = Rp(t.options, C)
              , T = -A * t.optionHeight;
            r && A < C && b(),
            u.value = T
        }
        ),
        mr("touchmove", E, {
            target: l
        }),
        () => R("div", {
            ref: l,
            class: jm(),
            onTouchstartPassive: w,
            onTouchend: S,
            onTouchcancel: S
        }, [R("ul", {
            ref: c,
            style: {
                transform: `translate3d(0, ${u.value + p()}px, 0)`,
                transitionDuration: `${f.value}ms`,
                transitionProperty: f.value ? "all" : "none"
            },
            class: jm("wrapper"),
            onTransitionend: b
        }, [P()])])
    }
});
const [Iq] = Te("picker-toolbar")
  , Bg = {
    title: String,
    cancelButtonText: String,
    confirmButtonText: String
}
  , Oq = ["cancel", "confirm", "title", "toolbar"]
  , Rq = Object.keys(Bg);
var Mq = we({
    name: Iq,
    props: Bg,
    emits: ["confirm", "cancel"],
    setup(t, {emit: e, slots: n}) {
        const r = () => {
            if (n.title)
                return n.title();
            if (t.title)
                return R("div", {
                    class: [Ho("title"), "van-ellipsis"]
                }, [t.title])
        }
          , i = () => e("cancel")
          , o = () => e("confirm")
          , s = () => {
            var l;
            const c = (l = t.cancelButtonText) != null ? l : nC("cancel");
            if (!(!n.cancel && !c))
                return R("button", {
                    type: "button",
                    class: [Ho("cancel"), rs],
                    onClick: i
                }, [n.cancel ? n.cancel() : c])
        }
          , a = () => {
            var l;
            const c = (l = t.confirmButtonText) != null ? l : nC("confirm");
            if (!(!n.confirm && !c))
                return R("button", {
                    type: "button",
                    class: [Ho("confirm"), rs],
                    onClick: o
                }, [n.confirm ? n.confirm() : c])
        }
        ;
        return () => R("div", {
            class: Ho("toolbar")
        }, [n.toolbar ? n.toolbar() : [s(), r(), a()]])
    }
});
const Dq = (t, e) => {
    const n = Z(t());
    return ve(t, r => {
        r !== n.value && (n.value = r)
    }
    ),
    ve(n, r => {
        r !== t() && e(r)
    }
    ),
    n
}
;
/**
* @vue/shared v3.5.20
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
const eM = Array.isArray
  , ed = t => typeof t == "string"
  , tM = t => t !== null && typeof t == "object"
  , Bq = t => {
    const e = Object.create(null);
    return n => e[n] || (e[n] = t(n))
}
  , kq = /\B([A-Z])/g
  , Nq = Bq(t => t.replace(kq, "-$1").toLowerCase());
function nM(t) {
    if (eM(t)) {
        const e = {};
        for (let n = 0; n < t.length; n++) {
            const r = t[n]
              , i = ed(r) ? Uq(r) : nM(r);
            if (i)
                for (const o in i)
                    e[o] = i[o]
        }
        return e
    } else if (ed(t) || tM(t))
        return t
}
const Fq = /;(?![^(]*\))/g
  , Lq = /:([^]+)/
  , $q = /\/\*[^]*?\*\//g;
function Uq(t) {
    const e = {};
    return t.replace($q, "").split(Fq).forEach(n => {
        if (n) {
            const r = n.split(Lq);
            r.length > 1 && (e[r[0].trim()] = r[1].trim())
        }
    }
    ),
    e
}
function Gq(t) {
    if (!t)
        return "";
    if (ed(t))
        return t;
    let e = "";
    for (const n in t) {
        const r = t[n];
        if (ed(r) || typeof r == "number") {
            const i = n.startsWith("--") ? n : Nq(n);
            e += `${i}:${r};`
        }
    }
    return e
}
function rM(t) {
    let e = "";
    if (ed(t))
        e = t;
    else if (eM(t))
        for (let n = 0; n < t.length; n++) {
            const r = rM(t[n]);
            r && (e += r + " ")
        }
    else if (tM(t))
        for (const n in t)
            t[n] && (e += n + " ");
    return e.trim()
}
function Hq(t, e, n) {
    let r, i = 0;
    const o = t.scrollLeft
      , s = n === 0 ? 1 : Math.round(n * 1e3 / 16);
    let a = o;
    function l() {
        Hd(r)
    }
    function c() {
        a += (e - o) / s,
        t.scrollLeft = a,
        ++i < s && (r = hr(c))
    }
    return c(),
    l
}
function Vq(t, e, n, r) {
    let i, o = zd(t);
    const s = o < e
      , a = n === 0 ? 1 : Math.round(n * 1e3 / 16)
      , l = (e - o) / a;
    function c() {
        Hd(i)
    }
    function u() {
        o += l,
        (s && o > e || !s && o < e) && (o = e),
        f0(t, o),
        s && o < e || !s && o > e ? i = hr(u) : r && (i = hr(r))
    }
    return u(),
    c
}
let zq = 0;
function hw() {
    const t = yt()
      , {name: e="unknown"} = (t == null ? void 0 : t.type) || {};
    return `${e}-${++zq}`
}
function iM() {
    const t = Z([])
      , e = [];
    return dg( () => {
        t.value = []
    }
    ),
    [t, r => (e[r] || (e[r] = i => {
        t.value[r] = i
    }
    ),
    e[r])]
}
function oM(t, e) {
    if (!po || !window.IntersectionObserver)
        return;
    const n = new IntersectionObserver(o => {
        e(o[0].intersectionRatio > 0)
    }
    ,{
        root: document.body
    })
      , r = () => {
        t.value && n.observe(t.value)
    }
      , i = () => {
        t.value && n.unobserve(t.value)
    }
    ;
    bo(i),
    qr(i),
    pu(r)
}
const [jq,Wq] = Te("sticky")
  , Yq = {
    zIndex: Se,
    position: Me("top"),
    container: Object,
    offsetTop: ze(0),
    offsetBottom: ze(0)
};
var Xq = we({
    name: jq,
    props: Yq,
    emits: ["scroll", "change"],
    setup(t, {emit: e, slots: n}) {
        const r = Z()
          , i = Vd(r)
          , o = Mt({
            fixed: !1,
            width: 0,
            height: 0,
            transform: 0
        })
          , s = Z(!1)
          , a = re( () => uw(t.position === "top" ? t.offsetTop : t.offsetBottom))
          , l = re( () => {
            if (s.value)
                return;
            const {fixed: d, height: h, width: p} = o;
            if (d)
                return {
                    width: `${p}px`,
                    height: `${h}px`
                }
        }
        )
          , c = re( () => {
            if (!o.fixed || s.value)
                return;
            const d = We(F8(t.zIndex), {
                width: `${o.width}px`,
                height: `${o.height}px`,
                [t.position]: `${a.value}px`
            });
            return o.transform && (d.transform = `translate3d(0, ${o.transform}px, 0)`),
            d
        }
        )
          , u = d => e("scroll", {
            scrollTop: d,
            isFixed: o.fixed
        })
          , f = () => {
            if (!r.value || Uc(r))
                return;
            const {container: d, position: h} = t
              , p = wn(r)
              , y = zd(window);
            if (o.width = p.width,
            o.height = p.height,
            h === "top")
                if (d) {
                    const v = wn(d)
                      , g = v.bottom - a.value - o.height;
                    o.fixed = a.value > p.top && v.bottom > 0,
                    o.transform = g < 0 ? g : 0
                } else
                    o.fixed = a.value > p.top;
            else {
                const {clientHeight: v} = document.documentElement;
                if (d) {
                    const g = wn(d)
                      , m = v - g.top - a.value - o.height;
                    o.fixed = v - a.value < p.bottom && v > g.top,
                    o.transform = m < 0 ? -m : 0
                } else
                    o.fixed = v - a.value < p.bottom
            }
            u(y)
        }
        ;
        return ve( () => o.fixed, d => e("change", d)),
        mr("scroll", f, {
            target: i,
            passive: !0
        }),
        oM(r, f),
        ve([Wo, Ys], () => {
            !r.value || Uc(r) || !o.fixed || (s.value = !0,
            Xe( () => {
                const d = wn(r);
                o.width = d.width,
                o.height = d.height,
                s.value = !1
            }
            ))
        }
        ),
        () => {
            var d;
            return R("div", {
                ref: r,
                style: l.value
            }, [R("div", {
                class: Wq({
                    fixed: o.fixed && !s.value
                }),
                style: c.value
            }, [(d = n.default) == null ? void 0 : d.call(n)])])
        }
    }
});
const Kq = De(Xq)
  , [sM,Rh] = Te("swipe")
  , qq = {
    loop: _e,
    width: Se,
    height: Se,
    vertical: Boolean,
    autoplay: ze(0),
    duration: ze(500),
    touchable: _e,
    lazyRender: Boolean,
    initialSwipe: ze(0),
    indicatorColor: String,
    showIndicators: _e,
    stopPropagation: _e
}
  , aM = Symbol(sM);
var Zq = we({
    name: sM,
    props: qq,
    emits: ["change", "dragStart", "dragEnd"],
    setup(t, {emit: e, slots: n}) {
        const r = Z()
          , i = Z()
          , o = Mt({
            rect: null,
            width: 0,
            height: 0,
            offset: 0,
            active: 0,
            swiping: !1
        });
        let s = !1;
        const a = kl()
          , {children: l, linkChildren: c} = Ui(aM)
          , u = re( () => l.length)
          , f = re( () => o[t.vertical ? "height" : "width"])
          , d = re( () => t.vertical ? a.deltaY.value : a.deltaX.value)
          , h = re( () => o.rect ? (t.vertical ? o.rect.height : o.rect.width) - f.value * u.value : 0)
          , p = re( () => f.value ? Math.ceil(Math.abs(h.value) / f.value) : u.value)
          , y = re( () => u.value * f.value)
          , v = re( () => (o.active + u.value) % u.value)
          , g = re( () => {
            const ue = t.vertical ? "vertical" : "horizontal";
            return a.direction.value === ue
        }
        )
          , m = re( () => {
            const ue = {
                transitionDuration: `${o.swiping ? 0 : t.duration}ms`,
                transform: `translate${t.vertical ? "Y" : "X"}(${+o.offset.toFixed(2)}px)`
            };
            if (f.value) {
                const X = t.vertical ? "height" : "width"
                  , ie = t.vertical ? "width" : "height";
                ue[X] = `${y.value}px`,
                ue[ie] = t[ie] ? `${t[ie]}px` : ""
            }
            return ue
        }
        )
          , _ = ue => {
            const {active: X} = o;
            return ue ? t.loop ? $n(X + ue, -1, u.value) : $n(X + ue, 0, p.value) : X
        }
          , x = (ue, X=0) => {
            let ie = ue * f.value;
            t.loop || (ie = Math.min(ie, -h.value));
            let ge = X - ie;
            return t.loop || (ge = $n(ge, h.value, 0)),
            ge
        }
          , b = ({pace: ue=0, offset: X=0, emitChange: ie}) => {
            if (u.value <= 1)
                return;
            const {active: ge} = o
              , F = _(ue)
              , q = x(F, X);
            if (t.loop) {
                if (l[0] && q !== h.value) {
                    const L = q < h.value;
                    l[0].setOffset(L ? y.value : 0)
                }
                if (l[u.value - 1] && q !== 0) {
                    const L = q > 0;
                    l[u.value - 1].setOffset(L ? -y.value : 0)
                }
            }
            o.active = F,
            o.offset = q,
            ie && F !== ge && e("change", v.value)
        }
          , w = () => {
            o.swiping = !0,
            o.active <= -1 ? b({
                pace: u.value
            }) : o.active >= u.value && b({
                pace: -u.value
            })
        }
          , E = () => {
            w(),
            a.reset(),
            Ua( () => {
                o.swiping = !1,
                b({
                    pace: -1,
                    emitChange: !0
                })
            }
            )
        }
          , S = () => {
            w(),
            a.reset(),
            Ua( () => {
                o.swiping = !1,
                b({
                    pace: 1,
                    emitChange: !0
                })
            }
            )
        }
        ;
        let P;
        const C = () => clearTimeout(P)
          , A = () => {
            C(),
            +t.autoplay > 0 && u.value > 1 && (P = setTimeout( () => {
                S(),
                A()
            }
            , +t.autoplay))
        }
          , T = (ue=+t.initialSwipe) => {
            if (!r.value)
                return;
            const X = () => {
                var ie, ge;
                if (!Uc(r)) {
                    const F = {
                        width: r.value.offsetWidth,
                        height: r.value.offsetHeight
                    };
                    o.rect = F,
                    o.width = +((ie = t.width) != null ? ie : F.width),
                    o.height = +((ge = t.height) != null ? ge : F.height)
                }
                u.value && (ue = Math.min(u.value - 1, ue),
                ue === -1 && (ue = u.value - 1)),
                o.active = ue,
                o.swiping = !0,
                o.offset = x(ue),
                l.forEach(F => {
                    F.setOffset(0)
                }
                ),
                A()
            }
            ;
            Uc(r) ? Xe().then(X) : X()
        }
          , I = () => T(o.active);
        let B;
        const G = ue => {
            !t.touchable || ue.touches.length > 1 || (a.start(ue),
            s = !1,
            B = Date.now(),
            C(),
            w())
        }
          , N = ue => {
            t.touchable && o.swiping && (a.move(ue),
            g.value && (!t.loop && (o.active === 0 && d.value > 0 || o.active === u.value - 1 && d.value < 0) || (Bn(ue, t.stopPropagation),
            b({
                offset: d.value
            }),
            s || (e("dragStart", {
                index: v.value
            }),
            s = !0))))
        }
          , U = () => {
            if (!t.touchable || !o.swiping)
                return;
            const ue = Date.now() - B
              , X = d.value / ue;
            if ((Math.abs(X) > .25 || Math.abs(d.value) > f.value / 2) && g.value) {
                const ge = t.vertical ? a.offsetY.value : a.offsetX.value;
                let F = 0;
                t.loop ? F = ge > 0 ? d.value > 0 ? -1 : 1 : 0 : F = -Math[d.value > 0 ? "ceil" : "floor"](d.value / f.value),
                b({
                    pace: F,
                    emitChange: !0
                })
            } else
                d.value && b({
                    pace: 0
                });
            s = !1,
            o.swiping = !1,
            e("dragEnd", {
                index: v.value
            }),
            A()
        }
          , W = (ue, X={}) => {
            w(),
            a.reset(),
            Ua( () => {
                let ie;
                t.loop && ue === u.value ? ie = o.active === 0 ? 0 : ue : ie = ue % u.value,
                X.immediate ? Ua( () => {
                    o.swiping = !1
                }
                ) : o.swiping = !1,
                b({
                    pace: ie - o.active,
                    emitChange: !0
                })
            }
            )
        }
          , K = (ue, X) => {
            const ie = X === v.value
              , ge = ie ? {
                backgroundColor: t.indicatorColor
            } : void 0;
            return R("i", {
                style: ge,
                class: Rh("indicator", {
                    active: ie
                })
            }, null)
        }
          , fe = () => {
            if (n.indicator)
                return n.indicator({
                    active: v.value,
                    total: u.value
                });
            if (t.showIndicators && u.value > 1)
                return R("div", {
                    class: Rh("indicators", {
                        vertical: t.vertical
                    })
                }, [Array(u.value).fill("").map(K)])
        }
        ;
        return Kt({
            prev: E,
            next: S,
            state: o,
            resize: I,
            swipeTo: W
        }),
        c({
            size: f,
            props: t,
            count: u,
            activeIndicator: v
        }),
        ve( () => t.initialSwipe, ue => T(+ue)),
        ve(u, () => T(o.active)),
        ve( () => t.autoplay, A),
        ve([Wo, Ys, () => t.width, () => t.height], I),
        ve(rR(), ue => {
            ue === "visible" ? A() : C()
        }
        ),
        Ht(T),
        cs( () => T(o.active)),
        fw( () => T(o.active)),
        bo(C),
        qr(C),
        mr("touchmove", N, {
            target: i
        }),
        () => {
            var ue;
            return R("div", {
                ref: r,
                class: Rh()
            }, [R("div", {
                ref: i,
                style: m.value,
                class: Rh("track", {
                    vertical: t.vertical
                }),
                onTouchstartPassive: G,
                onTouchend: U,
                onTouchcancel: U
            }, [(ue = n.default) == null ? void 0 : ue.call(n)]), fe()])
        }
    }
});
const lM = De(Zq)
  , [Jq,sC] = Te("tabs");
var Qq = we({
    name: Jq,
    props: {
        count: ur(Number),
        inited: Boolean,
        animated: Boolean,
        duration: ur(Se),
        swipeable: Boolean,
        lazyRender: Boolean,
        currentIndex: ur(Number)
    },
    emits: ["change"],
    setup(t, {emit: e, slots: n}) {
        const r = Z()
          , i = a => e("change", a)
          , o = () => {
            var a;
            const l = (a = n.default) == null ? void 0 : a.call(n);
            return t.animated || t.swipeable ? R(lM, {
                ref: r,
                loop: !1,
                class: sC("track"),
                duration: +t.duration * 1e3,
                touchable: t.swipeable,
                lazyRender: t.lazyRender,
                showIndicators: !1,
                onChange: i
            }, {
                default: () => [l]
            }) : l
        }
          , s = a => {
            const l = r.value;
            l && l.state.active !== a && l.swipeTo(a, {
                immediate: !t.inited
            })
        }
        ;
        return ve( () => t.currentIndex, s),
        Ht( () => {
            s(t.currentIndex)
        }
        ),
        Kt({
            swipeRef: r
        }),
        () => R("div", {
            class: sC("content", {
                animated: t.animated || t.swipeable
            })
        }, [o()])
    }
});
const [cM,Mh] = Te("tabs")
  , eZ = {
    type: Me("line"),
    color: String,
    border: Boolean,
    sticky: Boolean,
    shrink: Boolean,
    active: ze(0),
    duration: ze(.3),
    animated: Boolean,
    ellipsis: _e,
    swipeable: Boolean,
    scrollspy: Boolean,
    offsetTop: ze(0),
    background: String,
    lazyRender: _e,
    showHeader: _e,
    lineWidth: Se,
    lineHeight: Se,
    beforeChange: Function,
    swipeThreshold: ze(5),
    titleActiveColor: String,
    titleInactiveColor: String
}
  , uM = Symbol(cM);
var tZ = we({
    name: cM,
    props: eZ,
    emits: ["change", "scroll", "rendered", "clickTab", "update:active"],
    setup(t, {emit: e, slots: n}) {
        let r, i, o, s, a;
        const l = Z()
          , c = Z()
          , u = Z()
          , f = Z()
          , d = hw()
          , h = Vd(l)
          , [p,y] = iM()
          , {children: v, linkChildren: g} = Ui(uM)
          , m = Mt({
            inited: !1,
            position: "",
            lineStyle: {},
            currentIndex: -1
        })
          , _ = re( () => v.length > +t.swipeThreshold || !t.ellipsis || t.shrink)
          , x = re( () => ({
            borderColor: t.color,
            background: t.background
        }))
          , b = (F, q) => {
            var L;
            return (L = F.name) != null ? L : q
        }
          , w = re( () => {
            const F = v[m.currentIndex];
            if (F)
                return b(F, m.currentIndex)
        }
        )
          , E = re( () => uw(t.offsetTop))
          , S = re( () => t.sticky ? E.value + r : 0)
          , P = F => {
            const q = c.value
              , L = p.value;
            if (!_.value || !q || !L || !L[m.currentIndex])
                return;
            const ee = L[m.currentIndex].$el
              , J = ee.offsetLeft - (q.offsetWidth - ee.offsetWidth) / 2;
            s && s(),
            s = Hq(q, J, F ? 0 : +t.duration)
        }
          , C = () => {
            const F = m.inited;
            Xe( () => {
                const q = p.value;
                if (!q || !q[m.currentIndex] || t.type !== "line" || Uc(l.value))
                    return;
                const L = q[m.currentIndex].$el
                  , {lineWidth: ee, lineHeight: J} = t
                  , de = L.offsetLeft + L.offsetWidth / 2
                  , pe = {
                    width: tt(ee),
                    backgroundColor: t.color,
                    transform: `translateX(${de}px) translateX(-50%)`
                };
                if (F && (pe.transitionDuration = `${t.duration}s`),
                Lt(J)) {
                    const xe = tt(J);
                    pe.height = xe,
                    pe.borderRadius = xe
                }
                m.lineStyle = pe
            }
            )
        }
          , A = F => {
            const q = F < m.currentIndex ? -1 : 1;
            for (; F >= 0 && F < v.length; ) {
                if (!v[F].disabled)
                    return F;
                F += q
            }
        }
          , T = (F, q) => {
            const L = A(F);
            if (!Lt(L))
                return;
            const ee = v[L]
              , J = b(ee, L)
              , de = m.currentIndex !== null;
            m.currentIndex !== L && (m.currentIndex = L,
            q || P(),
            C()),
            J !== t.active && (e("update:active", J),
            de && e("change", J, ee.title)),
            o && !t.scrollspy && cw(Math.ceil(zS(l.value) - E.value))
        }
          , I = (F, q) => {
            const L = v.findIndex( (ee, J) => b(ee, J) === F);
            T(L === -1 ? 0 : L, q)
        }
          , B = (F=!1) => {
            if (t.scrollspy) {
                const q = v[m.currentIndex].$el;
                if (q && h.value) {
                    const L = zS(q, h.value) - S.value;
                    i = !0,
                    a && a(),
                    a = Vq(h.value, L, F ? 0 : +t.duration, () => {
                        i = !1
                    }
                    )
                }
            }
        }
          , G = (F, q, L) => {
            const {title: ee, disabled: J} = v[q]
              , de = b(v[q], q);
            J || (gu(t.beforeChange, {
                args: [de],
                done: () => {
                    T(q),
                    B()
                }
            }),
            K8(F)),
            e("clickTab", {
                name: de,
                title: ee,
                event: L,
                disabled: J
            })
        }
          , N = F => {
            o = F.isFixed,
            e("scroll", F)
        }
          , U = F => {
            Xe( () => {
                I(F),
                B(!0)
            }
            )
        }
          , W = () => {
            for (let F = 0; F < v.length; F++) {
                const {top: q} = wn(v[F].$el);
                if (q > S.value)
                    return F === 0 ? 0 : F - 1
            }
            return v.length - 1
        }
          , K = () => {
            if (t.scrollspy && !i) {
                const F = W();
                T(F)
            }
        }
          , fe = () => {
            if (t.type === "line" && v.length)
                return R("div", {
                    class: Mh("line"),
                    style: m.lineStyle
                }, null)
        }
          , ue = () => {
            var F, q, L;
            const {type: ee, border: J, sticky: de} = t
              , pe = [R("div", {
                ref: de ? void 0 : u,
                class: [Mh("wrap"), {
                    [H8]: ee === "line" && J
                }]
            }, [R("div", {
                ref: c,
                role: "tablist",
                class: Mh("nav", [ee, {
                    shrink: t.shrink,
                    complete: _.value
                }]),
                style: x.value,
                "aria-orientation": "horizontal"
            }, [(F = n["nav-left"]) == null ? void 0 : F.call(n), v.map(xe => xe.renderTitle(G)), fe(), (q = n["nav-right"]) == null ? void 0 : q.call(n)])]), (L = n["nav-bottom"]) == null ? void 0 : L.call(n)];
            return de ? R("div", {
                ref: u
            }, [pe]) : pe
        }
          , X = () => {
            C(),
            Xe( () => {
                var F, q;
                P(!0),
                (q = (F = f.value) == null ? void 0 : F.swipeRef.value) == null || q.resize()
            }
            )
        }
        ;
        ve( () => [t.color, t.duration, t.lineWidth, t.lineHeight], C),
        ve(Wo, X),
        ve( () => t.active, F => {
            F !== w.value && I(F)
        }
        ),
        ve( () => v.length, () => {
            m.inited && (I(t.active),
            C(),
            Xe( () => {
                P(!0)
            }
            ))
        }
        );
        const ie = () => {
            I(t.active, !0),
            Xe( () => {
                m.inited = !0,
                u.value && (r = wn(u.value).height),
                P(!0)
            }
            )
        }
          , ge = (F, q) => e("rendered", F, q);
        return Kt({
            resize: X,
            scrollTo: U
        }),
        cs(C),
        fw(C),
        pu(ie),
        oM(l, C),
        mr("scroll", K, {
            target: h,
            passive: !0
        }),
        g({
            id: d,
            props: t,
            setLine: C,
            scrollable: _,
            onRendered: ge,
            currentName: w,
            setTitleRefs: y,
            scrollIntoView: P
        }),
        () => R("div", {
            ref: l,
            class: Mh([t.type])
        }, [t.showHeader ? t.sticky ? R(Kq, {
            container: l.value,
            offsetTop: E.value,
            onScroll: N
        }, {
            default: () => [ue()]
        }) : ue() : null, R(Qq, {
            ref: f,
            count: v.length,
            inited: m.inited,
            animated: t.animated,
            duration: t.duration,
            swipeable: t.swipeable,
            lazyRender: t.lazyRender,
            currentIndex: m.currentIndex,
            onChange: T
        }, {
            default: () => {
                var F;
                return [(F = n.default) == null ? void 0 : F.call(n)]
            }
        })])
    }
});
const nZ = Symbol()
  , fM = Symbol()
  , dM = () => dn(fM, null)
  , rZ = t => {
    const e = dM();
    hi(nZ, t),
    hi(fM, re( () => (e == null || e.value) && t.value))
}
  , [iZ,aC] = Te("tab")
  , oZ = we({
    name: iZ,
    props: {
        id: String,
        dot: Boolean,
        type: String,
        color: String,
        title: String,
        badge: Se,
        shrink: Boolean,
        isActive: Boolean,
        disabled: Boolean,
        controls: String,
        scrollable: Boolean,
        activeColor: String,
        inactiveColor: String,
        showZeroBadge: _e
    },
    setup(t, {slots: e}) {
        const n = re( () => {
            const i = {}
              , {type: o, color: s, disabled: a, isActive: l, activeColor: c, inactiveColor: u} = t;
            s && o === "card" && (i.borderColor = s,
            a || (l ? i.backgroundColor = s : i.color = s));
            const d = l ? c : u;
            return d && (i.color = d),
            i
        }
        )
          , r = () => {
            const i = R("span", {
                class: aC("text", {
                    ellipsis: !t.scrollable
                })
            }, [e.title ? e.title() : t.title]);
            return t.dot || Lt(t.badge) && t.badge !== "" ? R(Dg, {
                dot: t.dot,
                content: t.badge,
                showZero: t.showZeroBadge
            }, {
                default: () => [i]
            }) : i
        }
        ;
        return () => R("div", {
            id: t.id,
            role: "tab",
            class: [aC([t.type, {
                grow: t.scrollable && !t.shrink,
                shrink: t.shrink,
                active: t.isActive,
                disabled: t.disabled
            }])],
            style: n.value,
            tabindex: t.disabled ? void 0 : t.isActive ? 0 : -1,
            "aria-selected": t.isActive,
            "aria-disabled": t.disabled || void 0,
            "aria-controls": t.controls,
            "data-allow-mismatch": "attribute"
        }, [r()])
    }
})
  , [sZ,aZ] = Te("swipe-item");
var lZ = we({
    name: sZ,
    setup(t, {slots: e}) {
        let n;
        const r = Mt({
            offset: 0,
            inited: !1,
            mounted: !1
        })
          , {parent: i, index: o} = Zr(aM);
        if (!i) {
            console.error("[Vant] <SwipeItem> must be a child component of <Swipe>.");
            return
        }
        const s = re( () => {
            const c = {}
              , {vertical: u} = i.props;
            return i.size.value && (c[u ? "height" : "width"] = `${i.size.value}px`),
            r.offset && (c.transform = `translate${u ? "Y" : "X"}(${r.offset}px)`),
            c
        }
        )
          , a = re( () => {
            const {loop: c, lazyRender: u} = i.props;
            if (!u || n)
                return !0;
            if (!r.mounted)
                return !1;
            const f = i.activeIndicator.value
              , d = i.count.value - 1
              , h = f === 0 && c ? d : f - 1
              , p = f === d && c ? 0 : f + 1;
            return n = o.value === f || o.value === h || o.value === p,
            n
        }
        )
          , l = c => {
            r.offset = c
        }
        ;
        return Ht( () => {
            Xe( () => {
                r.mounted = !0
            }
            )
        }
        ),
        Kt({
            setOffset: l
        }),
        () => {
            var c;
            return R("div", {
                class: aZ(),
                style: s.value
            }, [a.value ? (c = e.default) == null ? void 0 : c.call(e) : null])
        }
    }
});
const hM = De(lZ)
  , [cZ,Wm] = Te("tab")
  , uZ = We({}, mu, {
    dot: Boolean,
    name: Se,
    badge: Se,
    title: String,
    disabled: Boolean,
    titleClass: hn,
    titleStyle: [String, Object],
    showZeroBadge: _e
});
var fZ = we({
    name: cZ,
    props: uZ,
    setup(t, {slots: e}) {
        const n = hw()
          , r = Z(!1)
          , i = yt()
          , {parent: o, index: s} = Zr(uM);
        if (!o) {
            console.error("[Vant] <Tab> must be a child component of <Tabs>.");
            return
        }
        const a = () => {
            var p;
            return (p = t.name) != null ? p : s.value
        }
          , l = () => {
            r.value = !0,
            o.props.lazyRender && Xe( () => {
                o.onRendered(a(), t.title)
            }
            )
        }
          , c = re( () => {
            const p = a() === o.currentName.value;
            return p && !r.value && l(),
            p
        }
        )
          , u = Z("")
          , f = Z("");
        fu( () => {
            const {titleClass: p, titleStyle: y} = t;
            u.value = p ? rM(p) : "",
            f.value = y && typeof y != "string" ? Gq(nM(y)) : y
        }
        );
        const d = p => R(oZ, st({
            key: n,
            id: `${o.id}-${s.value}`,
            ref: o.setTitleRefs(s.value),
            style: f.value,
            class: u.value,
            isActive: c.value,
            controls: n,
            scrollable: o.scrollable.value,
            activeColor: o.props.titleActiveColor,
            inactiveColor: o.props.titleInactiveColor,
            onClick: y => p(i.proxy, s.value, y)
        }, $t(o.props, ["type", "color", "shrink"]), $t(t, ["dot", "badge", "title", "disabled", "showZeroBadge"])), {
            title: e.title
        })
          , h = Z(!c.value);
        return ve(c, p => {
            p ? h.value = !1 : Ua( () => {
                h.value = !0
            }
            )
        }
        ),
        ve( () => t.title, () => {
            o.setLine(),
            o.scrollIntoView()
        }
        ),
        rZ(c),
        Kt({
            id: n,
            renderTitle: d
        }),
        () => {
            var p;
            const y = `${o.id}-${s.value}`
              , {animated: v, swipeable: g, scrollspy: m, lazyRender: _} = o.props;
            if (!e.default && !v)
                return;
            const x = m || c.value;
            if (v || g)
                return R(hM, {
                    id: n,
                    role: "tabpanel",
                    class: Wm("panel-wrapper", {
                        inactive: h.value
                    }),
                    tabindex: c.value ? 0 : -1,
                    "aria-hidden": !c.value,
                    "aria-labelledby": y,
                    "data-allow-mismatch": "attribute"
                }, {
                    default: () => {
                        var E;
                        return [R("div", {
                            class: Wm("panel")
                        }, [(E = e.default) == null ? void 0 : E.call(e)])]
                    }
                });
            const w = r.value || m || !_ ? (p = e.default) == null ? void 0 : p.call(e) : null;
            return di(R("div", {
                id: n,
                role: "tabpanel",
                class: Wm("panel"),
                tabindex: x ? 0 : -1,
                "aria-labelledby": y,
                "data-allow-mismatch": "attribute"
            }, [w]), [[pi, x]])
        }
    }
});
const QTe = De(fZ)
  , e3e = De(tZ)
  , [dZ,t3e] = Te("picker-group")
  , hZ = Symbol(dZ);
We({
    tabs: ns(),
    activeTab: ze(0),
    nextStepText: String,
    showToolbar: _e
}, Bg);
const pw = We({
    loading: Boolean,
    readonly: Boolean,
    allowHtml: Boolean,
    optionHeight: ze(44),
    showToolbar: _e,
    swipeDuration: ze(1e3),
    visibleOptionNum: ze(6)
}, Bg)
  , pZ = We({}, pw, {
    columns: ns(),
    modelValue: ns(),
    toolbarPosition: Me("top"),
    columnsFieldNames: Object
});
var gZ = we({
    name: wq,
    props: pZ,
    emits: ["confirm", "cancel", "change", "scrollInto", "clickOption", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const r = Z()
          , i = Z(t.modelValue.slice(0))
          , {parent: o} = Zr(hZ)
          , {children: s, linkChildren: a} = Ui(Q8);
        a();
        const l = re( () => Aq(t.columnsFieldNames))
          , c = re( () => uw(t.optionHeight))
          , u = re( () => Eq(t.columns, l.value))
          , f = re( () => {
            const {columns: T} = t;
            switch (u.value) {
            case "multiple":
                return T;
            case "cascade":
                return Sq(T, l.value, i);
            default:
                return [T]
            }
        }
        )
          , d = re( () => f.value.some(T => T.length))
          , h = re( () => f.value.map( (T, I) => Zy(T, i.value[I], l.value)))
          , p = re( () => f.value.map( (T, I) => T.findIndex(B => B[l.value.value] === i.value[I])))
          , y = (T, I) => {
            if (i.value[T] !== I) {
                const B = i.value.slice(0);
                B[T] = I,
                i.value = B
            }
        }
          , v = () => ({
            selectedValues: i.value.slice(0),
            selectedOptions: h.value,
            selectedIndexes: p.value
        })
          , g = (T, I) => {
            y(I, T),
            u.value === "cascade" && i.value.forEach( (B, G) => {
                const N = f.value[G];
                rC(N, B, l.value) || y(G, N.length ? N[0][l.value.value] : void 0)
            }
            ),
            Xe( () => {
                e("change", We({
                    columnIndex: I
                }, v()))
            }
            )
        }
          , m = (T, I) => {
            const B = {
                columnIndex: I,
                currentOption: T
            };
            e("clickOption", We(v(), B)),
            e("scrollInto", B)
        }
          , _ = () => {
            s.forEach(I => I.stopMomentum());
            const T = v();
            return Xe( () => {
                const I = v();
                e("confirm", I)
            }
            ),
            T
        }
          , x = () => e("cancel", v())
          , b = () => f.value.map( (T, I) => R(Pq, {
            value: i.value[I],
            fields: l.value,
            options: T,
            readonly: t.readonly,
            allowHtml: t.allowHtml,
            optionHeight: c.value,
            swipeDuration: t.swipeDuration,
            visibleOptionNum: t.visibleOptionNum,
            onChange: B => g(B, I),
            onClickOption: B => m(B, I),
            onScrollInto: B => {
                e("scrollInto", {
                    currentOption: B,
                    columnIndex: I
                })
            }
        }, {
            option: n.option
        }))
          , w = T => {
            if (d.value) {
                const I = {
                    height: `${c.value}px`
                }
                  , B = {
                    backgroundSize: `100% ${(T - c.value) / 2}px`
                };
                return [R("div", {
                    class: Ho("mask"),
                    style: B
                }, null), R("div", {
                    class: [DK, Ho("frame")],
                    style: I
                }, null)]
            }
        }
          , E = () => {
            const T = c.value * +t.visibleOptionNum
              , I = {
                height: `${T}px`
            };
            return !t.loading && !d.value && n.empty ? n.empty() : R("div", {
                ref: r,
                class: Ho("columns"),
                style: I
            }, [b(), w(T)])
        }
          , S = () => {
            if (t.showToolbar && !o)
                return R(Mq, st($t(t, Rq), {
                    onConfirm: _,
                    onCancel: x
                }), $t(n, Oq))
        }
          , P = T => {
            T.forEach( (I, B) => {
                I.length && !rC(I, i.value[B], l.value) && y(B, Z8(I)[l.value.value])
            }
            )
        }
        ;
        ve(f, T => P(T), {
            immediate: !0
        });
        let C;
        return ve( () => t.modelValue, T => {
            !Ws(T, i.value) && !Ws(T, C) && (i.value = T.slice(0),
            C = T.slice(0)),
            t.modelValue.length === 0 && P(f.value)
        }
        , {
            deep: !0
        }),
        ve(i, T => {
            Ws(T, t.modelValue) || (C = T.slice(0),
            e("update:modelValue", C))
        }
        , {
            immediate: !0
        }),
        mr("touchmove", Bn, {
            target: r
        }),
        Kt({
            confirm: _,
            getSelectedOptions: () => h.value
        }),
        () => {
            var T, I;
            return R("div", {
                class: Ho()
            }, [t.toolbarPosition === "top" ? S() : null, t.loading ? R(ds, {
                class: Ho("loading")
            }, null) : null, (T = n["columns-top"]) == null ? void 0 : T.call(n), E(), (I = n["columns-bottom"]) == null ? void 0 : I.call(n), t.toolbarPosition === "bottom" ? S() : null])
        }
    }
});
const mZ = De(gZ)
  , [vZ,Yl] = Te("cell")
  , kg = {
    tag: Me("div"),
    icon: String,
    size: String,
    title: Se,
    value: Se,
    label: Se,
    center: Boolean,
    isLink: Boolean,
    border: _e,
    iconPrefix: String,
    valueClass: hn,
    labelClass: hn,
    titleClass: hn,
    titleStyle: null,
    arrowDirection: String,
    required: {
        type: [Boolean, String],
        default: null
    },
    clickable: {
        type: Boolean,
        default: null
    }
}
  , yZ = We({}, kg, mu);
var _Z = we({
    name: vZ,
    props: yZ,
    setup(t, {slots: e}) {
        const n = jd()
          , r = () => {
            if (e.label || Lt(t.label))
                return R("div", {
                    class: [Yl("label"), t.labelClass]
                }, [e.label ? e.label() : t.label])
        }
          , i = () => {
            var l;
            if (e.title || Lt(t.title)) {
                const c = (l = e.title) == null ? void 0 : l.call(e);
                return Array.isArray(c) && c.length === 0 ? void 0 : R("div", {
                    class: [Yl("title"), t.titleClass],
                    style: t.titleStyle
                }, [c || R("span", null, [t.title]), r()])
            }
        }
          , o = () => {
            const l = e.value || e.default;
            if (l || Lt(t.value))
                return R("div", {
                    class: [Yl("value"), t.valueClass]
                }, [l ? l() : R("span", null, [t.value])])
        }
          , s = () => {
            if (e.icon)
                return e.icon();
            if (t.icon)
                return R(tn, {
                    name: t.icon,
                    class: Yl("left-icon"),
                    classPrefix: t.iconPrefix
                }, null)
        }
          , a = () => {
            if (e["right-icon"])
                return e["right-icon"]();
            if (t.isLink) {
                const l = t.arrowDirection && t.arrowDirection !== "right" ? `arrow-${t.arrowDirection}` : "arrow";
                return R(tn, {
                    name: l,
                    class: Yl("right-icon")
                }, null)
            }
        }
        ;
        return () => {
            var l;
            const {tag: c, size: u, center: f, border: d, isLink: h, required: p} = t
              , y = (l = t.clickable) != null ? l : h
              , v = {
                center: f,
                required: !!p,
                clickable: y,
                borderless: !d
            };
            return u && (v[u] = !!u),
            R(c, {
                class: Yl(v),
                role: y ? "button" : void 0,
                tabindex: y ? 0 : void 0,
                onClick: n
            }, {
                default: () => {
                    var g;
                    return [s(), i(), o(), a(), (g = e.extra) == null ? void 0 : g.call(e)]
                }
            })
        }
    }
});
const pM = De(_Z)
  , [xZ,bZ] = Te("form")
  , wZ = {
    colon: Boolean,
    disabled: Boolean,
    readonly: Boolean,
    required: [Boolean, String],
    showError: Boolean,
    labelWidth: Se,
    labelAlign: String,
    inputAlign: String,
    scrollToError: Boolean,
    scrollToErrorPosition: String,
    validateFirst: Boolean,
    submitOnEnter: _e,
    showErrorMessage: _e,
    errorMessageAlign: String,
    validateTrigger: {
        type: [String, Array],
        default: "onBlur"
    }
};
var EZ = we({
    name: xZ,
    props: wZ,
    emits: ["submit", "failed"],
    setup(t, {emit: e, slots: n}) {
        const {children: r, linkChildren: i} = Ui(V8)
          , o = v => v ? r.filter(g => v.includes(g.name)) : r
          , s = v => new Promise( (g, m) => {
            const _ = [];
            o(v).reduce( (b, w) => b.then( () => {
                if (!_.length)
                    return w.validate().then(E => {
                        E && _.push(E)
                    }
                    )
            }
            ), Promise.resolve()).then( () => {
                _.length ? m(_) : g()
            }
            )
        }
        )
          , a = v => new Promise( (g, m) => {
            const _ = o(v);
            Promise.all(_.map(x => x.validate())).then(x => {
                x = x.filter(Boolean),
                x.length ? m(x) : g()
            }
            )
        }
        )
          , l = v => {
            const g = r.find(m => m.name === v);
            return g ? new Promise( (m, _) => {
                g.validate().then(x => {
                    x ? _(x) : m()
                }
                )
            }
            ) : Promise.reject()
        }
          , c = v => typeof v == "string" ? l(v) : t.validateFirst ? s(v) : a(v)
          , u = v => {
            typeof v == "string" && (v = [v]),
            o(v).forEach(m => {
                m.resetValidation()
            }
            )
        }
          , f = () => r.reduce( (v, g) => (v[g.name] = g.getValidationStatus(),
        v), {})
          , d = (v, g) => {
            r.some(m => m.name === v ? (m.$el.scrollIntoView(g),
            !0) : !1)
        }
          , h = () => r.reduce( (v, g) => (g.name !== void 0 && (v[g.name] = g.formValue.value),
        v), {})
          , p = () => {
            const v = h();
            c().then( () => e("submit", v)).catch(g => {
                e("failed", {
                    values: v,
                    errors: g
                });
                const {scrollToError: m, scrollToErrorPosition: _} = t;
                m && g[0].name && d(g[0].name, _ ? {
                    block: _
                } : void 0)
            }
            )
        }
          , y = v => {
            Bn(v),
            p()
        }
        ;
        return i({
            props: t
        }),
        Kt({
            submit: p,
            validate: c,
            getValues: h,
            scrollToField: d,
            resetValidation: u,
            getValidationStatus: f
        }),
        () => {
            var v;
            return R("form", {
                class: bZ(),
                onSubmit: y
            }, [(v = n.default) == null ? void 0 : v.call(n)])
        }
    }
});
const n3e = De(EZ);
function gM(t) {
    return Array.isArray(t) ? !t.length : t === 0 ? !1 : !t
}
function SZ(t, e) {
    if (gM(t)) {
        if (e.required)
            return !1;
        if (e.validateEmpty === !1)
            return !0
    }
    return !(e.pattern && !e.pattern.test(String(t)))
}
function CZ(t, e) {
    return new Promise(n => {
        const r = e.validator(t, e);
        if (aw(r)) {
            r.then(n);
            return
        }
        n(r)
    }
    )
}
function lC(t, e) {
    const {message: n} = e;
    return $c(n) ? n(t, e) : n || ""
}
function AZ({target: t}) {
    t.composing = !0
}
function cC({target: t}) {
    t.composing && (t.composing = !1,
    t.dispatchEvent(new Event("input")))
}
function TZ(t, e) {
    const n = lw();
    t.style.height = "auto";
    let r = t.scrollHeight;
    if (go(e)) {
        const {maxHeight: i, minHeight: o} = e;
        i !== void 0 && (r = Math.min(r, i)),
        o !== void 0 && (r = Math.max(r, o))
    }
    r && (t.style.height = `${r}px`,
    cw(n))
}
function PZ(t, e) {
    return t === "number" && (t = "text",
    e ?? (e = "decimal")),
    t === "digit" && (t = "tel",
    e ?? (e = "numeric")),
    {
        type: t,
        inputmode: e
    }
}
function To(t) {
    return [...t].length
}
function Ym(t, e) {
    return [...t].slice(0, e).join("")
}
const [IZ,ri] = Te("field")
  , OZ = {
    id: String,
    name: String,
    leftIcon: String,
    rightIcon: String,
    autofocus: Boolean,
    clearable: Boolean,
    maxlength: Se,
    max: Number,
    min: Number,
    formatter: Function,
    clearIcon: Me("clear"),
    modelValue: ze(""),
    inputAlign: String,
    placeholder: String,
    autocomplete: String,
    autocapitalize: String,
    autocorrect: String,
    errorMessage: String,
    enterkeyhint: String,
    clearTrigger: Me("focus"),
    formatTrigger: Me("onChange"),
    spellcheck: {
        type: Boolean,
        default: null
    },
    error: {
        type: Boolean,
        default: null
    },
    disabled: {
        type: Boolean,
        default: null
    },
    readonly: {
        type: Boolean,
        default: null
    },
    inputmode: String
}
  , RZ = We({}, kg, OZ, {
    rows: Se,
    type: Me("text"),
    rules: Array,
    autosize: [Boolean, Object],
    labelWidth: Se,
    labelClass: hn,
    labelAlign: String,
    showWordLimit: Boolean,
    errorMessageAlign: String,
    colon: {
        type: Boolean,
        default: null
    }
});
var MZ = we({
    name: IZ,
    props: RZ,
    emits: ["blur", "focus", "clear", "keypress", "clickInput", "endValidate", "startValidate", "clickLeftIcon", "clickRightIcon", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const r = hw()
          , i = Mt({
            status: "unvalidated",
            focused: !1,
            validateMessage: ""
        })
          , o = Z()
          , s = Z()
          , a = Z()
          , {parent: l} = Zr(V8)
          , c = () => {
            var L;
            return String((L = t.modelValue) != null ? L : "")
        }
          , u = L => {
            if (Lt(t[L]))
                return t[L];
            if (l && Lt(l.props[L]))
                return l.props[L]
        }
          , f = re( () => {
            const L = u("readonly");
            if (t.clearable && !L) {
                const ee = c() !== ""
                  , J = t.clearTrigger === "always" || t.clearTrigger === "focus" && i.focused;
                return ee && J
            }
            return !1
        }
        )
          , d = re( () => a.value && n.input ? a.value() : t.modelValue)
          , h = re( () => {
            var L;
            const ee = u("required");
            return ee === "auto" ? (L = t.rules) == null ? void 0 : L.some(J => J.required) : ee
        }
        )
          , p = L => L.reduce( (ee, J) => ee.then( () => {
            if (i.status === "failed")
                return;
            let {value: de} = d;
            if (J.formatter && (de = J.formatter(de, J)),
            !SZ(de, J)) {
                i.status = "failed",
                i.validateMessage = lC(de, J);
                return
            }
            if (J.validator)
                return gM(de) && J.validateEmpty === !1 ? void 0 : CZ(de, J).then(pe => {
                    pe && typeof pe == "string" ? (i.status = "failed",
                    i.validateMessage = pe) : pe === !1 && (i.status = "failed",
                    i.validateMessage = lC(de, J))
                }
                )
        }
        ), Promise.resolve())
          , y = () => {
            i.status = "unvalidated",
            i.validateMessage = ""
        }
          , v = () => e("endValidate", {
            status: i.status,
            message: i.validateMessage
        })
          , g = (L=t.rules) => new Promise(ee => {
            y(),
            L ? (e("startValidate"),
            p(L).then( () => {
                i.status === "failed" ? (ee({
                    name: t.name,
                    message: i.validateMessage
                }),
                v()) : (i.status = "passed",
                ee(),
                v())
            }
            )) : ee()
        }
        )
          , m = L => {
            if (l && t.rules) {
                const {validateTrigger: ee} = l.props
                  , J = u0(ee).includes(L)
                  , de = t.rules.filter(pe => pe.trigger ? u0(pe.trigger).includes(L) : J);
                de.length && g(de)
            }
        }
          , _ = L => {
            var ee;
            const {maxlength: J} = t;
            if (Lt(J) && To(L) > +J) {
                const de = c();
                if (de && To(de) === +J)
                    return de;
                const pe = (ee = o.value) == null ? void 0 : ee.selectionEnd;
                if (i.focused && pe) {
                    const xe = [...L]
                      , O = xe.length - +J;
                    return xe.splice(pe - O, O),
                    xe.join("")
                }
                return Ym(L, +J)
            }
            return L
        }
          , x = (L, ee="onChange") => {
            var J, de;
            const pe = L;
            L = _(L);
            const xe = To(pe) - To(L);
            if (t.type === "number" || t.type === "digit") {
                const $ = t.type === "number";
                if (L = Xy(L, $, $),
                ee === "onBlur" && L !== "" && (t.min !== void 0 || t.max !== void 0)) {
                    const j = $n(+L, (J = t.min) != null ? J : -1 / 0, (de = t.max) != null ? de : 1 / 0);
                    +L !== j && (L = j.toString())
                }
            }
            let O = 0;
            if (t.formatter && ee === t.formatTrigger) {
                const {formatter: $, maxlength: j} = t;
                if (L = $(L),
                Lt(j) && To(L) > +j && (L = Ym(L, +j)),
                o.value && i.focused) {
                    const {selectionEnd: ae} = o.value
                      , ce = Ym(pe, ae);
                    O = To($(ce)) - To(ce)
                }
            }
            if (o.value && o.value.value !== L)
                if (i.focused) {
                    let {selectionStart: $, selectionEnd: j} = o.value;
                    if (o.value.value = L,
                    Lt($) && Lt(j)) {
                        const ae = To(L);
                        xe ? ($ -= xe,
                        j -= xe) : O && ($ += O,
                        j += O),
                        o.value.setSelectionRange(Math.min($, ae), Math.min(j, ae))
                    }
                } else
                    o.value.value = L;
            L !== t.modelValue && e("update:modelValue", L)
        }
          , b = L => {
            L.target.composing || x(L.target.value)
        }
          , w = () => {
            var L;
            return (L = o.value) == null ? void 0 : L.blur()
        }
          , E = () => {
            var L;
            return (L = o.value) == null ? void 0 : L.focus()
        }
          , S = () => {
            const L = o.value;
            t.type === "textarea" && t.autosize && L && TZ(L, t.autosize)
        }
          , P = L => {
            i.focused = !0,
            e("focus", L),
            Xe(S),
            u("readonly") && w()
        }
          , C = L => {
            i.focused = !1,
            x(c(), "onBlur"),
            e("blur", L),
            !u("readonly") && (m("onBlur"),
            Xe(S),
            k8())
        }
          , A = L => e("clickInput", L)
          , T = L => e("clickLeftIcon", L)
          , I = L => e("clickRightIcon", L)
          , B = L => {
            Bn(L),
            e("update:modelValue", ""),
            e("clear", L)
        }
          , G = re( () => {
            if (typeof t.error == "boolean")
                return t.error;
            if (l && l.props.showError && i.status === "failed")
                return !0
        }
        )
          , N = re( () => {
            const L = u("labelWidth")
              , ee = u("labelAlign");
            if (L && ee !== "top")
                return {
                    width: tt(L)
                }
        }
        )
          , U = L => {
            L.keyCode === 13 && (!(l && l.props.submitOnEnter) && t.type !== "textarea" && Bn(L),
            t.type === "search" && w()),
            e("keypress", L)
        }
          , W = () => t.id || `${r}-input`
          , K = () => i.status
          , fe = () => {
            const L = ri("control", [u("inputAlign"), {
                error: G.value,
                custom: !!n.input,
                "min-height": t.type === "textarea" && !t.autosize
            }]);
            if (n.input)
                return R("div", {
                    class: L,
                    onClick: A
                }, [n.input()]);
            const ee = {
                id: W(),
                ref: o,
                name: t.name,
                rows: t.rows !== void 0 ? +t.rows : void 0,
                class: L,
                disabled: u("disabled"),
                readonly: u("readonly"),
                autofocus: t.autofocus,
                placeholder: t.placeholder,
                autocomplete: t.autocomplete,
                autocapitalize: t.autocapitalize,
                autocorrect: t.autocorrect,
                enterkeyhint: t.enterkeyhint,
                spellcheck: t.spellcheck,
                "aria-labelledby": t.label ? `${r}-label` : void 0,
                "data-allow-mismatch": "attribute",
                onBlur: C,
                onFocus: P,
                onInput: b,
                onClick: A,
                onChange: cC,
                onKeypress: U,
                onCompositionend: cC,
                onCompositionstart: AZ
            };
            return t.type === "textarea" ? R("textarea", st(ee, {
                inputmode: t.inputmode
            }), null) : R("input", st(PZ(t.type, t.inputmode), ee), null)
        }
          , ue = () => {
            const L = n["left-icon"];
            if (t.leftIcon || L)
                return R("div", {
                    class: ri("left-icon"),
                    onClick: T
                }, [L ? L() : R(tn, {
                    name: t.leftIcon,
                    classPrefix: t.iconPrefix
                }, null)])
        }
          , X = () => {
            const L = n["right-icon"];
            if (t.rightIcon || L)
                return R("div", {
                    class: ri("right-icon"),
                    onClick: I
                }, [L ? L() : R(tn, {
                    name: t.rightIcon,
                    classPrefix: t.iconPrefix
                }, null)])
        }
          , ie = () => {
            if (t.showWordLimit && t.maxlength) {
                const L = To(c());
                return R("div", {
                    class: ri("word-limit")
                }, [R("span", {
                    class: ri("word-num")
                }, [L]), mg("/"), t.maxlength])
            }
        }
          , ge = () => {
            if (l && l.props.showErrorMessage === !1)
                return;
            const L = t.errorMessage || i.validateMessage;
            if (L) {
                const ee = n["error-message"]
                  , J = u("errorMessageAlign");
                return R("div", {
                    class: ri("error-message", J)
                }, [ee ? ee({
                    message: L
                }) : L])
            }
        }
          , F = () => {
            const L = u("labelWidth")
              , ee = u("labelAlign")
              , J = u("colon") ? ":" : "";
            if (n.label)
                return [n.label(), J];
            if (t.label)
                return R("label", {
                    id: `${r}-label`,
                    for: n.input ? void 0 : W(),
                    "data-allow-mismatch": "attribute",
                    onClick: de => {
                        Bn(de),
                        E()
                    }
                    ,
                    style: ee === "top" && L ? {
                        width: tt(L)
                    } : void 0
                }, [t.label + J])
        }
          , q = () => [R("div", {
            class: ri("body")
        }, [fe(), f.value && R(tn, {
            ref: s,
            name: t.clearIcon,
            class: ri("clear")
        }, null), X(), n.button && R("div", {
            class: ri("button")
        }, [n.button()])]), ie(), ge()];
        return Kt({
            blur: w,
            focus: E,
            validate: g,
            formValue: d,
            resetValidation: y,
            getValidationStatus: K
        }),
        hi(Rb, {
            customValue: a,
            resetValidation: y,
            validateWithTrigger: m
        }),
        ve( () => t.modelValue, () => {
            x(c()),
            y(),
            m("onChange"),
            Xe(S)
        }
        ),
        Ht( () => {
            x(c(), t.formatTrigger),
            Xe(S)
        }
        ),
        mr("touchstart", B, {
            target: re( () => {
                var L;
                return (L = s.value) == null ? void 0 : L.$el
            }
            )
        }),
        () => {
            const L = u("disabled")
              , ee = u("labelAlign")
              , J = ue()
              , de = () => {
                const pe = F();
                return ee === "top" ? [J, pe].filter(Boolean) : pe || []
            }
            ;
            return R(pM, {
                size: t.size,
                class: ri({
                    error: G.value,
                    disabled: L,
                    [`label-${ee}`]: ee
                }),
                center: t.center,
                border: t.border,
                isLink: t.isLink,
                clickable: t.clickable,
                titleStyle: N.value,
                valueClass: ri("value"),
                titleClass: [ri("label", [ee, {
                    required: h.value
                }]), t.labelClass],
                arrowDirection: t.arrowDirection
            }, {
                icon: J && ee !== "top" ? () => J : null,
                title: de,
                value: q,
                extra: n.extra
            })
        }
    }
});
const r3e = De(MZ);
let Bu = 0;
function DZ(t) {
    t ? (Bu || document.body.classList.add("van-toast--unclickable"),
    Bu++) : Bu && (Bu--,
    Bu || document.body.classList.remove("van-toast--unclickable"))
}
const [BZ,Xl] = Te("toast")
  , kZ = ["show", "overlay", "teleport", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay", "zIndex"]
  , NZ = {
    icon: String,
    show: Boolean,
    type: Me("text"),
    overlay: Boolean,
    message: Se,
    iconSize: Se,
    duration: Mg(2e3),
    position: Me("middle"),
    teleport: [String, Object],
    wordBreak: String,
    className: hn,
    iconPrefix: String,
    transition: Me("van-fade"),
    loadingType: String,
    forbidClick: Boolean,
    overlayClass: hn,
    overlayStyle: Object,
    closeOnClick: Boolean,
    closeOnClickOverlay: Boolean,
    zIndex: Se
};
var mM = we({
    name: BZ,
    props: NZ,
    emits: ["update:show"],
    setup(t, {emit: e, slots: n}) {
        let r, i = !1;
        const o = () => {
            const f = t.show && t.forbidClick;
            i !== f && (i = f,
            DZ(i))
        }
          , s = f => e("update:show", f)
          , a = () => {
            t.closeOnClick && s(!1)
        }
          , l = () => clearTimeout(r)
          , c = () => {
            const {icon: f, type: d, iconSize: h, iconPrefix: p, loadingType: y} = t;
            if (f || d === "success" || d === "fail")
                return R(tn, {
                    name: f || d,
                    size: h,
                    class: Xl("icon"),
                    classPrefix: p
                }, null);
            if (d === "loading")
                return R(ds, {
                    class: Xl("loading"),
                    size: h,
                    type: y
                }, null)
        }
          , u = () => {
            const {type: f, message: d} = t;
            if (n.message)
                return R("div", {
                    class: Xl("text")
                }, [n.message()]);
            if (Lt(d) && d !== "")
                return f === "html" ? R("div", {
                    key: 0,
                    class: Xl("text"),
                    innerHTML: String(d)
                }, null) : R("div", {
                    class: Xl("text")
                }, [d])
        }
        ;
        return ve( () => [t.show, t.forbidClick], o),
        ve( () => [t.show, t.type, t.message, t.duration], () => {
            l(),
            t.show && t.duration > 0 && (r = setTimeout( () => {
                s(!1)
            }
            , t.duration))
        }
        ),
        Ht(o),
        fs(o),
        () => R(Nl, st({
            class: [Xl([t.position, t.wordBreak === "normal" ? "break-normal" : t.wordBreak, {
                [t.type]: !t.icon
            }]), t.className],
            lockScroll: !1,
            onClick: a,
            onClosed: l,
            "onUpdate:show": s
        }, $t(t, kZ)), {
            default: () => [c(), u()]
        })
    }
});
function Ng() {
    const t = Mt({
        show: !1
    })
      , e = i => {
        t.show = i
    }
      , n = i => {
        We(t, i, {
            transitionAppear: !0
        }),
        e(!0)
    }
      , r = () => e(!1);
    return Kt({
        open: n,
        close: r,
        toggle: e
    }),
    {
        open: n,
        close: r,
        state: t,
        toggle: e
    }
}
function Fg(t) {
    const e = OO(t)
      , n = document.createElement("div");
    return document.body.appendChild(n),
    {
        instance: e.mount(n),
        unmount() {
            e.unmount(),
            document.body.removeChild(n)
        }
    }
}
const FZ = {
    icon: "",
    type: "text",
    message: "",
    className: "",
    overlay: !1,
    onClose: void 0,
    onOpened: void 0,
    duration: 2e3,
    teleport: "body",
    iconSize: void 0,
    iconPrefix: void 0,
    position: "middle",
    transition: "van-fade",
    forbidClick: !1,
    loadingType: void 0,
    overlayClass: "",
    overlayStyle: void 0,
    closeOnClick: !1,
    closeOnClickOverlay: !1
};
let ks = []
  , LZ = !1
  , Jy = We({}, FZ);
const vM = new Map;
function yM(t) {
    return go(t) ? t : {
        message: t
    }
}
function $Z() {
    const {instance: t, unmount: e} = Fg({
        setup() {
            const n = Z("")
              , {open: r, state: i, close: o, toggle: s} = Ng()
              , a = () => {}
              , l = () => R(mM, st(i, {
                onClosed: a,
                "onUpdate:show": s
            }), null);
            return ve(n, c => {
                i.message = c
            }
            ),
            yt().render = l,
            {
                open: r,
                close: o,
                message: n
            }
        }
    });
    return t
}
function UZ() {
    if (!ks.length || LZ) {
        const t = $Z();
        ks.push(t)
    }
    return ks[ks.length - 1]
}
function Qy(t={}) {
    if (!po)
        return {};
    const e = UZ()
      , n = yM(t);
    return e.open(We({}, Jy, vM.get(n.type || Jy.type), n)),
    e
}
const gw = t => e => Qy(We({
    type: t
}, yM(e)))
  , i3e = gw("loading")
  , o3e = gw("success")
  , s3e = gw("fail")
  , a3e = t => {
    ks.length && (t ? (ks.forEach(e => {
        e.close()
    }
    ),
    ks = []) : ks[0].close())
}
;
function l3e(t, e) {
    typeof t == "string" ? vM.set(t, e) : We(Jy, t)
}
const c3e = De(mM)
  , [GZ,Xm] = Te("switch")
  , HZ = {
    size: Se,
    loading: Boolean,
    disabled: Boolean,
    modelValue: hn,
    activeColor: String,
    inactiveColor: String,
    activeValue: {
        type: hn,
        default: !0
    },
    inactiveValue: {
        type: hn,
        default: !1
    }
};
var VZ = we({
    name: GZ,
    props: HZ,
    emits: ["change", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const r = () => t.modelValue === t.activeValue
          , i = () => {
            if (!t.disabled && !t.loading) {
                const s = r() ? t.inactiveValue : t.activeValue;
                e("update:modelValue", s),
                e("change", s)
            }
        }
          , o = () => {
            if (t.loading) {
                const s = r() ? t.activeColor : t.inactiveColor;
                return R(ds, {
                    class: Xm("loading"),
                    color: s
                }, null)
            }
            if (n.node)
                return n.node()
        }
        ;
        return Dl( () => t.modelValue),
        () => {
            var s;
            const {size: a, loading: l, disabled: c, activeColor: u, inactiveColor: f} = t
              , d = r()
              , h = {
                fontSize: tt(a),
                backgroundColor: d ? u : f
            };
            return R("div", {
                role: "switch",
                class: Xm({
                    on: d,
                    loading: l,
                    disabled: c
                }),
                style: h,
                tabindex: c ? void 0 : 0,
                "aria-checked": d,
                onClick: i
            }, [R("div", {
                class: Xm("node")
            }, [o()]), (s = n.background) == null ? void 0 : s.call(n)])
        }
    }
});
const u3e = De(VZ)
  , [_M,zZ] = Te("radio-group")
  , jZ = {
    shape: String,
    disabled: Boolean,
    iconSize: Se,
    direction: String,
    modelValue: hn,
    checkedColor: String
}
  , xM = Symbol(_M);
var WZ = we({
    name: _M,
    props: jZ,
    emits: ["change", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const {linkChildren: r} = Ui(xM)
          , i = o => e("update:modelValue", o);
        return ve( () => t.modelValue, o => e("change", o)),
        r({
            props: t,
            updateValue: i
        }),
        Dl( () => t.modelValue),
        () => {
            var o;
            return R("div", {
                class: zZ([t.direction]),
                role: "radiogroup"
            }, [(o = n.default) == null ? void 0 : o.call(n)])
        }
    }
});
const f3e = De(WZ)
  , [YZ,d3e] = Te("checkbox-group")
  , XZ = Symbol(YZ)
  , mw = {
    name: hn,
    disabled: Boolean,
    iconSize: Se,
    modelValue: hn,
    checkedColor: String,
    labelPosition: String,
    labelDisabled: Boolean
};
var bM = we({
    props: We({}, mw, {
        bem: ur(Function),
        role: String,
        shape: String,
        parent: Object,
        checked: Boolean,
        bindGroup: _e,
        indeterminate: {
            type: Boolean,
            default: null
        }
    }),
    emits: ["click", "toggle"],
    setup(t, {emit: e, slots: n}) {
        const r = Z()
          , i = d => {
            if (t.parent && t.bindGroup)
                return t.parent.props[d]
        }
          , o = re( () => {
            if (t.parent && t.bindGroup) {
                const d = i("disabled") || t.disabled;
                if (t.role === "checkbox") {
                    const h = i("modelValue").length
                      , p = i("max")
                      , y = p && h >= +p;
                    return d || y && !t.checked
                }
                return d
            }
            return t.disabled
        }
        )
          , s = re( () => i("direction"))
          , a = re( () => {
            const d = t.checkedColor || i("checkedColor");
            if (d && (t.checked || t.indeterminate) && !o.value)
                return {
                    borderColor: d,
                    backgroundColor: d
                }
        }
        )
          , l = re( () => t.shape || i("shape") || "round")
          , c = d => {
            const {target: h} = d
              , p = r.value
              , y = p === h || (p == null ? void 0 : p.contains(h));
            !o.value && (y || !t.labelDisabled) && e("toggle"),
            e("click", d)
        }
          , u = () => {
            var d, h;
            const {bem: p, checked: y, indeterminate: v} = t
              , g = t.iconSize || i("iconSize");
            return R("div", {
                ref: r,
                class: p("icon", [l.value, {
                    disabled: o.value,
                    checked: y,
                    indeterminate: v
                }]),
                style: l.value !== "dot" ? {
                    fontSize: tt(g)
                } : {
                    width: tt(g),
                    height: tt(g),
                    borderColor: (d = a.value) == null ? void 0 : d.borderColor
                }
            }, [n.icon ? n.icon({
                checked: y,
                disabled: o.value
            }) : l.value !== "dot" ? R(tn, {
                name: v ? "minus" : "success",
                style: a.value
            }, null) : R("div", {
                class: p("icon--dot__icon"),
                style: {
                    backgroundColor: (h = a.value) == null ? void 0 : h.backgroundColor
                }
            }, null)])
        }
          , f = () => {
            const {checked: d} = t;
            if (n.default)
                return R("span", {
                    class: t.bem("label", [t.labelPosition, {
                        disabled: o.value
                    }])
                }, [n.default({
                    checked: d,
                    disabled: o.value
                })])
        }
        ;
        return () => {
            const d = t.labelPosition === "left" ? [f(), u()] : [u(), f()];
            return R("div", {
                role: t.role,
                class: t.bem([{
                    disabled: o.value,
                    "label-disabled": t.labelDisabled
                }, s.value]),
                tabindex: o.value ? void 0 : 0,
                "aria-checked": t.checked,
                onClick: c
            }, [d])
        }
    }
});
const KZ = We({}, mw, {
    shape: String
})
  , [qZ,ZZ] = Te("radio");
var JZ = we({
    name: qZ,
    props: KZ,
    emits: ["update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const {parent: r} = Zr(xM)
          , i = () => (r ? r.props.modelValue : t.modelValue) === t.name
          , o = () => {
            r ? r.updateValue(t.name) : e("update:modelValue", t.name)
        }
        ;
        return () => R(bM, st({
            bem: ZZ,
            role: "radio",
            parent: r,
            checked: i(),
            onToggle: o
        }, t), $t(n, ["default", "icon"]))
    }
});
const h3e = De(JZ)
  , [QZ,eJ] = Te("checkbox")
  , tJ = We({}, mw, {
    shape: String,
    bindGroup: _e,
    indeterminate: {
        type: Boolean,
        default: null
    }
});
var nJ = we({
    name: QZ,
    props: tJ,
    emits: ["change", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const {parent: r} = Zr(XZ)
          , i = a => {
            const {name: l} = t
              , {max: c, modelValue: u} = r.props
              , f = u.slice();
            if (a)
                !(c && f.length >= +c) && !f.includes(l) && (f.push(l),
                t.bindGroup && r.updateValue(f));
            else {
                const d = f.indexOf(l);
                d !== -1 && (f.splice(d, 1),
                t.bindGroup && r.updateValue(f))
            }
        }
          , o = re( () => r && t.bindGroup ? r.props.modelValue.indexOf(t.name) !== -1 : !!t.modelValue)
          , s = (a=!o.value) => {
            r && t.bindGroup ? i(a) : e("update:modelValue", a),
            t.indeterminate !== null && e("change", a)
        }
        ;
        return ve( () => t.modelValue, a => {
            t.indeterminate === null && e("change", a)
        }
        ),
        Kt({
            toggle: s,
            props: t,
            checked: o
        }),
        Dl( () => t.modelValue),
        () => R(bM, st({
            bem: eJ,
            role: "checkbox",
            parent: r,
            checked: o.value,
            onToggle: s
        }, t), $t(n, ["default", "icon"]))
    }
});
const p3e = De(nJ)
  , [rJ,Qt,Yo] = Te("calendar")
  , iJ = t => Yo("monthTitle", t.getFullYear(), t.getMonth() + 1);
function Ga(t, e) {
    const n = t.getFullYear()
      , r = e.getFullYear();
    if (n === r) {
        const i = t.getMonth()
          , o = e.getMonth();
        return i === o ? 0 : i > o ? 1 : -1
    }
    return n > r ? 1 : -1
}
function xr(t, e) {
    const n = Ga(t, e);
    if (n === 0) {
        const r = t.getDate()
          , i = e.getDate();
        return r === i ? 0 : r > i ? 1 : -1
    }
    return n
}
const Gc = t => new Date(t)
  , uC = t => Array.isArray(t) ? t.map(Gc) : Gc(t);
function vw(t, e) {
    const n = Gc(t);
    return n.setDate(n.getDate() + e),
    n
}
function yw(t, e) {
    const n = Gc(t);
    return n.setMonth(n.getMonth() + e),
    n.getDate() !== t.getDate() && n.setDate(0),
    n
}
function wM(t, e) {
    const n = Gc(t);
    return n.setFullYear(n.getFullYear() + e),
    n.getDate() !== t.getDate() && n.setDate(0),
    n
}
const e_ = t => vw(t, -1)
  , t_ = t => vw(t, 1)
  , fC = t => yw(t, -1)
  , dC = t => yw(t, 1)
  , hC = t => wM(t, -1)
  , pC = t => wM(t, 1)
  , Dh = () => {
    const t = new Date;
    return t.setHours(0, 0, 0, 0),
    t
}
;
function oJ(t) {
    const e = t[0].getTime();
    return (t[1].getTime() - e) / (1e3 * 60 * 60 * 24) + 1
}
function sJ(t, e=0) {
    const n = new Date(t.getFullYear(),t.getMonth() + 1,0)
      , r = e + t.getDate() - 1
      , i = e + n.getDate() - 1;
    return Math.floor(r / 7) === Math.floor(i / 7)
}
const aJ = We({}, pw, {
    modelValue: ns(),
    filter: Function,
    formatter: {
        type: Function,
        default: (t, e) => e
    }
})
  , lJ = Object.keys(pw);
function cJ(t, e) {
    if (t < 0)
        return [];
    const n = Array(t);
    let r = -1;
    for (; ++r < t; )
        n[r] = e(r);
    return n
}
const EM = (t, e) => 32 - new Date(t,e - 1,32).getDate()
  , Km = (t, e, n, r, i, o) => {
    const s = cJ(e - t + 1, a => {
        const l = Fa(t + a);
        return r(n, {
            text: l,
            value: l
        })
    }
    );
    return i ? i(n, s, o) : s
}
  , uJ = (t, e) => t.map( (n, r) => {
    const i = e[r];
    if (i.length) {
        const o = +i[0].value
          , s = +i[i.length - 1].value;
        return Fa($n(+n, o, s))
    }
    return n
}
)
  , [fJ] = Te("calendar-day");
var dJ = we({
    name: fJ,
    props: {
        item: ur(Object),
        color: String,
        index: Number,
        offset: Mg(0),
        rowHeight: String
    },
    emits: ["click", "clickDisabledDate"],
    setup(t, {emit: e, slots: n}) {
        const r = re( () => {
            const {item: c, index: u, color: f, offset: d, rowHeight: h} = t
              , p = {
                height: h
            };
            if (c.type === "placeholder")
                return p.width = "100%",
                p;
            if (u === 0 && (p.marginLeft = `${100 * d / 7}%`),
            f)
                switch (c.type) {
                case "end":
                case "start":
                case "start-end":
                case "multiple-middle":
                case "multiple-selected":
                    p.background = f;
                    break;
                case "middle":
                    p.color = f;
                    break
                }
            return c.date && sJ(c.date, d) && (p.marginBottom = 0),
            p
        }
        )
          , i = () => {
            t.item.type !== "disabled" ? e("click", t.item) : e("clickDisabledDate", t.item)
        }
          , o = () => {
            const {topInfo: c} = t.item;
            if (c || n["top-info"])
                return R("div", {
                    class: Qt("top-info")
                }, [n["top-info"] ? n["top-info"](t.item) : c])
        }
          , s = () => {
            const {bottomInfo: c} = t.item;
            if (c || n["bottom-info"])
                return R("div", {
                    class: Qt("bottom-info")
                }, [n["bottom-info"] ? n["bottom-info"](t.item) : c])
        }
          , a = () => n.text ? n.text(t.item) : t.item.text
          , l = () => {
            const {item: c, color: u, rowHeight: f} = t
              , {type: d} = c
              , h = [o(), a(), s()];
            return d === "selected" ? R("div", {
                class: Qt("selected-day"),
                style: {
                    width: f,
                    height: f,
                    background: u
                }
            }, [h]) : h
        }
        ;
        return () => {
            const {type: c, className: u} = t.item;
            return c === "placeholder" ? R("div", {
                class: Qt("day"),
                style: r.value
            }, null) : R("div", {
                role: "gridcell",
                style: r.value,
                class: [Qt("day", c), u],
                tabindex: c === "disabled" ? void 0 : -1,
                onClick: i
            }, [l()])
        }
    }
});
const [hJ] = Te("calendar-month")
  , pJ = {
    date: ur(Date),
    type: String,
    color: String,
    minDate: Date,
    maxDate: Date,
    showMark: Boolean,
    rowHeight: Se,
    formatter: Function,
    lazyRender: Boolean,
    currentDate: [Date, Array],
    allowSameDay: Boolean,
    showSubtitle: Boolean,
    showMonthTitle: Boolean,
    firstDayOfWeek: Number
};
var gJ = we({
    name: hJ,
    props: pJ,
    emits: ["click", "clickDisabledDate"],
    setup(t, {emit: e, slots: n}) {
        const [r,i] = qO()
          , o = Z()
          , s = Z()
          , a = W8(s)
          , l = re( () => iJ(t.date))
          , c = re( () => tt(t.rowHeight))
          , u = re( () => {
            const C = t.date.getDate()
              , T = (t.date.getDay() - C % 7 + 8) % 7;
            return t.firstDayOfWeek ? (T + 7 - t.firstDayOfWeek) % 7 : T
        }
        )
          , f = re( () => EM(t.date.getFullYear(), t.date.getMonth() + 1))
          , d = re( () => r.value || !t.lazyRender)
          , h = () => l.value
          , p = C => {
            const A = T => t.currentDate.some(I => xr(I, T) === 0);
            if (A(C)) {
                const T = e_(C)
                  , I = t_(C)
                  , B = A(T)
                  , G = A(I);
                return B && G ? "multiple-middle" : B ? "end" : G ? "start" : "multiple-selected"
            }
            return ""
        }
          , y = C => {
            const [A,T] = t.currentDate;
            if (!A)
                return "";
            const I = xr(C, A);
            if (!T)
                return I === 0 ? "start" : "";
            const B = xr(C, T);
            return t.allowSameDay && I === 0 && B === 0 ? "start-end" : I === 0 ? "start" : B === 0 ? "end" : I > 0 && B < 0 ? "middle" : ""
        }
          , v = C => {
            const {type: A, minDate: T, maxDate: I, currentDate: B} = t;
            if (T && xr(C, T) < 0 || I && xr(C, I) > 0)
                return "disabled";
            if (B === null)
                return "";
            if (Array.isArray(B)) {
                if (A === "multiple")
                    return p(C);
                if (A === "range")
                    return y(C)
            } else if (A === "single")
                return xr(C, B) === 0 ? "selected" : "";
            return ""
        }
          , g = C => {
            if (t.type === "range") {
                if (C === "start" || C === "end")
                    return Yo(C);
                if (C === "start-end")
                    return `${Yo("start")}/${Yo("end")}`
            }
        }
          , m = () => {
            if (t.showMonthTitle)
                return R("div", {
                    class: Qt("month-title")
                }, [n["month-title"] ? n["month-title"]({
                    date: t.date,
                    text: l.value
                }) : l.value])
        }
          , _ = () => {
            if (t.showMark && d.value)
                return R("div", {
                    class: Qt("month-mark")
                }, [t.date.getMonth() + 1])
        }
          , x = re( () => {
            const C = Math.ceil((f.value + u.value) / 7);
            return Array(C).fill({
                type: "placeholder"
            })
        }
        )
          , b = re( () => {
            const C = []
              , A = t.date.getFullYear()
              , T = t.date.getMonth();
            for (let I = 1; I <= f.value; I++) {
                const B = new Date(A,T,I)
                  , G = v(B);
                let N = {
                    date: B,
                    type: G,
                    text: I,
                    bottomInfo: g(G)
                };
                t.formatter && (N = t.formatter(N)),
                C.push(N)
            }
            return C
        }
        )
          , w = re( () => b.value.filter(C => C.type === "disabled"))
          , E = (C, A) => {
            if (o.value) {
                const T = wn(o.value)
                  , I = x.value.length
                  , G = (Math.ceil((A.getDate() + u.value) / 7) - 1) * T.height / I;
                f0(C, T.top + G + C.scrollTop - wn(C).top)
            }
        }
          , S = (C, A) => R(dJ, {
            item: C,
            index: A,
            color: t.color,
            offset: u.value,
            rowHeight: c.value,
            onClick: T => e("click", T),
            onClickDisabledDate: T => e("clickDisabledDate", T)
        }, $t(n, ["top-info", "bottom-info", "text"]))
          , P = () => R("div", {
            ref: o,
            role: "grid",
            class: Qt("days")
        }, [_(), (d.value ? b : x).value.map(S)]);
        return Kt({
            getTitle: h,
            getHeight: () => a.value,
            setVisible: i,
            scrollToDate: E,
            disabledDays: w
        }),
        () => R("div", {
            class: Qt("month"),
            ref: s
        }, [m(), P()])
    }
});
const [mJ] = Te("calendar-header");
var vJ = we({
    name: mJ,
    props: {
        date: Date,
        minDate: Date,
        maxDate: Date,
        title: String,
        subtitle: String,
        showTitle: Boolean,
        showSubtitle: Boolean,
        firstDayOfWeek: Number,
        switchMode: Me("none")
    },
    emits: ["clickSubtitle", "panelChange"],
    setup(t, {slots: e, emit: n}) {
        const r = re( () => t.date && t.minDate && Ga(fC(t.date), t.minDate) < 0)
          , i = re( () => t.date && t.minDate && Ga(hC(t.date), t.minDate) < 0)
          , o = re( () => t.date && t.maxDate && Ga(dC(t.date), t.maxDate) > 0)
          , s = re( () => t.date && t.maxDate && Ga(pC(t.date), t.maxDate) > 0)
          , a = () => {
            if (t.showTitle) {
                const h = t.title || Yo("title")
                  , p = e.title ? e.title() : h;
                return R("div", {
                    class: Qt("header-title")
                }, [p])
            }
        }
          , l = h => n("clickSubtitle", h)
          , c = h => n("panelChange", h)
          , u = h => {
            const p = t.switchMode === "year-month"
              , y = e[h ? "next-month" : "prev-month"]
              , v = e[h ? "next-year" : "prev-year"]
              , g = h ? o.value : r.value
              , m = h ? s.value : i.value
              , _ = h ? "arrow" : "arrow-left"
              , x = h ? "arrow-double-right" : "arrow-double-left"
              , b = () => c((h ? dC : fC)(t.date))
              , w = () => c((h ? pC : hC)(t.date))
              , E = R("view", {
                class: Qt("header-action", {
                    disabled: g
                }),
                onClick: g ? void 0 : b
            }, [y ? y({
                disabled: g
            }) : R(tn, {
                class: {
                    [rs]: !g
                },
                name: _
            }, null)])
              , S = p && R("view", {
                class: Qt("header-action", {
                    disabled: m
                }),
                onClick: m ? void 0 : w
            }, [v ? v({
                disabled: m
            }) : R(tn, {
                class: {
                    [rs]: !m
                },
                name: x
            }, null)]);
            return h ? [E, S] : [S, E]
        }
          , f = () => {
            if (t.showSubtitle) {
                const h = e.subtitle ? e.subtitle({
                    date: t.date,
                    text: t.subtitle
                }) : t.subtitle
                  , p = t.switchMode !== "none";
                return R("div", {
                    class: Qt("header-subtitle", {
                        "with-switch": p
                    }),
                    onClick: l
                }, [p ? [u(), R("div", {
                    class: Qt("header-subtitle-text")
                }, [h]), u(!0)] : h])
            }
        }
          , d = () => {
            const {firstDayOfWeek: h} = t
              , p = Yo("weekdays")
              , y = [...p.slice(h, 7), ...p.slice(0, h)];
            return R("div", {
                class: Qt("weekdays")
            }, [y.map(v => R("span", {
                class: Qt("weekday")
            }, [v]))])
        }
        ;
        return () => R("div", {
            class: Qt("header")
        }, [a(), f(), d()])
    }
});
const yJ = {
    show: Boolean,
    type: Me("single"),
    switchMode: Me("none"),
    title: String,
    color: String,
    round: _e,
    readonly: Boolean,
    poppable: _e,
    maxRange: ze(null),
    position: Me("bottom"),
    teleport: [String, Object],
    showMark: _e,
    showTitle: _e,
    formatter: Function,
    rowHeight: Se,
    confirmText: String,
    rangePrompt: String,
    lazyRender: _e,
    showConfirm: _e,
    defaultDate: [Date, Array],
    allowSameDay: Boolean,
    showSubtitle: _e,
    closeOnPopstate: _e,
    showRangePrompt: _e,
    confirmDisabledText: String,
    closeOnClickOverlay: _e,
    safeAreaInsetTop: Boolean,
    safeAreaInsetBottom: _e,
    minDate: {
        type: Date,
        validator: Qf
    },
    maxDate: {
        type: Date,
        validator: Qf
    },
    firstDayOfWeek: {
        type: Se,
        default: 0,
        validator: t => t >= 0 && t <= 6
    }
};
var _J = we({
    name: rJ,
    props: yJ,
    emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate", "clickOverlay", "panelChange"],
    setup(t, {emit: e, slots: n}) {
        const r = re( () => t.switchMode !== "none")
          , i = re( () => !t.minDate && !r.value ? Dh() : t.minDate)
          , o = re( () => !t.maxDate && !r.value ? yw(Dh(), 6) : t.maxDate)
          , s = (X, ie=i.value, ge=o.value) => ie && xr(X, ie) === -1 ? ie : ge && xr(X, ge) === 1 ? ge : X
          , a = (X=t.defaultDate) => {
            const {type: ie, allowSameDay: ge} = t;
            if (X === null)
                return X;
            const F = Dh();
            if (ie === "range") {
                Array.isArray(X) || (X = []),
                X.length === 1 && xr(X[0], F) === 1 && (X = []);
                const q = i.value
                  , L = o.value
                  , ee = s(X[0] || F, q, L ? ge ? L : e_(L) : void 0)
                  , J = s(X[1] || (ge ? F : t_(F)), q ? ge ? q : t_(q) : void 0);
                return [ee, J]
            }
            return ie === "multiple" ? Array.isArray(X) ? X.map(q => s(q)) : [s(F)] : ((!X || Array.isArray(X)) && (X = F),
            s(X))
        }
          , l = () => {
            const X = Array.isArray(f.value) ? f.value[0] : f.value;
            return X || s(Dh())
        }
        ;
        let c;
        const u = Z()
          , f = Z(a())
          , d = Z(l())
          , h = Z()
          , [p,y] = iM()
          , v = re( () => t.firstDayOfWeek ? +t.firstDayOfWeek % 7 : 0)
          , g = re( () => {
            const X = [];
            if (!i.value || !o.value)
                return X;
            const ie = new Date(i.value);
            ie.setDate(1);
            do
                X.push(new Date(ie)),
                ie.setMonth(ie.getMonth() + 1);
            while (Ga(ie, o.value) !== 1);
            return X
        }
        )
          , m = re( () => {
            if (f.value) {
                if (t.type === "range")
                    return !f.value[0] || !f.value[1];
                if (t.type === "multiple")
                    return !f.value.length
            }
            return !f.value
        }
        )
          , _ = () => f.value
          , x = () => {
            const X = zd(u.value)
              , ie = X + c
              , ge = g.value.map( (J, de) => p.value[de].getHeight())
              , F = ge.reduce( (J, de) => J + de, 0);
            if (ie > F && X > 0)
                return;
            let q = 0, L;
            const ee = [-1, -1];
            for (let J = 0; J < g.value.length; J++) {
                const de = p.value[J];
                q <= ie && q + ge[J] >= X && (ee[1] = J,
                L || (L = de,
                ee[0] = J),
                p.value[J].showed || (p.value[J].showed = !0,
                e("monthShow", {
                    date: de.date,
                    title: de.getTitle()
                }))),
                q += ge[J]
            }
            g.value.forEach( (J, de) => {
                const pe = de >= ee[0] - 1 && de <= ee[1] + 1;
                p.value[de].setVisible(pe)
            }
            ),
            L && (h.value = L)
        }
          , b = X => {
            r.value ? d.value = X : hr( () => {
                g.value.some( (ie, ge) => Ga(ie, X) === 0 ? (u.value && p.value[ge].scrollToDate(u.value, X),
                !0) : !1),
                x()
            }
            )
        }
          , w = () => {
            if (!(t.poppable && !t.show))
                if (f.value) {
                    const X = t.type === "single" ? f.value : f.value[0];
                    Qf(X) && b(X)
                } else
                    r.value || hr(x)
        }
          , E = () => {
            t.poppable && !t.show || (r.value || hr( () => {
                c = Math.floor(wn(u).height)
            }
            ),
            w())
        }
          , S = (X=a()) => {
            f.value = X,
            w()
        }
          , P = X => {
            const {maxRange: ie, rangePrompt: ge, showRangePrompt: F} = t;
            return ie && oJ(X) > +ie ? (F && Qy(ge || Yo("rangePrompt", ie)),
            e("overRange"),
            !1) : !0
        }
          , C = X => {
            d.value = X,
            e("panelChange", {
                date: X
            })
        }
          , A = () => {
            var X;
            return e("confirm", (X = f.value) != null ? X : uC(f.value))
        }
          , T = (X, ie) => {
            const ge = F => {
                f.value = F,
                e("select", uC(F))
            }
            ;
            if (ie && t.type === "range" && !P(X)) {
                ge([X[0], vw(X[0], +t.maxRange - 1)]);
                return
            }
            ge(X),
            ie && !t.showConfirm && A()
        }
          , I = (X, ie, ge) => {
            var F;
            return (F = X.find(q => xr(ie, q.date) === -1 && xr(q.date, ge) === -1)) == null ? void 0 : F.date
        }
          , B = re( () => p.value.reduce( (X, ie) => {
            var ge, F;
            return X.push(...(F = (ge = ie.disabledDays) == null ? void 0 : ge.value) != null ? F : []),
            X
        }
        , []))
          , G = X => {
            if (t.readonly || !X.date)
                return;
            const {date: ie} = X
              , {type: ge} = t;
            if (ge === "range") {
                if (!f.value) {
                    T([ie]);
                    return
                }
                const [F,q] = f.value;
                if (F && !q) {
                    const L = xr(ie, F);
                    if (L === 1) {
                        const ee = I(B.value, F, ie);
                        if (ee) {
                            const J = e_(ee);
                            xr(F, J) === -1 ? T([F, J]) : T([ie])
                        } else
                            T([F, ie], !0)
                    } else
                        L === -1 ? T([ie]) : t.allowSameDay && T([ie, ie], !0)
                } else
                    T([ie])
            } else if (ge === "multiple") {
                if (!f.value) {
                    T([ie]);
                    return
                }
                const F = f.value
                  , q = F.findIndex(L => xr(L, ie) === 0);
                if (q !== -1) {
                    const [L] = F.splice(q, 1);
                    e("unselect", Gc(L))
                } else
                    t.maxRange && F.length >= +t.maxRange ? Qy(t.rangePrompt || Yo("rangePrompt", t.maxRange)) : T([...F, ie])
            } else
                T(ie, !0)
        }
          , N = X => e("clickOverlay", X)
          , U = X => e("update:show", X)
          , W = (X, ie) => {
            const ge = ie !== 0 || !t.showSubtitle;
            return R(gJ, st({
                ref: r.value ? h : y(ie),
                date: X,
                currentDate: f.value,
                showMonthTitle: ge,
                firstDayOfWeek: v.value,
                lazyRender: r.value ? !1 : t.lazyRender,
                maxDate: o.value,
                minDate: i.value
            }, $t(t, ["type", "color", "showMark", "formatter", "rowHeight", "showSubtitle", "allowSameDay"]), {
                onClick: G,
                onClickDisabledDate: F => e("clickDisabledDate", F)
            }), $t(n, ["top-info", "bottom-info", "month-title", "text"]))
        }
          , K = () => {
            if (n.footer)
                return n.footer();
            if (t.showConfirm) {
                const X = n["confirm-text"]
                  , ie = m.value
                  , ge = ie ? t.confirmDisabledText : t.confirmText;
                return R(d0, {
                    round: !0,
                    block: !0,
                    type: "primary",
                    color: t.color,
                    class: Qt("confirm"),
                    disabled: ie,
                    nativeType: "button",
                    onClick: A
                }, {
                    default: () => [X ? X({
                        disabled: ie
                    }) : ge || Yo("confirm")]
                })
            }
        }
          , fe = () => R("div", {
            class: [Qt("footer"), {
                "van-safe-area-bottom": t.safeAreaInsetBottom
            }]
        }, [K()])
          , ue = () => {
            var X, ie;
            return R("div", {
                class: Qt()
            }, [R(vJ, {
                date: (X = h.value) == null ? void 0 : X.date,
                maxDate: o.value,
                minDate: i.value,
                title: t.title,
                subtitle: (ie = h.value) == null ? void 0 : ie.getTitle(),
                showTitle: t.showTitle,
                showSubtitle: t.showSubtitle,
                switchMode: t.switchMode,
                firstDayOfWeek: v.value,
                onClickSubtitle: ge => e("clickSubtitle", ge),
                onPanelChange: C
            }, $t(n, ["title", "subtitle", "prev-month", "prev-year", "next-month", "next-year"])), R("div", {
                ref: u,
                class: Qt("body"),
                onScroll: r.value ? void 0 : x
            }, [r.value ? W(d.value, 0) : g.value.map(W)]), fe()])
        }
        ;
        return ve( () => t.show, E),
        ve( () => [t.type, t.minDate, t.maxDate, t.switchMode], () => S(a(f.value))),
        ve( () => t.defaultDate, X => {
            S(X)
        }
        ),
        Kt({
            reset: S,
            scrollToDate: b,
            getSelectedDate: _
        }),
        pu(E),
        () => t.poppable ? R(Nl, {
            show: t.show,
            class: Qt("popup"),
            round: t.round,
            position: t.position,
            closeable: t.showTitle || t.showSubtitle,
            teleport: t.teleport,
            closeOnPopstate: t.closeOnPopstate,
            safeAreaInsetTop: t.safeAreaInsetTop,
            closeOnClickOverlay: t.closeOnClickOverlay,
            onClickOverlay: N,
            "onUpdate:show": U
        }, {
            default: ue
        }) : ue()
    }
});
const g3e = De(_J)
  , [xJ,Kl] = Te("image")
  , bJ = {
    src: String,
    alt: String,
    fit: String,
    position: String,
    round: Boolean,
    block: Boolean,
    width: Se,
    height: Se,
    radius: Se,
    lazyLoad: Boolean,
    iconSize: Se,
    showError: _e,
    errorIcon: Me("photo-fail"),
    iconPrefix: String,
    showLoading: _e,
    loadingIcon: Me("photo"),
    crossorigin: String,
    referrerpolicy: String,
    decoding: String
};
var wJ = we({
    name: xJ,
    props: bJ,
    emits: ["load", "error"],
    setup(t, {emit: e, slots: n}) {
        const r = Z(!1)
          , i = Z(!0)
          , o = Z()
          , {$Lazyload: s} = yt().proxy
          , a = re( () => {
            const v = {
                width: tt(t.width),
                height: tt(t.height)
            };
            return Lt(t.radius) && (v.overflow = "hidden",
            v.borderRadius = tt(t.radius)),
            v
        }
        );
        ve( () => t.src, () => {
            r.value = !1,
            i.value = !0
        }
        );
        const l = v => {
            i.value && (i.value = !1,
            e("load", v))
        }
          , c = () => {
            const v = new Event("load");
            Object.defineProperty(v, "target", {
                value: o.value,
                enumerable: !0
            }),
            l(v)
        }
          , u = v => {
            r.value = !0,
            i.value = !1,
            e("error", v)
        }
          , f = (v, g, m) => m ? m() : R(tn, {
            name: v,
            size: t.iconSize,
            class: g,
            classPrefix: t.iconPrefix
        }, null)
          , d = () => {
            if (i.value && t.showLoading)
                return R("div", {
                    class: Kl("loading")
                }, [f(t.loadingIcon, Kl("loading-icon"), n.loading)]);
            if (r.value && t.showError)
                return R("div", {
                    class: Kl("error")
                }, [f(t.errorIcon, Kl("error-icon"), n.error)])
        }
          , h = () => {
            if (r.value || !t.src)
                return;
            const v = {
                alt: t.alt,
                class: Kl("img"),
                decoding: t.decoding,
                style: {
                    objectFit: t.fit,
                    objectPosition: t.position
                },
                crossorigin: t.crossorigin,
                referrerpolicy: t.referrerpolicy
            };
            return t.lazyLoad ? di(R("img", st({
                ref: o
            }, v), null), [[D4("lazy"), t.src]]) : R("img", st({
                ref: o,
                src: t.src,
                onLoad: l,
                onError: u
            }, v), null)
        }
          , p = ({el: v}) => {
            const g = () => {
                v === o.value && i.value && c()
            }
            ;
            o.value ? g() : Xe(g)
        }
          , y = ({el: v}) => {
            v === o.value && !r.value && u()
        }
        ;
        return s && po && (s.$on("loaded", p),
        s.$on("error", y),
        qr( () => {
            s.$off("loaded", p),
            s.$off("error", y)
        }
        )),
        Ht( () => {
            Xe( () => {
                var v;
                (v = o.value) != null && v.complete && !t.lazyLoad && c()
            }
            )
        }
        ),
        () => {
            var v;
            return R("div", {
                class: Kl({
                    round: t.round,
                    block: t.block
                }),
                style: a.value
            }, [h(), d(), (v = n.default) == null ? void 0 : v.call(n)])
        }
    }
});
const SM = De(wJ)
  , [EJ,Bh] = Te("circle");
let SJ = 0;
const gC = t => Math.min(Math.max(+t, 0), 100);
function CJ(t, e) {
    const n = t ? 1 : 0;
    return `M ${e / 2} ${e / 2} m 0, -500 a 500, 500 0 1, ${n} 0, 1000 a 500, 500 0 1, ${n} 0, -1000`
}
const AJ = {
    text: String,
    size: Se,
    fill: Me("none"),
    rate: ze(100),
    speed: ze(0),
    color: [String, Object],
    clockwise: _e,
    layerColor: String,
    currentRate: Mg(0),
    strokeWidth: ze(40),
    strokeLinecap: String,
    startPosition: Me("top")
};
var TJ = we({
    name: EJ,
    props: AJ,
    emits: ["update:currentRate"],
    setup(t, {emit: e, slots: n}) {
        const r = `van-circle-${SJ++}`
          , i = re( () => +t.strokeWidth + 1e3)
          , o = re( () => CJ(t.clockwise, i.value))
          , s = re( () => {
            const d = {
                top: 0,
                right: 90,
                bottom: 180,
                left: 270
            }[t.startPosition];
            if (d)
                return {
                    transform: `rotate(${d}deg)`
                }
        }
        );
        ve( () => t.rate, f => {
            let d;
            const h = Date.now()
              , p = t.currentRate
              , y = gC(f)
              , v = Math.abs((p - y) * 1e3 / +t.speed)
              , g = () => {
                const m = Date.now()
                  , x = Math.min((m - h) / v, 1) * (y - p) + p;
                e("update:currentRate", gC(parseFloat(x.toFixed(1)))),
                (y > p ? x < y : x > y) && (d = hr(g))
            }
            ;
            t.speed ? (d && Hd(d),
            d = hr(g)) : e("update:currentRate", y)
        }
        , {
            immediate: !0
        });
        const a = () => {
            const {strokeWidth: d, currentRate: h, strokeLinecap: p} = t
              , y = 3140 * h / 100
              , v = go(t.color) ? `url(#${r})` : t.color
              , g = {
                stroke: v,
                strokeWidth: `${+d + 1}px`,
                strokeLinecap: p,
                strokeDasharray: `${y}px 3140px`
            };
            return R("path", {
                d: o.value,
                style: g,
                class: Bh("hover"),
                stroke: v
            }, null)
        }
          , l = () => {
            const f = {
                fill: t.fill,
                stroke: t.layerColor,
                strokeWidth: `${t.strokeWidth}px`
            };
            return R("path", {
                class: Bh("layer"),
                style: f,
                d: o.value
            }, null)
        }
          , c = () => {
            const {color: f} = t;
            if (!go(f))
                return;
            const d = Object.keys(f).sort( (h, p) => parseFloat(h) - parseFloat(p)).map( (h, p) => R("stop", {
                key: p,
                offset: h,
                "stop-color": f[h]
            }, null));
            return R("defs", null, [R("linearGradient", {
                id: r,
                x1: "100%",
                y1: "0%",
                x2: "0%",
                y2: "0%"
            }, [d])])
        }
          , u = () => {
            if (n.default)
                return n.default();
            if (t.text)
                return R("div", {
                    class: Bh("text")
                }, [t.text])
        }
        ;
        return () => R("div", {
            class: Bh(),
            style: Bl(t.size)
        }, [R("svg", {
            viewBox: `0 0 ${i.value} ${i.value}`,
            style: s.value
        }, [c(), l(), a()]), u()])
    }
});
const m3e = De(TJ)
  , [CM,PJ] = Te("row")
  , AM = Symbol(CM)
  , IJ = {
    tag: Me("div"),
    wrap: _e,
    align: String,
    gutter: {
        type: [String, Number, Array],
        default: 0
    },
    justify: String
};
var OJ = we({
    name: CM,
    props: IJ,
    setup(t, {slots: e}) {
        const {children: n, linkChildren: r} = Ui(AM)
          , i = re( () => {
            const a = [[]];
            let l = 0;
            return n.forEach( (c, u) => {
                l += Number(c.span),
                l > 24 ? (a.push([u]),
                l -= 24) : a[a.length - 1].push(u)
            }
            ),
            a
        }
        )
          , o = re( () => {
            let a = 0;
            Array.isArray(t.gutter) ? a = Number(t.gutter[0]) || 0 : a = Number(t.gutter);
            const l = [];
            return a && i.value.forEach(c => {
                const u = a * (c.length - 1) / c.length;
                c.forEach( (f, d) => {
                    if (d === 0)
                        l.push({
                            right: u
                        });
                    else {
                        const h = a - l[f - 1].right
                          , p = u - h;
                        l.push({
                            left: h,
                            right: p
                        })
                    }
                }
                )
            }
            ),
            l
        }
        )
          , s = re( () => {
            const {gutter: a} = t
              , l = [];
            if (Array.isArray(a) && a.length > 1) {
                const c = Number(a[1]) || 0;
                if (c <= 0)
                    return l;
                i.value.forEach( (u, f) => {
                    f !== i.value.length - 1 && u.forEach( () => {
                        l.push({
                            bottom: c
                        })
                    }
                    )
                }
                )
            }
            return l
        }
        );
        return r({
            spaces: o,
            verticalSpaces: s
        }),
        () => {
            const {tag: a, wrap: l, align: c, justify: u} = t;
            return R(a, {
                class: PJ({
                    [`align-${c}`]: c,
                    [`justify-${u}`]: u,
                    nowrap: !l
                })
            }, {
                default: () => {
                    var f;
                    return [(f = e.default) == null ? void 0 : f.call(e)]
                }
            })
        }
    }
});
const [RJ,MJ] = Te("col")
  , DJ = {
    tag: Me("div"),
    span: ze(0),
    offset: Se
};
var BJ = we({
    name: RJ,
    props: DJ,
    setup(t, {slots: e}) {
        const {parent: n, index: r} = Zr(AM)
          , i = re( () => {
            if (!n)
                return;
            const {spaces: o, verticalSpaces: s} = n;
            let a = {};
            if (o && o.value && o.value[r.value]) {
                const {left: c, right: u} = o.value[r.value];
                a = {
                    paddingLeft: c ? `${c}px` : null,
                    paddingRight: u ? `${u}px` : null
                }
            }
            const {bottom: l} = s.value[r.value] || {};
            return We(a, {
                marginBottom: l ? `${l}px` : null
            })
        }
        );
        return () => {
            const {tag: o, span: s, offset: a} = t;
            return R(o, {
                style: i.value,
                class: MJ({
                    [s]: s,
                    [`offset-${a}`]: a
                })
            }, {
                default: () => {
                    var l;
                    return [(l = e.default) == null ? void 0 : l.call(e)]
                }
            })
        }
    }
});
const v3e = De(BJ)
  , [TM,kJ] = Te("collapse")
  , PM = Symbol(TM)
  , NJ = {
    border: _e,
    accordion: Boolean,
    modelValue: {
        type: [String, Number, Array],
        default: ""
    }
};
function FJ(t, e) {
    return e && Array.isArray(t) ? (console.error('[Vant] Collapse: "v-model" should not be Array in accordion mode'),
    !1) : !e && !Array.isArray(t) ? (console.error('[Vant] Collapse: "v-model" should be Array in non-accordion mode'),
    !1) : !0
}
var LJ = we({
    name: TM,
    props: NJ,
    emits: ["change", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const {linkChildren: r, children: i} = Ui(PM)
          , o = c => {
            e("change", c),
            e("update:modelValue", c)
        }
          , s = (c, u) => {
            const {accordion: f, modelValue: d} = t;
            o(f ? c === d ? "" : c : u ? d.concat(c) : d.filter(h => h !== c))
        }
          , a = (c={}) => {
            if (t.accordion)
                return;
            typeof c == "boolean" && (c = {
                expanded: c
            });
            const {expanded: u, skipDisabled: f} = c
              , h = i.filter(p => p.disabled && f ? p.expanded.value : u ?? !p.expanded.value).map(p => p.itemName.value);
            o(h)
        }
          , l = c => {
            const {accordion: u, modelValue: f} = t;
            return FJ(f, u) ? u ? f === c : f.includes(c) : !1
        }
        ;
        return Kt({
            toggleAll: a
        }),
        r({
            toggle: s,
            isExpanded: l
        }),
        () => {
            var c;
            return R("div", {
                class: [kJ(), {
                    [H8]: t.border
                }]
            }, [(c = n.default) == null ? void 0 : c.call(n)])
        }
    }
});
const y3e = De(LJ)
  , [$J,kh] = Te("collapse-item")
  , UJ = ["icon", "title", "value", "label", "right-icon"]
  , GJ = We({}, kg, {
    name: Se,
    isLink: _e,
    disabled: Boolean,
    readonly: Boolean,
    lazyRender: _e
});
var HJ = we({
    name: $J,
    props: GJ,
    setup(t, {slots: e}) {
        const n = Z()
          , r = Z()
          , {parent: i, index: o} = Zr(PM);
        if (!i) {
            console.error("[Vant] <CollapseItem> must be a child component of <Collapse>.");
            return
        }
        const s = re( () => {
            var y;
            return (y = t.name) != null ? y : o.value
        }
        )
          , a = re( () => i.isExpanded(s.value))
          , l = Z(a.value)
          , c = dw( () => l.value || !t.lazyRender)
          , u = () => {
            a.value ? n.value && (n.value.style.height = "") : l.value = !1
        }
        ;
        ve(a, (y, v) => {
            if (v === null)
                return;
            y && (l.value = !0),
            (y ? Xe : hr)( () => {
                if (!r.value || !n.value)
                    return;
                const {offsetHeight: m} = r.value;
                if (m) {
                    const _ = `${m}px`;
                    n.value.style.height = y ? "0" : _,
                    Ua( () => {
                        n.value && (n.value.style.height = y ? _ : "0")
                    }
                    )
                } else
                    u()
            }
            )
        }
        );
        const f = (y=!a.value) => {
            i.toggle(s.value, y)
        }
          , d = () => {
            !t.disabled && !t.readonly && f()
        }
          , h = () => {
            const {border: y, disabled: v, readonly: g} = t
              , m = $t(t, Object.keys(kg));
            return g && (m.isLink = !1),
            (v || g) && (m.clickable = !1),
            R(pM, st({
                role: "button",
                class: kh("title", {
                    disabled: v,
                    expanded: a.value,
                    borderless: !y
                }),
                "aria-expanded": String(a.value),
                onClick: d
            }, m), $t(e, UJ))
        }
          , p = c( () => {
            var y;
            return di(R("div", {
                ref: n,
                class: kh("wrapper"),
                onTransitionend: u
            }, [R("div", {
                ref: r,
                class: kh("content")
            }, [(y = e.default) == null ? void 0 : y.call(e)])]), [[pi, l.value]])
        }
        );
        return Kt({
            toggle: f,
            expanded: a,
            itemName: s
        }),
        () => R("div", {
            class: [kh({
                border: o.value && t.border
            })]
        }, [h(), p()])
    }
});
const _3e = De(HJ);
function VJ(t, e) {
    const {days: n} = e;
    let {hours: r, minutes: i, seconds: o, milliseconds: s} = e;
    if (t.includes("DD") ? t = t.replace("DD", Fa(n)) : r += n * 24,
    t.includes("HH") ? t = t.replace("HH", Fa(r)) : i += r * 60,
    t.includes("mm") ? t = t.replace("mm", Fa(i)) : o += i * 60,
    t.includes("ss") ? t = t.replace("ss", Fa(o)) : s += o * 1e3,
    t.includes("S")) {
        const a = Fa(s, 3);
        t.includes("SSS") ? t = t.replace("SSS", a) : t.includes("SS") ? t = t.replace("SS", a.slice(0, 2)) : t = t.replace("S", a.charAt(0))
    }
    return t
}
const [zJ,jJ] = Te("count-down")
  , WJ = {
    time: ze(0),
    format: Me("HH:mm:ss"),
    autoStart: _e,
    millisecond: Boolean
};
var YJ = we({
    name: zJ,
    props: WJ,
    emits: ["change", "finish"],
    setup(t, {emit: e, slots: n}) {
        const {start: r, pause: i, reset: o, current: s} = QO({
            time: +t.time,
            millisecond: t.millisecond,
            onChange: c => e("change", c),
            onFinish: () => e("finish")
        })
          , a = re( () => VJ(t.format, s.value))
          , l = () => {
            o(+t.time),
            t.autoStart && r()
        }
        ;
        return ve( () => t.time, l, {
            immediate: !0
        }),
        Kt({
            start: r,
            pause: i,
            reset: l
        }),
        () => R("div", {
            role: "timer",
            class: jJ()
        }, [n.default ? n.default(s.value) : a.value])
    }
});
const x3e = De(YJ)
  , mC = new Date().getFullYear()
  , [XJ] = Te("date-picker")
  , KJ = We({}, aJ, {
    columnsType: {
        type: Array,
        default: () => ["year", "month", "day"]
    },
    minDate: {
        type: Date,
        default: () => new Date(mC - 10,0,1),
        validator: Qf
    },
    maxDate: {
        type: Date,
        default: () => new Date(mC + 10,11,31),
        validator: Qf
    }
});
var qJ = we({
    name: XJ,
    props: KJ,
    emits: ["confirm", "cancel", "change", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const r = Z(t.modelValue)
          , i = Z(!1)
          , o = Z()
          , s = re( () => i.value ? t.modelValue : r.value)
          , a = b => b === t.minDate.getFullYear()
          , l = b => b === t.maxDate.getFullYear()
          , c = b => b === t.minDate.getMonth() + 1
          , u = b => b === t.maxDate.getMonth() + 1
          , f = b => {
            const {minDate: w, columnsType: E} = t
              , S = E.indexOf(b)
              , P = s.value[S];
            if (P)
                return +P;
            switch (b) {
            case "year":
                return w.getFullYear();
            case "month":
                return w.getMonth() + 1;
            case "day":
                return w.getDate()
            }
        }
          , d = () => {
            const b = t.minDate.getFullYear()
              , w = t.maxDate.getFullYear();
            return Km(b, w, "year", t.formatter, t.filter, s.value)
        }
          , h = () => {
            const b = f("year")
              , w = a(b) ? t.minDate.getMonth() + 1 : 1
              , E = l(b) ? t.maxDate.getMonth() + 1 : 12;
            return Km(w, E, "month", t.formatter, t.filter, s.value)
        }
          , p = () => {
            const b = f("year")
              , w = f("month")
              , E = a(b) && c(w) ? t.minDate.getDate() : 1
              , S = l(b) && u(w) ? t.maxDate.getDate() : EM(b, w);
            return Km(E, S, "day", t.formatter, t.filter, s.value)
        }
          , y = () => {
            var b;
            return (b = o.value) == null ? void 0 : b.confirm()
        }
          , v = () => r.value
          , g = re( () => t.columnsType.map(b => {
            switch (b) {
            case "year":
                return d();
            case "month":
                return h();
            case "day":
                return p();
            default:
                throw new Error(`[Vant] DatePicker: unsupported columns type: ${b}`)
            }
        }
        ));
        ve(r, b => {
            Ws(b, t.modelValue) || e("update:modelValue", b)
        }
        ),
        ve( () => t.modelValue, (b, w) => {
            i.value = Ws(w, r.value),
            b = uJ(b, g.value),
            Ws(b, r.value) || (r.value = b),
            i.value = !1
        }
        , {
            immediate: !0
        });
        const m = (...b) => e("change", ...b)
          , _ = (...b) => e("cancel", ...b)
          , x = (...b) => e("confirm", ...b);
        return Kt({
            confirm: y,
            getSelectedDate: v
        }),
        () => R(mZ, st({
            ref: o,
            modelValue: r.value,
            "onUpdate:modelValue": b => r.value = b,
            columns: g.value,
            onChange: m,
            onCancel: _,
            onConfirm: x
        }, $t(t, lJ)), n)
    }
});
const b3e = De(qJ)
  , [ZJ,xi,Nh] = Te("dialog")
  , JJ = We({}, Wd, {
    title: String,
    theme: String,
    width: Se,
    message: [String, Function],
    callback: Function,
    allowHtml: Boolean,
    className: hn,
    transition: Me("van-dialog-bounce"),
    messageAlign: String,
    closeOnPopstate: _e,
    showCancelButton: Boolean,
    cancelButtonText: String,
    cancelButtonColor: String,
    cancelButtonDisabled: Boolean,
    confirmButtonText: String,
    confirmButtonColor: String,
    confirmButtonDisabled: Boolean,
    showConfirmButton: _e,
    closeOnClickOverlay: Boolean,
    keyboardEnabled: _e,
    destroyOnClose: Boolean
})
  , QJ = [...q8, "transition", "closeOnPopstate", "destroyOnClose"];
var IM = we({
    name: ZJ,
    props: JJ,
    emits: ["confirm", "cancel", "keydown", "update:show"],
    setup(t, {emit: e, slots: n}) {
        const r = Z()
          , i = Mt({
            confirm: !1,
            cancel: !1
        })
          , o = g => e("update:show", g)
          , s = g => {
            var m;
            o(!1),
            (m = t.callback) == null || m.call(t, g)
        }
          , a = g => () => {
            t.show && (e(g),
            t.beforeClose ? (i[g] = !0,
            gu(t.beforeClose, {
                args: [g],
                done() {
                    s(g),
                    i[g] = !1
                },
                canceled() {
                    i[g] = !1
                }
            })) : s(g))
        }
          , l = a("cancel")
          , c = a("confirm")
          , u = CO(g => {
            var m, _;
            if (!t.keyboardEnabled || g.target !== ((_ = (m = r.value) == null ? void 0 : m.popupRef) == null ? void 0 : _.value))
                return;
            ({
                Enter: t.showConfirmButton ? c : Yy,
                Escape: t.showCancelButton ? l : Yy
            })[g.key](),
            e("keydown", g)
        }
        , ["enter", "esc"])
          , f = () => {
            const g = n.title ? n.title() : t.title;
            if (g)
                return R("div", {
                    class: xi("header", {
                        isolated: !t.message && !n.default
                    })
                }, [g])
        }
          , d = g => {
            const {message: m, allowHtml: _, messageAlign: x} = t
              , b = xi("message", {
                "has-title": g,
                [x]: x
            })
              , w = $c(m) ? m() : m;
            return _ && typeof w == "string" ? R("div", {
                class: b,
                innerHTML: w
            }, null) : R("div", {
                class: b
            }, [w])
        }
          , h = () => {
            if (n.default)
                return R("div", {
                    class: xi("content")
                }, [n.default()]);
            const {title: g, message: m, allowHtml: _} = t;
            if (m) {
                const x = !!(g || n.title);
                return R("div", {
                    key: _ ? 1 : 0,
                    class: xi("content", {
                        isolated: !x
                    })
                }, [d(x)])
            }
        }
          , p = () => R("div", {
            class: [G8, xi("footer")]
        }, [t.showCancelButton && R(d0, {
            size: "large",
            text: t.cancelButtonText || Nh("cancel"),
            class: xi("cancel"),
            style: {
                color: t.cancelButtonColor
            },
            loading: i.cancel,
            disabled: t.cancelButtonDisabled,
            onClick: l
        }, null), t.showConfirmButton && R(d0, {
            size: "large",
            text: t.confirmButtonText || Nh("confirm"),
            class: [xi("confirm"), {
                [OK]: t.showCancelButton
            }],
            style: {
                color: t.confirmButtonColor
            },
            loading: i.confirm,
            disabled: t.confirmButtonDisabled,
            onClick: c
        }, null)])
          , y = () => R(FK, {
            class: xi("footer")
        }, {
            default: () => [t.showCancelButton && R(QS, {
                type: "warning",
                text: t.cancelButtonText || Nh("cancel"),
                class: xi("cancel"),
                color: t.cancelButtonColor,
                loading: i.cancel,
                disabled: t.cancelButtonDisabled,
                onClick: l
            }, null), t.showConfirmButton && R(QS, {
                type: "danger",
                text: t.confirmButtonText || Nh("confirm"),
                class: xi("confirm"),
                color: t.confirmButtonColor,
                loading: i.confirm,
                disabled: t.confirmButtonDisabled,
                onClick: c
            }, null)]
        })
          , v = () => n.footer ? n.footer() : t.theme === "round-button" ? y() : p();
        return () => {
            const {width: g, title: m, theme: _, message: x, className: b} = t;
            return R(Nl, st({
                ref: r,
                role: "dialog",
                class: [xi([_]), b],
                style: {
                    width: tt(g)
                },
                tabindex: 0,
                "aria-labelledby": m || x,
                onKeydown: u,
                "onUpdate:show": o
            }, $t(t, QJ)), {
                default: () => [f(), h(), v()]
            })
        }
    }
});
let n_;
const eQ = {
    title: "",
    width: "",
    theme: null,
    message: "",
    overlay: !0,
    callback: null,
    teleport: "body",
    className: "",
    allowHtml: !1,
    lockScroll: !0,
    transition: void 0,
    beforeClose: null,
    overlayClass: "",
    overlayStyle: void 0,
    messageAlign: "",
    cancelButtonText: "",
    cancelButtonColor: null,
    cancelButtonDisabled: !1,
    confirmButtonText: "",
    confirmButtonColor: null,
    confirmButtonDisabled: !1,
    showConfirmButton: !0,
    showCancelButton: !1,
    closeOnPopstate: !0,
    closeOnClickOverlay: !1,
    destroyOnClose: !1
};
let tQ = We({}, eQ);
function nQ() {
    ({instance: n_} = Fg({
        setup() {
            const {state: e, toggle: n} = Ng();
            return () => R(IM, st(e, {
                "onUpdate:show": n
            }), null)
        }
    }))
}
function rQ(t) {
    return po ? new Promise( (e, n) => {
        n_ || nQ(),
        n_.open(We({}, tQ, t, {
            callback: r => {
                (r === "confirm" ? e : n)(r)
            }
        }))
    }
    ) : Promise.resolve(void 0)
}
const w3e = t => rQ(We({
    showCancelButton: !0
}, t))
  , E3e = De(IM)
  , [iQ,oQ] = Te("divider")
  , sQ = {
    dashed: Boolean,
    hairline: _e,
    vertical: Boolean,
    contentPosition: Me("center")
};
var aQ = we({
    name: iQ,
    props: sQ,
    setup(t, {slots: e}) {
        return () => {
            var n;
            return R("div", {
                role: "separator",
                class: oQ({
                    dashed: t.dashed,
                    hairline: t.hairline,
                    vertical: t.vertical,
                    [`content-${t.contentPosition}`]: !!e.default && !t.vertical
                })
            }, [!t.vertical && ((n = e.default) == null ? void 0 : n.call(e))])
        }
    }
});
const S3e = De(aQ)
  , lQ = {
    gap: {
        type: [Number, Object],
        default: 24
    },
    icon: String,
    axis: Me("y"),
    magnetic: String,
    offset: Object,
    teleport: {
        type: [String, Object],
        default: "body"
    }
}
  , [cQ,vC] = Te("floating-bubble");
var uQ = we({
    name: cQ,
    inheritAttrs: !1,
    props: lQ,
    emits: ["click", "update:offset", "offsetChange"],
    setup(t, {slots: e, emit: n, attrs: r}) {
        const i = Z()
          , o = Z({
            x: 0,
            y: 0,
            width: 0,
            height: 0
        })
          , s = re( () => go(t.gap) ? t.gap.x : t.gap)
          , a = re( () => go(t.gap) ? t.gap.y : t.gap)
          , l = re( () => ({
            top: a.value,
            right: Wo.value - o.value.width - s.value,
            bottom: Ys.value - o.value.height - a.value,
            left: s.value
        }))
          , c = Z(!1);
        let u = !1;
        const f = re( () => {
            const b = {}
              , w = tt(o.value.x)
              , E = tt(o.value.y);
            return b.transform = `translate3d(${w}, ${E}, 0)`,
            (c.value || !u) && (b.transition = "none"),
            b
        }
        )
          , d = () => {
            if (!x.value)
                return;
            const {width: b, height: w} = wn(i.value)
              , {offset: E} = t;
            o.value = {
                x: E ? E.x : Wo.value - b - s.value,
                y: E ? E.y : Ys.value - w - a.value,
                width: b,
                height: w
            }
        }
          , h = kl();
        let p = 0
          , y = 0;
        const v = b => {
            h.start(b),
            c.value = !0,
            p = o.value.x,
            y = o.value.y
        }
        ;
        mr("touchmove", b => {
            if (b.preventDefault(),
            h.move(b),
            t.axis !== "lock" && !h.isTap.value) {
                if (t.axis === "x" || t.axis === "xy") {
                    let E = p + h.deltaX.value;
                    E < l.value.left && (E = l.value.left),
                    E > l.value.right && (E = l.value.right),
                    o.value.x = E
                }
                if (t.axis === "y" || t.axis === "xy") {
                    let E = y + h.deltaY.value;
                    E < l.value.top && (E = l.value.top),
                    E > l.value.bottom && (E = l.value.bottom),
                    o.value.y = E
                }
                const w = $t(o.value, ["x", "y"]);
                n("update:offset", w)
            }
        }
        , {
            target: i
        });
        const m = () => {
            c.value = !1,
            Xe( () => {
                if (t.magnetic === "x") {
                    const b = KS([l.value.left, l.value.right], o.value.x);
                    o.value.x = b
                }
                if (t.magnetic === "y") {
                    const b = KS([l.value.top, l.value.bottom], o.value.y);
                    o.value.y = b
                }
                if (!h.isTap.value) {
                    const b = $t(o.value, ["x", "y"]);
                    n("update:offset", b),
                    (p !== b.x || y !== b.y) && n("offsetChange", b)
                }
            }
            )
        }
          , _ = b => {
            h.isTap.value ? n("click", b) : b.stopPropagation()
        }
        ;
        Ht( () => {
            d(),
            Xe( () => {
                u = !0
            }
            )
        }
        ),
        ve([Wo, Ys, s, a, () => t.offset], d, {
            deep: !0
        });
        const x = Z(!0);
        return cs( () => {
            x.value = !0
        }
        ),
        bo( () => {
            t.teleport && (x.value = !1)
        }
        ),
        () => {
            const b = di(R("div", st({
                class: vC(),
                ref: i,
                onTouchstartPassive: v,
                onTouchend: m,
                onTouchcancel: m,
                onClickCapture: _,
                style: f.value
            }, r), [e.default ? e.default() : R(KK, {
                name: t.icon,
                class: vC("icon")
            }, null)]), [[pi, x.value]]);
            return t.teleport ? R(hg, {
                to: t.teleport
            }, {
                default: () => [b]
            }) : b
        }
    }
});
const C3e = De(uQ)
  , [OM,fQ] = Te("grid")
  , dQ = {
    square: Boolean,
    center: _e,
    border: _e,
    gutter: Se,
    reverse: Boolean,
    iconSize: Se,
    direction: String,
    clickable: Boolean,
    columnNum: ze(4)
}
  , RM = Symbol(OM);
var hQ = we({
    name: OM,
    props: dQ,
    setup(t, {slots: e}) {
        const {linkChildren: n} = Ui(RM);
        return n({
            props: t
        }),
        () => {
            var r;
            return R("div", {
                style: {
                    paddingLeft: tt(t.gutter)
                },
                class: [fQ(), {
                    [G8]: t.border && !t.gutter
                }]
            }, [(r = e.default) == null ? void 0 : r.call(e)])
        }
    }
});
const A3e = De(hQ)
  , [pQ,Fh] = Te("grid-item")
  , gQ = We({}, mu, {
    dot: Boolean,
    text: String,
    icon: String,
    badge: Se,
    iconColor: String,
    iconPrefix: String,
    badgeProps: Object
});
var mQ = we({
    name: pQ,
    props: gQ,
    setup(t, {slots: e}) {
        const {parent: n, index: r} = Zr(RM)
          , i = jd();
        if (!n) {
            console.error("[Vant] <GridItem> must be a child component of <Grid>.");
            return
        }
        const o = re( () => {
            const {square: u, gutter: f, columnNum: d} = n.props
              , h = `${100 / +d}%`
              , p = {
                flexBasis: h
            };
            if (u)
                p.paddingTop = h;
            else if (f) {
                const y = tt(f);
                p.paddingRight = y,
                r.value >= +d && (p.marginTop = y)
            }
            return p
        }
        )
          , s = re( () => {
            const {square: u, gutter: f} = n.props;
            if (u && f) {
                const d = tt(f);
                return {
                    right: d,
                    bottom: d,
                    height: "auto"
                }
            }
        }
        )
          , a = () => {
            if (e.icon)
                return R(Dg, st({
                    dot: t.dot,
                    content: t.badge
                }, t.badgeProps), {
                    default: e.icon
                });
            if (t.icon)
                return R(tn, {
                    dot: t.dot,
                    name: t.icon,
                    size: n.props.iconSize,
                    badge: t.badge,
                    class: Fh("icon"),
                    color: t.iconColor,
                    badgeProps: t.badgeProps,
                    classPrefix: t.iconPrefix
                }, null)
        }
          , l = () => {
            if (e.text)
                return e.text();
            if (t.text)
                return R("span", {
                    class: Fh("text")
                }, [t.text])
        }
          , c = () => e.default ? e.default() : [a(), l()];
        return () => {
            const {center: u, border: f, square: d, gutter: h, reverse: p, direction: y, clickable: v} = n.props
              , g = [Fh("content", [y, {
                center: u,
                square: d,
                reverse: p,
                clickable: v,
                surround: f && h
            }]), {
                [ua]: f
            }];
            return R("div", {
                class: [Fh({
                    square: d
                })],
                style: o.value
            }, [R("div", {
                role: v ? "button" : void 0,
                class: g,
                style: s.value,
                tabindex: v ? 0 : void 0,
                onClick: i
            }, [c()])])
        }
    }
});
const T3e = De(mQ)
  , yC = t => Math.sqrt((t[0].clientX - t[1].clientX) ** 2 + (t[0].clientY - t[1].clientY) ** 2)
  , vQ = t => ({
    x: (t[0].clientX + t[1].clientX) / 2,
    y: (t[0].clientY + t[1].clientY) / 2
})
  , qm = Te("image-preview")[1]
  , _C = 2.6
  , yQ = {
    src: String,
    show: Boolean,
    active: Number,
    minZoom: ur(Se),
    maxZoom: ur(Se),
    rootWidth: ur(Number),
    rootHeight: ur(Number),
    disableZoom: Boolean,
    doubleScale: Boolean,
    closeOnClickImage: Boolean,
    closeOnClickOverlay: Boolean,
    vertical: Boolean
};
var _Q = we({
    props: yQ,
    emits: ["scale", "close", "longPress"],
    setup(t, {emit: e, slots: n}) {
        const r = Mt({
            scale: 1,
            moveX: 0,
            moveY: 0,
            moving: !1,
            zooming: !1,
            initializing: !1,
            imageRatio: 0
        })
          , i = kl()
          , o = Z()
          , s = Z()
          , a = Z(!1)
          , l = Z(!1);
        let c = 0;
        const u = re( () => {
            const {scale: N, moveX: U, moveY: W, moving: K, zooming: fe, initializing: ue} = r
              , X = {
                transitionDuration: fe || K || ue ? "0s" : ".3s"
            };
            return (N !== 1 || l.value) && (X.transform = `matrix(${N}, 0, 0, ${N}, ${U}, ${W})`),
            X
        }
        )
          , f = re( () => {
            if (r.imageRatio) {
                const {rootWidth: N, rootHeight: U} = t
                  , W = a.value ? U / r.imageRatio : N;
                return Math.max(0, (r.scale * W - N) / 2)
            }
            return 0
        }
        )
          , d = re( () => {
            if (r.imageRatio) {
                const {rootWidth: N, rootHeight: U} = t
                  , W = a.value ? U : N * r.imageRatio;
                return Math.max(0, (r.scale * W - U) / 2)
            }
            return 0
        }
        )
          , h = (N, U) => {
            var W;
            if (N = $n(N, +t.minZoom, +t.maxZoom + 1),
            N !== r.scale) {
                const K = N / r.scale;
                if (r.scale = N,
                U) {
                    const fe = wn((W = o.value) == null ? void 0 : W.$el)
                      , ue = {
                        x: fe.width * .5,
                        y: fe.height * .5
                    }
                      , X = r.moveX - (U.x - fe.left - ue.x) * (K - 1)
                      , ie = r.moveY - (U.y - fe.top - ue.y) * (K - 1);
                    r.moveX = $n(X, -f.value, f.value),
                    r.moveY = $n(ie, -d.value, d.value)
                } else
                    r.moveX = 0,
                    r.moveY = l.value ? c : 0;
                e("scale", {
                    scale: N,
                    index: t.active
                })
            }
        }
          , p = () => {
            h(1)
        }
          , y = () => {
            const N = r.scale > 1 ? 1 : 2;
            h(N, N === 2 || l.value ? {
                x: i.startX.value,
                y: i.startY.value
            } : void 0)
        }
        ;
        let v, g, m, _, x, b, w, E, S = !1;
        const P = N => {
            const {touches: U} = N;
            if (v = U.length,
            v === 2 && t.disableZoom)
                return;
            const {offsetX: W} = i;
            i.start(N),
            g = r.moveX,
            m = r.moveY,
            E = Date.now(),
            S = !1,
            r.moving = v === 1 && (r.scale !== 1 || l.value),
            r.zooming = v === 2 && !W.value,
            r.zooming && (_ = r.scale,
            x = yC(U))
        }
          , C = N => {
            const {touches: U} = N;
            if (i.move(N),
            r.moving) {
                const {deltaX: W, deltaY: K} = i
                  , fe = W.value + g
                  , ue = K.value + m;
                if ((t.vertical ? i.isVertical() && Math.abs(ue) > d.value : i.isHorizontal() && Math.abs(fe) > f.value) && !S) {
                    r.moving = !1;
                    return
                }
                S = !0,
                Bn(N, !0),
                r.moveX = $n(fe, -f.value, f.value),
                r.moveY = $n(ue, -d.value, d.value)
            }
            if (r.zooming && (Bn(N, !0),
            U.length === 2)) {
                const W = yC(U)
                  , K = _ * W / x;
                b = vQ(U),
                h(K, b)
            }
        }
          , A = N => {
            var U;
            const W = (U = s.value) == null ? void 0 : U.$el;
            if (!W)
                return;
            const K = W.firstElementChild
              , fe = N.target === W
              , ue = K == null ? void 0 : K.contains(N.target);
            !t.closeOnClickImage && ue || !t.closeOnClickOverlay && fe || e("close")
        }
          , T = N => {
            if (v > 1)
                return;
            const U = Date.now() - E
              , W = 250;
            i.isTap.value && (U < W ? t.doubleScale ? w ? (clearTimeout(w),
            w = null,
            y()) : w = setTimeout( () => {
                A(N),
                w = null
            }
            , W) : A(N) : U > z8 && e("longPress"))
        }
          , I = N => {
            let U = !1;
            if ((r.moving || r.zooming) && (U = !0,
            r.moving && g === r.moveX && m === r.moveY && (U = !1),
            !N.touches.length)) {
                r.zooming && (r.moveX = $n(r.moveX, -f.value, f.value),
                r.moveY = $n(r.moveY, -d.value, d.value),
                r.zooming = !1),
                r.moving = !1,
                g = 0,
                m = 0,
                _ = 1,
                r.scale < 1 && p();
                const W = +t.maxZoom;
                r.scale > W && h(W, b)
            }
            Bn(N, U),
            T(N),
            i.reset()
        }
          , B = () => {
            const {rootWidth: N, rootHeight: U} = t
              , W = U / N
              , {imageRatio: K} = r;
            a.value = r.imageRatio > W && K < _C,
            l.value = r.imageRatio > W && K >= _C,
            l.value && (c = (K * N - U) / 2,
            r.moveY = c,
            r.initializing = !0,
            hr( () => {
                r.initializing = !1
            }
            )),
            p()
        }
          , G = N => {
            const {naturalWidth: U, naturalHeight: W} = N.target;
            r.imageRatio = W / U,
            B()
        }
        ;
        return ve( () => t.active, p),
        ve( () => t.show, N => {
            N || p()
        }
        ),
        ve( () => [t.rootWidth, t.rootHeight], B),
        mr("touchmove", C, {
            target: re( () => {
                var N;
                return (N = s.value) == null ? void 0 : N.$el
            }
            )
        }),
        Kt({
            resetScale: p
        }),
        () => {
            const N = {
                loading: () => R(ds, {
                    type: "spinner"
                }, null)
            };
            return R(hM, {
                ref: s,
                class: qm("swipe-item"),
                onTouchstartPassive: P,
                onTouchend: I,
                onTouchcancel: I
            }, {
                default: () => [n.image ? R("div", {
                    class: qm("image-wrap")
                }, [n.image({
                    src: t.src,
                    onLoad: G,
                    style: u.value
                })]) : R(SM, {
                    ref: o,
                    src: t.src,
                    fit: "contain",
                    class: qm("image", {
                        vertical: a.value
                    }),
                    style: u.value,
                    onLoad: G
                }, N)]
            })
        }
    }
});
const [xQ,ql] = Te("image-preview")
  , bQ = ["show", "teleport", "transition", "overlayStyle", "closeOnPopstate"]
  , wQ = {
    show: Boolean,
    loop: _e,
    images: ns(),
    minZoom: ze(1 / 3),
    maxZoom: ze(3),
    overlay: _e,
    vertical: Boolean,
    closeable: Boolean,
    showIndex: _e,
    className: hn,
    closeIcon: Me("clear"),
    transition: String,
    beforeClose: Function,
    doubleScale: _e,
    overlayClass: hn,
    overlayStyle: Object,
    swipeDuration: ze(300),
    startPosition: ze(0),
    showIndicators: Boolean,
    closeOnPopstate: _e,
    closeOnClickImage: _e,
    closeOnClickOverlay: _e,
    closeIconPosition: Me("top-right"),
    teleport: [String, Object]
};
var MM = we({
    name: xQ,
    props: wQ,
    emits: ["scale", "close", "closed", "change", "longPress", "update:show"],
    setup(t, {emit: e, slots: n}) {
        const r = Z()
          , i = Z()
          , o = Mt({
            active: 0,
            rootWidth: 0,
            rootHeight: 0,
            disableZoom: !1
        })
          , s = () => {
            if (r.value) {
                const _ = wn(r.value.$el);
                o.rootWidth = _.width,
                o.rootHeight = _.height,
                r.value.resize()
            }
        }
          , a = _ => e("scale", _)
          , l = _ => e("update:show", _)
          , c = () => {
            gu(t.beforeClose, {
                args: [o.active],
                done: () => l(!1)
            })
        }
          , u = _ => {
            _ !== o.active && (o.active = _,
            e("change", _))
        }
          , f = () => {
            if (t.showIndex)
                return R("div", {
                    class: ql("index")
                }, [n.index ? n.index({
                    index: o.active
                }) : `${o.active + 1} / ${t.images.length}`])
        }
          , d = () => {
            if (n.cover)
                return R("div", {
                    class: ql("cover")
                }, [n.cover()])
        }
          , h = () => {
            o.disableZoom = !0
        }
          , p = () => {
            o.disableZoom = !1
        }
          , y = () => R(lM, {
            ref: r,
            lazyRender: !0,
            loop: t.loop,
            class: ql("swipe"),
            vertical: t.vertical,
            duration: t.swipeDuration,
            initialSwipe: t.startPosition,
            showIndicators: t.showIndicators,
            indicatorColor: "white",
            onChange: u,
            onDragEnd: p,
            onDragStart: h
        }, {
            default: () => [t.images.map( (_, x) => R(_Q, {
                ref: b => {
                    x === o.active && (i.value = b)
                }
                ,
                src: _,
                show: t.show,
                active: o.active,
                maxZoom: t.maxZoom,
                minZoom: t.minZoom,
                rootWidth: o.rootWidth,
                rootHeight: o.rootHeight,
                disableZoom: o.disableZoom,
                doubleScale: t.doubleScale,
                closeOnClickImage: t.closeOnClickImage,
                closeOnClickOverlay: t.closeOnClickOverlay,
                vertical: t.vertical,
                onScale: a,
                onClose: c,
                onLongPress: () => e("longPress", {
                    index: x
                })
            }, {
                image: n.image
            }))]
        })
          , v = () => {
            if (t.closeable)
                return R(tn, {
                    role: "button",
                    name: t.closeIcon,
                    class: [ql("close-icon", t.closeIconPosition), rs],
                    onClick: c
                }, null)
        }
          , g = () => e("closed")
          , m = (_, x) => {
            var b;
            return (b = r.value) == null ? void 0 : b.swipeTo(_, x)
        }
        ;
        return Kt({
            resetScale: () => {
                var _;
                (_ = i.value) == null || _.resetScale()
            }
            ,
            swipeTo: m
        }),
        Ht(s),
        ve([Wo, Ys], s),
        ve( () => t.startPosition, _ => u(+_)),
        ve( () => t.show, _ => {
            const {images: x, startPosition: b} = t;
            _ ? (u(+b),
            Xe( () => {
                s(),
                m(+b, {
                    immediate: !0
                })
            }
            )) : e("close", {
                index: o.active,
                url: x[o.active]
            })
        }
        ),
        () => R(Nl, st({
            class: [ql(), t.className],
            overlayClass: [ql("overlay"), t.overlayClass],
            onClosed: g,
            "onUpdate:show": l
        }, $t(t, bQ)), {
            default: () => [v(), y(), f(), d()]
        })
    }
});
let Mp;
const EQ = {
    loop: !0,
    images: [],
    maxZoom: 3,
    minZoom: 1 / 3,
    onScale: void 0,
    onClose: void 0,
    onChange: void 0,
    vertical: !1,
    teleport: "body",
    className: "",
    showIndex: !0,
    closeable: !1,
    closeIcon: "clear",
    transition: void 0,
    beforeClose: void 0,
    doubleScale: !0,
    overlayStyle: void 0,
    overlayClass: void 0,
    startPosition: 0,
    swipeDuration: 300,
    showIndicators: !1,
    closeOnPopstate: !0,
    closeOnClickOverlay: !0,
    closeIconPosition: "top-right"
};
function SQ() {
    ({instance: Mp} = Fg({
        setup() {
            const {state: t, toggle: e} = Ng()
              , n = () => {
                t.images = []
            }
            ;
            return () => R(MM, st(t, {
                onClosed: n,
                "onUpdate:show": e
            }), null)
        }
    }))
}
const CQ = (t, e=0) => {
    if (po)
        return Mp || SQ(),
        t = Array.isArray(t) ? {
            images: t,
            startPosition: e
        } : t,
        Mp.open(We({}, EQ, t)),
        Mp
}
;
De(MM);
const [AQ,Zl,TQ] = Te("list")
  , PQ = {
    error: Boolean,
    offset: ze(300),
    loading: Boolean,
    disabled: Boolean,
    finished: Boolean,
    scroller: Object,
    errorText: String,
    direction: Me("down"),
    loadingText: String,
    finishedText: String,
    immediateCheck: _e
};
var IQ = we({
    name: AQ,
    props: PQ,
    emits: ["load", "update:error", "update:loading"],
    setup(t, {emit: e, slots: n}) {
        const r = Z(t.loading)
          , i = Z()
          , o = Z()
          , s = dM()
          , a = Vd(i)
          , l = re( () => t.scroller || a.value)
          , c = () => {
            Xe( () => {
                if (r.value || t.finished || t.disabled || t.error || (s == null ? void 0 : s.value) === !1)
                    return;
                const {direction: p} = t
                  , y = +t.offset
                  , v = wn(l);
                if (!v.height || Uc(i))
                    return;
                let g = !1;
                const m = wn(o);
                p === "up" ? g = v.top - m.top <= y : g = m.bottom - v.bottom <= y,
                g && (r.value = !0,
                e("update:loading", !0),
                e("load"))
            }
            )
        }
          , u = () => {
            if (t.finished) {
                const p = n.finished ? n.finished() : t.finishedText;
                if (p)
                    return R("div", {
                        class: Zl("finished-text")
                    }, [p])
            }
        }
          , f = () => {
            e("update:error", !1),
            c()
        }
          , d = () => {
            if (t.error) {
                const p = n.error ? n.error() : t.errorText;
                if (p)
                    return R("div", {
                        role: "button",
                        class: Zl("error-text"),
                        tabindex: 0,
                        onClick: f
                    }, [p])
            }
        }
          , h = () => {
            if (r.value && !t.finished && !t.disabled)
                return R("div", {
                    class: Zl("loading")
                }, [n.loading ? n.loading() : R(ds, {
                    class: Zl("loading-icon")
                }, {
                    default: () => [t.loadingText || TQ("loading")]
                })])
        }
        ;
        return ve( () => [t.loading, t.finished, t.error], c),
        s && ve(s, p => {
            p && c()
        }
        ),
        Rl( () => {
            r.value = t.loading
        }
        ),
        Ht( () => {
            t.immediateCheck && c()
        }
        ),
        Kt({
            check: c
        }),
        mr("scroll", c, {
            target: l,
            passive: !0
        }),
        () => {
            var p;
            const y = (p = n.default) == null ? void 0 : p.call(n)
              , v = R("div", {
                ref: o,
                class: Zl("placeholder")
            }, null);
            return R("div", {
                ref: i,
                role: "feed",
                class: Zl(),
                "aria-busy": r.value
            }, [t.direction === "down" ? y : v, h(), u(), d(), t.direction === "up" ? y : v])
        }
    }
});
const P3e = De(IQ)
  , [OQ,RQ] = Te("notify")
  , MQ = ["lockScroll", "position", "show", "teleport", "zIndex"]
  , DQ = We({}, Wd, {
    type: Me("danger"),
    color: String,
    message: Se,
    position: Me("top"),
    className: hn,
    background: String,
    lockScroll: Boolean
});
var DM = we({
    name: OQ,
    props: DQ,
    emits: ["update:show"],
    setup(t, {emit: e, slots: n}) {
        const r = i => e("update:show", i);
        return () => R(Nl, st({
            class: [RQ([t.type]), t.className],
            style: {
                color: t.color,
                background: t.background
            },
            overlay: !1,
            duration: .2,
            "onUpdate:show": r
        }, $t(t, MQ)), {
            default: () => [n.default ? n.default() : t.message]
        })
    }
});
let xC, Pc;
const BQ = t => go(t) ? t : {
    message: t
};
function kQ() {
    ({instance: Pc} = Fg({
        setup() {
            const {state: t, toggle: e} = Ng();
            return () => R(DM, st(t, {
                "onUpdate:show": e
            }), null)
        }
    }))
}
const NQ = () => ({
    type: "danger",
    color: void 0,
    message: "",
    onClose: void 0,
    onClick: void 0,
    onOpened: void 0,
    duration: 3e3,
    position: void 0,
    className: "",
    lockScroll: !1,
    background: void 0
});
let FQ = NQ();
const LQ = () => {
    Pc && Pc.toggle(!1)
}
;
function I3e(t) {
    if (po)
        return Pc || kQ(),
        t = We({}, FQ, BQ(t)),
        Pc.open(t),
        clearTimeout(xC),
        t.duration > 0 && (xC = setTimeout(LQ, t.duration)),
        Pc
}
De(DM);
const [$Q,Jl,bC] = Te("pagination")
  , Zm = (t, e, n) => ({
    number: t,
    text: e,
    active: n
})
  , UQ = {
    mode: Me("multi"),
    prevText: String,
    nextText: String,
    pageCount: ze(0),
    modelValue: Mg(0),
    totalItems: ze(0),
    showPageSize: ze(5),
    itemsPerPage: ze(10),
    forceEllipses: Boolean,
    showPrevButton: _e,
    showNextButton: _e
};
var GQ = we({
    name: $Q,
    props: UQ,
    emits: ["change", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const r = re( () => {
            const {pageCount: u, totalItems: f, itemsPerPage: d} = t
              , h = +u || Math.ceil(+f / +d);
            return Math.max(1, h)
        }
        )
          , i = re( () => {
            const u = []
              , f = r.value
              , d = +t.showPageSize
              , {modelValue: h, forceEllipses: p} = t;
            let y = 1
              , v = f;
            const g = d < f;
            g && (y = Math.max(h - Math.floor(d / 2), 1),
            v = y + d - 1,
            v > f && (v = f,
            y = v - d + 1));
            for (let m = y; m <= v; m++) {
                const _ = Zm(m, m, m === h);
                u.push(_)
            }
            if (g && d > 0 && p) {
                if (y > 1) {
                    const m = Zm(y - 1, "...");
                    u.unshift(m)
                }
                if (v < f) {
                    const m = Zm(v + 1, "...");
                    u.push(m)
                }
            }
            return u
        }
        )
          , o = (u, f) => {
            u = $n(u, 1, r.value),
            t.modelValue !== u && (e("update:modelValue", u),
            f && e("change", u))
        }
        ;
        fu( () => o(t.modelValue));
        const s = () => R("li", {
            class: Jl("page-desc")
        }, [n.pageDesc ? n.pageDesc() : `${t.modelValue}/${r.value}`])
          , a = () => {
            const {mode: u, modelValue: f, showPrevButton: d} = t;
            if (!d)
                return;
            const h = n["prev-text"]
              , p = f === 1;
            return R("li", {
                class: [Jl("item", {
                    disabled: p,
                    border: u === "simple",
                    prev: !0
                }), Op]
            }, [R("button", {
                type: "button",
                disabled: p,
                onClick: () => o(f - 1, !0)
            }, [h ? h() : t.prevText || bC("prev")])])
        }
          , l = () => {
            const {mode: u, modelValue: f, showNextButton: d} = t;
            if (!d)
                return;
            const h = n["next-text"]
              , p = f === r.value;
            return R("li", {
                class: [Jl("item", {
                    disabled: p,
                    border: u === "simple",
                    next: !0
                }), Op]
            }, [R("button", {
                type: "button",
                disabled: p,
                onClick: () => o(f + 1, !0)
            }, [h ? h() : t.nextText || bC("next")])])
        }
          , c = () => i.value.map(u => R("li", {
            class: [Jl("item", {
                active: u.active,
                page: !0
            }), Op]
        }, [R("button", {
            type: "button",
            "aria-current": u.active || void 0,
            onClick: () => o(u.number, !0)
        }, [n.page ? n.page(u) : u.text])]));
        return () => R("nav", {
            role: "navigation",
            class: Jl()
        }, [R("ul", {
            class: Jl("items")
        }, [a(), t.mode === "simple" ? s() : c(), l()])])
    }
});
const O3e = De(GQ);
function Gi(t) {
    if (t == null)
        return window;
    if (t.toString() !== "[object Window]") {
        var e = t.ownerDocument;
        return e && e.defaultView || window
    }
    return t
}
function _w(t) {
    var e = Gi(t).Element;
    return t instanceof e || t instanceof Element
}
function ki(t) {
    var e = Gi(t).HTMLElement;
    return t instanceof e || t instanceof HTMLElement
}
function BM(t) {
    if (typeof ShadowRoot > "u")
        return !1;
    var e = Gi(t).ShadowRoot;
    return t instanceof e || t instanceof ShadowRoot
}
var Hc = Math.round;
function r_() {
    var t = navigator.userAgentData;
    return t != null && t.brands ? t.brands.map(function(e) {
        return e.brand + "/" + e.version
    }).join(" ") : navigator.userAgent
}
function HQ() {
    return !/^((?!chrome|android).)*safari/i.test(r_())
}
function h0(t, e, n) {
    e === void 0 && (e = !1),
    n === void 0 && (n = !1);
    var r = t.getBoundingClientRect()
      , i = 1
      , o = 1;
    e && ki(t) && (i = t.offsetWidth > 0 && Hc(r.width) / t.offsetWidth || 1,
    o = t.offsetHeight > 0 && Hc(r.height) / t.offsetHeight || 1);
    var s = _w(t) ? Gi(t) : window
      , a = s.visualViewport
      , l = !HQ() && n
      , c = (r.left + (l && a ? a.offsetLeft : 0)) / i
      , u = (r.top + (l && a ? a.offsetTop : 0)) / o
      , f = r.width / i
      , d = r.height / o;
    return {
        width: f,
        height: d,
        top: u,
        right: c + f,
        bottom: u + d,
        left: c,
        x: c,
        y: u
    }
}
function kM(t) {
    var e = Gi(t)
      , n = e.pageXOffset
      , r = e.pageYOffset;
    return {
        scrollLeft: n,
        scrollTop: r
    }
}
function VQ(t) {
    return {
        scrollLeft: t.scrollLeft,
        scrollTop: t.scrollTop
    }
}
function zQ(t) {
    return t === Gi(t) || !ki(t) ? kM(t) : VQ(t)
}
function is(t) {
    return t ? (t.nodeName || "").toLowerCase() : null
}
function Lg(t) {
    return ((_w(t) ? t.ownerDocument : t.document) || window.document).documentElement
}
function jQ(t) {
    return h0(Lg(t)).left + kM(t).scrollLeft
}
function os(t) {
    return Gi(t).getComputedStyle(t)
}
function xw(t) {
    var e = os(t)
      , n = e.overflow
      , r = e.overflowX
      , i = e.overflowY;
    return /auto|scroll|overlay|hidden/.test(n + i + r)
}
function WQ(t) {
    var e = t.getBoundingClientRect()
      , n = Hc(e.width) / t.offsetWidth || 1
      , r = Hc(e.height) / t.offsetHeight || 1;
    return n !== 1 || r !== 1
}
function YQ(t, e, n) {
    n === void 0 && (n = !1);
    var r = ki(e)
      , i = ki(e) && WQ(e)
      , o = Lg(e)
      , s = h0(t, i, n)
      , a = {
        scrollLeft: 0,
        scrollTop: 0
    }
      , l = {
        x: 0,
        y: 0
    };
    return (r || !r && !n) && ((is(e) !== "body" || xw(o)) && (a = zQ(e)),
    ki(e) ? (l = h0(e, !0),
    l.x += e.clientLeft,
    l.y += e.clientTop) : o && (l.x = jQ(o))),
    {
        x: s.left + a.scrollLeft - l.x,
        y: s.top + a.scrollTop - l.y,
        width: s.width,
        height: s.height
    }
}
function XQ(t) {
    var e = h0(t)
      , n = t.offsetWidth
      , r = t.offsetHeight;
    return Math.abs(e.width - n) <= 1 && (n = e.width),
    Math.abs(e.height - r) <= 1 && (r = e.height),
    {
        x: t.offsetLeft,
        y: t.offsetTop,
        width: n,
        height: r
    }
}
function bw(t) {
    return is(t) === "html" ? t : t.assignedSlot || t.parentNode || (BM(t) ? t.host : null) || Lg(t)
}
function NM(t) {
    return ["html", "body", "#document"].indexOf(is(t)) >= 0 ? t.ownerDocument.body : ki(t) && xw(t) ? t : NM(bw(t))
}
function Dp(t, e) {
    var n;
    e === void 0 && (e = []);
    var r = NM(t)
      , i = r === ((n = t.ownerDocument) == null ? void 0 : n.body)
      , o = Gi(r)
      , s = i ? [o].concat(o.visualViewport || [], xw(r) ? r : []) : r
      , a = e.concat(s);
    return i ? a : a.concat(Dp(bw(s)))
}
function KQ(t) {
    return ["table", "td", "th"].indexOf(is(t)) >= 0
}
function wC(t) {
    return !ki(t) || os(t).position === "fixed" ? null : t.offsetParent
}
function qQ(t) {
    var e = /firefox/i.test(r_())
      , n = /Trident/i.test(r_());
    if (n && ki(t)) {
        var r = os(t);
        if (r.position === "fixed")
            return null
    }
    var i = bw(t);
    for (BM(i) && (i = i.host); ki(i) && ["html", "body"].indexOf(is(i)) < 0; ) {
        var o = os(i);
        if (o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].indexOf(o.willChange) !== -1 || e && o.willChange === "filter" || e && o.filter && o.filter !== "none")
            return i;
        i = i.parentNode
    }
    return null
}
function FM(t) {
    for (var e = Gi(t), n = wC(t); n && KQ(n) && os(n).position === "static"; )
        n = wC(n);
    return n && (is(n) === "html" || is(n) === "body" && os(n).position === "static") ? e : n || qQ(t) || e
}
var Ic = "top"
  , p0 = "bottom"
  , td = "right"
  , rl = "left"
  , LM = "auto"
  , ZQ = [Ic, p0, td, rl]
  , $M = "start"
  , g0 = "end"
  , JQ = [].concat(ZQ, [LM]).reduce(function(t, e) {
    return t.concat([e, e + "-" + $M, e + "-" + g0])
}, [])
  , QQ = "beforeRead"
  , eee = "read"
  , tee = "afterRead"
  , nee = "beforeMain"
  , ree = "main"
  , iee = "afterMain"
  , oee = "beforeWrite"
  , see = "write"
  , aee = "afterWrite"
  , i_ = [QQ, eee, tee, nee, ree, iee, oee, see, aee];
function lee(t) {
    var e = new Map
      , n = new Set
      , r = [];
    t.forEach(function(o) {
        e.set(o.name, o)
    });
    function i(o) {
        n.add(o.name);
        var s = [].concat(o.requires || [], o.requiresIfExists || []);
        s.forEach(function(a) {
            if (!n.has(a)) {
                var l = e.get(a);
                l && i(l)
            }
        }),
        r.push(o)
    }
    return t.forEach(function(o) {
        n.has(o.name) || i(o)
    }),
    r
}
function cee(t) {
    var e = lee(t);
    return i_.reduce(function(n, r) {
        return n.concat(e.filter(function(i) {
            return i.phase === r
        }))
    }, [])
}
function uee(t) {
    var e;
    return function() {
        return e || (e = new Promise(function(n) {
            Promise.resolve().then(function() {
                e = void 0,
                n(t())
            })
        }
        )),
        e
    }
}
function ys(t) {
    for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
        n[r - 1] = arguments[r];
    return [].concat(n).reduce(function(i, o) {
        return i.replace(/%s/, o)
    }, t)
}
var ba = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'
  , fee = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available'
  , EC = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
function dee(t) {
    t.forEach(function(e) {
        [].concat(Object.keys(e), EC).filter(function(n, r, i) {
            return i.indexOf(n) === r
        }).forEach(function(n) {
            switch (n) {
            case "name":
                typeof e.name != "string" && console.error(ys(ba, String(e.name), '"name"', '"string"', '"' + String(e.name) + '"'));
                break;
            case "enabled":
                typeof e.enabled != "boolean" && console.error(ys(ba, e.name, '"enabled"', '"boolean"', '"' + String(e.enabled) + '"'));
                break;
            case "phase":
                i_.indexOf(e.phase) < 0 && console.error(ys(ba, e.name, '"phase"', "either " + i_.join(", "), '"' + String(e.phase) + '"'));
                break;
            case "fn":
                typeof e.fn != "function" && console.error(ys(ba, e.name, '"fn"', '"function"', '"' + String(e.fn) + '"'));
                break;
            case "effect":
                e.effect != null && typeof e.effect != "function" && console.error(ys(ba, e.name, '"effect"', '"function"', '"' + String(e.fn) + '"'));
                break;
            case "requires":
                e.requires != null && !Array.isArray(e.requires) && console.error(ys(ba, e.name, '"requires"', '"array"', '"' + String(e.requires) + '"'));
                break;
            case "requiresIfExists":
                Array.isArray(e.requiresIfExists) || console.error(ys(ba, e.name, '"requiresIfExists"', '"array"', '"' + String(e.requiresIfExists) + '"'));
                break;
            case "options":
            case "data":
                break;
            default:
                console.error('PopperJS: an invalid property has been provided to the "' + e.name + '" modifier, valid properties are ' + EC.map(function(r) {
                    return '"' + r + '"'
                }).join(", ") + '; but "' + n + '" was provided.')
            }
            e.requires && e.requires.forEach(function(r) {
                t.find(function(i) {
                    return i.name === r
                }) == null && console.error(ys(fee, String(e.name), r, r))
            })
        })
    })
}
function hee(t, e) {
    var n = new Set;
    return t.filter(function(r) {
        var i = e(r);
        if (!n.has(i))
            return n.add(i),
            !0
    })
}
function $g(t) {
    return t.split("-")[0]
}
function pee(t) {
    var e = t.reduce(function(n, r) {
        var i = n[r.name];
        return n[r.name] = i ? Object.assign({}, i, r, {
            options: Object.assign({}, i.options, r.options),
            data: Object.assign({}, i.data, r.data)
        }) : r,
        n
    }, {});
    return Object.keys(e).map(function(n) {
        return e[n]
    })
}
function UM(t) {
    return t.split("-")[1]
}
function gee(t) {
    return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y"
}
function mee(t) {
    var e = t.reference, n = t.element, r = t.placement, i = r ? $g(r) : null, o = r ? UM(r) : null, s = e.x + e.width / 2 - n.width / 2, a = e.y + e.height / 2 - n.height / 2, l;
    switch (i) {
    case Ic:
        l = {
            x: s,
            y: e.y - n.height
        };
        break;
    case p0:
        l = {
            x: s,
            y: e.y + e.height
        };
        break;
    case td:
        l = {
            x: e.x + e.width,
            y: a
        };
        break;
    case rl:
        l = {
            x: e.x - n.width,
            y: a
        };
        break;
    default:
        l = {
            x: e.x,
            y: e.y
        }
    }
    var c = i ? gee(i) : null;
    if (c != null) {
        var u = c === "y" ? "height" : "width";
        switch (o) {
        case $M:
            l[c] = l[c] - (e[u] / 2 - n[u] / 2);
            break;
        case g0:
            l[c] = l[c] + (e[u] / 2 - n[u] / 2);
            break
        }
    }
    return l
}
var SC = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element."
  , vee = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash."
  , CC = {
    placement: "bottom",
    modifiers: [],
    strategy: "absolute"
};
function AC() {
    for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
        e[n] = arguments[n];
    return !e.some(function(r) {
        return !(r && typeof r.getBoundingClientRect == "function")
    })
}
function yee(t) {
    t === void 0 && (t = {});
    var e = t
      , n = e.defaultModifiers
      , r = n === void 0 ? [] : n
      , i = e.defaultOptions
      , o = i === void 0 ? CC : i;
    return function(a, l, c) {
        c === void 0 && (c = o);
        var u = {
            placement: "bottom",
            orderedModifiers: [],
            options: Object.assign({}, CC, o),
            modifiersData: {},
            elements: {
                reference: a,
                popper: l
            },
            attributes: {},
            styles: {}
        }
          , f = []
          , d = !1
          , h = {
            state: u,
            setOptions: function(g) {
                var m = typeof g == "function" ? g(u.options) : g;
                y(),
                u.options = Object.assign({}, o, u.options, m),
                u.scrollParents = {
                    reference: _w(a) ? Dp(a) : a.contextElement ? Dp(a.contextElement) : [],
                    popper: Dp(l)
                };
                var _ = cee(pee([].concat(r, u.options.modifiers)));
                u.orderedModifiers = _.filter(function(A) {
                    return A.enabled
                });
                {
                    var x = hee([].concat(_, u.options.modifiers), function(A) {
                        var T = A.name;
                        return T
                    });
                    if (dee(x),
                    $g(u.options.placement) === LM) {
                        var b = u.orderedModifiers.find(function(A) {
                            var T = A.name;
                            return T === "flip"
                        });
                        b || console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "))
                    }
                    var w = os(l)
                      , E = w.marginTop
                      , S = w.marginRight
                      , P = w.marginBottom
                      , C = w.marginLeft;
                    [E, S, P, C].some(function(A) {
                        return parseFloat(A)
                    }) && console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "))
                }
                return p(),
                h.update()
            },
            forceUpdate: function() {
                if (!d) {
                    var g = u.elements
                      , m = g.reference
                      , _ = g.popper;
                    if (!AC(m, _)) {
                        console.error(SC);
                        return
                    }
                    u.rects = {
                        reference: YQ(m, FM(_), u.options.strategy === "fixed"),
                        popper: XQ(_)
                    },
                    u.reset = !1,
                    u.placement = u.options.placement,
                    u.orderedModifiers.forEach(function(A) {
                        return u.modifiersData[A.name] = Object.assign({}, A.data)
                    });
                    for (var x = 0, b = 0; b < u.orderedModifiers.length; b++) {
                        if (x += 1,
                        x > 100) {
                            console.error(vee);
                            break
                        }
                        if (u.reset === !0) {
                            u.reset = !1,
                            b = -1;
                            continue
                        }
                        var w = u.orderedModifiers[b]
                          , E = w.fn
                          , S = w.options
                          , P = S === void 0 ? {} : S
                          , C = w.name;
                        typeof E == "function" && (u = E({
                            state: u,
                            options: P,
                            name: C,
                            instance: h
                        }) || u)
                    }
                }
            },
            update: uee(function() {
                return new Promise(function(v) {
                    h.forceUpdate(),
                    v(u)
                }
                )
            }),
            destroy: function() {
                y(),
                d = !0
            }
        };
        if (!AC(a, l))
            return console.error(SC),
            h;
        h.setOptions(c).then(function(v) {
            !d && c.onFirstUpdate && c.onFirstUpdate(v)
        });
        function p() {
            u.orderedModifiers.forEach(function(v) {
                var g = v.name
                  , m = v.options
                  , _ = m === void 0 ? {} : m
                  , x = v.effect;
                if (typeof x == "function") {
                    var b = x({
                        state: u,
                        name: g,
                        instance: h,
                        options: _
                    })
                      , w = function() {};
                    f.push(b || w)
                }
            })
        }
        function y() {
            f.forEach(function(v) {
                return v()
            }),
            f = []
        }
        return h
    }
}
var Lh = {
    passive: !0
};
function _ee(t) {
    var e = t.state
      , n = t.instance
      , r = t.options
      , i = r.scroll
      , o = i === void 0 ? !0 : i
      , s = r.resize
      , a = s === void 0 ? !0 : s
      , l = Gi(e.elements.popper)
      , c = [].concat(e.scrollParents.reference, e.scrollParents.popper);
    return o && c.forEach(function(u) {
        u.addEventListener("scroll", n.update, Lh)
    }),
    a && l.addEventListener("resize", n.update, Lh),
    function() {
        o && c.forEach(function(u) {
            u.removeEventListener("scroll", n.update, Lh)
        }),
        a && l.removeEventListener("resize", n.update, Lh)
    }
}
var xee = {
    name: "eventListeners",
    enabled: !0,
    phase: "write",
    fn: function() {},
    effect: _ee,
    data: {}
};
function bee(t) {
    var e = t.state
      , n = t.name;
    e.modifiersData[n] = mee({
        reference: e.rects.reference,
        element: e.rects.popper,
        strategy: "absolute",
        placement: e.placement
    })
}
var wee = {
    name: "popperOffsets",
    enabled: !0,
    phase: "read",
    fn: bee,
    data: {}
}
  , Eee = {
    top: "auto",
    right: "auto",
    bottom: "auto",
    left: "auto"
};
function See(t) {
    var e = t.x
      , n = t.y
      , r = window
      , i = r.devicePixelRatio || 1;
    return {
        x: Hc(e * i) / i || 0,
        y: Hc(n * i) / i || 0
    }
}
function TC(t) {
    var e, n = t.popper, r = t.popperRect, i = t.placement, o = t.variation, s = t.offsets, a = t.position, l = t.gpuAcceleration, c = t.adaptive, u = t.roundOffsets, f = t.isFixed, d = s.x, h = d === void 0 ? 0 : d, p = s.y, y = p === void 0 ? 0 : p, v = typeof u == "function" ? u({
        x: h,
        y
    }) : {
        x: h,
        y
    };
    h = v.x,
    y = v.y;
    var g = s.hasOwnProperty("x")
      , m = s.hasOwnProperty("y")
      , _ = rl
      , x = Ic
      , b = window;
    if (c) {
        var w = FM(n)
          , E = "clientHeight"
          , S = "clientWidth";
        if (w === Gi(n) && (w = Lg(n),
        os(w).position !== "static" && a === "absolute" && (E = "scrollHeight",
        S = "scrollWidth")),
        w = w,
        i === Ic || (i === rl || i === td) && o === g0) {
            x = p0;
            var P = f && w === b && b.visualViewport ? b.visualViewport.height : w[E];
            y -= P - r.height,
            y *= l ? 1 : -1
        }
        if (i === rl || (i === Ic || i === p0) && o === g0) {
            _ = td;
            var C = f && w === b && b.visualViewport ? b.visualViewport.width : w[S];
            h -= C - r.width,
            h *= l ? 1 : -1
        }
    }
    var A = Object.assign({
        position: a
    }, c && Eee)
      , T = u === !0 ? See({
        x: h,
        y
    }) : {
        x: h,
        y
    };
    if (h = T.x,
    y = T.y,
    l) {
        var I;
        return Object.assign({}, A, (I = {},
        I[x] = m ? "0" : "",
        I[_] = g ? "0" : "",
        I.transform = (b.devicePixelRatio || 1) <= 1 ? "translate(" + h + "px, " + y + "px)" : "translate3d(" + h + "px, " + y + "px, 0)",
        I))
    }
    return Object.assign({}, A, (e = {},
    e[x] = m ? y + "px" : "",
    e[_] = g ? h + "px" : "",
    e.transform = "",
    e))
}
function Cee(t) {
    var e = t.state
      , n = t.options
      , r = n.gpuAcceleration
      , i = r === void 0 ? !0 : r
      , o = n.adaptive
      , s = o === void 0 ? !0 : o
      , a = n.roundOffsets
      , l = a === void 0 ? !0 : a;
    {
        var c = os(e.elements.popper).transitionProperty || "";
        s && ["transform", "top", "right", "bottom", "left"].some(function(f) {
            return c.indexOf(f) >= 0
        }) && console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', `

`, 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", `

`, "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "))
    }
    var u = {
        placement: $g(e.placement),
        variation: UM(e.placement),
        popper: e.elements.popper,
        popperRect: e.rects.popper,
        gpuAcceleration: i,
        isFixed: e.options.strategy === "fixed"
    };
    e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, TC(Object.assign({}, u, {
        offsets: e.modifiersData.popperOffsets,
        position: e.options.strategy,
        adaptive: s,
        roundOffsets: l
    })))),
    e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, TC(Object.assign({}, u, {
        offsets: e.modifiersData.arrow,
        position: "absolute",
        adaptive: !1,
        roundOffsets: l
    })))),
    e.attributes.popper = Object.assign({}, e.attributes.popper, {
        "data-popper-placement": e.placement
    })
}
var Aee = {
    name: "computeStyles",
    enabled: !0,
    phase: "beforeWrite",
    fn: Cee,
    data: {}
};
function Tee(t) {
    var e = t.state;
    Object.keys(e.elements).forEach(function(n) {
        var r = e.styles[n] || {}
          , i = e.attributes[n] || {}
          , o = e.elements[n];
        !ki(o) || !is(o) || (Object.assign(o.style, r),
        Object.keys(i).forEach(function(s) {
            var a = i[s];
            a === !1 ? o.removeAttribute(s) : o.setAttribute(s, a === !0 ? "" : a)
        }))
    })
}
function Pee(t) {
    var e = t.state
      , n = {
        popper: {
            position: e.options.strategy,
            left: "0",
            top: "0",
            margin: "0"
        },
        arrow: {
            position: "absolute"
        },
        reference: {}
    };
    return Object.assign(e.elements.popper.style, n.popper),
    e.styles = n,
    e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow),
    function() {
        Object.keys(e.elements).forEach(function(r) {
            var i = e.elements[r]
              , o = e.attributes[r] || {}
              , s = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : n[r])
              , a = s.reduce(function(l, c) {
                return l[c] = "",
                l
            }, {});
            !ki(i) || !is(i) || (Object.assign(i.style, a),
            Object.keys(o).forEach(function(l) {
                i.removeAttribute(l)
            }))
        })
    }
}
var Iee = {
    name: "applyStyles",
    enabled: !0,
    phase: "write",
    fn: Tee,
    effect: Pee,
    requires: ["computeStyles"]
}
  , Oee = [xee, wee, Aee, Iee]
  , Ree = yee({
    defaultModifiers: Oee
});
function Mee(t, e, n) {
    var r = $g(t)
      , i = [rl, Ic].indexOf(r) >= 0 ? -1 : 1
      , o = typeof n == "function" ? n(Object.assign({}, e, {
        placement: t
    })) : n
      , s = o[0]
      , a = o[1];
    return s = s || 0,
    a = (a || 0) * i,
    [rl, td].indexOf(r) >= 0 ? {
        x: a,
        y: s
    } : {
        x: s,
        y: a
    }
}
function Dee(t) {
    var e = t.state
      , n = t.options
      , r = t.name
      , i = n.offset
      , o = i === void 0 ? [0, 0] : i
      , s = JQ.reduce(function(u, f) {
        return u[f] = Mee(f, e.rects, o),
        u
    }, {})
      , a = s[e.placement]
      , l = a.x
      , c = a.y;
    e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += l,
    e.modifiersData.popperOffsets.y += c),
    e.modifiersData[r] = s
}
var Bee = {
    name: "offset",
    enabled: !0,
    phase: "main",
    requires: ["popperOffsets"],
    fn: Dee
};
const [kee,wa] = Te("popover")
  , Nee = ["overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"]
  , Fee = {
    show: Boolean,
    theme: Me("light"),
    overlay: Boolean,
    actions: ns(),
    actionsDirection: Me("vertical"),
    trigger: Me("click"),
    duration: Se,
    showArrow: _e,
    placement: Me("bottom"),
    iconPrefix: String,
    overlayClass: hn,
    overlayStyle: Object,
    closeOnClickAction: _e,
    closeOnClickOverlay: _e,
    closeOnClickOutside: _e,
    offset: {
        type: Array,
        default: () => [0, 8]
    },
    teleport: {
        type: [String, Object],
        default: "body"
    }
};
var Lee = we({
    name: kee,
    props: Fee,
    emits: ["select", "touchstart", "update:show"],
    setup(t, {emit: e, slots: n, attrs: r}) {
        let i;
        const o = Z()
          , s = Z()
          , a = Z()
          , l = Dq( () => t.show, m => e("update:show", m))
          , c = () => ({
            placement: t.placement,
            modifiers: [{
                name: "computeStyles",
                options: {
                    adaptive: !1,
                    gpuAcceleration: !1
                }
            }, We({}, Bee, {
                options: {
                    offset: t.offset
                }
            })]
        })
          , u = () => s.value && a.value ? Ree(s.value, a.value.popupRef.value, c()) : null
          , f = () => {
            Xe( () => {
                l.value && (i ? i.setOptions(c()) : (i = u(),
                po && (window.addEventListener("animationend", f),
                window.addEventListener("transitionend", f))))
            }
            )
        }
          , d = m => {
            l.value = m
        }
          , h = () => {
            t.trigger === "click" && (l.value = !l.value)
        }
          , p = (m, _) => {
            m.disabled || (e("select", m, _),
            t.closeOnClickAction && (l.value = !1))
        }
          , y = () => {
            l.value && t.closeOnClickOutside && (!t.overlay || t.closeOnClickOverlay) && (l.value = !1)
        }
          , v = (m, _) => n.action ? n.action({
            action: m,
            index: _
        }) : [m.icon && R(tn, {
            name: m.icon,
            classPrefix: t.iconPrefix,
            class: wa("action-icon")
        }, null), R("div", {
            class: [wa("action-text"), {
                [MK]: t.actionsDirection === "vertical"
            }]
        }, [m.text])]
          , g = (m, _) => {
            const {icon: x, color: b, disabled: w, className: E} = m;
            return R("div", {
                role: "menuitem",
                class: [wa("action", {
                    disabled: w,
                    "with-icon": x
                }), {
                    [RK]: t.actionsDirection === "horizontal"
                }, E],
                style: {
                    color: b
                },
                tabindex: w ? void 0 : 0,
                "aria-disabled": w || void 0,
                onClick: () => p(m, _)
            }, [v(m, _)])
        }
        ;
        return Ht( () => {
            f(),
            fu( () => {
                var m;
                o.value = (m = a.value) == null ? void 0 : m.popupRef.value
            }
            )
        }
        ),
        qr( () => {
            i && (po && (window.removeEventListener("animationend", f),
            window.removeEventListener("transitionend", f)),
            i.destroy(),
            i = null)
        }
        ),
        ve( () => [l.value, t.offset, t.placement], f),
        eR([s, o], y, {
            eventName: "touchstart"
        }),
        () => {
            var m;
            return R(Ft, null, [R("span", {
                ref: s,
                class: wa("wrapper"),
                onClick: h
            }, [(m = n.reference) == null ? void 0 : m.call(n)]), R(Nl, st({
                ref: a,
                show: l.value,
                class: wa([t.theme]),
                position: "",
                transition: "van-popover-zoom",
                lockScroll: !1,
                "onUpdate:show": d
            }, r, qy(), $t(t, Nee)), {
                default: () => [t.showArrow && R("div", {
                    class: wa("arrow")
                }, null), R("div", {
                    role: "menu",
                    class: wa("content", t.actionsDirection)
                }, [n.default ? n.default() : t.actions.map(g)])]
            })])
        }
    }
});
const R3e = De(Lee)
  , [$ee,Jm] = Te("progress")
  , Uee = {
    color: String,
    inactive: Boolean,
    pivotText: String,
    textColor: String,
    showPivot: _e,
    pivotColor: String,
    trackColor: String,
    strokeWidth: Se,
    percentage: {
        type: Se,
        default: 0,
        validator: t => +t >= 0 && +t <= 100
    }
};
var Gee = we({
    name: $ee,
    props: Uee,
    setup(t) {
        const e = re( () => t.inactive ? void 0 : t.color)
          , n = i => Math.min(Math.max(+i, 0), 100)
          , r = () => {
            const {textColor: i, pivotText: o, pivotColor: s, percentage: a} = t
              , l = n(a)
              , c = o ?? `${a}%`;
            if (t.showPivot && c) {
                const u = {
                    color: i,
                    left: `${l}%`,
                    transform: `translate(-${l}%,-50%)`,
                    background: s || e.value
                };
                return R("span", {
                    style: u,
                    class: Jm("pivot", {
                        inactive: t.inactive
                    })
                }, [c])
            }
        }
        ;
        return () => {
            const {trackColor: i, percentage: o, strokeWidth: s} = t
              , a = n(o)
              , l = {
                background: i,
                height: tt(s)
            }
              , c = {
                width: `${a}%`,
                background: e.value
            };
            return R("div", {
                class: Jm(),
                style: l
            }, [R("span", {
                class: Jm("portion", {
                    inactive: t.inactive
                }),
                style: c
            }, null), r()])
        }
    }
});
const M3e = De(Gee)
  , [Hee,ku,Vee] = Te("pull-refresh")
  , GM = 50
  , zee = ["pulling", "loosing", "success"]
  , jee = {
    disabled: Boolean,
    modelValue: Boolean,
    headHeight: ze(GM),
    successText: String,
    pullingText: String,
    loosingText: String,
    loadingText: String,
    pullDistance: Se,
    successDuration: ze(500),
    animationDuration: ze(300)
};
var Wee = we({
    name: Hee,
    props: jee,
    emits: ["change", "refresh", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        let r;
        const i = Z()
          , o = Z()
          , s = Vd(i)
          , a = Mt({
            status: "normal",
            distance: 0,
            duration: 0
        })
          , l = kl()
          , c = () => {
            if (t.headHeight !== GM)
                return {
                    height: `${t.headHeight}px`
                }
        }
          , u = () => a.status !== "loading" && a.status !== "success" && !t.disabled
          , f = x => {
            const b = +(t.pullDistance || t.headHeight);
            return x > b && (x < b * 2 ? x = b + (x - b) / 2 : x = b * 1.5 + (x - b * 2) / 4),
            Math.round(x)
        }
          , d = (x, b) => {
            const w = +(t.pullDistance || t.headHeight);
            a.distance = x,
            b ? a.status = "loading" : x === 0 ? a.status = "normal" : x < w ? a.status = "pulling" : a.status = "loosing",
            e("change", {
                status: a.status,
                distance: x
            })
        }
          , h = () => {
            const {status: x} = a;
            return x === "normal" ? "" : t[`${x}Text`] || Vee(x)
        }
          , p = () => {
            const {status: x, distance: b} = a;
            if (n[x])
                return n[x]({
                    distance: b
                });
            const w = [];
            return zee.includes(x) && w.push(R("div", {
                class: ku("text")
            }, [h()])),
            x === "loading" && w.push(R(ds, {
                class: ku("loading")
            }, {
                default: h
            })),
            w
        }
          , y = () => {
            a.status = "success",
            setTimeout( () => {
                d(0)
            }
            , +t.successDuration)
        }
          , v = x => {
            r = zd(s.value) === 0,
            r && (a.duration = 0,
            l.start(x))
        }
          , g = x => {
            u() && v(x)
        }
          , m = x => {
            if (u()) {
                r || v(x);
                const {deltaY: b} = l;
                l.move(x),
                r && b.value >= 0 && l.isVertical() && (Bn(x),
                d(f(b.value)))
            }
        }
          , _ = () => {
            r && l.deltaY.value && u() && (a.duration = +t.animationDuration,
            a.status === "loosing" ? (d(+t.headHeight, !0),
            e("update:modelValue", !0),
            Xe( () => e("refresh"))) : d(0))
        }
        ;
        return ve( () => t.modelValue, x => {
            a.duration = +t.animationDuration,
            x ? d(+t.headHeight, !0) : n.success || t.successText ? y() : d(0, !1)
        }
        ),
        mr("touchmove", m, {
            target: o
        }),
        () => {
            var x;
            const b = {
                transitionDuration: `${a.duration}ms`,
                transform: a.distance ? `translate3d(0,${a.distance}px, 0)` : ""
            };
            return R("div", {
                ref: i,
                class: ku()
            }, [R("div", {
                ref: o,
                class: ku("track"),
                style: b,
                onTouchstartPassive: g,
                onTouchend: _,
                onTouchcancel: _
            }, [R("div", {
                class: ku("head"),
                style: c()
            }, [p()]), (x = n.default) == null ? void 0 : x.call(n)])])
        }
    }
});
const D3e = De(Wee)
  , B3e = De(OJ)
  , [HM,Yee] = Te("sidebar")
  , VM = Symbol(HM)
  , Xee = {
    modelValue: ze(0)
};
var Kee = we({
    name: HM,
    props: Xee,
    emits: ["change", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const {linkChildren: r} = Ui(VM)
          , i = () => +t.modelValue;
        return r({
            getActive: i,
            setActive: s => {
                s !== i() && (e("update:modelValue", s),
                e("change", s))
            }
        }),
        () => {
            var s;
            return R("div", {
                role: "tablist",
                class: Yee()
            }, [(s = n.default) == null ? void 0 : s.call(n)])
        }
    }
});
const k3e = De(Kee)
  , [qee,PC] = Te("sidebar-item")
  , Zee = We({}, mu, {
    dot: Boolean,
    title: String,
    badge: Se,
    disabled: Boolean,
    badgeProps: Object
});
var Jee = we({
    name: qee,
    props: Zee,
    emits: ["click"],
    setup(t, {emit: e, slots: n}) {
        const r = jd()
          , {parent: i, index: o} = Zr(VM);
        if (!i) {
            console.error("[Vant] <SidebarItem> must be a child component of <Sidebar>.");
            return
        }
        const s = () => {
            t.disabled || (e("click", o.value),
            i.setActive(o.value),
            r())
        }
        ;
        return () => {
            const {dot: a, badge: l, title: c, disabled: u} = t
              , f = o.value === i.getActive();
            return R("div", {
                role: "tab",
                class: PC({
                    select: f,
                    disabled: u
                }),
                tabindex: u ? void 0 : 0,
                "aria-selected": f,
                onClick: s
            }, [R(Dg, st({
                dot: a,
                class: PC("text"),
                content: l
            }, t.badgeProps), {
                default: () => [n.title ? n.title() : c]
            })])
        }
    }
});
const N3e = De(Jee)
  , [Qee,ete] = Te("skeleton-title")
  , tte = {
    round: Boolean,
    titleWidth: Se
};
var nte = we({
    name: Qee,
    props: tte,
    setup(t) {
        return () => R("h3", {
            class: ete([{
                round: t.round
            }]),
            style: {
                width: tt(t.titleWidth)
            }
        }, null)
    }
});
const rte = De(nte);
var ite = rte;
const [ote,ste] = Te("skeleton-avatar")
  , ate = {
    avatarSize: Se,
    avatarShape: Me("round")
};
var lte = we({
    name: ote,
    props: ate,
    setup(t) {
        return () => R("div", {
            class: ste([t.avatarShape]),
            style: Bl(t.avatarSize)
        }, null)
    }
});
const cte = De(lte);
var ute = cte;
const ww = "100%"
  , fte = {
    round: Boolean,
    rowWidth: {
        type: Se,
        default: ww
    }
}
  , [dte,hte] = Te("skeleton-paragraph");
var pte = we({
    name: dte,
    props: fte,
    setup(t) {
        return () => R("div", {
            class: hte([{
                round: t.round
            }]),
            style: {
                width: t.rowWidth
            }
        }, null)
    }
});
const gte = De(pte);
var mte = gte;
const [vte,IC] = Te("skeleton")
  , yte = "60%"
  , _te = {
    row: ze(0),
    round: Boolean,
    title: Boolean,
    titleWidth: Se,
    avatar: Boolean,
    avatarSize: Se,
    avatarShape: Me("round"),
    loading: _e,
    animate: _e,
    rowWidth: {
        type: [Number, String, Array],
        default: ww
    }
};
var xte = we({
    name: vte,
    inheritAttrs: !1,
    props: _te,
    setup(t, {slots: e, attrs: n}) {
        const r = () => {
            if (t.avatar)
                return R(ute, {
                    avatarShape: t.avatarShape,
                    avatarSize: t.avatarSize
                }, null)
        }
          , i = () => {
            if (t.title)
                return R(ite, {
                    round: t.round,
                    titleWidth: t.titleWidth
                }, null)
        }
          , o = l => {
            const {rowWidth: c} = t;
            return c === ww && l === +t.row - 1 ? yte : Array.isArray(c) ? c[l] : c
        }
          , s = () => Array(+t.row).fill("").map( (l, c) => R(mte, {
            key: c,
            round: t.round,
            rowWidth: tt(o(c))
        }, null))
          , a = () => e.template ? e.template() : R(Ft, null, [r(), R("div", {
            class: IC("content")
        }, [i(), s()])]);
        return () => {
            var l;
            return t.loading ? R("div", st({
                class: IC({
                    animate: t.animate,
                    round: t.round
                })
            }, n), [a()]) : (l = e.default) == null ? void 0 : l.call(e)
        }
    }
});
const F3e = De(xte)
  , [bte,Nu] = Te("slider")
  , wte = {
    min: ze(0),
    max: ze(100),
    step: ze(1),
    range: Boolean,
    reverse: Boolean,
    disabled: Boolean,
    readonly: Boolean,
    vertical: Boolean,
    barHeight: Se,
    buttonSize: Se,
    activeColor: String,
    inactiveColor: String,
    modelValue: {
        type: [Number, Array],
        default: 0
    }
};
var Ete = we({
    name: bte,
    props: wte,
    emits: ["change", "dragEnd", "dragStart", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        let r, i, o;
        const s = Z()
          , a = [Z(), Z()]
          , l = Z()
          , c = kl()
          , u = re( () => Number(t.max) - Number(t.min))
          , f = re( () => {
            const A = t.vertical ? "width" : "height";
            return {
                background: t.inactiveColor,
                [A]: tt(t.barHeight)
            }
        }
        )
          , d = A => t.range && Array.isArray(A)
          , h = () => {
            const {modelValue: A, min: T} = t;
            return d(A) ? `${(A[1] - A[0]) * 100 / u.value}%` : `${(A - Number(T)) * 100 / u.value}%`
        }
          , p = () => {
            const {modelValue: A, min: T} = t;
            return d(A) ? `${(A[0] - Number(T)) * 100 / u.value}%` : "0%"
        }
          , y = re( () => {
            const T = {
                [t.vertical ? "height" : "width"]: h(),
                background: t.activeColor
            };
            l.value && (T.transition = "none");
            const I = () => t.vertical ? t.reverse ? "bottom" : "top" : t.reverse ? "right" : "left";
            return T[I()] = p(),
            T
        }
        )
          , v = A => {
            const T = +t.min
              , I = +t.max
              , B = +t.step;
            A = $n(A, T, I);
            const G = Math.round((A - T) / B) * B;
            return $8(T, G)
        }
          , g = () => {
            const A = t.modelValue;
            d(A) ? o = A.map(v) : o = v(A)
        }
          , m = A => {
            var T, I;
            const B = (T = A[0]) != null ? T : Number(t.min)
              , G = (I = A[1]) != null ? I : Number(t.max);
            return B > G ? [G, B] : [B, G]
        }
          , _ = (A, T) => {
            d(A) ? A = m(A).map(v) : A = v(A),
            Ws(A, t.modelValue) || e("update:modelValue", A),
            T && !Ws(A, o) && e("change", A)
        }
          , x = A => {
            if (A.stopPropagation(),
            t.disabled || t.readonly)
                return;
            g();
            const {min: T, reverse: I, vertical: B, modelValue: G} = t
              , N = wn(s)
              , U = () => B ? I ? N.bottom - A.clientY : A.clientY - N.top : I ? N.right - A.clientX : A.clientX - N.left
              , W = B ? N.height : N.width
              , K = Number(T) + U() / W * u.value;
            if (d(G)) {
                const [fe,ue] = G
                  , X = (fe + ue) / 2;
                K <= X ? _([K, ue], !0) : _([fe, K], !0)
            } else
                _(K, !0)
        }
          , b = A => {
            t.disabled || t.readonly || (c.start(A),
            i = t.modelValue,
            g(),
            l.value = "start")
        }
          , w = A => {
            if (t.disabled || t.readonly)
                return;
            l.value === "start" && e("dragStart", A),
            Bn(A, !0),
            c.move(A),
            l.value = "dragging";
            const T = wn(s)
              , I = t.vertical ? c.deltaY.value : c.deltaX.value
              , B = t.vertical ? T.height : T.width;
            let G = I / B * u.value;
            if (t.reverse && (G = -G),
            d(o)) {
                const N = t.reverse ? 1 - r : r;
                i[N] = o[N] + G
            } else
                i = o + G;
            _(i)
        }
          , E = A => {
            t.disabled || t.readonly || (l.value === "dragging" && (_(i, !0),
            e("dragEnd", A)),
            l.value = "")
        }
          , S = A => typeof A == "number" ? Nu("button-wrapper", ["left", "right"][A]) : Nu("button-wrapper", t.reverse ? "left" : "right")
          , P = (A, T) => {
            const I = l.value === "dragging";
            if (typeof T == "number") {
                const B = n[T === 0 ? "left-button" : "right-button"];
                let G;
                if (I && Array.isArray(i) && (G = i[0] > i[1] ? r ^ 1 : r),
                B)
                    return B({
                        value: A,
                        dragging: I,
                        dragIndex: G
                    })
            }
            return n.button ? n.button({
                value: A,
                dragging: I
            }) : R("div", {
                class: Nu("button"),
                style: Bl(t.buttonSize)
            }, null)
        }
          , C = A => {
            const T = typeof A == "number" ? t.modelValue[A] : t.modelValue;
            return R("div", {
                ref: a[A ?? 0],
                role: "slider",
                class: S(A),
                tabindex: t.disabled ? void 0 : 0,
                "aria-valuemin": t.min,
                "aria-valuenow": T,
                "aria-valuemax": t.max,
                "aria-disabled": t.disabled || void 0,
                "aria-readonly": t.readonly || void 0,
                "aria-orientation": t.vertical ? "vertical" : "horizontal",
                onTouchstartPassive: I => {
                    typeof A == "number" && (r = A),
                    b(I)
                }
                ,
                onTouchend: E,
                onTouchcancel: E,
                onClick: N8
            }, [P(T, A)])
        }
        ;
        return _(t.modelValue),
        Dl( () => t.modelValue),
        a.forEach(A => {
            mr("touchmove", w, {
                target: A
            })
        }
        ),
        () => R("div", {
            ref: s,
            style: f.value,
            class: Nu({
                vertical: t.vertical,
                disabled: t.disabled
            }),
            onClick: x
        }, [R("div", {
            class: Nu("bar"),
            style: y.value
        }, [t.range ? [C(0), C(1)] : C()])])
    }
});
const L3e = De(Ete)
  , [OC,Ste] = Te("space")
  , Cte = {
    align: String,
    direction: {
        type: String,
        default: "horizontal"
    },
    size: {
        type: [Number, String, Array],
        default: 8
    },
    wrap: Boolean,
    fill: Boolean
};
function zM(t=[]) {
    const e = [];
    return t.forEach(n => {
        Array.isArray(n) ? e.push(...n) : n.type === Ft ? e.push(...zM(n.children)) : e.push(n)
    }
    ),
    e.filter(n => {
        var r;
        return !(n && (n.type === en || n.type === Ft && ((r = n.children) == null ? void 0 : r.length) === 0 || n.type === fo && n.children.trim() === ""))
    }
    )
}
var Ate = we({
    name: OC,
    props: Cte,
    setup(t, {slots: e}) {
        const n = re( () => {
            var o;
            return (o = t.align) != null ? o : t.direction === "horizontal" ? "center" : ""
        }
        )
          , r = o => typeof o == "number" ? o + "px" : o
          , i = o => {
            const s = {}
              , a = `${r(Array.isArray(t.size) ? t.size[0] : t.size)}`
              , l = `${r(Array.isArray(t.size) ? t.size[1] : t.size)}`;
            return o ? t.wrap ? {
                marginBottom: l
            } : {} : (t.direction === "horizontal" && (s.marginRight = a),
            (t.direction === "vertical" || t.wrap) && (s.marginBottom = l),
            s)
        }
        ;
        return () => {
            var o;
            const s = zM((o = e.default) == null ? void 0 : o.call(e));
            return R("div", {
                class: [Ste({
                    [t.direction]: t.direction,
                    [`align-${n.value}`]: n.value,
                    wrap: t.wrap,
                    fill: t.fill
                })]
            }, [s.map( (a, l) => R("div", {
                key: `item-${l}`,
                class: `${OC}-item`,
                style: i(l === s.length - 1)
            }, [a]))])
        }
    }
});
const $3e = De(Ate)
  , [Tte,$h] = Te("stepper")
  , Pte = 200
  , Uh = (t, e) => String(t) === String(e)
  , Ite = {
    min: ze(1),
    max: ze(1 / 0),
    name: ze(""),
    step: ze(1),
    theme: String,
    integer: Boolean,
    disabled: Boolean,
    showPlus: _e,
    showMinus: _e,
    showInput: _e,
    longPress: _e,
    autoFixed: _e,
    allowEmpty: Boolean,
    modelValue: Se,
    inputWidth: Se,
    buttonSize: Se,
    placeholder: String,
    disablePlus: Boolean,
    disableMinus: Boolean,
    disableInput: Boolean,
    beforeChange: Function,
    defaultValue: ze(1),
    decimalLength: Se
};
var Ote = we({
    name: Tte,
    props: Ite,
    emits: ["plus", "blur", "minus", "focus", "change", "overlimit", "update:modelValue"],
    setup(t, {emit: e}) {
        const n = (S, P=!0) => {
            const {min: C, max: A, allowEmpty: T, decimalLength: I} = t;
            return T && S === "" || (S = Xy(String(S), !t.integer),
            S = S === "" ? 0 : +S,
            S = Number.isNaN(S) ? +C : S,
            S = P ? Math.max(Math.min(+A, S), +C) : S,
            Lt(I) && (S = S.toFixed(+I))),
            S
        }
          , r = () => {
            var S;
            const P = (S = t.modelValue) != null ? S : t.defaultValue
              , C = n(P);
            return Uh(C, t.modelValue) || e("update:modelValue", C),
            C
        }
        ;
        let i;
        const o = Z()
          , s = Z(r())
          , a = re( () => t.disabled || t.disableMinus || +s.value <= +t.min)
          , l = re( () => t.disabled || t.disablePlus || +s.value >= +t.max)
          , c = re( () => ({
            width: tt(t.inputWidth),
            height: tt(t.buttonSize)
        }))
          , u = re( () => Bl(t.buttonSize))
          , f = () => {
            const S = n(s.value);
            Uh(S, s.value) || (s.value = S)
        }
          , d = S => {
            t.beforeChange ? gu(t.beforeChange, {
                args: [S],
                done() {
                    s.value = S
                }
            }) : s.value = S
        }
          , h = () => {
            if (i === "plus" && l.value || i === "minus" && a.value) {
                e("overlimit", i);
                return
            }
            const S = i === "minus" ? -t.step : +t.step
              , P = n($8(+s.value, S));
            d(P),
            e(i)
        }
          , p = S => {
            const P = S.target
              , {value: C} = P
              , {decimalLength: A} = t;
            let T = Xy(String(C), !t.integer);
            if (Lt(A) && T.includes(".")) {
                const B = T.split(".");
                T = `${B[0]}.${B[1].slice(0, +A)}`
            }
            t.beforeChange ? P.value = String(s.value) : Uh(C, T) || (P.value = T);
            const I = T === String(+T);
            d(I ? +T : T)
        }
          , y = S => {
            var P;
            t.disableInput ? (P = o.value) == null || P.blur() : e("focus", S)
        }
          , v = S => {
            const P = S.target
              , C = n(P.value, t.autoFixed);
            P.value = String(C),
            s.value = C,
            Xe( () => {
                e("blur", S),
                k8()
            }
            )
        }
        ;
        let g, m;
        const _ = () => {
            m = setTimeout( () => {
                h(),
                _()
            }
            , Pte)
        }
          , x = () => {
            t.longPress && (g = !1,
            clearTimeout(m),
            m = setTimeout( () => {
                g = !0,
                h(),
                _()
            }
            , z8))
        }
          , b = S => {
            t.longPress && (clearTimeout(m),
            g && Bn(S))
        }
          , w = S => {
            t.disableInput && Bn(S)
        }
          , E = S => ({
            onClick: P => {
                Bn(P),
                i = S,
                h()
            }
            ,
            onTouchstartPassive: () => {
                i = S,
                x()
            }
            ,
            onTouchend: b,
            onTouchcancel: b
        });
        return ve( () => [t.max, t.min, t.integer, t.decimalLength], f),
        ve( () => t.modelValue, S => {
            Uh(S, s.value) || (s.value = n(S))
        }
        ),
        ve(s, S => {
            e("update:modelValue", S),
            e("change", S, {
                name: t.name
            })
        }
        ),
        Dl( () => t.modelValue),
        () => R("div", {
            role: "group",
            class: $h([t.theme])
        }, [di(R("button", st({
            type: "button",
            style: u.value,
            class: [$h("minus", {
                disabled: a.value
            }), {
                [rs]: !a.value
            }],
            "aria-disabled": a.value || void 0
        }, E("minus")), null), [[pi, t.showMinus]]), di(R("input", {
            ref: o,
            type: t.integer ? "tel" : "text",
            role: "spinbutton",
            class: $h("input"),
            value: s.value,
            style: c.value,
            disabled: t.disabled,
            readonly: t.disableInput,
            inputmode: t.integer ? "numeric" : "decimal",
            placeholder: t.placeholder,
            autocomplete: "off",
            "aria-valuemax": t.max,
            "aria-valuemin": t.min,
            "aria-valuenow": s.value,
            onBlur: v,
            onInput: p,
            onFocus: y,
            onMousedown: w
        }, null), [[pi, t.showInput]]), di(R("button", st({
            type: "button",
            style: u.value,
            class: [$h("plus", {
                disabled: l.value
            }), {
                [rs]: !l.value
            }],
            "aria-disabled": l.value || void 0
        }, E("plus")), null), [[pi, t.showPlus]])])
    }
});
const U3e = De(Ote)
  , [Rte,yn,Mte] = Te("uploader");
function RC(t, e) {
    return new Promise(n => {
        if (e === "file") {
            n();
            return
        }
        const r = new FileReader;
        r.onload = i => {
            n(i.target.result)
        }
        ,
        e === "dataUrl" ? r.readAsDataURL(t) : e === "text" && r.readAsText(t)
    }
    )
}
function jM(t, e) {
    return u0(t).some(n => n.file ? $c(e) ? e(n.file) : n.file.size > +e : !1)
}
function Dte(t, e) {
    const n = []
      , r = [];
    return t.forEach(i => {
        jM(i, e) ? r.push(i) : n.push(i)
    }
    ),
    {
        valid: n,
        invalid: r
    }
}
const Bte = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i
  , kte = t => Bte.test(t);
function WM(t) {
    return t.isImage ? !0 : t.file && t.file.type ? t.file.type.indexOf("image") === 0 : t.url ? kte(t.url) : typeof t.content == "string" ? t.content.indexOf("data:image") === 0 : !1
}
var Nte = we({
    props: {
        name: Se,
        item: ur(Object),
        index: Number,
        imageFit: String,
        lazyLoad: Boolean,
        deletable: Boolean,
        reupload: Boolean,
        previewSize: [Number, String, Array],
        beforeDelete: Function
    },
    emits: ["delete", "preview", "reupload"],
    setup(t, {emit: e, slots: n}) {
        const r = () => {
            const {status: u, message: f} = t.item;
            if (u === "uploading" || u === "failed") {
                const d = u === "failed" ? R(tn, {
                    name: "close",
                    class: yn("mask-icon")
                }, null) : R(ds, {
                    class: yn("loading")
                }, null)
                  , h = Lt(f) && f !== "";
                return R("div", {
                    class: yn("mask")
                }, [d, h && R("div", {
                    class: yn("mask-message")
                }, [f])])
            }
        }
          , i = u => {
            const {name: f, item: d, index: h, beforeDelete: p} = t;
            u.stopPropagation(),
            gu(p, {
                args: [d, {
                    name: f,
                    index: h
                }],
                done: () => e("delete")
            })
        }
          , o = () => e("preview")
          , s = () => e("reupload")
          , a = () => {
            if (t.deletable && t.item.status !== "uploading") {
                const u = n["preview-delete"];
                return R("div", {
                    role: "button",
                    class: yn("preview-delete", {
                        shadow: !u
                    }),
                    tabindex: 0,
                    "aria-label": Mte("delete"),
                    onClick: i
                }, [u ? u() : R(tn, {
                    name: "cross",
                    class: yn("preview-delete-icon")
                }, null)])
            }
        }
          , l = () => {
            if (n["preview-cover"]) {
                const {index: u, item: f} = t;
                return R("div", {
                    class: yn("preview-cover")
                }, [n["preview-cover"](We({
                    index: u
                }, f))])
            }
        }
          , c = () => {
            const {item: u, lazyLoad: f, imageFit: d, previewSize: h, reupload: p} = t;
            return WM(u) ? R(SM, {
                fit: d,
                src: u.objectUrl || u.content || u.url,
                class: yn("preview-image"),
                width: Array.isArray(h) ? h[0] : h,
                height: Array.isArray(h) ? h[1] : h,
                lazyLoad: f,
                onClick: p ? s : o
            }, {
                default: l
            }) : R("div", {
                class: yn("file"),
                style: Bl(t.previewSize)
            }, [R(tn, {
                class: yn("file-icon"),
                name: "description"
            }, null), R("div", {
                class: [yn("file-name"), "van-ellipsis"]
            }, [u.file ? u.file.name : u.url]), l()])
        }
        ;
        return () => R("div", {
            class: yn("preview")
        }, [c(), r(), a()])
    }
});
const Fte = {
    name: ze(""),
    accept: Me("image/*"),
    capture: String,
    multiple: Boolean,
    disabled: Boolean,
    readonly: Boolean,
    lazyLoad: Boolean,
    maxCount: ze(1 / 0),
    imageFit: Me("cover"),
    resultType: Me("dataUrl"),
    uploadIcon: Me("photograph"),
    uploadText: String,
    deletable: _e,
    reupload: Boolean,
    afterRead: Function,
    showUpload: _e,
    modelValue: ns(),
    beforeRead: Function,
    beforeDelete: Function,
    previewSize: [Number, String, Array],
    previewImage: _e,
    previewOptions: Object,
    previewFullImage: _e,
    maxSize: {
        type: [Number, String, Function],
        default: 1 / 0
    }
};
var Lte = we({
    name: Rte,
    props: Fte,
    emits: ["delete", "oversize", "clickUpload", "closePreview", "clickPreview", "clickReupload", "update:modelValue"],
    setup(t, {emit: e, slots: n}) {
        const r = Z()
          , i = []
          , o = Z(-1)
          , s = Z(!1)
          , a = (S=t.modelValue.length) => ({
            name: t.name,
            index: S
        })
          , l = () => {
            r.value && (r.value.value = "")
        }
          , c = S => {
            if (l(),
            jM(S, t.maxSize))
                if (Array.isArray(S)) {
                    const P = Dte(S, t.maxSize);
                    if (S = P.valid,
                    e("oversize", P.invalid, a()),
                    !S.length)
                        return
                } else {
                    e("oversize", S, a());
                    return
                }
            if (S = Mt(S),
            o.value > -1) {
                const P = [...t.modelValue];
                P.splice(o.value, 1, S),
                e("update:modelValue", P),
                o.value = -1
            } else
                e("update:modelValue", [...t.modelValue, ...u0(S)]);
            t.afterRead && t.afterRead(S, a())
        }
          , u = S => {
            const {maxCount: P, modelValue: C, resultType: A} = t;
            if (Array.isArray(S)) {
                const T = +P - C.length;
                S.length > T && (S = S.slice(0, T)),
                Promise.all(S.map(I => RC(I, A))).then(I => {
                    const B = S.map( (G, N) => {
                        const U = {
                            file: G,
                            status: "",
                            message: "",
                            objectUrl: URL.createObjectURL(G)
                        };
                        return I[N] && (U.content = I[N]),
                        U
                    }
                    );
                    c(B)
                }
                )
            } else
                RC(S, A).then(T => {
                    const I = {
                        file: S,
                        status: "",
                        message: "",
                        objectUrl: URL.createObjectURL(S)
                    };
                    T && (I.content = T),
                    c(I)
                }
                )
        }
          , f = S => {
            const {files: P} = S.target;
            if (t.disabled || !P || !P.length)
                return;
            const C = P.length === 1 ? P[0] : [].slice.call(P);
            if (t.beforeRead) {
                const A = t.beforeRead(C, a());
                if (!A) {
                    l();
                    return
                }
                if (aw(A)) {
                    A.then(T => {
                        u(T || C)
                    }
                    ).catch(l);
                    return
                }
            }
            u(C)
        }
        ;
        let d;
        const h = () => e("closePreview")
          , p = S => {
            if (t.previewFullImage) {
                const P = t.modelValue.filter(WM)
                  , C = P.map(A => (A.objectUrl && !A.url && A.status !== "failed" && (A.url = A.objectUrl,
                i.push(A.url)),
                A.url)).filter(Boolean);
                d = CQ(We({
                    images: C,
                    startPosition: P.indexOf(S),
                    onClose: h
                }, t.previewOptions))
            }
        }
          , y = () => {
            d && d.close()
        }
          , v = (S, P) => {
            const C = t.modelValue.slice(0);
            C.splice(P, 1),
            e("update:modelValue", C),
            e("delete", S, a(P))
        }
          , g = S => {
            s.value = !0,
            o.value = S,
            Xe( () => E())
        }
          , m = () => {
            s.value || (o.value = -1),
            s.value = !1
        }
          , _ = (S, P) => {
            const C = ["imageFit", "deletable", "reupload", "previewSize", "beforeDelete"]
              , A = We($t(t, C), $t(S, C, !0));
            return R(Nte, st({
                item: S,
                index: P,
                onClick: () => e(t.reupload ? "clickReupload" : "clickPreview", S, a(P)),
                onDelete: () => v(S, P),
                onPreview: () => p(S),
                onReupload: () => g(P)
            }, $t(t, ["name", "lazyLoad"]), A), $t(n, ["preview-cover", "preview-delete"]))
        }
          , x = () => {
            if (t.previewImage)
                return t.modelValue.map(_)
        }
          , b = S => e("clickUpload", S)
          , w = () => {
            const S = t.modelValue.length < +t.maxCount
              , P = t.readonly ? null : R("input", {
                ref: r,
                type: "file",
                class: yn("input"),
                accept: t.accept,
                capture: t.capture,
                multiple: t.multiple && o.value === -1,
                disabled: t.disabled,
                onChange: f,
                onClick: m
            }, null);
            return n.default ? di(R("div", {
                class: yn("input-wrapper"),
                onClick: b
            }, [n.default(), P]), [[pi, S]]) : di(R("div", {
                class: yn("upload", {
                    readonly: t.readonly
                }),
                style: Bl(t.previewSize),
                onClick: b
            }, [R(tn, {
                name: t.uploadIcon,
                class: yn("upload-icon")
            }, null), t.uploadText && R("span", {
                class: yn("upload-text")
            }, [t.uploadText]), P]), [[pi, t.showUpload && S]])
        }
          , E = () => {
            r.value && !t.disabled && r.value.click()
        }
        ;
        return qr( () => {
            i.forEach(S => URL.revokeObjectURL(S))
        }
        ),
        Kt({
            chooseFile: E,
            reuploadFile: g,
            closeImagePreview: y
        }),
        Dl( () => t.modelValue),
        () => R("div", {
            class: yn()
        }, [R("div", {
            class: yn("wrapper", {
                disabled: t.disabled
            })
        }, [x(), w()])])
    }
});
const G3e = De(Lte);
/*!
  * shared v11.1.11
  * (c) 2025 kazuya kawaguchi
  * Released under the MIT License.
  */
function mo(t, e) {
    typeof console < "u" && (console.warn("[intlify] " + t),
    e && console.warn(e.stack))
}
const MC = {};
function Ew(t) {
    MC[t] || (MC[t] = !0,
    mo(t))
}
const Li = typeof window < "u";
let Gr, hl;
{
    const t = Li && window.performance;
    t && t.mark && t.measure && t.clearMarks && t.clearMeasures && (Gr = e => {
        t.mark(e)
    }
    ,
    hl = (e, n, r) => {
        t.measure(e, n, r),
        t.clearMarks(n),
        t.clearMarks(r)
    }
    )
}
const $te = /\{([0-9a-zA-Z]+)\}/g;
function Ug(t, ...e) {
    return e.length === 1 && ot(e[0]) && (e = e[0]),
    (!e || !e.hasOwnProperty) && (e = {}),
    t.replace($te, (n, r) => e.hasOwnProperty(r) ? e[r] : "")
}
const Eo = (t, e=!1) => e ? Symbol.for(t) : Symbol(t)
  , Ute = (t, e, n) => Gte({
    l: t,
    k: e,
    s: n
})
  , Gte = t => JSON.stringify(t).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027")
  , un = t => typeof t == "number" && isFinite(t)
  , Hte = t => Sw(t) === "[object Date]"
  , Vc = t => Sw(t) === "[object RegExp]"
  , Gg = t => Ze(t) && Object.keys(t).length === 0
  , Sn = Object.assign
  , Vte = Object.create
  , Ct = (t=null) => Vte(t);
let DC;
const Ha = () => DC || (DC = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : Ct());
function BC(t) {
    return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/\//g, "&#x2F;").replace(/=/g, "&#x3D;")
}
function kC(t) {
    return t.replace(/&(?![a-zA-Z0-9#]{2,6};)/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
}
function zte(t) {
    return t = t.replace(/(\w+)\s*=\s*"([^"]*)"/g, (r, i, o) => `${i}="${kC(o)}"`),
    t = t.replace(/(\w+)\s*=\s*'([^']*)'/g, (r, i, o) => `${i}='${kC(o)}'`),
    /\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(t) && (mo("Potentially dangerous event handlers detected in translation. Consider removing onclick, onerror, etc. from your translation messages."),
    t = t.replace(/(\s+)(on)(\w+\s*=)/gi, "$1&#111;n$3")),
    [/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi, /(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(r => {
        t = t.replace(r, "$1javascript&#58;")
    }
    ),
    t
}
const jte = Object.prototype.hasOwnProperty;
function Mi(t, e) {
    return jte.call(t, e)
}
const Wt = Array.isArray
  , At = t => typeof t == "function"
  , Ee = t => typeof t == "string"
  , ct = t => typeof t == "boolean"
  , ot = t => t !== null && typeof t == "object"
  , Wte = t => ot(t) && At(t.then) && At(t.catch)
  , YM = Object.prototype.toString
  , Sw = t => YM.call(t)
  , Ze = t => Sw(t) === "[object Object]"
  , Yte = t => t == null ? "" : Wt(t) || Ze(t) && t.toString === YM ? JSON.stringify(t, null, 2) : String(t);
function Cw(t, e="") {
    return t.reduce( (n, r, i) => i === 0 ? n + r : n + e + r, "")
}
const NC = 2;
function Xte(t, e=0, n=t.length) {
    const r = t.split(/\r?\n/);
    let i = 0;
    const o = [];
    for (let s = 0; s < r.length; s++)
        if (i += r[s].length + 1,
        i >= e) {
            for (let a = s - NC; a <= s + NC || n > i; a++) {
                if (a < 0 || a >= r.length)
                    continue;
                const l = a + 1;
                o.push(`${l}${" ".repeat(3 - String(l).length)}|  ${r[a]}`);
                const c = r[a].length;
                if (a === s) {
                    const u = e - (i - c) + 1
                      , f = Math.max(1, n > i ? c - u : n - e);
                    o.push("   |  " + " ".repeat(u) + "^".repeat(f))
                } else if (a > s) {
                    if (n > i) {
                        const u = Math.max(Math.min(n - i, c), 1);
                        o.push("   |  " + "^".repeat(u))
                    }
                    i += c + 1
                }
            }
            break
        }
    return o.join(`
`)
}
function Aw() {
    const t = new Map;
    return {
        events: t,
        on(n, r) {
            const i = t.get(n);
            i && i.push(r) || t.set(n, [r])
        },
        off(n, r) {
            const i = t.get(n);
            i && i.splice(i.indexOf(r) >>> 0, 1)
        },
        emit(n, r) {
            (t.get(n) || []).slice().map(i => i(r)),
            (t.get("*") || []).slice().map(i => i(n, r))
        }
    }
}
const Gh = t => !ot(t) || Wt(t);
function Bp(t, e) {
    if (Gh(t) || Gh(e))
        throw new Error("Invalid value");
    const n = [{
        src: t,
        des: e
    }];
    for (; n.length; ) {
        const {src: r, des: i} = n.pop();
        Object.keys(r).forEach(o => {
            o !== "__proto__" && (ot(r[o]) && !ot(i[o]) && (i[o] = Array.isArray(r[o]) ? [] : Ct()),
            Gh(i[o]) || Gh(r[o]) ? i[o] = r[o] : n.push({
                src: r[o],
                des: i[o]
            }))
        }
        )
    }
}
/*!
  * message-compiler v11.1.11
  * (c) 2025 kazuya kawaguchi
  * Released under the MIT License.
  */
function Kte(t, e, n) {
    return {
        line: t,
        column: e,
        offset: n
    }
}
function o_(t, e, n) {
    const r = {
        start: t,
        end: e
    };
    return n != null && (r.source = n),
    r
}
const Ve = {
    EXPECTED_TOKEN: 1,
    INVALID_TOKEN_IN_PLACEHOLDER: 2,
    UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
    UNKNOWN_ESCAPE_SEQUENCE: 4,
    INVALID_UNICODE_ESCAPE_SEQUENCE: 5,
    UNBALANCED_CLOSING_BRACE: 6,
    UNTERMINATED_CLOSING_BRACE: 7,
    EMPTY_PLACEHOLDER: 8,
    NOT_ALLOW_NEST_PLACEHOLDER: 9,
    INVALID_LINKED_FORMAT: 10,
    MUST_HAVE_MESSAGES_IN_PLURAL: 11,
    UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
    UNEXPECTED_EMPTY_LINKED_KEY: 13,
    UNEXPECTED_LEXICAL_ANALYSIS: 14,
    UNHANDLED_CODEGEN_NODE_TYPE: 15,
    UNHANDLED_MINIFIER_NODE_TYPE: 16
}
  , qte = 17
  , Zte = {
    [Ve.EXPECTED_TOKEN]: "Expected token: '{0}'",
    [Ve.INVALID_TOKEN_IN_PLACEHOLDER]: "Invalid token in placeholder: '{0}'",
    [Ve.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: "Unterminated single quote in placeholder",
    [Ve.UNKNOWN_ESCAPE_SEQUENCE]: "Unknown escape sequence: \\{0}",
    [Ve.INVALID_UNICODE_ESCAPE_SEQUENCE]: "Invalid unicode escape sequence: {0}",
    [Ve.UNBALANCED_CLOSING_BRACE]: "Unbalanced closing brace",
    [Ve.UNTERMINATED_CLOSING_BRACE]: "Unterminated closing brace",
    [Ve.EMPTY_PLACEHOLDER]: "Empty placeholder",
    [Ve.NOT_ALLOW_NEST_PLACEHOLDER]: "Not allowed nest placeholder",
    [Ve.INVALID_LINKED_FORMAT]: "Invalid linked format",
    [Ve.MUST_HAVE_MESSAGES_IN_PLURAL]: "Plural must have messages",
    [Ve.UNEXPECTED_EMPTY_LINKED_MODIFIER]: "Unexpected empty linked modifier",
    [Ve.UNEXPECTED_EMPTY_LINKED_KEY]: "Unexpected empty linked key",
    [Ve.UNEXPECTED_LEXICAL_ANALYSIS]: "Unexpected lexical analysis in token: '{0}'",
    [Ve.UNHANDLED_CODEGEN_NODE_TYPE]: "unhandled codegen node type: '{0}'",
    [Ve.UNHANDLED_MINIFIER_NODE_TYPE]: "unhandled mimifier node type: '{0}'"
};
function vu(t, e, n={}) {
    const {domain: r, messages: i, args: o} = n
      , s = Ug((i || Zte)[t] || "", ...o || [])
      , a = new SyntaxError(String(s));
    return a.code = t,
    e && (a.location = e),
    a.domain = r,
    a
}
function Jte(t) {
    throw t
}
const Qte = /<\/?[\w\s="/.':;#-\/]+>/
  , ene = t => Qte.test(t)
  , Po = " "
  , tne = "\r"
  , sr = `
`
  , nne = String.fromCharCode(8232)
  , rne = String.fromCharCode(8233);
function ine(t) {
    const e = t;
    let n = 0
      , r = 1
      , i = 1
      , o = 0;
    const s = E => e[E] === tne && e[E + 1] === sr
      , a = E => e[E] === sr
      , l = E => e[E] === rne
      , c = E => e[E] === nne
      , u = E => s(E) || a(E) || l(E) || c(E)
      , f = () => n
      , d = () => r
      , h = () => i
      , p = () => o
      , y = E => s(E) || l(E) || c(E) ? sr : e[E]
      , v = () => y(n)
      , g = () => y(n + o);
    function m() {
        return o = 0,
        u(n) && (r++,
        i = 0),
        s(n) && n++,
        n++,
        i++,
        e[n]
    }
    function _() {
        return s(n + o) && o++,
        o++,
        e[n + o]
    }
    function x() {
        n = 0,
        r = 1,
        i = 1,
        o = 0
    }
    function b(E=0) {
        o = E
    }
    function w() {
        const E = n + o;
        for (; E !== n; )
            m();
        o = 0
    }
    return {
        index: f,
        line: d,
        column: h,
        peekOffset: p,
        charAt: y,
        currentChar: v,
        currentPeek: g,
        next: m,
        peek: _,
        reset: x,
        resetPeek: b,
        skipToPeek: w
    }
}
const _s = void 0
  , one = "."
  , FC = "'"
  , sne = "tokenizer";
function ane(t, e={}) {
    const n = e.location !== !1
      , r = ine(t)
      , i = () => r.index()
      , o = () => Kte(r.line(), r.column(), r.index())
      , s = o()
      , a = i()
      , l = {
        currentType: 13,
        offset: a,
        startLoc: s,
        endLoc: s,
        lastType: 13,
        lastOffset: a,
        lastStartLoc: s,
        lastEndLoc: s,
        braceNest: 0,
        inLinked: !1,
        text: ""
    }
      , c = () => l
      , {onError: u} = e;
    function f(M, k, H, ...Q) {
        const le = c();
        if (k.column += H,
        k.offset += H,
        u) {
            const ye = n ? o_(le.startLoc, k) : null
              , he = vu(M, ye, {
                domain: sne,
                args: Q
            });
            u(he)
        }
    }
    function d(M, k, H) {
        M.endLoc = o(),
        M.currentType = k;
        const Q = {
            type: k
        };
        return n && (Q.loc = o_(M.startLoc, M.endLoc)),
        H != null && (Q.value = H),
        Q
    }
    const h = M => d(M, 13);
    function p(M, k) {
        return M.currentChar() === k ? (M.next(),
        k) : (f(Ve.EXPECTED_TOKEN, o(), 0, k),
        "")
    }
    function y(M) {
        let k = "";
        for (; M.currentPeek() === Po || M.currentPeek() === sr; )
            k += M.currentPeek(),
            M.peek();
        return k
    }
    function v(M) {
        const k = y(M);
        return M.skipToPeek(),
        k
    }
    function g(M) {
        if (M === _s)
            return !1;
        const k = M.charCodeAt(0);
        return k >= 97 && k <= 122 || k >= 65 && k <= 90 || k === 95
    }
    function m(M) {
        if (M === _s)
            return !1;
        const k = M.charCodeAt(0);
        return k >= 48 && k <= 57
    }
    function _(M, k) {
        const {currentType: H} = k;
        if (H !== 2)
            return !1;
        y(M);
        const Q = g(M.currentPeek());
        return M.resetPeek(),
        Q
    }
    function x(M, k) {
        const {currentType: H} = k;
        if (H !== 2)
            return !1;
        y(M);
        const Q = M.currentPeek() === "-" ? M.peek() : M.currentPeek()
          , le = m(Q);
        return M.resetPeek(),
        le
    }
    function b(M, k) {
        const {currentType: H} = k;
        if (H !== 2)
            return !1;
        y(M);
        const Q = M.currentPeek() === FC;
        return M.resetPeek(),
        Q
    }
    function w(M, k) {
        const {currentType: H} = k;
        if (H !== 7)
            return !1;
        y(M);
        const Q = M.currentPeek() === ".";
        return M.resetPeek(),
        Q
    }
    function E(M, k) {
        const {currentType: H} = k;
        if (H !== 8)
            return !1;
        y(M);
        const Q = g(M.currentPeek());
        return M.resetPeek(),
        Q
    }
    function S(M, k) {
        const {currentType: H} = k;
        if (!(H === 7 || H === 11))
            return !1;
        y(M);
        const Q = M.currentPeek() === ":";
        return M.resetPeek(),
        Q
    }
    function P(M, k) {
        const {currentType: H} = k;
        if (H !== 9)
            return !1;
        const Q = () => {
            const ye = M.currentPeek();
            return ye === "{" ? g(M.peek()) : ye === "@" || ye === "|" || ye === ":" || ye === "." || ye === Po || !ye ? !1 : ye === sr ? (M.peek(),
            Q()) : A(M, !1)
        }
          , le = Q();
        return M.resetPeek(),
        le
    }
    function C(M) {
        y(M);
        const k = M.currentPeek() === "|";
        return M.resetPeek(),
        k
    }
    function A(M, k=!0) {
        const H = (le=!1, ye="") => {
            const he = M.currentPeek();
            return he === "{" || he === "@" || !he ? le : he === "|" ? !(ye === Po || ye === sr) : he === Po ? (M.peek(),
            H(!0, Po)) : he === sr ? (M.peek(),
            H(!0, sr)) : !0
        }
          , Q = H();
        return k && M.resetPeek(),
        Q
    }
    function T(M, k) {
        const H = M.currentChar();
        return H === _s ? _s : k(H) ? (M.next(),
        H) : null
    }
    function I(M) {
        const k = M.charCodeAt(0);
        return k >= 97 && k <= 122 || k >= 65 && k <= 90 || k >= 48 && k <= 57 || k === 95 || k === 36
    }
    function B(M) {
        return T(M, I)
    }
    function G(M) {
        const k = M.charCodeAt(0);
        return k >= 97 && k <= 122 || k >= 65 && k <= 90 || k >= 48 && k <= 57 || k === 95 || k === 36 || k === 45
    }
    function N(M) {
        return T(M, G)
    }
    function U(M) {
        const k = M.charCodeAt(0);
        return k >= 48 && k <= 57
    }
    function W(M) {
        return T(M, U)
    }
    function K(M) {
        const k = M.charCodeAt(0);
        return k >= 48 && k <= 57 || k >= 65 && k <= 70 || k >= 97 && k <= 102
    }
    function fe(M) {
        return T(M, K)
    }
    function ue(M) {
        let k = ""
          , H = "";
        for (; k = W(M); )
            H += k;
        return H
    }
    function X(M) {
        let k = "";
        for (; ; ) {
            const H = M.currentChar();
            if (H === "{" || H === "}" || H === "@" || H === "|" || !H)
                break;
            if (H === Po || H === sr)
                if (A(M))
                    k += H,
                    M.next();
                else {
                    if (C(M))
                        break;
                    k += H,
                    M.next()
                }
            else
                k += H,
                M.next()
        }
        return k
    }
    function ie(M) {
        v(M);
        let k = ""
          , H = "";
        for (; k = N(M); )
            H += k;
        return M.currentChar() === _s && f(Ve.UNTERMINATED_CLOSING_BRACE, o(), 0),
        H
    }
    function ge(M) {
        v(M);
        let k = "";
        return M.currentChar() === "-" ? (M.next(),
        k += `-${ue(M)}`) : k += ue(M),
        M.currentChar() === _s && f(Ve.UNTERMINATED_CLOSING_BRACE, o(), 0),
        k
    }
    function F(M) {
        return M !== FC && M !== sr
    }
    function q(M) {
        v(M),
        p(M, "'");
        let k = ""
          , H = "";
        for (; k = T(M, F); )
            k === "\\" ? H += L(M) : H += k;
        const Q = M.currentChar();
        return Q === sr || Q === _s ? (f(Ve.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, o(), 0),
        Q === sr && (M.next(),
        p(M, "'")),
        H) : (p(M, "'"),
        H)
    }
    function L(M) {
        const k = M.currentChar();
        switch (k) {
        case "\\":
        case "'":
            return M.next(),
            `\\${k}`;
        case "u":
            return ee(M, k, 4);
        case "U":
            return ee(M, k, 6);
        default:
            return f(Ve.UNKNOWN_ESCAPE_SEQUENCE, o(), 0, k),
            ""
        }
    }
    function ee(M, k, H) {
        p(M, k);
        let Q = "";
        for (let le = 0; le < H; le++) {
            const ye = fe(M);
            if (!ye) {
                f(Ve.INVALID_UNICODE_ESCAPE_SEQUENCE, o(), 0, `\\${k}${Q}${M.currentChar()}`);
                break
            }
            Q += ye
        }
        return `\\${k}${Q}`
    }
    function J(M) {
        return M !== "{" && M !== "}" && M !== Po && M !== sr
    }
    function de(M) {
        v(M);
        let k = ""
          , H = "";
        for (; k = T(M, J); )
            H += k;
        return H
    }
    function pe(M) {
        let k = ""
          , H = "";
        for (; k = B(M); )
            H += k;
        return H
    }
    function xe(M) {
        const k = H => {
            const Q = M.currentChar();
            return Q === "{" || Q === "@" || Q === "|" || Q === "(" || Q === ")" || !Q || Q === Po ? H : (H += Q,
            M.next(),
            k(H))
        }
        ;
        return k("")
    }
    function O(M) {
        v(M);
        const k = p(M, "|");
        return v(M),
        k
    }
    function $(M, k) {
        let H = null;
        switch (M.currentChar()) {
        case "{":
            return k.braceNest >= 1 && f(Ve.NOT_ALLOW_NEST_PLACEHOLDER, o(), 0),
            M.next(),
            H = d(k, 2, "{"),
            v(M),
            k.braceNest++,
            H;
        case "}":
            return k.braceNest > 0 && k.currentType === 2 && f(Ve.EMPTY_PLACEHOLDER, o(), 0),
            M.next(),
            H = d(k, 3, "}"),
            k.braceNest--,
            k.braceNest > 0 && v(M),
            k.inLinked && k.braceNest === 0 && (k.inLinked = !1),
            H;
        case "@":
            return k.braceNest > 0 && f(Ve.UNTERMINATED_CLOSING_BRACE, o(), 0),
            H = j(M, k) || h(k),
            k.braceNest = 0,
            H;
        default:
            {
                let le = !0
                  , ye = !0
                  , he = !0;
                if (C(M))
                    return k.braceNest > 0 && f(Ve.UNTERMINATED_CLOSING_BRACE, o(), 0),
                    H = d(k, 1, O(M)),
                    k.braceNest = 0,
                    k.inLinked = !1,
                    H;
                if (k.braceNest > 0 && (k.currentType === 4 || k.currentType === 5 || k.currentType === 6))
                    return f(Ve.UNTERMINATED_CLOSING_BRACE, o(), 0),
                    k.braceNest = 0,
                    ae(M, k);
                if (le = _(M, k))
                    return H = d(k, 4, ie(M)),
                    v(M),
                    H;
                if (ye = x(M, k))
                    return H = d(k, 5, ge(M)),
                    v(M),
                    H;
                if (he = b(M, k))
                    return H = d(k, 6, q(M)),
                    v(M),
                    H;
                if (!le && !ye && !he)
                    return H = d(k, 12, de(M)),
                    f(Ve.INVALID_TOKEN_IN_PLACEHOLDER, o(), 0, H.value),
                    v(M),
                    H;
                break
            }
        }
        return H
    }
    function j(M, k) {
        const {currentType: H} = k;
        let Q = null;
        const le = M.currentChar();
        switch ((H === 7 || H === 8 || H === 11 || H === 9) && (le === sr || le === Po) && f(Ve.INVALID_LINKED_FORMAT, o(), 0),
        le) {
        case "@":
            return M.next(),
            Q = d(k, 7, "@"),
            k.inLinked = !0,
            Q;
        case ".":
            return v(M),
            M.next(),
            d(k, 8, ".");
        case ":":
            return v(M),
            M.next(),
            d(k, 9, ":");
        default:
            return C(M) ? (Q = d(k, 1, O(M)),
            k.braceNest = 0,
            k.inLinked = !1,
            Q) : w(M, k) || S(M, k) ? (v(M),
            j(M, k)) : E(M, k) ? (v(M),
            d(k, 11, pe(M))) : P(M, k) ? (v(M),
            le === "{" ? $(M, k) || Q : d(k, 10, xe(M))) : (H === 7 && f(Ve.INVALID_LINKED_FORMAT, o(), 0),
            k.braceNest = 0,
            k.inLinked = !1,
            ae(M, k))
        }
    }
    function ae(M, k) {
        let H = {
            type: 13
        };
        if (k.braceNest > 0)
            return $(M, k) || h(k);
        if (k.inLinked)
            return j(M, k) || h(k);
        switch (M.currentChar()) {
        case "{":
            return $(M, k) || h(k);
        case "}":
            return f(Ve.UNBALANCED_CLOSING_BRACE, o(), 0),
            M.next(),
            d(k, 3, "}");
        case "@":
            return j(M, k) || h(k);
        default:
            {
                if (C(M))
                    return H = d(k, 1, O(M)),
                    k.braceNest = 0,
                    k.inLinked = !1,
                    H;
                if (A(M))
                    return d(k, 0, X(M));
                break
            }
        }
        return H
    }
    function ce() {
        const {currentType: M, offset: k, startLoc: H, endLoc: Q} = l;
        return l.lastType = M,
        l.lastOffset = k,
        l.lastStartLoc = H,
        l.lastEndLoc = Q,
        l.offset = i(),
        l.startLoc = o(),
        r.currentChar() === _s ? d(l, 13) : ae(r, l)
    }
    return {
        nextToken: ce,
        currentOffset: i,
        currentPosition: o,
        context: c
    }
}
const lne = "parser"
  , cne = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;
function une(t, e, n) {
    switch (t) {
    case "\\\\":
        return "\\";
    case "\\'":
        return "'";
    default:
        {
            const r = parseInt(e || n, 16);
            return r <= 55295 || r >= 57344 ? String.fromCodePoint(r) : "�"
        }
    }
}
function fne(t={}) {
    const e = t.location !== !1
      , {onError: n} = t;
    function r(g, m, _, x, ...b) {
        const w = g.currentPosition();
        if (w.offset += x,
        w.column += x,
        n) {
            const E = e ? o_(_, w) : null
              , S = vu(m, E, {
                domain: lne,
                args: b
            });
            n(S)
        }
    }
    function i(g, m, _) {
        const x = {
            type: g
        };
        return e && (x.start = m,
        x.end = m,
        x.loc = {
            start: _,
            end: _
        }),
        x
    }
    function o(g, m, _, x) {
        e && (g.end = m,
        g.loc && (g.loc.end = _))
    }
    function s(g, m) {
        const _ = g.context()
          , x = i(3, _.offset, _.startLoc);
        return x.value = m,
        o(x, g.currentOffset(), g.currentPosition()),
        x
    }
    function a(g, m) {
        const _ = g.context()
          , {lastOffset: x, lastStartLoc: b} = _
          , w = i(5, x, b);
        return w.index = parseInt(m, 10),
        g.nextToken(),
        o(w, g.currentOffset(), g.currentPosition()),
        w
    }
    function l(g, m) {
        const _ = g.context()
          , {lastOffset: x, lastStartLoc: b} = _
          , w = i(4, x, b);
        return w.key = m,
        g.nextToken(),
        o(w, g.currentOffset(), g.currentPosition()),
        w
    }
    function c(g, m) {
        const _ = g.context()
          , {lastOffset: x, lastStartLoc: b} = _
          , w = i(9, x, b);
        return w.value = m.replace(cne, une),
        g.nextToken(),
        o(w, g.currentOffset(), g.currentPosition()),
        w
    }
    function u(g) {
        const m = g.nextToken()
          , _ = g.context()
          , {lastOffset: x, lastStartLoc: b} = _
          , w = i(8, x, b);
        return m.type !== 11 ? (r(g, Ve.UNEXPECTED_EMPTY_LINKED_MODIFIER, _.lastStartLoc, 0),
        w.value = "",
        o(w, x, b),
        {
            nextConsumeToken: m,
            node: w
        }) : (m.value == null && r(g, Ve.UNEXPECTED_LEXICAL_ANALYSIS, _.lastStartLoc, 0, ji(m)),
        w.value = m.value || "",
        o(w, g.currentOffset(), g.currentPosition()),
        {
            node: w
        })
    }
    function f(g, m) {
        const _ = g.context()
          , x = i(7, _.offset, _.startLoc);
        return x.value = m,
        o(x, g.currentOffset(), g.currentPosition()),
        x
    }
    function d(g) {
        const m = g.context()
          , _ = i(6, m.offset, m.startLoc);
        let x = g.nextToken();
        if (x.type === 8) {
            const b = u(g);
            _.modifier = b.node,
            x = b.nextConsumeToken || g.nextToken()
        }
        switch (x.type !== 9 && r(g, Ve.UNEXPECTED_LEXICAL_ANALYSIS, m.lastStartLoc, 0, ji(x)),
        x = g.nextToken(),
        x.type === 2 && (x = g.nextToken()),
        x.type) {
        case 10:
            x.value == null && r(g, Ve.UNEXPECTED_LEXICAL_ANALYSIS, m.lastStartLoc, 0, ji(x)),
            _.key = f(g, x.value || "");
            break;
        case 4:
            x.value == null && r(g, Ve.UNEXPECTED_LEXICAL_ANALYSIS, m.lastStartLoc, 0, ji(x)),
            _.key = l(g, x.value || "");
            break;
        case 5:
            x.value == null && r(g, Ve.UNEXPECTED_LEXICAL_ANALYSIS, m.lastStartLoc, 0, ji(x)),
            _.key = a(g, x.value || "");
            break;
        case 6:
            x.value == null && r(g, Ve.UNEXPECTED_LEXICAL_ANALYSIS, m.lastStartLoc, 0, ji(x)),
            _.key = c(g, x.value || "");
            break;
        default:
            {
                r(g, Ve.UNEXPECTED_EMPTY_LINKED_KEY, m.lastStartLoc, 0);
                const b = g.context()
                  , w = i(7, b.offset, b.startLoc);
                return w.value = "",
                o(w, b.offset, b.startLoc),
                _.key = w,
                o(_, b.offset, b.startLoc),
                {
                    nextConsumeToken: x,
                    node: _
                }
            }
        }
        return o(_, g.currentOffset(), g.currentPosition()),
        {
            node: _
        }
    }
    function h(g) {
        const m = g.context()
          , _ = m.currentType === 1 ? g.currentOffset() : m.offset
          , x = m.currentType === 1 ? m.endLoc : m.startLoc
          , b = i(2, _, x);
        b.items = [];
        let w = null;
        do {
            const P = w || g.nextToken();
            switch (w = null,
            P.type) {
            case 0:
                P.value == null && r(g, Ve.UNEXPECTED_LEXICAL_ANALYSIS, m.lastStartLoc, 0, ji(P)),
                b.items.push(s(g, P.value || ""));
                break;
            case 5:
                P.value == null && r(g, Ve.UNEXPECTED_LEXICAL_ANALYSIS, m.lastStartLoc, 0, ji(P)),
                b.items.push(a(g, P.value || ""));
                break;
            case 4:
                P.value == null && r(g, Ve.UNEXPECTED_LEXICAL_ANALYSIS, m.lastStartLoc, 0, ji(P)),
                b.items.push(l(g, P.value || ""));
                break;
            case 6:
                P.value == null && r(g, Ve.UNEXPECTED_LEXICAL_ANALYSIS, m.lastStartLoc, 0, ji(P)),
                b.items.push(c(g, P.value || ""));
                break;
            case 7:
                {
                    const C = d(g);
                    b.items.push(C.node),
                    w = C.nextConsumeToken || null;
                    break
                }
            }
        } while (m.currentType !== 13 && m.currentType !== 1);
        const E = m.currentType === 1 ? m.lastOffset : g.currentOffset()
          , S = m.currentType === 1 ? m.lastEndLoc : g.currentPosition();
        return o(b, E, S),
        b
    }
    function p(g, m, _, x) {
        const b = g.context();
        let w = x.items.length === 0;
        const E = i(1, m, _);
        E.cases = [],
        E.cases.push(x);
        do {
            const S = h(g);
            w || (w = S.items.length === 0),
            E.cases.push(S)
        } while (b.currentType !== 13);
        return w && r(g, Ve.MUST_HAVE_MESSAGES_IN_PLURAL, _, 0),
        o(E, g.currentOffset(), g.currentPosition()),
        E
    }
    function y(g) {
        const m = g.context()
          , {offset: _, startLoc: x} = m
          , b = h(g);
        return m.currentType === 13 ? b : p(g, _, x, b)
    }
    function v(g) {
        const m = ane(g, Sn({}, t))
          , _ = m.context()
          , x = i(0, _.offset, _.startLoc);
        return e && x.loc && (x.loc.source = g),
        x.body = y(m),
        t.onCacheKey && (x.cacheKey = t.onCacheKey(g)),
        _.currentType !== 13 && r(m, Ve.UNEXPECTED_LEXICAL_ANALYSIS, _.lastStartLoc, 0, g[_.offset] || ""),
        o(x, m.currentOffset(), m.currentPosition()),
        x
    }
    return {
        parse: v
    }
}
function ji(t) {
    if (t.type === 13)
        return "EOF";
    const e = (t.value || "").replace(/\r?\n/gu, "\\n");
    return e.length > 10 ? e.slice(0, 9) + "…" : e
}
function dne(t, e={}) {
    const n = {
        ast: t,
        helpers: new Set
    };
    return {
        context: () => n,
        helper: o => (n.helpers.add(o),
        o)
    }
}
function LC(t, e) {
    for (let n = 0; n < t.length; n++)
        Tw(t[n], e)
}
function Tw(t, e) {
    switch (t.type) {
    case 1:
        LC(t.cases, e),
        e.helper("plural");
        break;
    case 2:
        LC(t.items, e);
        break;
    case 6:
        {
            Tw(t.key, e),
            e.helper("linked"),
            e.helper("type");
            break
        }
    case 5:
        e.helper("interpolate"),
        e.helper("list");
        break;
    case 4:
        e.helper("interpolate"),
        e.helper("named");
        break
    }
}
function hne(t, e={}) {
    const n = dne(t);
    n.helper("normalize"),
    t.body && Tw(t.body, n);
    const r = n.context();
    t.helpers = Array.from(r.helpers)
}
function pne(t) {
    const e = t.body;
    return e.type === 2 ? $C(e) : e.cases.forEach(n => $C(n)),
    t
}
function $C(t) {
    if (t.items.length === 1) {
        const e = t.items[0];
        (e.type === 3 || e.type === 9) && (t.static = e.value,
        delete e.value)
    } else {
        const e = [];
        for (let n = 0; n < t.items.length; n++) {
            const r = t.items[n];
            if (!(r.type === 3 || r.type === 9) || r.value == null)
                break;
            e.push(r.value)
        }
        if (e.length === t.items.length) {
            t.static = Cw(e);
            for (let n = 0; n < t.items.length; n++) {
                const r = t.items[n];
                (r.type === 3 || r.type === 9) && delete r.value
            }
        }
    }
}
const gne = "minifier";
function fc(t) {
    switch (t.t = t.type,
    t.type) {
    case 0:
        {
            const e = t;
            fc(e.body),
            e.b = e.body,
            delete e.body;
            break
        }
    case 1:
        {
            const e = t
              , n = e.cases;
            for (let r = 0; r < n.length; r++)
                fc(n[r]);
            e.c = n,
            delete e.cases;
            break
        }
    case 2:
        {
            const e = t
              , n = e.items;
            for (let r = 0; r < n.length; r++)
                fc(n[r]);
            e.i = n,
            delete e.items,
            e.static && (e.s = e.static,
            delete e.static);
            break
        }
    case 3:
    case 9:
    case 8:
    case 7:
        {
            const e = t;
            e.value && (e.v = e.value,
            delete e.value);
            break
        }
    case 6:
        {
            const e = t;
            fc(e.key),
            e.k = e.key,
            delete e.key,
            e.modifier && (fc(e.modifier),
            e.m = e.modifier,
            delete e.modifier);
            break
        }
    case 5:
        {
            const e = t;
            e.i = e.index,
            delete e.index;
            break
        }
    case 4:
        {
            const e = t;
            e.k = e.key,
            delete e.key;
            break
        }
    default:
        throw vu(Ve.UNHANDLED_MINIFIER_NODE_TYPE, null, {
            domain: gne,
            args: [t.type]
        })
    }
    delete t.type
}
const mne = "parser";
function vne(t, e) {
    const {sourceMap: n, filename: r, breakLineCode: i, needIndent: o} = e
      , s = e.location !== !1
      , a = {
        filename: r,
        code: "",
        column: 1,
        line: 1,
        offset: 0,
        map: void 0,
        breakLineCode: i,
        needIndent: o,
        indentLevel: 0
    };
    s && t.loc && (a.source = t.loc.source);
    const l = () => a;
    function c(v, g) {
        a.code += v
    }
    function u(v, g=!0) {
        const m = g ? i : "";
        c(o ? m + "  ".repeat(v) : m)
    }
    function f(v=!0) {
        const g = ++a.indentLevel;
        v && u(g)
    }
    function d(v=!0) {
        const g = --a.indentLevel;
        v && u(g)
    }
    function h() {
        u(a.indentLevel)
    }
    return {
        context: l,
        push: c,
        indent: f,
        deindent: d,
        newline: h,
        helper: v => `_${v}`,
        needIndent: () => a.needIndent
    }
}
function yne(t, e) {
    const {helper: n} = t;
    t.push(`${n("linked")}(`),
    zc(t, e.key),
    e.modifier ? (t.push(", "),
    zc(t, e.modifier),
    t.push(", _type")) : t.push(", undefined, _type"),
    t.push(")")
}
function _ne(t, e) {
    const {helper: n, needIndent: r} = t;
    t.push(`${n("normalize")}([`),
    t.indent(r());
    const i = e.items.length;
    for (let o = 0; o < i && (zc(t, e.items[o]),
    o !== i - 1); o++)
        t.push(", ");
    t.deindent(r()),
    t.push("])")
}
function xne(t, e) {
    const {helper: n, needIndent: r} = t;
    if (e.cases.length > 1) {
        t.push(`${n("plural")}([`),
        t.indent(r());
        const i = e.cases.length;
        for (let o = 0; o < i && (zc(t, e.cases[o]),
        o !== i - 1); o++)
            t.push(", ");
        t.deindent(r()),
        t.push("])")
    }
}
function bne(t, e) {
    e.body ? zc(t, e.body) : t.push("null")
}
function zc(t, e) {
    const {helper: n} = t;
    switch (e.type) {
    case 0:
        bne(t, e);
        break;
    case 1:
        xne(t, e);
        break;
    case 2:
        _ne(t, e);
        break;
    case 6:
        yne(t, e);
        break;
    case 8:
        t.push(JSON.stringify(e.value), e);
        break;
    case 7:
        t.push(JSON.stringify(e.value), e);
        break;
    case 5:
        t.push(`${n("interpolate")}(${n("list")}(${e.index}))`, e);
        break;
    case 4:
        t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`, e);
        break;
    case 9:
        t.push(JSON.stringify(e.value), e);
        break;
    case 3:
        t.push(JSON.stringify(e.value), e);
        break;
    default:
        throw vu(Ve.UNHANDLED_CODEGEN_NODE_TYPE, null, {
            domain: mne,
            args: [e.type]
        })
    }
}
const wne = (t, e={}) => {
    const n = Ee(e.mode) ? e.mode : "normal"
      , r = Ee(e.filename) ? e.filename : "message.intl"
      , i = !!e.sourceMap
      , o = e.breakLineCode != null ? e.breakLineCode : n === "arrow" ? ";" : `
`
      , s = e.needIndent ? e.needIndent : n !== "arrow"
      , a = t.helpers || []
      , l = vne(t, {
        mode: n,
        filename: r,
        sourceMap: i,
        breakLineCode: o,
        needIndent: s
    });
    l.push(n === "normal" ? "function __msg__ (ctx) {" : "(ctx) => {"),
    l.indent(s),
    a.length > 0 && (l.push(`const { ${Cw(a.map(f => `${f}: _${f}`), ", ")} } = ctx`),
    l.newline()),
    l.push("return "),
    zc(l, t),
    l.deindent(s),
    l.push("}"),
    delete t.helpers;
    const {code: c, map: u} = l.context();
    return {
        ast: t,
        code: c,
        map: u ? u.toJSON() : void 0
    }
}
;
function Ene(t, e={}) {
    const n = Sn({}, e)
      , r = !!n.jit
      , i = !!n.minify
      , o = n.optimize == null ? !0 : n.optimize
      , a = fne(n).parse(t);
    return r ? (o && pne(a),
    i && fc(a),
    {
        ast: a,
        code: ""
    }) : (hne(a, n),
    wne(a, n))
}
/*!
  * core-base v11.1.11
  * (c) 2025 kazuya kawaguchi
  * Released under the MIT License.
  */
function Sne() {
    typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (Ha().__INTLIFY_PROD_DEVTOOLS__ = !1),
    typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (Ha().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1)
}
function gi(t) {
    return ot(t) && Pw(t) === 0 && (Mi(t, "b") || Mi(t, "body"))
}
const XM = ["b", "body"];
function Cne(t) {
    return fa(t, XM)
}
const KM = ["c", "cases"];
function Ane(t) {
    return fa(t, KM, [])
}
const qM = ["s", "static"];
function Tne(t) {
    return fa(t, qM)
}
const ZM = ["i", "items"];
function Pne(t) {
    return fa(t, ZM, [])
}
const JM = ["t", "type"];
function Pw(t) {
    return fa(t, JM)
}
const QM = ["v", "value"];
function Hh(t, e) {
    const n = fa(t, QM);
    if (n != null)
        return n;
    throw nd(e)
}
const e6 = ["m", "modifier"];
function Ine(t) {
    return fa(t, e6)
}
const t6 = ["k", "key"];
function One(t) {
    const e = fa(t, t6);
    if (e)
        return e;
    throw nd(6)
}
function fa(t, e, n) {
    for (let r = 0; r < e.length; r++) {
        const i = e[r];
        if (Mi(t, i) && t[i] != null)
            return t[i]
    }
    return n
}
const n6 = [...XM, ...KM, ...qM, ...ZM, ...t6, ...e6, ...QM, ...JM];
function nd(t) {
    return new Error(`unhandled node type: ${t}`)
}
function Qm(t) {
    return n => Rne(n, t)
}
function Rne(t, e) {
    const n = Cne(e);
    if (n == null)
        throw nd(0);
    if (Pw(n) === 1) {
        const o = Ane(n);
        return t.plural(o.reduce( (s, a) => [...s, UC(t, a)], []))
    } else
        return UC(t, n)
}
function UC(t, e) {
    const n = Tne(e);
    if (n != null)
        return t.type === "text" ? n : t.normalize([n]);
    {
        const r = Pne(e).reduce( (i, o) => [...i, s_(t, o)], []);
        return t.normalize(r)
    }
}
function s_(t, e) {
    const n = Pw(e);
    switch (n) {
    case 3:
        return Hh(e, n);
    case 9:
        return Hh(e, n);
    case 4:
        {
            const r = e;
            if (Mi(r, "k") && r.k)
                return t.interpolate(t.named(r.k));
            if (Mi(r, "key") && r.key)
                return t.interpolate(t.named(r.key));
            throw nd(n)
        }
    case 5:
        {
            const r = e;
            if (Mi(r, "i") && un(r.i))
                return t.interpolate(t.list(r.i));
            if (Mi(r, "index") && un(r.index))
                return t.interpolate(t.list(r.index));
            throw nd(n)
        }
    case 6:
        {
            const r = e
              , i = Ine(r)
              , o = One(r);
            return t.linked(s_(t, o), i ? s_(t, i) : void 0, t.type)
        }
    case 7:
        return Hh(e, n);
    case 8:
        return Hh(e, n);
    default:
        throw new Error(`unhandled node on format message part: ${n}`)
    }
}
const Mne = "Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";
function Dne(t, e) {
    e && ene(t) && mo(Ug(Mne, {
        source: t
    }))
}
const Bne = t => t;
let Vh = Ct();
function kne(t, e={}) {
    let n = !1;
    const r = e.onError || Jte;
    return e.onError = i => {
        n = !0,
        r(i)
    }
    ,
    {
        ...Ene(t, e),
        detectError: n
    }
}
function Nne(t, e) {
    if (!__INTLIFY_DROP_MESSAGE_COMPILER__ && Ee(t)) {
        const n = ct(e.warnHtmlMessage) ? e.warnHtmlMessage : !0;
        Dne(t, n);
        const i = (e.onCacheKey || Bne)(t)
          , o = Vh[i];
        if (o)
            return o;
        const {ast: s, detectError: a} = kne(t, {
            ...e,
            location: !0,
            jit: !0
        })
          , l = Qm(s);
        return a ? l : Vh[i] = l
    } else {
        if (!gi(t))
            return mo(`the message that is resolve with key '${e.key}' is not supported for jit compilation`),
            () => t;
        const n = t.cacheKey;
        if (n) {
            const r = Vh[n];
            return r || (Vh[n] = Qm(t))
        } else
            return Qm(t)
    }
}
let rd = null;
function Fne(t) {
    rd = t
}
function Lne(t, e, n) {
    rd && rd.emit("i18n:init", {
        timestamp: Date.now(),
        i18n: t,
        version: e,
        meta: n
    })
}
const $ne = Une("function:translate");
function Une(t) {
    return e => rd && rd.emit(t, e)
}
const Xn = {
    INVALID_ARGUMENT: qte,
    INVALID_DATE_ARGUMENT: 18,
    INVALID_ISO_DATE_ARGUMENT: 19,
    NOT_SUPPORT_NON_STRING_MESSAGE: 20,
    NOT_SUPPORT_LOCALE_PROMISE_VALUE: 21,
    NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 22,
    NOT_SUPPORT_LOCALE_TYPE: 23
}
  , Gne = 24;
function zo(t) {
    return vu(t, null, {
        messages: Hne
    })
}
const Hne = {
    [Xn.INVALID_ARGUMENT]: "Invalid arguments",
    [Xn.INVALID_DATE_ARGUMENT]: "The date provided is an invalid Date object.Make sure your Date represents a valid date.",
    [Xn.INVALID_ISO_DATE_ARGUMENT]: "The argument provided is not a valid ISO date string",
    [Xn.NOT_SUPPORT_NON_STRING_MESSAGE]: "Not support non-string message",
    [Xn.NOT_SUPPORT_LOCALE_PROMISE_VALUE]: "cannot support promise value",
    [Xn.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]: "cannot support async function",
    [Xn.NOT_SUPPORT_LOCALE_TYPE]: "cannot support locale type"
};
function Iw(t, e) {
    return e.locale != null ? GC(e.locale) : GC(t.locale)
}
let e1;
function GC(t) {
    if (Ee(t))
        return t;
    if (At(t)) {
        if (t.resolvedOnce && e1 != null)
            return e1;
        if (t.constructor.name === "Function") {
            const e = t();
            if (Wte(e))
                throw zo(Xn.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
            return e1 = e
        } else
            throw zo(Xn.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)
    } else
        throw zo(Xn.NOT_SUPPORT_LOCALE_TYPE)
}
function Vne(t, e, n) {
    return [...new Set([n, ...Wt(e) ? e : ot(e) ? Object.keys(e) : Ee(e) ? [e] : [n]])]
}
function r6(t, e, n) {
    const r = Ee(n) ? n : id
      , i = t;
    i.__localeChainCache || (i.__localeChainCache = new Map);
    let o = i.__localeChainCache.get(r);
    if (!o) {
        o = [];
        let s = [n];
        for (; Wt(s); )
            s = HC(o, s, e);
        const a = Wt(e) || !Ze(e) ? e : e.default ? e.default : null;
        s = Ee(a) ? [a] : a,
        Wt(s) && HC(o, s, !1),
        i.__localeChainCache.set(r, o)
    }
    return o
}
function HC(t, e, n) {
    let r = !0;
    for (let i = 0; i < e.length && ct(r); i++) {
        const o = e[i];
        Ee(o) && (r = zne(t, e[i], n))
    }
    return r
}
function zne(t, e, n) {
    let r;
    const i = e.split("-");
    do {
        const o = i.join("-");
        r = jne(t, o, n),
        i.splice(-1, 1)
    } while (i.length && r === !0);
    return r
}
function jne(t, e, n) {
    let r = !1;
    if (!t.includes(e) && (r = !0,
    e)) {
        r = e[e.length - 1] !== "!";
        const i = e.replace(/!/g, "");
        t.push(i),
        (Wt(n) || Ze(n)) && n[i] && (r = n[i])
    }
    return r
}
const da = [];
da[0] = {
    w: [0],
    i: [3, 0],
    "[": [4],
    o: [7]
};
da[1] = {
    w: [1],
    ".": [2],
    "[": [4],
    o: [7]
};
da[2] = {
    w: [2],
    i: [3, 0],
    0: [3, 0]
};
da[3] = {
    i: [3, 0],
    0: [3, 0],
    w: [1, 1],
    ".": [2, 1],
    "[": [4, 1],
    o: [7, 1]
};
da[4] = {
    "'": [5, 0],
    '"': [6, 0],
    "[": [4, 2],
    "]": [1, 3],
    o: 8,
    l: [4, 0]
};
da[5] = {
    "'": [4, 0],
    o: 8,
    l: [5, 0]
};
da[6] = {
    '"': [4, 0],
    o: 8,
    l: [6, 0]
};
const Wne = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
function Yne(t) {
    return Wne.test(t)
}
function Xne(t) {
    const e = t.charCodeAt(0)
      , n = t.charCodeAt(t.length - 1);
    return e === n && (e === 34 || e === 39) ? t.slice(1, -1) : t
}
function Kne(t) {
    if (t == null)
        return "o";
    switch (t.charCodeAt(0)) {
    case 91:
    case 93:
    case 46:
    case 34:
    case 39:
        return t;
    case 95:
    case 36:
    case 45:
        return "i";
    case 9:
    case 10:
    case 13:
    case 160:
    case 65279:
    case 8232:
    case 8233:
        return "w"
    }
    return "i"
}
function qne(t) {
    const e = t.trim();
    return t.charAt(0) === "0" && isNaN(parseInt(t)) ? !1 : Yne(e) ? Xne(e) : "*" + e
}
function Zne(t) {
    const e = [];
    let n = -1, r = 0, i = 0, o, s, a, l, c, u, f;
    const d = [];
    d[0] = () => {
        s === void 0 ? s = a : s += a
    }
    ,
    d[1] = () => {
        s !== void 0 && (e.push(s),
        s = void 0)
    }
    ,
    d[2] = () => {
        d[0](),
        i++
    }
    ,
    d[3] = () => {
        if (i > 0)
            i--,
            r = 4,
            d[0]();
        else {
            if (i = 0,
            s === void 0 || (s = qne(s),
            s === !1))
                return !1;
            d[1]()
        }
    }
    ;
    function h() {
        const p = t[n + 1];
        if (r === 5 && p === "'" || r === 6 && p === '"')
            return n++,
            a = "\\" + p,
            d[0](),
            !0
    }
    for (; r !== null; )
        if (n++,
        o = t[n],
        !(o === "\\" && h())) {
            if (l = Kne(o),
            f = da[r],
            c = f[l] || f.l || 8,
            c === 8 || (r = c[0],
            c[1] !== void 0 && (u = d[c[1]],
            u && (a = o,
            u() === !1))))
                return;
            if (r === 7)
                return e
        }
}
const VC = new Map;
function Jne(t, e) {
    return ot(t) ? t[e] : null
}
function Qne(t, e) {
    if (!ot(t))
        return null;
    let n = VC.get(e);
    if (n || (n = Zne(e),
    n && VC.set(e, n)),
    !n)
        return null;
    const r = n.length;
    let i = t
      , o = 0;
    for (; o < r; ) {
        const s = n[o];
        if (n6.includes(s) && gi(i))
            return null;
        const a = i[s];
        if (a === void 0 || At(i))
            return null;
        i = a,
        o++
    }
    return i
}
const br = {
    NOT_FOUND_KEY: 1,
    FALLBACK_TO_TRANSLATE: 2,
    CANNOT_FORMAT_NUMBER: 3,
    FALLBACK_TO_NUMBER_FORMAT: 4,
    CANNOT_FORMAT_DATE: 5,
    FALLBACK_TO_DATE_FORMAT: 6,
    EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: 7
}
  , ere = 8
  , tre = {
    [br.NOT_FOUND_KEY]: "Not found '{key}' key in '{locale}' locale messages.",
    [br.FALLBACK_TO_TRANSLATE]: "Fall back to translate '{key}' key with '{target}' locale.",
    [br.CANNOT_FORMAT_NUMBER]: "Cannot format a number value due to not supported Intl.NumberFormat.",
    [br.FALLBACK_TO_NUMBER_FORMAT]: "Fall back to number format '{key}' key with '{target}' locale.",
    [br.CANNOT_FORMAT_DATE]: "Cannot format a date value due to not supported Intl.DateTimeFormat.",
    [br.FALLBACK_TO_DATE_FORMAT]: "Fall back to datetime format '{key}' key with '{target}' locale.",
    [br.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: "This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."
};
function pl(t, ...e) {
    return Ug(tre[t], ...e)
}
const nre = "11.1.11"
  , Hg = -1
  , id = "en-US"
  , m0 = ""
  , zC = t => `${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;
function rre() {
    return {
        upper: (t, e) => e === "text" && Ee(t) ? t.toUpperCase() : e === "vnode" && ot(t) && "__v_isVNode"in t ? t.children.toUpperCase() : t,
        lower: (t, e) => e === "text" && Ee(t) ? t.toLowerCase() : e === "vnode" && ot(t) && "__v_isVNode"in t ? t.children.toLowerCase() : t,
        capitalize: (t, e) => e === "text" && Ee(t) ? zC(t) : e === "vnode" && ot(t) && "__v_isVNode"in t ? zC(t.children) : t
    }
}
let i6;
function ire(t) {
    i6 = t
}
let o6;
function ore(t) {
    o6 = t
}
let s6;
function sre(t) {
    s6 = t
}
let a6 = null;
const are = t => {
    a6 = t
}
  , lre = () => a6;
let l6 = null;
const jC = t => {
    l6 = t
}
  , cre = () => l6;
let WC = 0;
function ure(t={}) {
    const e = At(t.onWarn) ? t.onWarn : mo
      , n = Ee(t.version) ? t.version : nre
      , r = Ee(t.locale) || At(t.locale) ? t.locale : id
      , i = At(r) ? id : r
      , o = Wt(t.fallbackLocale) || Ze(t.fallbackLocale) || Ee(t.fallbackLocale) || t.fallbackLocale === !1 ? t.fallbackLocale : i
      , s = Ze(t.messages) ? t.messages : t1(i)
      , a = Ze(t.datetimeFormats) ? t.datetimeFormats : t1(i)
      , l = Ze(t.numberFormats) ? t.numberFormats : t1(i)
      , c = Sn(Ct(), t.modifiers, rre())
      , u = t.pluralRules || Ct()
      , f = At(t.missing) ? t.missing : null
      , d = ct(t.missingWarn) || Vc(t.missingWarn) ? t.missingWarn : !0
      , h = ct(t.fallbackWarn) || Vc(t.fallbackWarn) ? t.fallbackWarn : !0
      , p = !!t.fallbackFormat
      , y = !!t.unresolving
      , v = At(t.postTranslation) ? t.postTranslation : null
      , g = Ze(t.processor) ? t.processor : null
      , m = ct(t.warnHtmlMessage) ? t.warnHtmlMessage : !0
      , _ = !!t.escapeParameter
      , x = At(t.messageCompiler) ? t.messageCompiler : i6;
    At(t.messageCompiler) && Ew(pl(br.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));
    const b = At(t.messageResolver) ? t.messageResolver : o6 || Jne
      , w = At(t.localeFallbacker) ? t.localeFallbacker : s6 || Vne
      , E = ot(t.fallbackContext) ? t.fallbackContext : void 0
      , S = t
      , P = ot(S.__datetimeFormatters) ? S.__datetimeFormatters : new Map
      , C = ot(S.__numberFormatters) ? S.__numberFormatters : new Map
      , A = ot(S.__meta) ? S.__meta : {};
    WC++;
    const T = {
        version: n,
        cid: WC,
        locale: r,
        fallbackLocale: o,
        messages: s,
        modifiers: c,
        pluralRules: u,
        missing: f,
        missingWarn: d,
        fallbackWarn: h,
        fallbackFormat: p,
        unresolving: y,
        postTranslation: v,
        processor: g,
        warnHtmlMessage: m,
        escapeParameter: _,
        messageCompiler: x,
        messageResolver: b,
        localeFallbacker: w,
        fallbackContext: E,
        onWarn: e,
        __meta: A
    };
    return T.datetimeFormats = a,
    T.numberFormats = l,
    T.__datetimeFormatters = P,
    T.__numberFormatters = C,
    T.__v_emitter = S.__v_emitter != null ? S.__v_emitter : void 0,
    Lne(T, n, A),
    T
}
const t1 = t => ({
    [t]: Ct()
});
function Vg(t, e) {
    return t instanceof RegExp ? t.test(e) : t
}
function c6(t, e) {
    return t instanceof RegExp ? t.test(e) : t
}
function Ow(t, e, n, r, i) {
    const {missing: o, onWarn: s} = t;
    {
        const a = t.__v_emitter;
        a && a.emit("missing", {
            locale: n,
            key: e,
            type: i,
            groupId: `${i}:${e}`
        })
    }
    if (o !== null) {
        const a = o(t, n, e, i);
        return Ee(a) ? a : e
    } else
        return c6(r, e) && s(pl(br.NOT_FOUND_KEY, {
            key: e,
            locale: n
        })),
        e
}
function Fu(t, e, n) {
    const r = t;
    r.__localeChainCache = new Map,
    t.localeFallbacker(t, n, e)
}
function u6(t, e) {
    return t === e ? !1 : t.split("-")[0] === e.split("-")[0]
}
function fre(t, e) {
    const n = e.indexOf(t);
    if (n === -1)
        return !1;
    for (let r = n + 1; r < e.length; r++)
        if (u6(t, e[r]))
            return !0;
    return !1
}
const YC = typeof Intl < "u"
  , f6 = {
    dateTimeFormat: YC && typeof Intl.DateTimeFormat < "u",
    numberFormat: YC && typeof Intl.NumberFormat < "u"
};
function XC(t, ...e) {
    const {datetimeFormats: n, unresolving: r, fallbackLocale: i, onWarn: o, localeFallbacker: s} = t
      , {__datetimeFormatters: a} = t;
    if (!f6.dateTimeFormat)
        return o(pl(br.CANNOT_FORMAT_DATE)),
        m0;
    const [l,c,u,f] = a_(...e)
      , d = ct(u.missingWarn) ? u.missingWarn : t.missingWarn
      , h = ct(u.fallbackWarn) ? u.fallbackWarn : t.fallbackWarn
      , p = !!u.part
      , y = Iw(t, u)
      , v = s(t, i, y);
    if (!Ee(l) || l === "")
        return new Intl.DateTimeFormat(y,f).format(c);
    let g = {}, m, _ = null, x = y, b = null;
    const w = "datetime format";
    for (let P = 0; P < v.length; P++) {
        if (m = b = v[P],
        y !== m && Vg(h, l) && o(pl(br.FALLBACK_TO_DATE_FORMAT, {
            key: l,
            target: m
        })),
        y !== m) {
            const C = t.__v_emitter;
            C && C.emit("fallback", {
                type: w,
                key: l,
                from: x,
                to: b,
                groupId: `${w}:${l}`
            })
        }
        if (g = n[m] || {},
        _ = g[l],
        Ze(_))
            break;
        Ow(t, l, m, d, w),
        x = b
    }
    if (!Ze(_) || !Ee(m))
        return r ? Hg : l;
    let E = `${m}__${l}`;
    Gg(f) || (E = `${E}__${JSON.stringify(f)}`);
    let S = a.get(E);
    return S || (S = new Intl.DateTimeFormat(m,Sn({}, _, f)),
    a.set(E, S)),
    p ? S.formatToParts(c) : S.format(c)
}
const d6 = ["localeMatcher", "weekday", "era", "year", "month", "day", "hour", "minute", "second", "timeZoneName", "formatMatcher", "hour12", "timeZone", "dateStyle", "timeStyle", "calendar", "dayPeriod", "numberingSystem", "hourCycle", "fractionalSecondDigits"];
function a_(...t) {
    const [e,n,r,i] = t
      , o = Ct();
    let s = Ct(), a;
    if (Ee(e)) {
        const l = e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
        if (!l)
            throw zo(Xn.INVALID_ISO_DATE_ARGUMENT);
        const c = l[3] ? l[3].trim().startsWith("T") ? `${l[1].trim()}${l[3].trim()}` : `${l[1].trim()}T${l[3].trim()}` : l[1].trim();
        a = new Date(c);
        try {
            a.toISOString()
        } catch {
            throw zo(Xn.INVALID_ISO_DATE_ARGUMENT)
        }
    } else if (Hte(e)) {
        if (isNaN(e.getTime()))
            throw zo(Xn.INVALID_DATE_ARGUMENT);
        a = e
    } else if (un(e))
        a = e;
    else
        throw zo(Xn.INVALID_ARGUMENT);
    return Ee(n) ? o.key = n : Ze(n) && Object.keys(n).forEach(l => {
        d6.includes(l) ? s[l] = n[l] : o[l] = n[l]
    }
    ),
    Ee(r) ? o.locale = r : Ze(r) && (s = r),
    Ze(i) && (s = i),
    [o.key || "", a, o, s]
}
function KC(t, e, n) {
    const r = t;
    for (const i in n) {
        const o = `${e}__${i}`;
        r.__datetimeFormatters.has(o) && r.__datetimeFormatters.delete(o)
    }
}
function qC(t, ...e) {
    const {numberFormats: n, unresolving: r, fallbackLocale: i, onWarn: o, localeFallbacker: s} = t
      , {__numberFormatters: a} = t;
    if (!f6.numberFormat)
        return o(pl(br.CANNOT_FORMAT_NUMBER)),
        m0;
    const [l,c,u,f] = l_(...e)
      , d = ct(u.missingWarn) ? u.missingWarn : t.missingWarn
      , h = ct(u.fallbackWarn) ? u.fallbackWarn : t.fallbackWarn
      , p = !!u.part
      , y = Iw(t, u)
      , v = s(t, i, y);
    if (!Ee(l) || l === "")
        return new Intl.NumberFormat(y,f).format(c);
    let g = {}, m, _ = null, x = y, b = null;
    const w = "number format";
    for (let P = 0; P < v.length; P++) {
        if (m = b = v[P],
        y !== m && Vg(h, l) && o(pl(br.FALLBACK_TO_NUMBER_FORMAT, {
            key: l,
            target: m
        })),
        y !== m) {
            const C = t.__v_emitter;
            C && C.emit("fallback", {
                type: w,
                key: l,
                from: x,
                to: b,
                groupId: `${w}:${l}`
            })
        }
        if (g = n[m] || {},
        _ = g[l],
        Ze(_))
            break;
        Ow(t, l, m, d, w),
        x = b
    }
    if (!Ze(_) || !Ee(m))
        return r ? Hg : l;
    let E = `${m}__${l}`;
    Gg(f) || (E = `${E}__${JSON.stringify(f)}`);
    let S = a.get(E);
    return S || (S = new Intl.NumberFormat(m,Sn({}, _, f)),
    a.set(E, S)),
    p ? S.formatToParts(c) : S.format(c)
}
const h6 = ["localeMatcher", "style", "currency", "currencyDisplay", "currencySign", "useGrouping", "minimumIntegerDigits", "minimumFractionDigits", "maximumFractionDigits", "minimumSignificantDigits", "maximumSignificantDigits", "compactDisplay", "notation", "signDisplay", "unit", "unitDisplay", "roundingMode", "roundingPriority", "roundingIncrement", "trailingZeroDisplay"];
function l_(...t) {
    const [e,n,r,i] = t
      , o = Ct();
    let s = Ct();
    if (!un(e))
        throw zo(Xn.INVALID_ARGUMENT);
    const a = e;
    return Ee(n) ? o.key = n : Ze(n) && Object.keys(n).forEach(l => {
        h6.includes(l) ? s[l] = n[l] : o[l] = n[l]
    }
    ),
    Ee(r) ? o.locale = r : Ze(r) && (s = r),
    Ze(i) && (s = i),
    [o.key || "", a, o, s]
}
function ZC(t, e, n) {
    const r = t;
    for (const i in n) {
        const o = `${e}__${i}`;
        r.__numberFormatters.has(o) && r.__numberFormatters.delete(o)
    }
}
const dre = t => t
  , hre = t => ""
  , pre = "text"
  , gre = t => t.length === 0 ? "" : Cw(t)
  , mre = Yte;
function JC(t, e) {
    return t = Math.abs(t),
    e === 2 ? t ? t > 1 ? 1 : 0 : 1 : t ? Math.min(t, 2) : 0
}
function vre(t) {
    const e = un(t.pluralIndex) ? t.pluralIndex : -1;
    return t.named && (un(t.named.count) || un(t.named.n)) ? un(t.named.count) ? t.named.count : un(t.named.n) ? t.named.n : e : e
}
function yre(t, e) {
    e.count || (e.count = t),
    e.n || (e.n = t)
}
function _re(t={}) {
    const e = t.locale
      , n = vre(t)
      , r = ot(t.pluralRules) && Ee(e) && At(t.pluralRules[e]) ? t.pluralRules[e] : JC
      , i = ot(t.pluralRules) && Ee(e) && At(t.pluralRules[e]) ? JC : void 0
      , o = g => g[r(n, g.length, i)]
      , s = t.list || []
      , a = g => s[g]
      , l = t.named || Ct();
    un(t.pluralIndex) && yre(n, l);
    const c = g => l[g];
    function u(g, m) {
        const _ = At(t.messages) ? t.messages(g, !!m) : ot(t.messages) ? t.messages[g] : !1;
        return _ || (t.parent ? t.parent.message(g) : hre)
    }
    const f = g => t.modifiers ? t.modifiers[g] : dre
      , d = Ze(t.processor) && At(t.processor.normalize) ? t.processor.normalize : gre
      , h = Ze(t.processor) && At(t.processor.interpolate) ? t.processor.interpolate : mre
      , p = Ze(t.processor) && Ee(t.processor.type) ? t.processor.type : pre
      , v = {
        list: a,
        named: c,
        plural: o,
        linked: (g, ...m) => {
            const [_,x] = m;
            let b = "text"
              , w = "";
            m.length === 1 ? ot(_) ? (w = _.modifier || w,
            b = _.type || b) : Ee(_) && (w = _ || w) : m.length === 2 && (Ee(_) && (w = _ || w),
            Ee(x) && (b = x || b));
            const E = u(g, !0)(v)
              , S = b === "vnode" && Wt(E) && w ? E[0] : E;
            return w ? f(w)(S, b) : S
        }
        ,
        message: u,
        type: p,
        interpolate: h,
        normalize: d,
        values: Sn(Ct(), s, l)
    };
    return v
}
const QC = () => ""
  , ai = t => At(t);
function eA(t, ...e) {
    const {fallbackFormat: n, postTranslation: r, unresolving: i, messageCompiler: o, fallbackLocale: s, messages: a} = t
      , [l,c] = c_(...e)
      , u = ct(c.missingWarn) ? c.missingWarn : t.missingWarn
      , f = ct(c.fallbackWarn) ? c.fallbackWarn : t.fallbackWarn
      , d = ct(c.escapeParameter) ? c.escapeParameter : t.escapeParameter
      , h = !!c.resolvedMessage
      , p = Ee(c.default) || ct(c.default) ? ct(c.default) ? o ? l : () => l : c.default : n ? o ? l : () => l : null
      , y = n || p != null && (Ee(p) || At(p))
      , v = Iw(t, c);
    d && xre(c);
    let[g,m,_] = h ? [l, v, a[v] || Ct()] : p6(t, l, v, s, f, u)
      , x = g
      , b = l;
    if (!h && !(Ee(x) || gi(x) || ai(x)) && y && (x = p,
    b = x),
    !h && (!(Ee(x) || gi(x) || ai(x)) || !Ee(m)))
        return i ? Hg : l;
    if (Ee(x) && t.messageCompiler == null)
        return mo(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${l}'.`),
        l;
    let w = !1;
    const E = () => {
        w = !0
    }
      , S = ai(x) ? x : g6(t, l, m, x, b, E);
    if (w)
        return x;
    const P = Sre(t, m, _, c)
      , C = _re(P)
      , A = bre(t, S, C);
    let T = r ? r(A, l) : A;
    d && Ee(T) && (T = zte(T));
    {
        const I = {
            timestamp: Date.now(),
            key: Ee(l) ? l : ai(x) ? x.key : "",
            locale: m || (ai(x) ? x.locale : ""),
            format: Ee(x) ? x : ai(x) ? x.source : "",
            message: T
        };
        I.meta = Sn({}, t.__meta, lre() || {}),
        $ne(I)
    }
    return T
}
function xre(t) {
    Wt(t.list) ? t.list = t.list.map(e => Ee(e) ? BC(e) : e) : ot(t.named) && Object.keys(t.named).forEach(e => {
        Ee(t.named[e]) && (t.named[e] = BC(t.named[e]))
    }
    )
}
function p6(t, e, n, r, i, o) {
    const {messages: s, onWarn: a, messageResolver: l, localeFallbacker: c} = t
      , u = c(t, r, n);
    let f = Ct(), d, h = null, p = n, y = null;
    const v = "translate";
    for (let g = 0; g < u.length; g++) {
        if (d = y = u[g],
        n !== d && !u6(n, d) && Vg(i, e) && a(pl(br.FALLBACK_TO_TRANSLATE, {
            key: e,
            target: d
        })),
        n !== d) {
            const b = t.__v_emitter;
            b && b.emit("fallback", {
                type: v,
                key: e,
                from: p,
                to: y,
                groupId: `${v}:${e}`
            })
        }
        f = s[d] || Ct();
        let m = null, _, x;
        if (Li && (m = window.performance.now(),
        _ = "intlify-message-resolve-start",
        x = "intlify-message-resolve-end",
        Gr && Gr(_)),
        (h = l(f, e)) === null && (h = f[e]),
        Li) {
            const b = window.performance.now()
              , w = t.__v_emitter;
            w && m && h && w.emit("message-resolve", {
                type: "message-resolve",
                key: e,
                message: h,
                time: b - m,
                groupId: `${v}:${e}`
            }),
            _ && x && Gr && hl && (Gr(x),
            hl("intlify message resolve", _, x))
        }
        if (Ee(h) || gi(h) || ai(h))
            break;
        if (!fre(d, u)) {
            const b = Ow(t, e, d, o, v);
            b !== e && (h = b)
        }
        p = y
    }
    return [h, d, f]
}
function g6(t, e, n, r, i, o) {
    const {messageCompiler: s, warnHtmlMessage: a} = t;
    if (ai(r)) {
        const d = r;
        return d.locale = d.locale || n,
        d.key = d.key || e,
        d
    }
    if (s == null) {
        const d = () => r;
        return d.locale = n,
        d.key = e,
        d
    }
    let l = null, c, u;
    Li && (l = window.performance.now(),
    c = "intlify-message-compilation-start",
    u = "intlify-message-compilation-end",
    Gr && Gr(c));
    const f = s(r, wre(t, n, i, r, a, o));
    if (Li) {
        const d = window.performance.now()
          , h = t.__v_emitter;
        h && l && h.emit("message-compilation", {
            type: "message-compilation",
            message: r,
            time: d - l,
            groupId: `translate:${e}`
        }),
        c && u && Gr && hl && (Gr(u),
        hl("intlify message compilation", c, u))
    }
    return f.locale = n,
    f.key = e,
    f.source = r,
    f
}
function bre(t, e, n) {
    let r = null, i, o;
    Li && (r = window.performance.now(),
    i = "intlify-message-evaluation-start",
    o = "intlify-message-evaluation-end",
    Gr && Gr(i));
    const s = e(n);
    if (Li) {
        const a = window.performance.now()
          , l = t.__v_emitter;
        l && r && l.emit("message-evaluation", {
            type: "message-evaluation",
            value: s,
            time: a - r,
            groupId: `translate:${e.key}`
        }),
        i && o && Gr && hl && (Gr(o),
        hl("intlify message evaluation", i, o))
    }
    return s
}
function c_(...t) {
    const [e,n,r] = t
      , i = Ct();
    if (!Ee(e) && !un(e) && !ai(e) && !gi(e))
        throw zo(Xn.INVALID_ARGUMENT);
    const o = un(e) ? String(e) : (ai(e),
    e);
    return un(n) ? i.plural = n : Ee(n) ? i.default = n : Ze(n) && !Gg(n) ? i.named = n : Wt(n) && (i.list = n),
    un(r) ? i.plural = r : Ee(r) ? i.default = r : Ze(r) && Sn(i, r),
    [o, i]
}
function wre(t, e, n, r, i, o) {
    return {
        locale: e,
        key: n,
        warnHtmlMessage: i,
        onError: s => {
            o && o(s);
            {
                const a = Ere(r)
                  , l = `Message compilation error: ${s.message}`
                  , c = s.location && a && Xte(a, s.location.start.offset, s.location.end.offset)
                  , u = t.__v_emitter;
                u && a && u.emit("compile-error", {
                    message: a,
                    error: s.message,
                    start: s.location && s.location.start.offset,
                    end: s.location && s.location.end.offset,
                    groupId: `translate:${n}`
                }),
                console.error(c ? `${l}
${c}` : l)
            }
        }
        ,
        onCacheKey: s => Ute(e, n, s)
    }
}
function Ere(t) {
    if (Ee(t))
        return t;
    if (t.loc && t.loc.source)
        return t.loc.source
}
function Sre(t, e, n, r) {
    const {modifiers: i, pluralRules: o, messageResolver: s, fallbackLocale: a, fallbackWarn: l, missingWarn: c, fallbackContext: u} = t
      , d = {
        locale: e,
        modifiers: i,
        pluralRules: o,
        messages: (h, p) => {
            let y = s(n, h);
            if (y == null && (u || p)) {
                const [,,v] = p6(u || t, h, e, a, l, c);
                y = s(v, h)
            }
            if (Ee(y) || gi(y)) {
                let v = !1;
                const m = g6(t, h, e, y, h, () => {
                    v = !0
                }
                );
                return v ? QC : m
            } else
                return ai(y) ? y : QC
        }
    };
    return t.processor && (d.processor = t.processor),
    r.list && (d.list = r.list),
    r.named && (d.named = r.named),
    un(r.plural) && (d.pluralIndex = r.plural),
    d
}
Sne();
/*!
  * vue-i18n v11.1.11
  * (c) 2025 kazuya kawaguchi
  * Released under the MIT License.
  */
const Cre = "11.1.11";
function Are() {
    typeof __VUE_I18N_FULL_INSTALL__ != "boolean" && (Ha().__VUE_I18N_FULL_INSTALL__ = !0),
    typeof __VUE_I18N_LEGACY_API__ != "boolean" && (Ha().__VUE_I18N_LEGACY_API__ = !0),
    typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (Ha().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1),
    typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (Ha().__INTLIFY_PROD_DEVTOOLS__ = !1)
}
const Pt = {
    UNEXPECTED_RETURN_TYPE: Gne,
    INVALID_ARGUMENT: 25,
    MUST_BE_CALL_SETUP_TOP: 26,
    NOT_INSTALLED: 27,
    REQUIRED_VALUE: 28,
    INVALID_VALUE: 29,
    CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: 30,
    NOT_INSTALLED_WITH_PROVIDE: 31,
    UNEXPECTED_ERROR: 32,
    NOT_COMPATIBLE_LEGACY_VUE_I18N: 33,
    NOT_AVAILABLE_COMPOSITION_IN_LEGACY: 34
};
function Mr(t, ...e) {
    return vu(t, null, {
        messages: Tre,
        args: e
    })
}
const Tre = {
    [Pt.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer",
    [Pt.INVALID_ARGUMENT]: "Invalid argument",
    [Pt.MUST_BE_CALL_SETUP_TOP]: "Must be called at the top of a `setup` function",
    [Pt.NOT_INSTALLED]: "Need to install with `app.use` function",
    [Pt.UNEXPECTED_ERROR]: "Unexpected error",
    [Pt.REQUIRED_VALUE]: "Required in value: {0}",
    [Pt.INVALID_VALUE]: "Invalid value",
    [Pt.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: "Cannot setup vue-devtools plugin",
    [Pt.NOT_INSTALLED_WITH_PROVIDE]: "Need to install with `provide` function",
    [Pt.NOT_COMPATIBLE_LEGACY_VUE_I18N]: "Not compatible legacy VueI18n.",
    [Pt.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]: "Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"
}
  , u_ = Eo("__translateVNode")
  , f_ = Eo("__datetimeParts")
  , d_ = Eo("__numberParts")
  , gl = Eo("__enableEmitter")
  , od = Eo("__disableEmitter")
  , m6 = Eo("__setPluralRules")
  , v6 = Eo("__injectWithOption")
  , h_ = Eo("__dispose")
  , li = {
    FALLBACK_TO_ROOT: ere,
    NOT_FOUND_PARENT_SCOPE: 9,
    IGNORE_OBJ_FLATTEN: 10,
    DEPRECATE_LEGACY_MODE: 11,
    DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE: 12,
    DUPLICATE_USE_I18N_CALLING: 13
}
  , Pre = {
    [li.FALLBACK_TO_ROOT]: "Fall back to {type} '{key}' with root locale.",
    [li.NOT_FOUND_PARENT_SCOPE]: "Not found parent scope. use the global scope.",
    [li.IGNORE_OBJ_FLATTEN]: "Ignore object flatten: '{key}' key has an string value",
    [li.DEPRECATE_LEGACY_MODE]: `Legacy API mode has been deprecated in v11. Use Composition API mode instead.
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,
    [li.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]: "'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead.",
    [li.DUPLICATE_USE_I18N_CALLING]: "Duplicate `useI18n` calling by local scope. Please don't call it on local scope, due to it does not work properly in component."
};
function jc(t, ...e) {
    return Ug(Pre[t], ...e)
}
function sd(t) {
    if (!ot(t) || gi(t))
        return t;
    for (const e in t)
        if (Mi(t, e))
            if (!e.includes("."))
                ot(t[e]) && sd(t[e]);
            else {
                const n = e.split(".")
                  , r = n.length - 1;
                let i = t
                  , o = !1;
                for (let s = 0; s < r; s++) {
                    if (n[s] === "__proto__")
                        throw new Error(`unsafe key: ${n[s]}`);
                    if (n[s]in i || (i[n[s]] = Ct()),
                    !ot(i[n[s]])) {
                        mo(jc(li.IGNORE_OBJ_FLATTEN, {
                            key: n[s]
                        })),
                        o = !0;
                        break
                    }
                    i = i[n[s]]
                }
                if (o || (gi(i) ? n6.includes(n[r]) || delete t[e] : (i[n[r]] = t[e],
                delete t[e])),
                !gi(i)) {
                    const s = i[n[r]];
                    ot(s) && sd(s)
                }
            }
    return t
}
function Rw(t, e) {
    const {messages: n, __i18n: r, messageResolver: i, flatJson: o} = e
      , s = Ze(n) ? n : Wt(r) ? Ct() : {
        [t]: Ct()
    };
    if (Wt(r) && r.forEach(a => {
        if ("locale"in a && "resource"in a) {
            const {locale: l, resource: c} = a;
            l ? (s[l] = s[l] || Ct(),
            Bp(c, s[l])) : Bp(c, s)
        } else
            Ee(a) && Bp(JSON.parse(a), s)
    }
    ),
    i == null && o)
        for (const a in s)
            Mi(s, a) && sd(s[a]);
    return s
}
function y6(t) {
    return t.type
}
function _6(t, e, n) {
    let r = ot(e.messages) ? e.messages : Ct();
    "__i18nGlobal"in n && (r = Rw(t.locale.value, {
        messages: r,
        __i18n: n.__i18nGlobal
    }));
    const i = Object.keys(r);
    i.length && i.forEach(o => {
        t.mergeLocaleMessage(o, r[o])
    }
    );
    {
        if (ot(e.datetimeFormats)) {
            const o = Object.keys(e.datetimeFormats);
            o.length && o.forEach(s => {
                t.mergeDateTimeFormat(s, e.datetimeFormats[s])
            }
            )
        }
        if (ot(e.numberFormats)) {
            const o = Object.keys(e.numberFormats);
            o.length && o.forEach(s => {
                t.mergeNumberFormat(s, e.numberFormats[s])
            }
            )
        }
    }
}
function tA(t) {
    return R(fo, null, t, 0)
}
const nA = "__INTLIFY_META__"
  , rA = () => []
  , Ire = () => !1;
let iA = 0;
function oA(t) {
    return (e, n, r, i) => t(n, r, yt() || void 0, i)
}
const Ore = () => {
    const t = yt();
    let e = null;
    return t && (e = y6(t)[nA]) ? {
        [nA]: e
    } : null
}
;
function Mw(t={}) {
    const {__root: e, __injectWithOption: n} = t
      , r = e === void 0
      , i = t.flatJson
      , o = Li ? Z : ig;
    let s = ct(t.inheritLocale) ? t.inheritLocale : !0;
    const a = o(e && s ? e.locale.value : Ee(t.locale) ? t.locale : id)
      , l = o(e && s ? e.fallbackLocale.value : Ee(t.fallbackLocale) || Wt(t.fallbackLocale) || Ze(t.fallbackLocale) || t.fallbackLocale === !1 ? t.fallbackLocale : a.value)
      , c = o(Rw(a.value, t))
      , u = o(Ze(t.datetimeFormats) ? t.datetimeFormats : {
        [a.value]: {}
    })
      , f = o(Ze(t.numberFormats) ? t.numberFormats : {
        [a.value]: {}
    });
    let d = e ? e.missingWarn : ct(t.missingWarn) || Vc(t.missingWarn) ? t.missingWarn : !0
      , h = e ? e.fallbackWarn : ct(t.fallbackWarn) || Vc(t.fallbackWarn) ? t.fallbackWarn : !0
      , p = e ? e.fallbackRoot : ct(t.fallbackRoot) ? t.fallbackRoot : !0
      , y = !!t.fallbackFormat
      , v = At(t.missing) ? t.missing : null
      , g = At(t.missing) ? oA(t.missing) : null
      , m = At(t.postTranslation) ? t.postTranslation : null
      , _ = e ? e.warnHtmlMessage : ct(t.warnHtmlMessage) ? t.warnHtmlMessage : !0
      , x = !!t.escapeParameter;
    const b = e ? e.modifiers : Ze(t.modifiers) ? t.modifiers : {};
    let w = t.pluralRules || e && e.pluralRules, E;
    E = ( () => {
        r && jC(null);
        const z = {
            version: Cre,
            locale: a.value,
            fallbackLocale: l.value,
            messages: c.value,
            modifiers: b,
            pluralRules: w,
            missing: g === null ? void 0 : g,
            missingWarn: d,
            fallbackWarn: h,
            fallbackFormat: y,
            unresolving: !0,
            postTranslation: m === null ? void 0 : m,
            warnHtmlMessage: _,
            escapeParameter: x,
            messageResolver: t.messageResolver,
            messageCompiler: t.messageCompiler,
            __meta: {
                framework: "vue"
            }
        };
        z.datetimeFormats = u.value,
        z.numberFormats = f.value,
        z.__datetimeFormatters = Ze(E) ? E.__datetimeFormatters : void 0,
        z.__numberFormatters = Ze(E) ? E.__numberFormatters : void 0,
        z.__v_emitter = Ze(E) ? E.__v_emitter : void 0;
        const ne = ure(z);
        return r && jC(ne),
        ne
    }
    )(),
    Fu(E, a.value, l.value);
    function P() {
        return [a.value, l.value, c.value, u.value, f.value]
    }
    const C = re({
        get: () => a.value,
        set: z => {
            E.locale = z,
            a.value = z
        }
    })
      , A = re({
        get: () => l.value,
        set: z => {
            E.fallbackLocale = z,
            l.value = z,
            Fu(E, a.value, z)
        }
    })
      , T = re( () => c.value)
      , I = re( () => u.value)
      , B = re( () => f.value);
    function G() {
        return At(m) ? m : null
    }
    function N(z) {
        m = z,
        E.postTranslation = z
    }
    function U() {
        return v
    }
    function W(z) {
        z !== null && (g = oA(z)),
        v = z,
        E.missing = g
    }
    function K(z, ne) {
        return z !== "translate" || !ne.resolvedMessage
    }
    const fe = (z, ne, Ce, Ue, et, Dt) => {
        P();
        let An;
        try {
            r || (E.fallbackContext = e ? cre() : void 0),
            An = z(E)
        } finally {
            r || (E.fallbackContext = void 0)
        }
        if (Ce !== "translate exists" && un(An) && An === Hg || Ce === "translate exists" && !An) {
            const [vr,mh] = ne();
            if (e && Ee(vr) && K(Ce, mh)) {
                p && (Vg(h, vr) || c6(d, vr)) && mo(jc(li.FALLBACK_TO_ROOT, {
                    key: vr,
                    type: Ce
                }));
                {
                    const {__v_emitter: hs} = E;
                    hs && p && hs.emit("fallback", {
                        type: Ce,
                        key: vr,
                        to: "global",
                        groupId: `${Ce}:${vr}`
                    })
                }
            }
            return e && p ? Ue(e) : et(vr)
        } else {
            if (Dt(An))
                return An;
            throw Mr(Pt.UNEXPECTED_RETURN_TYPE)
        }
    }
    ;
    function ue(...z) {
        return fe(ne => Reflect.apply(eA, null, [ne, ...z]), () => c_(...z), "translate", ne => Reflect.apply(ne.t, ne, [...z]), ne => ne, ne => Ee(ne))
    }
    function X(...z) {
        const [ne,Ce,Ue] = z;
        if (Ue && !ot(Ue))
            throw Mr(Pt.INVALID_ARGUMENT);
        return ue(ne, Ce, Sn({
            resolvedMessage: !0
        }, Ue || {}))
    }
    function ie(...z) {
        return fe(ne => Reflect.apply(XC, null, [ne, ...z]), () => a_(...z), "datetime format", ne => Reflect.apply(ne.d, ne, [...z]), () => m0, ne => Ee(ne) || Wt(ne))
    }
    function ge(...z) {
        return fe(ne => Reflect.apply(qC, null, [ne, ...z]), () => l_(...z), "number format", ne => Reflect.apply(ne.n, ne, [...z]), () => m0, ne => Ee(ne) || Wt(ne))
    }
    function F(z) {
        return z.map(ne => Ee(ne) || un(ne) || ct(ne) ? tA(String(ne)) : ne)
    }
    const L = {
        normalize: F,
        interpolate: z => z,
        type: "vnode"
    };
    function ee(...z) {
        return fe(ne => {
            let Ce;
            const Ue = ne;
            try {
                Ue.processor = L,
                Ce = Reflect.apply(eA, null, [Ue, ...z])
            } finally {
                Ue.processor = null
            }
            return Ce
        }
        , () => c_(...z), "translate", ne => ne[u_](...z), ne => [tA(ne)], ne => Wt(ne))
    }
    function J(...z) {
        return fe(ne => Reflect.apply(qC, null, [ne, ...z]), () => l_(...z), "number format", ne => ne[d_](...z), rA, ne => Ee(ne) || Wt(ne))
    }
    function de(...z) {
        return fe(ne => Reflect.apply(XC, null, [ne, ...z]), () => a_(...z), "datetime format", ne => ne[f_](...z), rA, ne => Ee(ne) || Wt(ne))
    }
    function pe(z) {
        w = z,
        E.pluralRules = w
    }
    function xe(z, ne) {
        return fe( () => {
            if (!z)
                return !1;
            const Ce = Ee(ne) ? ne : a.value
              , Ue = j(Ce)
              , et = E.messageResolver(Ue, z);
            return gi(et) || ai(et) || Ee(et)
        }
        , () => [z], "translate exists", Ce => Reflect.apply(Ce.te, Ce, [z, ne]), Ire, Ce => ct(Ce))
    }
    function O(z) {
        let ne = null;
        const Ce = r6(E, l.value, a.value);
        for (let Ue = 0; Ue < Ce.length; Ue++) {
            const et = c.value[Ce[Ue]] || {}
              , Dt = E.messageResolver(et, z);
            if (Dt != null) {
                ne = Dt;
                break
            }
        }
        return ne
    }
    function $(z) {
        const ne = O(z);
        return ne ?? (e ? e.tm(z) || {} : {})
    }
    function j(z) {
        return c.value[z] || {}
    }
    function ae(z, ne) {
        if (i) {
            const Ce = {
                [z]: ne
            };
            for (const Ue in Ce)
                Mi(Ce, Ue) && sd(Ce[Ue]);
            ne = Ce[z]
        }
        c.value[z] = ne,
        E.messages = c.value
    }
    function ce(z, ne) {
        c.value[z] = c.value[z] || {};
        const Ce = {
            [z]: ne
        };
        if (i)
            for (const Ue in Ce)
                Mi(Ce, Ue) && sd(Ce[Ue]);
        ne = Ce[z],
        Bp(ne, c.value[z]),
        E.messages = c.value
    }
    function M(z) {
        return u.value[z] || {}
    }
    function k(z, ne) {
        u.value[z] = ne,
        E.datetimeFormats = u.value,
        KC(E, z, ne)
    }
    function H(z, ne) {
        u.value[z] = Sn(u.value[z] || {}, ne),
        E.datetimeFormats = u.value,
        KC(E, z, ne)
    }
    function Q(z) {
        return f.value[z] || {}
    }
    function le(z, ne) {
        f.value[z] = ne,
        E.numberFormats = f.value,
        ZC(E, z, ne)
    }
    function ye(z, ne) {
        f.value[z] = Sn(f.value[z] || {}, ne),
        E.numberFormats = f.value,
        ZC(E, z, ne)
    }
    iA++,
    e && Li && (ve(e.locale, z => {
        s && (a.value = z,
        E.locale = z,
        Fu(E, a.value, l.value))
    }
    ),
    ve(e.fallbackLocale, z => {
        s && (l.value = z,
        E.fallbackLocale = z,
        Fu(E, a.value, l.value))
    }
    ));
    const he = {
        id: iA,
        locale: C,
        fallbackLocale: A,
        get inheritLocale() {
            return s
        },
        set inheritLocale(z) {
            s = z,
            z && e && (a.value = e.locale.value,
            l.value = e.fallbackLocale.value,
            Fu(E, a.value, l.value))
        },
        get availableLocales() {
            return Object.keys(c.value).sort()
        },
        messages: T,
        get modifiers() {
            return b
        },
        get pluralRules() {
            return w || {}
        },
        get isGlobal() {
            return r
        },
        get missingWarn() {
            return d
        },
        set missingWarn(z) {
            d = z,
            E.missingWarn = d
        },
        get fallbackWarn() {
            return h
        },
        set fallbackWarn(z) {
            h = z,
            E.fallbackWarn = h
        },
        get fallbackRoot() {
            return p
        },
        set fallbackRoot(z) {
            p = z
        },
        get fallbackFormat() {
            return y
        },
        set fallbackFormat(z) {
            y = z,
            E.fallbackFormat = y
        },
        get warnHtmlMessage() {
            return _
        },
        set warnHtmlMessage(z) {
            _ = z,
            E.warnHtmlMessage = z
        },
        get escapeParameter() {
            return x
        },
        set escapeParameter(z) {
            x = z,
            E.escapeParameter = z
        },
        t: ue,
        getLocaleMessage: j,
        setLocaleMessage: ae,
        mergeLocaleMessage: ce,
        getPostTranslationHandler: G,
        setPostTranslationHandler: N,
        getMissingHandler: U,
        setMissingHandler: W,
        [m6]: pe
    };
    return he.datetimeFormats = I,
    he.numberFormats = B,
    he.rt = X,
    he.te = xe,
    he.tm = $,
    he.d = ie,
    he.n = ge,
    he.getDateTimeFormat = M,
    he.setDateTimeFormat = k,
    he.mergeDateTimeFormat = H,
    he.getNumberFormat = Q,
    he.setNumberFormat = le,
    he.mergeNumberFormat = ye,
    he[v6] = n,
    he[u_] = ee,
    he[f_] = de,
    he[d_] = J,
    he[gl] = z => {
        E.__v_emitter = z
    }
    ,
    he[od] = () => {
        E.__v_emitter = void 0
    }
    ,
    he
}
const x6 = "vue-i18n: composer properties"
  , n1 = {
    "vue-devtools-plugin-vue-i18n": "Vue I18n DevTools",
    "vue-i18n-resource-inspector": "Vue I18n DevTools",
    "vue-i18n-timeline": "Vue I18n"
}
  , Rre = {
    "vue-i18n-resource-inspector": "Search for scopes ..."
}
  , Mre = {
    "vue-i18n-timeline": 16764185
};
let p_;
async function Dre(t, e) {
    return new Promise( (n, r) => {
        try {
            bg({
                id: "vue-devtools-plugin-vue-i18n",
                label: n1["vue-devtools-plugin-vue-i18n"],
                packageName: "vue-i18n",
                homepage: "https://vue-i18n.intlify.dev",
                logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
                componentStateTypes: [x6],
                app: t
            }, i => {
                p_ = i,
                i.on.visitComponentTree( ({componentInstance: s, treeNode: a}) => {
                    Bre(s, a, e)
                }
                ),
                i.on.inspectComponent( ({componentInstance: s, instanceData: a}) => {
                    s.vnode.el && s.vnode.el.__VUE_I18N__ && a && (e.mode === "legacy" ? s.vnode.el.__VUE_I18N__ !== e.global.__composer && sA(a, s.vnode.el.__VUE_I18N__) : sA(a, s.vnode.el.__VUE_I18N__))
                }
                ),
                i.addInspector({
                    id: "vue-i18n-resource-inspector",
                    label: n1["vue-i18n-resource-inspector"],
                    icon: "language",
                    treeFilterPlaceholder: Rre["vue-i18n-resource-inspector"]
                }),
                i.on.getInspectorTree(s => {
                    s.app === t && s.inspectorId === "vue-i18n-resource-inspector" && $re(s, e)
                }
                );
                const o = new Map;
                i.on.getInspectorState(async s => {
                    if (s.app === t && s.inspectorId === "vue-i18n-resource-inspector")
                        if (i.unhighlightElement(),
                        Gre(s, e),
                        s.nodeId === "global") {
                            if (!o.has(s.app)) {
                                const [a] = await i.getComponentInstances(s.app);
                                o.set(s.app, a)
                            }
                            i.highlightElement(o.get(s.app))
                        } else {
                            const a = Ure(s.nodeId, e);
                            a && i.highlightElement(a)
                        }
                }
                ),
                i.on.editInspectorState(s => {
                    s.app === t && s.inspectorId === "vue-i18n-resource-inspector" && Vre(s, e)
                }
                ),
                i.addTimelineLayer({
                    id: "vue-i18n-timeline",
                    label: n1["vue-i18n-timeline"],
                    color: Mre["vue-i18n-timeline"]
                }),
                n(!0)
            }
            )
        } catch (i) {
            console.error(i),
            r(!1)
        }
    }
    )
}
function b6(t) {
    return t.type.name || t.type.displayName || t.type.__file || "Anonymous"
}
function Bre(t, e, n) {
    const r = n.mode === "composition" ? n.global : n.global.__composer;
    if (t && t.vnode.el && t.vnode.el.__VUE_I18N__ && t.vnode.el.__VUE_I18N__ !== r) {
        const i = {
            label: `i18n (${b6(t)} Scope)`,
            textColor: 0,
            backgroundColor: 16764185
        };
        e.tags.push(i)
    }
}
function sA(t, e) {
    const n = x6;
    t.state.push({
        type: n,
        key: "locale",
        editable: !0,
        value: e.locale.value
    }),
    t.state.push({
        type: n,
        key: "availableLocales",
        editable: !1,
        value: e.availableLocales
    }),
    t.state.push({
        type: n,
        key: "fallbackLocale",
        editable: !0,
        value: e.fallbackLocale.value
    }),
    t.state.push({
        type: n,
        key: "inheritLocale",
        editable: !0,
        value: e.inheritLocale
    }),
    t.state.push({
        type: n,
        key: "messages",
        editable: !1,
        value: Dw(e.messages.value)
    }),
    t.state.push({
        type: n,
        key: "datetimeFormats",
        editable: !1,
        value: e.datetimeFormats.value
    }),
    t.state.push({
        type: n,
        key: "numberFormats",
        editable: !1,
        value: e.numberFormats.value
    })
}
function Dw(t) {
    const e = {};
    return Object.keys(t).forEach(n => {
        const r = t[n];
        At(r) && "source"in r ? e[n] = Lre(r) : gi(r) && r.loc && r.loc.source ? e[n] = r.loc.source : ot(r) ? e[n] = Dw(r) : e[n] = r
    }
    ),
    e
}
const kre = {
    "<": "&lt;",
    ">": "&gt;",
    '"': "&quot;",
    "&": "&amp;"
};
function Nre(t) {
    return t.replace(/[<>"&]/g, Fre)
}
function Fre(t) {
    return kre[t] || t
}
function Lre(t) {
    return {
        _custom: {
            type: "function",
            display: `<span>ƒ</span> ${t.source ? `("${Nre(t.source)}")` : "(?)"}`
        }
    }
}
function $re(t, e) {
    t.rootNodes.push({
        id: "global",
        label: "Global Scope"
    });
    const n = e.mode === "composition" ? e.global : e.global.__composer;
    for (const [r,i] of e.__instances) {
        const o = e.mode === "composition" ? i : i.__composer;
        n !== o && t.rootNodes.push({
            id: o.id.toString(),
            label: `${b6(r)} Scope`
        })
    }
}
function Ure(t, e) {
    let n = null;
    if (t !== "global") {
        for (const [r,i] of e.__instances.entries())
            if (i.id.toString() === t) {
                n = r;
                break
            }
    }
    return n
}
function w6(t, e) {
    if (t === "global")
        return e.mode === "composition" ? e.global : e.global.__composer;
    {
        const n = Array.from(e.__instances.values()).find(r => r.id.toString() === t);
        return n ? e.mode === "composition" ? n : n.__composer : null
    }
}
function Gre(t, e) {
    const n = w6(t.nodeId, e);
    return n && (t.state = Hre(n)),
    null
}
function Hre(t) {
    const e = {}
      , n = "Locale related info"
      , r = [{
        type: n,
        key: "locale",
        editable: !0,
        value: t.locale.value
    }, {
        type: n,
        key: "fallbackLocale",
        editable: !0,
        value: t.fallbackLocale.value
    }, {
        type: n,
        key: "availableLocales",
        editable: !1,
        value: t.availableLocales
    }, {
        type: n,
        key: "inheritLocale",
        editable: !0,
        value: t.inheritLocale
    }];
    e[n] = r;
    const i = "Locale messages info"
      , o = [{
        type: i,
        key: "messages",
        editable: !1,
        value: Dw(t.messages.value)
    }];
    e[i] = o;
    {
        const s = "Datetime formats info"
          , a = [{
            type: s,
            key: "datetimeFormats",
            editable: !1,
            value: t.datetimeFormats.value
        }];
        e[s] = a;
        const l = "Datetime formats info"
          , c = [{
            type: l,
            key: "numberFormats",
            editable: !1,
            value: t.numberFormats.value
        }];
        e[l] = c
    }
    return e
}
function ad(t, e) {
    if (p_) {
        let n;
        e && "groupId"in e && (n = e.groupId,
        delete e.groupId),
        p_.addTimelineEvent({
            layerId: "vue-i18n-timeline",
            event: {
                title: t,
                groupId: n,
                time: Date.now(),
                meta: {},
                data: e || {},
                logType: t === "compile-error" ? "error" : t === "fallback" || t === "missing" ? "warning" : "default"
            }
        })
    }
}
function Vre(t, e) {
    const n = w6(t.nodeId, e);
    if (n) {
        const [r] = t.path;
        r === "locale" && Ee(t.state.value) ? n.locale.value = t.state.value : r === "fallbackLocale" && (Ee(t.state.value) || Wt(t.state.value) || ot(t.state.value)) ? n.fallbackLocale.value = t.state.value : r === "inheritLocale" && ct(t.state.value) && (n.inheritLocale = t.state.value)
    }
}
function zre(t) {
    const e = Ee(t.locale) ? t.locale : id
      , n = Ee(t.fallbackLocale) || Wt(t.fallbackLocale) || Ze(t.fallbackLocale) || t.fallbackLocale === !1 ? t.fallbackLocale : e
      , r = At(t.missing) ? t.missing : void 0
      , i = ct(t.silentTranslationWarn) || Vc(t.silentTranslationWarn) ? !t.silentTranslationWarn : !0
      , o = ct(t.silentFallbackWarn) || Vc(t.silentFallbackWarn) ? !t.silentFallbackWarn : !0
      , s = ct(t.fallbackRoot) ? t.fallbackRoot : !0
      , a = !!t.formatFallbackMessages
      , l = Ze(t.modifiers) ? t.modifiers : {}
      , c = t.pluralizationRules
      , u = At(t.postTranslation) ? t.postTranslation : void 0
      , f = Ee(t.warnHtmlInMessage) ? t.warnHtmlInMessage !== "off" : !0
      , d = !!t.escapeParameterHtml
      , h = ct(t.sync) ? t.sync : !0;
    let p = t.messages;
    if (Ze(t.sharedMessages)) {
        const b = t.sharedMessages;
        p = Object.keys(b).reduce( (E, S) => {
            const P = E[S] || (E[S] = {});
            return Sn(P, b[S]),
            E
        }
        , p || {})
    }
    const {__i18n: y, __root: v, __injectWithOption: g} = t
      , m = t.datetimeFormats
      , _ = t.numberFormats
      , x = t.flatJson;
    return {
        locale: e,
        fallbackLocale: n,
        messages: p,
        flatJson: x,
        datetimeFormats: m,
        numberFormats: _,
        missing: r,
        missingWarn: i,
        fallbackWarn: o,
        fallbackRoot: s,
        fallbackFormat: a,
        modifiers: l,
        pluralRules: c,
        postTranslation: u,
        warnHtmlMessage: f,
        escapeParameter: d,
        messageResolver: t.messageResolver,
        inheritLocale: h,
        __i18n: y,
        __root: v,
        __injectWithOption: g
    }
}
function g_(t={}) {
    const e = Mw(zre(t))
      , {__extender: n} = t
      , r = {
        id: e.id,
        get locale() {
            return e.locale.value
        },
        set locale(i) {
            e.locale.value = i
        },
        get fallbackLocale() {
            return e.fallbackLocale.value
        },
        set fallbackLocale(i) {
            e.fallbackLocale.value = i
        },
        get messages() {
            return e.messages.value
        },
        get datetimeFormats() {
            return e.datetimeFormats.value
        },
        get numberFormats() {
            return e.numberFormats.value
        },
        get availableLocales() {
            return e.availableLocales
        },
        get missing() {
            return e.getMissingHandler()
        },
        set missing(i) {
            e.setMissingHandler(i)
        },
        get silentTranslationWarn() {
            return ct(e.missingWarn) ? !e.missingWarn : e.missingWarn
        },
        set silentTranslationWarn(i) {
            e.missingWarn = ct(i) ? !i : i
        },
        get silentFallbackWarn() {
            return ct(e.fallbackWarn) ? !e.fallbackWarn : e.fallbackWarn
        },
        set silentFallbackWarn(i) {
            e.fallbackWarn = ct(i) ? !i : i
        },
        get modifiers() {
            return e.modifiers
        },
        get formatFallbackMessages() {
            return e.fallbackFormat
        },
        set formatFallbackMessages(i) {
            e.fallbackFormat = i
        },
        get postTranslation() {
            return e.getPostTranslationHandler()
        },
        set postTranslation(i) {
            e.setPostTranslationHandler(i)
        },
        get sync() {
            return e.inheritLocale
        },
        set sync(i) {
            e.inheritLocale = i
        },
        get warnHtmlInMessage() {
            return e.warnHtmlMessage ? "warn" : "off"
        },
        set warnHtmlInMessage(i) {
            e.warnHtmlMessage = i !== "off"
        },
        get escapeParameterHtml() {
            return e.escapeParameter
        },
        set escapeParameterHtml(i) {
            e.escapeParameter = i
        },
        get pluralizationRules() {
            return e.pluralRules || {}
        },
        __composer: e,
        t(...i) {
            return Reflect.apply(e.t, e, [...i])
        },
        rt(...i) {
            return Reflect.apply(e.rt, e, [...i])
        },
        te(i, o) {
            return e.te(i, o)
        },
        tm(i) {
            return e.tm(i)
        },
        getLocaleMessage(i) {
            return e.getLocaleMessage(i)
        },
        setLocaleMessage(i, o) {
            e.setLocaleMessage(i, o)
        },
        mergeLocaleMessage(i, o) {
            e.mergeLocaleMessage(i, o)
        },
        d(...i) {
            return Reflect.apply(e.d, e, [...i])
        },
        getDateTimeFormat(i) {
            return e.getDateTimeFormat(i)
        },
        setDateTimeFormat(i, o) {
            e.setDateTimeFormat(i, o)
        },
        mergeDateTimeFormat(i, o) {
            e.mergeDateTimeFormat(i, o)
        },
        n(...i) {
            return Reflect.apply(e.n, e, [...i])
        },
        getNumberFormat(i) {
            return e.getNumberFormat(i)
        },
        setNumberFormat(i, o) {
            e.setNumberFormat(i, o)
        },
        mergeNumberFormat(i, o) {
            e.mergeNumberFormat(i, o)
        }
    };
    return r.__extender = n,
    r.__enableEmitter = i => {
        const o = e;
        o[gl] && o[gl](i)
    }
    ,
    r.__disableEmitter = () => {
        const i = e;
        i[od] && i[od]()
    }
    ,
    r
}
function jre(t, e, n) {
    return {
        beforeCreate() {
            const r = yt();
            if (!r)
                throw Mr(Pt.UNEXPECTED_ERROR);
            const i = this.$options;
            if (i.i18n) {
                const o = i.i18n;
                if (i.__i18n && (o.__i18n = i.__i18n),
                o.__root = e,
                this === this.$root)
                    this.$i18n = aA(t, o);
                else {
                    o.__injectWithOption = !0,
                    o.__extender = n.__vueI18nExtend,
                    this.$i18n = g_(o);
                    const s = this.$i18n;
                    s.__extender && (s.__disposer = s.__extender(this.$i18n))
                }
            } else if (i.__i18n)
                if (this === this.$root)
                    this.$i18n = aA(t, i);
                else {
                    this.$i18n = g_({
                        __i18n: i.__i18n,
                        __injectWithOption: !0,
                        __extender: n.__vueI18nExtend,
                        __root: e
                    });
                    const o = this.$i18n;
                    o.__extender && (o.__disposer = o.__extender(this.$i18n))
                }
            else
                this.$i18n = t;
            i.__i18nGlobal && _6(e, i, i),
            this.$t = (...o) => this.$i18n.t(...o),
            this.$rt = (...o) => this.$i18n.rt(...o),
            this.$te = (o, s) => this.$i18n.te(o, s),
            this.$d = (...o) => this.$i18n.d(...o),
            this.$n = (...o) => this.$i18n.n(...o),
            this.$tm = o => this.$i18n.tm(o),
            n.__setInstance(r, this.$i18n)
        },
        mounted() {
            if (this.$el && this.$i18n) {
                const r = this.$i18n;
                this.$el.__VUE_I18N__ = r.__composer;
                const i = this.__v_emitter = Aw();
                r.__enableEmitter && r.__enableEmitter(i),
                i.on("*", ad)
            }
        },
        unmounted() {
            const r = yt();
            if (!r)
                throw Mr(Pt.UNEXPECTED_ERROR);
            const i = this.$i18n;
            this.$el && this.$el.__VUE_I18N__ && (this.__v_emitter && (this.__v_emitter.off("*", ad),
            delete this.__v_emitter),
            this.$i18n && (i.__disableEmitter && i.__disableEmitter(),
            delete this.$el.__VUE_I18N__)),
            delete this.$t,
            delete this.$rt,
            delete this.$te,
            delete this.$d,
            delete this.$n,
            delete this.$tm,
            i.__disposer && (i.__disposer(),
            delete i.__disposer,
            delete i.__extender),
            n.__deleteInstance(r),
            delete this.$i18n
        }
    }
}
function aA(t, e) {
    t.locale = e.locale || t.locale,
    t.fallbackLocale = e.fallbackLocale || t.fallbackLocale,
    t.missing = e.missing || t.missing,
    t.silentTranslationWarn = e.silentTranslationWarn || t.silentFallbackWarn,
    t.silentFallbackWarn = e.silentFallbackWarn || t.silentFallbackWarn,
    t.formatFallbackMessages = e.formatFallbackMessages || t.formatFallbackMessages,
    t.postTranslation = e.postTranslation || t.postTranslation,
    t.warnHtmlInMessage = e.warnHtmlInMessage || t.warnHtmlInMessage,
    t.escapeParameterHtml = e.escapeParameterHtml || t.escapeParameterHtml,
    t.sync = e.sync || t.sync,
    t.__composer[m6](e.pluralizationRules || t.pluralizationRules);
    const n = Rw(t.locale, {
        messages: e.messages,
        __i18n: e.__i18n
    });
    return Object.keys(n).forEach(r => t.mergeLocaleMessage(r, n[r])),
    e.datetimeFormats && Object.keys(e.datetimeFormats).forEach(r => t.mergeDateTimeFormat(r, e.datetimeFormats[r])),
    e.numberFormats && Object.keys(e.numberFormats).forEach(r => t.mergeNumberFormat(r, e.numberFormats[r])),
    t
}
const Bw = {
    tag: {
        type: [String, Object]
    },
    locale: {
        type: String
    },
    scope: {
        type: String,
        validator: t => t === "parent" || t === "global",
        default: "parent"
    },
    i18n: {
        type: Object
    }
};
function Wre({slots: t}, e) {
    return e.length === 1 && e[0] === "default" ? (t.default ? t.default() : []).reduce( (r, i) => [...r, ...i.type === Ft ? i.children : [i]], []) : e.reduce( (n, r) => {
        const i = t[r];
        return i && (n[r] = i()),
        n
    }
    , Ct())
}
function E6() {
    return Ft
}
const Yre = we({
    name: "i18n-t",
    props: Sn({
        keypath: {
            type: String,
            required: !0
        },
        plural: {
            type: [Number, String],
            validator: t => un(t) || !isNaN(t)
        }
    }, Bw),
    setup(t, e) {
        const {slots: n, attrs: r} = e
          , i = t.i18n || kw({
            useScope: t.scope,
            __useComponent: !0
        });
        return () => {
            const o = Object.keys(n).filter(f => f[0] !== "_")
              , s = Ct();
            t.locale && (s.locale = t.locale),
            t.plural !== void 0 && (s.plural = Ee(t.plural) ? +t.plural : t.plural);
            const a = Wre(e, o)
              , l = i[u_](t.keypath, a, s)
              , c = Sn(Ct(), r)
              , u = Ee(t.tag) || ot(t.tag) ? t.tag : E6();
            return Mn(u, c, l)
        }
    }
})
  , lA = Yre;
function Xre(t) {
    return Wt(t) && !Ee(t[0])
}
function S6(t, e, n, r) {
    const {slots: i, attrs: o} = e;
    return () => {
        const s = {
            part: !0
        };
        let a = Ct();
        t.locale && (s.locale = t.locale),
        Ee(t.format) ? s.key = t.format : ot(t.format) && (Ee(t.format.key) && (s.key = t.format.key),
        a = Object.keys(t.format).reduce( (d, h) => n.includes(h) ? Sn(Ct(), d, {
            [h]: t.format[h]
        }) : d, Ct()));
        const l = r(t.value, s, a);
        let c = [s.key];
        Wt(l) ? c = l.map( (d, h) => {
            const p = i[d.type]
              , y = p ? p({
                [d.type]: d.value,
                index: h,
                parts: l
            }) : [d.value];
            return Xre(y) && (y[0].key = `${d.type}-${h}`),
            y
        }
        ) : Ee(l) && (c = [l]);
        const u = Sn(Ct(), o)
          , f = Ee(t.tag) || ot(t.tag) ? t.tag : E6();
        return Mn(f, u, c)
    }
}
const Kre = we({
    name: "i18n-n",
    props: Sn({
        value: {
            type: Number,
            required: !0
        },
        format: {
            type: [String, Object]
        }
    }, Bw),
    setup(t, e) {
        const n = t.i18n || kw({
            useScope: t.scope,
            __useComponent: !0
        });
        return S6(t, e, h6, (...r) => n[d_](...r))
    }
})
  , cA = Kre;
function qre(t, e) {
    const n = t;
    if (t.mode === "composition")
        return n.__getInstance(e) || t.global;
    {
        const r = n.__getInstance(e);
        return r != null ? r.__composer : t.global.__composer
    }
}
function Zre(t) {
    const e = s => {
        Ew(jc(li.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));
        const {instance: a, value: l} = s;
        if (!a || !a.$)
            throw Mr(Pt.UNEXPECTED_ERROR);
        const c = qre(t, a.$)
          , u = uA(l);
        return [Reflect.apply(c.t, c, [...fA(u)]), c]
    }
    ;
    return {
        created: (s, a) => {
            const [l,c] = e(a);
            Li && t.global === c && (s.__i18nWatcher = ve(c.locale, () => {
                a.instance && a.instance.$forceUpdate()
            }
            )),
            s.__composer = c,
            s.textContent = l
        }
        ,
        unmounted: s => {
            Li && s.__i18nWatcher && (s.__i18nWatcher(),
            s.__i18nWatcher = void 0,
            delete s.__i18nWatcher),
            s.__composer && (s.__composer = void 0,
            delete s.__composer)
        }
        ,
        beforeUpdate: (s, {value: a}) => {
            if (s.__composer) {
                const l = s.__composer
                  , c = uA(a);
                s.textContent = Reflect.apply(l.t, l, [...fA(c)])
            }
        }
        ,
        getSSRProps: s => {
            const [a] = e(s);
            return {
                textContent: a
            }
        }
    }
}
function uA(t) {
    if (Ee(t))
        return {
            path: t
        };
    if (Ze(t)) {
        if (!("path"in t))
            throw Mr(Pt.REQUIRED_VALUE, "path");
        return t
    } else
        throw Mr(Pt.INVALID_VALUE)
}
function fA(t) {
    const {path: e, locale: n, args: r, choice: i, plural: o} = t
      , s = {}
      , a = r || {};
    return Ee(n) && (s.locale = n),
    un(i) && (s.plural = i),
    un(o) && (s.plural = o),
    [e, a, s]
}
function Jre(t, e, ...n) {
    const r = Ze(n[0]) ? n[0] : {};
    (ct(r.globalInstall) ? r.globalInstall : !0) && ([lA.name, "I18nT"].forEach(o => t.component(o, lA)),
    [cA.name, "I18nN"].forEach(o => t.component(o, cA)),
    [hA.name, "I18nD"].forEach(o => t.component(o, hA))),
    t.directive("t", Zre(e))
}
const Qre = Eo("global-vue-i18n");
function H3e(t={}) {
    const e = __VUE_I18N_LEGACY_API__ && ct(t.legacy) ? t.legacy : __VUE_I18N_LEGACY_API__;
    e && Ew(jc(li.DEPRECATE_LEGACY_MODE));
    const n = ct(t.globalInjection) ? t.globalInjection : !0
      , r = new Map
      , [i,o] = eie(t, e)
      , s = Eo("vue-i18n");
    function a(f) {
        return r.get(f) || null
    }
    function l(f, d) {
        r.set(f, d)
    }
    function c(f) {
        r.delete(f)
    }
    const u = {
        get mode() {
            return __VUE_I18N_LEGACY_API__ && e ? "legacy" : "composition"
        },
        async install(f, ...d) {
            if (f.__VUE_I18N__ = u,
            f.__VUE_I18N_SYMBOL__ = s,
            f.provide(f.__VUE_I18N_SYMBOL__, u),
            Ze(d[0])) {
                const y = d[0];
                u.__composerExtend = y.__composerExtend,
                u.__vueI18nExtend = y.__vueI18nExtend
            }
            let h = null;
            !e && n && (h = lie(f, u.global)),
            __VUE_I18N_FULL_INSTALL__ && Jre(f, u, ...d),
            __VUE_I18N_LEGACY_API__ && e && f.mixin(jre(o, o.__composer, u));
            const p = f.unmount;
            f.unmount = () => {
                h && h(),
                u.dispose(),
                p()
            }
            ;
            {
                if (!await Dre(f, u))
                    throw Mr(Pt.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);
                const v = Aw();
                if (e) {
                    const g = o;
                    g.__enableEmitter && g.__enableEmitter(v)
                } else {
                    const g = o;
                    g[gl] && g[gl](v)
                }
                v.on("*", ad)
            }
        },
        get global() {
            return o
        },
        dispose() {
            i.stop()
        },
        __instances: r,
        __getInstance: a,
        __setInstance: l,
        __deleteInstance: c
    };
    return u
}
function kw(t={}) {
    const e = yt();
    if (e == null)
        throw Mr(Pt.MUST_BE_CALL_SETUP_TOP);
    if (!e.isCE && e.appContext.app != null && !e.appContext.app.__VUE_I18N_SYMBOL__)
        throw Mr(Pt.NOT_INSTALLED);
    const n = tie(e)
      , r = rie(n)
      , i = y6(e)
      , o = nie(t, i);
    if (o === "global")
        return _6(r, t, i),
        r;
    if (o === "parent") {
        let l = iie(n, e, t.__useComponent);
        return l == null && (mo(jc(li.NOT_FOUND_PARENT_SCOPE)),
        l = r),
        l
    }
    const s = n;
    let a = s.__getInstance(e);
    if (a == null) {
        const l = Sn({}, t);
        "__i18n"in i && (l.__i18n = i.__i18n),
        r && (l.__root = r),
        a = Mw(l),
        s.__composerExtend && (a[h_] = s.__composerExtend(a)),
        sie(s, e, a),
        s.__setInstance(e, a)
    } else
        o === "local" && mo(jc(li.DUPLICATE_USE_I18N_CALLING));
    return a
}
function eie(t, e) {
    const n = Pd()
      , r = __VUE_I18N_LEGACY_API__ && e ? n.run( () => g_(t)) : n.run( () => Mw(t));
    if (r == null)
        throw Mr(Pt.UNEXPECTED_ERROR);
    return [n, r]
}
function tie(t) {
    const e = dn(t.isCE ? Qre : t.appContext.app.__VUE_I18N_SYMBOL__);
    if (!e)
        throw Mr(t.isCE ? Pt.NOT_INSTALLED_WITH_PROVIDE : Pt.UNEXPECTED_ERROR);
    return e
}
function nie(t, e) {
    return Gg(t) ? "__i18n"in e ? "local" : "global" : t.useScope ? t.useScope : "local"
}
function rie(t) {
    return t.mode === "composition" ? t.global : t.global.__composer
}
function iie(t, e, n=!1) {
    let r = null;
    const i = e.root;
    let o = oie(e, n);
    for (; o != null; ) {
        const s = t;
        if (t.mode === "composition")
            r = s.__getInstance(o);
        else if (__VUE_I18N_LEGACY_API__) {
            const a = s.__getInstance(o);
            a != null && (r = a.__composer,
            n && r && !r[v6] && (r = null))
        }
        if (r != null || i === o)
            break;
        o = o.parent
    }
    return r
}
function oie(t, e=!1) {
    return t == null ? null : e && t.vnode.ctx || t.parent
}
function sie(t, e, n) {
    let r = null;
    Ht( () => {
        if (e.vnode.el) {
            e.vnode.el.__VUE_I18N__ = n,
            r = Aw();
            const i = n;
            i[gl] && i[gl](r),
            r.on("*", ad)
        }
    }
    , e),
    fs( () => {
        const i = n;
        e.vnode.el && e.vnode.el.__VUE_I18N__ && (r && r.off("*", ad),
        i[od] && i[od](),
        delete e.vnode.el.__VUE_I18N__),
        t.__deleteInstance(e);
        const o = i[h_];
        o && (o(),
        delete i[h_])
    }
    , e)
}
const aie = ["locale", "fallbackLocale", "availableLocales"]
  , dA = ["t", "rt", "d", "n", "tm", "te"];
function lie(t, e) {
    const n = Object.create(null);
    return aie.forEach(i => {
        const o = Object.getOwnPropertyDescriptor(e, i);
        if (!o)
            throw Mr(Pt.UNEXPECTED_ERROR);
        const s = pt(o.value) ? {
            get() {
                return o.value.value
            },
            set(a) {
                o.value.value = a
            }
        } : {
            get() {
                return o.get && o.get()
            }
        };
        Object.defineProperty(n, i, s)
    }
    ),
    t.config.globalProperties.$i18n = n,
    dA.forEach(i => {
        const o = Object.getOwnPropertyDescriptor(e, i);
        if (!o || !o.value)
            throw Mr(Pt.UNEXPECTED_ERROR);
        Object.defineProperty(t.config.globalProperties, `$${i}`, o)
    }
    ),
    () => {
        delete t.config.globalProperties.$i18n,
        dA.forEach(i => {
            delete t.config.globalProperties[`$${i}`]
        }
        )
    }
}
const cie = we({
    name: "i18n-d",
    props: Sn({
        value: {
            type: [Number, Date],
            required: !0
        },
        format: {
            type: [String, Object]
        }
    }, Bw),
    setup(t, e) {
        const n = t.i18n || kw({
            useScope: t.scope,
            __useComponent: !0
        });
        return S6(t, e, d6, (...r) => n[f_](...r))
    }
})
  , hA = cie;
Are();
ire(Nne);
ore(Qne);
sre(r6);
{
    const t = Ha();
    t.__INTLIFY__ = !0,
    Fne(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)
}
var V3e = {
    name: "Name",
    tel: "Phone",
    save: "Save",
    clear: "Clear",
    cancel: "Cancel",
    confirm: "Confirm",
    delete: "Delete",
    loading: "Loading...",
    noCoupon: "No coupons",
    nameEmpty: "Please fill in the name",
    addContact: "Add contact",
    telInvalid: "Malformed phone number",
    vanCalendar: {
        end: "End",
        start: "Start",
        title: "Calendar",
        weekdays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
        monthTitle: (t, e) => `${t}/${e}`,
        rangePrompt: t => `Choose no more than ${t} days`
    },
    vanCascader: {
        select: "Select"
    },
    vanPagination: {
        prev: "Previous",
        next: "Next"
    },
    vanPullRefresh: {
        pulling: "Pull to refresh...",
        loosing: "Loose to refresh..."
    },
    vanSubmitBar: {
        label: "Total:"
    },
    vanCoupon: {
        unlimited: "Unlimited",
        discount: t => `${t * 10}% off`,
        condition: t => `At least ${t}`
    },
    vanCouponCell: {
        title: "Coupon",
        count: t => `You have ${t} coupons`
    },
    vanCouponList: {
        exchange: "Exchange",
        close: "Close",
        enable: "Available",
        disabled: "Unavailable",
        placeholder: "Coupon code"
    },
    vanAddressEdit: {
        area: "Area",
        areaEmpty: "Please select a receiving area",
        addressEmpty: "Address can not be empty",
        addressDetail: "Address",
        defaultAddress: "Set as the default address"
    },
    vanAddressList: {
        add: "Add new address"
    }
}
  , z3e = {
    name: "Имя",
    tel: "Телефон",
    save: "Сохранить",
    clear: "Прозрачный",
    cancel: "Отмена",
    confirm: "Подтвердить",
    delete: "Удалить",
    loading: "Загрузка...",
    noCoupon: "Нет купонов",
    nameEmpty: "Пожалуйста укажите имя",
    addContact: "Создать контакт",
    telInvalid: "Некорректный номер телефона",
    vanCalendar: {
        end: "Конец",
        start: "Начало",
        title: "Календарь",
        weekdays: ["ВС", "ПН", "ВТ", "СР", "ЧТ", "ПТ", "СБ"],
        monthTitle: (t, e) => `${t}/${e}`,
        rangePrompt: t => `Укажите более ${t} дней`
    },
    vanCascader: {
        select: "Выбрать"
    },
    vanPagination: {
        prev: "Назад",
        next: "Вперед"
    },
    vanPullRefresh: {
        pulling: "Потяните для обновления...",
        loosing: "Отпустите для обновления..."
    },
    vanSubmitBar: {
        label: "Всего:"
    },
    vanCoupon: {
        unlimited: "Безлимитный",
        discount: t => `${t * 10}% скидка`,
        condition: t => `Как минимум ${t}`
    },
    vanCouponCell: {
        title: "Купон",
        count: t => `У вас есть ${t} купонов`
    },
    vanCouponList: {
        exchange: "Обмен",
        close: "Закрыть",
        enable: "Доступно",
        disabled: "Недоступно",
        placeholder: "Код купона"
    },
    vanAddressEdit: {
        area: "Область",
        areaEmpty: "Укажите зону доставки",
        addressEmpty: "Адрес не может быть пустым",
        addressDetail: "Адрес",
        defaultAddress: "Сделать адресом по умолчанию"
    },
    vanAddressList: {
        add: "Новый адрес"
    }
}
  , j3e = {
    name: "tên",
    tel: "Điện thoại",
    save: "Cứu",
    clear: "Thông thoáng",
    cancel: "Hủy bỏ",
    confirm: "Xác nhận",
    delete: "Xóa",
    loading: "Đang tải ...",
    noCoupon: "Không có phiếu giảm giá",
    nameEmpty: "Vui lòng điền vào tên",
    addContact: "Thêm liên hệ",
    telInvalid: "Số điện thoại không đúng định dạng",
    vanCalendar: {
        end: "Kết thúc",
        start: "Bắt ​​đầu",
        title: "Lịch",
        weekdays: ["chủ nhật", "thứ hai", "thứ ba", "Thứ Tư", "Thứ năm", "Thứ sáu", "thứ bảy"],
        monthTitle: (t, e) => `${t}/${e}`,
        rangePrompt: t => `Chọn không quá ${t} ngày`
    },
    vanCascader: {
        select: "Chọn"
    },
    vanPagination: {
        prev: "Trước đó",
        next: "Tiếp theo"
    },
    vanPullRefresh: {
        pulling: "Kéo để làm mới ...",
        loosing: "Loose để làm mới ..."
    },
    vanSubmitBar: {
        label: "Tổng:"
    },
    vanCoupon: {
        unlimited: "Không giới hạn",
        discount: t => `Chiết khấu ${t * 10}%`,
        condition: t => `Ít nhất ${t}`
    },
    vanCouponCell: {
        title: "Phiếu giảm giá",
        count: t => `Bạn có ${t} phiếu giảm giá`
    },
    vanCouponList: {
        exchange: "Trao đổi",
        close: "Đóng",
        enable: "Có sẵn",
        disabled: "Không khả dụng",
        placeholder: "Mã phiếu thưởng"
    },
    vanAddressEdit: {
        area: "Khu vực",
        areaEmpty: "Vui lòng chọn khu vực nhận hàng",
        addressEmpty: "Địa chỉ không được để trống",
        addressDetail: "Địa chỉ",
        defaultAddress: "Đặt làm địa chỉ mặc định"
    },
    vanAddressList: {
        add: "Thêm địa chỉ mới"
    }
}
  , W3e = {
    name: "Nama",
    tel: "Telepon",
    save: "Simpan",
    clear: "Jernih",
    cancel: "Batal",
    confirm: "Konfirmasi",
    delete: "Hapus",
    loading: "Memuat...",
    noCoupon: "Tidak ada kupon",
    nameEmpty: "Silakan isi nama",
    addContact: "Tambahkan kontak",
    telInvalid: "Nomor telepon salah format",
    vanCalendar: {
        end: "Akhir",
        start: "Mulai",
        title: "Kalender",
        weekdays: ["minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"],
        monthTitle: (t, e) => `${t}/${e}`,
        rangePrompt: t => `Pilih tidak lebih dari ${t} hari`
    },
    vanCascader: {
        select: "Pilih"
    },
    vanPagination: {
        prev: "Sebelumnya",
        next: "Selanjutnya"
    },
    vanPullRefresh: {
        pulling: "Tarik untuk menyegarkan...",
        loosing: "Loose untuk menyegarkan..."
    },
    vanSubmitBar: {
        label: "Jumlah:"
    },
    vanCoupon: {
        unlimited: "Tidak terbatas",
        discount: t => `${t * 10}% off`,
        condition: t => `Setidaknya ${t}`
    },
    vanCouponCell: {
        title: "Kupon",
        count: t => `Anda memiliki kupon ${t}`
    },
    vanCouponList: {
        exchange: "Pertukaran",
        close: "Tutup",
        enable: "Tersedia",
        disabled: "Tidak tersedia",
        placeholder: "Kode kupon"
    },
    vanAddressEdit: {
        area: "Daerah",
        areaEmpty: "Silakan pilih area penerima",
        addressEmpty: "Alamat tidak boleh kosong",
        addressDetail: "Alamat",
        defaultAddress: "Tetapkan sebagai alamat default"
    },
    vanAddressList: {
        add: "Tambahkan alamat baru"
    }
}
  , Y3e = {
    name: "नाम",
    tel: "फ़ोन",
    save: "सहेजें",
    clear: "साफ़",
    cancel: "रद्द करें",
    confirm: "पुष्टि करना",
    delete: "हटाएं",
    loading: "लोड हो रहा है...",
    noCoupon: "कोई कूपन नहीं",
    nameEmpty: "कृपया नाम भरें",
    addContact: "संपर्क जोड़ें",
    telInvalid: "विकृत फ़ोन नंबर",
    vanCalendar: {
        end: "समाप्त",
        start: "शुरू",
        title: "पंचांग",
        weekdays: ["रविवार", "सोमवार", "मंगलवार", "बुधवार", "गुरूवार", "शुक्रवार", "शनिवार"],
        monthTitle: (t, e) => `${t}/${e}`,
        rangePrompt: t => `${t} दिन से अधिक नहीं चुनें`
    },
    vanCascader: {
        select: "चुनते हैं"
    },
    vanPagination: {
        prev: "पहले का",
        next: "अगला"
    },
    vanPullRefresh: {
        pulling: "रीफ़्रेश करने के लिए खींचें...",
        loosing: "ताज़ा करने के लिए ढीला..."
    },
    vanSubmitBar: {
        label: "कुल:"
    },
    vanCoupon: {
        unlimited: "असीमित",
        discount: t => `${t * 10}% छूट`,
        condition: t => `कम से कम ${t}`
    },
    vanCouponCell: {
        title: "कूपन",
        count: t => `आपके पास ${t} कूपन हैं`
    },
    vanCouponList: {
        exchange: "अदला बदली",
        close: "बंद करे",
        enable: "उपलब्ध",
        disabled: "अनुपलब्ध",
        placeholder: "कूपन कोड"
    },
    vanAddressEdit: {
        area: "क्षेत्र",
        areaEmpty: "कृपया एक क्षेत्र चुनें",
        addressEmpty: "पता खाली नहीं हो सकता",
        addressDetail: "पता",
        defaultAddress: "डिफ़ॉल्ट पते के रूप में सेट करें"
    },
    vanAddressList: {
        add: "नया पता जोड़ें"
    }
}
  , X3e = {
    name: "ชื่อ",
    tel: "โทรศัพท์",
    save: "บันทึก",
    clear: "ชัดเจน",
    cancel: "ยกเลิก",
    confirm: "ยืนยัน",
    delete: "ลบ",
    loading: "กำลังโหลด...",
    noCoupon: "ไม่มีคูปอง",
    nameEmpty: "กรุณากรอกชื่อของคุณ",
    addContact: "เพิ่มผู้ติดต่อ",
    telInvalid: "กรุณากรอกหมายเลขโทรศัพท์ที่ถูกต้อง",
    vanCalendar: {
        end: "จบ",
        start: "เริ่ม",
        title: "การเลือกวันที่",
        weekdays: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส"],
        monthTitle: (t, e) => `${t}ปี${e}เดือน`,
        rangePrompt: t => `จำนวนวันที่เลือกต้องไม่เกิน ${t} วัน`
    },
    vanCascader: {
        select: "โปรดเลือก"
    },
    vanPagination: {
        prev: "หน้าที่แล้ว",
        next: "หน้าต่อไป"
    },
    vanPullRefresh: {
        pulling: "ดึงลงเพื่อรีเฟรช...",
        loosing: "ปล่อยเพื่อรีเฟรช..."
    },
    vanSubmitBar: {
        label: "รวม:"
    },
    vanCoupon: {
        unlimited: "ไม่ จำกัด",
        discount: t => `ลด${t}`,
        condition: t => `มีจำหน่ายในราคา ${t} กว่าหยวน`
    },
    vanCouponCell: {
        title: "คูปอง",
        count: t => `มีรูปภาพ ${t} รูป`
    },
    vanCouponList: {
        exchange: "แลกเปลี่ยน",
        close: "ไม่ได้ใช้",
        enable: "พร้อมใช้งาน",
        disabled: "ไม่พร้อมใช้งาน",
        placeholder: "กรุณากรอกรหัสคูปอง"
    },
    vanAddressEdit: {
        area: "พื้นที่",
        areaEmpty: "โปรดเลือกภูมิภาค",
        addressEmpty: "กรุณากรอกที่อยู่โดยละเอียด",
        addressDetail: "ที่อยู่",
        defaultAddress: "ตั้งเป็นที่อยู่จัดส่งเริ่มต้น"
    },
    vanAddressList: {
        add: "เพิ่มที่อยู่"
    }
}
  , K3e = {
    name: "Nome",
    tel: "Fone",
    save: "Salvar",
    clear: "Claro",
    cancel: "Cancelar",
    confirm: "Confirmar",
    delete: "Excluir",
    loading: "Carregando...",
    noCoupon: "Nenhum cupom",
    nameEmpty: "Por favor, preencha o nome",
    addContact: "Adicionar novo contato",
    telInvalid: "Telefone em formato inválido",
    vanCalendar: {
        end: "Fim",
        start: "Início",
        title: "Calendário",
        weekdays: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
        monthTitle: (t, e) => `${e}/${t}`,
        rangePrompt: t => `Escolha no máximo ${t} dias`
    },
    vanCascader: {
        select: "Selecione"
    },
    vanPagination: {
        prev: "Anterior",
        next: "Próximo"
    },
    vanPullRefresh: {
        pulling: "Puxe para atualizar...",
        loosing: "Solte para atualizar..."
    },
    vanSubmitBar: {
        label: "Total:"
    },
    vanCoupon: {
        unlimited: "Ilimitado",
        discount: t => `${t * 10}% de desconto`,
        condition: t => `Pelo menos ${t}`
    },
    vanCouponCell: {
        title: "Cupom",
        count: t => `Você possui ${t} cupom(ns)`
    },
    vanCouponList: {
        exchange: "Usar",
        close: "Fechar",
        enable: "Disponível",
        disabled: "Indisponível",
        placeholder: "Código do cupom"
    },
    vanAddressEdit: {
        area: "Área",
        areaEmpty: "Por favor, selecione uma área de recebimento",
        addressEmpty: "Endereço não pode ser vazio",
        addressDetail: "Endereço",
        defaultAddress: "Usar como endereço padrão"
    },
    vanAddressList: {
        add: "Adicionar novo endereço"
    }
}
  , q3e = {
    name: "নাম",
    tel: "ফোন",
    save: "সংরক্ষণ করুন",
    clear: "পরিষ্কার",
    cancel: "বাতিল",
    confirm: "নিশ্চিত করুন",
    delete: "মুছুন",
    loading: "লোড হচ্ছে...",
    noCoupon: "কোন কুপন নেই",
    nameEmpty: "অনুগ্রহ করে নামটি পূরণ করুন",
    addContact: "যোগাযোগ যোগ করুন",
    telInvalid: "বিকৃত ফোন নম্বর",
    vanCalendar: {
        end: "শেষ",
        start: "শুরু",
        title: "ক্যালেন্ডার",
        weekdays: ["রবিবার", "সোমবার", "মঙ্গলবার", "বুধবার", "বৃহস্পতিবার", "শুক্রবার", "শনিবার"],
        monthTitle: (t, e) => `${t}/${e}`,
        rangePrompt: t => `${t} দিনের বেশি নির্বাচন করবেন না`
    },
    vanCascader: {
        select: "নির্বাচন"
    },
    vanPagination: {
        prev: "পূর্ববর্তী",
        next: "পরবর্তী"
    },
    vanPullRefresh: {
        pulling: "রিফ্রেশ করতে টানুন...",
        loosing: "রিফ্রেশ করতে আলগা..."
    },
    vanSubmitBar: {
        label: "মোট:"
    },
    vanCoupon: {
        unlimited: "আনলিমিটেড",
        discount: t => `${t * 10}% ছাড়`,
        condition: t => `অন্তত ${t}`
    },
    vanCouponCell: {
        title: "কুপন",
        count: t => `আপনার ${t} কুপন আছে`
    },
    vanCouponList: {
        exchange: "বিনিময়",
        close: "বন্ধ",
        enable: "উপলভ্য",
        disabled: "অনুপলব্ধ",
        placeholder: "কুপন কোড"
    },
    vanAddressEdit: {
        area: "এরিয়া",
        areaEmpty: "অনুগ্রহ করে একটি রিসিভিং এলাকা নির্বাচন করুন",
        addressEmpty: "ঠিকানা খালি হতে পারে না",
        addressDetail: "ঠিকানা",
        defaultAddress: "ডিফল্ট ঠিকানা হিসাবে সেট করুন"
    },
    vanAddressList: {
        add: "নতুন ঠিকানা যোগ করুন"
    }
}
  , Z3e = {
    name: "الاسم",
    tel: "الهاتف",
    save: "حفظ",
    clear: "مسح",
    cancel: "إلغاء",
    confirm: "تأكيد",
    delete: "حذف",
    loading: "جار التحميل...",
    noCoupon: "لا يوجد كوبونات",
    nameEmpty: "يرجى ملء الاسم",
    addContact: "إضافة جهة اتصال",
    telInvalid: "رقم الهاتف غير صحيح",
    vanCalendar: {
        end: "نهاية",
        start: "بداية",
        title: "التقويم",
        weekdays: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"],
        monthTitle: (t, e) => `${t}/${e}`,
        rangePrompt: t => `اختر لا يزيد عن ${t} أيام`
    },
    vanCascader: {
        select: "اختر"
    },
    vanPagination: {
        prev: "السابق",
        next: "التالي"
    },
    vanPullRefresh: {
        pulling: "اسحب للتحديث...",
        loosing: "أفلت للتحديث..."
    },
    vanSubmitBar: {
        label: "المجموع:"
    },
    vanCoupon: {
        unlimited: "غير محدود",
        discount: t => `${t * 10}% خصم`,
        condition: t => `على الأقل ${t}`
    },
    vanCouponCell: {
        title: "كوبون",
        count: t => `لديك ${t} كوبونات`
    },
    vanCouponList: {
        exchange: "استبدال",
        close: "إغلاق",
        enable: "متاح",
        disabled: "غير متاح",
        placeholder: "كود الكوبون"
    },
    vanAddressEdit: {
        area: "المنطقة",
        areaEmpty: "يرجى اختيار منطقة استقبال",
        addressEmpty: "العنوان لا يمكن أن يكون فارغًا",
        addressDetail: "العنوان",
        defaultAddress: "تعيين كعنوان افتراضي"
    },
    vanAddressList: {
        add: "إضافة عنوان جديد"
    }
};
function na(t) {
    return Id() ? (Wx(t),
    !0) : !1
}
function J3e(t) {
    let e = !1, n;
    const r = Pd(!0);
    return (...i) => (e || (n = r.run( () => t(...i)),
    e = !0),
    n)
}
function pr(t) {
    return typeof t == "function" ? t() : dr(t)
}
const ra = typeof window < "u" && typeof document < "u"
  , Q3e = typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope
  , uie = t => typeof t < "u"
  , fie = t => t != null
  , die = Object.prototype.toString
  , hie = t => die.call(t) === "[object Object]"
  , Vr = () => {}
  , m_ = pie();
function pie() {
    var t, e;
    return ra && ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent))
}
function Nw(t, e) {
    function n(...r) {
        return new Promise( (i, o) => {
            Promise.resolve(t( () => e.apply(this, r), {
                fn: e,
                thisArg: this,
                args: r
            })).then(i).catch(o)
        }
        )
    }
    return n
}
const C6 = t => t();
function A6(t, e={}) {
    let n, r, i = Vr;
    const o = a => {
        clearTimeout(a),
        i(),
        i = Vr
    }
    ;
    return a => {
        const l = pr(t)
          , c = pr(e.maxWait);
        return n && o(n),
        l <= 0 || c !== void 0 && c <= 0 ? (r && (o(r),
        r = null),
        Promise.resolve(a())) : new Promise( (u, f) => {
            i = e.rejectOnCancel ? f : u,
            c && !r && (r = setTimeout( () => {
                n && o(n),
                r = null,
                u(a())
            }
            , c)),
            n = setTimeout( () => {
                r && o(r),
                r = null,
                u(a())
            }
            , l)
        }
        )
    }
}
function gie(...t) {
    let e = 0, n, r = !0, i = Vr, o, s, a, l, c;
    !pt(t[0]) && typeof t[0] == "object" ? {delay: s, trailing: a=!0, leading: l=!0, rejectOnCancel: c=!1} = t[0] : [s,a=!0,l=!0,c=!1] = t;
    const u = () => {
        n && (clearTimeout(n),
        n = void 0,
        i(),
        i = Vr)
    }
    ;
    return d => {
        const h = pr(s)
          , p = Date.now() - e
          , y = () => o = d();
        return u(),
        h <= 0 ? (e = Date.now(),
        y()) : (p > h && (l || !r) ? (e = Date.now(),
        y()) : a && (o = new Promise( (v, g) => {
            i = c ? g : v,
            n = setTimeout( () => {
                e = Date.now(),
                r = !0,
                v(y()),
                u()
            }
            , Math.max(0, h - p))
        }
        )),
        !l && !n && (n = setTimeout( () => r = !0, h)),
        r = !1,
        o)
    }
}
function mie(t=C6) {
    const e = Z(!0);
    function n() {
        e.value = !1
    }
    function r() {
        e.value = !0
    }
    const i = (...o) => {
        e.value && t(...o)
    }
    ;
    return {
        isActive: Il(e),
        pause: n,
        resume: r,
        eventFilter: i
    }
}
function vie(t) {
    let e;
    function n() {
        return e || (e = t()),
        e
    }
    return n.reset = async () => {
        const r = e;
        e = void 0,
        r && await r
    }
    ,
    n
}
function yie(t) {
    return t || yt()
}
function T6(...t) {
    if (t.length !== 1)
        return ff(...t);
    const e = t[0];
    return typeof e == "function" ? Il(r4( () => ({
        get: e,
        set: Vr
    }))) : Z(e)
}
function ePe(t, e=200, n={}) {
    return Nw(A6(e, n), t)
}
function tPe(t, e=200, n=!1, r=!0, i=!1) {
    return Nw(gie(e, n, r, i), t)
}
function P6(t, e, n={}) {
    const {eventFilter: r=C6, ...i} = n;
    return ve(t, Nw(r, e), i)
}
function I6(t, e, n={}) {
    const {eventFilter: r, ...i} = n
      , {eventFilter: o, pause: s, resume: a, isActive: l} = mie(r);
    return {
        stop: P6(t, e, {
            ...i,
            eventFilter: o
        }),
        pause: s,
        resume: a,
        isActive: l
    }
}
function Fw(t, e=!0, n) {
    yie() ? Ht(t, n) : e ? t() : Xe(t)
}
function nPe(t, e) {
    return re( () => pr(t).map(n => pr(n)).filter(e))
}
function rPe(t, e=1e3, n={}) {
    const {immediate: r=!0, immediateCallback: i=!1} = n;
    let o = null;
    const s = Z(!1);
    function a() {
        o && (clearInterval(o),
        o = null)
    }
    function l() {
        s.value = !1,
        a()
    }
    function c() {
        const u = pr(e);
        u <= 0 || (s.value = !0,
        i && t(),
        a(),
        o = setInterval(t, u))
    }
    if (r && ra && c(),
    pt(e) || typeof e == "function") {
        const u = ve(e, () => {
            s.value && ra && c()
        }
        );
        na(u)
    }
    return na(l),
    {
        isActive: s,
        pause: l,
        resume: c
    }
}
function _ie(t, e, n={}) {
    const {immediate: r=!0} = n
      , i = Z(!1);
    let o = null;
    function s() {
        o && (clearTimeout(o),
        o = null)
    }
    function a() {
        i.value = !1,
        s()
    }
    function l(...c) {
        s(),
        i.value = !0,
        o = setTimeout( () => {
            i.value = !1,
            o = null,
            t(...c)
        }
        , pr(e))
    }
    return r && (i.value = !0,
    ra && l()),
    na(a),
    {
        isPending: Il(i),
        start: l,
        stop: a
    }
}
function iPe(t, e, n={}) {
    const {debounce: r=0, maxWait: i=void 0, ...o} = n;
    return P6(t, e, {
        ...o,
        eventFilter: A6(r, {
            maxWait: i
        })
    })
}
function io(t) {
    var e;
    const n = pr(t);
    return (e = n == null ? void 0 : n.$el) != null ? e : n
}
const vo = ra ? window : void 0
  , O6 = ra ? window.document : void 0
  , R6 = ra ? window.navigator : void 0;
function Zn(...t) {
    let e, n, r, i;
    if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n,r,i] = t,
    e = vo) : [e,n,r,i] = t,
    !e)
        return Vr;
    Array.isArray(n) || (n = [n]),
    Array.isArray(r) || (r = [r]);
    const o = []
      , s = () => {
        o.forEach(u => u()),
        o.length = 0
    }
      , a = (u, f, d, h) => (u.addEventListener(f, d, h),
    () => u.removeEventListener(f, d, h))
      , l = ve( () => [io(e), pr(i)], ([u,f]) => {
        if (s(),
        !u)
            return;
        const d = hie(f) ? {
            ...f
        } : f;
        o.push(...n.flatMap(h => r.map(p => a(u, h, p, d))))
    }
    , {
        immediate: !0,
        flush: "post"
    })
      , c = () => {
        l(),
        s()
    }
    ;
    return na(c),
    c
}
let pA = !1;
function oPe(t, e, n={}) {
    const {window: r=vo, ignore: i=[], capture: o=!0, detectIframe: s=!1} = n;
    if (!r)
        return Vr;
    m_ && !pA && (pA = !0,
    Array.from(r.document.body.children).forEach(d => d.addEventListener("click", Vr)),
    r.document.documentElement.addEventListener("click", Vr));
    let a = !0;
    const l = d => i.some(h => {
        if (typeof h == "string")
            return Array.from(r.document.querySelectorAll(h)).some(p => p === d.target || d.composedPath().includes(p));
        {
            const p = io(h);
            return p && (d.target === p || d.composedPath().includes(p))
        }
    }
    )
      , u = [Zn(r, "click", d => {
        const h = io(t);
        if (!(!h || h === d.target || d.composedPath().includes(h))) {
            if (d.detail === 0 && (a = !l(d)),
            !a) {
                a = !0;
                return
            }
            e(d)
        }
    }
    , {
        passive: !0,
        capture: o
    }), Zn(r, "pointerdown", d => {
        const h = io(t);
        a = !l(d) && !!(h && !d.composedPath().includes(h))
    }
    , {
        passive: !0
    }), s && Zn(r, "blur", d => {
        setTimeout( () => {
            var h;
            const p = io(t);
            ((h = r.document.activeElement) == null ? void 0 : h.tagName) === "IFRAME" && !(p != null && p.contains(r.document.activeElement)) && e(d)
        }
        , 0)
    }
    )].filter(Boolean);
    return () => u.forEach(d => d())
}
function xie() {
    const t = Z(!1)
      , e = yt();
    return e && Ht( () => {
        t.value = !0
    }
    , e),
    t
}
function zg(t) {
    const e = xie();
    return re( () => (e.value,
    !!t()))
}
function bie(t, e, n={}) {
    const {window: r=vo, ...i} = n;
    let o;
    const s = zg( () => r && "MutationObserver"in r)
      , a = () => {
        o && (o.disconnect(),
        o = void 0)
    }
      , l = re( () => {
        const d = pr(t)
          , h = (Array.isArray(d) ? d : [d]).map(io).filter(fie);
        return new Set(h)
    }
    )
      , c = ve( () => l.value, d => {
        a(),
        s.value && d.size && (o = new MutationObserver(e),
        d.forEach(h => o.observe(h, i)))
    }
    , {
        immediate: !0,
        flush: "post"
    })
      , u = () => o == null ? void 0 : o.takeRecords()
      , f = () => {
        a(),
        c()
    }
    ;
    return na(f),
    {
        isSupported: s,
        stop: f,
        takeRecords: u
    }
}
function sPe(t, e) {
    const {interrupt: n=!0, onError: r=Vr, onFinished: i=Vr, signal: o} = e || {}
      , s = {
        aborted: "aborted",
        fulfilled: "fulfilled",
        pending: "pending",
        rejected: "rejected"
    }
      , a = Array.from(Array.from({
        length: t.length
    }), () => ({
        state: s.pending,
        data: null
    }))
      , l = Mt(a)
      , c = Z(-1);
    if (!t || t.length === 0)
        return i(),
        {
            activeIndex: c,
            result: l
        };
    function u(f, d) {
        c.value++,
        l[c.value].data = d,
        l[c.value].state = f
    }
    return t.reduce( (f, d) => f.then(h => {
        var p;
        if (o != null && o.aborted) {
            u(s.aborted, new Error("aborted"));
            return
        }
        if (((p = l[c.value]) == null ? void 0 : p.state) === s.rejected && n) {
            i();
            return
        }
        const y = d(h).then(v => (u(s.fulfilled, v),
        c.value === t.length - 1 && i(),
        v));
        return o ? Promise.race([y, wie(o)]) : y
    }
    ).catch(h => o != null && o.aborted ? (u(s.aborted, h),
    h) : (u(s.rejected, h),
    r(),
    h)), Promise.resolve()),
    {
        activeIndex: c,
        result: l
    }
}
function wie(t) {
    return new Promise( (e, n) => {
        const r = new Error("aborted");
        t.aborted ? n(r) : t.addEventListener("abort", () => n(r), {
            once: !0
        })
    }
    )
}
function gA(t, e={}) {
    const {controls: n=!1, navigator: r=R6} = e
      , i = zg( () => r && "permissions"in r);
    let o;
    const s = typeof t == "string" ? {
        name: t
    } : t
      , a = Z()
      , l = () => {
        o && (a.value = o.state)
    }
      , c = vie(async () => {
        if (i.value) {
            if (!o)
                try {
                    o = await r.permissions.query(s),
                    Zn(o, "change", l),
                    l()
                } catch {
                    a.value = "prompt"
                }
            return o
        }
    }
    );
    return c(),
    n ? {
        state: a,
        isSupported: i,
        query: c
    } : a
}
function aPe(t={}) {
    const {navigator: e=R6, read: n=!1, source: r, copiedDuring: i=1500, legacy: o=!1} = t
      , s = zg( () => e && "clipboard"in e)
      , a = gA("clipboard-read")
      , l = gA("clipboard-write")
      , c = re( () => s.value || o)
      , u = Z("")
      , f = Z(!1)
      , d = _ie( () => f.value = !1, i);
    function h() {
        s.value && g(a.value) ? e.clipboard.readText().then(m => {
            u.value = m
        }
        ) : u.value = v()
    }
    c.value && n && Zn(["copy", "cut"], h);
    async function p(m=pr(r)) {
        c.value && m != null && (s.value && g(l.value) ? await e.clipboard.writeText(m) : y(m),
        u.value = m,
        f.value = !0,
        d.start())
    }
    function y(m) {
        const _ = document.createElement("textarea");
        _.value = m ?? "",
        _.style.position = "absolute",
        _.style.opacity = "0",
        document.body.appendChild(_),
        _.select(),
        document.execCommand("copy"),
        _.remove()
    }
    function v() {
        var m, _, x;
        return (x = (_ = (m = document == null ? void 0 : document.getSelection) == null ? void 0 : m.call(document)) == null ? void 0 : _.toString()) != null ? x : ""
    }
    function g(m) {
        return m === "granted" || m === "prompt"
    }
    return {
        isSupported: c,
        text: u,
        copied: f,
        copy: p
    }
}
function Eie(t) {
    return JSON.parse(JSON.stringify(t))
}
const zh = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}
  , jh = "__vueuse_ssr_handlers__"
  , Sie = Cie();
function Cie() {
    return jh in zh || (zh[jh] = zh[jh] || {}),
    zh[jh]
}
function Aie(t, e) {
    return Sie[t] || e
}
function Tie(t) {
    return t == null ? "any" : t instanceof Set ? "set" : t instanceof Map ? "map" : t instanceof Date ? "date" : typeof t == "boolean" ? "boolean" : typeof t == "string" ? "string" : typeof t == "object" ? "object" : Number.isNaN(t) ? "any" : "number"
}
const Pie = {
    boolean: {
        read: t => t === "true",
        write: t => String(t)
    },
    object: {
        read: t => JSON.parse(t),
        write: t => JSON.stringify(t)
    },
    number: {
        read: t => Number.parseFloat(t),
        write: t => String(t)
    },
    any: {
        read: t => t,
        write: t => String(t)
    },
    string: {
        read: t => t,
        write: t => String(t)
    },
    map: {
        read: t => new Map(JSON.parse(t)),
        write: t => JSON.stringify(Array.from(t.entries()))
    },
    set: {
        read: t => new Set(JSON.parse(t)),
        write: t => JSON.stringify(Array.from(t))
    },
    date: {
        read: t => new Date(t),
        write: t => t.toISOString()
    }
}
  , mA = "vueuse-storage";
function M6(t, e, n, r={}) {
    var i;
    const {flush: o="pre", deep: s=!0, listenToStorageChanges: a=!0, writeDefaults: l=!0, mergeDefaults: c=!1, shallow: u, window: f=vo, eventFilter: d, onError: h=C => {
        console.error(C)
    }
    , initOnMounted: p} = r
      , y = (u ? ig : Z)(typeof e == "function" ? e() : e);
    if (!n)
        try {
            n = Aie("getDefaultStorage", () => {
                var C;
                return (C = vo) == null ? void 0 : C.localStorage
            }
            )()
        } catch (C) {
            h(C)
        }
    if (!n)
        return y;
    const v = pr(e)
      , g = Tie(v)
      , m = (i = r.serializer) != null ? i : Pie[g]
      , {pause: _, resume: x} = I6(y, () => w(y.value), {
        flush: o,
        deep: s,
        eventFilter: d
    });
    f && a && Fw( () => {
        Zn(f, "storage", S),
        Zn(f, mA, P),
        p && S()
    }
    ),
    p || S();
    function b(C, A) {
        f && f.dispatchEvent(new CustomEvent(mA,{
            detail: {
                key: t,
                oldValue: C,
                newValue: A,
                storageArea: n
            }
        }))
    }
    function w(C) {
        try {
            const A = n.getItem(t);
            if (C == null)
                b(A, null),
                n.removeItem(t);
            else {
                const T = m.write(C);
                A !== T && (n.setItem(t, T),
                b(A, T))
            }
        } catch (A) {
            h(A)
        }
    }
    function E(C) {
        const A = C ? C.newValue : n.getItem(t);
        if (A == null)
            return l && v != null && n.setItem(t, m.write(v)),
            v;
        if (!C && c) {
            const T = m.read(A);
            return typeof c == "function" ? c(T, v) : g === "object" && !Array.isArray(T) ? {
                ...v,
                ...T
            } : T
        } else
            return typeof A != "string" ? A : m.read(A)
    }
    function S(C) {
        if (!(C && C.storageArea !== n)) {
            if (C && C.key == null) {
                y.value = v;
                return
            }
            if (!(C && C.key !== t)) {
                _();
                try {
                    (C == null ? void 0 : C.newValue) !== m.write(y.value) && (y.value = E(C))
                } catch (A) {
                    h(A)
                } finally {
                    C ? Xe(x) : x()
                }
            }
        }
    }
    function P(C) {
        S(C.detail)
    }
    return y
}
function lPe(t={}) {
    const {document: e=O6} = t;
    if (!e)
        return Z("visible");
    const n = Z(e.visibilityState);
    return Zn(e, "visibilitychange", () => {
        n.value = e.visibilityState
    }
    ),
    n
}
function Iie(t, e, n={}) {
    const {window: r=vo, ...i} = n;
    let o;
    const s = zg( () => r && "ResizeObserver"in r)
      , a = () => {
        o && (o.disconnect(),
        o = void 0)
    }
      , l = re( () => Array.isArray(t) ? t.map(f => io(f)) : [io(t)])
      , c = ve(l, f => {
        if (a(),
        s.value && r) {
            o = new ResizeObserver(e);
            for (const d of f)
                d && o.observe(d, i)
        }
    }
    , {
        immediate: !0,
        flush: "post"
    })
      , u = () => {
        a(),
        c()
    }
    ;
    return na(u),
    {
        isSupported: s,
        stop: u
    }
}
function cPe(t, e={}) {
    const {reset: n=!0, windowResize: r=!0, windowScroll: i=!0, immediate: o=!0} = e
      , s = Z(0)
      , a = Z(0)
      , l = Z(0)
      , c = Z(0)
      , u = Z(0)
      , f = Z(0)
      , d = Z(0)
      , h = Z(0);
    function p() {
        const y = io(t);
        if (!y) {
            n && (s.value = 0,
            a.value = 0,
            l.value = 0,
            c.value = 0,
            u.value = 0,
            f.value = 0,
            d.value = 0,
            h.value = 0);
            return
        }
        const v = y.getBoundingClientRect();
        s.value = v.height,
        a.value = v.bottom,
        l.value = v.left,
        c.value = v.right,
        u.value = v.top,
        f.value = v.width,
        d.value = v.x,
        h.value = v.y
    }
    return Iie(t, p),
    ve( () => io(t), y => !y && p()),
    bie(t, p, {
        attributeFilter: ["style", "class"]
    }),
    i && Zn("scroll", p, {
        capture: !0,
        passive: !0
    }),
    r && Zn("resize", p, {
        passive: !0
    }),
    Fw( () => {
        o && p()
    }
    ),
    {
        height: s,
        bottom: a,
        left: l,
        right: c,
        top: u,
        width: f,
        x: d,
        y: h,
        update: p
    }
}
const Lu = new Map;
function uPe(t) {
    const e = Id();
    function n(a) {
        var l;
        const c = Lu.get(t) || new Set;
        c.add(a),
        Lu.set(t, c);
        const u = () => i(a);
        return (l = e == null ? void 0 : e.cleanups) == null || l.push(u),
        u
    }
    function r(a) {
        function l(...c) {
            i(l),
            a(...c)
        }
        return n(l)
    }
    function i(a) {
        const l = Lu.get(t);
        l && (l.delete(a),
        l.size || o())
    }
    function o() {
        Lu.delete(t)
    }
    function s(a, l) {
        var c;
        (c = Lu.get(t)) == null || c.forEach(u => u(a, l))
    }
    return {
        on: n,
        once: r,
        off: i,
        emit: s,
        reset: o
    }
}
function r1(t) {
    return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t
}
function fPe(t, e, n={}) {
    const {window: r=vo} = n;
    return M6(t, e, r == null ? void 0 : r.localStorage, n)
}
function D6(t) {
    const e = window.getComputedStyle(t);
    if (e.overflowX === "scroll" || e.overflowY === "scroll" || e.overflowX === "auto" && t.clientWidth < t.scrollWidth || e.overflowY === "auto" && t.clientHeight < t.scrollHeight)
        return !0;
    {
        const n = t.parentNode;
        return !n || n.tagName === "BODY" ? !1 : D6(n)
    }
}
function Oie(t) {
    const e = t || window.event
      , n = e.target;
    return D6(n) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(),
    !1)
}
const i1 = new WeakMap;
function dPe(t, e=!1) {
    const n = Z(e);
    let r = null
      , i = "";
    ve(T6(t), a => {
        const l = r1(pr(a));
        if (l) {
            const c = l;
            if (i1.get(c) || i1.set(c, c.style.overflow),
            c.style.overflow !== "hidden" && (i = c.style.overflow),
            c.style.overflow === "hidden")
                return n.value = !0;
            if (n.value)
                return c.style.overflow = "hidden"
        }
    }
    , {
        immediate: !0
    });
    const o = () => {
        const a = r1(pr(t));
        !a || n.value || (m_ && (r = Zn(a, "touchmove", l => {
            Oie(l)
        }
        , {
            passive: !1
        })),
        a.style.overflow = "hidden",
        n.value = !0)
    }
      , s = () => {
        const a = r1(pr(t));
        !a || !n.value || (m_ && (r == null || r()),
        a.style.overflow = i,
        i1.delete(a),
        n.value = !1)
    }
    ;
    return na(s),
    re({
        get() {
            return n.value
        },
        set(a) {
            a ? o() : s()
        }
    })
}
function hPe(t, e, n={}) {
    const {window: r=vo} = n;
    return M6(t, e, r == null ? void 0 : r.sessionStorage, n)
}
let Rie = 0;
function pPe(t, e={}) {
    const n = Z(!1)
      , {document: r=O6, immediate: i=!0, manual: o=!1, id: s=`vueuse_styletag_${++Rie}`} = e
      , a = Z(t);
    let l = () => {}
    ;
    const c = () => {
        if (!r)
            return;
        const f = r.getElementById(s) || r.createElement("style");
        f.isConnected || (f.id = s,
        e.media && (f.media = e.media),
        r.head.appendChild(f)),
        !n.value && (l = ve(a, d => {
            f.textContent = d
        }
        , {
            immediate: !0
        }),
        n.value = !0)
    }
      , u = () => {
        !r || !n.value || (l(),
        r.head.removeChild(r.getElementById(s)),
        n.value = !1)
    }
    ;
    return i && !o && Fw(c),
    o || na(u),
    {
        id: s,
        css: a,
        unload: u,
        load: c,
        isLoaded: Il(n)
    }
}
function gPe(t, e={}) {
    const {threshold: n=50, onSwipe: r, onSwipeEnd: i, onSwipeStart: o, passive: s=!0, window: a=vo} = e
      , l = Mt({
        x: 0,
        y: 0
    })
      , c = Mt({
        x: 0,
        y: 0
    })
      , u = re( () => l.x - c.x)
      , f = re( () => l.y - c.y)
      , {max: d, abs: h} = Math
      , p = re( () => d(h(u.value), h(f.value)) >= n)
      , y = Z(!1)
      , v = re( () => p.value ? h(u.value) > h(f.value) ? u.value > 0 ? "left" : "right" : f.value > 0 ? "up" : "down" : "none")
      , g = P => [P.touches[0].clientX, P.touches[0].clientY]
      , m = (P, C) => {
        l.x = P,
        l.y = C
    }
      , _ = (P, C) => {
        c.x = P,
        c.y = C
    }
    ;
    let x;
    const b = Mie(a == null ? void 0 : a.document);
    s ? x = b ? {
        passive: !0
    } : {
        capture: !1
    } : x = b ? {
        passive: !1,
        capture: !0
    } : {
        capture: !0
    };
    const w = P => {
        y.value && (i == null || i(P, v.value)),
        y.value = !1
    }
      , E = [Zn(t, "touchstart", P => {
        if (P.touches.length !== 1)
            return;
        x.capture && !x.passive && P.preventDefault();
        const [C,A] = g(P);
        m(C, A),
        _(C, A),
        o == null || o(P)
    }
    , x), Zn(t, "touchmove", P => {
        if (P.touches.length !== 1)
            return;
        const [C,A] = g(P);
        _(C, A),
        !y.value && p.value && (y.value = !0),
        y.value && (r == null || r(P))
    }
    , x), Zn(t, ["touchend", "touchcancel"], w, x)];
    return {
        isPassiveEventSupported: b,
        isSwiping: y,
        direction: v,
        coordsStart: l,
        coordsEnd: c,
        lengthX: u,
        lengthY: f,
        stop: () => E.forEach(P => P())
    }
}
function Mie(t) {
    if (!t)
        return !1;
    let e = !1;
    const n = {
        get passive() {
            return e = !0,
            !1
        }
    };
    return t.addEventListener("x", Vr, n),
    t.removeEventListener("x", Vr),
    e
}
function mPe(t="history", e={}) {
    const {initialValue: n={}, removeNullishValues: r=!0, removeFalsyValues: i=!1, write: o=!0, window: s=vo} = e;
    if (!s)
        return Mt(n);
    const a = Mt({});
    function l() {
        if (t === "history")
            return s.location.search || "";
        if (t === "hash") {
            const g = s.location.hash || ""
              , m = g.indexOf("?");
            return m > 0 ? g.slice(m) : ""
        } else
            return (s.location.hash || "").replace(/^#/, "")
    }
    function c(g) {
        const m = g.toString();
        if (t === "history")
            return `${m ? `?${m}` : ""}${s.location.hash || ""}`;
        if (t === "hash-params")
            return `${s.location.search || ""}${m ? `#${m}` : ""}`;
        const _ = s.location.hash || "#"
          , x = _.indexOf("?");
        return x > 0 ? `${_.slice(0, x)}${m ? `?${m}` : ""}` : `${_}${m ? `?${m}` : ""}`
    }
    function u() {
        return new URLSearchParams(l())
    }
    function f(g) {
        const m = new Set(Object.keys(a));
        for (const _ of g.keys()) {
            const x = g.getAll(_);
            a[_] = x.length > 1 ? x : g.get(_) || "",
            m.delete(_)
        }
        Array.from(m).forEach(_ => delete a[_])
    }
    const {pause: d, resume: h} = I6(a, () => {
        const g = new URLSearchParams("");
        Object.keys(a).forEach(m => {
            const _ = a[m];
            Array.isArray(_) ? _.forEach(x => g.append(m, x)) : r && _ == null || i && !_ ? g.delete(m) : g.set(m, _)
        }
        ),
        p(g)
    }
    , {
        deep: !0
    });
    function p(g, m) {
        d(),
        m && f(g),
        s.history.replaceState(s.history.state, s.document.title, s.location.pathname + c(g)),
        h()
    }
    function y() {
        o && p(u(), !0)
    }
    Zn(s, "popstate", y, !1),
    t !== "history" && Zn(s, "hashchange", y, !1);
    const v = u();
    return v.keys().next().value ? f(v) : Object.assign(a, n),
    a
}
function Die(t, e, n, r={}) {
    var i, o, s;
    const {clone: a=!1, passive: l=!1, eventName: c, deep: u=!1, defaultValue: f, shouldEmit: d} = r
      , h = yt()
      , p = n || (h == null ? void 0 : h.emit) || ((i = h == null ? void 0 : h.$emit) == null ? void 0 : i.bind(h)) || ((s = (o = h == null ? void 0 : h.proxy) == null ? void 0 : o.$emit) == null ? void 0 : s.bind(h == null ? void 0 : h.proxy));
    let y = c;
    e || (e = "modelValue"),
    y = y || `update:${e.toString()}`;
    const v = _ => a ? typeof a == "function" ? a(_) : Eie(_) : _
      , g = () => uie(t[e]) ? v(t[e]) : f
      , m = _ => {
        d ? d(_) && p(y, _) : p(y, _)
    }
    ;
    if (l) {
        const _ = g()
          , x = Z(_);
        let b = !1;
        return ve( () => t[e], w => {
            b || (b = !0,
            x.value = v(w),
            Xe( () => b = !1))
        }
        ),
        ve(x, w => {
            !b && (w !== t[e] || u) && m(w)
        }
        , {
            deep: u
        }),
        x
    } else
        return re({
            get() {
                return g()
            },
            set(_) {
                m(_)
            }
        })
}
function vPe(t, e, n={}) {
    const r = {};
    for (const i in t)
        r[i] = Die(t, i, e, n);
    return r
}
/*!
  * vue-router v4.1.6
  * (c) 2022 Eduardo San Martin Morote
  * @license MIT
  */
const $o = typeof window < "u";
function Bie(t) {
    return t.__esModule || t[Symbol.toStringTag] === "Module"
}
const mt = Object.assign;
function o1(t, e) {
    const n = {};
    for (const r in e) {
        const i = e[r];
        n[r] = Yr(i) ? i.map(t) : t(i)
    }
    return n
}
const Ef = () => {}
  , Yr = Array.isArray;
function Qe(t) {
    const e = Array.from(arguments).slice(1);
    console.warn.apply(console, ["[Vue Router warn]: " + t].concat(e))
}
const kie = /\/$/
  , Nie = t => t.replace(kie, "");
function s1(t, e, n="/") {
    let r, i = {}, o = "", s = "";
    const a = e.indexOf("#");
    let l = e.indexOf("?");
    return a < l && a >= 0 && (l = -1),
    l > -1 && (r = e.slice(0, l),
    o = e.slice(l + 1, a > -1 ? a : e.length),
    i = t(o)),
    a > -1 && (r = r || e.slice(0, a),
    s = e.slice(a, e.length)),
    r = $ie(r ?? e, n),
    {
        fullPath: r + (o && "?") + o + s,
        path: r,
        query: i,
        hash: s
    }
}
function Fie(t, e) {
    const n = e.query ? t(e.query) : "";
    return e.path + (n && "?") + n + (e.hash || "")
}
function vA(t, e) {
    return !e || !t.toLowerCase().startsWith(e.toLowerCase()) ? t : t.slice(e.length) || "/"
}
function yA(t, e, n) {
    const r = e.matched.length - 1
      , i = n.matched.length - 1;
    return r > -1 && r === i && ia(e.matched[r], n.matched[i]) && B6(e.params, n.params) && t(e.query) === t(n.query) && e.hash === n.hash
}
function ia(t, e) {
    return (t.aliasOf || t) === (e.aliasOf || e)
}
function B6(t, e) {
    if (Object.keys(t).length !== Object.keys(e).length)
        return !1;
    for (const n in t)
        if (!Lie(t[n], e[n]))
            return !1;
    return !0
}
function Lie(t, e) {
    return Yr(t) ? _A(t, e) : Yr(e) ? _A(e, t) : t === e
}
function _A(t, e) {
    return Yr(e) ? t.length === e.length && t.every( (n, r) => n === e[r]) : t.length === 1 && t[0] === e
}
function $ie(t, e) {
    if (t.startsWith("/"))
        return t;
    if (!e.startsWith("/"))
        return Qe(`Cannot resolve a relative location without an absolute path. Trying to resolve "${t}" from "${e}". It should look like "/${e}".`),
        t;
    if (!t)
        return e;
    const n = e.split("/")
      , r = t.split("/");
    let i = n.length - 1, o, s;
    for (o = 0; o < r.length; o++)
        if (s = r[o],
        s !== ".")
            if (s === "..")
                i > 1 && i--;
            else
                break;
    return n.slice(0, i).join("/") + "/" + r.slice(o - (o === r.length ? 1 : 0)).join("/")
}
var ld;
(function(t) {
    t.pop = "pop",
    t.push = "push"
}
)(ld || (ld = {}));
var Sf;
(function(t) {
    t.back = "back",
    t.forward = "forward",
    t.unknown = ""
}
)(Sf || (Sf = {}));
function Uie(t) {
    if (!t)
        if ($o) {
            const e = document.querySelector("base");
            t = e && e.getAttribute("href") || "/",
            t = t.replace(/^\w+:\/\/[^\/]+/, "")
        } else
            t = "/";
    return t[0] !== "/" && t[0] !== "#" && (t = "/" + t),
    Nie(t)
}
const Gie = /^[^#]+#/;
function Hie(t, e) {
    return t.replace(Gie, "#") + e
}
function Vie(t, e) {
    const n = document.documentElement.getBoundingClientRect()
      , r = t.getBoundingClientRect();
    return {
        behavior: e.behavior,
        left: r.left - n.left - (e.left || 0),
        top: r.top - n.top - (e.top || 0)
    }
}
const jg = () => ({
    left: window.pageXOffset,
    top: window.pageYOffset
});
function zie(t) {
    let e;
    if ("el"in t) {
        const n = t.el
          , r = typeof n == "string" && n.startsWith("#");
        if (typeof t.el == "string" && (!r || !document.getElementById(t.el.slice(1))))
            try {
                const o = document.querySelector(t.el);
                if (r && o) {
                    Qe(`The selector "${t.el}" should be passed as "el: document.querySelector('${t.el}')" because it starts with "#".`);
                    return
                }
            } catch {
                Qe(`The selector "${t.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);
                return
            }
        const i = typeof n == "string" ? r ? document.getElementById(n.slice(1)) : document.querySelector(n) : n;
        if (!i) {
            Qe(`Couldn't find element using selector "${t.el}" returned by scrollBehavior.`);
            return
        }
        e = Vie(i, t)
    } else
        e = t;
    "scrollBehavior"in document.documentElement.style ? window.scrollTo(e) : window.scrollTo(e.left != null ? e.left : window.pageXOffset, e.top != null ? e.top : window.pageYOffset)
}
function xA(t, e) {
    return (history.state ? history.state.position - e : -1) + t
}
const v_ = new Map;
function jie(t, e) {
    v_.set(t, e)
}
function Wie(t) {
    const e = v_.get(t);
    return v_.delete(t),
    e
}
let Yie = () => location.protocol + "//" + location.host;
function k6(t, e) {
    const {pathname: n, search: r, hash: i} = e
      , o = t.indexOf("#");
    if (o > -1) {
        let a = i.includes(t.slice(o)) ? t.slice(o).length : 1
          , l = i.slice(a);
        return l[0] !== "/" && (l = "/" + l),
        vA(l, "")
    }
    return vA(n, t) + r + i
}
function Xie(t, e, n, r) {
    let i = []
      , o = []
      , s = null;
    const a = ({state: d}) => {
        const h = k6(t, location)
          , p = n.value
          , y = e.value;
        let v = 0;
        if (d) {
            if (n.value = h,
            e.value = d,
            s && s === p) {
                s = null;
                return
            }
            v = y ? d.position - y.position : 0
        } else
            r(h);
        i.forEach(g => {
            g(n.value, p, {
                delta: v,
                type: ld.pop,
                direction: v ? v > 0 ? Sf.forward : Sf.back : Sf.unknown
            })
        }
        )
    }
    ;
    function l() {
        s = n.value
    }
    function c(d) {
        i.push(d);
        const h = () => {
            const p = i.indexOf(d);
            p > -1 && i.splice(p, 1)
        }
        ;
        return o.push(h),
        h
    }
    function u() {
        const {history: d} = window;
        d.state && d.replaceState(mt({}, d.state, {
            scroll: jg()
        }), "")
    }
    function f() {
        for (const d of o)
            d();
        o = [],
        window.removeEventListener("popstate", a),
        window.removeEventListener("beforeunload", u)
    }
    return window.addEventListener("popstate", a),
    window.addEventListener("beforeunload", u),
    {
        pauseListeners: l,
        listen: c,
        destroy: f
    }
}
function bA(t, e, n, r=!1, i=!1) {
    return {
        back: t,
        current: e,
        forward: n,
        replaced: r,
        position: window.history.length,
        scroll: i ? jg() : null
    }
}
function Kie(t) {
    const {history: e, location: n} = window
      , r = {
        value: k6(t, n)
    }
      , i = {
        value: e.state
    };
    i.value || o(r.value, {
        back: null,
        current: r.value,
        forward: null,
        position: e.length - 1,
        replaced: !0,
        scroll: null
    }, !0);
    function o(l, c, u) {
        const f = t.indexOf("#")
          , d = f > -1 ? (n.host && document.querySelector("base") ? t : t.slice(f)) + l : Yie() + t + l;
        try {
            e[u ? "replaceState" : "pushState"](c, "", d),
            i.value = c
        } catch (h) {
            Qe("Error with push/replace State", h),
            n[u ? "replace" : "assign"](d)
        }
    }
    function s(l, c) {
        const u = mt({}, e.state, bA(i.value.back, l, i.value.forward, !0), c, {
            position: i.value.position
        });
        o(l, u, !0),
        r.value = l
    }
    function a(l, c) {
        const u = mt({}, i.value, e.state, {
            forward: l,
            scroll: jg()
        });
        e.state || Qe(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:

history.replaceState(history.state, '', url)

You can find more information at https://next.router.vuejs.org/guide/migration/#usage-of-history-state.`),
        o(u.current, u, !0);
        const f = mt({}, bA(r.value, l, null), {
            position: u.position + 1
        }, c);
        o(l, f, !1),
        r.value = l
    }
    return {
        location: r,
        state: i,
        push: a,
        replace: s
    }
}
function qie(t) {
    t = Uie(t);
    const e = Kie(t)
      , n = Xie(t, e.state, e.location, e.replace);
    function r(o, s=!0) {
        s || n.pauseListeners(),
        history.go(o)
    }
    const i = mt({
        location: "",
        base: t,
        go: r,
        createHref: Hie.bind(null, t)
    }, e, n);
    return Object.defineProperty(i, "location", {
        enumerable: !0,
        get: () => e.location.value
    }),
    Object.defineProperty(i, "state", {
        enumerable: !0,
        get: () => e.state.value
    }),
    i
}
function yPe(t) {
    return t = location.host ? t || location.pathname + location.search : "",
    t.includes("#") || (t += "#"),
    !t.endsWith("#/") && !t.endsWith("#") && Qe(`A hash base must end with a "#":
"${t}" should be "${t.replace(/#.*$/, "#")}".`),
    qie(t)
}
function Zie(t) {
    return typeof t == "string" || t && typeof t == "object"
}
function N6(t) {
    return typeof t == "string" || typeof t == "symbol"
}
const xs = {
    path: "/",
    name: void 0,
    params: {},
    query: {},
    hash: "",
    fullPath: "/",
    matched: [],
    meta: {},
    redirectedFrom: void 0
}
  , F6 = Symbol("navigation failure");
var wA;
(function(t) {
    t[t.aborted = 4] = "aborted",
    t[t.cancelled = 8] = "cancelled",
    t[t.duplicated = 16] = "duplicated"
}
)(wA || (wA = {}));
const Jie = {
    1({location: t, currentLocation: e}) {
        return `No match for
 ${JSON.stringify(t)}${e ? `
while being at
` + JSON.stringify(e) : ""}`
    },
    2({from: t, to: e}) {
        return `Redirected from "${t.fullPath}" to "${eoe(e)}" via a navigation guard.`
    },
    4({from: t, to: e}) {
        return `Navigation aborted from "${t.fullPath}" to "${e.fullPath}" via a navigation guard.`
    },
    8({from: t, to: e}) {
        return `Navigation cancelled from "${t.fullPath}" to "${e.fullPath}" with a new navigation.`
    },
    16({from: t, to: e}) {
        return `Avoided redundant navigation to current location: "${t.fullPath}".`
    }
};
function Wc(t, e) {
    return mt(new Error(Jie[t](e)), {
        type: t,
        [F6]: !0
    }, e)
}
function Io(t, e) {
    return t instanceof Error && F6 in t && (e == null || !!(t.type & e))
}
const Qie = ["params", "query", "hash"];
function eoe(t) {
    if (typeof t == "string")
        return t;
    if ("path"in t)
        return t.path;
    const e = {};
    for (const n of Qie)
        n in t && (e[n] = t[n]);
    return JSON.stringify(e, null, 2)
}
const EA = "[^/]+?"
  , toe = {
    sensitive: !1,
    strict: !1,
    start: !0,
    end: !0
}
  , noe = /[.+*?^${}()[\]/\\]/g;
function roe(t, e) {
    const n = mt({}, toe, e)
      , r = [];
    let i = n.start ? "^" : "";
    const o = [];
    for (const c of t) {
        const u = c.length ? [] : [90];
        n.strict && !c.length && (i += "/");
        for (let f = 0; f < c.length; f++) {
            const d = c[f];
            let h = 40 + (n.sensitive ? .25 : 0);
            if (d.type === 0)
                f || (i += "/"),
                i += d.value.replace(noe, "\\$&"),
                h += 40;
            else if (d.type === 1) {
                const {value: p, repeatable: y, optional: v, regexp: g} = d;
                o.push({
                    name: p,
                    repeatable: y,
                    optional: v
                });
                const m = g || EA;
                if (m !== EA) {
                    h += 10;
                    try {
                        new RegExp(`(${m})`)
                    } catch (x) {
                        throw new Error(`Invalid custom RegExp for param "${p}" (${m}): ` + x.message)
                    }
                }
                let _ = y ? `((?:${m})(?:/(?:${m}))*)` : `(${m})`;
                f || (_ = v && c.length < 2 ? `(?:/${_})` : "/" + _),
                v && (_ += "?"),
                i += _,
                h += 20,
                v && (h += -8),
                y && (h += -20),
                m === ".*" && (h += -50)
            }
            u.push(h)
        }
        r.push(u)
    }
    if (n.strict && n.end) {
        const c = r.length - 1;
        r[c][r[c].length - 1] += .7000000000000001
    }
    n.strict || (i += "/?"),
    n.end ? i += "$" : n.strict && (i += "(?:/|$)");
    const s = new RegExp(i,n.sensitive ? "" : "i");
    function a(c) {
        const u = c.match(s)
          , f = {};
        if (!u)
            return null;
        for (let d = 1; d < u.length; d++) {
            const h = u[d] || ""
              , p = o[d - 1];
            f[p.name] = h && p.repeatable ? h.split("/") : h
        }
        return f
    }
    function l(c) {
        let u = ""
          , f = !1;
        for (const d of t) {
            (!f || !u.endsWith("/")) && (u += "/"),
            f = !1;
            for (const h of d)
                if (h.type === 0)
                    u += h.value;
                else if (h.type === 1) {
                    const {value: p, repeatable: y, optional: v} = h
                      , g = p in c ? c[p] : "";
                    if (Yr(g) && !y)
                        throw new Error(`Provided param "${p}" is an array but it is not repeatable (* or + modifiers)`);
                    const m = Yr(g) ? g.join("/") : g;
                    if (!m)
                        if (v)
                            d.length < 2 && (u.endsWith("/") ? u = u.slice(0, -1) : f = !0);
                        else
                            throw new Error(`Missing required param "${p}"`);
                    u += m
                }
        }
        return u || "/"
    }
    return {
        re: s,
        score: r,
        keys: o,
        parse: a,
        stringify: l
    }
}
function ioe(t, e) {
    let n = 0;
    for (; n < t.length && n < e.length; ) {
        const r = e[n] - t[n];
        if (r)
            return r;
        n++
    }
    return t.length < e.length ? t.length === 1 && t[0] === 40 + 40 ? -1 : 1 : t.length > e.length ? e.length === 1 && e[0] === 40 + 40 ? 1 : -1 : 0
}
function ooe(t, e) {
    let n = 0;
    const r = t.score
      , i = e.score;
    for (; n < r.length && n < i.length; ) {
        const o = ioe(r[n], i[n]);
        if (o)
            return o;
        n++
    }
    if (Math.abs(i.length - r.length) === 1) {
        if (SA(r))
            return 1;
        if (SA(i))
            return -1
    }
    return i.length - r.length
}
function SA(t) {
    const e = t[t.length - 1];
    return t.length > 0 && e[e.length - 1] < 0
}
const soe = {
    type: 0,
    value: ""
}
  , aoe = /[a-zA-Z0-9_]/;
function loe(t) {
    if (!t)
        return [[]];
    if (t === "/")
        return [[soe]];
    if (!t.startsWith("/"))
        throw new Error(`Route paths should start with a "/": "${t}" should be "/${t}".`);
    function e(h) {
        throw new Error(`ERR (${n})/"${c}": ${h}`)
    }
    let n = 0
      , r = n;
    const i = [];
    let o;
    function s() {
        o && i.push(o),
        o = []
    }
    let a = 0, l, c = "", u = "";
    function f() {
        c && (n === 0 ? o.push({
            type: 0,
            value: c
        }) : n === 1 || n === 2 || n === 3 ? (o.length > 1 && (l === "*" || l === "+") && e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),
        o.push({
            type: 1,
            value: c,
            regexp: u,
            repeatable: l === "*" || l === "+",
            optional: l === "*" || l === "?"
        })) : e("Invalid state to consume buffer"),
        c = "")
    }
    function d() {
        c += l
    }
    for (; a < t.length; ) {
        if (l = t[a++],
        l === "\\" && n !== 2) {
            r = n,
            n = 4;
            continue
        }
        switch (n) {
        case 0:
            l === "/" ? (c && f(),
            s()) : l === ":" ? (f(),
            n = 1) : d();
            break;
        case 4:
            d(),
            n = r;
            break;
        case 1:
            l === "(" ? n = 2 : aoe.test(l) ? d() : (f(),
            n = 0,
            l !== "*" && l !== "?" && l !== "+" && a--);
            break;
        case 2:
            l === ")" ? u[u.length - 1] == "\\" ? u = u.slice(0, -1) + l : n = 3 : u += l;
            break;
        case 3:
            f(),
            n = 0,
            l !== "*" && l !== "?" && l !== "+" && a--,
            u = "";
            break;
        default:
            e("Unknown state");
            break
        }
    }
    return n === 2 && e(`Unfinished custom RegExp for param "${c}"`),
    f(),
    s(),
    i
}
function coe(t, e, n) {
    const r = roe(loe(t.path), n);
    {
        const o = new Set;
        for (const s of r.keys)
            o.has(s.name) && Qe(`Found duplicated params with name "${s.name}" for path "${t.path}". Only the last one will be available on "$route.params".`),
            o.add(s.name)
    }
    const i = mt(r, {
        record: t,
        parent: e,
        children: [],
        alias: []
    });
    return e && !i.record.aliasOf == !e.record.aliasOf && e.children.push(i),
    i
}
function uoe(t, e) {
    const n = []
      , r = new Map;
    e = TA({
        strict: !1,
        end: !0,
        sensitive: !1
    }, e);
    function i(u) {
        return r.get(u)
    }
    function o(u, f, d) {
        const h = !d
          , p = foe(u);
        goe(p, f),
        p.aliasOf = d && d.record;
        const y = TA(e, u)
          , v = [p];
        if ("alias"in u) {
            const _ = typeof u.alias == "string" ? [u.alias] : u.alias;
            for (const x of _)
                v.push(mt({}, p, {
                    components: d ? d.record.components : p.components,
                    path: x,
                    aliasOf: d ? d.record : p
                }))
        }
        let g, m;
        for (const _ of v) {
            const {path: x} = _;
            if (f && x[0] !== "/") {
                const b = f.record.path
                  , w = b[b.length - 1] === "/" ? "" : "/";
                _.path = f.record.path + (x && w + x)
            }
            if (_.path === "*")
                throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
See more at https://next.router.vuejs.org/guide/migration/#removed-star-or-catch-all-routes.`);
            if (g = coe(_, f, y),
            f && x[0] === "/" && moe(g, f),
            d ? (d.alias.push(g),
            poe(d, g)) : (m = m || g,
            m !== g && m.alias.push(g),
            h && u.name && !AA(g) && s(u.name)),
            p.children) {
                const b = p.children;
                for (let w = 0; w < b.length; w++)
                    o(b[w], g, d && d.children[w])
            }
            d = d || g,
            (g.record.components && Object.keys(g.record.components).length || g.record.name || g.record.redirect) && l(g)
        }
        return m ? () => {
            s(m)
        }
        : Ef
    }
    function s(u) {
        if (N6(u)) {
            const f = r.get(u);
            f && (r.delete(u),
            n.splice(n.indexOf(f), 1),
            f.children.forEach(s),
            f.alias.forEach(s))
        } else {
            const f = n.indexOf(u);
            f > -1 && (n.splice(f, 1),
            u.record.name && r.delete(u.record.name),
            u.children.forEach(s),
            u.alias.forEach(s))
        }
    }
    function a() {
        return n
    }
    function l(u) {
        let f = 0;
        for (; f < n.length && ooe(u, n[f]) >= 0 && (u.record.path !== n[f].record.path || !L6(u, n[f])); )
            f++;
        n.splice(f, 0, u),
        u.record.name && !AA(u) && r.set(u.record.name, u)
    }
    function c(u, f) {
        let d, h = {}, p, y;
        if ("name"in u && u.name) {
            if (d = r.get(u.name),
            !d)
                throw Wc(1, {
                    location: u
                });
            {
                const m = Object.keys(u.params || {}).filter(_ => !d.keys.find(x => x.name === _));
                m.length && Qe(`Discarded invalid param(s) "${m.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`)
            }
            y = d.record.name,
            h = mt(CA(f.params, d.keys.filter(m => !m.optional).map(m => m.name)), u.params && CA(u.params, d.keys.map(m => m.name))),
            p = d.stringify(h)
        } else if ("path"in u)
            p = u.path,
            p.startsWith("/") || Qe(`The Matcher cannot resolve relative paths but received "${p}". Unless you directly called \`matcher.resolve("${p}")\`, this is probably a bug in vue-router. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/router.`),
            d = n.find(m => m.re.test(p)),
            d && (h = d.parse(p),
            y = d.record.name);
        else {
            if (d = f.name ? r.get(f.name) : n.find(m => m.re.test(f.path)),
            !d)
                throw Wc(1, {
                    location: u,
                    currentLocation: f
                });
            y = d.record.name,
            h = mt({}, f.params, u.params),
            p = d.stringify(h)
        }
        const v = [];
        let g = d;
        for (; g; )
            v.unshift(g.record),
            g = g.parent;
        return {
            name: y,
            path: p,
            params: h,
            matched: v,
            meta: hoe(v)
        }
    }
    return t.forEach(u => o(u)),
    {
        addRoute: o,
        resolve: c,
        removeRoute: s,
        getRoutes: a,
        getRecordMatcher: i
    }
}
function CA(t, e) {
    const n = {};
    for (const r of e)
        r in t && (n[r] = t[r]);
    return n
}
function foe(t) {
    return {
        path: t.path,
        redirect: t.redirect,
        name: t.name,
        meta: t.meta || {},
        aliasOf: void 0,
        beforeEnter: t.beforeEnter,
        props: doe(t),
        children: t.children || [],
        instances: {},
        leaveGuards: new Set,
        updateGuards: new Set,
        enterCallbacks: {},
        components: "components"in t ? t.components || null : t.component && {
            default: t.component
        }
    }
}
function doe(t) {
    const e = {}
      , n = t.props || !1;
    if ("component"in t)
        e.default = n;
    else
        for (const r in t.components)
            e[r] = typeof n == "boolean" ? n : n[r];
    return e
}
function AA(t) {
    for (; t; ) {
        if (t.record.aliasOf)
            return !0;
        t = t.parent
    }
    return !1
}
function hoe(t) {
    return t.reduce( (e, n) => mt(e, n.meta), {})
}
function TA(t, e) {
    const n = {};
    for (const r in t)
        n[r] = r in e ? e[r] : t[r];
    return n
}
function y_(t, e) {
    return t.name === e.name && t.optional === e.optional && t.repeatable === e.repeatable
}
function poe(t, e) {
    for (const n of t.keys)
        if (!n.optional && !e.keys.find(y_.bind(null, n)))
            return Qe(`Alias "${e.record.path}" and the original record: "${t.record.path}" must have the exact same param named "${n.name}"`);
    for (const n of e.keys)
        if (!n.optional && !t.keys.find(y_.bind(null, n)))
            return Qe(`Alias "${e.record.path}" and the original record: "${t.record.path}" must have the exact same param named "${n.name}"`)
}
function goe(t, e) {
    e && e.record.name && !t.name && !t.path && Qe(`The route named "${String(e.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`)
}
function moe(t, e) {
    for (const n of e.keys)
        if (!t.keys.find(y_.bind(null, n)))
            return Qe(`Absolute path "${t.record.path}" must have the exact same param named "${n.name}" as its parent "${e.record.path}".`)
}
function L6(t, e) {
    return e.children.some(n => n === t || L6(t, n))
}
const $6 = /#/g
  , voe = /&/g
  , yoe = /\//g
  , _oe = /=/g
  , xoe = /\?/g
  , U6 = /\+/g
  , boe = /%5B/g
  , woe = /%5D/g
  , G6 = /%5E/g
  , Eoe = /%60/g
  , H6 = /%7B/g
  , Soe = /%7C/g
  , V6 = /%7D/g
  , Coe = /%20/g;
function Lw(t) {
    return encodeURI("" + t).replace(Soe, "|").replace(boe, "[").replace(woe, "]")
}
function Aoe(t) {
    return Lw(t).replace(H6, "{").replace(V6, "}").replace(G6, "^")
}
function __(t) {
    return Lw(t).replace(U6, "%2B").replace(Coe, "+").replace($6, "%23").replace(voe, "%26").replace(Eoe, "`").replace(H6, "{").replace(V6, "}").replace(G6, "^")
}
function Toe(t) {
    return __(t).replace(_oe, "%3D")
}
function Poe(t) {
    return Lw(t).replace($6, "%23").replace(xoe, "%3F")
}
function Ioe(t) {
    return t == null ? "" : Poe(t).replace(yoe, "%2F")
}
function cd(t) {
    try {
        return decodeURIComponent("" + t)
    } catch {
        Qe(`Error decoding "${t}". Using original value`)
    }
    return "" + t
}
function Ooe(t) {
    const e = {};
    if (t === "" || t === "?")
        return e;
    const r = (t[0] === "?" ? t.slice(1) : t).split("&");
    for (let i = 0; i < r.length; ++i) {
        const o = r[i].replace(U6, " ")
          , s = o.indexOf("=")
          , a = cd(s < 0 ? o : o.slice(0, s))
          , l = s < 0 ? null : cd(o.slice(s + 1));
        if (a in e) {
            let c = e[a];
            Yr(c) || (c = e[a] = [c]),
            c.push(l)
        } else
            e[a] = l
    }
    return e
}
function PA(t) {
    let e = "";
    for (let n in t) {
        const r = t[n];
        if (n = Toe(n),
        r == null) {
            r !== void 0 && (e += (e.length ? "&" : "") + n);
            continue
        }
        (Yr(r) ? r.map(o => o && __(o)) : [r && __(r)]).forEach(o => {
            o !== void 0 && (e += (e.length ? "&" : "") + n,
            o != null && (e += "=" + o))
        }
        )
    }
    return e
}
function Roe(t) {
    const e = {};
    for (const n in t) {
        const r = t[n];
        r !== void 0 && (e[n] = Yr(r) ? r.map(i => i == null ? null : "" + i) : r == null ? r : "" + r)
    }
    return e
}
const z6 = Symbol("router view location matched")
  , IA = Symbol("router view depth")
  , Wg = Symbol("router")
  , $w = Symbol("route location")
  , x_ = Symbol("router view location");
function $u() {
    let t = [];
    function e(r) {
        return t.push(r),
        () => {
            const i = t.indexOf(r);
            i > -1 && t.splice(i, 1)
        }
    }
    function n() {
        t = []
    }
    return {
        add: e,
        list: () => t,
        reset: n
    }
}
function Moe(t, e, n) {
    const r = () => {
        t[e].delete(n)
    }
    ;
    fs(r),
    bo(r),
    cs( () => {
        t[e].add(n)
    }
    ),
    t[e].add(n)
}
function _Pe(t) {
    if (!yt()) {
        Qe("getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function");
        return
    }
    const e = dn(z6, {}).value;
    if (!e) {
        Qe("No active route record was found when calling `onBeforeRouteLeave()`. Make sure you call this function inside a component child of <router-view>. Maybe you called it inside of App.vue?");
        return
    }
    Moe(e, "leaveGuards", t)
}
function Ps(t, e, n, r, i) {
    const o = r && (r.enterCallbacks[i] = r.enterCallbacks[i] || []);
    return () => new Promise( (s, a) => {
        const l = f => {
            f === !1 ? a(Wc(4, {
                from: n,
                to: e
            })) : f instanceof Error ? a(f) : Zie(f) ? a(Wc(2, {
                from: e,
                to: f
            })) : (o && r.enterCallbacks[i] === o && typeof f == "function" && o.push(f),
            s())
        }
          , c = t.call(r && r.instances[i], e, n, Doe(l, e, n));
        let u = Promise.resolve(c);
        if (t.length < 3 && (u = u.then(l)),
        t.length > 2) {
            const f = `The "next" callback was never called inside of ${t.name ? '"' + t.name + '"' : ""}:
${t.toString()}
. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;
            if (typeof c == "object" && "then"in c)
                u = u.then(d => l._called ? d : (Qe(f),
                Promise.reject(new Error("Invalid navigation guard"))));
            else if (c !== void 0 && !l._called) {
                Qe(f),
                a(new Error("Invalid navigation guard"));
                return
            }
        }
        u.catch(f => a(f))
    }
    )
}
function Doe(t, e, n) {
    let r = 0;
    return function() {
        r++ === 1 && Qe(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${e.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`),
        t._called = !0,
        r === 1 && t.apply(null, arguments)
    }
}
function a1(t, e, n, r) {
    const i = [];
    for (const o of t) {
        !o.components && !o.children.length && Qe(`Record with path "${o.path}" is either missing a "component(s)" or "children" property.`);
        for (const s in o.components) {
            let a = o.components[s];
            {
                if (!a || typeof a != "object" && typeof a != "function")
                    throw Qe(`Component "${s}" in record with path "${o.path}" is not a valid component. Received "${String(a)}".`),
                    new Error("Invalid route component");
                if ("then"in a) {
                    Qe(`Component "${s}" in record with path "${o.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);
                    const l = a;
                    a = () => l
                } else
                    a.__asyncLoader && !a.__warnedDefineAsync && (a.__warnedDefineAsync = !0,
                    Qe(`Component "${s}" in record with path "${o.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`))
            }
            if (!(e !== "beforeRouteEnter" && !o.instances[s]))
                if (Boe(a)) {
                    const c = (a.__vccOpts || a)[e];
                    c && i.push(Ps(c, n, r, o, s))
                } else {
                    let l = a();
                    "catch"in l || (Qe(`Component "${s}" in record with path "${o.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`),
                    l = Promise.resolve(l)),
                    i.push( () => l.then(c => {
                        if (!c)
                            return Promise.reject(new Error(`Couldn't resolve component "${s}" at "${o.path}"`));
                        const u = Bie(c) ? c.default : c;
                        o.components[s] = u;
                        const d = (u.__vccOpts || u)[e];
                        return d && Ps(d, n, r, o, s)()
                    }
                    ))
                }
        }
    }
    return i
}
function Boe(t) {
    return typeof t == "object" || "displayName"in t || "props"in t || "__vccOpts"in t
}
function OA(t) {
    const e = dn(Wg)
      , n = dn($w)
      , r = re( () => e.resolve(dr(t.to)))
      , i = re( () => {
        const {matched: l} = r.value
          , {length: c} = l
          , u = l[c - 1]
          , f = n.matched;
        if (!u || !f.length)
            return -1;
        const d = f.findIndex(ia.bind(null, u));
        if (d > -1)
            return d;
        const h = RA(l[c - 2]);
        return c > 1 && RA(u) === h && f[f.length - 1].path !== h ? f.findIndex(ia.bind(null, l[c - 2])) : d
    }
    )
      , o = re( () => i.value > -1 && Loe(n.params, r.value.params))
      , s = re( () => i.value > -1 && i.value === n.matched.length - 1 && B6(n.params, r.value.params));
    function a(l={}) {
        return Foe(l) ? e[dr(t.replace) ? "replace" : "push"](dr(t.to)).catch(Ef) : Promise.resolve()
    }
    if ($o) {
        const l = yt();
        if (l) {
            const c = {
                route: r.value,
                isActive: o.value,
                isExactActive: s.value
            };
            l.__vrl_devtools = l.__vrl_devtools || [],
            l.__vrl_devtools.push(c),
            fu( () => {
                c.route = r.value,
                c.isActive = o.value,
                c.isExactActive = s.value
            }
            , {
                flush: "post"
            })
        }
    }
    return {
        route: r,
        href: re( () => r.value.href),
        isActive: o,
        isExactActive: s,
        navigate: a
    }
}
const koe = we({
    name: "RouterLink",
    compatConfig: {
        MODE: 3
    },
    props: {
        to: {
            type: [String, Object],
            required: !0
        },
        replace: Boolean,
        activeClass: String,
        exactActiveClass: String,
        custom: Boolean,
        ariaCurrentValue: {
            type: String,
            default: "page"
        }
    },
    useLink: OA,
    setup(t, {slots: e}) {
        const n = Mt(OA(t))
          , {options: r} = dn(Wg)
          , i = re( () => ({
            [MA(t.activeClass, r.linkActiveClass, "router-link-active")]: n.isActive,
            [MA(t.exactActiveClass, r.linkExactActiveClass, "router-link-exact-active")]: n.isExactActive
        }));
        return () => {
            const o = e.default && e.default(n);
            return t.custom ? o : Mn("a", {
                "aria-current": n.isExactActive ? t.ariaCurrentValue : null,
                href: n.href,
                onClick: n.navigate,
                class: i.value
            }, o)
        }
    }
})
  , Noe = koe;
function Foe(t) {
    if (!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey) && !t.defaultPrevented && !(t.button !== void 0 && t.button !== 0)) {
        if (t.currentTarget && t.currentTarget.getAttribute) {
            const e = t.currentTarget.getAttribute("target");
            if (/\b_blank\b/i.test(e))
                return
        }
        return t.preventDefault && t.preventDefault(),
        !0
    }
}
function Loe(t, e) {
    for (const n in e) {
        const r = e[n]
          , i = t[n];
        if (typeof r == "string") {
            if (r !== i)
                return !1
        } else if (!Yr(i) || i.length !== r.length || r.some( (o, s) => o !== i[s]))
            return !1
    }
    return !0
}
function RA(t) {
    return t ? t.aliasOf ? t.aliasOf.path : t.path : ""
}
const MA = (t, e, n) => t ?? e ?? n
  , $oe = we({
    name: "RouterView",
    inheritAttrs: !1,
    props: {
        name: {
            type: String,
            default: "default"
        },
        route: Object
    },
    compatConfig: {
        MODE: 3
    },
    setup(t, {attrs: e, slots: n}) {
        Goe();
        const r = dn(x_)
          , i = re( () => t.route || r.value)
          , o = dn(IA, 0)
          , s = re( () => {
            let c = dr(o);
            const {matched: u} = i.value;
            let f;
            for (; (f = u[c]) && !f.components; )
                c++;
            return c
        }
        )
          , a = re( () => i.value.matched[s.value]);
        hi(IA, re( () => s.value + 1)),
        hi(z6, a),
        hi(x_, i);
        const l = Z();
        return ve( () => [l.value, a.value, t.name], ([c,u,f], [d,h,p]) => {
            u && (u.instances[f] = c,
            h && h !== u && c && c === d && (u.leaveGuards.size || (u.leaveGuards = h.leaveGuards),
            u.updateGuards.size || (u.updateGuards = h.updateGuards))),
            c && u && (!h || !ia(u, h) || !d) && (u.enterCallbacks[f] || []).forEach(y => y(c))
        }
        , {
            flush: "post"
        }),
        () => {
            const c = i.value
              , u = t.name
              , f = a.value
              , d = f && f.components[u];
            if (!d)
                return DA(n.default, {
                    Component: d,
                    route: c
                });
            const h = f.props[u]
              , p = h ? h === !0 ? c.params : typeof h == "function" ? h(c) : h : null
              , v = Mn(d, mt({}, p, e, {
                onVnodeUnmounted: g => {
                    g.component.isUnmounted && (f.instances[u] = null)
                }
                ,
                ref: l
            }));
            if ($o && v.ref) {
                const g = {
                    depth: s.value,
                    name: f.name,
                    path: f.path,
                    meta: f.meta
                };
                (Yr(v.ref) ? v.ref.map(_ => _.i) : [v.ref.i]).forEach(_ => {
                    _.__vrv_devtools = g
                }
                )
            }
            return DA(n.default, {
                Component: v,
                route: c
            }) || v
        }
    }
});
function DA(t, e) {
    if (!t)
        return null;
    const n = t(e);
    return n.length === 1 ? n[0] : n
}
const Uoe = $oe;
function Goe() {
    const t = yt()
      , e = t.parent && t.parent.type.name;
    if (e && (e === "KeepAlive" || e.includes("Transition"))) {
        const n = e === "KeepAlive" ? "keep-alive" : "transition";
        Qe(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
Use slot props instead:

<router-view v-slot="{ Component }">
  <${n}>
    <component :is="Component" />
  </${n}>
</router-view>`)
    }
}
function Uu(t, e) {
    const n = mt({}, t, {
        matched: t.matched.map(r => qoe(r, ["instances", "children", "aliasOf"]))
    });
    return {
        _custom: {
            type: null,
            readOnly: !0,
            display: t.fullPath,
            tooltip: e,
            value: n
        }
    }
}
function Wh(t) {
    return {
        _custom: {
            display: t
        }
    }
}
let Hoe = 0;
function Voe(t, e, n) {
    if (e.__hasDevtools)
        return;
    e.__hasDevtools = !0;
    const r = Hoe++;
    bg({
        id: "org.vuejs.router" + (r ? "." + r : ""),
        label: "Vue Router",
        packageName: "vue-router",
        homepage: "https://router.vuejs.org",
        logo: "https://router.vuejs.org/logo.png",
        componentStateTypes: ["Routing"],
        app: t
    }, i => {
        typeof i.now != "function" && console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),
        i.on.inspectComponent( (u, f) => {
            u.instanceData && u.instanceData.state.push({
                type: "Routing",
                key: "$route",
                editable: !1,
                value: Uu(e.currentRoute.value, "Current Route")
            })
        }
        ),
        i.on.visitComponentTree( ({treeNode: u, componentInstance: f}) => {
            if (f.__vrv_devtools) {
                const d = f.__vrv_devtools;
                u.tags.push({
                    label: (d.name ? `${d.name.toString()}: ` : "") + d.path,
                    textColor: 0,
                    tooltip: "This component is rendered by &lt;router-view&gt;",
                    backgroundColor: j6
                })
            }
            Yr(f.__vrl_devtools) && (f.__devtoolsApi = i,
            f.__vrl_devtools.forEach(d => {
                let h = X6
                  , p = "";
                d.isExactActive ? (h = Y6,
                p = "This is exactly active") : d.isActive && (h = W6,
                p = "This link is active"),
                u.tags.push({
                    label: d.route.path,
                    textColor: 0,
                    tooltip: p,
                    backgroundColor: h
                })
            }
            ))
        }
        ),
        ve(e.currentRoute, () => {
            l(),
            i.notifyComponentUpdate(),
            i.sendInspectorTree(a),
            i.sendInspectorState(a)
        }
        );
        const o = "router:navigations:" + r;
        i.addTimelineLayer({
            id: o,
            label: `Router${r ? " " + r : ""} Navigations`,
            color: 4237508
        }),
        e.onError( (u, f) => {
            i.addTimelineEvent({
                layerId: o,
                event: {
                    title: "Error during Navigation",
                    subtitle: f.fullPath,
                    logType: "error",
                    time: i.now(),
                    data: {
                        error: u
                    },
                    groupId: f.meta.__navigationId
                }
            })
        }
        );
        let s = 0;
        e.beforeEach( (u, f) => {
            const d = {
                guard: Wh("beforeEach"),
                from: Uu(f, "Current Location during this navigation"),
                to: Uu(u, "Target location")
            };
            Object.defineProperty(u.meta, "__navigationId", {
                value: s++
            }),
            i.addTimelineEvent({
                layerId: o,
                event: {
                    time: i.now(),
                    title: "Start of navigation",
                    subtitle: u.fullPath,
                    data: d,
                    groupId: u.meta.__navigationId
                }
            })
        }
        ),
        e.afterEach( (u, f, d) => {
            const h = {
                guard: Wh("afterEach")
            };
            d ? (h.failure = {
                _custom: {
                    type: Error,
                    readOnly: !0,
                    display: d ? d.message : "",
                    tooltip: "Navigation Failure",
                    value: d
                }
            },
            h.status = Wh("❌")) : h.status = Wh("✅"),
            h.from = Uu(f, "Current Location during this navigation"),
            h.to = Uu(u, "Target location"),
            i.addTimelineEvent({
                layerId: o,
                event: {
                    title: "End of navigation",
                    subtitle: u.fullPath,
                    time: i.now(),
                    data: h,
                    logType: d ? "warning" : "default",
                    groupId: u.meta.__navigationId
                }
            })
        }
        );
        const a = "router-inspector:" + r;
        i.addInspector({
            id: a,
            label: "Routes" + (r ? " " + r : ""),
            icon: "book",
            treeFilterPlaceholder: "Search routes"
        });
        function l() {
            if (!c)
                return;
            const u = c;
            let f = n.getRoutes().filter(d => !d.parent);
            f.forEach(Z6),
            u.filter && (f = f.filter(d => b_(d, u.filter.toLowerCase()))),
            f.forEach(d => q6(d, e.currentRoute.value)),
            u.rootNodes = f.map(K6)
        }
        let c;
        i.on.getInspectorTree(u => {
            c = u,
            u.app === t && u.inspectorId === a && l()
        }
        ),
        i.on.getInspectorState(u => {
            if (u.app === t && u.inspectorId === a) {
                const d = n.getRoutes().find(h => h.record.__vd_id === u.nodeId);
                d && (u.state = {
                    options: joe(d)
                })
            }
        }
        ),
        i.sendInspectorTree(a),
        i.sendInspectorState(a)
    }
    )
}
function zoe(t) {
    return t.optional ? t.repeatable ? "*" : "?" : t.repeatable ? "+" : ""
}
function joe(t) {
    const {record: e} = t
      , n = [{
        editable: !1,
        key: "path",
        value: e.path
    }];
    return e.name != null && n.push({
        editable: !1,
        key: "name",
        value: e.name
    }),
    n.push({
        editable: !1,
        key: "regexp",
        value: t.re
    }),
    t.keys.length && n.push({
        editable: !1,
        key: "keys",
        value: {
            _custom: {
                type: null,
                readOnly: !0,
                display: t.keys.map(r => `${r.name}${zoe(r)}`).join(" "),
                tooltip: "Param keys",
                value: t.keys
            }
        }
    }),
    e.redirect != null && n.push({
        editable: !1,
        key: "redirect",
        value: e.redirect
    }),
    t.alias.length && n.push({
        editable: !1,
        key: "aliases",
        value: t.alias.map(r => r.record.path)
    }),
    Object.keys(t.record.meta).length && n.push({
        editable: !1,
        key: "meta",
        value: t.record.meta
    }),
    n.push({
        key: "score",
        editable: !1,
        value: {
            _custom: {
                type: null,
                readOnly: !0,
                display: t.score.map(r => r.join(", ")).join(" | "),
                tooltip: "Score used to sort routes",
                value: t.score
            }
        }
    }),
    n
}
const j6 = 15485081
  , W6 = 2450411
  , Y6 = 8702998
  , Woe = 2282478
  , X6 = 16486972
  , Yoe = 6710886;
function K6(t) {
    const e = []
      , {record: n} = t;
    n.name != null && e.push({
        label: String(n.name),
        textColor: 0,
        backgroundColor: Woe
    }),
    n.aliasOf && e.push({
        label: "alias",
        textColor: 0,
        backgroundColor: X6
    }),
    t.__vd_match && e.push({
        label: "matches",
        textColor: 0,
        backgroundColor: j6
    }),
    t.__vd_exactActive && e.push({
        label: "exact",
        textColor: 0,
        backgroundColor: Y6
    }),
    t.__vd_active && e.push({
        label: "active",
        textColor: 0,
        backgroundColor: W6
    }),
    n.redirect && e.push({
        label: typeof n.redirect == "string" ? `redirect: ${n.redirect}` : "redirects",
        textColor: 16777215,
        backgroundColor: Yoe
    });
    let r = n.__vd_id;
    return r == null && (r = String(Xoe++),
    n.__vd_id = r),
    {
        id: r,
        label: n.path,
        tags: e,
        children: t.children.map(K6)
    }
}
let Xoe = 0;
const Koe = /^\/(.*)\/([a-z]*)$/;
function q6(t, e) {
    const n = e.matched.length && ia(e.matched[e.matched.length - 1], t.record);
    t.__vd_exactActive = t.__vd_active = n,
    n || (t.__vd_active = e.matched.some(r => ia(r, t.record))),
    t.children.forEach(r => q6(r, e))
}
function Z6(t) {
    t.__vd_match = !1,
    t.children.forEach(Z6)
}
function b_(t, e) {
    const n = String(t.re).match(Koe);
    if (t.__vd_match = !1,
    !n || n.length < 3)
        return !1;
    if (new RegExp(n[1].replace(/\$$/, ""),n[2]).test(e))
        return t.children.forEach(s => b_(s, e)),
        t.record.path !== "/" || e === "/" ? (t.__vd_match = t.re.test(e),
        !0) : !1;
    const i = t.record.path.toLowerCase()
      , o = cd(i);
    return !e.startsWith("/") && (o.includes(e) || i.includes(e)) || o.startsWith(e) || i.startsWith(e) || t.record.name && String(t.record.name).includes(e) ? !0 : t.children.some(s => b_(s, e))
}
function qoe(t, e) {
    const n = {};
    for (const r in t)
        e.includes(r) || (n[r] = t[r]);
    return n
}
function xPe(t) {
    const e = uoe(t.routes, t)
      , n = t.parseQuery || Ooe
      , r = t.stringifyQuery || PA
      , i = t.history;
    if (!i)
        throw new Error('Provide the "history" option when calling "createRouter()": https://next.router.vuejs.org/api/#history.');
    const o = $u()
      , s = $u()
      , a = $u()
      , l = ig(xs);
    let c = xs;
    $o && t.scrollBehavior && "scrollRestoration"in history && (history.scrollRestoration = "manual");
    const u = o1.bind(null, F => "" + F)
      , f = o1.bind(null, Ioe)
      , d = o1.bind(null, cd);
    function h(F, q) {
        let L, ee;
        return N6(F) ? (L = e.getRecordMatcher(F),
        ee = q) : ee = F,
        e.addRoute(ee, L)
    }
    function p(F) {
        const q = e.getRecordMatcher(F);
        q ? e.removeRoute(q) : Qe(`Cannot remove non-existent route "${String(F)}"`)
    }
    function y() {
        return e.getRoutes().map(F => F.record)
    }
    function v(F) {
        return !!e.getRecordMatcher(F)
    }
    function g(F, q) {
        if (q = mt({}, q || l.value),
        typeof F == "string") {
            const xe = s1(n, F, q.path)
              , O = e.resolve({
                path: xe.path
            }, q)
              , $ = i.createHref(xe.fullPath);
            return $.startsWith("//") ? Qe(`Location "${F}" resolved to "${$}". A resolved location cannot start with multiple slashes.`) : O.matched.length || Qe(`No match found for location with path "${F}"`),
            mt(xe, O, {
                params: d(O.params),
                hash: cd(xe.hash),
                redirectedFrom: void 0,
                href: $
            })
        }
        let L;
        if ("path"in F)
            "params"in F && !("name"in F) && Object.keys(F.params).length && Qe(`Path "${F.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),
            L = mt({}, F, {
                path: s1(n, F.path, q.path).path
            });
        else {
            const xe = mt({}, F.params);
            for (const O in xe)
                xe[O] == null && delete xe[O];
            L = mt({}, F, {
                params: f(F.params)
            }),
            q.params = f(q.params)
        }
        const ee = e.resolve(L, q)
          , J = F.hash || "";
        J && !J.startsWith("#") && Qe(`A \`hash\` should always start with the character "#". Replace "${J}" with "#${J}".`),
        ee.params = u(d(ee.params));
        const de = Fie(r, mt({}, F, {
            hash: Aoe(J),
            path: ee.path
        }))
          , pe = i.createHref(de);
        return pe.startsWith("//") ? Qe(`Location "${F}" resolved to "${pe}". A resolved location cannot start with multiple slashes.`) : ee.matched.length || Qe(`No match found for location with path "${"path"in F ? F.path : F}"`),
        mt({
            fullPath: de,
            hash: J,
            query: r === PA ? Roe(F.query) : F.query || {}
        }, ee, {
            redirectedFrom: void 0,
            href: pe
        })
    }
    function m(F) {
        return typeof F == "string" ? s1(n, F, l.value.path) : mt({}, F)
    }
    function _(F, q) {
        if (c !== F)
            return Wc(8, {
                from: q,
                to: F
            })
    }
    function x(F) {
        return E(F)
    }
    function b(F) {
        return x(mt(m(F), {
            replace: !0
        }))
    }
    function w(F) {
        const q = F.matched[F.matched.length - 1];
        if (q && q.redirect) {
            const {redirect: L} = q;
            let ee = typeof L == "function" ? L(F) : L;
            if (typeof ee == "string" && (ee = ee.includes("?") || ee.includes("#") ? ee = m(ee) : {
                path: ee
            },
            ee.params = {}),
            !("path"in ee) && !("name"in ee))
                throw Qe(`Invalid redirect found:
${JSON.stringify(ee, null, 2)}
 when navigating to "${F.fullPath}". A redirect must contain a name or path. This will break in production.`),
                new Error("Invalid redirect");
            return mt({
                query: F.query,
                hash: F.hash,
                params: "path"in ee ? {} : F.params
            }, ee)
        }
    }
    function E(F, q) {
        const L = c = g(F)
          , ee = l.value
          , J = F.state
          , de = F.force
          , pe = F.replace === !0
          , xe = w(L);
        if (xe)
            return E(mt(m(xe), {
                state: typeof xe == "object" ? mt({}, J, xe.state) : J,
                force: de,
                replace: pe
            }), q || L);
        const O = L;
        O.redirectedFrom = q;
        let $;
        return !de && yA(r, ee, L) && ($ = Wc(16, {
            to: O,
            from: ee
        }),
        fe(ee, ee, !0, !1)),
        ($ ? Promise.resolve($) : P(O, ee)).catch(j => Io(j) ? Io(j, 2) ? j : K(j) : U(j, O, ee)).then(j => {
            if (j) {
                if (Io(j, 2))
                    return yA(r, g(j.to), O) && q && (q._count = q._count ? q._count + 1 : 1) > 10 ? (Qe(`Detected an infinite redirection in a navigation guard when going from "${ee.fullPath}" to "${O.fullPath}". Aborting to avoid a Stack Overflow. This will break in production if not fixed.`),
                    Promise.reject(new Error("Infinite redirect in navigation guard"))) : E(mt({
                        replace: pe
                    }, m(j.to), {
                        state: typeof j.to == "object" ? mt({}, J, j.to.state) : J,
                        force: de
                    }), q || O)
            } else
                j = A(O, ee, !0, pe, J);
            return C(O, ee, j),
            j
        }
        )
    }
    function S(F, q) {
        const L = _(F, q);
        return L ? Promise.reject(L) : Promise.resolve()
    }
    function P(F, q) {
        let L;
        const [ee,J,de] = Zoe(F, q);
        L = a1(ee.reverse(), "beforeRouteLeave", F, q);
        for (const xe of ee)
            xe.leaveGuards.forEach(O => {
                L.push(Ps(O, F, q))
            }
            );
        const pe = S.bind(null, F, q);
        return L.push(pe),
        Ql(L).then( () => {
            L = [];
            for (const xe of o.list())
                L.push(Ps(xe, F, q));
            return L.push(pe),
            Ql(L)
        }
        ).then( () => {
            L = a1(J, "beforeRouteUpdate", F, q);
            for (const xe of J)
                xe.updateGuards.forEach(O => {
                    L.push(Ps(O, F, q))
                }
                );
            return L.push(pe),
            Ql(L)
        }
        ).then( () => {
            L = [];
            for (const xe of F.matched)
                if (xe.beforeEnter && !q.matched.includes(xe))
                    if (Yr(xe.beforeEnter))
                        for (const O of xe.beforeEnter)
                            L.push(Ps(O, F, q));
                    else
                        L.push(Ps(xe.beforeEnter, F, q));
            return L.push(pe),
            Ql(L)
        }
        ).then( () => (F.matched.forEach(xe => xe.enterCallbacks = {}),
        L = a1(de, "beforeRouteEnter", F, q),
        L.push(pe),
        Ql(L))).then( () => {
            L = [];
            for (const xe of s.list())
                L.push(Ps(xe, F, q));
            return L.push(pe),
            Ql(L)
        }
        ).catch(xe => Io(xe, 8) ? xe : Promise.reject(xe))
    }
    function C(F, q, L) {
        for (const ee of a.list())
            ee(F, q, L)
    }
    function A(F, q, L, ee, J) {
        const de = _(F, q);
        if (de)
            return de;
        const pe = q === xs
          , xe = $o ? history.state : {};
        L && (ee || pe ? i.replace(F.fullPath, mt({
            scroll: pe && xe && xe.scroll
        }, J)) : i.push(F.fullPath, J)),
        l.value = F,
        fe(F, q, L, pe),
        K()
    }
    let T;
    function I() {
        T || (T = i.listen( (F, q, L) => {
            if (!ge.listening)
                return;
            const ee = g(F)
              , J = w(ee);
            if (J) {
                E(mt(J, {
                    replace: !0
                }), ee).catch(Ef);
                return
            }
            c = ee;
            const de = l.value;
            $o && jie(xA(de.fullPath, L.delta), jg()),
            P(ee, de).catch(pe => Io(pe, 12) ? pe : Io(pe, 2) ? (E(pe.to, ee).then(xe => {
                Io(xe, 20) && !L.delta && L.type === ld.pop && i.go(-1, !1)
            }
            ).catch(Ef),
            Promise.reject()) : (L.delta && i.go(-L.delta, !1),
            U(pe, ee, de))).then(pe => {
                pe = pe || A(ee, de, !1),
                pe && (L.delta && !Io(pe, 8) ? i.go(-L.delta, !1) : L.type === ld.pop && Io(pe, 20) && i.go(-1, !1)),
                C(ee, de, pe)
            }
            ).catch(Ef)
        }
        ))
    }
    let B = $u(), G = $u(), N;
    function U(F, q, L) {
        K(F);
        const ee = G.list();
        return ee.length ? ee.forEach(J => J(F, q, L)) : (Qe("uncaught error during route navigation:"),
        console.error(F)),
        Promise.reject(F)
    }
    function W() {
        return N && l.value !== xs ? Promise.resolve() : new Promise( (F, q) => {
            B.add([F, q])
        }
        )
    }
    function K(F) {
        return N || (N = !F,
        I(),
        B.list().forEach( ([q,L]) => F ? L(F) : q()),
        B.reset()),
        F
    }
    function fe(F, q, L, ee) {
        const {scrollBehavior: J} = t;
        if (!$o || !J)
            return Promise.resolve();
        const de = !L && Wie(xA(F.fullPath, 0)) || (ee || !L) && history.state && history.state.scroll || null;
        return Xe().then( () => J(F, q, de)).then(pe => pe && zie(pe)).catch(pe => U(pe, F, q))
    }
    const ue = F => i.go(F);
    let X;
    const ie = new Set
      , ge = {
        currentRoute: l,
        listening: !0,
        addRoute: h,
        removeRoute: p,
        hasRoute: v,
        getRoutes: y,
        resolve: g,
        options: t,
        push: x,
        replace: b,
        go: ue,
        back: () => ue(-1),
        forward: () => ue(1),
        beforeEach: o.add,
        beforeResolve: s.add,
        afterEach: a.add,
        onError: G.add,
        isReady: W,
        install(F) {
            const q = this;
            F.component("RouterLink", Noe),
            F.component("RouterView", Uoe),
            F.config.globalProperties.$router = q,
            Object.defineProperty(F.config.globalProperties, "$route", {
                enumerable: !0,
                get: () => dr(l)
            }),
            $o && !X && l.value === xs && (X = !0,
            x(i.location).catch(J => {
                Qe("Unexpected error when starting the router:", J)
            }
            ));
            const L = {};
            for (const J in xs)
                L[J] = re( () => l.value[J]);
            F.provide(Wg, q),
            F.provide($w, Mt(L)),
            F.provide(x_, l);
            const ee = F.unmount;
            ie.add(F),
            F.unmount = function() {
                ie.delete(F),
                ie.size < 1 && (c = xs,
                T && T(),
                T = null,
                l.value = xs,
                X = !1,
                N = !1),
                ee()
            }
            ,
            $o && Voe(F, q, e)
        }
    };
    return ge
}
function Ql(t) {
    return t.reduce( (e, n) => e.then( () => n()), Promise.resolve())
}
function Zoe(t, e) {
    const n = []
      , r = []
      , i = []
      , o = Math.max(e.matched.length, t.matched.length);
    for (let s = 0; s < o; s++) {
        const a = e.matched[s];
        a && (t.matched.find(c => ia(c, a)) ? r.push(a) : n.push(a));
        const l = t.matched[s];
        l && (e.matched.find(c => ia(c, l)) || i.push(l))
    }
    return [n, r, i]
}
function bPe() {
    return dn(Wg)
}
function wPe() {
    return dn($w)
}
function J6(t, e) {
    return function() {
        return t.apply(e, arguments)
    }
}
const {toString: Joe} = Object.prototype
  , {getPrototypeOf: Uw} = Object
  , {iterator: Yg, toStringTag: Q6} = Symbol
  , Xg = (t => e => {
    const n = Joe.call(e);
    return t[n] || (t[n] = n.slice(8, -1).toLowerCase())
}
)(Object.create(null))
  , Hi = t => (t = t.toLowerCase(),
e => Xg(e) === t)
  , Kg = t => e => typeof e === t
  , {isArray: yu} = Array
  , ud = Kg("undefined");
function Yd(t) {
    return t !== null && !ud(t) && t.constructor !== null && !ud(t.constructor) && Tr(t.constructor.isBuffer) && t.constructor.isBuffer(t)
}
const eD = Hi("ArrayBuffer");
function Qoe(t) {
    let e;
    return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && eD(t.buffer),
    e
}
const ese = Kg("string")
  , Tr = Kg("function")
  , tD = Kg("number")
  , Xd = t => t !== null && typeof t == "object"
  , tse = t => t === !0 || t === !1
  , kp = t => {
    if (Xg(t) !== "object")
        return !1;
    const e = Uw(t);
    return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Q6 in t) && !(Yg in t)
}
  , nse = t => {
    if (!Xd(t) || Yd(t))
        return !1;
    try {
        return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype
    } catch {
        return !1
    }
}
  , rse = Hi("Date")
  , ise = Hi("File")
  , ose = Hi("Blob")
  , sse = Hi("FileList")
  , ase = t => Xd(t) && Tr(t.pipe)
  , lse = t => {
    let e;
    return t && (typeof FormData == "function" && t instanceof FormData || Tr(t.append) && ((e = Xg(t)) === "formdata" || e === "object" && Tr(t.toString) && t.toString() === "[object FormData]"))
}
  , cse = Hi("URLSearchParams")
  , [use,fse,dse,hse] = ["ReadableStream", "Request", "Response", "Headers"].map(Hi)
  , pse = t => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function Kd(t, e, {allOwnKeys: n=!1}={}) {
    if (t === null || typeof t > "u")
        return;
    let r, i;
    if (typeof t != "object" && (t = [t]),
    yu(t))
        for (r = 0,
        i = t.length; r < i; r++)
            e.call(null, t[r], r, t);
    else {
        if (Yd(t))
            return;
        const o = n ? Object.getOwnPropertyNames(t) : Object.keys(t)
          , s = o.length;
        let a;
        for (r = 0; r < s; r++)
            a = o[r],
            e.call(null, t[a], a, t)
    }
}
function nD(t, e) {
    if (Yd(t))
        return null;
    e = e.toLowerCase();
    const n = Object.keys(t);
    let r = n.length, i;
    for (; r-- > 0; )
        if (i = n[r],
        e === i.toLowerCase())
            return i;
    return null
}
const Va = ( () => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)()
  , rD = t => !ud(t) && t !== Va;
function w_() {
    const {caseless: t} = rD(this) && this || {}
      , e = {}
      , n = (r, i) => {
        const o = t && nD(e, i) || i;
        kp(e[o]) && kp(r) ? e[o] = w_(e[o], r) : kp(r) ? e[o] = w_({}, r) : yu(r) ? e[o] = r.slice() : e[o] = r
    }
    ;
    for (let r = 0, i = arguments.length; r < i; r++)
        arguments[r] && Kd(arguments[r], n);
    return e
}
const gse = (t, e, n, {allOwnKeys: r}={}) => (Kd(e, (i, o) => {
    n && Tr(i) ? t[o] = J6(i, n) : t[o] = i
}
, {
    allOwnKeys: r
}),
t)
  , mse = t => (t.charCodeAt(0) === 65279 && (t = t.slice(1)),
t)
  , vse = (t, e, n, r) => {
    t.prototype = Object.create(e.prototype, r),
    t.prototype.constructor = t,
    Object.defineProperty(t, "super", {
        value: e.prototype
    }),
    n && Object.assign(t.prototype, n)
}
  , yse = (t, e, n, r) => {
    let i, o, s;
    const a = {};
    if (e = e || {},
    t == null)
        return e;
    do {
        for (i = Object.getOwnPropertyNames(t),
        o = i.length; o-- > 0; )
            s = i[o],
            (!r || r(s, t, e)) && !a[s] && (e[s] = t[s],
            a[s] = !0);
        t = n !== !1 && Uw(t)
    } while (t && (!n || n(t, e)) && t !== Object.prototype);
    return e
}
  , _se = (t, e, n) => {
    t = String(t),
    (n === void 0 || n > t.length) && (n = t.length),
    n -= e.length;
    const r = t.indexOf(e, n);
    return r !== -1 && r === n
}
  , xse = t => {
    if (!t)
        return null;
    if (yu(t))
        return t;
    let e = t.length;
    if (!tD(e))
        return null;
    const n = new Array(e);
    for (; e-- > 0; )
        n[e] = t[e];
    return n
}
  , bse = (t => e => t && e instanceof t)(typeof Uint8Array < "u" && Uw(Uint8Array))
  , wse = (t, e) => {
    const r = (t && t[Yg]).call(t);
    let i;
    for (; (i = r.next()) && !i.done; ) {
        const o = i.value;
        e.call(t, o[0], o[1])
    }
}
  , Ese = (t, e) => {
    let n;
    const r = [];
    for (; (n = t.exec(e)) !== null; )
        r.push(n);
    return r
}
  , Sse = Hi("HTMLFormElement")
  , Cse = t => t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(n, r, i) {
    return r.toUpperCase() + i
})
  , BA = ( ({hasOwnProperty: t}) => (e, n) => t.call(e, n))(Object.prototype)
  , Ase = Hi("RegExp")
  , iD = (t, e) => {
    const n = Object.getOwnPropertyDescriptors(t)
      , r = {};
    Kd(n, (i, o) => {
        let s;
        (s = e(i, o, t)) !== !1 && (r[o] = s || i)
    }
    ),
    Object.defineProperties(t, r)
}
  , Tse = t => {
    iD(t, (e, n) => {
        if (Tr(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
            return !1;
        const r = t[n];
        if (Tr(r)) {
            if (e.enumerable = !1,
            "writable"in e) {
                e.writable = !1;
                return
            }
            e.set || (e.set = () => {
                throw Error("Can not rewrite read-only method '" + n + "'")
            }
            )
        }
    }
    )
}
  , Pse = (t, e) => {
    const n = {}
      , r = i => {
        i.forEach(o => {
            n[o] = !0
        }
        )
    }
    ;
    return yu(t) ? r(t) : r(String(t).split(e)),
    n
}
  , Ise = () => {}
  , Ose = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
function Rse(t) {
    return !!(t && Tr(t.append) && t[Q6] === "FormData" && t[Yg])
}
const Mse = t => {
    const e = new Array(10)
      , n = (r, i) => {
        if (Xd(r)) {
            if (e.indexOf(r) >= 0)
                return;
            if (Yd(r))
                return r;
            if (!("toJSON"in r)) {
                e[i] = r;
                const o = yu(r) ? [] : {};
                return Kd(r, (s, a) => {
                    const l = n(s, i + 1);
                    !ud(l) && (o[a] = l)
                }
                ),
                e[i] = void 0,
                o
            }
        }
        return r
    }
    ;
    return n(t, 0)
}
  , Dse = Hi("AsyncFunction")
  , Bse = t => t && (Xd(t) || Tr(t)) && Tr(t.then) && Tr(t.catch)
  , oD = ( (t, e) => t ? setImmediate : e ? ( (n, r) => (Va.addEventListener("message", ({source: i, data: o}) => {
    i === Va && o === n && r.length && r.shift()()
}
, !1),
i => {
    r.push(i),
    Va.postMessage(n, "*")
}
))(`axios@${Math.random()}`, []) : n => setTimeout(n))(typeof setImmediate == "function", Tr(Va.postMessage))
  , kse = typeof queueMicrotask < "u" ? queueMicrotask.bind(Va) : typeof process < "u" && process.nextTick || oD
  , Nse = t => t != null && Tr(t[Yg])
  , te = {
    isArray: yu,
    isArrayBuffer: eD,
    isBuffer: Yd,
    isFormData: lse,
    isArrayBufferView: Qoe,
    isString: ese,
    isNumber: tD,
    isBoolean: tse,
    isObject: Xd,
    isPlainObject: kp,
    isEmptyObject: nse,
    isReadableStream: use,
    isRequest: fse,
    isResponse: dse,
    isHeaders: hse,
    isUndefined: ud,
    isDate: rse,
    isFile: ise,
    isBlob: ose,
    isRegExp: Ase,
    isFunction: Tr,
    isStream: ase,
    isURLSearchParams: cse,
    isTypedArray: bse,
    isFileList: sse,
    forEach: Kd,
    merge: w_,
    extend: gse,
    trim: pse,
    stripBOM: mse,
    inherits: vse,
    toFlatObject: yse,
    kindOf: Xg,
    kindOfTest: Hi,
    endsWith: _se,
    toArray: xse,
    forEachEntry: wse,
    matchAll: Ese,
    isHTMLForm: Sse,
    hasOwnProperty: BA,
    hasOwnProp: BA,
    reduceDescriptors: iD,
    freezeMethods: Tse,
    toObjectSet: Pse,
    toCamelCase: Cse,
    noop: Ise,
    toFiniteNumber: Ose,
    findKey: nD,
    global: Va,
    isContextDefined: rD,
    isSpecCompliantForm: Rse,
    toJSONObject: Mse,
    isAsyncFn: Dse,
    isThenable: Bse,
    setImmediate: oD,
    asap: kse,
    isIterable: Nse
};
function Ye(t, e, n, r, i) {
    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),
    r && (this.request = r),
    i && (this.response = i,
    this.status = i.status ? i.status : null)
}
te.inherits(Ye, Error, {
    toJSON: function() {
        return {
            message: this.message,
            name: this.name,
            description: this.description,
            number: this.number,
            fileName: this.fileName,
            lineNumber: this.lineNumber,
            columnNumber: this.columnNumber,
            stack: this.stack,
            config: te.toJSONObject(this.config),
            code: this.code,
            status: this.status
        }
    }
});
const sD = Ye.prototype
  , aD = {};
["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"].forEach(t => {
    aD[t] = {
        value: t
    }
}
);
Object.defineProperties(Ye, aD);
Object.defineProperty(sD, "isAxiosError", {
    value: !0
});
Ye.from = (t, e, n, r, i, o) => {
    const s = Object.create(sD);
    return te.toFlatObject(t, s, function(l) {
        return l !== Error.prototype
    }, a => a !== "isAxiosError"),
    Ye.call(s, t.message, e, n, r, i),
    s.cause = t,
    s.name = t.name,
    o && Object.assign(s, o),
    s
}
;
const Fse = null;
function E_(t) {
    return te.isPlainObject(t) || te.isArray(t)
}
function lD(t) {
    return te.endsWith(t, "[]") ? t.slice(0, -2) : t
}
function kA(t, e, n) {
    return t ? t.concat(e).map(function(i, o) {
        return i = lD(i),
        !n && o ? "[" + i + "]" : i
    }).join(n ? "." : "") : e
}
function Lse(t) {
    return te.isArray(t) && !t.some(E_)
}
const $se = te.toFlatObject(te, {}, null, function(e) {
    return /^is[A-Z]/.test(e)
});
function qg(t, e, n) {
    if (!te.isObject(t))
        throw new TypeError("target must be an object");
    e = e || new FormData,
    n = te.toFlatObject(n, {
        metaTokens: !0,
        dots: !1,
        indexes: !1
    }, !1, function(y, v) {
        return !te.isUndefined(v[y])
    });
    const r = n.metaTokens
      , i = n.visitor || u
      , o = n.dots
      , s = n.indexes
      , l = (n.Blob || typeof Blob < "u" && Blob) && te.isSpecCompliantForm(e);
    if (!te.isFunction(i))
        throw new TypeError("visitor must be a function");
    function c(p) {
        if (p === null)
            return "";
        if (te.isDate(p))
            return p.toISOString();
        if (te.isBoolean(p))
            return p.toString();
        if (!l && te.isBlob(p))
            throw new Ye("Blob is not supported. Use a Buffer instead.");
        return te.isArrayBuffer(p) || te.isTypedArray(p) ? l && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p
    }
    function u(p, y, v) {
        let g = p;
        if (p && !v && typeof p == "object") {
            if (te.endsWith(y, "{}"))
                y = r ? y : y.slice(0, -2),
                p = JSON.stringify(p);
            else if (te.isArray(p) && Lse(p) || (te.isFileList(p) || te.endsWith(y, "[]")) && (g = te.toArray(p)))
                return y = lD(y),
                g.forEach(function(_, x) {
                    !(te.isUndefined(_) || _ === null) && e.append(s === !0 ? kA([y], x, o) : s === null ? y : y + "[]", c(_))
                }),
                !1
        }
        return E_(p) ? !0 : (e.append(kA(v, y, o), c(p)),
        !1)
    }
    const f = []
      , d = Object.assign($se, {
        defaultVisitor: u,
        convertValue: c,
        isVisitable: E_
    });
    function h(p, y) {
        if (!te.isUndefined(p)) {
            if (f.indexOf(p) !== -1)
                throw Error("Circular reference detected in " + y.join("."));
            f.push(p),
            te.forEach(p, function(g, m) {
                (!(te.isUndefined(g) || g === null) && i.call(e, g, te.isString(m) ? m.trim() : m, y, d)) === !0 && h(g, y ? y.concat(m) : [m])
            }),
            f.pop()
        }
    }
    if (!te.isObject(t))
        throw new TypeError("data must be an object");
    return h(t),
    e
}
function NA(t) {
    const e = {
        "!": "%21",
        "'": "%27",
        "(": "%28",
        ")": "%29",
        "~": "%7E",
        "%20": "+",
        "%00": "\0"
    };
    return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) {
        return e[r]
    })
}
function Gw(t, e) {
    this._pairs = [],
    t && qg(t, this, e)
}
const cD = Gw.prototype;
cD.append = function(e, n) {
    this._pairs.push([e, n])
}
;
cD.toString = function(e) {
    const n = e ? function(r) {
        return e.call(this, r, NA)
    }
    : NA;
    return this._pairs.map(function(i) {
        return n(i[0]) + "=" + n(i[1])
    }, "").join("&")
}
;
function Use(t) {
    return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]")
}
function uD(t, e, n) {
    if (!e)
        return t;
    const r = n && n.encode || Use;
    te.isFunction(n) && (n = {
        serialize: n
    });
    const i = n && n.serialize;
    let o;
    if (i ? o = i(e, n) : o = te.isURLSearchParams(e) ? e.toString() : new Gw(e,n).toString(r),
    o) {
        const s = t.indexOf("#");
        s !== -1 && (t = t.slice(0, s)),
        t += (t.indexOf("?") === -1 ? "?" : "&") + o
    }
    return t
}
class Gse {
    constructor() {
        this.handlers = []
    }
    use(e, n, r) {
        return this.handlers.push({
            fulfilled: e,
            rejected: n,
            synchronous: r ? r.synchronous : !1,
            runWhen: r ? r.runWhen : null
        }),
        this.handlers.length - 1
    }
    eject(e) {
        this.handlers[e] && (this.handlers[e] = null)
    }
    clear() {
        this.handlers && (this.handlers = [])
    }
    forEach(e) {
        te.forEach(this.handlers, function(r) {
            r !== null && e(r)
        })
    }
}
const FA = Gse
  , fD = {
    silentJSONParsing: !0,
    forcedJSONParsing: !0,
    clarifyTimeoutError: !1
}
  , Hse = typeof URLSearchParams < "u" ? URLSearchParams : Gw
  , Vse = typeof FormData < "u" ? FormData : null
  , zse = typeof Blob < "u" ? Blob : null
  , jse = {
    isBrowser: !0,
    classes: {
        URLSearchParams: Hse,
        FormData: Vse,
        Blob: zse
    },
    protocols: ["http", "https", "file", "blob", "url", "data"]
}
  , Hw = typeof window < "u" && typeof document < "u"
  , S_ = typeof navigator == "object" && navigator || void 0
  , Wse = Hw && (!S_ || ["ReactNative", "NativeScript", "NS"].indexOf(S_.product) < 0)
  , Yse = ( () => typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope && typeof self.importScripts == "function")()
  , Xse = Hw && window.location.href || "http://localhost"
  , Kse = Object.freeze(Object.defineProperty({
    __proto__: null,
    hasBrowserEnv: Hw,
    hasStandardBrowserEnv: Wse,
    hasStandardBrowserWebWorkerEnv: Yse,
    navigator: S_,
    origin: Xse
}, Symbol.toStringTag, {
    value: "Module"
}))
  , qn = {
    ...Kse,
    ...jse
};
function qse(t, e) {
    return qg(t, new qn.classes.URLSearchParams, {
        visitor: function(n, r, i, o) {
            return qn.isNode && te.isBuffer(n) ? (this.append(r, n.toString("base64")),
            !1) : o.defaultVisitor.apply(this, arguments)
        },
        ...e
    })
}
function Zse(t) {
    return te.matchAll(/\w+|\[(\w*)]/g, t).map(e => e[0] === "[]" ? "" : e[1] || e[0])
}
function Jse(t) {
    const e = {}
      , n = Object.keys(t);
    let r;
    const i = n.length;
    let o;
    for (r = 0; r < i; r++)
        o = n[r],
        e[o] = t[o];
    return e
}
function dD(t) {
    function e(n, r, i, o) {
        let s = n[o++];
        if (s === "__proto__")
            return !0;
        const a = Number.isFinite(+s)
          , l = o >= n.length;
        return s = !s && te.isArray(i) ? i.length : s,
        l ? (te.hasOwnProp(i, s) ? i[s] = [i[s], r] : i[s] = r,
        !a) : ((!i[s] || !te.isObject(i[s])) && (i[s] = []),
        e(n, r, i[s], o) && te.isArray(i[s]) && (i[s] = Jse(i[s])),
        !a)
    }
    if (te.isFormData(t) && te.isFunction(t.entries)) {
        const n = {};
        return te.forEachEntry(t, (r, i) => {
            e(Zse(r), i, n, 0)
        }
        ),
        n
    }
    return null
}
function Qse(t, e, n) {
    if (te.isString(t))
        try {
            return (e || JSON.parse)(t),
            te.trim(t)
        } catch (r) {
            if (r.name !== "SyntaxError")
                throw r
        }
    return (n || JSON.stringify)(t)
}
const Vw = {
    transitional: fD,
    adapter: ["xhr", "http", "fetch"],
    transformRequest: [function(e, n) {
        const r = n.getContentType() || ""
          , i = r.indexOf("application/json") > -1
          , o = te.isObject(e);
        if (o && te.isHTMLForm(e) && (e = new FormData(e)),
        te.isFormData(e))
            return i ? JSON.stringify(dD(e)) : e;
        if (te.isArrayBuffer(e) || te.isBuffer(e) || te.isStream(e) || te.isFile(e) || te.isBlob(e) || te.isReadableStream(e))
            return e;
        if (te.isArrayBufferView(e))
            return e.buffer;
        if (te.isURLSearchParams(e))
            return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1),
            e.toString();
        let a;
        if (o) {
            if (r.indexOf("application/x-www-form-urlencoded") > -1)
                return qse(e, this.formSerializer).toString();
            if ((a = te.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
                const l = this.env && this.env.FormData;
                return qg(a ? {
                    "files[]": e
                } : e, l && new l, this.formSerializer)
            }
        }
        return o || i ? (n.setContentType("application/json", !1),
        Qse(e)) : e
    }
    ],
    transformResponse: [function(e) {
        const n = this.transitional || Vw.transitional
          , r = n && n.forcedJSONParsing
          , i = this.responseType === "json";
        if (te.isResponse(e) || te.isReadableStream(e))
            return e;
        if (e && te.isString(e) && (r && !this.responseType || i)) {
            const s = !(n && n.silentJSONParsing) && i;
            try {
                return JSON.parse(e)
            } catch (a) {
                if (s)
                    throw a.name === "SyntaxError" ? Ye.from(a, Ye.ERR_BAD_RESPONSE, this, null, this.response) : a
            }
        }
        return e
    }
    ],
    timeout: 0,
    xsrfCookieName: "XSRF-TOKEN",
    xsrfHeaderName: "X-XSRF-TOKEN",
    maxContentLength: -1,
    maxBodyLength: -1,
    env: {
        FormData: qn.classes.FormData,
        Blob: qn.classes.Blob
    },
    validateStatus: function(e) {
        return e >= 200 && e < 300
    },
    headers: {
        common: {
            Accept: "application/json, text/plain, */*",
            "Content-Type": void 0
        }
    }
};
te.forEach(["delete", "get", "head", "post", "put", "patch"], t => {
    Vw.headers[t] = {}
}
);
const zw = Vw
  , eae = te.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"])
  , tae = t => {
    const e = {};
    let n, r, i;
    return t && t.split(`
`).forEach(function(s) {
        i = s.indexOf(":"),
        n = s.substring(0, i).trim().toLowerCase(),
        r = s.substring(i + 1).trim(),
        !(!n || e[n] && eae[n]) && (n === "set-cookie" ? e[n] ? e[n].push(r) : e[n] = [r] : e[n] = e[n] ? e[n] + ", " + r : r)
    }),
    e
}
  , LA = Symbol("internals");
function Gu(t) {
    return t && String(t).trim().toLowerCase()
}
function Np(t) {
    return t === !1 || t == null ? t : te.isArray(t) ? t.map(Np) : String(t)
}
function nae(t) {
    const e = Object.create(null)
      , n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
    let r;
    for (; r = n.exec(t); )
        e[r[1]] = r[2];
    return e
}
const rae = t => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
function l1(t, e, n, r, i) {
    if (te.isFunction(r))
        return r.call(this, e, n);
    if (i && (e = n),
    !!te.isString(e)) {
        if (te.isString(r))
            return e.indexOf(r) !== -1;
        if (te.isRegExp(r))
            return r.test(e)
    }
}
function iae(t) {
    return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, r) => n.toUpperCase() + r)
}
function oae(t, e) {
    const n = te.toCamelCase(" " + e);
    ["get", "set", "has"].forEach(r => {
        Object.defineProperty(t, r + n, {
            value: function(i, o, s) {
                return this[r].call(this, e, i, o, s)
            },
            configurable: !0
        })
    }
    )
}
class Zg {
    constructor(e) {
        e && this.set(e)
    }
    set(e, n, r) {
        const i = this;
        function o(a, l, c) {
            const u = Gu(l);
            if (!u)
                throw new Error("header name must be a non-empty string");
            const f = te.findKey(i, u);
            (!f || i[f] === void 0 || c === !0 || c === void 0 && i[f] !== !1) && (i[f || l] = Np(a))
        }
        const s = (a, l) => te.forEach(a, (c, u) => o(c, u, l));
        if (te.isPlainObject(e) || e instanceof this.constructor)
            s(e, n);
        else if (te.isString(e) && (e = e.trim()) && !rae(e))
            s(tae(e), n);
        else if (te.isObject(e) && te.isIterable(e)) {
            let a = {}, l, c;
            for (const u of e) {
                if (!te.isArray(u))
                    throw TypeError("Object iterator must return a key-value pair");
                a[c = u[0]] = (l = a[c]) ? te.isArray(l) ? [...l, u[1]] : [l, u[1]] : u[1]
            }
            s(a, n)
        } else
            e != null && o(n, e, r);
        return this
    }
    get(e, n) {
        if (e = Gu(e),
        e) {
            const r = te.findKey(this, e);
            if (r) {
                const i = this[r];
                if (!n)
                    return i;
                if (n === !0)
                    return nae(i);
                if (te.isFunction(n))
                    return n.call(this, i, r);
                if (te.isRegExp(n))
                    return n.exec(i);
                throw new TypeError("parser must be boolean|regexp|function")
            }
        }
    }
    has(e, n) {
        if (e = Gu(e),
        e) {
            const r = te.findKey(this, e);
            return !!(r && this[r] !== void 0 && (!n || l1(this, this[r], r, n)))
        }
        return !1
    }
    delete(e, n) {
        const r = this;
        let i = !1;
        function o(s) {
            if (s = Gu(s),
            s) {
                const a = te.findKey(r, s);
                a && (!n || l1(r, r[a], a, n)) && (delete r[a],
                i = !0)
            }
        }
        return te.isArray(e) ? e.forEach(o) : o(e),
        i
    }
    clear(e) {
        const n = Object.keys(this);
        let r = n.length
          , i = !1;
        for (; r--; ) {
            const o = n[r];
            (!e || l1(this, this[o], o, e, !0)) && (delete this[o],
            i = !0)
        }
        return i
    }
    normalize(e) {
        const n = this
          , r = {};
        return te.forEach(this, (i, o) => {
            const s = te.findKey(r, o);
            if (s) {
                n[s] = Np(i),
                delete n[o];
                return
            }
            const a = e ? iae(o) : String(o).trim();
            a !== o && delete n[o],
            n[a] = Np(i),
            r[a] = !0
        }
        ),
        this
    }
    concat(...e) {
        return this.constructor.concat(this, ...e)
    }
    toJSON(e) {
        const n = Object.create(null);
        return te.forEach(this, (r, i) => {
            r != null && r !== !1 && (n[i] = e && te.isArray(r) ? r.join(", ") : r)
        }
        ),
        n
    }
    [Symbol.iterator]() {
        return Object.entries(this.toJSON())[Symbol.iterator]()
    }
    toString() {
        return Object.entries(this.toJSON()).map( ([e,n]) => e + ": " + n).join(`
`)
    }
    getSetCookie() {
        return this.get("set-cookie") || []
    }
    get[Symbol.toStringTag]() {
        return "AxiosHeaders"
    }
    static from(e) {
        return e instanceof this ? e : new this(e)
    }
    static concat(e, ...n) {
        const r = new this(e);
        return n.forEach(i => r.set(i)),
        r
    }
    static accessor(e) {
        const r = (this[LA] = this[LA] = {
            accessors: {}
        }).accessors
          , i = this.prototype;
        function o(s) {
            const a = Gu(s);
            r[a] || (oae(i, s),
            r[a] = !0)
        }
        return te.isArray(e) ? e.forEach(o) : o(e),
        this
    }
}
Zg.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
te.reduceDescriptors(Zg.prototype, ({value: t}, e) => {
    let n = e[0].toUpperCase() + e.slice(1);
    return {
        get: () => t,
        set(r) {
            this[n] = r
        }
    }
}
);
te.freezeMethods(Zg);
const Ni = Zg;
function c1(t, e) {
    const n = this || zw
      , r = e || n
      , i = Ni.from(r.headers);
    let o = r.data;
    return te.forEach(t, function(a) {
        o = a.call(n, o, i.normalize(), e ? e.status : void 0)
    }),
    i.normalize(),
    o
}
function hD(t) {
    return !!(t && t.__CANCEL__)
}
function _u(t, e, n) {
    Ye.call(this, t ?? "canceled", Ye.ERR_CANCELED, e, n),
    this.name = "CanceledError"
}
te.inherits(_u, Ye, {
    __CANCEL__: !0
});
function pD(t, e, n) {
    const r = n.config.validateStatus;
    !n.status || !r || r(n.status) ? t(n) : e(new Ye("Request failed with status code " + n.status,[Ye.ERR_BAD_REQUEST, Ye.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],n.config,n.request,n))
}
function sae(t) {
    const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
    return e && e[1] || ""
}
function aae(t, e) {
    t = t || 10;
    const n = new Array(t)
      , r = new Array(t);
    let i = 0, o = 0, s;
    return e = e !== void 0 ? e : 1e3,
    function(l) {
        const c = Date.now()
          , u = r[o];
        s || (s = c),
        n[i] = l,
        r[i] = c;
        let f = o
          , d = 0;
        for (; f !== i; )
            d += n[f++],
            f = f % t;
        if (i = (i + 1) % t,
        i === o && (o = (o + 1) % t),
        c - s < e)
            return;
        const h = u && c - u;
        return h ? Math.round(d * 1e3 / h) : void 0
    }
}
function lae(t, e) {
    let n = 0, r = 1e3 / e, i, o;
    const s = (c, u=Date.now()) => {
        n = u,
        i = null,
        o && (clearTimeout(o),
        o = null),
        t(...c)
    }
    ;
    return [ (...c) => {
        const u = Date.now()
          , f = u - n;
        f >= r ? s(c, u) : (i = c,
        o || (o = setTimeout( () => {
            o = null,
            s(i)
        }
        , r - f)))
    }
    , () => i && s(i)]
}
const v0 = (t, e, n=3) => {
    let r = 0;
    const i = aae(50, 250);
    return lae(o => {
        const s = o.loaded
          , a = o.lengthComputable ? o.total : void 0
          , l = s - r
          , c = i(l)
          , u = s <= a;
        r = s;
        const f = {
            loaded: s,
            total: a,
            progress: a ? s / a : void 0,
            bytes: l,
            rate: c || void 0,
            estimated: c && a && u ? (a - s) / c : void 0,
            event: o,
            lengthComputable: a != null,
            [e ? "download" : "upload"]: !0
        };
        t(f)
    }
    , n)
}
  , $A = (t, e) => {
    const n = t != null;
    return [r => e[0]({
        lengthComputable: n,
        total: t,
        loaded: r
    }), e[1]]
}
  , UA = t => (...e) => te.asap( () => t(...e))
  , cae = qn.hasStandardBrowserEnv ? ( (t, e) => n => (n = new URL(n,qn.origin),
t.protocol === n.protocol && t.host === n.host && (e || t.port === n.port)))(new URL(qn.origin), qn.navigator && /(msie|trident)/i.test(qn.navigator.userAgent)) : () => !0
  , uae = qn.hasStandardBrowserEnv ? {
    write(t, e, n, r, i, o) {
        const s = [t + "=" + encodeURIComponent(e)];
        te.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()),
        te.isString(r) && s.push("path=" + r),
        te.isString(i) && s.push("domain=" + i),
        o === !0 && s.push("secure"),
        document.cookie = s.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)
    }
} : {
    write() {},
    read() {
        return null
    },
    remove() {}
};
function fae(t) {
    return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)
}
function dae(t, e) {
    return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t
}
function gD(t, e, n) {
    let r = !fae(e);
    return t && (r || n == !1) ? dae(t, e) : e
}
const GA = t => t instanceof Ni ? {
    ...t
} : t;
function ml(t, e) {
    e = e || {};
    const n = {};
    function r(c, u, f, d) {
        return te.isPlainObject(c) && te.isPlainObject(u) ? te.merge.call({
            caseless: d
        }, c, u) : te.isPlainObject(u) ? te.merge({}, u) : te.isArray(u) ? u.slice() : u
    }
    function i(c, u, f, d) {
        if (te.isUndefined(u)) {
            if (!te.isUndefined(c))
                return r(void 0, c, f, d)
        } else
            return r(c, u, f, d)
    }
    function o(c, u) {
        if (!te.isUndefined(u))
            return r(void 0, u)
    }
    function s(c, u) {
        if (te.isUndefined(u)) {
            if (!te.isUndefined(c))
                return r(void 0, c)
        } else
            return r(void 0, u)
    }
    function a(c, u, f) {
        if (f in e)
            return r(c, u);
        if (f in t)
            return r(void 0, c)
    }
    const l = {
        url: o,
        method: o,
        data: o,
        baseURL: s,
        transformRequest: s,
        transformResponse: s,
        paramsSerializer: s,
        timeout: s,
        timeoutMessage: s,
        withCredentials: s,
        withXSRFToken: s,
        adapter: s,
        responseType: s,
        xsrfCookieName: s,
        xsrfHeaderName: s,
        onUploadProgress: s,
        onDownloadProgress: s,
        decompress: s,
        maxContentLength: s,
        maxBodyLength: s,
        beforeRedirect: s,
        transport: s,
        httpAgent: s,
        httpsAgent: s,
        cancelToken: s,
        socketPath: s,
        responseEncoding: s,
        validateStatus: a,
        headers: (c, u, f) => i(GA(c), GA(u), f, !0)
    };
    return te.forEach(Object.keys({
        ...t,
        ...e
    }), function(u) {
        const f = l[u] || i
          , d = f(t[u], e[u], u);
        te.isUndefined(d) && f !== a || (n[u] = d)
    }),
    n
}
const mD = t => {
    const e = ml({}, t);
    let {data: n, withXSRFToken: r, xsrfHeaderName: i, xsrfCookieName: o, headers: s, auth: a} = e;
    e.headers = s = Ni.from(s),
    e.url = uD(gD(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer),
    a && s.set("Authorization", "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : "")));
    let l;
    if (te.isFormData(n)) {
        if (qn.hasStandardBrowserEnv || qn.hasStandardBrowserWebWorkerEnv)
            s.setContentType(void 0);
        else if ((l = s.getContentType()) !== !1) {
            const [c,...u] = l ? l.split(";").map(f => f.trim()).filter(Boolean) : [];
            s.setContentType([c || "multipart/form-data", ...u].join("; "))
        }
    }
    if (qn.hasStandardBrowserEnv && (r && te.isFunction(r) && (r = r(e)),
    r || r !== !1 && cae(e.url))) {
        const c = i && o && uae.read(o);
        c && s.set(i, c)
    }
    return e
}
  , hae = typeof XMLHttpRequest < "u"
  , pae = hae && function(t) {
    return new Promise(function(n, r) {
        const i = mD(t);
        let o = i.data;
        const s = Ni.from(i.headers).normalize();
        let {responseType: a, onUploadProgress: l, onDownloadProgress: c} = i, u, f, d, h, p;
        function y() {
            h && h(),
            p && p(),
            i.cancelToken && i.cancelToken.unsubscribe(u),
            i.signal && i.signal.removeEventListener("abort", u)
        }
        let v = new XMLHttpRequest;
        v.open(i.method.toUpperCase(), i.url, !0),
        v.timeout = i.timeout;
        function g() {
            if (!v)
                return;
            const _ = Ni.from("getAllResponseHeaders"in v && v.getAllResponseHeaders())
              , b = {
                data: !a || a === "text" || a === "json" ? v.responseText : v.response,
                status: v.status,
                statusText: v.statusText,
                headers: _,
                config: t,
                request: v
            };
            pD(function(E) {
                n(E),
                y()
            }, function(E) {
                r(E),
                y()
            }, b),
            v = null
        }
        "onloadend"in v ? v.onloadend = g : v.onreadystatechange = function() {
            !v || v.readyState !== 4 || v.status === 0 && !(v.responseURL && v.responseURL.indexOf("file:") === 0) || setTimeout(g)
        }
        ,
        v.onabort = function() {
            v && (r(new Ye("Request aborted",Ye.ECONNABORTED,t,v)),
            v = null)
        }
        ,
        v.onerror = function() {
            r(new Ye("Network Error",Ye.ERR_NETWORK,t,v)),
            v = null
        }
        ,
        v.ontimeout = function() {
            let x = i.timeout ? "timeout of " + i.timeout + "ms exceeded" : "timeout exceeded";
            const b = i.transitional || fD;
            i.timeoutErrorMessage && (x = i.timeoutErrorMessage),
            r(new Ye(x,b.clarifyTimeoutError ? Ye.ETIMEDOUT : Ye.ECONNABORTED,t,v)),
            v = null
        }
        ,
        o === void 0 && s.setContentType(null),
        "setRequestHeader"in v && te.forEach(s.toJSON(), function(x, b) {
            v.setRequestHeader(b, x)
        }),
        te.isUndefined(i.withCredentials) || (v.withCredentials = !!i.withCredentials),
        a && a !== "json" && (v.responseType = i.responseType),
        c && ([d,p] = v0(c, !0),
        v.addEventListener("progress", d)),
        l && v.upload && ([f,h] = v0(l),
        v.upload.addEventListener("progress", f),
        v.upload.addEventListener("loadend", h)),
        (i.cancelToken || i.signal) && (u = _ => {
            v && (r(!_ || _.type ? new _u(null,t,v) : _),
            v.abort(),
            v = null)
        }
        ,
        i.cancelToken && i.cancelToken.subscribe(u),
        i.signal && (i.signal.aborted ? u() : i.signal.addEventListener("abort", u)));
        const m = sae(i.url);
        if (m && qn.protocols.indexOf(m) === -1) {
            r(new Ye("Unsupported protocol " + m + ":",Ye.ERR_BAD_REQUEST,t));
            return
        }
        v.send(o || null)
    }
    )
}
  , gae = (t, e) => {
    const {length: n} = t = t ? t.filter(Boolean) : [];
    if (e || n) {
        let r = new AbortController, i;
        const o = function(c) {
            if (!i) {
                i = !0,
                a();
                const u = c instanceof Error ? c : this.reason;
                r.abort(u instanceof Ye ? u : new _u(u instanceof Error ? u.message : u))
            }
        };
        let s = e && setTimeout( () => {
            s = null,
            o(new Ye(`timeout ${e} of ms exceeded`,Ye.ETIMEDOUT))
        }
        , e);
        const a = () => {
            t && (s && clearTimeout(s),
            s = null,
            t.forEach(c => {
                c.unsubscribe ? c.unsubscribe(o) : c.removeEventListener("abort", o)
            }
            ),
            t = null)
        }
        ;
        t.forEach(c => c.addEventListener("abort", o));
        const {signal: l} = r;
        return l.unsubscribe = () => te.asap(a),
        l
    }
}
  , mae = gae
  , vae = function*(t, e) {
    let n = t.byteLength;
    if (!e || n < e) {
        yield t;
        return
    }
    let r = 0, i;
    for (; r < n; )
        i = r + e,
        yield t.slice(r, i),
        r = i
}
  , yae = async function*(t, e) {
    for await(const n of _ae(t))
        yield*vae(n, e)
}
  , _ae = async function*(t) {
    if (t[Symbol.asyncIterator]) {
        yield*t;
        return
    }
    const e = t.getReader();
    try {
        for (; ; ) {
            const {done: n, value: r} = await e.read();
            if (n)
                break;
            yield r
        }
    } finally {
        await e.cancel()
    }
}
  , HA = (t, e, n, r) => {
    const i = yae(t, e);
    let o = 0, s, a = l => {
        s || (s = !0,
        r && r(l))
    }
    ;
    return new ReadableStream({
        async pull(l) {
            try {
                const {done: c, value: u} = await i.next();
                if (c) {
                    a(),
                    l.close();
                    return
                }
                let f = u.byteLength;
                if (n) {
                    let d = o += f;
                    n(d)
                }
                l.enqueue(new Uint8Array(u))
            } catch (c) {
                throw a(c),
                c
            }
        },
        cancel(l) {
            return a(l),
            i.return()
        }
    },{
        highWaterMark: 2
    })
}
  , Jg = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function"
  , vD = Jg && typeof ReadableStream == "function"
  , xae = Jg && (typeof TextEncoder == "function" ? (t => e => t.encode(e))(new TextEncoder) : async t => new Uint8Array(await new Response(t).arrayBuffer()))
  , yD = (t, ...e) => {
    try {
        return !!t(...e)
    } catch {
        return !1
    }
}
  , bae = vD && yD( () => {
    let t = !1;
    const e = new Request(qn.origin,{
        body: new ReadableStream,
        method: "POST",
        get duplex() {
            return t = !0,
            "half"
        }
    }).headers.has("Content-Type");
    return t && !e
}
)
  , VA = 64 * 1024
  , C_ = vD && yD( () => te.isReadableStream(new Response("").body))
  , y0 = {
    stream: C_ && (t => t.body)
};
Jg && (t => {
    ["text", "arrayBuffer", "blob", "formData", "stream"].forEach(e => {
        !y0[e] && (y0[e] = te.isFunction(t[e]) ? n => n[e]() : (n, r) => {
            throw new Ye(`Response type '${e}' is not supported`,Ye.ERR_NOT_SUPPORT,r)
        }
        )
    }
    )
}
)(new Response);
const wae = async t => {
    if (t == null)
        return 0;
    if (te.isBlob(t))
        return t.size;
    if (te.isSpecCompliantForm(t))
        return (await new Request(qn.origin,{
            method: "POST",
            body: t
        }).arrayBuffer()).byteLength;
    if (te.isArrayBufferView(t) || te.isArrayBuffer(t))
        return t.byteLength;
    if (te.isURLSearchParams(t) && (t = t + ""),
    te.isString(t))
        return (await xae(t)).byteLength
}
  , Eae = async (t, e) => {
    const n = te.toFiniteNumber(t.getContentLength());
    return n ?? wae(e)
}
  , Sae = Jg && (async t => {
    let {url: e, method: n, data: r, signal: i, cancelToken: o, timeout: s, onDownloadProgress: a, onUploadProgress: l, responseType: c, headers: u, withCredentials: f="same-origin", fetchOptions: d} = mD(t);
    c = c ? (c + "").toLowerCase() : "text";
    let h = mae([i, o && o.toAbortSignal()], s), p;
    const y = h && h.unsubscribe && ( () => {
        h.unsubscribe()
    }
    );
    let v;
    try {
        if (l && bae && n !== "get" && n !== "head" && (v = await Eae(u, r)) !== 0) {
            let b = new Request(e,{
                method: "POST",
                body: r,
                duplex: "half"
            }), w;
            if (te.isFormData(r) && (w = b.headers.get("content-type")) && u.setContentType(w),
            b.body) {
                const [E,S] = $A(v, v0(UA(l)));
                r = HA(b.body, VA, E, S)
            }
        }
        te.isString(f) || (f = f ? "include" : "omit");
        const g = "credentials"in Request.prototype;
        p = new Request(e,{
            ...d,
            signal: h,
            method: n.toUpperCase(),
            headers: u.normalize().toJSON(),
            body: r,
            duplex: "half",
            credentials: g ? f : void 0
        });
        let m = await fetch(p, d);
        const _ = C_ && (c === "stream" || c === "response");
        if (C_ && (a || _ && y)) {
            const b = {};
            ["status", "statusText", "headers"].forEach(P => {
                b[P] = m[P]
            }
            );
            const w = te.toFiniteNumber(m.headers.get("content-length"))
              , [E,S] = a && $A(w, v0(UA(a), !0)) || [];
            m = new Response(HA(m.body, VA, E, () => {
                S && S(),
                y && y()
            }
            ),b)
        }
        c = c || "text";
        let x = await y0[te.findKey(y0, c) || "text"](m, t);
        return !_ && y && y(),
        await new Promise( (b, w) => {
            pD(b, w, {
                data: x,
                headers: Ni.from(m.headers),
                status: m.status,
                statusText: m.statusText,
                config: t,
                request: p
            })
        }
        )
    } catch (g) {
        throw y && y(),
        g && g.name === "TypeError" && /Load failed|fetch/i.test(g.message) ? Object.assign(new Ye("Network Error",Ye.ERR_NETWORK,t,p), {
            cause: g.cause || g
        }) : Ye.from(g, g && g.code, t, p)
    }
}
)
  , A_ = {
    http: Fse,
    xhr: pae,
    fetch: Sae
};
te.forEach(A_, (t, e) => {
    if (t) {
        try {
            Object.defineProperty(t, "name", {
                value: e
            })
        } catch {}
        Object.defineProperty(t, "adapterName", {
            value: e
        })
    }
}
);
const zA = t => `- ${t}`
  , Cae = t => te.isFunction(t) || t === null || t === !1
  , _D = {
    getAdapter: t => {
        t = te.isArray(t) ? t : [t];
        const {length: e} = t;
        let n, r;
        const i = {};
        for (let o = 0; o < e; o++) {
            n = t[o];
            let s;
            if (r = n,
            !Cae(n) && (r = A_[(s = String(n)).toLowerCase()],
            r === void 0))
                throw new Ye(`Unknown adapter '${s}'`);
            if (r)
                break;
            i[s || "#" + o] = r
        }
        if (!r) {
            const o = Object.entries(i).map( ([a,l]) => `adapter ${a} ` + (l === !1 ? "is not supported by the environment" : "is not available in the build"));
            let s = e ? o.length > 1 ? `since :
` + o.map(zA).join(`
`) : " " + zA(o[0]) : "as no adapter specified";
            throw new Ye("There is no suitable adapter to dispatch the request " + s,"ERR_NOT_SUPPORT")
        }
        return r
    }
    ,
    adapters: A_
};
function u1(t) {
    if (t.cancelToken && t.cancelToken.throwIfRequested(),
    t.signal && t.signal.aborted)
        throw new _u(null,t)
}
function jA(t) {
    return u1(t),
    t.headers = Ni.from(t.headers),
    t.data = c1.call(t, t.transformRequest),
    ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1),
    _D.getAdapter(t.adapter || zw.adapter)(t).then(function(r) {
        return u1(t),
        r.data = c1.call(t, t.transformResponse, r),
        r.headers = Ni.from(r.headers),
        r
    }, function(r) {
        return hD(r) || (u1(t),
        r && r.response && (r.response.data = c1.call(t, t.transformResponse, r.response),
        r.response.headers = Ni.from(r.response.headers))),
        Promise.reject(r)
    })
}
const xD = "1.11.0"
  , Qg = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach( (t, e) => {
    Qg[t] = function(r) {
        return typeof r === t || "a" + (e < 1 ? "n " : " ") + t
    }
}
);
const WA = {};
Qg.transitional = function(e, n, r) {
    function i(o, s) {
        return "[Axios v" + xD + "] Transitional option '" + o + "'" + s + (r ? ". " + r : "")
    }
    return (o, s, a) => {
        if (e === !1)
            throw new Ye(i(s, " has been removed" + (n ? " in " + n : "")),Ye.ERR_DEPRECATED);
        return n && !WA[s] && (WA[s] = !0,
        console.warn(i(s, " has been deprecated since v" + n + " and will be removed in the near future"))),
        e ? e(o, s, a) : !0
    }
}
;
Qg.spelling = function(e) {
    return (n, r) => (console.warn(`${r} is likely a misspelling of ${e}`),
    !0)
}
;
function Aae(t, e, n) {
    if (typeof t != "object")
        throw new Ye("options must be an object",Ye.ERR_BAD_OPTION_VALUE);
    const r = Object.keys(t);
    let i = r.length;
    for (; i-- > 0; ) {
        const o = r[i]
          , s = e[o];
        if (s) {
            const a = t[o]
              , l = a === void 0 || s(a, o, t);
            if (l !== !0)
                throw new Ye("option " + o + " must be " + l,Ye.ERR_BAD_OPTION_VALUE);
            continue
        }
        if (n !== !0)
            throw new Ye("Unknown option " + o,Ye.ERR_BAD_OPTION)
    }
}
const Fp = {
    assertOptions: Aae,
    validators: Qg
}
  , Wi = Fp.validators;
class _0 {
    constructor(e) {
        this.defaults = e || {},
        this.interceptors = {
            request: new FA,
            response: new FA
        }
    }
    async request(e, n) {
        try {
            return await this._request(e, n)
        } catch (r) {
            if (r instanceof Error) {
                let i = {};
                Error.captureStackTrace ? Error.captureStackTrace(i) : i = new Error;
                const o = i.stack ? i.stack.replace(/^.+\n/, "") : "";
                try {
                    r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
` + o) : r.stack = o
                } catch {}
            }
            throw r
        }
    }
    _request(e, n) {
        typeof e == "string" ? (n = n || {},
        n.url = e) : n = e || {},
        n = ml(this.defaults, n);
        const {transitional: r, paramsSerializer: i, headers: o} = n;
        r !== void 0 && Fp.assertOptions(r, {
            silentJSONParsing: Wi.transitional(Wi.boolean),
            forcedJSONParsing: Wi.transitional(Wi.boolean),
            clarifyTimeoutError: Wi.transitional(Wi.boolean)
        }, !1),
        i != null && (te.isFunction(i) ? n.paramsSerializer = {
            serialize: i
        } : Fp.assertOptions(i, {
            encode: Wi.function,
            serialize: Wi.function
        }, !0)),
        n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0),
        Fp.assertOptions(n, {
            baseUrl: Wi.spelling("baseURL"),
            withXsrfToken: Wi.spelling("withXSRFToken")
        }, !0),
        n.method = (n.method || this.defaults.method || "get").toLowerCase();
        let s = o && te.merge(o.common, o[n.method]);
        o && te.forEach(["delete", "get", "head", "post", "put", "patch", "common"], p => {
            delete o[p]
        }
        ),
        n.headers = Ni.concat(s, o);
        const a = [];
        let l = !0;
        this.interceptors.request.forEach(function(y) {
            typeof y.runWhen == "function" && y.runWhen(n) === !1 || (l = l && y.synchronous,
            a.unshift(y.fulfilled, y.rejected))
        });
        const c = [];
        this.interceptors.response.forEach(function(y) {
            c.push(y.fulfilled, y.rejected)
        });
        let u, f = 0, d;
        if (!l) {
            const p = [jA.bind(this), void 0];
            for (p.unshift(...a),
            p.push(...c),
            d = p.length,
            u = Promise.resolve(n); f < d; )
                u = u.then(p[f++], p[f++]);
            return u
        }
        d = a.length;
        let h = n;
        for (f = 0; f < d; ) {
            const p = a[f++]
              , y = a[f++];
            try {
                h = p(h)
            } catch (v) {
                y.call(this, v);
                break
            }
        }
        try {
            u = jA.call(this, h)
        } catch (p) {
            return Promise.reject(p)
        }
        for (f = 0,
        d = c.length; f < d; )
            u = u.then(c[f++], c[f++]);
        return u
    }
    getUri(e) {
        e = ml(this.defaults, e);
        const n = gD(e.baseURL, e.url, e.allowAbsoluteUrls);
        return uD(n, e.params, e.paramsSerializer)
    }
}
te.forEach(["delete", "get", "head", "options"], function(e) {
    _0.prototype[e] = function(n, r) {
        return this.request(ml(r || {}, {
            method: e,
            url: n,
            data: (r || {}).data
        }))
    }
});
te.forEach(["post", "put", "patch"], function(e) {
    function n(r) {
        return function(o, s, a) {
            return this.request(ml(a || {}, {
                method: e,
                headers: r ? {
                    "Content-Type": "multipart/form-data"
                } : {},
                url: o,
                data: s
            }))
        }
    }
    _0.prototype[e] = n(),
    _0.prototype[e + "Form"] = n(!0)
});
const Lp = _0;
class jw {
    constructor(e) {
        if (typeof e != "function")
            throw new TypeError("executor must be a function.");
        let n;
        this.promise = new Promise(function(o) {
            n = o
        }
        );
        const r = this;
        this.promise.then(i => {
            if (!r._listeners)
                return;
            let o = r._listeners.length;
            for (; o-- > 0; )
                r._listeners[o](i);
            r._listeners = null
        }
        ),
        this.promise.then = i => {
            let o;
            const s = new Promise(a => {
                r.subscribe(a),
                o = a
            }
            ).then(i);
            return s.cancel = function() {
                r.unsubscribe(o)
            }
            ,
            s
        }
        ,
        e(function(o, s, a) {
            r.reason || (r.reason = new _u(o,s,a),
            n(r.reason))
        })
    }
    throwIfRequested() {
        if (this.reason)
            throw this.reason
    }
    subscribe(e) {
        if (this.reason) {
            e(this.reason);
            return
        }
        this._listeners ? this._listeners.push(e) : this._listeners = [e]
    }
    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 = r => {
            e.abort(r)
        }
        ;
        return this.subscribe(n),
        e.signal.unsubscribe = () => this.unsubscribe(n),
        e.signal
    }
    static source() {
        let e;
        return {
            token: new jw(function(i) {
                e = i
            }
            ),
            cancel: e
        }
    }
}
const Tae = jw;
function Pae(t) {
    return function(n) {
        return t.apply(null, n)
    }
}
function Iae(t) {
    return te.isObject(t) && t.isAxiosError === !0
}
const T_ = {
    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(T_).forEach( ([t,e]) => {
    T_[e] = t
}
);
const Oae = T_;
function bD(t) {
    const e = new Lp(t)
      , n = J6(Lp.prototype.request, e);
    return te.extend(n, Lp.prototype, e, {
        allOwnKeys: !0
    }),
    te.extend(n, e, null, {
        allOwnKeys: !0
    }),
    n.create = function(i) {
        return bD(ml(t, i))
    }
    ,
    n
}
const pn = bD(zw);
pn.Axios = Lp;
pn.CanceledError = _u;
pn.CancelToken = Tae;
pn.isCancel = hD;
pn.VERSION = xD;
pn.toFormData = qg;
pn.AxiosError = Ye;
pn.Cancel = pn.CanceledError;
pn.all = function(e) {
    return Promise.all(e)
}
;
pn.spread = Pae;
pn.isAxiosError = Iae;
pn.mergeConfig = ml;
pn.AxiosHeaders = Ni;
pn.formToJSON = t => dD(te.isHTMLForm(t) ? new FormData(t) : t);
pn.getAdapter = _D.getAdapter;
pn.HttpStatusCode = Oae;
pn.default = pn;
const EPe = pn;
var V = (t => (t.Application = "application",
t.WebGLPipes = "webgl-pipes",
t.WebGLPipesAdaptor = "webgl-pipes-adaptor",
t.WebGLSystem = "webgl-system",
t.WebGPUPipes = "webgpu-pipes",
t.WebGPUPipesAdaptor = "webgpu-pipes-adaptor",
t.WebGPUSystem = "webgpu-system",
t.CanvasSystem = "canvas-system",
t.CanvasPipesAdaptor = "canvas-pipes-adaptor",
t.CanvasPipes = "canvas-pipes",
t.Asset = "asset",
t.LoadParser = "load-parser",
t.ResolveParser = "resolve-parser",
t.CacheParser = "cache-parser",
t.DetectionParser = "detection-parser",
t.MaskEffect = "mask-effect",
t.BlendMode = "blend-mode",
t.TextureSource = "texture-source",
t.Environment = "environment",
t.ShapeBuilder = "shape-builder",
t.Batcher = "batcher",
t))(V || {});
const P_ = t => {
    if (typeof t == "function" || typeof t == "object" && t.extension) {
        if (!t.extension)
            throw new Error("Extension class must have an extension object");
        t = {
            ...typeof t.extension != "object" ? {
                type: t.extension
            } : t.extension,
            ref: t
        }
    }
    if (typeof t == "object")
        t = {
            ...t
        };
    else
        throw new Error("Invalid extension type");
    return typeof t.type == "string" && (t.type = [t.type]),
    t
}
  , Yh = (t, e) => P_(t).priority ?? e
  , $e = {
    _addHandlers: {},
    _removeHandlers: {},
    _queue: {},
    remove(...t) {
        return t.map(P_).forEach(e => {
            e.type.forEach(n => {
                var r, i;
                return (i = (r = this._removeHandlers)[n]) == null ? void 0 : i.call(r, e)
            }
            )
        }
        ),
        this
    },
    add(...t) {
        return t.map(P_).forEach(e => {
            e.type.forEach(n => {
                var o, s;
                const r = this._addHandlers
                  , i = this._queue;
                r[n] ? (s = r[n]) == null || s.call(r, e) : (i[n] = i[n] || [],
                (o = i[n]) == null || o.push(e))
            }
            )
        }
        ),
        this
    },
    handle(t, e, n) {
        var s;
        const r = this._addHandlers
          , i = this._removeHandlers;
        if (r[t] || i[t])
            throw new Error(`Extension type ${t} already has a handler`);
        r[t] = e,
        i[t] = n;
        const o = this._queue;
        return o[t] && ((s = o[t]) == null || s.forEach(a => e(a)),
        delete o[t]),
        this
    },
    handleByMap(t, e) {
        return this.handle(t, n => {
            n.name && (e[n.name] = n.ref)
        }
        , n => {
            n.name && delete e[n.name]
        }
        )
    },
    handleByNamedList(t, e, n=-1) {
        return this.handle(t, r => {
            e.findIndex(o => o.name === r.name) >= 0 || (e.push({
                name: r.name,
                value: r.ref
            }),
            e.sort( (o, s) => Yh(s.value, n) - Yh(o.value, n)))
        }
        , r => {
            const i = e.findIndex(o => o.name === r.name);
            i !== -1 && e.splice(i, 1)
        }
        )
    },
    handleByList(t, e, n=-1) {
        return this.handle(t, r => {
            e.includes(r.ref) || (e.push(r.ref),
            e.sort( (i, o) => Yh(o, n) - Yh(i, n)))
        }
        , r => {
            const i = e.indexOf(r.ref);
            i !== -1 && e.splice(i, 1)
        }
        )
    },
    mixin(t, ...e) {
        for (const n of e)
            Object.defineProperties(t.prototype, Object.getOwnPropertyDescriptors(n))
    }
}
  , Rae = {
    extension: {
        type: V.Environment,
        name: "browser",
        priority: -1
    },
    test: () => !0,
    load: async () => {
        await Uf( () => Promise.resolve().then( () => Fve), void 0)
    }
}
  , Mae = {
    extension: {
        type: V.Environment,
        name: "webworker",
        priority: 0
    },
    test: () => typeof self < "u" && self.WorkerGlobalScope !== void 0,
    load: async () => {
        await Uf( () => Promise.resolve().then( () => Lve), void 0)
    }
};
class Jt {
    constructor(e, n, r) {
        this._x = n || 0,
        this._y = r || 0,
        this._observer = e
    }
    clone(e) {
        return new Jt(e ?? this._observer,this._x,this._y)
    }
    set(e=0, n=e) {
        return (this._x !== e || this._y !== n) && (this._x = e,
        this._y = n,
        this._observer._onUpdate(this)),
        this
    }
    copyFrom(e) {
        return (this._x !== e.x || this._y !== e.y) && (this._x = e.x,
        this._y = e.y,
        this._observer._onUpdate(this)),
        this
    }
    copyTo(e) {
        return e.set(this._x, this._y),
        e
    }
    equals(e) {
        return e.x === this._x && e.y === this._y
    }
    toString() {
        return `[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`
    }
    get x() {
        return this._x
    }
    set x(e) {
        this._x !== e && (this._x = e,
        this._observer._onUpdate(this))
    }
    get y() {
        return this._y
    }
    set y(e) {
        this._y !== e && (this._y = e,
        this._observer._onUpdate(this))
    }
}
var wD = {
    exports: {}
};
(function(t) {
    var e = Object.prototype.hasOwnProperty
      , n = "~";
    function r() {}
    Object.create && (r.prototype = Object.create(null),
    new r().__proto__ || (n = !1));
    function i(l, c, u) {
        this.fn = l,
        this.context = c,
        this.once = u || !1
    }
    function o(l, c, u, f, d) {
        if (typeof u != "function")
            throw new TypeError("The listener must be a function");
        var h = new i(u,f || l,d)
          , p = n ? n + c : c;
        return l._events[p] ? l._events[p].fn ? l._events[p] = [l._events[p], h] : l._events[p].push(h) : (l._events[p] = h,
        l._eventsCount++),
        l
    }
    function s(l, c) {
        --l._eventsCount === 0 ? l._events = new r : delete l._events[c]
    }
    function a() {
        this._events = new r,
        this._eventsCount = 0
    }
    a.prototype.eventNames = function() {
        var c = [], u, f;
        if (this._eventsCount === 0)
            return c;
        for (f in u = this._events)
            e.call(u, f) && c.push(n ? f.slice(1) : f);
        return Object.getOwnPropertySymbols ? c.concat(Object.getOwnPropertySymbols(u)) : c
    }
    ,
    a.prototype.listeners = function(c) {
        var u = n ? n + c : c
          , f = this._events[u];
        if (!f)
            return [];
        if (f.fn)
            return [f.fn];
        for (var d = 0, h = f.length, p = new Array(h); d < h; d++)
            p[d] = f[d].fn;
        return p
    }
    ,
    a.prototype.listenerCount = function(c) {
        var u = n ? n + c : c
          , f = this._events[u];
        return f ? f.fn ? 1 : f.length : 0
    }
    ,
    a.prototype.emit = function(c, u, f, d, h, p) {
        var y = n ? n + c : c;
        if (!this._events[y])
            return !1;
        var v = this._events[y], g = arguments.length, m, _;
        if (v.fn) {
            switch (v.once && this.removeListener(c, v.fn, void 0, !0),
            g) {
            case 1:
                return v.fn.call(v.context),
                !0;
            case 2:
                return v.fn.call(v.context, u),
                !0;
            case 3:
                return v.fn.call(v.context, u, f),
                !0;
            case 4:
                return v.fn.call(v.context, u, f, d),
                !0;
            case 5:
                return v.fn.call(v.context, u, f, d, h),
                !0;
            case 6:
                return v.fn.call(v.context, u, f, d, h, p),
                !0
            }
            for (_ = 1,
            m = new Array(g - 1); _ < g; _++)
                m[_ - 1] = arguments[_];
            v.fn.apply(v.context, m)
        } else {
            var x = v.length, b;
            for (_ = 0; _ < x; _++)
                switch (v[_].once && this.removeListener(c, v[_].fn, void 0, !0),
                g) {
                case 1:
                    v[_].fn.call(v[_].context);
                    break;
                case 2:
                    v[_].fn.call(v[_].context, u);
                    break;
                case 3:
                    v[_].fn.call(v[_].context, u, f);
                    break;
                case 4:
                    v[_].fn.call(v[_].context, u, f, d);
                    break;
                default:
                    if (!m)
                        for (b = 1,
                        m = new Array(g - 1); b < g; b++)
                            m[b - 1] = arguments[b];
                    v[_].fn.apply(v[_].context, m)
                }
        }
        return !0
    }
    ,
    a.prototype.on = function(c, u, f) {
        return o(this, c, u, f, !1)
    }
    ,
    a.prototype.once = function(c, u, f) {
        return o(this, c, u, f, !0)
    }
    ,
    a.prototype.removeListener = function(c, u, f, d) {
        var h = n ? n + c : c;
        if (!this._events[h])
            return this;
        if (!u)
            return s(this, h),
            this;
        var p = this._events[h];
        if (p.fn)
            p.fn === u && (!d || p.once) && (!f || p.context === f) && s(this, h);
        else {
            for (var y = 0, v = [], g = p.length; y < g; y++)
                (p[y].fn !== u || d && !p[y].once || f && p[y].context !== f) && v.push(p[y]);
            v.length ? this._events[h] = v.length === 1 ? v[0] : v : s(this, h)
        }
        return this
    }
    ,
    a.prototype.removeAllListeners = function(c) {
        var u;
        return c ? (u = n ? n + c : c,
        this._events[u] && s(this, u)) : (this._events = new r,
        this._eventsCount = 0),
        this
    }
    ,
    a.prototype.off = a.prototype.removeListener,
    a.prototype.addListener = a.prototype.on,
    a.prefixed = n,
    a.EventEmitter = a,
    t.exports = a
}
)(wD);
var Dae = wD.exports;
const Jr = hu(Dae)
  , Bae = Math.PI * 2
  , kae = 180 / Math.PI
  , Nae = Math.PI / 180;
let Gt = class ED {
    constructor(e=0, n=0) {
        this.x = 0,
        this.y = 0,
        this.x = e,
        this.y = n
    }
    clone() {
        return new ED(this.x,this.y)
    }
    copyFrom(e) {
        return this.set(e.x, e.y),
        this
    }
    copyTo(e) {
        return e.set(this.x, this.y),
        e
    }
    equals(e) {
        return e.x === this.x && e.y === this.y
    }
    set(e=0, n=e) {
        return this.x = e,
        this.y = n,
        this
    }
    toString() {
        return `[pixi.js/math:Point x=${this.x} y=${this.y}]`
    }
    static get shared() {
        return f1.x = 0,
        f1.y = 0,
        f1
    }
}
;
const f1 = new Gt;
class Oe {
    constructor(e=1, n=0, r=0, i=1, o=0, s=0) {
        this.array = null,
        this.a = e,
        this.b = n,
        this.c = r,
        this.d = i,
        this.tx = o,
        this.ty = s
    }
    fromArray(e) {
        this.a = e[0],
        this.b = e[1],
        this.c = e[3],
        this.d = e[4],
        this.tx = e[2],
        this.ty = e[5]
    }
    set(e, n, r, i, o, s) {
        return this.a = e,
        this.b = n,
        this.c = r,
        this.d = i,
        this.tx = o,
        this.ty = s,
        this
    }
    toArray(e, n) {
        this.array || (this.array = new Float32Array(9));
        const r = n || this.array;
        return e ? (r[0] = this.a,
        r[1] = this.b,
        r[2] = 0,
        r[3] = this.c,
        r[4] = this.d,
        r[5] = 0,
        r[6] = this.tx,
        r[7] = this.ty,
        r[8] = 1) : (r[0] = this.a,
        r[1] = this.c,
        r[2] = this.tx,
        r[3] = this.b,
        r[4] = this.d,
        r[5] = this.ty,
        r[6] = 0,
        r[7] = 0,
        r[8] = 1),
        r
    }
    apply(e, n) {
        n = n || new Gt;
        const r = e.x
          , i = e.y;
        return n.x = this.a * r + this.c * i + this.tx,
        n.y = this.b * r + this.d * i + this.ty,
        n
    }
    applyInverse(e, n) {
        n = n || new Gt;
        const r = this.a
          , i = this.b
          , o = this.c
          , s = this.d
          , a = this.tx
          , l = this.ty
          , c = 1 / (r * s + o * -i)
          , u = e.x
          , f = e.y;
        return n.x = s * c * u + -o * c * f + (l * o - a * s) * c,
        n.y = r * c * f + -i * c * u + (-l * r + a * i) * c,
        n
    }
    translate(e, n) {
        return this.tx += e,
        this.ty += n,
        this
    }
    scale(e, n) {
        return this.a *= e,
        this.d *= n,
        this.c *= e,
        this.b *= n,
        this.tx *= e,
        this.ty *= n,
        this
    }
    rotate(e) {
        const n = Math.cos(e)
          , r = Math.sin(e)
          , i = this.a
          , o = this.c
          , s = this.tx;
        return this.a = i * n - this.b * r,
        this.b = i * r + this.b * n,
        this.c = o * n - this.d * r,
        this.d = o * r + this.d * n,
        this.tx = s * n - this.ty * r,
        this.ty = s * r + this.ty * n,
        this
    }
    append(e) {
        const n = this.a
          , r = this.b
          , i = this.c
          , o = this.d;
        return this.a = e.a * n + e.b * i,
        this.b = e.a * r + e.b * o,
        this.c = e.c * n + e.d * i,
        this.d = e.c * r + e.d * o,
        this.tx = e.tx * n + e.ty * i + this.tx,
        this.ty = e.tx * r + e.ty * o + this.ty,
        this
    }
    appendFrom(e, n) {
        const r = e.a
          , i = e.b
          , o = e.c
          , s = e.d
          , a = e.tx
          , l = e.ty
          , c = n.a
          , u = n.b
          , f = n.c
          , d = n.d;
        return this.a = r * c + i * f,
        this.b = r * u + i * d,
        this.c = o * c + s * f,
        this.d = o * u + s * d,
        this.tx = a * c + l * f + n.tx,
        this.ty = a * u + l * d + n.ty,
        this
    }
    setTransform(e, n, r, i, o, s, a, l, c) {
        return this.a = Math.cos(a + c) * o,
        this.b = Math.sin(a + c) * o,
        this.c = -Math.sin(a - l) * s,
        this.d = Math.cos(a - l) * s,
        this.tx = e - (r * this.a + i * this.c),
        this.ty = n - (r * this.b + i * this.d),
        this
    }
    prepend(e) {
        const n = this.tx;
        if (e.a !== 1 || e.b !== 0 || e.c !== 0 || e.d !== 1) {
            const r = this.a
              , i = this.c;
            this.a = r * e.a + this.b * e.c,
            this.b = r * e.b + this.b * e.d,
            this.c = i * e.a + this.d * e.c,
            this.d = i * e.b + this.d * e.d
        }
        return this.tx = n * e.a + this.ty * e.c + e.tx,
        this.ty = n * e.b + this.ty * e.d + e.ty,
        this
    }
    decompose(e) {
        const n = this.a
          , r = this.b
          , i = this.c
          , o = this.d
          , s = e.pivot
          , a = -Math.atan2(-i, o)
          , l = Math.atan2(r, n)
          , c = Math.abs(a + l);
        return c < 1e-5 || Math.abs(Bae - c) < 1e-5 ? (e.rotation = l,
        e.skew.x = e.skew.y = 0) : (e.rotation = 0,
        e.skew.x = a,
        e.skew.y = l),
        e.scale.x = Math.sqrt(n * n + r * r),
        e.scale.y = Math.sqrt(i * i + o * o),
        e.position.x = this.tx + (s.x * n + s.y * i),
        e.position.y = this.ty + (s.x * r + s.y * o),
        e
    }
    invert() {
        const e = this.a
          , n = this.b
          , r = this.c
          , i = this.d
          , o = this.tx
          , s = e * i - n * r;
        return this.a = i / s,
        this.b = -n / s,
        this.c = -r / s,
        this.d = e / s,
        this.tx = (r * this.ty - i * o) / s,
        this.ty = -(e * this.ty - n * o) / s,
        this
    }
    isIdentity() {
        return this.a === 1 && this.b === 0 && this.c === 0 && this.d === 1 && this.tx === 0 && this.ty === 0
    }
    identity() {
        return this.a = 1,
        this.b = 0,
        this.c = 0,
        this.d = 1,
        this.tx = 0,
        this.ty = 0,
        this
    }
    clone() {
        const e = new Oe;
        return e.a = this.a,
        e.b = this.b,
        e.c = this.c,
        e.d = this.d,
        e.tx = this.tx,
        e.ty = this.ty,
        e
    }
    copyTo(e) {
        return e.a = this.a,
        e.b = this.b,
        e.c = this.c,
        e.d = this.d,
        e.tx = this.tx,
        e.ty = this.ty,
        e
    }
    copyFrom(e) {
        return this.a = e.a,
        this.b = e.b,
        this.c = e.c,
        this.d = e.d,
        this.tx = e.tx,
        this.ty = e.ty,
        this
    }
    equals(e) {
        return e.a === this.a && e.b === this.b && e.c === this.c && e.d === this.d && e.tx === this.tx && e.ty === this.ty
    }
    toString() {
        return `[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`
    }
    static get IDENTITY() {
        return Lae.identity()
    }
    static get shared() {
        return Fae.identity()
    }
}
const Fae = new Oe
  , Lae = new Oe
  , Ia = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1]
  , Oa = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1]
  , Ra = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1]
  , Ma = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1]
  , I_ = []
  , SD = []
  , Xh = Math.sign;
function $ae() {
    for (let t = 0; t < 16; t++) {
        const e = [];
        I_.push(e);
        for (let n = 0; n < 16; n++) {
            const r = Xh(Ia[t] * Ia[n] + Ra[t] * Oa[n])
              , i = Xh(Oa[t] * Ia[n] + Ma[t] * Oa[n])
              , o = Xh(Ia[t] * Ra[n] + Ra[t] * Ma[n])
              , s = Xh(Oa[t] * Ra[n] + Ma[t] * Ma[n]);
            for (let a = 0; a < 16; a++)
                if (Ia[a] === r && Oa[a] === i && Ra[a] === o && Ma[a] === s) {
                    e.push(a);
                    break
                }
        }
    }
    for (let t = 0; t < 16; t++) {
        const e = new Oe;
        e.set(Ia[t], Oa[t], Ra[t], Ma[t], 0, 0),
        SD.push(e)
    }
}
$ae();
const Et = {
    E: 0,
    SE: 1,
    S: 2,
    SW: 3,
    W: 4,
    NW: 5,
    N: 6,
    NE: 7,
    MIRROR_VERTICAL: 8,
    MAIN_DIAGONAL: 10,
    MIRROR_HORIZONTAL: 12,
    REVERSE_DIAGONAL: 14,
    uX: t => Ia[t],
    uY: t => Oa[t],
    vX: t => Ra[t],
    vY: t => Ma[t],
    inv: t => t & 8 ? t & 15 : -t & 7,
    add: (t, e) => I_[t][e],
    sub: (t, e) => I_[t][Et.inv(e)],
    rotate180: t => t ^ 4,
    isVertical: t => (t & 3) === 2,
    byDirection: (t, e) => Math.abs(t) * 2 <= Math.abs(e) ? e >= 0 ? Et.S : Et.N : Math.abs(e) * 2 <= Math.abs(t) ? t > 0 ? Et.E : Et.W : e > 0 ? t > 0 ? Et.SE : Et.SW : t > 0 ? Et.NE : Et.NW,
    matrixAppendRotationInv: (t, e, n=0, r=0) => {
        const i = SD[Et.inv(e)];
        i.tx = n,
        i.ty = r,
        t.append(i)
    }
    ,
    transformRectCoords: (t, e, n, r) => {
        const {x: i, y: o, width: s, height: a} = t
          , {x: l, y: c, width: u, height: f} = e;
        return n === Et.E ? (r.set(i + l, o + c, s, a),
        r) : n === Et.S ? r.set(u - o - a + l, i + c, a, s) : n === Et.W ? r.set(u - i - s + l, f - o - a + c, s, a) : n === Et.N ? r.set(o + l, f - i - s + c, a, s) : r.set(i + l, o + c, s, a)
    }
}
  , Kh = [new Gt, new Gt, new Gt, new Gt];
class vt {
    constructor(e=0, n=0, r=0, i=0) {
        this.type = "rectangle",
        this.x = Number(e),
        this.y = Number(n),
        this.width = Number(r),
        this.height = Number(i)
    }
    get left() {
        return this.x
    }
    get right() {
        return this.x + this.width
    }
    get top() {
        return this.y
    }
    get bottom() {
        return this.y + this.height
    }
    isEmpty() {
        return this.left === this.right || this.top === this.bottom
    }
    static get EMPTY() {
        return new vt(0,0,0,0)
    }
    clone() {
        return new vt(this.x,this.y,this.width,this.height)
    }
    copyFromBounds(e) {
        return this.x = e.minX,
        this.y = e.minY,
        this.width = e.maxX - e.minX,
        this.height = e.maxY - e.minY,
        this
    }
    copyFrom(e) {
        return this.x = e.x,
        this.y = e.y,
        this.width = e.width,
        this.height = e.height,
        this
    }
    copyTo(e) {
        return e.copyFrom(this),
        e
    }
    contains(e, n) {
        return this.width <= 0 || this.height <= 0 ? !1 : e >= this.x && e < this.x + this.width && n >= this.y && n < this.y + this.height
    }
    strokeContains(e, n, r, i=.5) {
        const {width: o, height: s} = this;
        if (o <= 0 || s <= 0)
            return !1;
        const a = this.x
          , l = this.y
          , c = r * (1 - i)
          , u = r - c
          , f = a - c
          , d = a + o + c
          , h = l - c
          , p = l + s + c
          , y = a + u
          , v = a + o - u
          , g = l + u
          , m = l + s - u;
        return e >= f && e <= d && n >= h && n <= p && !(e > y && e < v && n > g && n < m)
    }
    intersects(e, n) {
        if (!n) {
            const S = this.x < e.x ? e.x : this.x;
            if ((this.right > e.right ? e.right : this.right) <= S)
                return !1;
            const C = this.y < e.y ? e.y : this.y;
            return (this.bottom > e.bottom ? e.bottom : this.bottom) > C
        }
        const r = this.left
          , i = this.right
          , o = this.top
          , s = this.bottom;
        if (i <= r || s <= o)
            return !1;
        const a = Kh[0].set(e.left, e.top)
          , l = Kh[1].set(e.left, e.bottom)
          , c = Kh[2].set(e.right, e.top)
          , u = Kh[3].set(e.right, e.bottom);
        if (c.x <= a.x || l.y <= a.y)
            return !1;
        const f = Math.sign(n.a * n.d - n.b * n.c);
        if (f === 0 || (n.apply(a, a),
        n.apply(l, l),
        n.apply(c, c),
        n.apply(u, u),
        Math.max(a.x, l.x, c.x, u.x) <= r || Math.min(a.x, l.x, c.x, u.x) >= i || Math.max(a.y, l.y, c.y, u.y) <= o || Math.min(a.y, l.y, c.y, u.y) >= s))
            return !1;
        const d = f * (l.y - a.y)
          , h = f * (a.x - l.x)
          , p = d * r + h * o
          , y = d * i + h * o
          , v = d * r + h * s
          , g = d * i + h * s;
        if (Math.max(p, y, v, g) <= d * a.x + h * a.y || Math.min(p, y, v, g) >= d * u.x + h * u.y)
            return !1;
        const m = f * (a.y - c.y)
          , _ = f * (c.x - a.x)
          , x = m * r + _ * o
          , b = m * i + _ * o
          , w = m * r + _ * s
          , E = m * i + _ * s;
        return !(Math.max(x, b, w, E) <= m * a.x + _ * a.y || Math.min(x, b, w, E) >= m * u.x + _ * u.y)
    }
    pad(e=0, n=e) {
        return this.x -= e,
        this.y -= n,
        this.width += e * 2,
        this.height += n * 2,
        this
    }
    fit(e) {
        const n = Math.max(this.x, e.x)
          , r = Math.min(this.x + this.width, e.x + e.width)
          , i = Math.max(this.y, e.y)
          , o = Math.min(this.y + this.height, e.y + e.height);
        return this.x = n,
        this.width = Math.max(r - n, 0),
        this.y = i,
        this.height = Math.max(o - i, 0),
        this
    }
    ceil(e=1, n=.001) {
        const r = Math.ceil((this.x + this.width - n) * e) / e
          , i = Math.ceil((this.y + this.height - n) * e) / e;
        return this.x = Math.floor((this.x + n) * e) / e,
        this.y = Math.floor((this.y + n) * e) / e,
        this.width = r - this.x,
        this.height = i - this.y,
        this
    }
    scale(e, n=e) {
        return this.x *= e,
        this.y *= n,
        this.width *= e,
        this.height *= n,
        this
    }
    enlarge(e) {
        const n = Math.min(this.x, e.x)
          , r = Math.max(this.x + this.width, e.x + e.width)
          , i = Math.min(this.y, e.y)
          , o = Math.max(this.y + this.height, e.y + e.height);
        return this.x = n,
        this.width = r - n,
        this.y = i,
        this.height = o - i,
        this
    }
    getBounds(e) {
        return e || (e = new vt),
        e.copyFrom(this),
        e
    }
    containsRect(e) {
        if (this.width <= 0 || this.height <= 0)
            return !1;
        const n = e.x
          , r = e.y
          , i = e.x + e.width
          , o = e.y + e.height;
        return n >= this.x && n < this.x + this.width && r >= this.y && r < this.y + this.height && i >= this.x && i < this.x + this.width && o >= this.y && o < this.y + this.height
    }
    set(e, n, r, i) {
        return this.x = e,
        this.y = n,
        this.width = r,
        this.height = i,
        this
    }
    toString() {
        return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`
    }
}
const d1 = {
    default: -1
};
function Ut(t="default") {
    return d1[t] === void 0 && (d1[t] = -1),
    ++d1[t]
}
const YA = {}
  , rt = "8.0.0"
  , Uae = "8.3.4";
function Fe(t, e, n=3) {
    if (YA[e])
        return;
    let r = new Error().stack;
    typeof r > "u" ? console.warn("PixiJS Deprecation Warning: ", `${e}
Deprecated since v${t}`) : (r = r.split(`
`).splice(n).join(`
`),
    console.groupCollapsed ? (console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s", "color:#614108;background:#fffbe6", "font-weight:normal;color:#614108;background:#fffbe6", `${e}
Deprecated since v${t}`),
    console.warn(r),
    console.groupEnd()) : (console.warn("PixiJS Deprecation Warning: ", `${e}
Deprecated since v${t}`),
    console.warn(r))),
    YA[e] = !0
}
const CD = () => {}
;
function Yc(t) {
    return t += t === 0 ? 1 : 0,
    --t,
    t |= t >>> 1,
    t |= t >>> 2,
    t |= t >>> 4,
    t |= t >>> 8,
    t |= t >>> 16,
    t + 1
}
function XA(t) {
    return !(t & t - 1) && !!t
}
function AD(t) {
    const e = {};
    for (const n in t)
        t[n] !== void 0 && (e[n] = t[n]);
    return e
}
const KA = Object.create(null);
function Gae(t) {
    const e = KA[t];
    return e === void 0 && (KA[t] = Ut("resource")),
    e
}
const TD = class PD extends Jr {
    constructor(e={}) {
        super(),
        this._resourceType = "textureSampler",
        this._touched = 0,
        this._maxAnisotropy = 1,
        this.destroyed = !1,
        e = {
            ...PD.defaultOptions,
            ...e
        },
        this.addressMode = e.addressMode,
        this.addressModeU = e.addressModeU ?? this.addressModeU,
        this.addressModeV = e.addressModeV ?? this.addressModeV,
        this.addressModeW = e.addressModeW ?? this.addressModeW,
        this.scaleMode = e.scaleMode,
        this.magFilter = e.magFilter ?? this.magFilter,
        this.minFilter = e.minFilter ?? this.minFilter,
        this.mipmapFilter = e.mipmapFilter ?? this.mipmapFilter,
        this.lodMinClamp = e.lodMinClamp,
        this.lodMaxClamp = e.lodMaxClamp,
        this.compare = e.compare,
        this.maxAnisotropy = e.maxAnisotropy ?? 1
    }
    set addressMode(e) {
        this.addressModeU = e,
        this.addressModeV = e,
        this.addressModeW = e
    }
    get addressMode() {
        return this.addressModeU
    }
    set wrapMode(e) {
        Fe(rt, "TextureStyle.wrapMode is now TextureStyle.addressMode"),
        this.addressMode = e
    }
    get wrapMode() {
        return this.addressMode
    }
    set scaleMode(e) {
        this.magFilter = e,
        this.minFilter = e,
        this.mipmapFilter = e
    }
    get scaleMode() {
        return this.magFilter
    }
    set maxAnisotropy(e) {
        this._maxAnisotropy = Math.min(e, 16),
        this._maxAnisotropy > 1 && (this.scaleMode = "linear")
    }
    get maxAnisotropy() {
        return this._maxAnisotropy
    }
    get _resourceId() {
        return this._sharedResourceId || this._generateResourceId()
    }
    update() {
        this.emit("change", this),
        this._sharedResourceId = null
    }
    _generateResourceId() {
        const e = `${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;
        return this._sharedResourceId = Gae(e),
        this._resourceId
    }
    destroy() {
        this.destroyed = !0,
        this.emit("destroy", this),
        this.emit("change", this),
        this.removeAllListeners()
    }
}
;
TD.defaultOptions = {
    addressMode: "clamp-to-edge",
    scaleMode: "linear"
};
let yo = TD;
const ID = class OD extends Jr {
    constructor(e={}) {
        super(),
        this.options = e,
        this.uid = Ut("textureSource"),
        this._resourceType = "textureSource",
        this._resourceId = Ut("resource"),
        this.uploadMethodId = "unknown",
        this._resolution = 1,
        this.pixelWidth = 1,
        this.pixelHeight = 1,
        this.width = 1,
        this.height = 1,
        this.sampleCount = 1,
        this.mipLevelCount = 1,
        this.autoGenerateMipmaps = !1,
        this.format = "rgba8unorm",
        this.dimension = "2d",
        this.antialias = !1,
        this._touched = 0,
        this._batchTick = -1,
        this._textureBindLocation = -1,
        e = {
            ...OD.defaultOptions,
            ...e
        },
        this.label = e.label ?? "",
        this.resource = e.resource,
        this.autoGarbageCollect = e.autoGarbageCollect,
        this._resolution = e.resolution,
        e.width ? this.pixelWidth = e.width * this._resolution : this.pixelWidth = this.resource ? this.resourceWidth ?? 1 : 1,
        e.height ? this.pixelHeight = e.height * this._resolution : this.pixelHeight = this.resource ? this.resourceHeight ?? 1 : 1,
        this.width = this.pixelWidth / this._resolution,
        this.height = this.pixelHeight / this._resolution,
        this.format = e.format,
        this.dimension = e.dimensions,
        this.mipLevelCount = e.mipLevelCount,
        this.autoGenerateMipmaps = e.autoGenerateMipmaps,
        this.sampleCount = e.sampleCount,
        this.antialias = e.antialias,
        this.alphaMode = e.alphaMode,
        this.style = new yo(AD(e)),
        this.destroyed = !1,
        this._refreshPOT()
    }
    get source() {
        return this
    }
    get style() {
        return this._style
    }
    set style(e) {
        var n, r;
        this.style !== e && ((n = this._style) == null || n.off("change", this._onStyleChange, this),
        this._style = e,
        (r = this._style) == null || r.on("change", this._onStyleChange, this),
        this._onStyleChange())
    }
    set maxAnisotropy(e) {
        this._style.maxAnisotropy = e
    }
    get maxAnisotropy() {
        return this._style.maxAnisotropy
    }
    get addressMode() {
        return this._style.addressMode
    }
    set addressMode(e) {
        this._style.addressMode = e
    }
    get repeatMode() {
        return this._style.addressMode
    }
    set repeatMode(e) {
        this._style.addressMode = e
    }
    get magFilter() {
        return this._style.magFilter
    }
    set magFilter(e) {
        this._style.magFilter = e
    }
    get minFilter() {
        return this._style.minFilter
    }
    set minFilter(e) {
        this._style.minFilter = e
    }
    get mipmapFilter() {
        return this._style.mipmapFilter
    }
    set mipmapFilter(e) {
        this._style.mipmapFilter = e
    }
    get lodMinClamp() {
        return this._style.lodMinClamp
    }
    set lodMinClamp(e) {
        this._style.lodMinClamp = e
    }
    get lodMaxClamp() {
        return this._style.lodMaxClamp
    }
    set lodMaxClamp(e) {
        this._style.lodMaxClamp = e
    }
    _onStyleChange() {
        this.emit("styleChange", this)
    }
    update() {
        if (this.resource) {
            const e = this._resolution;
            if (this.resize(this.resourceWidth / e, this.resourceHeight / e))
                return
        }
        this.emit("update", this)
    }
    destroy() {
        this.destroyed = !0,
        this.emit("destroy", this),
        this.emit("change", this),
        this._style && (this._style.destroy(),
        this._style = null),
        this.uploadMethodId = null,
        this.resource = null,
        this.removeAllListeners()
    }
    unload() {
        this._resourceId = Ut("resource"),
        this.emit("change", this),
        this.emit("unload", this)
    }
    get resourceWidth() {
        const {resource: e} = this;
        return e.naturalWidth || e.videoWidth || e.displayWidth || e.width
    }
    get resourceHeight() {
        const {resource: e} = this;
        return e.naturalHeight || e.videoHeight || e.displayHeight || e.height
    }
    get resolution() {
        return this._resolution
    }
    set resolution(e) {
        this._resolution !== e && (this._resolution = e,
        this.width = this.pixelWidth / e,
        this.height = this.pixelHeight / e)
    }
    resize(e, n, r) {
        r || (r = this._resolution),
        e || (e = this.width),
        n || (n = this.height);
        const i = Math.round(e * r)
          , o = Math.round(n * r);
        return this.width = i / r,
        this.height = o / r,
        this._resolution = r,
        this.pixelWidth === i && this.pixelHeight === o ? !1 : (this._refreshPOT(),
        this.pixelWidth = i,
        this.pixelHeight = o,
        this.emit("resize", this),
        this._resourceId = Ut("resource"),
        this.emit("change", this),
        !0)
    }
    updateMipmaps() {
        this.autoGenerateMipmaps && this.mipLevelCount > 1 && this.emit("updateMipmaps", this)
    }
    set wrapMode(e) {
        this._style.wrapMode = e
    }
    get wrapMode() {
        return this._style.wrapMode
    }
    set scaleMode(e) {
        this._style.scaleMode = e
    }
    get scaleMode() {
        return this._style.scaleMode
    }
    _refreshPOT() {
        this.isPowerOfTwo = XA(this.pixelWidth) && XA(this.pixelHeight)
    }
    static test(e) {
        throw new Error("Unimplemented")
    }
}
;
ID.defaultOptions = {
    resolution: 1,
    format: "bgra8unorm",
    alphaMode: "premultiply-alpha-on-upload",
    dimensions: "2d",
    mipLevelCount: 1,
    autoGenerateMipmaps: !1,
    sampleCount: 1,
    antialias: !1,
    autoGarbageCollect: !1
};
let Cn = ID;
class Ww extends Cn {
    constructor(e) {
        const n = e.resource || new Float32Array(e.width * e.height * 4);
        let r = e.format;
        r || (n instanceof Float32Array ? r = "rgba32float" : n instanceof Int32Array || n instanceof Uint32Array ? r = "rgba32uint" : n instanceof Int16Array || n instanceof Uint16Array ? r = "rgba16uint" : (n instanceof Int8Array,
        r = "bgra8unorm")),
        super({
            ...e,
            resource: n,
            format: r
        }),
        this.uploadMethodId = "buffer"
    }
    static test(e) {
        return e instanceof Int8Array || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Float32Array
    }
}
Ww.extension = V.TextureSource;
const qA = new Oe;
class RD {
    constructor(e, n) {
        this.mapCoord = new Oe,
        this.uClampFrame = new Float32Array(4),
        this.uClampOffset = new Float32Array(2),
        this._textureID = -1,
        this._updateID = 0,
        this.clampOffset = 0,
        typeof n > "u" ? this.clampMargin = e.width < 10 ? 0 : .5 : this.clampMargin = n,
        this.isSimple = !1,
        this.texture = e
    }
    get texture() {
        return this._texture
    }
    set texture(e) {
        var n;
        this.texture !== e && ((n = this._texture) == null || n.removeListener("update", this.update, this),
        this._texture = e,
        this._texture.addListener("update", this.update, this),
        this.update())
    }
    multiplyUvs(e, n) {
        n === void 0 && (n = e);
        const r = this.mapCoord;
        for (let i = 0; i < e.length; i += 2) {
            const o = e[i]
              , s = e[i + 1];
            n[i] = o * r.a + s * r.c + r.tx,
            n[i + 1] = o * r.b + s * r.d + r.ty
        }
        return n
    }
    update() {
        const e = this._texture;
        this._updateID++;
        const n = e.uvs;
        this.mapCoord.set(n.x1 - n.x0, n.y1 - n.y0, n.x3 - n.x0, n.y3 - n.y0, n.x0, n.y0);
        const r = e.orig
          , i = e.trim;
        i && (qA.set(r.width / i.width, 0, 0, r.height / i.height, -i.x / i.width, -i.y / i.height),
        this.mapCoord.append(qA));
        const o = e.source
          , s = this.uClampFrame
          , a = this.clampMargin / o._resolution
          , l = this.clampOffset / o._resolution;
        return s[0] = (e.frame.x + a + l) / o.width,
        s[1] = (e.frame.y + a + l) / o.height,
        s[2] = (e.frame.x + e.frame.width - a + l) / o.width,
        s[3] = (e.frame.y + e.frame.height - a + l) / o.height,
        this.uClampOffset[0] = this.clampOffset / o.pixelWidth,
        this.uClampOffset[1] = this.clampOffset / o.pixelHeight,
        this.isSimple = e.frame.width === o.width && e.frame.height === o.height && e.rotate === 0,
        !0
    }
}
class Ae extends Jr {
    constructor({source: e, label: n, frame: r, orig: i, trim: o, defaultAnchor: s, defaultBorders: a, rotate: l, dynamic: c}={}) {
        if (super(),
        this.uid = Ut("texture"),
        this.uvs = {
            x0: 0,
            y0: 0,
            x1: 0,
            y1: 0,
            x2: 0,
            y2: 0,
            x3: 0,
            y3: 0
        },
        this.frame = new vt,
        this.noFrame = !1,
        this.dynamic = !1,
        this.isTexture = !0,
        this.label = n,
        this.source = (e == null ? void 0 : e.source) ?? new Cn,
        this.noFrame = !r,
        r)
            this.frame.copyFrom(r);
        else {
            const {width: u, height: f} = this._source;
            this.frame.width = u,
            this.frame.height = f
        }
        this.orig = i || this.frame,
        this.trim = o,
        this.rotate = l ?? 0,
        this.defaultAnchor = s,
        this.defaultBorders = a,
        this.destroyed = !1,
        this.dynamic = c || !1,
        this.updateUvs()
    }
    set source(e) {
        this._source && this._source.off("resize", this.update, this),
        this._source = e,
        e.on("resize", this.update, this),
        this.emit("update", this)
    }
    get source() {
        return this._source
    }
    get textureMatrix() {
        return this._textureMatrix || (this._textureMatrix = new RD(this)),
        this._textureMatrix
    }
    get width() {
        return this.orig.width
    }
    get height() {
        return this.orig.height
    }
    updateUvs() {
        const {uvs: e, frame: n} = this
          , {width: r, height: i} = this._source
          , o = n.x / r
          , s = n.y / i
          , a = n.width / r
          , l = n.height / i;
        let c = this.rotate;
        if (c) {
            const u = a / 2
              , f = l / 2
              , d = o + u
              , h = s + f;
            c = Et.add(c, Et.NW),
            e.x0 = d + u * Et.uX(c),
            e.y0 = h + f * Et.uY(c),
            c = Et.add(c, 2),
            e.x1 = d + u * Et.uX(c),
            e.y1 = h + f * Et.uY(c),
            c = Et.add(c, 2),
            e.x2 = d + u * Et.uX(c),
            e.y2 = h + f * Et.uY(c),
            c = Et.add(c, 2),
            e.x3 = d + u * Et.uX(c),
            e.y3 = h + f * Et.uY(c)
        } else
            e.x0 = o,
            e.y0 = s,
            e.x1 = o + a,
            e.y1 = s,
            e.x2 = o + a,
            e.y2 = s + l,
            e.x3 = o,
            e.y3 = s + l
    }
    destroy(e=!1) {
        this._source && e && (this._source.destroy(),
        this._source = null),
        this._textureMatrix = null,
        this.destroyed = !0,
        this.emit("destroy", this),
        this.removeAllListeners()
    }
    update() {
        this.noFrame && (this.frame.width = this._source.width,
        this.frame.height = this._source.height),
        this.updateUvs(),
        this.emit("update", this)
    }
    get baseTexture() {
        return Fe(rt, "Texture.baseTexture is now Texture.source"),
        this._source
    }
}
Ae.EMPTY = new Ae({
    label: "EMPTY",
    source: new Cn({
        label: "EMPTY"
    })
});
Ae.EMPTY.destroy = CD;
Ae.WHITE = new Ae({
    source: new Ww({
        resource: new Uint8Array([255, 255, 255, 255]),
        width: 1,
        height: 1,
        alphaMode: "premultiply-alpha-on-upload",
        label: "WHITE"
    }),
    label: "WHITE"
});
Ae.WHITE.destroy = CD;
function MD(t, e, n) {
    const {width: r, height: i} = n.orig
      , o = n.trim;
    if (o) {
        const s = o.width
          , a = o.height;
        t.minX = o.x - e._x * r,
        t.maxX = t.minX + s,
        t.minY = o.y - e._y * i,
        t.maxY = t.minY + a
    } else
        t.minX = -e._x * r,
        t.maxX = t.minX + r,
        t.minY = -e._y * i,
        t.maxY = t.minY + i
}
const ZA = new Oe;
class Vn {
    constructor(e=1 / 0, n=1 / 0, r=-1 / 0, i=-1 / 0) {
        this.minX = 1 / 0,
        this.minY = 1 / 0,
        this.maxX = -1 / 0,
        this.maxY = -1 / 0,
        this.matrix = ZA,
        this.minX = e,
        this.minY = n,
        this.maxX = r,
        this.maxY = i
    }
    isEmpty() {
        return this.minX > this.maxX || this.minY > this.maxY
    }
    get rectangle() {
        this._rectangle || (this._rectangle = new vt);
        const e = this._rectangle;
        return this.minX > this.maxX || this.minY > this.maxY ? (e.x = 0,
        e.y = 0,
        e.width = 0,
        e.height = 0) : e.copyFromBounds(this),
        e
    }
    clear() {
        return this.minX = 1 / 0,
        this.minY = 1 / 0,
        this.maxX = -1 / 0,
        this.maxY = -1 / 0,
        this.matrix = ZA,
        this
    }
    set(e, n, r, i) {
        this.minX = e,
        this.minY = n,
        this.maxX = r,
        this.maxY = i
    }
    addFrame(e, n, r, i, o) {
        o || (o = this.matrix);
        const s = o.a
          , a = o.b
          , l = o.c
          , c = o.d
          , u = o.tx
          , f = o.ty;
        let d = this.minX
          , h = this.minY
          , p = this.maxX
          , y = this.maxY
          , v = s * e + l * n + u
          , g = a * e + c * n + f;
        v < d && (d = v),
        g < h && (h = g),
        v > p && (p = v),
        g > y && (y = g),
        v = s * r + l * n + u,
        g = a * r + c * n + f,
        v < d && (d = v),
        g < h && (h = g),
        v > p && (p = v),
        g > y && (y = g),
        v = s * e + l * i + u,
        g = a * e + c * i + f,
        v < d && (d = v),
        g < h && (h = g),
        v > p && (p = v),
        g > y && (y = g),
        v = s * r + l * i + u,
        g = a * r + c * i + f,
        v < d && (d = v),
        g < h && (h = g),
        v > p && (p = v),
        g > y && (y = g),
        this.minX = d,
        this.minY = h,
        this.maxX = p,
        this.maxY = y
    }
    addRect(e, n) {
        this.addFrame(e.x, e.y, e.x + e.width, e.y + e.height, n)
    }
    addBounds(e, n) {
        this.addFrame(e.minX, e.minY, e.maxX, e.maxY, n)
    }
    addBoundsMask(e) {
        this.minX = this.minX > e.minX ? this.minX : e.minX,
        this.minY = this.minY > e.minY ? this.minY : e.minY,
        this.maxX = this.maxX < e.maxX ? this.maxX : e.maxX,
        this.maxY = this.maxY < e.maxY ? this.maxY : e.maxY
    }
    applyMatrix(e) {
        const n = this.minX
          , r = this.minY
          , i = this.maxX
          , o = this.maxY
          , {a: s, b: a, c: l, d: c, tx: u, ty: f} = e;
        let d = s * n + l * r + u
          , h = a * n + c * r + f;
        this.minX = d,
        this.minY = h,
        this.maxX = d,
        this.maxY = h,
        d = s * i + l * r + u,
        h = a * i + c * r + f,
        this.minX = d < this.minX ? d : this.minX,
        this.minY = h < this.minY ? h : this.minY,
        this.maxX = d > this.maxX ? d : this.maxX,
        this.maxY = h > this.maxY ? h : this.maxY,
        d = s * n + l * o + u,
        h = a * n + c * o + f,
        this.minX = d < this.minX ? d : this.minX,
        this.minY = h < this.minY ? h : this.minY,
        this.maxX = d > this.maxX ? d : this.maxX,
        this.maxY = h > this.maxY ? h : this.maxY,
        d = s * i + l * o + u,
        h = a * i + c * o + f,
        this.minX = d < this.minX ? d : this.minX,
        this.minY = h < this.minY ? h : this.minY,
        this.maxX = d > this.maxX ? d : this.maxX,
        this.maxY = h > this.maxY ? h : this.maxY
    }
    fit(e) {
        return this.minX < e.left && (this.minX = e.left),
        this.maxX > e.right && (this.maxX = e.right),
        this.minY < e.top && (this.minY = e.top),
        this.maxY > e.bottom && (this.maxY = e.bottom),
        this
    }
    fitBounds(e, n, r, i) {
        return this.minX < e && (this.minX = e),
        this.maxX > n && (this.maxX = n),
        this.minY < r && (this.minY = r),
        this.maxY > i && (this.maxY = i),
        this
    }
    pad(e, n=e) {
        return this.minX -= e,
        this.maxX += e,
        this.minY -= n,
        this.maxY += n,
        this
    }
    ceil() {
        return this.minX = Math.floor(this.minX),
        this.minY = Math.floor(this.minY),
        this.maxX = Math.ceil(this.maxX),
        this.maxY = Math.ceil(this.maxY),
        this
    }
    clone() {
        return new Vn(this.minX,this.minY,this.maxX,this.maxY)
    }
    scale(e, n=e) {
        return this.minX *= e,
        this.minY *= n,
        this.maxX *= e,
        this.maxY *= n,
        this
    }
    get x() {
        return this.minX
    }
    set x(e) {
        const n = this.maxX - this.minX;
        this.minX = e,
        this.maxX = e + n
    }
    get y() {
        return this.minY
    }
    set y(e) {
        const n = this.maxY - this.minY;
        this.minY = e,
        this.maxY = e + n
    }
    get width() {
        return this.maxX - this.minX
    }
    set width(e) {
        this.maxX = this.minX + e
    }
    get height() {
        return this.maxY - this.minY
    }
    set height(e) {
        this.maxY = this.minY + e
    }
    get left() {
        return this.minX
    }
    get right() {
        return this.maxX
    }
    get top() {
        return this.minY
    }
    get bottom() {
        return this.maxY
    }
    get isPositive() {
        return this.maxX - this.minX > 0 && this.maxY - this.minY > 0
    }
    get isValid() {
        return this.minX + this.minY !== 1 / 0
    }
    addVertexData(e, n, r, i) {
        let o = this.minX
          , s = this.minY
          , a = this.maxX
          , l = this.maxY;
        i || (i = this.matrix);
        const c = i.a
          , u = i.b
          , f = i.c
          , d = i.d
          , h = i.tx
          , p = i.ty;
        for (let y = n; y < r; y += 2) {
            const v = e[y]
              , g = e[y + 1]
              , m = c * v + f * g + h
              , _ = u * v + d * g + p;
            o = m < o ? m : o,
            s = _ < s ? _ : s,
            a = m > a ? m : a,
            l = _ > l ? _ : l
        }
        this.minX = o,
        this.minY = s,
        this.maxX = a,
        this.maxY = l
    }
    containsPoint(e, n) {
        return this.minX <= e && this.minY <= n && this.maxX >= e && this.maxY >= n
    }
    toString() {
        return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`
    }
    copyFrom(e) {
        return this.minX = e.minX,
        this.minY = e.minY,
        this.maxX = e.maxX,
        this.maxY = e.maxY,
        this
    }
}
var Hae = {
    grad: .9,
    turn: 360,
    rad: 360 / (2 * Math.PI)
}
  , Oo = function(t) {
    return typeof t == "string" ? t.length > 0 : typeof t == "number"
}
  , On = function(t, e, n) {
    return e === void 0 && (e = 0),
    n === void 0 && (n = Math.pow(10, e)),
    Math.round(n * t) / n + 0
}
  , ui = function(t, e, n) {
    return e === void 0 && (e = 0),
    n === void 0 && (n = 1),
    t > n ? n : t > e ? t : e
}
  , DD = function(t) {
    return (t = isFinite(t) ? t % 360 : 0) > 0 ? t : t + 360
}
  , JA = function(t) {
    return {
        r: ui(t.r, 0, 255),
        g: ui(t.g, 0, 255),
        b: ui(t.b, 0, 255),
        a: ui(t.a)
    }
}
  , h1 = function(t) {
    return {
        r: On(t.r),
        g: On(t.g),
        b: On(t.b),
        a: On(t.a, 3)
    }
}
  , Vae = /^#([0-9a-f]{3,8})$/i
  , qh = function(t) {
    var e = t.toString(16);
    return e.length < 2 ? "0" + e : e
}
  , BD = function(t) {
    var e = t.r
      , n = t.g
      , r = t.b
      , i = t.a
      , o = Math.max(e, n, r)
      , s = o - Math.min(e, n, r)
      , a = s ? o === e ? (n - r) / s : o === n ? 2 + (r - e) / s : 4 + (e - n) / s : 0;
    return {
        h: 60 * (a < 0 ? a + 6 : a),
        s: o ? s / o * 100 : 0,
        v: o / 255 * 100,
        a: i
    }
}
  , kD = function(t) {
    var e = t.h
      , n = t.s
      , r = t.v
      , i = t.a;
    e = e / 360 * 6,
    n /= 100,
    r /= 100;
    var o = Math.floor(e)
      , s = r * (1 - n)
      , a = r * (1 - (e - o) * n)
      , l = r * (1 - (1 - e + o) * n)
      , c = o % 6;
    return {
        r: 255 * [r, a, s, s, l, r][c],
        g: 255 * [l, r, r, a, s, s][c],
        b: 255 * [s, s, l, r, r, a][c],
        a: i
    }
}
  , QA = function(t) {
    return {
        h: DD(t.h),
        s: ui(t.s, 0, 100),
        l: ui(t.l, 0, 100),
        a: ui(t.a)
    }
}
  , eT = function(t) {
    return {
        h: On(t.h),
        s: On(t.s),
        l: On(t.l),
        a: On(t.a, 3)
    }
}
  , tT = function(t) {
    return kD((n = (e = t).s,
    {
        h: e.h,
        s: (n *= ((r = e.l) < 50 ? r : 100 - r) / 100) > 0 ? 2 * n / (r + n) * 100 : 0,
        v: r + n,
        a: e.a
    }));
    var e, n, r
}
  , Cf = function(t) {
    return {
        h: (e = BD(t)).h,
        s: (i = (200 - (n = e.s)) * (r = e.v) / 100) > 0 && i < 200 ? n * r / 100 / (i <= 100 ? i : 200 - i) * 100 : 0,
        l: i / 2,
        a: e.a
    };
    var e, n, r, i
}
  , zae = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i
  , jae = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i
  , Wae = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i
  , Yae = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i
  , O_ = {
    string: [[function(t) {
        var e = Vae.exec(t);
        return e ? (t = e[1]).length <= 4 ? {
            r: parseInt(t[0] + t[0], 16),
            g: parseInt(t[1] + t[1], 16),
            b: parseInt(t[2] + t[2], 16),
            a: t.length === 4 ? On(parseInt(t[3] + t[3], 16) / 255, 2) : 1
        } : t.length === 6 || t.length === 8 ? {
            r: parseInt(t.substr(0, 2), 16),
            g: parseInt(t.substr(2, 2), 16),
            b: parseInt(t.substr(4, 2), 16),
            a: t.length === 8 ? On(parseInt(t.substr(6, 2), 16) / 255, 2) : 1
        } : null : null
    }
    , "hex"], [function(t) {
        var e = Wae.exec(t) || Yae.exec(t);
        return e ? e[2] !== e[4] || e[4] !== e[6] ? null : JA({
            r: Number(e[1]) / (e[2] ? 100 / 255 : 1),
            g: Number(e[3]) / (e[4] ? 100 / 255 : 1),
            b: Number(e[5]) / (e[6] ? 100 / 255 : 1),
            a: e[7] === void 0 ? 1 : Number(e[7]) / (e[8] ? 100 : 1)
        }) : null
    }
    , "rgb"], [function(t) {
        var e = zae.exec(t) || jae.exec(t);
        if (!e)
            return null;
        var n, r, i = QA({
            h: (n = e[1],
            r = e[2],
            r === void 0 && (r = "deg"),
            Number(n) * (Hae[r] || 1)),
            s: Number(e[3]),
            l: Number(e[4]),
            a: e[5] === void 0 ? 1 : Number(e[5]) / (e[6] ? 100 : 1)
        });
        return tT(i)
    }
    , "hsl"]],
    object: [[function(t) {
        var e = t.r
          , n = t.g
          , r = t.b
          , i = t.a
          , o = i === void 0 ? 1 : i;
        return Oo(e) && Oo(n) && Oo(r) ? JA({
            r: Number(e),
            g: Number(n),
            b: Number(r),
            a: Number(o)
        }) : null
    }
    , "rgb"], [function(t) {
        var e = t.h
          , n = t.s
          , r = t.l
          , i = t.a
          , o = i === void 0 ? 1 : i;
        if (!Oo(e) || !Oo(n) || !Oo(r))
            return null;
        var s = QA({
            h: Number(e),
            s: Number(n),
            l: Number(r),
            a: Number(o)
        });
        return tT(s)
    }
    , "hsl"], [function(t) {
        var e = t.h
          , n = t.s
          , r = t.v
          , i = t.a
          , o = i === void 0 ? 1 : i;
        if (!Oo(e) || !Oo(n) || !Oo(r))
            return null;
        var s = function(a) {
            return {
                h: DD(a.h),
                s: ui(a.s, 0, 100),
                v: ui(a.v, 0, 100),
                a: ui(a.a)
            }
        }({
            h: Number(e),
            s: Number(n),
            v: Number(r),
            a: Number(o)
        });
        return kD(s)
    }
    , "hsv"]]
}
  , nT = function(t, e) {
    for (var n = 0; n < e.length; n++) {
        var r = e[n][0](t);
        if (r)
            return [r, e[n][1]]
    }
    return [null, void 0]
}
  , Xae = function(t) {
    return typeof t == "string" ? nT(t.trim(), O_.string) : typeof t == "object" && t !== null ? nT(t, O_.object) : [null, void 0]
}
  , p1 = function(t, e) {
    var n = Cf(t);
    return {
        h: n.h,
        s: ui(n.s + 100 * e, 0, 100),
        l: n.l,
        a: n.a
    }
}
  , g1 = function(t) {
    return (299 * t.r + 587 * t.g + 114 * t.b) / 1e3 / 255
}
  , rT = function(t, e) {
    var n = Cf(t);
    return {
        h: n.h,
        s: n.s,
        l: ui(n.l + 100 * e, 0, 100),
        a: n.a
    }
}
  , R_ = function() {
    function t(e) {
        this.parsed = Xae(e)[0],
        this.rgba = this.parsed || {
            r: 0,
            g: 0,
            b: 0,
            a: 1
        }
    }
    return t.prototype.isValid = function() {
        return this.parsed !== null
    }
    ,
    t.prototype.brightness = function() {
        return On(g1(this.rgba), 2)
    }
    ,
    t.prototype.isDark = function() {
        return g1(this.rgba) < .5
    }
    ,
    t.prototype.isLight = function() {
        return g1(this.rgba) >= .5
    }
    ,
    t.prototype.toHex = function() {
        return e = h1(this.rgba),
        n = e.r,
        r = e.g,
        i = e.b,
        s = (o = e.a) < 1 ? qh(On(255 * o)) : "",
        "#" + qh(n) + qh(r) + qh(i) + s;
        var e, n, r, i, o, s
    }
    ,
    t.prototype.toRgb = function() {
        return h1(this.rgba)
    }
    ,
    t.prototype.toRgbString = function() {
        return e = h1(this.rgba),
        n = e.r,
        r = e.g,
        i = e.b,
        (o = e.a) < 1 ? "rgba(" + n + ", " + r + ", " + i + ", " + o + ")" : "rgb(" + n + ", " + r + ", " + i + ")";
        var e, n, r, i, o
    }
    ,
    t.prototype.toHsl = function() {
        return eT(Cf(this.rgba))
    }
    ,
    t.prototype.toHslString = function() {
        return e = eT(Cf(this.rgba)),
        n = e.h,
        r = e.s,
        i = e.l,
        (o = e.a) < 1 ? "hsla(" + n + ", " + r + "%, " + i + "%, " + o + ")" : "hsl(" + n + ", " + r + "%, " + i + "%)";
        var e, n, r, i, o
    }
    ,
    t.prototype.toHsv = function() {
        return e = BD(this.rgba),
        {
            h: On(e.h),
            s: On(e.s),
            v: On(e.v),
            a: On(e.a, 3)
        };
        var e
    }
    ,
    t.prototype.invert = function() {
        return Xi({
            r: 255 - (e = this.rgba).r,
            g: 255 - e.g,
            b: 255 - e.b,
            a: e.a
        });
        var e
    }
    ,
    t.prototype.saturate = function(e) {
        return e === void 0 && (e = .1),
        Xi(p1(this.rgba, e))
    }
    ,
    t.prototype.desaturate = function(e) {
        return e === void 0 && (e = .1),
        Xi(p1(this.rgba, -e))
    }
    ,
    t.prototype.grayscale = function() {
        return Xi(p1(this.rgba, -1))
    }
    ,
    t.prototype.lighten = function(e) {
        return e === void 0 && (e = .1),
        Xi(rT(this.rgba, e))
    }
    ,
    t.prototype.darken = function(e) {
        return e === void 0 && (e = .1),
        Xi(rT(this.rgba, -e))
    }
    ,
    t.prototype.rotate = function(e) {
        return e === void 0 && (e = 15),
        this.hue(this.hue() + e)
    }
    ,
    t.prototype.alpha = function(e) {
        return typeof e == "number" ? Xi({
            r: (n = this.rgba).r,
            g: n.g,
            b: n.b,
            a: e
        }) : On(this.rgba.a, 3);
        var n
    }
    ,
    t.prototype.hue = function(e) {
        var n = Cf(this.rgba);
        return typeof e == "number" ? Xi({
            h: e,
            s: n.s,
            l: n.l,
            a: n.a
        }) : On(n.h)
    }
    ,
    t.prototype.isEqual = function(e) {
        return this.toHex() === Xi(e).toHex()
    }
    ,
    t
}()
  , Xi = function(t) {
    return t instanceof R_ ? t : new R_(t)
}
  , iT = []
  , Kae = function(t) {
    t.forEach(function(e) {
        iT.indexOf(e) < 0 && (e(R_, O_),
        iT.push(e))
    })
};
function qae(t, e) {
    var n = {
        white: "#ffffff",
        bisque: "#ffe4c4",
        blue: "#0000ff",
        cadetblue: "#5f9ea0",
        chartreuse: "#7fff00",
        chocolate: "#d2691e",
        coral: "#ff7f50",
        antiquewhite: "#faebd7",
        aqua: "#00ffff",
        azure: "#f0ffff",
        whitesmoke: "#f5f5f5",
        papayawhip: "#ffefd5",
        plum: "#dda0dd",
        blanchedalmond: "#ffebcd",
        black: "#000000",
        gold: "#ffd700",
        goldenrod: "#daa520",
        gainsboro: "#dcdcdc",
        cornsilk: "#fff8dc",
        cornflowerblue: "#6495ed",
        burlywood: "#deb887",
        aquamarine: "#7fffd4",
        beige: "#f5f5dc",
        crimson: "#dc143c",
        cyan: "#00ffff",
        darkblue: "#00008b",
        darkcyan: "#008b8b",
        darkgoldenrod: "#b8860b",
        darkkhaki: "#bdb76b",
        darkgray: "#a9a9a9",
        darkgreen: "#006400",
        darkgrey: "#a9a9a9",
        peachpuff: "#ffdab9",
        darkmagenta: "#8b008b",
        darkred: "#8b0000",
        darkorchid: "#9932cc",
        darkorange: "#ff8c00",
        darkslateblue: "#483d8b",
        gray: "#808080",
        darkslategray: "#2f4f4f",
        darkslategrey: "#2f4f4f",
        deeppink: "#ff1493",
        deepskyblue: "#00bfff",
        wheat: "#f5deb3",
        firebrick: "#b22222",
        floralwhite: "#fffaf0",
        ghostwhite: "#f8f8ff",
        darkviolet: "#9400d3",
        magenta: "#ff00ff",
        green: "#008000",
        dodgerblue: "#1e90ff",
        grey: "#808080",
        honeydew: "#f0fff0",
        hotpink: "#ff69b4",
        blueviolet: "#8a2be2",
        forestgreen: "#228b22",
        lawngreen: "#7cfc00",
        indianred: "#cd5c5c",
        indigo: "#4b0082",
        fuchsia: "#ff00ff",
        brown: "#a52a2a",
        maroon: "#800000",
        mediumblue: "#0000cd",
        lightcoral: "#f08080",
        darkturquoise: "#00ced1",
        lightcyan: "#e0ffff",
        ivory: "#fffff0",
        lightyellow: "#ffffe0",
        lightsalmon: "#ffa07a",
        lightseagreen: "#20b2aa",
        linen: "#faf0e6",
        mediumaquamarine: "#66cdaa",
        lemonchiffon: "#fffacd",
        lime: "#00ff00",
        khaki: "#f0e68c",
        mediumseagreen: "#3cb371",
        limegreen: "#32cd32",
        mediumspringgreen: "#00fa9a",
        lightskyblue: "#87cefa",
        lightblue: "#add8e6",
        midnightblue: "#191970",
        lightpink: "#ffb6c1",
        mistyrose: "#ffe4e1",
        moccasin: "#ffe4b5",
        mintcream: "#f5fffa",
        lightslategray: "#778899",
        lightslategrey: "#778899",
        navajowhite: "#ffdead",
        navy: "#000080",
        mediumvioletred: "#c71585",
        powderblue: "#b0e0e6",
        palegoldenrod: "#eee8aa",
        oldlace: "#fdf5e6",
        paleturquoise: "#afeeee",
        mediumturquoise: "#48d1cc",
        mediumorchid: "#ba55d3",
        rebeccapurple: "#663399",
        lightsteelblue: "#b0c4de",
        mediumslateblue: "#7b68ee",
        thistle: "#d8bfd8",
        tan: "#d2b48c",
        orchid: "#da70d6",
        mediumpurple: "#9370db",
        purple: "#800080",
        pink: "#ffc0cb",
        skyblue: "#87ceeb",
        springgreen: "#00ff7f",
        palegreen: "#98fb98",
        red: "#ff0000",
        yellow: "#ffff00",
        slateblue: "#6a5acd",
        lavenderblush: "#fff0f5",
        peru: "#cd853f",
        palevioletred: "#db7093",
        violet: "#ee82ee",
        teal: "#008080",
        slategray: "#708090",
        slategrey: "#708090",
        aliceblue: "#f0f8ff",
        darkseagreen: "#8fbc8f",
        darkolivegreen: "#556b2f",
        greenyellow: "#adff2f",
        seagreen: "#2e8b57",
        seashell: "#fff5ee",
        tomato: "#ff6347",
        silver: "#c0c0c0",
        sienna: "#a0522d",
        lavender: "#e6e6fa",
        lightgreen: "#90ee90",
        orange: "#ffa500",
        orangered: "#ff4500",
        steelblue: "#4682b4",
        royalblue: "#4169e1",
        turquoise: "#40e0d0",
        yellowgreen: "#9acd32",
        salmon: "#fa8072",
        saddlebrown: "#8b4513",
        sandybrown: "#f4a460",
        rosybrown: "#bc8f8f",
        darksalmon: "#e9967a",
        lightgoldenrodyellow: "#fafad2",
        snow: "#fffafa",
        lightgrey: "#d3d3d3",
        lightgray: "#d3d3d3",
        dimgray: "#696969",
        dimgrey: "#696969",
        olivedrab: "#6b8e23",
        olive: "#808000"
    }
      , r = {};
    for (var i in n)
        r[n[i]] = i;
    var o = {};
    t.prototype.toName = function(s) {
        if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b))
            return "transparent";
        var a, l, c = r[this.toHex()];
        if (c)
            return c;
        if (s != null && s.closest) {
            var u = this.toRgb()
              , f = 1 / 0
              , d = "black";
            if (!o.length)
                for (var h in n)
                    o[h] = new t(n[h]).toRgb();
            for (var p in n) {
                var y = (a = u,
                l = o[p],
                Math.pow(a.r - l.r, 2) + Math.pow(a.g - l.g, 2) + Math.pow(a.b - l.b, 2));
                y < f && (f = y,
                d = p)
            }
            return d
        }
    }
    ,
    e.string.push([function(s) {
        var a = s.toLowerCase()
          , l = a === "transparent" ? "#0000" : n[a];
        return l ? new t(l).toRgb() : null
    }
    , "name"])
}
Kae([qae]);
const Xc = class nf {
    constructor(e=16777215) {
        this._value = null,
        this._components = new Float32Array(4),
        this._components.fill(1),
        this._int = 16777215,
        this.value = e
    }
    get red() {
        return this._components[0]
    }
    get green() {
        return this._components[1]
    }
    get blue() {
        return this._components[2]
    }
    get alpha() {
        return this._components[3]
    }
    setValue(e) {
        return this.value = e,
        this
    }
    set value(e) {
        if (e instanceof nf)
            this._value = this._cloneSource(e._value),
            this._int = e._int,
            this._components.set(e._components);
        else {
            if (e === null)
                throw new Error("Cannot set Color#value to null");
            (this._value === null || !this._isSourceEqual(this._value, e)) && (this._value = this._cloneSource(e),
            this._normalize(this._value))
        }
    }
    get value() {
        return this._value
    }
    _cloneSource(e) {
        return typeof e == "string" || typeof e == "number" || e instanceof Number || e === null ? e : Array.isArray(e) || ArrayBuffer.isView(e) ? e.slice(0) : typeof e == "object" && e !== null ? {
            ...e
        } : e
    }
    _isSourceEqual(e, n) {
        const r = typeof e;
        if (r !== typeof n)
            return !1;
        if (r === "number" || r === "string" || e instanceof Number)
            return e === n;
        if (Array.isArray(e) && Array.isArray(n) || ArrayBuffer.isView(e) && ArrayBuffer.isView(n))
            return e.length !== n.length ? !1 : e.every( (o, s) => o === n[s]);
        if (e !== null && n !== null) {
            const o = Object.keys(e)
              , s = Object.keys(n);
            return o.length !== s.length ? !1 : o.every(a => e[a] === n[a])
        }
        return e === n
    }
    toRgba() {
        const [e,n,r,i] = this._components;
        return {
            r: e,
            g: n,
            b: r,
            a: i
        }
    }
    toRgb() {
        const [e,n,r] = this._components;
        return {
            r: e,
            g: n,
            b: r
        }
    }
    toRgbaString() {
        const [e,n,r] = this.toUint8RgbArray();
        return `rgba(${e},${n},${r},${this.alpha})`
    }
    toUint8RgbArray(e) {
        const [n,r,i] = this._components;
        return this._arrayRgb || (this._arrayRgb = []),
        e || (e = this._arrayRgb),
        e[0] = Math.round(n * 255),
        e[1] = Math.round(r * 255),
        e[2] = Math.round(i * 255),
        e
    }
    toArray(e) {
        this._arrayRgba || (this._arrayRgba = []),
        e || (e = this._arrayRgba);
        const [n,r,i,o] = this._components;
        return e[0] = n,
        e[1] = r,
        e[2] = i,
        e[3] = o,
        e
    }
    toRgbArray(e) {
        this._arrayRgb || (this._arrayRgb = []),
        e || (e = this._arrayRgb);
        const [n,r,i] = this._components;
        return e[0] = n,
        e[1] = r,
        e[2] = i,
        e
    }
    toNumber() {
        return this._int
    }
    toBgrNumber() {
        const [e,n,r] = this.toUint8RgbArray();
        return (r << 16) + (n << 8) + e
    }
    toLittleEndianNumber() {
        const e = this._int;
        return (e >> 16) + (e & 65280) + ((e & 255) << 16)
    }
    multiply(e) {
        const [n,r,i,o] = nf._temp.setValue(e)._components;
        return this._components[0] *= n,
        this._components[1] *= r,
        this._components[2] *= i,
        this._components[3] *= o,
        this._refreshInt(),
        this._value = null,
        this
    }
    premultiply(e, n=!0) {
        return n && (this._components[0] *= e,
        this._components[1] *= e,
        this._components[2] *= e),
        this._components[3] = e,
        this._refreshInt(),
        this._value = null,
        this
    }
    toPremultiplied(e, n=!0) {
        if (e === 1)
            return (255 << 24) + this._int;
        if (e === 0)
            return n ? 0 : this._int;
        let r = this._int >> 16 & 255
          , i = this._int >> 8 & 255
          , o = this._int & 255;
        return n && (r = r * e + .5 | 0,
        i = i * e + .5 | 0,
        o = o * e + .5 | 0),
        (e * 255 << 24) + (r << 16) + (i << 8) + o
    }
    toHex() {
        const e = this._int.toString(16);
        return `#${"000000".substring(0, 6 - e.length) + e}`
    }
    toHexa() {
        const n = Math.round(this._components[3] * 255).toString(16);
        return this.toHex() + "00".substring(0, 2 - n.length) + n
    }
    setAlpha(e) {
        return this._components[3] = this._clamp(e),
        this
    }
    _normalize(e) {
        let n, r, i, o;
        if ((typeof e == "number" || e instanceof Number) && e >= 0 && e <= 16777215) {
            const s = e;
            n = (s >> 16 & 255) / 255,
            r = (s >> 8 & 255) / 255,
            i = (s & 255) / 255,
            o = 1
        } else if ((Array.isArray(e) || e instanceof Float32Array) && e.length >= 3 && e.length <= 4)
            e = this._clamp(e),
            [n,r,i,o=1] = e;
        else if ((e instanceof Uint8Array || e instanceof Uint8ClampedArray) && e.length >= 3 && e.length <= 4)
            e = this._clamp(e, 0, 255),
            [n,r,i,o=255] = e,
            n /= 255,
            r /= 255,
            i /= 255,
            o /= 255;
        else if (typeof e == "string" || typeof e == "object") {
            if (typeof e == "string") {
                const a = nf.HEX_PATTERN.exec(e);
                a && (e = `#${a[2]}`)
            }
            const s = Xi(e);
            s.isValid() && ({r: n, g: r, b: i, a: o} = s.rgba,
            n /= 255,
            r /= 255,
            i /= 255)
        }
        if (n !== void 0)
            this._components[0] = n,
            this._components[1] = r,
            this._components[2] = i,
            this._components[3] = o,
            this._refreshInt();
        else
            throw new Error(`Unable to convert color ${e}`)
    }
    _refreshInt() {
        this._clamp(this._components);
        const [e,n,r] = this._components;
        this._int = (e * 255 << 16) + (n * 255 << 8) + (r * 255 | 0)
    }
    _clamp(e, n=0, r=1) {
        return typeof e == "number" ? Math.min(Math.max(e, n), r) : (e.forEach( (i, o) => {
            e[o] = Math.min(Math.max(i, n), r)
        }
        ),
        e)
    }
    static isColorLike(e) {
        return typeof e == "number" || typeof e == "string" || e instanceof Number || e instanceof nf || Array.isArray(e) || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Float32Array || e.r !== void 0 && e.g !== void 0 && e.b !== void 0 || e.r !== void 0 && e.g !== void 0 && e.b !== void 0 && e.a !== void 0 || e.h !== void 0 && e.s !== void 0 && e.l !== void 0 || e.h !== void 0 && e.s !== void 0 && e.l !== void 0 && e.a !== void 0 || e.h !== void 0 && e.s !== void 0 && e.v !== void 0 || e.h !== void 0 && e.s !== void 0 && e.v !== void 0 && e.a !== void 0
    }
}
;
Xc.shared = new Xc;
Xc._temp = new Xc;
Xc.HEX_PATTERN = /^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;
let Rt = Xc;
const Zae = {
    cullArea: null,
    cullable: !1,
    cullableChildren: !0
};
let m1 = 0;
const oT = 500;
function Ne(...t) {
    m1 !== oT && (m1++,
    m1 === oT ? console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS.") : console.warn("PixiJS Warning: ", ...t))
}
class Yw {
    constructor(e, n) {
        this._pool = [],
        this._count = 0,
        this._index = 0,
        this._classType = e,
        n && this.prepopulate(n)
    }
    prepopulate(e) {
        for (let n = 0; n < e; n++)
            this._pool[this._index++] = new this._classType;
        this._count += e
    }
    get(e) {
        var r;
        let n;
        return this._index > 0 ? n = this._pool[--this._index] : n = new this._classType,
        (r = n.init) == null || r.call(n, e),
        n
    }
    return(e) {
        var n;
        (n = e.reset) == null || n.call(e),
        this._pool[this._index++] = e
    }
    get totalSize() {
        return this._count
    }
    get totalFree() {
        return this._index
    }
    get totalUsed() {
        return this._count - this._index
    }
    clear() {
        this._pool.length = 0,
        this._index = 0
    }
}
class Jae {
    constructor() {
        this._poolsByClass = new Map
    }
    prepopulate(e, n) {
        this.getPool(e).prepopulate(n)
    }
    get(e, n) {
        return this.getPool(e).get(n)
    }
    return(e) {
        this.getPool(e.constructor).return(e)
    }
    getPool(e) {
        return this._poolsByClass.has(e) || this._poolsByClass.set(e, new Yw(e)),
        this._poolsByClass.get(e)
    }
    stats() {
        const e = {};
        return this._poolsByClass.forEach(n => {
            const r = e[n._classType.name] ? n._classType.name + n._classType.ID : n._classType.name;
            e[r] = {
                free: n.totalFree,
                used: n.totalUsed,
                size: n.totalSize
            }
        }
        ),
        e
    }
}
const Hn = new Jae
  , Qae = {
    get isCachedAsTexture() {
        var t;
        return !!((t = this.renderGroup) != null && t.isCachedAsTexture)
    },
    cacheAsTexture(t) {
        typeof t == "boolean" && t === !1 ? this.disableRenderGroup() : (this.enableRenderGroup(),
        this.renderGroup.enableCacheAsTexture(t === !0 ? {} : t))
    },
    updateCacheTexture() {
        var t;
        (t = this.renderGroup) == null || t.updateCacheTexture()
    },
    get cacheAsBitmap() {
        return this.isCachedAsTexture
    },
    set cacheAsBitmap(t) {
        Fe("v8.6.0", "cacheAsBitmap is deprecated, use cacheAsTexture instead."),
        this.cacheAsTexture(t)
    }
};
function ND(t, e, n) {
    const r = t.length;
    let i;
    if (e >= r || n === 0)
        return;
    n = e + n > r ? r - e : n;
    const o = r - n;
    for (i = e; i < o; ++i)
        t[i] = t[i + n];
    t.length = o
}
const ele = {
    allowChildren: !0,
    removeChildren(t=0, e) {
        var o;
        const n = e ?? this.children.length
          , r = n - t
          , i = [];
        if (r > 0 && r <= n) {
            for (let a = n - 1; a >= t; a--) {
                const l = this.children[a];
                l && (i.push(l),
                l.parent = null)
            }
            ND(this.children, t, n);
            const s = this.renderGroup || this.parentRenderGroup;
            s && s.removeChildren(i);
            for (let a = 0; a < i.length; ++a) {
                const l = i[a];
                (o = l.parentRenderLayer) == null || o.detach(l),
                this.emit("childRemoved", l, this, a),
                i[a].emit("removed", this)
            }
            return i.length > 0 && this._didViewChangeTick++,
            i
        } else if (r === 0 && this.children.length === 0)
            return i;
        throw new RangeError("removeChildren: numeric values are outside the acceptable range.")
    },
    removeChildAt(t) {
        const e = this.getChildAt(t);
        return this.removeChild(e)
    },
    getChildAt(t) {
        if (t < 0 || t >= this.children.length)
            throw new Error(`getChildAt: Index (${t}) does not exist.`);
        return this.children[t]
    },
    setChildIndex(t, e) {
        if (e < 0 || e >= this.children.length)
            throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);
        this.getChildIndex(t),
        this.addChildAt(t, e)
    },
    getChildIndex(t) {
        const e = this.children.indexOf(t);
        if (e === -1)
            throw new Error("The supplied Container must be a child of the caller");
        return e
    },
    addChildAt(t, e) {
        this.allowChildren || Fe(rt, "addChildAt: Only Containers will be allowed to add children in v8.0.0");
        const {children: n} = this;
        if (e < 0 || e > n.length)
            throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${n.length}`);
        if (t.parent) {
            const i = t.parent.children.indexOf(t);
            if (t.parent === this && i === e)
                return t;
            i !== -1 && t.parent.children.splice(i, 1)
        }
        e === n.length ? n.push(t) : n.splice(e, 0, t),
        t.parent = this,
        t.didChange = !0,
        t._updateFlags = 15;
        const r = this.renderGroup || this.parentRenderGroup;
        return r && r.addChild(t),
        this.sortableChildren && (this.sortDirty = !0),
        this.emit("childAdded", t, this, e),
        t.emit("added", this),
        t
    },
    swapChildren(t, e) {
        if (t === e)
            return;
        const n = this.getChildIndex(t)
          , r = this.getChildIndex(e);
        this.children[n] = e,
        this.children[r] = t;
        const i = this.renderGroup || this.parentRenderGroup;
        i && (i.structureDidChange = !0),
        this._didContainerChangeTick++
    },
    removeFromParent() {
        var t;
        (t = this.parent) == null || t.removeChild(this)
    },
    reparentChild(...t) {
        return t.length === 1 ? this.reparentChildAt(t[0], this.children.length) : (t.forEach(e => this.reparentChildAt(e, this.children.length)),
        t[0])
    },
    reparentChildAt(t, e) {
        if (t.parent === this)
            return this.setChildIndex(t, e),
            t;
        const n = t.worldTransform.clone();
        t.removeFromParent(),
        this.addChildAt(t, e);
        const r = this.worldTransform.clone();
        return r.invert(),
        n.prepend(r),
        t.setFromMatrix(n),
        t
    },
    replaceChild(t, e) {
        t.updateLocalTransform(),
        this.addChildAt(e, this.getChildIndex(t)),
        e.setFromMatrix(t.localTransform),
        e.updateLocalTransform(),
        this.removeChild(t)
    }
}
  , tle = {
    collectRenderables(t, e, n) {
        this.parentRenderLayer && this.parentRenderLayer !== n || this.globalDisplayStatus < 7 || !this.includeInBuild || (this.sortableChildren && this.sortChildren(),
        this.isSimple ? this.collectRenderablesSimple(t, e, n) : this.renderGroup ? e.renderPipes.renderGroup.addRenderGroup(this.renderGroup, t) : this.collectRenderablesWithEffects(t, e, n))
    },
    collectRenderablesSimple(t, e, n) {
        const r = this.children
          , i = r.length;
        for (let o = 0; o < i; o++)
            r[o].collectRenderables(t, e, n)
    },
    collectRenderablesWithEffects(t, e, n) {
        const {renderPipes: r} = e;
        for (let i = 0; i < this.effects.length; i++) {
            const o = this.effects[i];
            r[o.pipe].push(o, this, t)
        }
        this.collectRenderablesSimple(t, e, n);
        for (let i = this.effects.length - 1; i >= 0; i--) {
            const o = this.effects[i];
            r[o.pipe].pop(o, this, t)
        }
    }
};
class x0 {
    constructor() {
        this.pipe = "filter",
        this.priority = 1
    }
    destroy() {
        for (let e = 0; e < this.filters.length; e++)
            this.filters[e].destroy();
        this.filters = null,
        this.filterArea = null
    }
}
class nle {
    constructor() {
        this._effectClasses = [],
        this._tests = [],
        this._initialized = !1
    }
    init() {
        this._initialized || (this._initialized = !0,
        this._effectClasses.forEach(e => {
            this.add({
                test: e.test,
                maskClass: e
            })
        }
        ))
    }
    add(e) {
        this._tests.push(e)
    }
    getMaskEffect(e) {
        this._initialized || this.init();
        for (let n = 0; n < this._tests.length; n++) {
            const r = this._tests[n];
            if (r.test(e))
                return Hn.get(r.maskClass, e)
        }
        return e
    }
    returnMaskEffect(e) {
        Hn.return(e)
    }
}
const M_ = new nle;
$e.handleByList(V.MaskEffect, M_._effectClasses);
const rle = {
    _maskEffect: null,
    _maskOptions: {
        inverse: !1
    },
    _filterEffect: null,
    effects: [],
    _markStructureAsChanged() {
        const t = this.renderGroup || this.parentRenderGroup;
        t && (t.structureDidChange = !0)
    },
    addEffect(t) {
        this.effects.indexOf(t) === -1 && (this.effects.push(t),
        this.effects.sort( (n, r) => n.priority - r.priority),
        this._markStructureAsChanged(),
        this._updateIsSimple())
    },
    removeEffect(t) {
        const e = this.effects.indexOf(t);
        e !== -1 && (this.effects.splice(e, 1),
        this._markStructureAsChanged(),
        this._updateIsSimple())
    },
    set mask(t) {
        const e = this._maskEffect;
        (e == null ? void 0 : e.mask) !== t && (e && (this.removeEffect(e),
        M_.returnMaskEffect(e),
        this._maskEffect = null),
        t != null && (this._maskEffect = M_.getMaskEffect(t),
        this.addEffect(this._maskEffect)))
    },
    get mask() {
        var t;
        return (t = this._maskEffect) == null ? void 0 : t.mask
    },
    setMask(t) {
        this._maskOptions = {
            ...this._maskOptions,
            ...t
        },
        t.mask && (this.mask = t.mask),
        this._markStructureAsChanged()
    },
    set filters(t) {
        var o;
        !Array.isArray(t) && t && (t = [t]);
        const e = this._filterEffect || (this._filterEffect = new x0);
        t = t;
        const n = (t == null ? void 0 : t.length) > 0
          , r = ((o = e.filters) == null ? void 0 : o.length) > 0
          , i = n !== r;
        t = Array.isArray(t) ? t.slice(0) : t,
        e.filters = Object.freeze(t),
        i && (n ? this.addEffect(e) : (this.removeEffect(e),
        e.filters = t ?? null))
    },
    get filters() {
        var t;
        return (t = this._filterEffect) == null ? void 0 : t.filters
    },
    set filterArea(t) {
        this._filterEffect || (this._filterEffect = new x0),
        this._filterEffect.filterArea = t
    },
    get filterArea() {
        var t;
        return (t = this._filterEffect) == null ? void 0 : t.filterArea
    }
}
  , ile = {
    label: null,
    get name() {
        return Fe(rt, "Container.name property has been removed, use Container.label instead"),
        this.label
    },
    set name(t) {
        Fe(rt, "Container.name property has been removed, use Container.label instead"),
        this.label = t
    },
    getChildByName(t, e=!1) {
        return this.getChildByLabel(t, e)
    },
    getChildByLabel(t, e=!1) {
        const n = this.children;
        for (let r = 0; r < n.length; r++) {
            const i = n[r];
            if (i.label === t || t instanceof RegExp && t.test(i.label))
                return i
        }
        if (e)
            for (let r = 0; r < n.length; r++) {
                const o = n[r].getChildByLabel(t, !0);
                if (o)
                    return o
            }
        return null
    },
    getChildrenByLabel(t, e=!1, n=[]) {
        const r = this.children;
        for (let i = 0; i < r.length; i++) {
            const o = r[i];
            (o.label === t || t instanceof RegExp && t.test(o.label)) && n.push(o)
        }
        if (e)
            for (let i = 0; i < r.length; i++)
                r[i].getChildrenByLabel(t, !0, n);
        return n
    }
}
  , fr = new Yw(Oe)
  , Xo = new Yw(Vn)
  , ole = new Oe
  , sle = {
    getFastGlobalBounds(t, e) {
        e || (e = new Vn),
        e.clear(),
        this._getGlobalBoundsRecursive(!!t, e, this.parentRenderLayer),
        e.isValid || e.set(0, 0, 0, 0);
        const n = this.renderGroup || this.parentRenderGroup;
        return e.applyMatrix(n.worldTransform),
        e
    },
    _getGlobalBoundsRecursive(t, e, n) {
        let r = e;
        if (t && this.parentRenderLayer && this.parentRenderLayer !== n || this.localDisplayStatus !== 7 || !this.measurable)
            return;
        const i = !!this.effects.length;
        if ((this.renderGroup || i) && (r = Xo.get().clear()),
        this.boundsArea)
            e.addRect(this.boundsArea, this.worldTransform);
        else {
            if (this.renderPipeId) {
                const s = this.bounds;
                r.addFrame(s.minX, s.minY, s.maxX, s.maxY, this.groupTransform)
            }
            const o = this.children;
            for (let s = 0; s < o.length; s++)
                o[s]._getGlobalBoundsRecursive(t, r, n)
        }
        if (i) {
            let o = !1;
            const s = this.renderGroup || this.parentRenderGroup;
            for (let a = 0; a < this.effects.length; a++)
                this.effects[a].addBounds && (o || (o = !0,
                r.applyMatrix(s.worldTransform)),
                this.effects[a].addBounds(r, !0));
            o && r.applyMatrix(s.worldTransform.copyTo(ole).invert()),
            e.addBounds(r),
            Xo.return(r)
        } else
            this.renderGroup && (e.addBounds(r, this.relativeGroupTransform),
            Xo.return(r))
    }
};
function Xw(t, e, n) {
    n.clear();
    let r, i;
    return t.parent ? e ? r = t.parent.worldTransform : (i = fr.get().identity(),
    r = Kw(t, i)) : r = Oe.IDENTITY,
    FD(t, n, r, e),
    i && fr.return(i),
    n.isValid || n.set(0, 0, 0, 0),
    n
}
function FD(t, e, n, r) {
    var a, l;
    if (!t.visible || !t.measurable)
        return;
    let i;
    r ? i = t.worldTransform : (t.updateLocalTransform(),
    i = fr.get(),
    i.appendFrom(t.localTransform, n));
    const o = e
      , s = !!t.effects.length;
    if (s && (e = Xo.get().clear()),
    t.boundsArea)
        e.addRect(t.boundsArea, i);
    else {
        t.bounds && (e.matrix = i,
        e.addBounds(t.bounds));
        for (let c = 0; c < t.children.length; c++)
            FD(t.children[c], e, i, r)
    }
    if (s) {
        for (let c = 0; c < t.effects.length; c++)
            (l = (a = t.effects[c]).addBounds) == null || l.call(a, e);
        o.addBounds(e, Oe.IDENTITY),
        Xo.return(e)
    }
    r || fr.return(i)
}
function Kw(t, e) {
    const n = t.parent;
    return n && (Kw(n, e),
    n.updateLocalTransform(),
    e.append(n.localTransform)),
    e
}
function LD(t, e) {
    if (t === 16777215 || !e)
        return e;
    if (e === 16777215 || !t)
        return t;
    const n = t >> 16 & 255
      , r = t >> 8 & 255
      , i = t & 255
      , o = e >> 16 & 255
      , s = e >> 8 & 255
      , a = e & 255
      , l = n * o / 255 | 0
      , c = r * s / 255 | 0
      , u = i * a / 255 | 0;
    return (l << 16) + (c << 8) + u
}
const sT = 16777215;
function b0(t, e) {
    return t === sT ? e : e === sT ? t : LD(t, e)
}
function Af(t) {
    return ((t & 255) << 16) + (t & 65280) + (t >> 16 & 255)
}
const ale = {
    getGlobalAlpha(t) {
        if (t)
            return this.renderGroup ? this.renderGroup.worldAlpha : this.parentRenderGroup ? this.parentRenderGroup.worldAlpha * this.alpha : this.alpha;
        let e = this.alpha
          , n = this.parent;
        for (; n; )
            e *= n.alpha,
            n = n.parent;
        return e
    },
    getGlobalTransform(t=new Oe, e) {
        if (e)
            return t.copyFrom(this.worldTransform);
        this.updateLocalTransform();
        const n = Kw(this, fr.get().identity());
        return t.appendFrom(this.localTransform, n),
        fr.return(n),
        t
    },
    getGlobalTint(t) {
        if (t)
            return this.renderGroup ? Af(this.renderGroup.worldColor) : this.parentRenderGroup ? Af(b0(this.localColor, this.parentRenderGroup.worldColor)) : this.tint;
        let e = this.localColor
          , n = this.parent;
        for (; n; )
            e = b0(e, n.localColor),
            n = n.parent;
        return Af(e)
    }
};
function qw(t, e, n) {
    return e.clear(),
    n || (n = Oe.IDENTITY),
    $D(t, e, n, t, !0),
    e.isValid || e.set(0, 0, 0, 0),
    e
}
function $D(t, e, n, r, i) {
    var l, c;
    let o;
    if (i)
        o = fr.get(),
        o = n.copyTo(o);
    else {
        if (!t.visible || !t.measurable)
            return;
        t.updateLocalTransform();
        const u = t.localTransform;
        o = fr.get(),
        o.appendFrom(u, n)
    }
    const s = e
      , a = !!t.effects.length;
    if (a && (e = Xo.get().clear()),
    t.boundsArea)
        e.addRect(t.boundsArea, o);
    else {
        t.renderPipeId && (e.matrix = o,
        e.addBounds(t.bounds));
        const u = t.children;
        for (let f = 0; f < u.length; f++)
            $D(u[f], e, o, r, !1)
    }
    if (a) {
        for (let u = 0; u < t.effects.length; u++)
            (c = (l = t.effects[u]).addLocalBounds) == null || c.call(l, e, r);
        s.addBounds(e, Oe.IDENTITY),
        Xo.return(e)
    }
    fr.return(o)
}
function UD(t, e) {
    const n = t.children;
    for (let r = 0; r < n.length; r++) {
        const i = n[r]
          , o = i.uid
          , s = (i._didViewChangeTick & 65535) << 16 | i._didContainerChangeTick & 65535
          , a = e.index;
        (e.data[a] !== o || e.data[a + 1] !== s) && (e.data[e.index] = o,
        e.data[e.index + 1] = s,
        e.didChange = !0),
        e.index = a + 2,
        i.children.length && UD(i, e)
    }
    return e.didChange
}
const lle = new Oe
  , cle = {
    _localBoundsCacheId: -1,
    _localBoundsCacheData: null,
    _setWidth(t, e) {
        const n = Math.sign(this.scale.x) || 1;
        e !== 0 ? this.scale.x = t / e * n : this.scale.x = n
    },
    _setHeight(t, e) {
        const n = Math.sign(this.scale.y) || 1;
        e !== 0 ? this.scale.y = t / e * n : this.scale.y = n
    },
    getLocalBounds() {
        this._localBoundsCacheData || (this._localBoundsCacheData = {
            data: [],
            index: 1,
            didChange: !1,
            localBounds: new Vn
        });
        const t = this._localBoundsCacheData;
        return t.index = 1,
        t.didChange = !1,
        t.data[0] !== this._didViewChangeTick && (t.didChange = !0,
        t.data[0] = this._didViewChangeTick),
        UD(this, t),
        t.didChange && qw(this, t.localBounds, lle),
        t.localBounds
    },
    getBounds(t, e) {
        return Xw(this, t, e || new Vn)
    }
}
  , ule = {
    _onRender: null,
    set onRender(t) {
        const e = this.renderGroup || this.parentRenderGroup;
        if (!t) {
            this._onRender && (e == null || e.removeOnRender(this)),
            this._onRender = null;
            return
        }
        this._onRender || e == null || e.addOnRender(this),
        this._onRender = t
    },
    get onRender() {
        return this._onRender
    }
}
  , fle = {
    _zIndex: 0,
    sortDirty: !1,
    sortableChildren: !1,
    get zIndex() {
        return this._zIndex
    },
    set zIndex(t) {
        this._zIndex !== t && (this._zIndex = t,
        this.depthOfChildModified())
    },
    depthOfChildModified() {
        this.parent && (this.parent.sortableChildren = !0,
        this.parent.sortDirty = !0),
        this.parentRenderGroup && (this.parentRenderGroup.structureDidChange = !0)
    },
    sortChildren() {
        this.sortDirty && (this.sortDirty = !1,
        this.children.sort(dle))
    }
};
function dle(t, e) {
    return t._zIndex - e._zIndex
}
const hle = {
    getGlobalPosition(t=new Gt, e=!1) {
        return this.parent ? this.parent.toGlobal(this._position, t, e) : (t.x = this._position.x,
        t.y = this._position.y),
        t
    },
    toGlobal(t, e, n=!1) {
        const r = this.getGlobalTransform(fr.get(), n);
        return e = r.apply(t, e),
        fr.return(r),
        e
    },
    toLocal(t, e, n, r) {
        e && (t = e.toGlobal(t, n, r));
        const i = this.getGlobalTransform(fr.get(), r);
        return n = i.applyInverse(t, n),
        fr.return(i),
        n
    }
};
class GD {
    constructor() {
        this.uid = Ut("instructionSet"),
        this.instructions = [],
        this.instructionSize = 0,
        this.renderables = [],
        this.gcTick = 0
    }
    reset() {
        this.instructionSize = 0
    }
    add(e) {
        this.instructions[this.instructionSize++] = e
    }
    log() {
        this.instructions.length = this.instructionSize,
        console.table(this.instructions, ["type", "action"])
    }
}
let ple = 0;
class gle {
    constructor(e) {
        this._poolKeyHash = Object.create(null),
        this._texturePool = {},
        this.textureOptions = e || {},
        this.enableFullScreen = !1,
        this.textureStyle = new yo(this.textureOptions)
    }
    createTexture(e, n, r) {
        const i = new Cn({
            ...this.textureOptions,
            width: e,
            height: n,
            resolution: 1,
            antialias: r,
            autoGarbageCollect: !1
        });
        return new Ae({
            source: i,
            label: `texturePool_${ple++}`
        })
    }
    getOptimalTexture(e, n, r=1, i) {
        let o = Math.ceil(e * r - 1e-6)
          , s = Math.ceil(n * r - 1e-6);
        o = Yc(o),
        s = Yc(s);
        const a = (o << 17) + (s << 1) + (i ? 1 : 0);
        this._texturePool[a] || (this._texturePool[a] = []);
        let l = this._texturePool[a].pop();
        return l || (l = this.createTexture(o, s, i)),
        l.source._resolution = r,
        l.source.width = o / r,
        l.source.height = s / r,
        l.source.pixelWidth = o,
        l.source.pixelHeight = s,
        l.frame.x = 0,
        l.frame.y = 0,
        l.frame.width = e,
        l.frame.height = n,
        l.updateUvs(),
        this._poolKeyHash[l.uid] = a,
        l
    }
    getSameSizeTexture(e, n=!1) {
        const r = e.source;
        return this.getOptimalTexture(e.width, e.height, r._resolution, n)
    }
    returnTexture(e, n=!1) {
        const r = this._poolKeyHash[e.uid];
        n && (e.source.style = this.textureStyle),
        this._texturePool[r].push(e)
    }
    clear(e) {
        if (e = e !== !1,
        e)
            for (const n in this._texturePool) {
                const r = this._texturePool[n];
                if (r)
                    for (let i = 0; i < r.length; i++)
                        r[i].destroy(!0)
            }
        this._texturePool = {}
    }
}
const cn = new gle;
class mle {
    constructor() {
        this.renderPipeId = "renderGroup",
        this.root = null,
        this.canBundle = !1,
        this.renderGroupParent = null,
        this.renderGroupChildren = [],
        this.worldTransform = new Oe,
        this.worldColorAlpha = 4294967295,
        this.worldColor = 16777215,
        this.worldAlpha = 1,
        this.childrenToUpdate = Object.create(null),
        this.updateTick = 0,
        this.gcTick = 0,
        this.childrenRenderablesToUpdate = {
            list: [],
            index: 0
        },
        this.structureDidChange = !0,
        this.instructionSet = new GD,
        this._onRenderContainers = [],
        this.textureNeedsUpdate = !0,
        this.isCachedAsTexture = !1,
        this._matrixDirty = 7
    }
    init(e) {
        this.root = e,
        e._onRender && this.addOnRender(e),
        e.didChange = !0;
        const n = e.children;
        for (let r = 0; r < n.length; r++) {
            const i = n[r];
            i._updateFlags = 15,
            this.addChild(i)
        }
    }
    enableCacheAsTexture(e={}) {
        this.textureOptions = e,
        this.isCachedAsTexture = !0,
        this.textureNeedsUpdate = !0
    }
    disableCacheAsTexture() {
        this.isCachedAsTexture = !1,
        this.texture && (cn.returnTexture(this.texture, !0),
        this.texture = null)
    }
    updateCacheTexture() {
        this.textureNeedsUpdate = !0
    }
    reset() {
        this.renderGroupChildren.length = 0;
        for (const e in this.childrenToUpdate) {
            const n = this.childrenToUpdate[e];
            n.list.fill(null),
            n.index = 0
        }
        this.childrenRenderablesToUpdate.index = 0,
        this.childrenRenderablesToUpdate.list.fill(null),
        this.root = null,
        this.updateTick = 0,
        this.structureDidChange = !0,
        this._onRenderContainers.length = 0,
        this.renderGroupParent = null,
        this.disableCacheAsTexture()
    }
    get localTransform() {
        return this.root.localTransform
    }
    addRenderGroupChild(e) {
        e.renderGroupParent && e.renderGroupParent._removeRenderGroupChild(e),
        e.renderGroupParent = this,
        this.renderGroupChildren.push(e)
    }
    _removeRenderGroupChild(e) {
        const n = this.renderGroupChildren.indexOf(e);
        n > -1 && this.renderGroupChildren.splice(n, 1),
        e.renderGroupParent = null
    }
    addChild(e) {
        if (this.structureDidChange = !0,
        e.parentRenderGroup = this,
        e.updateTick = -1,
        e.parent === this.root ? e.relativeRenderGroupDepth = 1 : e.relativeRenderGroupDepth = e.parent.relativeRenderGroupDepth + 1,
        e.didChange = !0,
        this.onChildUpdate(e),
        e.renderGroup) {
            this.addRenderGroupChild(e.renderGroup);
            return
        }
        e._onRender && this.addOnRender(e);
        const n = e.children;
        for (let r = 0; r < n.length; r++)
            this.addChild(n[r])
    }
    removeChild(e) {
        if (this.structureDidChange = !0,
        e._onRender && (e.renderGroup || this.removeOnRender(e)),
        e.parentRenderGroup = null,
        e.renderGroup) {
            this._removeRenderGroupChild(e.renderGroup);
            return
        }
        const n = e.children;
        for (let r = 0; r < n.length; r++)
            this.removeChild(n[r])
    }
    removeChildren(e) {
        for (let n = 0; n < e.length; n++)
            this.removeChild(e[n])
    }
    onChildUpdate(e) {
        let n = this.childrenToUpdate[e.relativeRenderGroupDepth];
        n || (n = this.childrenToUpdate[e.relativeRenderGroupDepth] = {
            index: 0,
            list: []
        }),
        n.list[n.index++] = e
    }
    updateRenderable(e) {
        e.globalDisplayStatus < 7 || (this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),
        e.didViewUpdate = !1)
    }
    onChildViewUpdate(e) {
        this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++] = e
    }
    get isRenderable() {
        return this.root.localDisplayStatus === 7 && this.worldAlpha > 0
    }
    addOnRender(e) {
        this._onRenderContainers.push(e)
    }
    removeOnRender(e) {
        this._onRenderContainers.splice(this._onRenderContainers.indexOf(e), 1)
    }
    runOnRender(e) {
        for (let n = 0; n < this._onRenderContainers.length; n++)
            this._onRenderContainers[n]._onRender(e)
    }
    destroy() {
        this.disableCacheAsTexture(),
        this.renderGroupParent = null,
        this.root = null,
        this.childrenRenderablesToUpdate = null,
        this.childrenToUpdate = null,
        this.renderGroupChildren = null,
        this._onRenderContainers = null,
        this.instructionSet = null
    }
    getChildren(e=[]) {
        const n = this.root.children;
        for (let r = 0; r < n.length; r++)
            this._getChildren(n[r], e);
        return e
    }
    _getChildren(e, n=[]) {
        if (n.push(e),
        e.renderGroup)
            return n;
        const r = e.children;
        for (let i = 0; i < r.length; i++)
            this._getChildren(r[i], n);
        return n
    }
    invalidateMatrices() {
        this._matrixDirty = 7
    }
    get inverseWorldTransform() {
        return this._matrixDirty & 1 ? (this._matrixDirty &= -2,
        this._inverseWorldTransform || (this._inverseWorldTransform = new Oe),
        this._inverseWorldTransform.copyFrom(this.worldTransform).invert()) : this._inverseWorldTransform
    }
    get textureOffsetInverseTransform() {
        return this._matrixDirty & 2 ? (this._matrixDirty &= -3,
        this._textureOffsetInverseTransform || (this._textureOffsetInverseTransform = new Oe),
        this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x, -this._textureBounds.y)) : this._textureOffsetInverseTransform
    }
    get inverseParentTextureTransform() {
        if (!(this._matrixDirty & 4))
            return this._inverseParentTextureTransform;
        this._matrixDirty &= -5;
        const e = this._parentCacheAsTextureRenderGroup;
        return e ? (this._inverseParentTextureTransform || (this._inverseParentTextureTransform = new Oe),
        this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x, -e._textureBounds.y)) : this.worldTransform
    }
    get cacheToLocalTransform() {
        return this._parentCacheAsTextureRenderGroup ? this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform : null
    }
}
function D_(t, e, n={}) {
    for (const r in e)
        !n[r] && e[r] !== void 0 && (t[r] = e[r])
}
const v1 = new Jt(null)
  , Zh = new Jt(null)
  , y1 = new Jt(null,1,1)
  , Jh = new Jt(null)
  , w0 = 1
  , Zw = 2
  , Tf = 4;
class Xr extends Jr {
    constructor(e={}) {
        var n, r;
        super(),
        this.uid = Ut("renderable"),
        this._updateFlags = 15,
        this.renderGroup = null,
        this.parentRenderGroup = null,
        this.parentRenderGroupIndex = 0,
        this.didChange = !1,
        this.didViewUpdate = !1,
        this.relativeRenderGroupDepth = 0,
        this.children = [],
        this.parent = null,
        this.includeInBuild = !0,
        this.measurable = !0,
        this.isSimple = !0,
        this.updateTick = -1,
        this.localTransform = new Oe,
        this.relativeGroupTransform = new Oe,
        this.groupTransform = this.relativeGroupTransform,
        this.destroyed = !1,
        this._position = new Jt(this,0,0),
        this._scale = y1,
        this._pivot = Zh,
        this._origin = Jh,
        this._skew = v1,
        this._cx = 1,
        this._sx = 0,
        this._cy = 0,
        this._sy = 1,
        this._rotation = 0,
        this.localColor = 16777215,
        this.localAlpha = 1,
        this.groupAlpha = 1,
        this.groupColor = 16777215,
        this.groupColorAlpha = 4294967295,
        this.localBlendMode = "inherit",
        this.groupBlendMode = "normal",
        this.localDisplayStatus = 7,
        this.globalDisplayStatus = 7,
        this._didContainerChangeTick = 0,
        this._didViewChangeTick = 0,
        this._didLocalTransformChangeId = -1,
        this.effects = [],
        D_(this, e, {
            children: !0,
            parent: !0,
            effects: !0
        }),
        (n = e.children) == null || n.forEach(i => this.addChild(i)),
        (r = e.parent) == null || r.addChild(this)
    }
    static mixin(e) {
        Fe("8.8.0", "Container.mixin is deprecated, please use extensions.mixin instead."),
        $e.mixin(Xr, e)
    }
    set _didChangeId(e) {
        this._didViewChangeTick = e >> 12 & 4095,
        this._didContainerChangeTick = e & 4095
    }
    get _didChangeId() {
        return this._didContainerChangeTick & 4095 | (this._didViewChangeTick & 4095) << 12
    }
    addChild(...e) {
        if (this.allowChildren || Fe(rt, "addChild: Only Containers will be allowed to add children in v8.0.0"),
        e.length > 1) {
            for (let i = 0; i < e.length; i++)
                this.addChild(e[i]);
            return e[0]
        }
        const n = e[0]
          , r = this.renderGroup || this.parentRenderGroup;
        return n.parent === this ? (this.children.splice(this.children.indexOf(n), 1),
        this.children.push(n),
        r && (r.structureDidChange = !0),
        n) : (n.parent && n.parent.removeChild(n),
        this.children.push(n),
        this.sortableChildren && (this.sortDirty = !0),
        n.parent = this,
        n.didChange = !0,
        n._updateFlags = 15,
        r && r.addChild(n),
        this.emit("childAdded", n, this, this.children.length - 1),
        n.emit("added", this),
        this._didViewChangeTick++,
        n._zIndex !== 0 && n.depthOfChildModified(),
        n)
    }
    removeChild(...e) {
        if (e.length > 1) {
            for (let i = 0; i < e.length; i++)
                this.removeChild(e[i]);
            return e[0]
        }
        const n = e[0]
          , r = this.children.indexOf(n);
        return r > -1 && (this._didViewChangeTick++,
        this.children.splice(r, 1),
        this.renderGroup ? this.renderGroup.removeChild(n) : this.parentRenderGroup && this.parentRenderGroup.removeChild(n),
        n.parentRenderLayer && n.parentRenderLayer.detach(n),
        n.parent = null,
        this.emit("childRemoved", n, this, r),
        n.emit("removed", this)),
        n
    }
    _onUpdate(e) {
        e && e === this._skew && this._updateSkew(),
        this._didContainerChangeTick++,
        !this.didChange && (this.didChange = !0,
        this.parentRenderGroup && this.parentRenderGroup.onChildUpdate(this))
    }
    set isRenderGroup(e) {
        !!this.renderGroup !== e && (e ? this.enableRenderGroup() : this.disableRenderGroup())
    }
    get isRenderGroup() {
        return !!this.renderGroup
    }
    enableRenderGroup() {
        if (this.renderGroup)
            return;
        const e = this.parentRenderGroup;
        e == null || e.removeChild(this),
        this.renderGroup = Hn.get(mle, this),
        this.groupTransform = Oe.IDENTITY,
        e == null || e.addChild(this),
        this._updateIsSimple()
    }
    disableRenderGroup() {
        if (!this.renderGroup)
            return;
        const e = this.parentRenderGroup;
        e == null || e.removeChild(this),
        Hn.return(this.renderGroup),
        this.renderGroup = null,
        this.groupTransform = this.relativeGroupTransform,
        e == null || e.addChild(this),
        this._updateIsSimple()
    }
    _updateIsSimple() {
        this.isSimple = !this.renderGroup && this.effects.length === 0
    }
    get worldTransform() {
        return this._worldTransform || (this._worldTransform = new Oe),
        this.renderGroup ? this._worldTransform.copyFrom(this.renderGroup.worldTransform) : this.parentRenderGroup && this._worldTransform.appendFrom(this.relativeGroupTransform, this.parentRenderGroup.worldTransform),
        this._worldTransform
    }
    get x() {
        return this._position.x
    }
    set x(e) {
        this._position.x = e
    }
    get y() {
        return this._position.y
    }
    set y(e) {
        this._position.y = e
    }
    get position() {
        return this._position
    }
    set position(e) {
        this._position.copyFrom(e)
    }
    get rotation() {
        return this._rotation
    }
    set rotation(e) {
        this._rotation !== e && (this._rotation = e,
        this._onUpdate(this._skew))
    }
    get angle() {
        return this.rotation * kae
    }
    set angle(e) {
        this.rotation = e * Nae
    }
    get pivot() {
        return this._pivot === Zh && (this._pivot = new Jt(this,0,0)),
        this._pivot
    }
    set pivot(e) {
        this._pivot === Zh && (this._pivot = new Jt(this,0,0),
        this._origin !== Jh && Ne("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),
        typeof e == "number" ? this._pivot.set(e) : this._pivot.copyFrom(e)
    }
    get skew() {
        return this._skew === v1 && (this._skew = new Jt(this,0,0)),
        this._skew
    }
    set skew(e) {
        this._skew === v1 && (this._skew = new Jt(this,0,0)),
        this._skew.copyFrom(e)
    }
    get scale() {
        return this._scale === y1 && (this._scale = new Jt(this,1,1)),
        this._scale
    }
    set scale(e) {
        this._scale === y1 && (this._scale = new Jt(this,0,0)),
        typeof e == "string" && (e = parseFloat(e)),
        typeof e == "number" ? this._scale.set(e) : this._scale.copyFrom(e)
    }
    get origin() {
        return this._origin === Jh && (this._origin = new Jt(this,0,0)),
        this._origin
    }
    set origin(e) {
        this._origin === Jh && (this._origin = new Jt(this,0,0),
        this._pivot !== Zh && Ne("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),
        typeof e == "number" ? this._origin.set(e) : this._origin.copyFrom(e)
    }
    get width() {
        return Math.abs(this.scale.x * this.getLocalBounds().width)
    }
    set width(e) {
        const n = this.getLocalBounds().width;
        this._setWidth(e, n)
    }
    get height() {
        return Math.abs(this.scale.y * this.getLocalBounds().height)
    }
    set height(e) {
        const n = this.getLocalBounds().height;
        this._setHeight(e, n)
    }
    getSize(e) {
        e || (e = {});
        const n = this.getLocalBounds();
        return e.width = Math.abs(this.scale.x * n.width),
        e.height = Math.abs(this.scale.y * n.height),
        e
    }
    setSize(e, n) {
        const r = this.getLocalBounds();
        typeof e == "object" ? (n = e.height ?? e.width,
        e = e.width) : n ?? (n = e),
        e !== void 0 && this._setWidth(e, r.width),
        n !== void 0 && this._setHeight(n, r.height)
    }
    _updateSkew() {
        const e = this._rotation
          , n = this._skew;
        this._cx = Math.cos(e + n._y),
        this._sx = Math.sin(e + n._y),
        this._cy = -Math.sin(e - n._x),
        this._sy = Math.cos(e - n._x)
    }
    updateTransform(e) {
        return this.position.set(typeof e.x == "number" ? e.x : this.position.x, typeof e.y == "number" ? e.y : this.position.y),
        this.scale.set(typeof e.scaleX == "number" ? e.scaleX || 1 : this.scale.x, typeof e.scaleY == "number" ? e.scaleY || 1 : this.scale.y),
        this.rotation = typeof e.rotation == "number" ? e.rotation : this.rotation,
        this.skew.set(typeof e.skewX == "number" ? e.skewX : this.skew.x, typeof e.skewY == "number" ? e.skewY : this.skew.y),
        this.pivot.set(typeof e.pivotX == "number" ? e.pivotX : this.pivot.x, typeof e.pivotY == "number" ? e.pivotY : this.pivot.y),
        this.origin.set(typeof e.originX == "number" ? e.originX : this.origin.x, typeof e.originY == "number" ? e.originY : this.origin.y),
        this
    }
    setFromMatrix(e) {
        e.decompose(this)
    }
    updateLocalTransform() {
        const e = this._didContainerChangeTick;
        if (this._didLocalTransformChangeId === e)
            return;
        this._didLocalTransformChangeId = e;
        const n = this.localTransform
          , r = this._scale
          , i = this._pivot
          , o = this._origin
          , s = this._position
          , a = r._x
          , l = r._y
          , c = i._x
          , u = i._y
          , f = -o._x
          , d = -o._y;
        n.a = this._cx * a,
        n.b = this._sx * a,
        n.c = this._cy * l,
        n.d = this._sy * l,
        n.tx = s._x - (c * n.a + u * n.c) + (f * n.a + d * n.c) - f,
        n.ty = s._y - (c * n.b + u * n.d) + (f * n.b + d * n.d) - d
    }
    set alpha(e) {
        e !== this.localAlpha && (this.localAlpha = e,
        this._updateFlags |= w0,
        this._onUpdate())
    }
    get alpha() {
        return this.localAlpha
    }
    set tint(e) {
        const r = Rt.shared.setValue(e ?? 16777215).toBgrNumber();
        r !== this.localColor && (this.localColor = r,
        this._updateFlags |= w0,
        this._onUpdate())
    }
    get tint() {
        return Af(this.localColor)
    }
    set blendMode(e) {
        this.localBlendMode !== e && (this.parentRenderGroup && (this.parentRenderGroup.structureDidChange = !0),
        this._updateFlags |= Zw,
        this.localBlendMode = e,
        this._onUpdate())
    }
    get blendMode() {
        return this.localBlendMode
    }
    get visible() {
        return !!(this.localDisplayStatus & 2)
    }
    set visible(e) {
        const n = e ? 2 : 0;
        (this.localDisplayStatus & 2) !== n && (this.parentRenderGroup && (this.parentRenderGroup.structureDidChange = !0),
        this._updateFlags |= Tf,
        this.localDisplayStatus ^= 2,
        this._onUpdate())
    }
    get culled() {
        return !(this.localDisplayStatus & 4)
    }
    set culled(e) {
        const n = e ? 0 : 4;
        (this.localDisplayStatus & 4) !== n && (this.parentRenderGroup && (this.parentRenderGroup.structureDidChange = !0),
        this._updateFlags |= Tf,
        this.localDisplayStatus ^= 4,
        this._onUpdate())
    }
    get renderable() {
        return !!(this.localDisplayStatus & 1)
    }
    set renderable(e) {
        const n = e ? 1 : 0;
        (this.localDisplayStatus & 1) !== n && (this._updateFlags |= Tf,
        this.localDisplayStatus ^= 1,
        this.parentRenderGroup && (this.parentRenderGroup.structureDidChange = !0),
        this._onUpdate())
    }
    get isRenderable() {
        return this.localDisplayStatus === 7 && this.groupAlpha > 0
    }
    destroy(e=!1) {
        var i;
        if (this.destroyed)
            return;
        this.destroyed = !0;
        let n;
        if (this.children.length && (n = this.removeChildren(0, this.children.length)),
        this.removeFromParent(),
        this.parent = null,
        this._maskEffect = null,
        this._filterEffect = null,
        this.effects = null,
        this._position = null,
        this._scale = null,
        this._pivot = null,
        this._origin = null,
        this._skew = null,
        this.emit("destroyed", this),
        this.removeAllListeners(),
        (typeof e == "boolean" ? e : e == null ? void 0 : e.children) && n)
            for (let o = 0; o < n.length; ++o)
                n[o].destroy(e);
        (i = this.renderGroup) == null || i.destroy(),
        this.renderGroup = null
    }
}
$e.mixin(Xr, ele, sle, hle, ule, cle, rle, ile, fle, Zae, Qae, ale, tle);
class qd extends Xr {
    constructor(e) {
        super(e),
        this.canBundle = !0,
        this.allowChildren = !1,
        this._roundPixels = 0,
        this._lastUsed = -1,
        this._gpuData = Object.create(null),
        this._bounds = new Vn(0,1,0,0),
        this._boundsDirty = !0
    }
    get bounds() {
        return this._boundsDirty ? (this.updateBounds(),
        this._boundsDirty = !1,
        this._bounds) : this._bounds
    }
    get roundPixels() {
        return !!this._roundPixels
    }
    set roundPixels(e) {
        this._roundPixels = e ? 1 : 0
    }
    containsPoint(e) {
        const n = this.bounds
          , {x: r, y: i} = e;
        return r >= n.minX && r <= n.maxX && i >= n.minY && i <= n.maxY
    }
    onViewUpdate() {
        if (this._didViewChangeTick++,
        this._boundsDirty = !0,
        this.didViewUpdate)
            return;
        this.didViewUpdate = !0;
        const e = this.renderGroup || this.parentRenderGroup;
        e && e.onChildViewUpdate(this)
    }
    destroy(e) {
        var n, r;
        super.destroy(e),
        this._bounds = null;
        for (const i in this._gpuData)
            (r = (n = this._gpuData[i]).destroy) == null || r.call(n);
        this._gpuData = null
    }
    collectRenderablesSimple(e, n, r) {
        const {renderPipes: i} = n;
        i.blendMode.setBlendMode(this, this.groupBlendMode, e),
        i[this.renderPipeId].addRenderable(this, e),
        this.didViewUpdate = !1;
        const s = this.children
          , a = s.length;
        for (let l = 0; l < a; l++)
            s[l].collectRenderables(e, n, r)
    }
}
class vl extends qd {
    constructor(e=Ae.EMPTY) {
        e instanceof Ae && (e = {
            texture: e
        });
        const {texture: n=Ae.EMPTY, anchor: r, roundPixels: i, width: o, height: s, ...a} = e;
        super({
            label: "Sprite",
            ...a
        }),
        this.renderPipeId = "sprite",
        this.batched = !0,
        this._visualBounds = {
            minX: 0,
            maxX: 1,
            minY: 0,
            maxY: 0
        },
        this._anchor = new Jt({
            _onUpdate: () => {
                this.onViewUpdate()
            }
        }),
        r ? this.anchor = r : n.defaultAnchor && (this.anchor = n.defaultAnchor),
        this.texture = n,
        this.allowChildren = !1,
        this.roundPixels = i ?? !1,
        o !== void 0 && (this.width = o),
        s !== void 0 && (this.height = s)
    }
    static from(e, n=!1) {
        return e instanceof Ae ? new vl(e) : new vl(Ae.from(e, n))
    }
    set texture(e) {
        e || (e = Ae.EMPTY);
        const n = this._texture;
        n !== e && (n && n.dynamic && n.off("update", this.onViewUpdate, this),
        e.dynamic && e.on("update", this.onViewUpdate, this),
        this._texture = e,
        this._width && this._setWidth(this._width, this._texture.orig.width),
        this._height && this._setHeight(this._height, this._texture.orig.height),
        this.onViewUpdate())
    }
    get texture() {
        return this._texture
    }
    get visualBounds() {
        return MD(this._visualBounds, this._anchor, this._texture),
        this._visualBounds
    }
    get sourceBounds() {
        return Fe("8.6.1", "Sprite.sourceBounds is deprecated, use visualBounds instead."),
        this.visualBounds
    }
    updateBounds() {
        const e = this._anchor
          , n = this._texture
          , r = this._bounds
          , {width: i, height: o} = n.orig;
        r.minX = -e._x * i,
        r.maxX = r.minX + i,
        r.minY = -e._y * o,
        r.maxY = r.minY + o
    }
    destroy(e=!1) {
        if (super.destroy(e),
        typeof e == "boolean" ? e : e == null ? void 0 : e.texture) {
            const r = typeof e == "boolean" ? e : e == null ? void 0 : e.textureSource;
            this._texture.destroy(r)
        }
        this._texture = null,
        this._visualBounds = null,
        this._bounds = null,
        this._anchor = null,
        this._gpuData = null
    }
    get anchor() {
        return this._anchor
    }
    set anchor(e) {
        typeof e == "number" ? this._anchor.set(e) : this._anchor.copyFrom(e)
    }
    get width() {
        return Math.abs(this.scale.x) * this._texture.orig.width
    }
    set width(e) {
        this._setWidth(e, this._texture.orig.width),
        this._width = e
    }
    get height() {
        return Math.abs(this.scale.y) * this._texture.orig.height
    }
    set height(e) {
        this._setHeight(e, this._texture.orig.height),
        this._height = e
    }
    getSize(e) {
        return e || (e = {}),
        e.width = Math.abs(this.scale.x) * this._texture.orig.width,
        e.height = Math.abs(this.scale.y) * this._texture.orig.height,
        e
    }
    setSize(e, n) {
        typeof e == "object" ? (n = e.height ?? e.width,
        e = e.width) : n ?? (n = e),
        e !== void 0 && this._setWidth(e, this._texture.orig.width),
        n !== void 0 && this._setHeight(n, this._texture.orig.height)
    }
}
const vle = new Vn;
function HD(t, e, n) {
    const r = vle;
    t.measurable = !0,
    Xw(t, n, r),
    e.addBoundsMask(r),
    t.measurable = !1
}
function VD(t, e, n) {
    const r = Xo.get();
    t.measurable = !0;
    const i = fr.get().identity()
      , o = zD(t, n, i);
    qw(t, r, o),
    t.measurable = !1,
    e.addBoundsMask(r),
    fr.return(i),
    Xo.return(r)
}
function zD(t, e, n) {
    return t ? (t !== e && (zD(t.parent, e, n),
    t.updateLocalTransform(),
    n.append(t.localTransform)),
    n) : (Ne("Mask bounds, renderable is not inside the root container"),
    n)
}
class jD {
    constructor(e) {
        this.priority = 0,
        this.inverse = !1,
        this.pipe = "alphaMask",
        e != null && e.mask && this.init(e.mask)
    }
    init(e) {
        this.mask = e,
        this.renderMaskToTexture = !(e instanceof vl),
        this.mask.renderable = this.renderMaskToTexture,
        this.mask.includeInBuild = !this.renderMaskToTexture,
        this.mask.measurable = !1
    }
    reset() {
        this.mask.measurable = !0,
        this.mask = null
    }
    addBounds(e, n) {
        this.inverse || HD(this.mask, e, n)
    }
    addLocalBounds(e, n) {
        VD(this.mask, e, n)
    }
    containsPoint(e, n) {
        const r = this.mask;
        return n(r, e)
    }
    destroy() {
        this.reset()
    }
    static test(e) {
        return e instanceof vl
    }
}
jD.extension = V.MaskEffect;
class WD {
    constructor(e) {
        this.priority = 0,
        this.pipe = "colorMask",
        e != null && e.mask && this.init(e.mask)
    }
    init(e) {
        this.mask = e
    }
    destroy() {}
    static test(e) {
        return typeof e == "number"
    }
}
WD.extension = V.MaskEffect;
class YD {
    constructor(e) {
        this.priority = 0,
        this.pipe = "stencilMask",
        e != null && e.mask && this.init(e.mask)
    }
    init(e) {
        this.mask = e,
        this.mask.includeInBuild = !1,
        this.mask.measurable = !1
    }
    reset() {
        this.mask.measurable = !0,
        this.mask.includeInBuild = !0,
        this.mask = null
    }
    addBounds(e, n) {
        HD(this.mask, e, n)
    }
    addLocalBounds(e, n) {
        VD(this.mask, e, n)
    }
    containsPoint(e, n) {
        const r = this.mask;
        return n(r, e)
    }
    destroy() {
        this.reset()
    }
    static test(e) {
        return e instanceof Xr
    }
}
YD.extension = V.MaskEffect;
const yle = {
    createCanvas: (t, e) => {
        const n = document.createElement("canvas");
        return n.width = t,
        n.height = e,
        n
    }
    ,
    createImage: () => new Image,
    getCanvasRenderingContext2D: () => CanvasRenderingContext2D,
    getWebGLRenderingContext: () => WebGLRenderingContext,
    getNavigator: () => navigator,
    getBaseUrl: () => document.baseURI ?? window.location.href,
    getFontFaceSet: () => document.fonts,
    fetch: (t, e) => fetch(t, e),
    parseXML: t => new DOMParser().parseFromString(t, "text/xml")
};
let aT = yle;
const je = {
    get() {
        return aT
    },
    set(t) {
        aT = t
    }
};
class lo extends Cn {
    constructor(e) {
        e.resource || (e.resource = je.get().createCanvas()),
        e.width || (e.width = e.resource.width,
        e.autoDensity || (e.width /= e.resolution)),
        e.height || (e.height = e.resource.height,
        e.autoDensity || (e.height /= e.resolution)),
        super(e),
        this.uploadMethodId = "image",
        this.autoDensity = e.autoDensity,
        this.resizeCanvas(),
        this.transparent = !!e.transparent
    }
    resizeCanvas() {
        this.autoDensity && "style"in this.resource && (this.resource.style.width = `${this.width}px`,
        this.resource.style.height = `${this.height}px`),
        (this.resource.width !== this.pixelWidth || this.resource.height !== this.pixelHeight) && (this.resource.width = this.pixelWidth,
        this.resource.height = this.pixelHeight)
    }
    resize(e=this.width, n=this.height, r=this._resolution) {
        const i = super.resize(e, n, r);
        return i && this.resizeCanvas(),
        i
    }
    static test(e) {
        return globalThis.HTMLCanvasElement && e instanceof HTMLCanvasElement || globalThis.OffscreenCanvas && e instanceof OffscreenCanvas
    }
    get context2D() {
        return this._context2D || (this._context2D = this.resource.getContext("2d"))
    }
}
lo.extension = V.TextureSource;
class yl extends Cn {
    constructor(e) {
        super(e),
        this.uploadMethodId = "image",
        this.autoGarbageCollect = !0
    }
    static test(e) {
        return globalThis.HTMLImageElement && e instanceof HTMLImageElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap || globalThis.VideoFrame && e instanceof VideoFrame
    }
}
yl.extension = V.TextureSource;
var _l = (t => (t[t.INTERACTION = 50] = "INTERACTION",
t[t.HIGH = 25] = "HIGH",
t[t.NORMAL = 0] = "NORMAL",
t[t.LOW = -25] = "LOW",
t[t.UTILITY = -50] = "UTILITY",
t))(_l || {});
class _1 {
    constructor(e, n=null, r=0, i=!1) {
        this.next = null,
        this.previous = null,
        this._destroyed = !1,
        this._fn = e,
        this._context = n,
        this.priority = r,
        this._once = i
    }
    match(e, n=null) {
        return this._fn === e && this._context === n
    }
    emit(e) {
        this._fn && (this._context ? this._fn.call(this._context, e) : this._fn(e));
        const n = this.next;
        return this._once && this.destroy(!0),
        this._destroyed && (this.next = null),
        n
    }
    connect(e) {
        this.previous = e,
        e.next && (e.next.previous = this),
        this.next = e.next,
        e.next = this
    }
    destroy(e=!1) {
        this._destroyed = !0,
        this._fn = null,
        this._context = null,
        this.previous && (this.previous.next = this.next),
        this.next && (this.next.previous = this.previous);
        const n = this.next;
        return this.next = e ? null : n,
        this.previous = null,
        n
    }
}
const XD = class Nr {
    constructor() {
        this.autoStart = !1,
        this.deltaTime = 1,
        this.lastTime = -1,
        this.speed = 1,
        this.started = !1,
        this._requestId = null,
        this._maxElapsedMS = 100,
        this._minElapsedMS = 0,
        this._protected = !1,
        this._lastFrame = -1,
        this._head = new _1(null,null,1 / 0),
        this.deltaMS = 1 / Nr.targetFPMS,
        this.elapsedMS = 1 / Nr.targetFPMS,
        this._tick = e => {
            this._requestId = null,
            this.started && (this.update(e),
            this.started && this._requestId === null && this._head.next && (this._requestId = requestAnimationFrame(this._tick)))
        }
    }
    _requestIfNeeded() {
        this._requestId === null && this._head.next && (this.lastTime = performance.now(),
        this._lastFrame = this.lastTime,
        this._requestId = requestAnimationFrame(this._tick))
    }
    _cancelIfNeeded() {
        this._requestId !== null && (cancelAnimationFrame(this._requestId),
        this._requestId = null)
    }
    _startIfPossible() {
        this.started ? this._requestIfNeeded() : this.autoStart && this.start()
    }
    add(e, n, r=_l.NORMAL) {
        return this._addListener(new _1(e,n,r))
    }
    addOnce(e, n, r=_l.NORMAL) {
        return this._addListener(new _1(e,n,r,!0))
    }
    _addListener(e) {
        let n = this._head.next
          , r = this._head;
        if (!n)
            e.connect(r);
        else {
            for (; n; ) {
                if (e.priority > n.priority) {
                    e.connect(r);
                    break
                }
                r = n,
                n = n.next
            }
            e.previous || e.connect(r)
        }
        return this._startIfPossible(),
        this
    }
    remove(e, n) {
        let r = this._head.next;
        for (; r; )
            r.match(e, n) ? r = r.destroy() : r = r.next;
        return this._head.next || this._cancelIfNeeded(),
        this
    }
    get count() {
        if (!this._head)
            return 0;
        let e = 0
          , n = this._head;
        for (; n = n.next; )
            e++;
        return e
    }
    start() {
        this.started || (this.started = !0,
        this._requestIfNeeded())
    }
    stop() {
        this.started && (this.started = !1,
        this._cancelIfNeeded())
    }
    destroy() {
        if (!this._protected) {
            this.stop();
            let e = this._head.next;
            for (; e; )
                e = e.destroy(!0);
            this._head.destroy(),
            this._head = null
        }
    }
    update(e=performance.now()) {
        let n;
        if (e > this.lastTime) {
            if (n = this.elapsedMS = e - this.lastTime,
            n > this._maxElapsedMS && (n = this._maxElapsedMS),
            n *= this.speed,
            this._minElapsedMS) {
                const o = e - this._lastFrame | 0;
                if (o < this._minElapsedMS)
                    return;
                this._lastFrame = e - o % this._minElapsedMS
            }
            this.deltaMS = n,
            this.deltaTime = this.deltaMS * Nr.targetFPMS;
            const r = this._head;
            let i = r.next;
            for (; i; )
                i = i.emit(this);
            r.next || this._cancelIfNeeded()
        } else
            this.deltaTime = this.deltaMS = this.elapsedMS = 0;
        this.lastTime = e
    }
    get FPS() {
        return 1e3 / this.elapsedMS
    }
    get minFPS() {
        return 1e3 / this._maxElapsedMS
    }
    set minFPS(e) {
        const n = Math.min(this.maxFPS, e)
          , r = Math.min(Math.max(0, n) / 1e3, Nr.targetFPMS);
        this._maxElapsedMS = 1 / r
    }
    get maxFPS() {
        return this._minElapsedMS ? Math.round(1e3 / this._minElapsedMS) : 0
    }
    set maxFPS(e) {
        if (e === 0)
            this._minElapsedMS = 0;
        else {
            const n = Math.max(this.minFPS, e);
            this._minElapsedMS = 1 / (n / 1e3)
        }
    }
    static get shared() {
        if (!Nr._shared) {
            const e = Nr._shared = new Nr;
            e.autoStart = !0,
            e._protected = !0
        }
        return Nr._shared
    }
    static get system() {
        if (!Nr._system) {
            const e = Nr._system = new Nr;
            e.autoStart = !0,
            e._protected = !0
        }
        return Nr._system
    }
}
;
XD.targetFPMS = .06;
let Un = XD, x1;
async function KD() {
    return x1 ?? (x1 = (async () => {
        var s;
        const e = je.get().createCanvas(1, 1).getContext("webgl");
        if (!e)
            return "premultiply-alpha-on-upload";
        const n = await new Promise(a => {
            const l = document.createElement("video");
            l.onloadeddata = () => a(l),
            l.onerror = () => a(null),
            l.autoplay = !1,
            l.crossOrigin = "anonymous",
            l.preload = "auto",
            l.src = "data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",
            l.load()
        }
        );
        if (!n)
            return "premultiply-alpha-on-upload";
        const r = e.createTexture();
        e.bindTexture(e.TEXTURE_2D, r);
        const i = e.createFramebuffer();
        e.bindFramebuffer(e.FRAMEBUFFER, i),
        e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, r, 0),
        e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1),
        e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.NONE),
        e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, n);
        const o = new Uint8Array(4);
        return e.readPixels(0, 0, 1, 1, e.RGBA, e.UNSIGNED_BYTE, o),
        e.deleteFramebuffer(i),
        e.deleteTexture(r),
        (s = e.getExtension("WEBGL_lose_context")) == null || s.loseContext(),
        o[0] <= o[3] ? "premultiplied-alpha" : "premultiply-alpha-on-upload"
    }
    )()),
    x1
}
const em = class qD extends Cn {
    constructor(e) {
        super(e),
        this.isReady = !1,
        this.uploadMethodId = "video",
        e = {
            ...qD.defaultOptions,
            ...e
        },
        this._autoUpdate = !0,
        this._isConnectedToTicker = !1,
        this._updateFPS = e.updateFPS || 0,
        this._msToNextUpdate = 0,
        this.autoPlay = e.autoPlay !== !1,
        this.alphaMode = e.alphaMode ?? "premultiply-alpha-on-upload",
        this._videoFrameRequestCallback = this._videoFrameRequestCallback.bind(this),
        this._videoFrameRequestCallbackHandle = null,
        this._load = null,
        this._resolve = null,
        this._reject = null,
        this._onCanPlay = this._onCanPlay.bind(this),
        this._onCanPlayThrough = this._onCanPlayThrough.bind(this),
        this._onError = this._onError.bind(this),
        this._onPlayStart = this._onPlayStart.bind(this),
        this._onPlayStop = this._onPlayStop.bind(this),
        this._onSeeked = this._onSeeked.bind(this),
        e.autoLoad !== !1 && this.load()
    }
    updateFrame() {
        if (!this.destroyed) {
            if (this._updateFPS) {
                const e = Un.shared.elapsedMS * this.resource.playbackRate;
                this._msToNextUpdate = Math.floor(this._msToNextUpdate - e)
            }
            (!this._updateFPS || this._msToNextUpdate <= 0) && (this._msToNextUpdate = this._updateFPS ? Math.floor(1e3 / this._updateFPS) : 0),
            this.isValid && this.update()
        }
    }
    _videoFrameRequestCallback() {
        this.updateFrame(),
        this.destroyed ? this._videoFrameRequestCallbackHandle = null : this._videoFrameRequestCallbackHandle = this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)
    }
    get isValid() {
        return !!this.resource.videoWidth && !!this.resource.videoHeight
    }
    async load() {
        if (this._load)
            return this._load;
        const e = this.resource
          , n = this.options;
        return (e.readyState === e.HAVE_ENOUGH_DATA || e.readyState === e.HAVE_FUTURE_DATA) && e.width && e.height && (e.complete = !0),
        e.addEventListener("play", this._onPlayStart),
        e.addEventListener("pause", this._onPlayStop),
        e.addEventListener("seeked", this._onSeeked),
        this._isSourceReady() ? this._mediaReady() : (n.preload || e.addEventListener("canplay", this._onCanPlay),
        e.addEventListener("canplaythrough", this._onCanPlayThrough),
        e.addEventListener("error", this._onError, !0)),
        this.alphaMode = await KD(),
        this._load = new Promise( (r, i) => {
            this.isValid ? r(this) : (this._resolve = r,
            this._reject = i,
            n.preloadTimeoutMs !== void 0 && (this._preloadTimeout = setTimeout( () => {
                this._onError(new ErrorEvent(`Preload exceeded timeout of ${n.preloadTimeoutMs}ms`))
            }
            )),
            e.load())
        }
        ),
        this._load
    }
    _onError(e) {
        this.resource.removeEventListener("error", this._onError, !0),
        this.emit("error", e),
        this._reject && (this._reject(e),
        this._reject = null,
        this._resolve = null)
    }
    _isSourcePlaying() {
        const e = this.resource;
        return !e.paused && !e.ended
    }
    _isSourceReady() {
        return this.resource.readyState > 2
    }
    _onPlayStart() {
        this.isValid || this._mediaReady(),
        this._configureAutoUpdate()
    }
    _onPlayStop() {
        this._configureAutoUpdate()
    }
    _onSeeked() {
        this._autoUpdate && !this._isSourcePlaying() && (this._msToNextUpdate = 0,
        this.updateFrame(),
        this._msToNextUpdate = 0)
    }
    _onCanPlay() {
        this.resource.removeEventListener("canplay", this._onCanPlay),
        this._mediaReady()
    }
    _onCanPlayThrough() {
        this.resource.removeEventListener("canplaythrough", this._onCanPlay),
        this._preloadTimeout && (clearTimeout(this._preloadTimeout),
        this._preloadTimeout = void 0),
        this._mediaReady()
    }
    _mediaReady() {
        const e = this.resource;
        this.isValid && (this.isReady = !0,
        this.resize(e.videoWidth, e.videoHeight)),
        this._msToNextUpdate = 0,
        this.updateFrame(),
        this._msToNextUpdate = 0,
        this._resolve && (this._resolve(this),
        this._resolve = null,
        this._reject = null),
        this._isSourcePlaying() ? this._onPlayStart() : this.autoPlay && this.resource.play()
    }
    destroy() {
        this._configureAutoUpdate();
        const e = this.resource;
        e && (e.removeEventListener("play", this._onPlayStart),
        e.removeEventListener("pause", this._onPlayStop),
        e.removeEventListener("seeked", this._onSeeked),
        e.removeEventListener("canplay", this._onCanPlay),
        e.removeEventListener("canplaythrough", this._onCanPlayThrough),
        e.removeEventListener("error", this._onError, !0),
        e.pause(),
        e.src = "",
        e.load()),
        super.destroy()
    }
    get autoUpdate() {
        return this._autoUpdate
    }
    set autoUpdate(e) {
        e !== this._autoUpdate && (this._autoUpdate = e,
        this._configureAutoUpdate())
    }
    get updateFPS() {
        return this._updateFPS
    }
    set updateFPS(e) {
        e !== this._updateFPS && (this._updateFPS = e,
        this._configureAutoUpdate())
    }
    _configureAutoUpdate() {
        this._autoUpdate && this._isSourcePlaying() ? !this._updateFPS && this.resource.requestVideoFrameCallback ? (this._isConnectedToTicker && (Un.shared.remove(this.updateFrame, this),
        this._isConnectedToTicker = !1,
        this._msToNextUpdate = 0),
        this._videoFrameRequestCallbackHandle === null && (this._videoFrameRequestCallbackHandle = this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))) : (this._videoFrameRequestCallbackHandle !== null && (this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),
        this._videoFrameRequestCallbackHandle = null),
        this._isConnectedToTicker || (Un.shared.add(this.updateFrame, this),
        this._isConnectedToTicker = !0,
        this._msToNextUpdate = 0)) : (this._videoFrameRequestCallbackHandle !== null && (this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),
        this._videoFrameRequestCallbackHandle = null),
        this._isConnectedToTicker && (Un.shared.remove(this.updateFrame, this),
        this._isConnectedToTicker = !1,
        this._msToNextUpdate = 0))
    }
    static test(e) {
        return globalThis.HTMLVideoElement && e instanceof HTMLVideoElement
    }
}
;
em.extension = V.TextureSource;
em.defaultOptions = {
    ...Cn.defaultOptions,
    autoLoad: !0,
    autoPlay: !0,
    updateFPS: 0,
    crossorigin: !0,
    loop: !1,
    muted: !0,
    playsinline: !0,
    preload: !1
};
em.MIME_TYPES = {
    ogv: "video/ogg",
    mov: "video/quicktime",
    m4v: "video/mp4"
};
let Pf = em;
const Pi = (t, e, n=!1) => (Array.isArray(t) || (t = [t]),
e ? t.map(r => typeof r == "string" || n ? e(r) : r) : t);
class _le {
    constructor() {
        this._parsers = [],
        this._cache = new Map,
        this._cacheMap = new Map
    }
    reset() {
        this._cacheMap.clear(),
        this._cache.clear()
    }
    has(e) {
        return this._cache.has(e)
    }
    get(e) {
        const n = this._cache.get(e);
        return n || Ne(`[Assets] Asset id ${e} was not found in the Cache`),
        n
    }
    set(e, n) {
        const r = Pi(e);
        let i;
        for (let l = 0; l < this.parsers.length; l++) {
            const c = this.parsers[l];
            if (c.test(n)) {
                i = c.getCacheableAssets(r, n);
                break
            }
        }
        const o = new Map(Object.entries(i || {}));
        i || r.forEach(l => {
            o.set(l, n)
        }
        );
        const s = [...o.keys()]
          , a = {
            cacheKeys: s,
            keys: r
        };
        r.forEach(l => {
            this._cacheMap.set(l, a)
        }
        ),
        s.forEach(l => {
            const c = i ? i[l] : n;
            this._cache.has(l) && this._cache.get(l) !== c && Ne("[Cache] already has key:", l),
            this._cache.set(l, o.get(l))
        }
        )
    }
    remove(e) {
        if (!this._cacheMap.has(e)) {
            Ne(`[Assets] Asset id ${e} was not found in the Cache`);
            return
        }
        const n = this._cacheMap.get(e);
        n.cacheKeys.forEach(i => {
            this._cache.delete(i)
        }
        ),
        n.keys.forEach(i => {
            this._cacheMap.delete(i)
        }
        )
    }
    get parsers() {
        return this._parsers
    }
}
const bt = new _le
  , B_ = [];
$e.handleByList(V.TextureSource, B_);
function ZD(t={}) {
    const e = t && t.resource
      , n = e ? t.resource : t
      , r = e ? t : {
        resource: t
    };
    for (let i = 0; i < B_.length; i++) {
        const o = B_[i];
        if (o.test(n))
            return new o(r)
    }
    throw new Error(`Could not find a source type for resource: ${r.resource}`)
}
function xle(t={}, e=!1) {
    const n = t && t.resource
      , r = n ? t.resource : t
      , i = n ? t : {
        resource: t
    };
    if (!e && bt.has(r))
        return bt.get(r);
    const o = new Ae({
        source: ZD(i)
    });
    return o.on("destroy", () => {
        bt.has(r) && bt.remove(r)
    }
    ),
    e || bt.set(r, o),
    o
}
function ble(t, e=!1) {
    return typeof t == "string" ? bt.get(t) : t instanceof Cn ? new Ae({
        source: t
    }) : xle(t, e)
}
Ae.from = ble;
Cn.from = ZD;
$e.add(jD, WD, YD, Pf, yl, lo, Ww);
var ha = (t => (t[t.Low = 0] = "Low",
t[t.Normal = 1] = "Normal",
t[t.High = 2] = "High",
t))(ha || {});
function bi(t) {
    if (typeof t != "string")
        throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)
}
function Hu(t) {
    return t.split("?")[0].split("#")[0]
}
function wle(t) {
    return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
}
function Ele(t, e, n) {
    return t.replace(new RegExp(wle(e),"g"), n)
}
function Sle(t, e) {
    let n = ""
      , r = 0
      , i = -1
      , o = 0
      , s = -1;
    for (let a = 0; a <= t.length; ++a) {
        if (a < t.length)
            s = t.charCodeAt(a);
        else {
            if (s === 47)
                break;
            s = 47
        }
        if (s === 47) {
            if (!(i === a - 1 || o === 1))
                if (i !== a - 1 && o === 2) {
                    if (n.length < 2 || r !== 2 || n.charCodeAt(n.length - 1) !== 46 || n.charCodeAt(n.length - 2) !== 46) {
                        if (n.length > 2) {
                            const l = n.lastIndexOf("/");
                            if (l !== n.length - 1) {
                                l === -1 ? (n = "",
                                r = 0) : (n = n.slice(0, l),
                                r = n.length - 1 - n.lastIndexOf("/")),
                                i = a,
                                o = 0;
                                continue
                            }
                        } else if (n.length === 2 || n.length === 1) {
                            n = "",
                            r = 0,
                            i = a,
                            o = 0;
                            continue
                        }
                    }
                    e && (n.length > 0 ? n += "/.." : n = "..",
                    r = 2)
                } else
                    n.length > 0 ? n += `/${t.slice(i + 1, a)}` : n = t.slice(i + 1, a),
                    r = a - i - 1;
            i = a,
            o = 0
        } else
            s === 46 && o !== -1 ? ++o : o = -1
    }
    return n
}
const Pr = {
    toPosix(t) {
        return Ele(t, "\\", "/")
    },
    isUrl(t) {
        return /^https?:/.test(this.toPosix(t))
    },
    isDataUrl(t) {
        return /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)
    },
    isBlobUrl(t) {
        return t.startsWith("blob:")
    },
    hasProtocol(t) {
        return /^[^/:]+:/.test(this.toPosix(t))
    },
    getProtocol(t) {
        bi(t),
        t = this.toPosix(t);
        const e = /^file:\/\/\//.exec(t);
        if (e)
            return e[0];
        const n = /^[^/:]+:\/{0,2}/.exec(t);
        return n ? n[0] : ""
    },
    toAbsolute(t, e, n) {
        if (bi(t),
        this.isDataUrl(t) || this.isBlobUrl(t))
            return t;
        const r = Hu(this.toPosix(e ?? je.get().getBaseUrl()))
          , i = Hu(this.toPosix(n ?? this.rootname(r)));
        return t = this.toPosix(t),
        t.startsWith("/") ? Pr.join(i, t.slice(1)) : this.isAbsolute(t) ? t : this.join(r, t)
    },
    normalize(t) {
        if (bi(t),
        t.length === 0)
            return ".";
        if (this.isDataUrl(t) || this.isBlobUrl(t))
            return t;
        t = this.toPosix(t);
        let e = "";
        const n = t.startsWith("/");
        this.hasProtocol(t) && (e = this.rootname(t),
        t = t.slice(e.length));
        const r = t.endsWith("/");
        return t = Sle(t, !1),
        t.length > 0 && r && (t += "/"),
        n ? `/${t}` : e + t
    },
    isAbsolute(t) {
        return bi(t),
        t = this.toPosix(t),
        this.hasProtocol(t) ? !0 : t.startsWith("/")
    },
    join(...t) {
        if (t.length === 0)
            return ".";
        let e;
        for (let n = 0; n < t.length; ++n) {
            const r = t[n];
            if (bi(r),
            r.length > 0)
                if (e === void 0)
                    e = r;
                else {
                    const i = t[n - 1] ?? "";
                    this.joinExtensions.includes(this.extname(i).toLowerCase()) ? e += `/../${r}` : e += `/${r}`
                }
        }
        return e === void 0 ? "." : this.normalize(e)
    },
    dirname(t) {
        if (bi(t),
        t.length === 0)
            return ".";
        t = this.toPosix(t);
        let e = t.charCodeAt(0);
        const n = e === 47;
        let r = -1
          , i = !0;
        const o = this.getProtocol(t)
          , s = t;
        t = t.slice(o.length);
        for (let a = t.length - 1; a >= 1; --a)
            if (e = t.charCodeAt(a),
            e === 47) {
                if (!i) {
                    r = a;
                    break
                }
            } else
                i = !1;
        return r === -1 ? n ? "/" : this.isUrl(s) ? o + t : o : n && r === 1 ? "//" : o + t.slice(0, r)
    },
    rootname(t) {
        bi(t),
        t = this.toPosix(t);
        let e = "";
        if (t.startsWith("/") ? e = "/" : e = this.getProtocol(t),
        this.isUrl(t)) {
            const n = t.indexOf("/", e.length);
            n !== -1 ? e = t.slice(0, n) : e = t,
            e.endsWith("/") || (e += "/")
        }
        return e
    },
    basename(t, e) {
        bi(t),
        e && bi(e),
        t = Hu(this.toPosix(t));
        let n = 0, r = -1, i = !0, o;
        if (e !== void 0 && e.length > 0 && e.length <= t.length) {
            if (e.length === t.length && e === t)
                return "";
            let s = e.length - 1
              , a = -1;
            for (o = t.length - 1; o >= 0; --o) {
                const l = t.charCodeAt(o);
                if (l === 47) {
                    if (!i) {
                        n = o + 1;
                        break
                    }
                } else
                    a === -1 && (i = !1,
                    a = o + 1),
                    s >= 0 && (l === e.charCodeAt(s) ? --s === -1 && (r = o) : (s = -1,
                    r = a))
            }
            return n === r ? r = a : r === -1 && (r = t.length),
            t.slice(n, r)
        }
        for (o = t.length - 1; o >= 0; --o)
            if (t.charCodeAt(o) === 47) {
                if (!i) {
                    n = o + 1;
                    break
                }
            } else
                r === -1 && (i = !1,
                r = o + 1);
        return r === -1 ? "" : t.slice(n, r)
    },
    extname(t) {
        bi(t),
        t = Hu(this.toPosix(t));
        let e = -1
          , n = 0
          , r = -1
          , i = !0
          , o = 0;
        for (let s = t.length - 1; s >= 0; --s) {
            const a = t.charCodeAt(s);
            if (a === 47) {
                if (!i) {
                    n = s + 1;
                    break
                }
                continue
            }
            r === -1 && (i = !1,
            r = s + 1),
            a === 46 ? e === -1 ? e = s : o !== 1 && (o = 1) : e !== -1 && (o = -1)
        }
        return e === -1 || r === -1 || o === 0 || o === 1 && e === r - 1 && e === n + 1 ? "" : t.slice(e, r)
    },
    parse(t) {
        bi(t);
        const e = {
            root: "",
            dir: "",
            base: "",
            ext: "",
            name: ""
        };
        if (t.length === 0)
            return e;
        t = Hu(this.toPosix(t));
        let n = t.charCodeAt(0);
        const r = this.isAbsolute(t);
        let i;
        e.root = this.rootname(t),
        r || this.hasProtocol(t) ? i = 1 : i = 0;
        let o = -1
          , s = 0
          , a = -1
          , l = !0
          , c = t.length - 1
          , u = 0;
        for (; c >= i; --c) {
            if (n = t.charCodeAt(c),
            n === 47) {
                if (!l) {
                    s = c + 1;
                    break
                }
                continue
            }
            a === -1 && (l = !1,
            a = c + 1),
            n === 46 ? o === -1 ? o = c : u !== 1 && (u = 1) : o !== -1 && (u = -1)
        }
        return o === -1 || a === -1 || u === 0 || u === 1 && o === a - 1 && o === s + 1 ? a !== -1 && (s === 0 && r ? e.base = e.name = t.slice(1, a) : e.base = e.name = t.slice(s, a)) : (s === 0 && r ? (e.name = t.slice(1, o),
        e.base = t.slice(1, a)) : (e.name = t.slice(s, o),
        e.base = t.slice(s, a)),
        e.ext = t.slice(o, a)),
        e.dir = this.dirname(t),
        e
    },
    sep: "/",
    delimiter: ":",
    joinExtensions: [".html"]
};
function JD(t, e, n, r, i) {
    const o = e[n];
    for (let s = 0; s < o.length; s++) {
        const a = o[s];
        n < e.length - 1 ? JD(t.replace(r[n], a), e, n + 1, r, i) : i.push(t.replace(r[n], a))
    }
}
function Cle(t) {
    const e = /\{(.*?)\}/g
      , n = t.match(e)
      , r = [];
    if (n) {
        const i = [];
        n.forEach(o => {
            const s = o.substring(1, o.length - 1).split(",");
            i.push(s)
        }
        ),
        JD(t, i, 0, n, r)
    } else
        r.push(t);
    return r
}
const E0 = t => !Array.isArray(t);
class xu {
    constructor() {
        this._defaultBundleIdentifierOptions = {
            connector: "-",
            createBundleAssetId: (e, n) => `${e}${this._bundleIdConnector}${n}`,
            extractAssetIdFromBundle: (e, n) => n.replace(`${e}${this._bundleIdConnector}`, "")
        },
        this._bundleIdConnector = this._defaultBundleIdentifierOptions.connector,
        this._createBundleAssetId = this._defaultBundleIdentifierOptions.createBundleAssetId,
        this._extractAssetIdFromBundle = this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,
        this._assetMap = {},
        this._preferredOrder = [],
        this._parsers = [],
        this._resolverHash = {},
        this._bundles = {}
    }
    setBundleIdentifier(e) {
        if (this._bundleIdConnector = e.connector ?? this._bundleIdConnector,
        this._createBundleAssetId = e.createBundleAssetId ?? this._createBundleAssetId,
        this._extractAssetIdFromBundle = e.extractAssetIdFromBundle ?? this._extractAssetIdFromBundle,
        this._extractAssetIdFromBundle("foo", this._createBundleAssetId("foo", "bar")) !== "bar")
            throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")
    }
    prefer(...e) {
        e.forEach(n => {
            this._preferredOrder.push(n),
            n.priority || (n.priority = Object.keys(n.params))
        }
        ),
        this._resolverHash = {}
    }
    set basePath(e) {
        this._basePath = e
    }
    get basePath() {
        return this._basePath
    }
    set rootPath(e) {
        this._rootPath = e
    }
    get rootPath() {
        return this._rootPath
    }
    get parsers() {
        return this._parsers
    }
    reset() {
        this.setBundleIdentifier(this._defaultBundleIdentifierOptions),
        this._assetMap = {},
        this._preferredOrder = [],
        this._resolverHash = {},
        this._rootPath = null,
        this._basePath = null,
        this._manifest = null,
        this._bundles = {},
        this._defaultSearchParams = null
    }
    setDefaultSearchParams(e) {
        if (typeof e == "string")
            this._defaultSearchParams = e;
        else {
            const n = e;
            this._defaultSearchParams = Object.keys(n).map(r => `${encodeURIComponent(r)}=${encodeURIComponent(n[r])}`).join("&")
        }
    }
    getAlias(e) {
        const {alias: n, src: r} = e;
        return Pi(n || r, o => typeof o == "string" ? o : Array.isArray(o) ? o.map(s => (s == null ? void 0 : s.src) ?? s) : o != null && o.src ? o.src : o, !0)
    }
    addManifest(e) {
        this._manifest && Ne("[Resolver] Manifest already exists, this will be overwritten"),
        this._manifest = e,
        e.bundles.forEach(n => {
            this.addBundle(n.name, n.assets)
        }
        )
    }
    addBundle(e, n) {
        const r = [];
        let i = n;
        Array.isArray(n) || (i = Object.entries(n).map( ([o,s]) => typeof s == "string" || Array.isArray(s) ? {
            alias: o,
            src: s
        } : {
            alias: o,
            ...s
        })),
        i.forEach(o => {
            const s = o.src
              , a = o.alias;
            let l;
            if (typeof a == "string") {
                const c = this._createBundleAssetId(e, a);
                r.push(c),
                l = [a, c]
            } else {
                const c = a.map(u => this._createBundleAssetId(e, u));
                r.push(...c),
                l = [...a, ...c]
            }
            this.add({
                ...o,
                alias: l,
                src: s
            })
        }
        ),
        this._bundles[e] = r
    }
    add(e) {
        const n = [];
        Array.isArray(e) ? n.push(...e) : n.push(e);
        let r;
        r = o => {
            this.hasKey(o) && Ne(`[Resolver] already has key: ${o} overwriting`)
        }
        ,
        Pi(n).forEach(o => {
            const {src: s} = o;
            let {data: a, format: l, loadParser: c, parser: u} = o;
            const f = Pi(s).map(p => typeof p == "string" ? Cle(p) : Array.isArray(p) ? p : [p])
              , d = this.getAlias(o);
            Array.isArray(d) ? d.forEach(r) : r(d);
            const h = [];
            f.forEach(p => {
                p.forEach(y => {
                    let v = {};
                    if (typeof y != "object") {
                        v.src = y;
                        for (let g = 0; g < this._parsers.length; g++) {
                            const m = this._parsers[g];
                            if (m.test(y)) {
                                v = m.parse(y);
                                break
                            }
                        }
                    } else
                        a = y.data ?? a,
                        l = y.format ?? l,
                        (y.loadParser || y.parser) && (c = y.loadParser ?? c,
                        u = y.parser ?? u),
                        v = {
                            ...v,
                            ...y
                        };
                    if (!d)
                        throw new Error(`[Resolver] alias is undefined for this asset: ${v.src}`);
                    v = this._buildResolvedAsset(v, {
                        aliases: d,
                        data: a,
                        format: l,
                        loadParser: c,
                        parser: u
                    }),
                    h.push(v)
                }
                )
            }
            ),
            d.forEach(p => {
                this._assetMap[p] = h
            }
            )
        }
        )
    }
    resolveBundle(e) {
        const n = E0(e);
        e = Pi(e);
        const r = {};
        return e.forEach(i => {
            const o = this._bundles[i];
            if (o) {
                const s = this.resolve(o)
                  , a = {};
                for (const l in s) {
                    const c = s[l];
                    a[this._extractAssetIdFromBundle(i, l)] = c
                }
                r[i] = a
            }
        }
        ),
        n ? r[e[0]] : r
    }
    resolveUrl(e) {
        const n = this.resolve(e);
        if (typeof e != "string") {
            const r = {};
            for (const i in n)
                r[i] = n[i].src;
            return r
        }
        return n.src
    }
    resolve(e) {
        const n = E0(e);
        e = Pi(e);
        const r = {};
        return e.forEach(i => {
            if (!this._resolverHash[i])
                if (this._assetMap[i]) {
                    let o = this._assetMap[i];
                    const s = this._getPreferredOrder(o);
                    s == null || s.priority.forEach(a => {
                        s.params[a].forEach(l => {
                            const c = o.filter(u => u[a] ? u[a] === l : !1);
                            c.length && (o = c)
                        }
                        )
                    }
                    ),
                    this._resolverHash[i] = o[0]
                } else
                    this._resolverHash[i] = this._buildResolvedAsset({
                        alias: [i],
                        src: i
                    }, {});
            r[i] = this._resolverHash[i]
        }
        ),
        n ? r[e[0]] : r
    }
    hasKey(e) {
        return !!this._assetMap[e]
    }
    hasBundle(e) {
        return !!this._bundles[e]
    }
    _getPreferredOrder(e) {
        for (let n = 0; n < e.length; n++) {
            const r = e[n]
              , i = this._preferredOrder.find(o => o.params.format.includes(r.format));
            if (i)
                return i
        }
        return this._preferredOrder[0]
    }
    _appendDefaultSearchParams(e) {
        if (!this._defaultSearchParams)
            return e;
        const n = /\?/.test(e) ? "&" : "?";
        return `${e}${n}${this._defaultSearchParams}`
    }
    _buildResolvedAsset(e, n) {
        const {aliases: r, data: i, loadParser: o, parser: s, format: a} = n;
        return (this._basePath || this._rootPath) && (e.src = Pr.toAbsolute(e.src, this._basePath, this._rootPath)),
        e.alias = r ?? e.alias ?? [e.src],
        e.src = this._appendDefaultSearchParams(e.src),
        e.data = {
            ...i || {},
            ...e.data
        },
        e.loadParser = o ?? e.loadParser,
        e.parser = s ?? e.parser,
        e.format = a ?? e.format ?? Ale(e.src),
        e
    }
}
xu.RETINA_PREFIX = /@([0-9\.]+)x/;
function Ale(t) {
    return t.split(".").pop().split("?").shift().split("#").shift()
}
const k_ = (t, e) => {
    const n = e.split("?")[1];
    return n && (t += `?${n}`),
    t
}
  , QD = class rf {
    constructor(e, n) {
        this.linkedSheets = [];
        let r = e;
        (e == null ? void 0 : e.source)instanceof Cn && (r = {
            texture: e,
            data: n
        });
        const {texture: i, data: o, cachePrefix: s=""} = r;
        this.cachePrefix = s,
        this._texture = i instanceof Ae ? i : null,
        this.textureSource = i.source,
        this.textures = {},
        this.animations = {},
        this.data = o;
        const a = parseFloat(o.meta.scale);
        a ? (this.resolution = a,
        i.source.resolution = this.resolution) : this.resolution = i.source._resolution,
        this._frames = this.data.frames,
        this._frameKeys = Object.keys(this._frames),
        this._batchIndex = 0,
        this._callback = null
    }
    parse() {
        return new Promise(e => {
            this._callback = e,
            this._batchIndex = 0,
            this._frameKeys.length <= rf.BATCH_SIZE ? (this._processFrames(0),
            this._processAnimations(),
            this._parseComplete()) : this._nextBatch()
        }
        )
    }
    _processFrames(e) {
        let n = e;
        const r = rf.BATCH_SIZE;
        for (; n - e < r && n < this._frameKeys.length; ) {
            const i = this._frameKeys[n]
              , o = this._frames[i]
              , s = o.frame;
            if (s) {
                let a = null
                  , l = null;
                const c = o.trimmed !== !1 && o.sourceSize ? o.sourceSize : o.frame
                  , u = new vt(0,0,Math.floor(c.w) / this.resolution,Math.floor(c.h) / this.resolution);
                o.rotated ? a = new vt(Math.floor(s.x) / this.resolution,Math.floor(s.y) / this.resolution,Math.floor(s.h) / this.resolution,Math.floor(s.w) / this.resolution) : a = new vt(Math.floor(s.x) / this.resolution,Math.floor(s.y) / this.resolution,Math.floor(s.w) / this.resolution,Math.floor(s.h) / this.resolution),
                o.trimmed !== !1 && o.spriteSourceSize && (l = new vt(Math.floor(o.spriteSourceSize.x) / this.resolution,Math.floor(o.spriteSourceSize.y) / this.resolution,Math.floor(s.w) / this.resolution,Math.floor(s.h) / this.resolution)),
                this.textures[i] = new Ae({
                    source: this.textureSource,
                    frame: a,
                    orig: u,
                    trim: l,
                    rotate: o.rotated ? 2 : 0,
                    defaultAnchor: o.anchor,
                    defaultBorders: o.borders,
                    label: i.toString()
                })
            }
            n++
        }
    }
    _processAnimations() {
        const e = this.data.animations || {};
        for (const n in e) {
            this.animations[n] = [];
            for (let r = 0; r < e[n].length; r++) {
                const i = e[n][r];
                this.animations[n].push(this.textures[i])
            }
        }
    }
    _parseComplete() {
        const e = this._callback;
        this._callback = null,
        this._batchIndex = 0,
        e.call(this, this.textures)
    }
    _nextBatch() {
        this._processFrames(this._batchIndex * rf.BATCH_SIZE),
        this._batchIndex++,
        setTimeout( () => {
            this._batchIndex * rf.BATCH_SIZE < this._frameKeys.length ? this._nextBatch() : (this._processAnimations(),
            this._parseComplete())
        }
        , 0)
    }
    destroy(e=!1) {
        var n;
        for (const r in this.textures)
            this.textures[r].destroy();
        this._frames = null,
        this._frameKeys = null,
        this.data = null,
        this.textures = null,
        e && ((n = this._texture) == null || n.destroy(),
        this.textureSource.destroy()),
        this._texture = null,
        this.textureSource = null,
        this.linkedSheets = []
    }
}
;
QD.BATCH_SIZE = 1e3;
let lT = QD;
const Tle = ["jpg", "png", "jpeg", "avif", "webp", "basis", "etc2", "bc7", "bc6h", "bc5", "bc4", "bc3", "bc2", "bc1", "eac", "astc"];
function eB(t, e, n) {
    const r = {};
    if (t.forEach(i => {
        r[i] = e
    }
    ),
    Object.keys(e.textures).forEach(i => {
        r[`${e.cachePrefix}${i}`] = e.textures[i]
    }
    ),
    !n) {
        const i = Pr.dirname(t[0]);
        e.linkedSheets.forEach( (o, s) => {
            const a = eB([`${i}/${e.data.meta.related_multi_packs[s]}`], o, !0);
            Object.assign(r, a)
        }
        )
    }
    return r
}
const Ple = {
    extension: V.Asset,
    cache: {
        test: t => t instanceof lT,
        getCacheableAssets: (t, e) => eB(t, e, !1)
    },
    resolver: {
        extension: {
            type: V.ResolveParser,
            name: "resolveSpritesheet"
        },
        test: t => {
            const n = t.split("?")[0].split(".")
              , r = n.pop()
              , i = n.pop();
            return r === "json" && Tle.includes(i)
        }
        ,
        parse: t => {
            var n;
            const e = t.split(".");
            return {
                resolution: parseFloat(((n = xu.RETINA_PREFIX.exec(t)) == null ? void 0 : n[1]) ?? "1"),
                format: e[e.length - 2],
                src: t
            }
        }
    },
    loader: {
        name: "spritesheetLoader",
        id: "spritesheet",
        extension: {
            type: V.LoadParser,
            priority: ha.Normal,
            name: "spritesheetLoader"
        },
        async testParse(t, e) {
            return Pr.extname(e.src).toLowerCase() === ".json" && !!t.frames
        },
        async parse(t, e, n) {
            var f, d;
            const {texture: r, imageFilename: i, textureOptions: o, cachePrefix: s} = (e == null ? void 0 : e.data) ?? {};
            let a = Pr.dirname(e.src);
            a && a.lastIndexOf("/") !== a.length - 1 && (a += "/");
            let l;
            if (r instanceof Ae)
                l = r;
            else {
                const h = k_(a + (i ?? t.meta.image), e.src);
                l = (await n.load([{
                    src: h,
                    data: o
                }]))[h]
            }
            const c = new lT({
                texture: l.source,
                data: t,
                cachePrefix: s
            });
            await c.parse();
            const u = (f = t == null ? void 0 : t.meta) == null ? void 0 : f.related_multi_packs;
            if (Array.isArray(u)) {
                const h = [];
                for (const y of u) {
                    if (typeof y != "string")
                        continue;
                    let v = a + y;
                    (d = e.data) != null && d.ignoreMultiPack || (v = k_(v, e.src),
                    h.push(n.load({
                        src: v,
                        data: {
                            textureOptions: o,
                            ignoreMultiPack: !0
                        }
                    })))
                }
                const p = await Promise.all(h);
                c.linkedSheets = p,
                p.forEach(y => {
                    y.linkedSheets = [c].concat(c.linkedSheets.filter(v => v !== y))
                }
                )
            }
            return c
        },
        async unload(t, e, n) {
            await n.unload(t.textureSource._sourceOrigin),
            t.destroy(!1)
        }
    }
};
$e.add(Ple);
class tB {
    constructor(e) {
        this._lastTransform = "",
        this._observer = null,
        this._tickerAttached = !1,
        this.updateTranslation = () => {
            if (!this._canvas)
                return;
            const n = this._canvas.getBoundingClientRect()
              , r = this._canvas.width
              , i = this._canvas.height
              , o = n.width / r * this._renderer.resolution
              , s = n.height / i * this._renderer.resolution
              , a = n.left
              , l = n.top
              , c = `translate(${a}px, ${l}px) scale(${o}, ${s})`;
            c !== this._lastTransform && (this._domElement.style.transform = c,
            this._lastTransform = c)
        }
        ,
        this._domElement = e.domElement,
        this._renderer = e.renderer,
        !(globalThis.OffscreenCanvas && this._renderer.canvas instanceof OffscreenCanvas) && (this._canvas = this._renderer.canvas,
        this._attachObserver())
    }
    get canvas() {
        return this._canvas
    }
    ensureAttached() {
        !this._domElement.parentNode && this._canvas.parentNode && (this._canvas.parentNode.appendChild(this._domElement),
        this.updateTranslation())
    }
    _attachObserver() {
        "ResizeObserver"in globalThis ? (this._observer && (this._observer.disconnect(),
        this._observer = null),
        this._observer = new ResizeObserver(e => {
            for (const n of e) {
                if (n.target !== this._canvas)
                    continue;
                const r = this.canvas.width
                  , i = this.canvas.height
                  , o = n.contentRect.width / r * this._renderer.resolution
                  , s = n.contentRect.height / i * this._renderer.resolution;
                (this._lastScaleX !== o || this._lastScaleY !== s) && (this.updateTranslation(),
                this._lastScaleX = o,
                this._lastScaleY = s)
            }
        }
        ),
        this._observer.observe(this._canvas)) : this._tickerAttached || Un.shared.add(this.updateTranslation, this, _l.HIGH)
    }
    destroy() {
        this._observer ? (this._observer.disconnect(),
        this._observer = null) : this._tickerAttached && Un.shared.remove(this.updateTranslation),
        this._domElement = null,
        this._renderer = null,
        this._canvas = null,
        this._tickerAttached = !1,
        this._lastTransform = "",
        this._lastScaleX = null,
        this._lastScaleY = null
    }
}
class Zd {
    constructor(e) {
        this.bubbles = !0,
        this.cancelBubble = !0,
        this.cancelable = !1,
        this.composed = !1,
        this.defaultPrevented = !1,
        this.eventPhase = Zd.prototype.NONE,
        this.propagationStopped = !1,
        this.propagationImmediatelyStopped = !1,
        this.layer = new Gt,
        this.page = new Gt,
        this.NONE = 0,
        this.CAPTURING_PHASE = 1,
        this.AT_TARGET = 2,
        this.BUBBLING_PHASE = 3,
        this.manager = e
    }
    get layerX() {
        return this.layer.x
    }
    get layerY() {
        return this.layer.y
    }
    get pageX() {
        return this.page.x
    }
    get pageY() {
        return this.page.y
    }
    get data() {
        return this
    }
    composedPath() {
        return this.manager && (!this.path || this.path[this.path.length - 1] !== this.target) && (this.path = this.target ? this.manager.propagationPath(this.target) : []),
        this.path
    }
    initEvent(e, n, r) {
        throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")
    }
    initUIEvent(e, n, r, i, o) {
        throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")
    }
    preventDefault() {
        this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.preventDefault(),
        this.defaultPrevented = !0
    }
    stopImmediatePropagation() {
        this.propagationImmediatelyStopped = !0
    }
    stopPropagation() {
        this.propagationStopped = !0
    }
}
var b1 = /iPhone/i
  , cT = /iPod/i
  , uT = /iPad/i
  , fT = /\biOS-universal(?:.+)Mac\b/i
  , w1 = /\bAndroid(?:.+)Mobile\b/i
  , dT = /Android/i
  , ec = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i
  , Qh = /Silk/i
  , Ro = /Windows Phone/i
  , hT = /\bWindows(?:.+)ARM\b/i
  , pT = /BlackBerry/i
  , gT = /BB10/i
  , mT = /Opera Mini/i
  , vT = /\b(CriOS|Chrome)(?:.+)Mobile/i
  , yT = /Mobile(?:.+)Firefox\b/i
  , _T = function(t) {
    return typeof t < "u" && t.platform === "MacIntel" && typeof t.maxTouchPoints == "number" && t.maxTouchPoints > 1 && typeof MSStream > "u"
};
function Ile(t) {
    return function(e) {
        return e.test(t)
    }
}
function xT(t) {
    var e = {
        userAgent: "",
        platform: "",
        maxTouchPoints: 0
    };
    !t && typeof navigator < "u" ? e = {
        userAgent: navigator.userAgent,
        platform: navigator.platform,
        maxTouchPoints: navigator.maxTouchPoints || 0
    } : typeof t == "string" ? e.userAgent = t : t && t.userAgent && (e = {
        userAgent: t.userAgent,
        platform: t.platform,
        maxTouchPoints: t.maxTouchPoints || 0
    });
    var n = e.userAgent
      , r = n.split("[FBAN");
    typeof r[1] < "u" && (n = r[0]),
    r = n.split("Twitter"),
    typeof r[1] < "u" && (n = r[0]);
    var i = Ile(n)
      , o = {
        apple: {
            phone: i(b1) && !i(Ro),
            ipod: i(cT),
            tablet: !i(b1) && (i(uT) || _T(e)) && !i(Ro),
            universal: i(fT),
            device: (i(b1) || i(cT) || i(uT) || i(fT) || _T(e)) && !i(Ro)
        },
        amazon: {
            phone: i(ec),
            tablet: !i(ec) && i(Qh),
            device: i(ec) || i(Qh)
        },
        android: {
            phone: !i(Ro) && i(ec) || !i(Ro) && i(w1),
            tablet: !i(Ro) && !i(ec) && !i(w1) && (i(Qh) || i(dT)),
            device: !i(Ro) && (i(ec) || i(Qh) || i(w1) || i(dT)) || i(/\bokhttp\b/i)
        },
        windows: {
            phone: i(Ro),
            tablet: i(hT),
            device: i(Ro) || i(hT)
        },
        other: {
            blackberry: i(pT),
            blackberry10: i(gT),
            opera: i(mT),
            firefox: i(yT),
            chrome: i(vT),
            device: i(pT) || i(gT) || i(mT) || i(yT) || i(vT)
        },
        any: !1,
        phone: !1,
        tablet: !1
    };
    return o.any = o.apple.device || o.android.device || o.windows.device || o.other.device,
    o.phone = o.apple.phone || o.android.phone || o.windows.phone,
    o.tablet = o.apple.tablet || o.android.tablet || o.windows.tablet,
    o
}
const Ole = xT.default ?? xT
  , Rle = Ole(globalThis.navigator)
  , Mle = 9
  , bT = 100
  , Dle = 0
  , Ble = 0
  , wT = 2
  , ET = 1
  , kle = -1e3
  , Nle = -1e3
  , Fle = 2
  , Jw = class nB {
    constructor(e, n=Rle) {
        this._mobileInfo = n,
        this.debug = !1,
        this._activateOnTab = !0,
        this._deactivateOnMouseMove = !0,
        this._isActive = !1,
        this._isMobileAccessibility = !1,
        this._div = null,
        this._pool = [],
        this._renderId = 0,
        this._children = [],
        this._androidUpdateCount = 0,
        this._androidUpdateFrequency = 500,
        this._hookDiv = null,
        (n.tablet || n.phone) && this._createTouchHook(),
        this._renderer = e
    }
    get isActive() {
        return this._isActive
    }
    get isMobileAccessibility() {
        return this._isMobileAccessibility
    }
    get hookDiv() {
        return this._hookDiv
    }
    _createTouchHook() {
        const e = document.createElement("button");
        e.style.width = `${ET}px`,
        e.style.height = `${ET}px`,
        e.style.position = "absolute",
        e.style.top = `${kle}px`,
        e.style.left = `${Nle}px`,
        e.style.zIndex = Fle.toString(),
        e.style.backgroundColor = "#FF0000",
        e.title = "select to enable accessibility for this content",
        e.addEventListener("focus", () => {
            this._isMobileAccessibility = !0,
            this._activate(),
            this._destroyTouchHook()
        }
        ),
        document.body.appendChild(e),
        this._hookDiv = e
    }
    _destroyTouchHook() {
        this._hookDiv && (document.body.removeChild(this._hookDiv),
        this._hookDiv = null)
    }
    _activate() {
        if (this._isActive)
            return;
        this._isActive = !0,
        this._div || (this._div = document.createElement("div"),
        this._div.style.position = "absolute",
        this._div.style.top = `${Dle}px`,
        this._div.style.left = `${Ble}px`,
        this._div.style.pointerEvents = "none",
        this._div.style.zIndex = wT.toString(),
        this._canvasObserver = new tB({
            domElement: this._div,
            renderer: this._renderer
        })),
        this._activateOnTab && (this._onKeyDown = this._onKeyDown.bind(this),
        globalThis.addEventListener("keydown", this._onKeyDown, !1)),
        this._deactivateOnMouseMove && (this._onMouseMove = this._onMouseMove.bind(this),
        globalThis.document.addEventListener("mousemove", this._onMouseMove, !0));
        const e = this._renderer.view.canvas;
        if (e.parentNode)
            this._canvasObserver.ensureAttached(),
            this._initAccessibilitySetup();
        else {
            const n = new MutationObserver( () => {
                e.parentNode && (n.disconnect(),
                this._canvasObserver.ensureAttached(),
                this._initAccessibilitySetup())
            }
            );
            n.observe(document.body, {
                childList: !0,
                subtree: !0
            })
        }
    }
    _initAccessibilitySetup() {
        this._renderer.runners.postrender.add(this),
        this._renderer.lastObjectRendered && this._updateAccessibleObjects(this._renderer.lastObjectRendered)
    }
    _deactivate() {
        if (!(!this._isActive || this._isMobileAccessibility)) {
            this._isActive = !1,
            globalThis.document.removeEventListener("mousemove", this._onMouseMove, !0),
            this._activateOnTab && globalThis.addEventListener("keydown", this._onKeyDown, !1),
            this._renderer.runners.postrender.remove(this);
            for (const e of this._children)
                e._accessibleDiv && e._accessibleDiv.parentNode && (e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),
                e._accessibleDiv = null),
                e._accessibleActive = !1;
            this._pool.forEach(e => {
                e.parentNode && e.parentNode.removeChild(e)
            }
            ),
            this._div && this._div.parentNode && this._div.parentNode.removeChild(this._div),
            this._pool = [],
            this._children = []
        }
    }
    _updateAccessibleObjects(e) {
        if (!e.visible || !e.accessibleChildren)
            return;
        e.accessible && (e._accessibleActive || this._addChild(e),
        e._renderId = this._renderId);
        const n = e.children;
        if (n)
            for (let r = 0; r < n.length; r++)
                this._updateAccessibleObjects(n[r])
    }
    init(e) {
        const r = {
            accessibilityOptions: {
                ...nB.defaultOptions,
                ...(e == null ? void 0 : e.accessibilityOptions) || {}
            }
        };
        this.debug = r.accessibilityOptions.debug,
        this._activateOnTab = r.accessibilityOptions.activateOnTab,
        this._deactivateOnMouseMove = r.accessibilityOptions.deactivateOnMouseMove,
        r.accessibilityOptions.enabledByDefault ? this._activate() : this._activateOnTab && (this._onKeyDown = this._onKeyDown.bind(this),
        globalThis.addEventListener("keydown", this._onKeyDown, !1)),
        this._renderer.runners.postrender.remove(this)
    }
    postrender() {
        const e = performance.now();
        if (this._mobileInfo.android.device && e < this._androidUpdateCount || (this._androidUpdateCount = e + this._androidUpdateFrequency,
        !this._renderer.renderingToScreen || !this._renderer.view.canvas))
            return;
        const n = new Set;
        if (this._renderer.lastObjectRendered) {
            this._updateAccessibleObjects(this._renderer.lastObjectRendered);
            for (const r of this._children)
                r._renderId === this._renderId && n.add(this._children.indexOf(r))
        }
        for (let r = this._children.length - 1; r >= 0; r--) {
            const i = this._children[r];
            n.has(r) || (i._accessibleDiv && i._accessibleDiv.parentNode && (i._accessibleDiv.parentNode.removeChild(i._accessibleDiv),
            this._pool.push(i._accessibleDiv),
            i._accessibleDiv = null),
            i._accessibleActive = !1,
            ND(this._children, r, 1))
        }
        this._renderer.renderingToScreen && this._canvasObserver.ensureAttached();
        for (let r = 0; r < this._children.length; r++) {
            const i = this._children[r];
            if (!i._accessibleActive || !i._accessibleDiv)
                continue;
            const o = i._accessibleDiv
              , s = i.hitArea || i.getBounds().rectangle;
            if (i.hitArea) {
                const a = i.worldTransform;
                o.style.left = `${a.tx + s.x * a.a}px`,
                o.style.top = `${a.ty + s.y * a.d}px`,
                o.style.width = `${s.width * a.a}px`,
                o.style.height = `${s.height * a.d}px`
            } else
                this._capHitArea(s),
                o.style.left = `${s.x}px`,
                o.style.top = `${s.y}px`,
                o.style.width = `${s.width}px`,
                o.style.height = `${s.height}px`
        }
        this._renderId++
    }
    _updateDebugHTML(e) {
        e.innerHTML = `type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`
    }
    _capHitArea(e) {
        e.x < 0 && (e.width += e.x,
        e.x = 0),
        e.y < 0 && (e.height += e.y,
        e.y = 0);
        const {width: n, height: r} = this._renderer;
        e.x + e.width > n && (e.width = n - e.x),
        e.y + e.height > r && (e.height = r - e.y)
    }
    _addChild(e) {
        let n = this._pool.pop();
        n || (e.accessibleType === "button" ? n = document.createElement("button") : (n = document.createElement(e.accessibleType),
        n.style.cssText = `
                        color: transparent;
                        pointer-events: none;
                        padding: 0;
                        margin: 0;
                        border: 0;
                        outline: 0;
                        background: transparent;
                        box-sizing: border-box;
                        user-select: none;
                        -webkit-user-select: none;
                        -moz-user-select: none;
                        -ms-user-select: none;
                    `,
        e.accessibleText && (n.innerText = e.accessibleText)),
        n.style.width = `${bT}px`,
        n.style.height = `${bT}px`,
        n.style.backgroundColor = this.debug ? "rgba(255,255,255,0.5)" : "transparent",
        n.style.position = "absolute",
        n.style.zIndex = wT.toString(),
        n.style.borderStyle = "none",
        navigator.userAgent.toLowerCase().includes("chrome") ? n.setAttribute("aria-live", "off") : n.setAttribute("aria-live", "polite"),
        navigator.userAgent.match(/rv:.*Gecko\//) ? n.setAttribute("aria-relevant", "additions") : n.setAttribute("aria-relevant", "text"),
        n.addEventListener("click", this._onClick.bind(this)),
        n.addEventListener("focus", this._onFocus.bind(this)),
        n.addEventListener("focusout", this._onFocusOut.bind(this))),
        n.style.pointerEvents = e.accessiblePointerEvents,
        n.type = e.accessibleType,
        e.accessibleTitle && e.accessibleTitle !== null ? n.title = e.accessibleTitle : (!e.accessibleHint || e.accessibleHint === null) && (n.title = `container ${e.tabIndex}`),
        e.accessibleHint && e.accessibleHint !== null && n.setAttribute("aria-label", e.accessibleHint),
        this.debug && this._updateDebugHTML(n),
        e._accessibleActive = !0,
        e._accessibleDiv = n,
        n.container = e,
        this._children.push(e),
        this._div.appendChild(e._accessibleDiv),
        e.interactive && (e._accessibleDiv.tabIndex = e.tabIndex)
    }
    _dispatchEvent(e, n) {
        const {container: r} = e.target
          , i = this._renderer.events.rootBoundary
          , o = Object.assign(new Zd(i), {
            target: r
        });
        i.rootTarget = this._renderer.lastObjectRendered,
        n.forEach(s => i.dispatchEvent(o, s))
    }
    _onClick(e) {
        this._dispatchEvent(e, ["click", "pointertap", "tap"])
    }
    _onFocus(e) {
        e.target.getAttribute("aria-live") || e.target.setAttribute("aria-live", "assertive"),
        this._dispatchEvent(e, ["mouseover"])
    }
    _onFocusOut(e) {
        e.target.getAttribute("aria-live") || e.target.setAttribute("aria-live", "polite"),
        this._dispatchEvent(e, ["mouseout"])
    }
    _onKeyDown(e) {
        e.keyCode !== Mle || !this._activateOnTab || this._activate()
    }
    _onMouseMove(e) {
        e.movementX === 0 && e.movementY === 0 || this._deactivate()
    }
    destroy() {
        var e;
        this._deactivate(),
        this._destroyTouchHook(),
        (e = this._canvasObserver) == null || e.destroy(),
        this._canvasObserver = null,
        this._div = null,
        this._pool = null,
        this._children = null,
        this._renderer = null,
        this._activateOnTab && globalThis.removeEventListener("keydown", this._onKeyDown)
    }
    setAccessibilityEnabled(e) {
        e ? this._activate() : this._deactivate()
    }
}
;
Jw.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem],
    name: "accessibility"
};
Jw.defaultOptions = {
    enabledByDefault: !1,
    debug: !1,
    activateOnTab: !0,
    deactivateOnMouseMove: !0
};
let Lle = Jw;
const $le = {
    accessible: !1,
    accessibleTitle: null,
    accessibleHint: null,
    tabIndex: 0,
    accessibleType: "button",
    accessibleText: null,
    accessiblePointerEvents: "auto",
    accessibleChildren: !0,
    _accessibleActive: !1,
    _accessibleDiv: null,
    _renderId: -1
}
  , E1 = Object.create(null)
  , ST = Object.create(null);
function fd(t, e) {
    let n = ST[t];
    return n === void 0 && (E1[e] === void 0 && (E1[e] = 1),
    ST[t] = n = E1[e]++),
    n
}
let tc;
function rB() {
    return (!tc || tc != null && tc.isContextLost()) && (tc = je.get().createCanvas().getContext("webgl", {})),
    tc
}
let ep;
function Ule() {
    if (!ep) {
        ep = "mediump";
        const t = rB();
        t && t.getShaderPrecisionFormat && (ep = t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision ? "highp" : "mediump")
    }
    return ep
}
function Gle(t, e, n) {
    return e ? t : n ? (t = t.replace("out vec4 finalColor;", ""),
    `

        #ifdef GL_ES // This checks if it is WebGL1
        #define in varying
        #define finalColor gl_FragColor
        #define texture texture2D
        #endif
        ${t}
        `) : `

        #ifdef GL_ES // This checks if it is WebGL1
        #define in attribute
        #define out varying
        #endif
        ${t}
        `
}
function Hle(t, e, n) {
    const r = n ? e.maxSupportedFragmentPrecision : e.maxSupportedVertexPrecision;
    if (t.substring(0, 9) !== "precision") {
        let i = n ? e.requestedFragmentPrecision : e.requestedVertexPrecision;
        return i === "highp" && r !== "highp" && (i = "mediump"),
        `precision ${i} float;
${t}`
    } else if (r !== "highp" && t.substring(0, 15) === "precision highp")
        return t.replace("precision highp", "precision mediump");
    return t
}
function Vle(t, e) {
    return e ? `#version 300 es
${t}` : t
}
const zle = {}
  , jle = {};
function Wle(t, {name: e="pixi-program"}, n=!0) {
    e = e.replace(/\s+/g, "-"),
    e += n ? "-fragment" : "-vertex";
    const r = n ? zle : jle;
    return r[e] ? (r[e]++,
    e += `-${r[e]}`) : r[e] = 1,
    t.indexOf("#define SHADER_NAME") !== -1 ? t : `${`#define SHADER_NAME ${e}`}
${t}`
}
function Yle(t, e) {
    return e ? t.replace("#version 300 es", "") : t
}
const S1 = {
    stripVersion: Yle,
    ensurePrecision: Hle,
    addProgramDefines: Gle,
    setProgramName: Wle,
    insertVersion: Vle
}
  , C1 = Object.create(null)
  , iB = class N_ {
    constructor(e) {
        e = {
            ...N_.defaultOptions,
            ...e
        };
        const n = e.fragment.indexOf("#version 300 es") !== -1
          , r = {
            stripVersion: n,
            ensurePrecision: {
                requestedFragmentPrecision: e.preferredFragmentPrecision,
                requestedVertexPrecision: e.preferredVertexPrecision,
                maxSupportedVertexPrecision: "highp",
                maxSupportedFragmentPrecision: Ule()
            },
            setProgramName: {
                name: e.name
            },
            addProgramDefines: n,
            insertVersion: n
        };
        let i = e.fragment
          , o = e.vertex;
        Object.keys(S1).forEach(s => {
            const a = r[s];
            i = S1[s](i, a, !0),
            o = S1[s](o, a, !1)
        }
        ),
        this.fragment = i,
        this.vertex = o,
        this.transformFeedbackVaryings = e.transformFeedbackVaryings,
        this._key = fd(`${this.vertex}:${this.fragment}`, "gl-program")
    }
    destroy() {
        this.fragment = null,
        this.vertex = null,
        this._attributeData = null,
        this._uniformData = null,
        this._uniformBlockData = null,
        this.transformFeedbackVaryings = null
    }
    static from(e) {
        const n = `${e.vertex}:${e.fragment}`;
        return C1[n] || (C1[n] = new N_(e)),
        C1[n]
    }
}
;
iB.defaultOptions = {
    preferredVertexPrecision: "highp",
    preferredFragmentPrecision: "mediump"
};
let Fl = iB;
const CT = {
    uint8x2: {
        size: 2,
        stride: 2,
        normalised: !1
    },
    uint8x4: {
        size: 4,
        stride: 4,
        normalised: !1
    },
    sint8x2: {
        size: 2,
        stride: 2,
        normalised: !1
    },
    sint8x4: {
        size: 4,
        stride: 4,
        normalised: !1
    },
    unorm8x2: {
        size: 2,
        stride: 2,
        normalised: !0
    },
    unorm8x4: {
        size: 4,
        stride: 4,
        normalised: !0
    },
    snorm8x2: {
        size: 2,
        stride: 2,
        normalised: !0
    },
    snorm8x4: {
        size: 4,
        stride: 4,
        normalised: !0
    },
    uint16x2: {
        size: 2,
        stride: 4,
        normalised: !1
    },
    uint16x4: {
        size: 4,
        stride: 8,
        normalised: !1
    },
    sint16x2: {
        size: 2,
        stride: 4,
        normalised: !1
    },
    sint16x4: {
        size: 4,
        stride: 8,
        normalised: !1
    },
    unorm16x2: {
        size: 2,
        stride: 4,
        normalised: !0
    },
    unorm16x4: {
        size: 4,
        stride: 8,
        normalised: !0
    },
    snorm16x2: {
        size: 2,
        stride: 4,
        normalised: !0
    },
    snorm16x4: {
        size: 4,
        stride: 8,
        normalised: !0
    },
    float16x2: {
        size: 2,
        stride: 4,
        normalised: !1
    },
    float16x4: {
        size: 4,
        stride: 8,
        normalised: !1
    },
    float32: {
        size: 1,
        stride: 4,
        normalised: !1
    },
    float32x2: {
        size: 2,
        stride: 8,
        normalised: !1
    },
    float32x3: {
        size: 3,
        stride: 12,
        normalised: !1
    },
    float32x4: {
        size: 4,
        stride: 16,
        normalised: !1
    },
    uint32: {
        size: 1,
        stride: 4,
        normalised: !1
    },
    uint32x2: {
        size: 2,
        stride: 8,
        normalised: !1
    },
    uint32x3: {
        size: 3,
        stride: 12,
        normalised: !1
    },
    uint32x4: {
        size: 4,
        stride: 16,
        normalised: !1
    },
    sint32: {
        size: 1,
        stride: 4,
        normalised: !1
    },
    sint32x2: {
        size: 2,
        stride: 8,
        normalised: !1
    },
    sint32x3: {
        size: 3,
        stride: 12,
        normalised: !1
    },
    sint32x4: {
        size: 4,
        stride: 16,
        normalised: !1
    }
};
function oa(t) {
    return CT[t] ?? CT.float32
}
const Xle = {
    f32: "float32",
    "vec2<f32>": "float32x2",
    "vec3<f32>": "float32x3",
    "vec4<f32>": "float32x4",
    vec2f: "float32x2",
    vec3f: "float32x3",
    vec4f: "float32x4",
    i32: "sint32",
    "vec2<i32>": "sint32x2",
    "vec3<i32>": "sint32x3",
    "vec4<i32>": "sint32x4",
    u32: "uint32",
    "vec2<u32>": "uint32x2",
    "vec3<u32>": "uint32x3",
    "vec4<u32>": "uint32x4",
    bool: "uint32",
    "vec2<bool>": "uint32x2",
    "vec3<bool>": "uint32x3",
    "vec4<bool>": "uint32x4"
};
function Kle({source: t, entryPoint: e}) {
    const n = {}
      , r = t.indexOf(`fn ${e}`);
    if (r !== -1) {
        const i = t.indexOf("->", r);
        if (i !== -1) {
            const o = t.substring(r, i)
              , s = /@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;
            let a;
            for (; (a = s.exec(o)) !== null; ) {
                const l = Xle[a[3]] ?? "float32";
                n[a[2]] = {
                    location: parseInt(a[1], 10),
                    format: l,
                    stride: oa(l).stride,
                    offset: 0,
                    instance: !1,
                    start: 0
                }
            }
        }
    }
    return n
}
function A1(t) {
    var f, d;
    const e = /(^|[^/])@(group|binding)\(\d+\)[^;]+;/g
      , n = /@group\((\d+)\)/
      , r = /@binding\((\d+)\)/
      , i = /var(<[^>]+>)? (\w+)/
      , o = /:\s*(\w+)/
      , s = /struct\s+(\w+)\s*{([^}]+)}/g
      , a = /(\w+)\s*:\s*([\w\<\>]+)/g
      , l = /struct\s+(\w+)/
      , c = (f = t.match(e)) == null ? void 0 : f.map(h => ({
        group: parseInt(h.match(n)[1], 10),
        binding: parseInt(h.match(r)[1], 10),
        name: h.match(i)[2],
        isUniform: h.match(i)[1] === "<uniform>",
        type: h.match(o)[1]
    }));
    if (!c)
        return {
            groups: [],
            structs: []
        };
    const u = ((d = t.match(s)) == null ? void 0 : d.map(h => {
        const p = h.match(l)[1]
          , y = h.match(a).reduce( (v, g) => {
            const [m,_] = g.split(":");
            return v[m.trim()] = _.trim(),
            v
        }
        , {});
        return y ? {
            name: p,
            members: y
        } : null
    }
    ).filter( ({name: h}) => c.some(p => p.type === h))) ?? [];
    return {
        groups: c,
        structs: u
    }
}
var of = (t => (t[t.VERTEX = 1] = "VERTEX",
t[t.FRAGMENT = 2] = "FRAGMENT",
t[t.COMPUTE = 4] = "COMPUTE",
t))(of || {});
function qle({groups: t}) {
    const e = [];
    for (let n = 0; n < t.length; n++) {
        const r = t[n];
        e[r.group] || (e[r.group] = []),
        r.isUniform ? e[r.group].push({
            binding: r.binding,
            visibility: of.VERTEX | of.FRAGMENT,
            buffer: {
                type: "uniform"
            }
        }) : r.type === "sampler" ? e[r.group].push({
            binding: r.binding,
            visibility: of.FRAGMENT,
            sampler: {
                type: "filtering"
            }
        }) : r.type === "texture_2d" && e[r.group].push({
            binding: r.binding,
            visibility: of.FRAGMENT,
            texture: {
                sampleType: "float",
                viewDimension: "2d",
                multisampled: !1
            }
        })
    }
    return e
}
function Zle({groups: t}) {
    const e = [];
    for (let n = 0; n < t.length; n++) {
        const r = t[n];
        e[r.group] || (e[r.group] = {}),
        e[r.group][r.name] = r.binding
    }
    return e
}
function Jle(t, e) {
    const n = new Set
      , r = new Set
      , i = [...t.structs, ...e.structs].filter(s => n.has(s.name) ? !1 : (n.add(s.name),
    !0))
      , o = [...t.groups, ...e.groups].filter(s => {
        const a = `${s.name}-${s.binding}`;
        return r.has(a) ? !1 : (r.add(a),
        !0)
    }
    );
    return {
        structs: i,
        groups: o
    }
}
const T1 = Object.create(null);
class pa {
    constructor(e) {
        var a, l;
        this._layoutKey = 0,
        this._attributeLocationsKey = 0;
        const {fragment: n, vertex: r, layout: i, gpuLayout: o, name: s} = e;
        if (this.name = s,
        this.fragment = n,
        this.vertex = r,
        n.source === r.source) {
            const c = A1(n.source);
            this.structsAndGroups = c
        } else {
            const c = A1(r.source)
              , u = A1(n.source);
            this.structsAndGroups = Jle(c, u)
        }
        this.layout = i ?? Zle(this.structsAndGroups),
        this.gpuLayout = o ?? qle(this.structsAndGroups),
        this.autoAssignGlobalUniforms = ((a = this.layout[0]) == null ? void 0 : a.globalUniforms) !== void 0,
        this.autoAssignLocalUniforms = ((l = this.layout[1]) == null ? void 0 : l.localUniforms) !== void 0,
        this._generateProgramKey()
    }
    _generateProgramKey() {
        const {vertex: e, fragment: n} = this
          , r = e.source + n.source + e.entryPoint + n.entryPoint;
        this._layoutKey = fd(r, "program")
    }
    get attributeData() {
        return this._attributeData ?? (this._attributeData = Kle(this.vertex)),
        this._attributeData
    }
    destroy() {
        this.gpuLayout = null,
        this.layout = null,
        this.structsAndGroups = null,
        this.fragment = null,
        this.vertex = null
    }
    static from(e) {
        const n = `${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;
        return T1[n] || (T1[n] = new pa(e)),
        T1[n]
    }
}
const oB = ["f32", "i32", "vec2<f32>", "vec3<f32>", "vec4<f32>", "mat2x2<f32>", "mat3x3<f32>", "mat4x4<f32>", "mat3x2<f32>", "mat4x2<f32>", "mat2x3<f32>", "mat4x3<f32>", "mat2x4<f32>", "mat3x4<f32>", "vec2<i32>", "vec3<i32>", "vec4<i32>"]
  , Qle = oB.reduce( (t, e) => (t[e] = !0,
t), {});
function ece(t, e) {
    switch (t) {
    case "f32":
        return 0;
    case "vec2<f32>":
        return new Float32Array(2 * e);
    case "vec3<f32>":
        return new Float32Array(3 * e);
    case "vec4<f32>":
        return new Float32Array(4 * e);
    case "mat2x2<f32>":
        return new Float32Array([1, 0, 0, 1]);
    case "mat3x3<f32>":
        return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);
    case "mat4x4<f32>":
        return new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
    }
    return null
}
const sB = class aB {
    constructor(e, n) {
        this._touched = 0,
        this.uid = Ut("uniform"),
        this._resourceType = "uniformGroup",
        this._resourceId = Ut("resource"),
        this.isUniformGroup = !0,
        this._dirtyId = 0,
        this.destroyed = !1,
        n = {
            ...aB.defaultOptions,
            ...n
        },
        this.uniformStructures = e;
        const r = {};
        for (const i in e) {
            const o = e[i];
            if (o.name = i,
            o.size = o.size ?? 1,
            !Qle[o.type])
                throw new Error(`Uniform type ${o.type} is not supported. Supported uniform types are: ${oB.join(", ")}`);
            o.value ?? (o.value = ece(o.type, o.size)),
            r[i] = o.value
        }
        this.uniforms = r,
        this._dirtyId = 1,
        this.ubo = n.ubo,
        this.isStatic = n.isStatic,
        this._signature = fd(Object.keys(r).map(i => `${i}-${e[i].type}`).join("-"), "uniform-group")
    }
    update() {
        this._dirtyId++
    }
}
;
sB.defaultOptions = {
    ubo: !1,
    isStatic: !1
};
let gr = sB;
class Ko {
    constructor(e) {
        this.resources = Object.create(null),
        this._dirty = !0;
        let n = 0;
        for (const r in e) {
            const i = e[r];
            this.setResource(i, n++)
        }
        this._updateKey()
    }
    _updateKey() {
        if (!this._dirty)
            return;
        this._dirty = !1;
        const e = [];
        let n = 0;
        for (const r in this.resources)
            e[n++] = this.resources[r]._resourceId;
        this._key = e.join("|")
    }
    setResource(e, n) {
        var i, o;
        const r = this.resources[n];
        e !== r && (r && ((i = e.off) == null || i.call(e, "change", this.onResourceChange, this)),
        (o = e.on) == null || o.call(e, "change", this.onResourceChange, this),
        this.resources[n] = e,
        this._dirty = !0)
    }
    getResource(e) {
        return this.resources[e]
    }
    _touch(e) {
        const n = this.resources;
        for (const r in n)
            n[r]._touched = e
    }
    destroy() {
        var n;
        const e = this.resources;
        for (const r in e) {
            const i = e[r];
            (n = i.off) == null || n.call(i, "change", this.onResourceChange, this)
        }
        this.resources = null
    }
    onResourceChange(e) {
        if (this._dirty = !0,
        e.destroyed) {
            const n = this.resources;
            for (const r in n)
                n[r] === e && (n[r] = null)
        } else
            this._updateKey()
    }
}
var Kr = (t => (t[t.WEBGL = 1] = "WEBGL",
t[t.WEBGPU = 2] = "WEBGPU",
t[t.BOTH = 3] = "BOTH",
t))(Kr || {});
class yi extends Jr {
    constructor(e) {
        super(),
        this.uid = Ut("shader"),
        this._uniformBindMap = Object.create(null),
        this._ownedBindGroups = [];
        let {gpuProgram: n, glProgram: r, groups: i, resources: o, compatibleRenderers: s, groupMap: a} = e;
        this.gpuProgram = n,
        this.glProgram = r,
        s === void 0 && (s = 0,
        n && (s |= Kr.WEBGPU),
        r && (s |= Kr.WEBGL)),
        this.compatibleRenderers = s;
        const l = {};
        if (!o && !i && (o = {}),
        o && i)
            throw new Error("[Shader] Cannot have both resources and groups");
        if (!n && i && !a)
            throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");
        if (!n && i && a)
            for (const c in a)
                for (const u in a[c]) {
                    const f = a[c][u];
                    l[f] = {
                        group: c,
                        binding: u,
                        name: f
                    }
                }
        else if (n && i && !a) {
            const c = n.structsAndGroups.groups;
            a = {},
            c.forEach(u => {
                a[u.group] = a[u.group] || {},
                a[u.group][u.binding] = u.name,
                l[u.name] = u
            }
            )
        } else if (o) {
            i = {},
            a = {},
            n && n.structsAndGroups.groups.forEach(f => {
                a[f.group] = a[f.group] || {},
                a[f.group][f.binding] = f.name,
                l[f.name] = f
            }
            );
            let c = 0;
            for (const u in o)
                l[u] || (i[99] || (i[99] = new Ko,
                this._ownedBindGroups.push(i[99])),
                l[u] = {
                    group: 99,
                    binding: c,
                    name: u
                },
                a[99] = a[99] || {},
                a[99][c] = u,
                c++);
            for (const u in o) {
                const f = u;
                let d = o[u];
                !d.source && !d._resourceType && (d = new gr(d));
                const h = l[f];
                h && (i[h.group] || (i[h.group] = new Ko,
                this._ownedBindGroups.push(i[h.group])),
                i[h.group].setResource(d, h.binding))
            }
        }
        this.groups = i,
        this._uniformBindMap = a,
        this.resources = this._buildResourceAccessor(i, l)
    }
    addResource(e, n, r) {
        var i, o;
        (i = this._uniformBindMap)[n] || (i[n] = {}),
        (o = this._uniformBindMap[n])[r] || (o[r] = e),
        this.groups[n] || (this.groups[n] = new Ko,
        this._ownedBindGroups.push(this.groups[n]))
    }
    _buildResourceAccessor(e, n) {
        const r = {};
        for (const i in n) {
            const o = n[i];
            Object.defineProperty(r, o.name, {
                get() {
                    return e[o.group].getResource(o.binding)
                },
                set(s) {
                    e[o.group].setResource(s, o.binding)
                }
            })
        }
        return r
    }
    destroy(e=!1) {
        var n, r;
        this.emit("destroy", this),
        e && ((n = this.gpuProgram) == null || n.destroy(),
        (r = this.glProgram) == null || r.destroy()),
        this.gpuProgram = null,
        this.glProgram = null,
        this.removeAllListeners(),
        this._uniformBindMap = null,
        this._ownedBindGroups.forEach(i => {
            i.destroy()
        }
        ),
        this._ownedBindGroups = null,
        this.resources = null,
        this.groups = null
    }
    static from(e) {
        const {gpu: n, gl: r, ...i} = e;
        let o, s;
        return n && (o = pa.from(n)),
        r && (s = Fl.from(r)),
        new yi({
            gpuProgram: o,
            glProgram: s,
            ...i
        })
    }
}
const tce = {
    normal: 0,
    add: 1,
    multiply: 2,
    screen: 3,
    overlay: 4,
    erase: 5,
    "normal-npm": 6,
    "add-npm": 7,
    "screen-npm": 8,
    min: 9,
    max: 10
}
  , P1 = 0
  , I1 = 1
  , O1 = 2
  , R1 = 3
  , M1 = 4
  , D1 = 5
  , F_ = class lB {
    constructor() {
        this.data = 0,
        this.blendMode = "normal",
        this.polygonOffset = 0,
        this.blend = !0,
        this.depthMask = !0
    }
    get blend() {
        return !!(this.data & 1 << P1)
    }
    set blend(e) {
        !!(this.data & 1 << P1) !== e && (this.data ^= 1 << P1)
    }
    get offsets() {
        return !!(this.data & 1 << I1)
    }
    set offsets(e) {
        !!(this.data & 1 << I1) !== e && (this.data ^= 1 << I1)
    }
    set cullMode(e) {
        if (e === "none") {
            this.culling = !1;
            return
        }
        this.culling = !0,
        this.clockwiseFrontFace = e === "front"
    }
    get cullMode() {
        return this.culling ? this.clockwiseFrontFace ? "front" : "back" : "none"
    }
    get culling() {
        return !!(this.data & 1 << O1)
    }
    set culling(e) {
        !!(this.data & 1 << O1) !== e && (this.data ^= 1 << O1)
    }
    get depthTest() {
        return !!(this.data & 1 << R1)
    }
    set depthTest(e) {
        !!(this.data & 1 << R1) !== e && (this.data ^= 1 << R1)
    }
    get depthMask() {
        return !!(this.data & 1 << D1)
    }
    set depthMask(e) {
        !!(this.data & 1 << D1) !== e && (this.data ^= 1 << D1)
    }
    get clockwiseFrontFace() {
        return !!(this.data & 1 << M1)
    }
    set clockwiseFrontFace(e) {
        !!(this.data & 1 << M1) !== e && (this.data ^= 1 << M1)
    }
    get blendMode() {
        return this._blendMode
    }
    set blendMode(e) {
        this.blend = e !== "none",
        this._blendMode = e,
        this._blendModeId = tce[e] || 0
    }
    get polygonOffset() {
        return this._polygonOffset
    }
    set polygonOffset(e) {
        this.offsets = !!e,
        this._polygonOffset = e
    }
    toString() {
        return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`
    }
    static for2d() {
        const e = new lB;
        return e.depthTest = !1,
        e.blend = !0,
        e
    }
}
;
F_.default2d = F_.for2d();
let $i = F_;
const cB = class L_ extends yi {
    constructor(e) {
        e = {
            ...L_.defaultOptions,
            ...e
        },
        super(e),
        this.enabled = !0,
        this._state = $i.for2d(),
        this.blendMode = e.blendMode,
        this.padding = e.padding,
        typeof e.antialias == "boolean" ? this.antialias = e.antialias ? "on" : "off" : this.antialias = e.antialias,
        this.resolution = e.resolution,
        this.blendRequired = e.blendRequired,
        this.clipToViewport = e.clipToViewport,
        this.addResource("uTexture", 0, 1)
    }
    apply(e, n, r, i) {
        e.applyFilter(this, n, r, i)
    }
    get blendMode() {
        return this._state.blendMode
    }
    set blendMode(e) {
        this._state.blendMode = e
    }
    static from(e) {
        const {gpu: n, gl: r, ...i} = e;
        let o, s;
        return n && (o = pa.from(n)),
        r && (s = Fl.from(r)),
        new L_({
            gpuProgram: o,
            glProgram: s,
            ...i
        })
    }
}
;
cB.defaultOptions = {
    blendMode: "normal",
    resolution: 1,
    padding: 0,
    antialias: "off",
    blendRequired: !1,
    clipToViewport: !0
};
let Qw = cB;
const $_ = [];
$e.handleByNamedList(V.Environment, $_);
async function nce(t) {
    if (!t)
        for (let e = 0; e < $_.length; e++) {
            const n = $_[e];
            if (n.value.test()) {
                await n.value.load();
                return
            }
        }
}
let Vu;
function uB() {
    if (typeof Vu == "boolean")
        return Vu;
    try {
        Vu = new Function("param1","param2","param3","return param1[param2] === param3;")({
            a: "b"
        }, "a", "b") === !0
    } catch {
        Vu = !1
    }
    return Vu
}
function AT(t, e, n=2) {
    const r = e && e.length
      , i = r ? e[0] * n : t.length;
    let o = fB(t, 0, i, n, !0);
    const s = [];
    if (!o || o.next === o.prev)
        return s;
    let a, l, c;
    if (r && (o = ace(t, e, o, n)),
    t.length > 80 * n) {
        a = t[0],
        l = t[1];
        let u = a
          , f = l;
        for (let d = n; d < i; d += n) {
            const h = t[d]
              , p = t[d + 1];
            h < a && (a = h),
            p < l && (l = p),
            h > u && (u = h),
            p > f && (f = p)
        }
        c = Math.max(u - a, f - l),
        c = c !== 0 ? 32767 / c : 0
    }
    return dd(o, s, n, a, l, c, 0),
    s
}
function fB(t, e, n, r, i) {
    let o;
    if (i === yce(t, e, n, r) > 0)
        for (let s = e; s < n; s += r)
            o = TT(s / r | 0, t[s], t[s + 1], o);
    else
        for (let s = n - r; s >= e; s -= r)
            o = TT(s / r | 0, t[s], t[s + 1], o);
    return o && Kc(o, o.next) && (pd(o),
    o = o.next),
    o
}
function xl(t, e) {
    if (!t)
        return t;
    e || (e = t);
    let n = t, r;
    do
        if (r = !1,
        !n.steiner && (Kc(n, n.next) || Yt(n.prev, n, n.next) === 0)) {
            if (pd(n),
            n = e = n.prev,
            n === n.next)
                break;
            r = !0
        } else
            n = n.next;
    while (r || n !== e);
    return e
}
function dd(t, e, n, r, i, o, s) {
    if (!t)
        return;
    !s && o && dce(t, r, i, o);
    let a = t;
    for (; t.prev !== t.next; ) {
        const l = t.prev
          , c = t.next;
        if (o ? ice(t, r, i, o) : rce(t)) {
            e.push(l.i, t.i, c.i),
            pd(t),
            t = c.next,
            a = c.next;
            continue
        }
        if (t = c,
        t === a) {
            s ? s === 1 ? (t = oce(xl(t), e),
            dd(t, e, n, r, i, o, 2)) : s === 2 && sce(t, e, n, r, i, o) : dd(xl(t), e, n, r, i, o, 1);
            break
        }
    }
}
function rce(t) {
    const e = t.prev
      , n = t
      , r = t.next;
    if (Yt(e, n, r) >= 0)
        return !1;
    const i = e.x
      , o = n.x
      , s = r.x
      , a = e.y
      , l = n.y
      , c = r.y
      , u = Math.min(i, o, s)
      , f = Math.min(a, l, c)
      , d = Math.max(i, o, s)
      , h = Math.max(a, l, c);
    let p = r.next;
    for (; p !== e; ) {
        if (p.x >= u && p.x <= d && p.y >= f && p.y <= h && sf(i, a, o, l, s, c, p.x, p.y) && Yt(p.prev, p, p.next) >= 0)
            return !1;
        p = p.next
    }
    return !0
}
function ice(t, e, n, r) {
    const i = t.prev
      , o = t
      , s = t.next;
    if (Yt(i, o, s) >= 0)
        return !1;
    const a = i.x
      , l = o.x
      , c = s.x
      , u = i.y
      , f = o.y
      , d = s.y
      , h = Math.min(a, l, c)
      , p = Math.min(u, f, d)
      , y = Math.max(a, l, c)
      , v = Math.max(u, f, d)
      , g = U_(h, p, e, n, r)
      , m = U_(y, v, e, n, r);
    let _ = t.prevZ
      , x = t.nextZ;
    for (; _ && _.z >= g && x && x.z <= m; ) {
        if (_.x >= h && _.x <= y && _.y >= p && _.y <= v && _ !== i && _ !== s && sf(a, u, l, f, c, d, _.x, _.y) && Yt(_.prev, _, _.next) >= 0 || (_ = _.prevZ,
        x.x >= h && x.x <= y && x.y >= p && x.y <= v && x !== i && x !== s && sf(a, u, l, f, c, d, x.x, x.y) && Yt(x.prev, x, x.next) >= 0))
            return !1;
        x = x.nextZ
    }
    for (; _ && _.z >= g; ) {
        if (_.x >= h && _.x <= y && _.y >= p && _.y <= v && _ !== i && _ !== s && sf(a, u, l, f, c, d, _.x, _.y) && Yt(_.prev, _, _.next) >= 0)
            return !1;
        _ = _.prevZ
    }
    for (; x && x.z <= m; ) {
        if (x.x >= h && x.x <= y && x.y >= p && x.y <= v && x !== i && x !== s && sf(a, u, l, f, c, d, x.x, x.y) && Yt(x.prev, x, x.next) >= 0)
            return !1;
        x = x.nextZ
    }
    return !0
}
function oce(t, e) {
    let n = t;
    do {
        const r = n.prev
          , i = n.next.next;
        !Kc(r, i) && hB(r, n, n.next, i) && hd(r, i) && hd(i, r) && (e.push(r.i, n.i, i.i),
        pd(n),
        pd(n.next),
        n = t = i),
        n = n.next
    } while (n !== t);
    return xl(n)
}
function sce(t, e, n, r, i, o) {
    let s = t;
    do {
        let a = s.next.next;
        for (; a !== s.prev; ) {
            if (s.i !== a.i && gce(s, a)) {
                let l = pB(s, a);
                s = xl(s, s.next),
                l = xl(l, l.next),
                dd(s, e, n, r, i, o, 0),
                dd(l, e, n, r, i, o, 0);
                return
            }
            a = a.next
        }
        s = s.next
    } while (s !== t)
}
function ace(t, e, n, r) {
    const i = [];
    for (let o = 0, s = e.length; o < s; o++) {
        const a = e[o] * r
          , l = o < s - 1 ? e[o + 1] * r : t.length
          , c = fB(t, a, l, r, !1);
        c === c.next && (c.steiner = !0),
        i.push(pce(c))
    }
    i.sort(lce);
    for (let o = 0; o < i.length; o++)
        n = cce(i[o], n);
    return n
}
function lce(t, e) {
    let n = t.x - e.x;
    if (n === 0 && (n = t.y - e.y,
    n === 0)) {
        const r = (t.next.y - t.y) / (t.next.x - t.x)
          , i = (e.next.y - e.y) / (e.next.x - e.x);
        n = r - i
    }
    return n
}
function cce(t, e) {
    const n = uce(t, e);
    if (!n)
        return e;
    const r = pB(n, t);
    return xl(r, r.next),
    xl(n, n.next)
}
function uce(t, e) {
    let n = e;
    const r = t.x
      , i = t.y;
    let o = -1 / 0, s;
    if (Kc(t, n))
        return n;
    do {
        if (Kc(t, n.next))
            return n.next;
        if (i <= n.y && i >= n.next.y && n.next.y !== n.y) {
            const f = n.x + (i - n.y) * (n.next.x - n.x) / (n.next.y - n.y);
            if (f <= r && f > o && (o = f,
            s = n.x < n.next.x ? n : n.next,
            f === r))
                return s
        }
        n = n.next
    } while (n !== e);
    if (!s)
        return null;
    const a = s
      , l = s.x
      , c = s.y;
    let u = 1 / 0;
    n = s;
    do {
        if (r >= n.x && n.x >= l && r !== n.x && dB(i < c ? r : o, i, l, c, i < c ? o : r, i, n.x, n.y)) {
            const f = Math.abs(i - n.y) / (r - n.x);
            hd(n, t) && (f < u || f === u && (n.x > s.x || n.x === s.x && fce(s, n))) && (s = n,
            u = f)
        }
        n = n.next
    } while (n !== a);
    return s
}
function fce(t, e) {
    return Yt(t.prev, t, e.prev) < 0 && Yt(e.next, t, t.next) < 0
}
function dce(t, e, n, r) {
    let i = t;
    do
        i.z === 0 && (i.z = U_(i.x, i.y, e, n, r)),
        i.prevZ = i.prev,
        i.nextZ = i.next,
        i = i.next;
    while (i !== t);
    i.prevZ.nextZ = null,
    i.prevZ = null,
    hce(i)
}
function hce(t) {
    let e, n = 1;
    do {
        let r = t, i;
        t = null;
        let o = null;
        for (e = 0; r; ) {
            e++;
            let s = r
              , a = 0;
            for (let c = 0; c < n && (a++,
            s = s.nextZ,
            !!s); c++)
                ;
            let l = n;
            for (; a > 0 || l > 0 && s; )
                a !== 0 && (l === 0 || !s || r.z <= s.z) ? (i = r,
                r = r.nextZ,
                a--) : (i = s,
                s = s.nextZ,
                l--),
                o ? o.nextZ = i : t = i,
                i.prevZ = o,
                o = i;
            r = s
        }
        o.nextZ = null,
        n *= 2
    } while (e > 1);
    return t
}
function U_(t, e, n, r, i) {
    return t = (t - n) * i | 0,
    e = (e - r) * i | 0,
    t = (t | t << 8) & 16711935,
    t = (t | t << 4) & 252645135,
    t = (t | t << 2) & 858993459,
    t = (t | t << 1) & 1431655765,
    e = (e | e << 8) & 16711935,
    e = (e | e << 4) & 252645135,
    e = (e | e << 2) & 858993459,
    e = (e | e << 1) & 1431655765,
    t | e << 1
}
function pce(t) {
    let e = t
      , n = t;
    do
        (e.x < n.x || e.x === n.x && e.y < n.y) && (n = e),
        e = e.next;
    while (e !== t);
    return n
}
function dB(t, e, n, r, i, o, s, a) {
    return (i - s) * (e - a) >= (t - s) * (o - a) && (t - s) * (r - a) >= (n - s) * (e - a) && (n - s) * (o - a) >= (i - s) * (r - a)
}
function sf(t, e, n, r, i, o, s, a) {
    return !(t === s && e === a) && dB(t, e, n, r, i, o, s, a)
}
function gce(t, e) {
    return t.next.i !== e.i && t.prev.i !== e.i && !mce(t, e) && (hd(t, e) && hd(e, t) && vce(t, e) && (Yt(t.prev, t, e.prev) || Yt(t, e.prev, e)) || Kc(t, e) && Yt(t.prev, t, t.next) > 0 && Yt(e.prev, e, e.next) > 0)
}
function Yt(t, e, n) {
    return (e.y - t.y) * (n.x - e.x) - (e.x - t.x) * (n.y - e.y)
}
function Kc(t, e) {
    return t.x === e.x && t.y === e.y
}
function hB(t, e, n, r) {
    const i = np(Yt(t, e, n))
      , o = np(Yt(t, e, r))
      , s = np(Yt(n, r, t))
      , a = np(Yt(n, r, e));
    return !!(i !== o && s !== a || i === 0 && tp(t, n, e) || o === 0 && tp(t, r, e) || s === 0 && tp(n, t, r) || a === 0 && tp(n, e, r))
}
function tp(t, e, n) {
    return e.x <= Math.max(t.x, n.x) && e.x >= Math.min(t.x, n.x) && e.y <= Math.max(t.y, n.y) && e.y >= Math.min(t.y, n.y)
}
function np(t) {
    return t > 0 ? 1 : t < 0 ? -1 : 0
}
function mce(t, e) {
    let n = t;
    do {
        if (n.i !== t.i && n.next.i !== t.i && n.i !== e.i && n.next.i !== e.i && hB(n, n.next, t, e))
            return !0;
        n = n.next
    } while (n !== t);
    return !1
}
function hd(t, e) {
    return Yt(t.prev, t, t.next) < 0 ? Yt(t, e, t.next) >= 0 && Yt(t, t.prev, e) >= 0 : Yt(t, e, t.prev) < 0 || Yt(t, t.next, e) < 0
}
function vce(t, e) {
    let n = t
      , r = !1;
    const i = (t.x + e.x) / 2
      , o = (t.y + e.y) / 2;
    do
        n.y > o != n.next.y > o && n.next.y !== n.y && i < (n.next.x - n.x) * (o - n.y) / (n.next.y - n.y) + n.x && (r = !r),
        n = n.next;
    while (n !== t);
    return r
}
function pB(t, e) {
    const n = G_(t.i, t.x, t.y)
      , r = G_(e.i, e.x, e.y)
      , i = t.next
      , o = e.prev;
    return t.next = e,
    e.prev = t,
    n.next = i,
    i.prev = n,
    r.next = n,
    n.prev = r,
    o.next = r,
    r.prev = o,
    r
}
function TT(t, e, n, r) {
    const i = G_(t, e, n);
    return r ? (i.next = r.next,
    i.prev = r,
    r.next.prev = i,
    r.next = i) : (i.prev = i,
    i.next = i),
    i
}
function pd(t) {
    t.next.prev = t.prev,
    t.prev.next = t.next,
    t.prevZ && (t.prevZ.nextZ = t.nextZ),
    t.nextZ && (t.nextZ.prevZ = t.prevZ)
}
function G_(t, e, n) {
    return {
        i: t,
        x: e,
        y: n,
        prev: null,
        next: null,
        z: 0,
        prevZ: null,
        nextZ: null,
        steiner: !1
    }
}
function yce(t, e, n, r) {
    let i = 0;
    for (let o = e, s = n - r; o < n; o += r)
        i += (t[s] - t[o]) * (t[o + 1] + t[s + 1]),
        s = o;
    return i
}
const _ce = AT.default || AT;
var Ur = (t => (t[t.NONE = 0] = "NONE",
t[t.COLOR = 16384] = "COLOR",
t[t.STENCIL = 1024] = "STENCIL",
t[t.DEPTH = 256] = "DEPTH",
t[t.COLOR_DEPTH = 16640] = "COLOR_DEPTH",
t[t.COLOR_STENCIL = 17408] = "COLOR_STENCIL",
t[t.DEPTH_STENCIL = 1280] = "DEPTH_STENCIL",
t[t.ALL = 17664] = "ALL",
t))(Ur || {});
class gB {
    constructor(e) {
        this.items = [],
        this._name = e
    }
    emit(e, n, r, i, o, s, a, l) {
        const {name: c, items: u} = this;
        for (let f = 0, d = u.length; f < d; f++)
            u[f][c](e, n, r, i, o, s, a, l);
        return this
    }
    add(e) {
        return e[this._name] && (this.remove(e),
        this.items.push(e)),
        this
    }
    remove(e) {
        const n = this.items.indexOf(e);
        return n !== -1 && this.items.splice(n, 1),
        this
    }
    contains(e) {
        return this.items.indexOf(e) !== -1
    }
    removeAll() {
        return this.items.length = 0,
        this
    }
    destroy() {
        this.removeAll(),
        this.items = null,
        this._name = null
    }
    get empty() {
        return this.items.length === 0
    }
    get name() {
        return this._name
    }
}
const xce = ["init", "destroy", "contextChange", "resolutionChange", "resetState", "renderEnd", "renderStart", "render", "update", "postrender", "prerender"]
  , mB = class vB extends Jr {
    constructor(e) {
        super(),
        this.uid = Ut("renderer"),
        this.runners = Object.create(null),
        this.renderPipes = Object.create(null),
        this._initOptions = {},
        this._systemsHash = Object.create(null),
        this.type = e.type,
        this.name = e.name,
        this.config = e;
        const n = [...xce, ...this.config.runners ?? []];
        this._addRunners(...n),
        this._unsafeEvalCheck()
    }
    async init(e={}) {
        const n = e.skipExtensionImports === !0 ? !0 : e.manageImports === !1;
        await nce(n),
        this._addSystems(this.config.systems),
        this._addPipes(this.config.renderPipes, this.config.renderPipeAdaptors);
        for (const r in this._systemsHash)
            e = {
                ...this._systemsHash[r].constructor.defaultOptions,
                ...e
            };
        e = {
            ...vB.defaultOptions,
            ...e
        },
        this._roundPixels = e.roundPixels ? 1 : 0;
        for (let r = 0; r < this.runners.init.items.length; r++)
            await this.runners.init.items[r].init(e);
        this._initOptions = e
    }
    render(e, n) {
        let r = e;
        if (r instanceof Xr && (r = {
            container: r
        },
        n && (Fe(rt, "passing a second argument is deprecated, please use render options instead"),
        r.target = n.renderTexture)),
        r.target || (r.target = this.view.renderTarget),
        r.target === this.view.renderTarget && (this._lastObjectRendered = r.container,
        r.clearColor ?? (r.clearColor = this.background.colorRgba),
        r.clear ?? (r.clear = this.background.clearBeforeRender)),
        r.clearColor) {
            const i = Array.isArray(r.clearColor) && r.clearColor.length === 4;
            r.clearColor = i ? r.clearColor : Rt.shared.setValue(r.clearColor).toArray()
        }
        r.transform || (r.container.updateLocalTransform(),
        r.transform = r.container.localTransform),
        r.container.enableRenderGroup(),
        this.runners.prerender.emit(r),
        this.runners.renderStart.emit(r),
        this.runners.render.emit(r),
        this.runners.renderEnd.emit(r),
        this.runners.postrender.emit(r)
    }
    resize(e, n, r) {
        const i = this.view.resolution;
        this.view.resize(e, n, r),
        this.emit("resize", this.view.screen.width, this.view.screen.height, this.view.resolution),
        r !== void 0 && r !== i && this.runners.resolutionChange.emit(r)
    }
    clear(e={}) {
        const n = this;
        e.target || (e.target = n.renderTarget.renderTarget),
        e.clearColor || (e.clearColor = this.background.colorRgba),
        e.clear ?? (e.clear = Ur.ALL);
        const {clear: r, clearColor: i, target: o} = e;
        Rt.shared.setValue(i ?? this.background.colorRgba),
        n.renderTarget.clear(o, r, Rt.shared.toArray())
    }
    get resolution() {
        return this.view.resolution
    }
    set resolution(e) {
        this.view.resolution = e,
        this.runners.resolutionChange.emit(e)
    }
    get width() {
        return this.view.texture.frame.width
    }
    get height() {
        return this.view.texture.frame.height
    }
    get canvas() {
        return this.view.canvas
    }
    get lastObjectRendered() {
        return this._lastObjectRendered
    }
    get renderingToScreen() {
        return this.renderTarget.renderingToScreen
    }
    get screen() {
        return this.view.screen
    }
    _addRunners(...e) {
        e.forEach(n => {
            this.runners[n] = new gB(n)
        }
        )
    }
    _addSystems(e) {
        let n;
        for (n in e) {
            const r = e[n];
            this._addSystem(r.value, r.name)
        }
    }
    _addSystem(e, n) {
        const r = new e(this);
        if (this[n])
            throw new Error(`Whoops! The name "${n}" is already in use`);
        this[n] = r,
        this._systemsHash[n] = r;
        for (const i in this.runners)
            this.runners[i].add(r);
        return this
    }
    _addPipes(e, n) {
        const r = n.reduce( (i, o) => (i[o.name] = o.value,
        i), {});
        e.forEach(i => {
            const o = i.value
              , s = i.name
              , a = r[s];
            this.renderPipes[s] = new o(this,a ? new a : null)
        }
        )
    }
    destroy(e=!1) {
        this.runners.destroy.items.reverse(),
        this.runners.destroy.emit(e),
        Object.values(this.runners).forEach(n => {
            n.destroy()
        }
        ),
        this._systemsHash = null,
        this.renderPipes = null
    }
    generateTexture(e) {
        return this.textureGenerator.generateTexture(e)
    }
    get roundPixels() {
        return !!this._roundPixels
    }
    _unsafeEvalCheck() {
        if (!uB())
            throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")
    }
    resetState() {
        this.runners.resetState.emit()
    }
}
;
mB.defaultOptions = {
    resolution: 1,
    failIfMajorPerformanceCaveat: !1,
    roundPixels: !1
};
let tm = mB, rp;
function bce(t) {
    return rp !== void 0 || (rp = ( () => {
        var n;
        const e = {
            stencil: !0,
            failIfMajorPerformanceCaveat: t ?? tm.defaultOptions.failIfMajorPerformanceCaveat
        };
        try {
            if (!je.get().getWebGLRenderingContext())
                return !1;
            let i = je.get().createCanvas().getContext("webgl", e);
            const o = !!((n = i == null ? void 0 : i.getContextAttributes()) != null && n.stencil);
            if (i) {
                const s = i.getExtension("WEBGL_lose_context");
                s && s.loseContext()
            }
            return i = null,
            o
        } catch {
            return !1
        }
    }
    )()),
    rp
}
let ip;
async function wce(t={}) {
    return ip !== void 0 || (ip = await (async () => {
        const e = je.get().getNavigator().gpu;
        if (!e)
            return !1;
        try {
            return await (await e.requestAdapter(t)).requestDevice(),
            !0
        } catch {
            return !1
        }
    }
    )()),
    ip
}
const PT = ["webgl", "webgpu", "canvas"];
async function Ece(t) {
    let e = [];
    t.preference ? (e.push(t.preference),
    PT.forEach(o => {
        o !== t.preference && e.push(o)
    }
    )) : e = PT.slice();
    let n, r = {};
    for (let o = 0; o < e.length; o++) {
        const s = e[o];
        if (s === "webgpu" && await wce()) {
            const {WebGPURenderer: a} = await Uf( () => Promise.resolve().then( () => Epe), void 0);
            n = a,
            r = {
                ...t,
                ...t.webgpu
            };
            break
        } else if (s === "webgl" && bce(t.failIfMajorPerformanceCaveat ?? tm.defaultOptions.failIfMajorPerformanceCaveat)) {
            const {WebGLRenderer: a} = await Uf( () => Promise.resolve().then( () => ipe), void 0);
            n = a,
            r = {
                ...t,
                ...t.webgl
            };
            break
        } else if (s === "canvas")
            throw r = {
                ...t
            },
            new Error("CanvasRenderer is not yet implemented")
    }
    if (delete r.webgpu,
    delete r.webgl,
    !n)
        throw new Error("No available renderer for the current environment");
    const i = new n;
    return await i.init(r),
    i
}
const S0 = "8.12.0";
class yB {
    static init() {
        var e;
        (e = globalThis.__PIXI_APP_INIT__) == null || e.call(globalThis, this, S0)
    }
    static destroy() {}
}
yB.extension = V.Application;
class _B {
    constructor(e) {
        this._renderer = e
    }
    init() {
        var e;
        (e = globalThis.__PIXI_RENDERER_INIT__) == null || e.call(globalThis, this._renderer, S0)
    }
    destroy() {
        this._renderer = null
    }
}
_B.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem],
    name: "initHook",
    priority: -10
};
const xB = class H_ {
    constructor(...e) {
        this.stage = new Xr,
        e[0] !== void 0 && Fe(rt, "Application constructor options are deprecated, please use Application.init() instead.")
    }
    async init(e) {
        e = {
            ...e
        },
        this.renderer = await Ece(e),
        H_._plugins.forEach(n => {
            n.init.call(this, e)
        }
        )
    }
    render() {
        this.renderer.render({
            container: this.stage
        })
    }
    get canvas() {
        return this.renderer.canvas
    }
    get view() {
        return Fe(rt, "Application.view is deprecated, please use Application.canvas instead."),
        this.renderer.canvas
    }
    get screen() {
        return this.renderer.screen
    }
    destroy(e=!1, n=!1) {
        const r = H_._plugins.slice(0);
        r.reverse(),
        r.forEach(i => {
            i.destroy.call(this)
        }
        ),
        this.stage.destroy(n),
        this.stage = null,
        this.renderer.destroy(e),
        this.renderer = null
    }
}
;
xB._plugins = [];
let Sce = xB;
$e.handleByList(V.Application, Sce._plugins);
$e.add(yB);
class bB {
    static init(e) {
        Object.defineProperty(this, "resizeTo", {
            set(n) {
                globalThis.removeEventListener("resize", this.queueResize),
                this._resizeTo = n,
                n && (globalThis.addEventListener("resize", this.queueResize),
                this.resize())
            },
            get() {
                return this._resizeTo
            }
        }),
        this.queueResize = () => {
            this._resizeTo && (this._cancelResize(),
            this._resizeId = requestAnimationFrame( () => this.resize()))
        }
        ,
        this._cancelResize = () => {
            this._resizeId && (cancelAnimationFrame(this._resizeId),
            this._resizeId = null)
        }
        ,
        this.resize = () => {
            if (!this._resizeTo)
                return;
            this._cancelResize();
            let n, r;
            if (this._resizeTo === globalThis.window)
                n = globalThis.innerWidth,
                r = globalThis.innerHeight;
            else {
                const {clientWidth: i, clientHeight: o} = this._resizeTo;
                n = i,
                r = o
            }
            this.renderer.resize(n, r),
            this.render()
        }
        ,
        this._resizeId = null,
        this._resizeTo = null,
        this.resizeTo = e.resizeTo || null
    }
    static destroy() {
        globalThis.removeEventListener("resize", this.queueResize),
        this._cancelResize(),
        this._cancelResize = null,
        this.queueResize = null,
        this.resizeTo = null,
        this.resize = null
    }
}
bB.extension = V.Application;
class wB {
    static init(e) {
        e = Object.assign({
            autoStart: !0,
            sharedTicker: !1
        }, e),
        Object.defineProperty(this, "ticker", {
            set(n) {
                this._ticker && this._ticker.remove(this.render, this),
                this._ticker = n,
                n && n.add(this.render, this, _l.LOW)
            },
            get() {
                return this._ticker
            }
        }),
        this.stop = () => {
            this._ticker.stop()
        }
        ,
        this.start = () => {
            this._ticker.start()
        }
        ,
        this._ticker = null,
        this.ticker = e.sharedTicker ? Un.shared : new Un,
        e.autoStart && this.start()
    }
    static destroy() {
        if (this._ticker) {
            const e = this._ticker;
            this.ticker = null,
            e.destroy()
        }
    }
}
wB.extension = V.Application;
class EB extends Jr {
    constructor() {
        super(...arguments),
        this.chars = Object.create(null),
        this.lineHeight = 0,
        this.fontFamily = "",
        this.fontMetrics = {
            fontSize: 0,
            ascent: 0,
            descent: 0
        },
        this.baseLineOffset = 0,
        this.distanceField = {
            type: "none",
            range: 0
        },
        this.pages = [],
        this.applyFillAsTint = !0,
        this.baseMeasurementFontSize = 100,
        this.baseRenderedFontSize = 100
    }
    get font() {
        return Fe(rt, "BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),
        this.fontFamily
    }
    get pageTextures() {
        return Fe(rt, "BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),
        this.pages
    }
    get size() {
        return Fe(rt, "BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),
        this.fontMetrics.fontSize
    }
    get distanceFieldRange() {
        return Fe(rt, "BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),
        this.distanceField.range
    }
    get distanceFieldType() {
        return Fe(rt, "BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),
        this.distanceField.type
    }
    destroy(e=!1) {
        var n;
        this.emit("destroy", this),
        this.removeAllListeners();
        for (const r in this.chars)
            (n = this.chars[r].texture) == null || n.destroy();
        this.chars = null,
        e && (this.pages.forEach(r => r.texture.destroy(!0)),
        this.pages = null)
    }
}
const Cce = ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui"];
function C0(t) {
    const e = typeof t.fontSize == "number" ? `${t.fontSize}px` : t.fontSize;
    let n = t.fontFamily;
    Array.isArray(t.fontFamily) || (n = t.fontFamily.split(","));
    for (let r = n.length - 1; r >= 0; r--) {
        let i = n[r].trim();
        !/([\"\'])[^\'\"]+\1/.test(i) && !Cce.includes(i) && (i = `"${i}"`),
        n[r] = i
    }
    return `${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${e} ${n.join(",")}`
}
const B1 = {
    willReadFrequently: !0
}
  , So = class Re {
    static get experimentalLetterSpacingSupported() {
        let e = Re._experimentalLetterSpacingSupported;
        if (e === void 0) {
            const n = je.get().getCanvasRenderingContext2D().prototype;
            e = Re._experimentalLetterSpacingSupported = "letterSpacing"in n || "textLetterSpacing"in n
        }
        return e
    }
    constructor(e, n, r, i, o, s, a, l, c) {
        this.text = e,
        this.style = n,
        this.width = r,
        this.height = i,
        this.lines = o,
        this.lineWidths = s,
        this.lineHeight = a,
        this.maxLineWidth = l,
        this.fontProperties = c
    }
    static measureText(e=" ", n, r=Re._canvas, i=n.wordWrap) {
        var g;
        const o = C0(n)
          , s = Re.measureFont(o);
        s.fontSize === 0 && (s.fontSize = n.fontSize,
        s.ascent = n.fontSize);
        const a = Re.__context;
        a.font = o;
        const c = (i ? Re._wordWrap(e, n, r) : e).split(/(?:\r\n|\r|\n)/)
          , u = new Array(c.length);
        let f = 0;
        for (let m = 0; m < c.length; m++) {
            const _ = Re._measureText(c[m], n.letterSpacing, a);
            u[m] = _,
            f = Math.max(f, _)
        }
        const d = ((g = n._stroke) == null ? void 0 : g.width) || 0;
        let h = f + d;
        n.dropShadow && (h += n.dropShadow.distance);
        const p = n.lineHeight || s.fontSize;
        let y = Math.max(p, s.fontSize + d) + (c.length - 1) * (p + n.leading);
        return n.dropShadow && (y += n.dropShadow.distance),
        new Re(e,n,h,y,c,u,p + n.leading,f,s)
    }
    static _measureText(e, n, r) {
        let i = !1;
        Re.experimentalLetterSpacingSupported && (Re.experimentalLetterSpacing ? (r.letterSpacing = `${n}px`,
        r.textLetterSpacing = `${n}px`,
        i = !0) : (r.letterSpacing = "0px",
        r.textLetterSpacing = "0px"));
        const o = r.measureText(e);
        let s = o.width;
        const a = -o.actualBoundingBoxLeft;
        let c = o.actualBoundingBoxRight - a;
        if (s > 0)
            if (i)
                s -= n,
                c -= n;
            else {
                const u = (Re.graphemeSegmenter(e).length - 1) * n;
                s += u,
                c += u
            }
        return Math.max(s, c)
    }
    static _wordWrap(e, n, r=Re._canvas) {
        const i = r.getContext("2d", B1);
        let o = 0
          , s = ""
          , a = "";
        const l = Object.create(null)
          , {letterSpacing: c, whiteSpace: u} = n
          , f = Re._collapseSpaces(u)
          , d = Re._collapseNewlines(u);
        let h = !f;
        const p = n.wordWrapWidth + c
          , y = Re._tokenize(e);
        for (let v = 0; v < y.length; v++) {
            let g = y[v];
            if (Re._isNewline(g)) {
                if (!d) {
                    a += Re._addLine(s),
                    h = !f,
                    s = "",
                    o = 0;
                    continue
                }
                g = " "
            }
            if (f) {
                const _ = Re.isBreakingSpace(g)
                  , x = Re.isBreakingSpace(s[s.length - 1]);
                if (_ && x)
                    continue
            }
            const m = Re._getFromCache(g, c, l, i);
            if (m > p)
                if (s !== "" && (a += Re._addLine(s),
                s = "",
                o = 0),
                Re.canBreakWords(g, n.breakWords)) {
                    const _ = Re.wordWrapSplit(g);
                    for (let x = 0; x < _.length; x++) {
                        let b = _[x]
                          , w = b
                          , E = 1;
                        for (; _[x + E]; ) {
                            const P = _[x + E];
                            if (!Re.canBreakChars(w, P, g, x, n.breakWords))
                                b += P;
                            else
                                break;
                            w = P,
                            E++
                        }
                        x += E - 1;
                        const S = Re._getFromCache(b, c, l, i);
                        S + o > p && (a += Re._addLine(s),
                        h = !1,
                        s = "",
                        o = 0),
                        s += b,
                        o += S
                    }
                } else {
                    s.length > 0 && (a += Re._addLine(s),
                    s = "",
                    o = 0);
                    const _ = v === y.length - 1;
                    a += Re._addLine(g, !_),
                    h = !1,
                    s = "",
                    o = 0
                }
            else
                m + o > p && (h = !1,
                a += Re._addLine(s),
                s = "",
                o = 0),
                (s.length > 0 || !Re.isBreakingSpace(g) || h) && (s += g,
                o += m)
        }
        return a += Re._addLine(s, !1),
        a
    }
    static _addLine(e, n=!0) {
        return e = Re._trimRight(e),
        e = n ? `${e}
` : e,
        e
    }
    static _getFromCache(e, n, r, i) {
        let o = r[e];
        return typeof o != "number" && (o = Re._measureText(e, n, i) + n,
        r[e] = o),
        o
    }
    static _collapseSpaces(e) {
        return e === "normal" || e === "pre-line"
    }
    static _collapseNewlines(e) {
        return e === "normal"
    }
    static _trimRight(e) {
        if (typeof e != "string")
            return "";
        for (let n = e.length - 1; n >= 0; n--) {
            const r = e[n];
            if (!Re.isBreakingSpace(r))
                break;
            e = e.slice(0, -1)
        }
        return e
    }
    static _isNewline(e) {
        return typeof e != "string" ? !1 : Re._newlines.includes(e.charCodeAt(0))
    }
    static isBreakingSpace(e, n) {
        return typeof e != "string" ? !1 : Re._breakingSpaces.includes(e.charCodeAt(0))
    }
    static _tokenize(e) {
        const n = [];
        let r = "";
        if (typeof e != "string")
            return n;
        for (let i = 0; i < e.length; i++) {
            const o = e[i]
              , s = e[i + 1];
            if (Re.isBreakingSpace(o, s) || Re._isNewline(o)) {
                r !== "" && (n.push(r),
                r = ""),
                o === "\r" && s === `
` ? (n.push(`\r
`),
                i++) : n.push(o);
                continue
            }
            r += o
        }
        return r !== "" && n.push(r),
        n
    }
    static canBreakWords(e, n) {
        return n
    }
    static canBreakChars(e, n, r, i, o) {
        return !0
    }
    static wordWrapSplit(e) {
        return Re.graphemeSegmenter(e)
    }
    static measureFont(e) {
        if (Re._fonts[e])
            return Re._fonts[e];
        const n = Re._context;
        n.font = e;
        const r = n.measureText(Re.METRICS_STRING + Re.BASELINE_SYMBOL)
          , i = {
            ascent: r.actualBoundingBoxAscent,
            descent: r.actualBoundingBoxDescent,
            fontSize: r.actualBoundingBoxAscent + r.actualBoundingBoxDescent
        };
        return Re._fonts[e] = i,
        i
    }
    static clearMetrics(e="") {
        e ? delete Re._fonts[e] : Re._fonts = {}
    }
    static get _canvas() {
        if (!Re.__canvas) {
            let e;
            try {
                const n = new OffscreenCanvas(0,0)
                  , r = n.getContext("2d", B1);
                if (r != null && r.measureText)
                    return Re.__canvas = n,
                    n;
                e = je.get().createCanvas()
            } catch {
                e = je.get().createCanvas()
            }
            e.width = e.height = 10,
            Re.__canvas = e
        }
        return Re.__canvas
    }
    static get _context() {
        return Re.__context || (Re.__context = Re._canvas.getContext("2d", B1)),
        Re.__context
    }
}
;
So.METRICS_STRING = "|ÉqÅ";
So.BASELINE_SYMBOL = "M";
So.BASELINE_MULTIPLIER = 1.4;
So.HEIGHT_MULTIPLIER = 2;
So.graphemeSegmenter = ( () => {
    if (typeof (Intl == null ? void 0 : Intl.Segmenter) == "function") {
        const t = new Intl.Segmenter;
        return e => {
            const n = t.segment(e)
              , r = [];
            let i = 0;
            for (const o of n)
                r[i++] = o.segment;
            return r
        }
    }
    return t => [...t]
}
)();
So.experimentalLetterSpacing = !1;
So._fonts = {};
So._newlines = [10, 13];
So._breakingSpaces = [9, 32, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8200, 8201, 8202, 8287, 12288];
let Ii = So;
const IT = [{
    offset: 0,
    color: "white"
}, {
    offset: 1,
    color: "black"
}]
  , e2 = class V_ {
    constructor(...e) {
        this.uid = Ut("fillGradient"),
        this.type = "linear",
        this.colorStops = [];
        let n = Ace(e);
        n = {
            ...n.type === "radial" ? V_.defaultRadialOptions : V_.defaultLinearOptions,
            ...AD(n)
        },
        this._textureSize = n.textureSize,
        this._wrapMode = n.wrapMode,
        n.type === "radial" ? (this.center = n.center,
        this.outerCenter = n.outerCenter ?? this.center,
        this.innerRadius = n.innerRadius,
        this.outerRadius = n.outerRadius,
        this.scale = n.scale,
        this.rotation = n.rotation) : (this.start = n.start,
        this.end = n.end),
        this.textureSpace = n.textureSpace,
        this.type = n.type,
        n.colorStops.forEach(i => {
            this.addColorStop(i.offset, i.color)
        }
        )
    }
    addColorStop(e, n) {
        return this.colorStops.push({
            offset: e,
            color: Rt.shared.setValue(n).toHexa()
        }),
        this
    }
    buildLinearGradient() {
        if (this.texture)
            return;
        let {x: e, y: n} = this.start
          , {x: r, y: i} = this.end
          , o = r - e
          , s = i - n;
        const a = o < 0 || s < 0;
        if (this._wrapMode === "clamp-to-edge") {
            if (o < 0) {
                const v = e;
                e = r,
                r = v,
                o *= -1
            }
            if (s < 0) {
                const v = n;
                n = i,
                i = v,
                s *= -1
            }
        }
        const l = this.colorStops.length ? this.colorStops : IT
          , c = this._textureSize
          , {canvas: u, context: f} = RT(c, 1)
          , d = a ? f.createLinearGradient(this._textureSize, 0, 0, 0) : f.createLinearGradient(0, 0, this._textureSize, 0);
        OT(d, l),
        f.fillStyle = d,
        f.fillRect(0, 0, c, 1),
        this.texture = new Ae({
            source: new yl({
                resource: u,
                addressMode: this._wrapMode
            })
        });
        const h = Math.sqrt(o * o + s * s)
          , p = Math.atan2(s, o)
          , y = new Oe;
        y.scale(h / c, 1),
        y.rotate(p),
        y.translate(e, n),
        this.textureSpace === "local" && y.scale(c, c),
        this.transform = y
    }
    buildGradient() {
        this.type === "linear" ? this.buildLinearGradient() : this.buildRadialGradient()
    }
    buildRadialGradient() {
        if (this.texture)
            return;
        const e = this.colorStops.length ? this.colorStops : IT
          , n = this._textureSize
          , {canvas: r, context: i} = RT(n, n)
          , {x: o, y: s} = this.center
          , {x: a, y: l} = this.outerCenter
          , c = this.innerRadius
          , u = this.outerRadius
          , f = a - u
          , d = l - u
          , h = n / (u * 2)
          , p = (o - f) * h
          , y = (s - d) * h
          , v = i.createRadialGradient(p, y, c * h, (a - f) * h, (l - d) * h, u * h);
        OT(v, e),
        i.fillStyle = e[e.length - 1].color,
        i.fillRect(0, 0, n, n),
        i.fillStyle = v,
        i.translate(p, y),
        i.rotate(this.rotation),
        i.scale(1, this.scale),
        i.translate(-p, -y),
        i.fillRect(0, 0, n, n),
        this.texture = new Ae({
            source: new yl({
                resource: r,
                addressMode: this._wrapMode
            })
        });
        const g = new Oe;
        g.scale(1 / h, 1 / h),
        g.translate(f, d),
        this.textureSpace === "local" && g.scale(n, n),
        this.transform = g
    }
    get styleKey() {
        return this.uid
    }
    destroy() {
        var e;
        (e = this.texture) == null || e.destroy(!0),
        this.texture = null,
        this.transform = null,
        this.colorStops = [],
        this.start = null,
        this.end = null,
        this.center = null,
        this.outerCenter = null
    }
}
;
e2.defaultLinearOptions = {
    start: {
        x: 0,
        y: 0
    },
    end: {
        x: 0,
        y: 1
    },
    colorStops: [],
    textureSpace: "local",
    type: "linear",
    textureSize: 256,
    wrapMode: "clamp-to-edge"
};
e2.defaultRadialOptions = {
    center: {
        x: .5,
        y: .5
    },
    innerRadius: 0,
    outerRadius: .5,
    colorStops: [],
    scale: 1,
    textureSpace: "local",
    type: "radial",
    textureSize: 256,
    wrapMode: "clamp-to-edge"
};
let ss = e2;
function OT(t, e) {
    for (let n = 0; n < e.length; n++) {
        const r = e[n];
        t.addColorStop(r.offset, r.color)
    }
}
function RT(t, e) {
    const n = je.get().createCanvas(t, e)
      , r = n.getContext("2d");
    return {
        canvas: n,
        context: r
    }
}
function Ace(t) {
    let e = t[0] ?? {};
    return (typeof e == "number" || t[1]) && (Fe("8.5.2", "use options object instead"),
    e = {
        type: "linear",
        start: {
            x: t[0],
            y: t[1]
        },
        end: {
            x: t[2],
            y: t[3]
        },
        textureSpace: t[4],
        textureSize: t[5] ?? ss.defaultLinearOptions.textureSize
    }),
    e
}
const MT = {
    repeat: {
        addressModeU: "repeat",
        addressModeV: "repeat"
    },
    "repeat-x": {
        addressModeU: "repeat",
        addressModeV: "clamp-to-edge"
    },
    "repeat-y": {
        addressModeU: "clamp-to-edge",
        addressModeV: "repeat"
    },
    "no-repeat": {
        addressModeU: "clamp-to-edge",
        addressModeV: "clamp-to-edge"
    }
};
class nm {
    constructor(e, n) {
        this.uid = Ut("fillPattern"),
        this.transform = new Oe,
        this._styleKey = null,
        this.texture = e,
        this.transform.scale(1 / e.frame.width, 1 / e.frame.height),
        n && (e.source.style.addressModeU = MT[n].addressModeU,
        e.source.style.addressModeV = MT[n].addressModeV)
    }
    setTransform(e) {
        const n = this.texture;
        this.transform.copyFrom(e),
        this.transform.invert(),
        this.transform.scale(1 / n.frame.width, 1 / n.frame.height),
        this._styleKey = null
    }
    get styleKey() {
        return this._styleKey ? this._styleKey : (this._styleKey = `fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,
        this._styleKey)
    }
    destroy() {
        this.texture.destroy(!0),
        this.texture = null,
        this._styleKey = null
    }
}
var Tce = Ice
  , k1 = {
    a: 7,
    c: 6,
    h: 1,
    l: 2,
    m: 2,
    q: 4,
    s: 4,
    t: 2,
    v: 1,
    z: 0
}
  , Pce = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
function Ice(t) {
    var e = [];
    return t.replace(Pce, function(n, r, i) {
        var o = r.toLowerCase();
        for (i = Rce(i),
        o == "m" && i.length > 2 && (e.push([r].concat(i.splice(0, 2))),
        o = "l",
        r = r == "m" ? "l" : "L"); ; ) {
            if (i.length == k1[o])
                return i.unshift(r),
                e.push(i);
            if (i.length < k1[o])
                throw new Error("malformed path data");
            e.push([r].concat(i.splice(0, k1[o])))
        }
    }),
    e
}
var Oce = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
function Rce(t) {
    var e = t.match(Oce);
    return e ? e.map(Number) : []
}
const Mce = hu(Tce);
function Dce(t, e) {
    const n = Mce(t)
      , r = [];
    let i = null
      , o = 0
      , s = 0;
    for (let a = 0; a < n.length; a++) {
        const l = n[a]
          , c = l[0]
          , u = l;
        switch (c) {
        case "M":
            o = u[1],
            s = u[2],
            e.moveTo(o, s);
            break;
        case "m":
            o += u[1],
            s += u[2],
            e.moveTo(o, s);
            break;
        case "H":
            o = u[1],
            e.lineTo(o, s);
            break;
        case "h":
            o += u[1],
            e.lineTo(o, s);
            break;
        case "V":
            s = u[1],
            e.lineTo(o, s);
            break;
        case "v":
            s += u[1],
            e.lineTo(o, s);
            break;
        case "L":
            o = u[1],
            s = u[2],
            e.lineTo(o, s);
            break;
        case "l":
            o += u[1],
            s += u[2],
            e.lineTo(o, s);
            break;
        case "C":
            o = u[5],
            s = u[6],
            e.bezierCurveTo(u[1], u[2], u[3], u[4], o, s);
            break;
        case "c":
            e.bezierCurveTo(o + u[1], s + u[2], o + u[3], s + u[4], o + u[5], s + u[6]),
            o += u[5],
            s += u[6];
            break;
        case "S":
            o = u[3],
            s = u[4],
            e.bezierCurveToShort(u[1], u[2], o, s);
            break;
        case "s":
            e.bezierCurveToShort(o + u[1], s + u[2], o + u[3], s + u[4]),
            o += u[3],
            s += u[4];
            break;
        case "Q":
            o = u[3],
            s = u[4],
            e.quadraticCurveTo(u[1], u[2], o, s);
            break;
        case "q":
            e.quadraticCurveTo(o + u[1], s + u[2], o + u[3], s + u[4]),
            o += u[3],
            s += u[4];
            break;
        case "T":
            o = u[1],
            s = u[2],
            e.quadraticCurveToShort(o, s);
            break;
        case "t":
            o += u[1],
            s += u[2],
            e.quadraticCurveToShort(o, s);
            break;
        case "A":
            o = u[6],
            s = u[7],
            e.arcToSvg(u[1], u[2], u[3], u[4], u[5], o, s);
            break;
        case "a":
            o += u[6],
            s += u[7],
            e.arcToSvg(u[1], u[2], u[3], u[4], u[5], o, s);
            break;
        case "Z":
        case "z":
            e.closePath(),
            r.length > 0 && (i = r.pop(),
            i ? (o = i.startX,
            s = i.startY) : (o = 0,
            s = 0)),
            i = null;
            break;
        default:
            Ne(`Unknown SVG path command: ${c}`)
        }
        c !== "Z" && c !== "z" && i === null && (i = {
            startX: o,
            startY: s
        },
        r.push(i))
    }
    return e
}
class t2 {
    constructor(e=0, n=0, r=0) {
        this.type = "circle",
        this.x = e,
        this.y = n,
        this.radius = r
    }
    clone() {
        return new t2(this.x,this.y,this.radius)
    }
    contains(e, n) {
        if (this.radius <= 0)
            return !1;
        const r = this.radius * this.radius;
        let i = this.x - e
          , o = this.y - n;
        return i *= i,
        o *= o,
        i + o <= r
    }
    strokeContains(e, n, r, i=.5) {
        if (this.radius === 0)
            return !1;
        const o = this.x - e
          , s = this.y - n
          , a = this.radius
          , l = (1 - i) * r
          , c = Math.sqrt(o * o + s * s);
        return c <= a + l && c > a - (r - l)
    }
    getBounds(e) {
        return e || (e = new vt),
        e.x = this.x - this.radius,
        e.y = this.y - this.radius,
        e.width = this.radius * 2,
        e.height = this.radius * 2,
        e
    }
    copyFrom(e) {
        return this.x = e.x,
        this.y = e.y,
        this.radius = e.radius,
        this
    }
    copyTo(e) {
        return e.copyFrom(this),
        e
    }
    toString() {
        return `[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`
    }
}
class n2 {
    constructor(e=0, n=0, r=0, i=0) {
        this.type = "ellipse",
        this.x = e,
        this.y = n,
        this.halfWidth = r,
        this.halfHeight = i
    }
    clone() {
        return new n2(this.x,this.y,this.halfWidth,this.halfHeight)
    }
    contains(e, n) {
        if (this.halfWidth <= 0 || this.halfHeight <= 0)
            return !1;
        let r = (e - this.x) / this.halfWidth
          , i = (n - this.y) / this.halfHeight;
        return r *= r,
        i *= i,
        r + i <= 1
    }
    strokeContains(e, n, r, i=.5) {
        const {halfWidth: o, halfHeight: s} = this;
        if (o <= 0 || s <= 0)
            return !1;
        const a = r * (1 - i)
          , l = r - a
          , c = o - l
          , u = s - l
          , f = o + a
          , d = s + a
          , h = e - this.x
          , p = n - this.y
          , y = h * h / (c * c) + p * p / (u * u)
          , v = h * h / (f * f) + p * p / (d * d);
        return y > 1 && v <= 1
    }
    getBounds(e) {
        return e || (e = new vt),
        e.x = this.x - this.halfWidth,
        e.y = this.y - this.halfHeight,
        e.width = this.halfWidth * 2,
        e.height = this.halfHeight * 2,
        e
    }
    copyFrom(e) {
        return this.x = e.x,
        this.y = e.y,
        this.halfWidth = e.halfWidth,
        this.halfHeight = e.halfHeight,
        this
    }
    copyTo(e) {
        return e.copyFrom(this),
        e
    }
    toString() {
        return `[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`
    }
}
function Bce(t, e, n, r, i, o) {
    const s = t - n
      , a = e - r
      , l = i - n
      , c = o - r
      , u = s * l + a * c
      , f = l * l + c * c;
    let d = -1;
    f !== 0 && (d = u / f);
    let h, p;
    d < 0 ? (h = n,
    p = r) : d > 1 ? (h = i,
    p = o) : (h = n + d * l,
    p = r + d * c);
    const y = t - h
      , v = e - p;
    return y * y + v * v
}
let kce, Nce;
class If {
    constructor(...e) {
        this.type = "polygon";
        let n = Array.isArray(e[0]) ? e[0] : e;
        if (typeof n[0] != "number") {
            const r = [];
            for (let i = 0, o = n.length; i < o; i++)
                r.push(n[i].x, n[i].y);
            n = r
        }
        this.points = n,
        this.closePath = !0
    }
    isClockwise() {
        let e = 0;
        const n = this.points
          , r = n.length;
        for (let i = 0; i < r; i += 2) {
            const o = n[i]
              , s = n[i + 1]
              , a = n[(i + 2) % r]
              , l = n[(i + 3) % r];
            e += (a - o) * (l + s)
        }
        return e < 0
    }
    containsPolygon(e) {
        const n = this.getBounds(kce)
          , r = e.getBounds(Nce);
        if (!n.containsRect(r))
            return !1;
        const i = e.points;
        for (let o = 0; o < i.length; o += 2) {
            const s = i[o]
              , a = i[o + 1];
            if (!this.contains(s, a))
                return !1
        }
        return !0
    }
    clone() {
        const e = this.points.slice()
          , n = new If(e);
        return n.closePath = this.closePath,
        n
    }
    contains(e, n) {
        let r = !1;
        const i = this.points.length / 2;
        for (let o = 0, s = i - 1; o < i; s = o++) {
            const a = this.points[o * 2]
              , l = this.points[o * 2 + 1]
              , c = this.points[s * 2]
              , u = this.points[s * 2 + 1];
            l > n != u > n && e < (c - a) * ((n - l) / (u - l)) + a && (r = !r)
        }
        return r
    }
    strokeContains(e, n, r, i=.5) {
        const o = r * r
          , s = o * (1 - i)
          , a = o - s
          , {points: l} = this
          , c = l.length - (this.closePath ? 0 : 2);
        for (let u = 0; u < c; u += 2) {
            const f = l[u]
              , d = l[u + 1]
              , h = l[(u + 2) % l.length]
              , p = l[(u + 3) % l.length]
              , y = Bce(e, n, f, d, h, p)
              , v = Math.sign((h - f) * (n - d) - (p - d) * (e - f));
            if (y <= (v < 0 ? a : s))
                return !0
        }
        return !1
    }
    getBounds(e) {
        e || (e = new vt);
        const n = this.points;
        let r = 1 / 0
          , i = -1 / 0
          , o = 1 / 0
          , s = -1 / 0;
        for (let a = 0, l = n.length; a < l; a += 2) {
            const c = n[a]
              , u = n[a + 1];
            r = c < r ? c : r,
            i = c > i ? c : i,
            o = u < o ? u : o,
            s = u > s ? u : s
        }
        return e.x = r,
        e.width = i - r,
        e.y = o,
        e.height = s - o,
        e
    }
    copyFrom(e) {
        return this.points = e.points.slice(),
        this.closePath = e.closePath,
        this
    }
    copyTo(e) {
        return e.copyFrom(this),
        e
    }
    toString() {
        return `[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce( (e, n) => `${e}, ${n}`, "")}]`
    }
    get lastX() {
        return this.points[this.points.length - 2]
    }
    get lastY() {
        return this.points[this.points.length - 1]
    }
    get x() {
        return Fe("8.11.0", "Polygon.lastX is deprecated, please use Polygon.lastX instead."),
        this.points[this.points.length - 2]
    }
    get y() {
        return Fe("8.11.0", "Polygon.y is deprecated, please use Polygon.lastY instead."),
        this.points[this.points.length - 1]
    }
    get startX() {
        return this.points[0]
    }
    get startY() {
        return this.points[1]
    }
}
const op = (t, e, n, r, i, o, s) => {
    const a = t - n
      , l = e - r
      , c = Math.sqrt(a * a + l * l);
    return c >= i - o && c <= i + s
}
;
class r2 {
    constructor(e=0, n=0, r=0, i=0, o=20) {
        this.type = "roundedRectangle",
        this.x = e,
        this.y = n,
        this.width = r,
        this.height = i,
        this.radius = o
    }
    getBounds(e) {
        return e || (e = new vt),
        e.x = this.x,
        e.y = this.y,
        e.width = this.width,
        e.height = this.height,
        e
    }
    clone() {
        return new r2(this.x,this.y,this.width,this.height,this.radius)
    }
    copyFrom(e) {
        return this.x = e.x,
        this.y = e.y,
        this.width = e.width,
        this.height = e.height,
        this
    }
    copyTo(e) {
        return e.copyFrom(this),
        e
    }
    contains(e, n) {
        if (this.width <= 0 || this.height <= 0)
            return !1;
        if (e >= this.x && e <= this.x + this.width && n >= this.y && n <= this.y + this.height) {
            const r = Math.max(0, Math.min(this.radius, Math.min(this.width, this.height) / 2));
            if (n >= this.y + r && n <= this.y + this.height - r || e >= this.x + r && e <= this.x + this.width - r)
                return !0;
            let i = e - (this.x + r)
              , o = n - (this.y + r);
            const s = r * r;
            if (i * i + o * o <= s || (i = e - (this.x + this.width - r),
            i * i + o * o <= s) || (o = n - (this.y + this.height - r),
            i * i + o * o <= s) || (i = e - (this.x + r),
            i * i + o * o <= s))
                return !0
        }
        return !1
    }
    strokeContains(e, n, r, i=.5) {
        const {x: o, y: s, width: a, height: l, radius: c} = this
          , u = r * (1 - i)
          , f = r - u
          , d = o + c
          , h = s + c
          , p = a - c * 2
          , y = l - c * 2
          , v = o + a
          , g = s + l;
        return (e >= o - u && e <= o + f || e >= v - f && e <= v + u) && n >= h && n <= h + y || (n >= s - u && n <= s + f || n >= g - f && n <= g + u) && e >= d && e <= d + p ? !0 : e < d && n < h && op(e, n, d, h, c, f, u) || e > v - c && n < h && op(e, n, v - c, h, c, f, u) || e > v - c && n > g - c && op(e, n, v - c, g - c, c, f, u) || e < d && n > g - c && op(e, n, d, g - c, c, f, u)
    }
    toString() {
        return `[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`
    }
}
const SB = {};
function i2(t, e, n) {
    let r = 2166136261;
    for (let i = 0; i < e; i++)
        r ^= t[i].uid,
        r = Math.imul(r, 16777619),
        r >>>= 0;
    return SB[r] || Fce(t, e, r, n)
}
function Fce(t, e, n, r) {
    const i = {};
    let o = 0;
    for (let a = 0; a < r; a++) {
        const l = a < e ? t[a] : Ae.EMPTY.source;
        i[o++] = l.source,
        i[o++] = l.style
    }
    const s = new Ko(i);
    return SB[n] = s,
    s
}
class vc {
    constructor(e) {
        typeof e == "number" ? this.rawBinaryData = new ArrayBuffer(e) : e instanceof Uint8Array ? this.rawBinaryData = e.buffer : this.rawBinaryData = e,
        this.uint32View = new Uint32Array(this.rawBinaryData),
        this.float32View = new Float32Array(this.rawBinaryData),
        this.size = this.rawBinaryData.byteLength
    }
    get int8View() {
        return this._int8View || (this._int8View = new Int8Array(this.rawBinaryData)),
        this._int8View
    }
    get uint8View() {
        return this._uint8View || (this._uint8View = new Uint8Array(this.rawBinaryData)),
        this._uint8View
    }
    get int16View() {
        return this._int16View || (this._int16View = new Int16Array(this.rawBinaryData)),
        this._int16View
    }
    get int32View() {
        return this._int32View || (this._int32View = new Int32Array(this.rawBinaryData)),
        this._int32View
    }
    get float64View() {
        return this._float64Array || (this._float64Array = new Float64Array(this.rawBinaryData)),
        this._float64Array
    }
    get bigUint64View() {
        return this._bigUint64Array || (this._bigUint64Array = new BigUint64Array(this.rawBinaryData)),
        this._bigUint64Array
    }
    view(e) {
        return this[`${e}View`]
    }
    destroy() {
        this.rawBinaryData = null,
        this._int8View = null,
        this._uint8View = null,
        this._int16View = null,
        this.uint16View = null,
        this._int32View = null,
        this.uint32View = null,
        this.float32View = null
    }
    static sizeOf(e) {
        switch (e) {
        case "int8":
        case "uint8":
            return 1;
        case "int16":
        case "uint16":
            return 2;
        case "int32":
        case "uint32":
        case "float32":
            return 4;
        default:
            throw new Error(`${e} isn't a valid view type`)
        }
    }
}
function z_(t, e) {
    const n = t.byteLength / 8 | 0
      , r = new Float64Array(t,0,n);
    new Float64Array(e,0,n).set(r);
    const o = t.byteLength - n * 8;
    if (o > 0) {
        const s = new Uint8Array(t,n * 8,o);
        new Uint8Array(e,n * 8,o).set(s)
    }
}
const Lce = {
    normal: "normal-npm",
    add: "add-npm",
    screen: "screen-npm"
};
var sn = (t => (t[t.DISABLED = 0] = "DISABLED",
t[t.RENDERING_MASK_ADD = 1] = "RENDERING_MASK_ADD",
t[t.MASK_ACTIVE = 2] = "MASK_ACTIVE",
t[t.INVERSE_MASK_ACTIVE = 3] = "INVERSE_MASK_ACTIVE",
t[t.RENDERING_MASK_REMOVE = 4] = "RENDERING_MASK_REMOVE",
t[t.NONE = 5] = "NONE",
t))(sn || {});
function gd(t, e) {
    return e.alphaMode === "no-premultiply-alpha" && Lce[t] || t
}
const $ce = ["precision mediump float;", "void main(void){", "float test = 0.1;", "%forloop%", "gl_FragColor = vec4(0.0);", "}"].join(`
`);
function Uce(t) {
    let e = "";
    for (let n = 0; n < t; ++n)
        n > 0 && (e += `
else `),
        n < t - 1 && (e += `if(test == ${n}.0){}`);
    return e
}
function CB(t, e) {
    if (t === 0)
        throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");
    const n = e.createShader(e.FRAGMENT_SHADER);
    try {
        for (; ; ) {
            const r = $ce.replace(/%forloop%/gi, Uce(t));
            if (e.shaderSource(n, r),
            e.compileShader(n),
            !e.getShaderParameter(n, e.COMPILE_STATUS))
                t = t / 2 | 0;
            else
                break
        }
    } finally {
        e.deleteShader(n)
    }
    return t
}
let nc = null;
function Gce() {
    var e;
    if (nc)
        return nc;
    const t = rB();
    return nc = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
    nc = CB(nc, t),
    (e = t.getExtension("WEBGL_lose_context")) == null || e.loseContext(),
    nc
}
class Hce {
    constructor() {
        this.ids = Object.create(null),
        this.textures = [],
        this.count = 0
    }
    clear() {
        for (let e = 0; e < this.count; e++) {
            const n = this.textures[e];
            this.textures[e] = null,
            this.ids[n.uid] = null
        }
        this.count = 0
    }
}
class Vce {
    constructor() {
        this.renderPipeId = "batch",
        this.action = "startBatch",
        this.start = 0,
        this.size = 0,
        this.textures = new Hce,
        this.blendMode = "normal",
        this.topology = "triangle-strip",
        this.canBundle = !0
    }
    destroy() {
        this.textures = null,
        this.gpuBindGroup = null,
        this.bindGroup = null,
        this.batcher = null
    }
}
const AB = [];
let j_ = 0;
function DT() {
    return j_ > 0 ? AB[--j_] : new Vce
}
function BT(t) {
    AB[j_++] = t
}
let zu = 0;
const TB = class PB {
    constructor(e) {
        this.uid = Ut("batcher"),
        this.dirty = !0,
        this.batchIndex = 0,
        this.batches = [],
        this._elements = [],
        e = {
            ...PB.defaultOptions,
            ...e
        },
        e.maxTextures || (Fe("v8.8.0", "maxTextures is a required option for Batcher now, please pass it in the options"),
        e.maxTextures = Gce());
        const {maxTextures: n, attributesInitialSize: r, indicesInitialSize: i} = e;
        this.attributeBuffer = new vc(r * 4),
        this.indexBuffer = new Uint16Array(i),
        this.maxTextures = n
    }
    begin() {
        this.elementSize = 0,
        this.elementStart = 0,
        this.indexSize = 0,
        this.attributeSize = 0;
        for (let e = 0; e < this.batchIndex; e++)
            BT(this.batches[e]);
        this.batchIndex = 0,
        this._batchIndexStart = 0,
        this._batchIndexSize = 0,
        this.dirty = !0
    }
    add(e) {
        this._elements[this.elementSize++] = e,
        e._indexStart = this.indexSize,
        e._attributeStart = this.attributeSize,
        e._batcher = this,
        this.indexSize += e.indexSize,
        this.attributeSize += e.attributeSize * this.vertexSize
    }
    checkAndUpdateTexture(e, n) {
        const r = e._batch.textures.ids[n._source.uid];
        return !r && r !== 0 ? !1 : (e._textureId = r,
        e.texture = n,
        !0)
    }
    updateElement(e) {
        this.dirty = !0;
        const n = this.attributeBuffer;
        e.packAsQuad ? this.packQuadAttributes(e, n.float32View, n.uint32View, e._attributeStart, e._textureId) : this.packAttributes(e, n.float32View, n.uint32View, e._attributeStart, e._textureId)
    }
    break(e) {
        const n = this._elements;
        if (!n[this.elementStart])
            return;
        let r = DT()
          , i = r.textures;
        i.clear();
        const o = n[this.elementStart];
        let s = gd(o.blendMode, o.texture._source)
          , a = o.topology;
        this.attributeSize * 4 > this.attributeBuffer.size && this._resizeAttributeBuffer(this.attributeSize * 4),
        this.indexSize > this.indexBuffer.length && this._resizeIndexBuffer(this.indexSize);
        const l = this.attributeBuffer.float32View
          , c = this.attributeBuffer.uint32View
          , u = this.indexBuffer;
        let f = this._batchIndexSize
          , d = this._batchIndexStart
          , h = "startBatch";
        const p = this.maxTextures;
        for (let y = this.elementStart; y < this.elementSize; ++y) {
            const v = n[y];
            n[y] = null;
            const m = v.texture._source
              , _ = gd(v.blendMode, m)
              , x = s !== _ || a !== v.topology;
            if (m._batchTick === zu && !x) {
                v._textureId = m._textureBindLocation,
                f += v.indexSize,
                v.packAsQuad ? (this.packQuadAttributes(v, l, c, v._attributeStart, v._textureId),
                this.packQuadIndex(u, v._indexStart, v._attributeStart / this.vertexSize)) : (this.packAttributes(v, l, c, v._attributeStart, v._textureId),
                this.packIndex(v, u, v._indexStart, v._attributeStart / this.vertexSize)),
                v._batch = r;
                continue
            }
            m._batchTick = zu,
            (i.count >= p || x) && (this._finishBatch(r, d, f - d, i, s, a, e, h),
            h = "renderBatch",
            d = f,
            s = _,
            a = v.topology,
            r = DT(),
            i = r.textures,
            i.clear(),
            ++zu),
            v._textureId = m._textureBindLocation = i.count,
            i.ids[m.uid] = i.count,
            i.textures[i.count++] = m,
            v._batch = r,
            f += v.indexSize,
            v.packAsQuad ? (this.packQuadAttributes(v, l, c, v._attributeStart, v._textureId),
            this.packQuadIndex(u, v._indexStart, v._attributeStart / this.vertexSize)) : (this.packAttributes(v, l, c, v._attributeStart, v._textureId),
            this.packIndex(v, u, v._indexStart, v._attributeStart / this.vertexSize))
        }
        i.count > 0 && (this._finishBatch(r, d, f - d, i, s, a, e, h),
        d = f,
        ++zu),
        this.elementStart = this.elementSize,
        this._batchIndexStart = d,
        this._batchIndexSize = f
    }
    _finishBatch(e, n, r, i, o, s, a, l) {
        e.gpuBindGroup = null,
        e.bindGroup = null,
        e.action = l,
        e.batcher = this,
        e.textures = i,
        e.blendMode = o,
        e.topology = s,
        e.start = n,
        e.size = r,
        ++zu,
        this.batches[this.batchIndex++] = e,
        a.add(e)
    }
    finish(e) {
        this.break(e)
    }
    ensureAttributeBuffer(e) {
        e * 4 <= this.attributeBuffer.size || this._resizeAttributeBuffer(e * 4)
    }
    ensureIndexBuffer(e) {
        e <= this.indexBuffer.length || this._resizeIndexBuffer(e)
    }
    _resizeAttributeBuffer(e) {
        const n = Math.max(e, this.attributeBuffer.size * 2)
          , r = new vc(n);
        z_(this.attributeBuffer.rawBinaryData, r.rawBinaryData),
        this.attributeBuffer = r
    }
    _resizeIndexBuffer(e) {
        const n = this.indexBuffer;
        let r = Math.max(e, n.length * 1.5);
        r += r % 2;
        const i = r > 65535 ? new Uint32Array(r) : new Uint16Array(r);
        if (i.BYTES_PER_ELEMENT !== n.BYTES_PER_ELEMENT)
            for (let o = 0; o < n.length; o++)
                i[o] = n[o];
        else
            z_(n.buffer, i.buffer);
        this.indexBuffer = i
    }
    packQuadIndex(e, n, r) {
        e[n] = r + 0,
        e[n + 1] = r + 1,
        e[n + 2] = r + 2,
        e[n + 3] = r + 0,
        e[n + 4] = r + 2,
        e[n + 5] = r + 3
    }
    packIndex(e, n, r, i) {
        const o = e.indices
          , s = e.indexSize
          , a = e.indexOffset
          , l = e.attributeOffset;
        for (let c = 0; c < s; c++)
            n[r++] = i + o[c + a] - l
    }
    destroy() {
        for (let e = 0; e < this.batches.length; e++)
            BT(this.batches[e]);
        this.batches = null;
        for (let e = 0; e < this._elements.length; e++)
            this._elements[e]._batch = null;
        this._elements = null,
        this.indexBuffer = null,
        this.attributeBuffer.destroy(),
        this.attributeBuffer = null
    }
}
;
TB.defaultOptions = {
    maxTextures: null,
    attributesInitialSize: 4,
    indicesInitialSize: 6
};
let zce = TB;
var it = (t => (t[t.MAP_READ = 1] = "MAP_READ",
t[t.MAP_WRITE = 2] = "MAP_WRITE",
t[t.COPY_SRC = 4] = "COPY_SRC",
t[t.COPY_DST = 8] = "COPY_DST",
t[t.INDEX = 16] = "INDEX",
t[t.VERTEX = 32] = "VERTEX",
t[t.UNIFORM = 64] = "UNIFORM",
t[t.STORAGE = 128] = "STORAGE",
t[t.INDIRECT = 256] = "INDIRECT",
t[t.QUERY_RESOLVE = 512] = "QUERY_RESOLVE",
t[t.STATIC = 1024] = "STATIC",
t))(it || {});
let zr = class extends Jr {
    constructor(e) {
        let {data: n, size: r} = e;
        const {usage: i, label: o, shrinkToFit: s} = e;
        super(),
        this.uid = Ut("buffer"),
        this._resourceType = "buffer",
        this._resourceId = Ut("resource"),
        this._touched = 0,
        this._updateID = 1,
        this._dataInt32 = null,
        this.shrinkToFit = !0,
        this.destroyed = !1,
        n instanceof Array && (n = new Float32Array(n)),
        this._data = n,
        r ?? (r = n == null ? void 0 : n.byteLength);
        const a = !!n;
        this.descriptor = {
            size: r,
            usage: i,
            mappedAtCreation: a,
            label: o
        },
        this.shrinkToFit = s ?? !0
    }
    get data() {
        return this._data
    }
    set data(e) {
        this.setDataWithSize(e, e.length, !0)
    }
    get dataInt32() {
        return this._dataInt32 || (this._dataInt32 = new Int32Array(this.data.buffer)),
        this._dataInt32
    }
    get static() {
        return !!(this.descriptor.usage & it.STATIC)
    }
    set static(e) {
        e ? this.descriptor.usage |= it.STATIC : this.descriptor.usage &= ~it.STATIC
    }
    setDataWithSize(e, n, r) {
        if (this._updateID++,
        this._updateSize = n * e.BYTES_PER_ELEMENT,
        this._data === e) {
            r && this.emit("update", this);
            return
        }
        const i = this._data;
        if (this._data = e,
        this._dataInt32 = null,
        !i || i.length !== e.length) {
            !this.shrinkToFit && i && e.byteLength < i.byteLength ? r && this.emit("update", this) : (this.descriptor.size = e.byteLength,
            this._resourceId = Ut("resource"),
            this.emit("change", this));
            return
        }
        r && this.emit("update", this)
    }
    update(e) {
        this._updateSize = e ?? this._updateSize,
        this._updateID++,
        this.emit("update", this)
    }
    destroy() {
        this.destroyed = !0,
        this.emit("destroy", this),
        this.emit("change", this),
        this._data = null,
        this.descriptor = null,
        this.removeAllListeners()
    }
}
;
function IB(t, e) {
    if (!(t instanceof zr)) {
        let n = e ? it.INDEX : it.VERTEX;
        t instanceof Array && (e ? (t = new Uint32Array(t),
        n = it.INDEX | it.COPY_DST) : (t = new Float32Array(t),
        n = it.VERTEX | it.COPY_DST)),
        t = new zr({
            data: t,
            label: e ? "index-mesh-buffer" : "vertex-mesh-buffer",
            usage: n
        })
    }
    return t
}
function jce(t, e, n) {
    const r = t.getAttribute(e);
    if (!r)
        return n.minX = 0,
        n.minY = 0,
        n.maxX = 0,
        n.maxY = 0,
        n;
    const i = r.buffer.data;
    let o = 1 / 0
      , s = 1 / 0
      , a = -1 / 0
      , l = -1 / 0;
    const c = i.BYTES_PER_ELEMENT
      , u = (r.offset || 0) / c
      , f = (r.stride || 2 * 4) / c;
    for (let d = u; d < i.length; d += f) {
        const h = i[d]
          , p = i[d + 1];
        h > a && (a = h),
        p > l && (l = p),
        h < o && (o = h),
        p < s && (s = p)
    }
    return n.minX = o,
    n.minY = s,
    n.maxX = a,
    n.maxY = l,
    n
}
function Wce(t) {
    return (t instanceof zr || Array.isArray(t) || t.BYTES_PER_ELEMENT) && (t = {
        buffer: t
    }),
    t.buffer = IB(t.buffer, !1),
    t
}
class Jd extends Jr {
    constructor(e={}) {
        super(),
        this.uid = Ut("geometry"),
        this._layoutKey = 0,
        this.instanceCount = 1,
        this._bounds = new Vn,
        this._boundsDirty = !0;
        const {attributes: n, indexBuffer: r, topology: i} = e;
        if (this.buffers = [],
        this.attributes = {},
        n)
            for (const o in n)
                this.addAttribute(o, n[o]);
        this.instanceCount = e.instanceCount ?? 1,
        r && this.addIndex(r),
        this.topology = i || "triangle-list"
    }
    onBufferUpdate() {
        this._boundsDirty = !0,
        this.emit("update", this)
    }
    getAttribute(e) {
        return this.attributes[e]
    }
    getIndex() {
        return this.indexBuffer
    }
    getBuffer(e) {
        return this.getAttribute(e).buffer
    }
    getSize() {
        for (const e in this.attributes) {
            const n = this.attributes[e];
            return n.buffer.data.length / (n.stride / 4 || n.size)
        }
        return 0
    }
    addAttribute(e, n) {
        const r = Wce(n);
        this.buffers.indexOf(r.buffer) === -1 && (this.buffers.push(r.buffer),
        r.buffer.on("update", this.onBufferUpdate, this),
        r.buffer.on("change", this.onBufferUpdate, this)),
        this.attributes[e] = r
    }
    addIndex(e) {
        this.indexBuffer = IB(e, !0),
        this.buffers.push(this.indexBuffer)
    }
    get bounds() {
        return this._boundsDirty ? (this._boundsDirty = !1,
        jce(this, "aPosition", this._bounds)) : this._bounds
    }
    destroy(e=!1) {
        this.emit("destroy", this),
        this.removeAllListeners(),
        e && this.buffers.forEach(n => n.destroy()),
        this.attributes = null,
        this.buffers = null,
        this.indexBuffer = null,
        this._bounds = null
    }
}
const Yce = new Float32Array(1)
  , Xce = new Uint32Array(1);
class Kce extends Jd {
    constructor() {
        const n = new zr({
            data: Yce,
            label: "attribute-batch-buffer",
            usage: it.VERTEX | it.COPY_DST,
            shrinkToFit: !1
        })
          , r = new zr({
            data: Xce,
            label: "index-batch-buffer",
            usage: it.INDEX | it.COPY_DST,
            shrinkToFit: !1
        })
          , i = 6 * 4;
        super({
            attributes: {
                aPosition: {
                    buffer: n,
                    format: "float32x2",
                    stride: i,
                    offset: 0
                },
                aUV: {
                    buffer: n,
                    format: "float32x2",
                    stride: i,
                    offset: 2 * 4
                },
                aColor: {
                    buffer: n,
                    format: "unorm8x4",
                    stride: i,
                    offset: 4 * 4
                },
                aTextureIdAndRound: {
                    buffer: n,
                    format: "uint16x2",
                    stride: i,
                    offset: 5 * 4
                }
            },
            indexBuffer: r
        })
    }
}
function kT(t, e, n) {
    if (t)
        for (const r in t) {
            const i = r.toLocaleLowerCase()
              , o = e[i];
            if (o) {
                let s = t[r];
                r === "header" && (s = s.replace(/@in\s+[^;]+;\s*/g, "").replace(/@out\s+[^;]+;\s*/g, "")),
                n && o.push(`//----${n}----//`),
                o.push(s)
            } else
                Ne(`${r} placement hook does not exist in shader`)
        }
}
const qce = /\{\{(.*?)\}\}/g;
function NT(t) {
    var r;
    const e = {};
    return (((r = t.match(qce)) == null ? void 0 : r.map(i => i.replace(/[{()}]/g, ""))) ?? []).forEach(i => {
        e[i] = []
    }
    ),
    e
}
function FT(t, e) {
    let n;
    const r = /@in\s+([^;]+);/g;
    for (; (n = r.exec(t)) !== null; )
        e.push(n[1])
}
function LT(t, e, n=!1) {
    const r = [];
    FT(e, r),
    t.forEach(a => {
        a.header && FT(a.header, r)
    }
    );
    const i = r;
    n && i.sort();
    const o = i.map( (a, l) => `       @location(${l}) ${a},`).join(`
`);
    let s = e.replace(/@in\s+[^;]+;\s*/g, "");
    return s = s.replace("{{in}}", `
${o}
`),
    s
}
function $T(t, e) {
    let n;
    const r = /@out\s+([^;]+);/g;
    for (; (n = r.exec(t)) !== null; )
        e.push(n[1])
}
function Zce(t) {
    const n = /\b(\w+)\s*:/g.exec(t);
    return n ? n[1] : ""
}
function Jce(t) {
    const e = /@.*?\s+/g;
    return t.replace(e, "")
}
function Qce(t, e) {
    const n = [];
    $T(e, n),
    t.forEach(l => {
        l.header && $T(l.header, n)
    }
    );
    let r = 0;
    const i = n.sort().map(l => l.indexOf("builtin") > -1 ? l : `@location(${r++}) ${l}`).join(`,
`)
      , o = n.sort().map(l => `       var ${Jce(l)};`).join(`
`)
      , s = `return VSOutput(
            ${n.sort().map(l => ` ${Zce(l)}`).join(`,
`)});`;
    let a = e.replace(/@out\s+[^;]+;\s*/g, "");
    return a = a.replace("{{struct}}", `
${i}
`),
    a = a.replace("{{start}}", `
${o}
`),
    a = a.replace("{{return}}", `
${s}
`),
    a
}
function UT(t, e) {
    let n = t;
    for (const r in e) {
        const i = e[r];
        i.join(`
`).length ? n = n.replace(`{{${r}}}`, `//-----${r} START-----//
${i.join(`
`)}
//----${r} FINISH----//`) : n = n.replace(`{{${r}}}`, "")
    }
    return n
}
const Ns = Object.create(null)
  , N1 = new Map;
let eue = 0;
function tue({template: t, bits: e}) {
    const n = OB(t, e);
    if (Ns[n])
        return Ns[n];
    const {vertex: r, fragment: i} = rue(t, e);
    return Ns[n] = RB(r, i, e),
    Ns[n]
}
function nue({template: t, bits: e}) {
    const n = OB(t, e);
    return Ns[n] || (Ns[n] = RB(t.vertex, t.fragment, e)),
    Ns[n]
}
function rue(t, e) {
    const n = e.map(s => s.vertex).filter(s => !!s)
      , r = e.map(s => s.fragment).filter(s => !!s);
    let i = LT(n, t.vertex, !0);
    i = Qce(n, i);
    const o = LT(r, t.fragment, !0);
    return {
        vertex: i,
        fragment: o
    }
}
function OB(t, e) {
    return e.map(n => (N1.has(n) || N1.set(n, eue++),
    N1.get(n))).sort( (n, r) => n - r).join("-") + t.vertex + t.fragment
}
function RB(t, e, n) {
    const r = NT(t)
      , i = NT(e);
    return n.forEach(o => {
        kT(o.vertex, r, o.name),
        kT(o.fragment, i, o.name)
    }
    ),
    {
        vertex: UT(t, r),
        fragment: UT(e, i)
    }
}
const iue = `
    @in aPosition: vec2<f32>;
    @in aUV: vec2<f32>;

    @out @builtin(position) vPosition: vec4<f32>;
    @out vUV : vec2<f32>;
    @out vColor : vec4<f32>;

    {{header}}

    struct VSOutput {
        {{struct}}
    };

    @vertex
    fn main( {{in}} ) -> VSOutput {

        var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
        var modelMatrix = mat3x3<f32>(
            1.0, 0.0, 0.0,
            0.0, 1.0, 0.0,
            0.0, 0.0, 1.0
          );
        var position = aPosition;
        var uv = aUV;

        {{start}}

        vColor = vec4<f32>(1., 1., 1., 1.);

        {{main}}

        vUV = uv;

        var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;

        vPosition =  vec4<f32>((modelViewProjectionMatrix *  vec3<f32>(position, 1.0)).xy, 0.0, 1.0);

        vColor *= globalUniforms.uWorldColorAlpha;

        {{end}}

        {{return}}
    };
`
  , oue = `
    @in vUV : vec2<f32>;
    @in vColor : vec4<f32>;

    {{header}}

    @fragment
    fn main(
        {{in}}
      ) -> @location(0) vec4<f32> {

        {{start}}

        var outColor:vec4<f32>;

        {{main}}

        var finalColor:vec4<f32> = outColor * vColor;

        {{end}}

        return finalColor;
      };
`
  , sue = `
    in vec2 aPosition;
    in vec2 aUV;

    out vec4 vColor;
    out vec2 vUV;

    {{header}}

    void main(void){

        mat3 worldTransformMatrix = uWorldTransformMatrix;
        mat3 modelMatrix = mat3(
            1.0, 0.0, 0.0,
            0.0, 1.0, 0.0,
            0.0, 0.0, 1.0
          );
        vec2 position = aPosition;
        vec2 uv = aUV;

        {{start}}

        vColor = vec4(1.);

        {{main}}

        vUV = uv;

        mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;

        gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);

        vColor *= uWorldColorAlpha;

        {{end}}
    }
`
  , aue = `

    in vec4 vColor;
    in vec2 vUV;

    out vec4 finalColor;

    {{header}}

    void main(void) {

        {{start}}

        vec4 outColor;

        {{main}}

        finalColor = outColor * vColor;

        {{end}}
    }
`
  , lue = {
    name: "global-uniforms-bit",
    vertex: {
        header: `
        struct GlobalUniforms {
            uProjectionMatrix:mat3x3<f32>,
            uWorldTransformMatrix:mat3x3<f32>,
            uWorldColorAlpha: vec4<f32>,
            uResolution: vec2<f32>,
        }

        @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
        `
    }
}
  , cue = {
    name: "global-uniforms-bit",
    vertex: {
        header: `
          uniform mat3 uProjectionMatrix;
          uniform mat3 uWorldTransformMatrix;
          uniform vec4 uWorldColorAlpha;
          uniform vec2 uResolution;
        `
    }
};
function Qd({bits: t, name: e}) {
    const n = tue({
        template: {
            fragment: oue,
            vertex: iue
        },
        bits: [lue, ...t]
    });
    return pa.from({
        name: e,
        vertex: {
            source: n.vertex,
            entryPoint: "main"
        },
        fragment: {
            source: n.fragment,
            entryPoint: "main"
        }
    })
}
function eh({bits: t, name: e}) {
    return new Fl({
        name: e,
        ...nue({
            template: {
                vertex: sue,
                fragment: aue
            },
            bits: [cue, ...t]
        })
    })
}
const o2 = {
    name: "color-bit",
    vertex: {
        header: `
            @in aColor: vec4<f32>;
        `,
        main: `
            vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
        `
    }
}
  , s2 = {
    name: "color-bit",
    vertex: {
        header: `
            in vec4 aColor;
        `,
        main: `
            vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
        `
    }
}
  , F1 = {};
function uue(t) {
    const e = [];
    if (t === 1)
        e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),
        e.push("@group(1) @binding(1) var textureSampler1: sampler;");
    else {
        let n = 0;
        for (let r = 0; r < t; r++)
            e.push(`@group(1) @binding(${n++}) var textureSource${r + 1}: texture_2d<f32>;`),
            e.push(`@group(1) @binding(${n++}) var textureSampler${r + 1}: sampler;`)
    }
    return e.join(`
`)
}
function fue(t) {
    const e = [];
    if (t === 1)
        e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");
    else {
        e.push("switch vTextureId {");
        for (let n = 0; n < t; n++)
            n === t - 1 ? e.push("  default:{") : e.push(`  case ${n}:{`),
            e.push(`      outColor = textureSampleGrad(textureSource${n + 1}, textureSampler${n + 1}, vUV, uvDx, uvDy);`),
            e.push("      break;}");
        e.push("}")
    }
    return e.join(`
`)
}
function a2(t) {
    return F1[t] || (F1[t] = {
        name: "texture-batch-bit",
        vertex: {
            header: `
                @in aTextureIdAndRound: vec2<u32>;
                @out @interpolate(flat) vTextureId : u32;
            `,
            main: `
                vTextureId = aTextureIdAndRound.y;
            `,
            end: `
                if(aTextureIdAndRound.x == 1)
                {
                    vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
                }
            `
        },
        fragment: {
            header: `
                @in @interpolate(flat) vTextureId: u32;

                ${uue(t)}
            `,
            main: `
                var uvDx = dpdx(vUV);
                var uvDy = dpdy(vUV);

                ${fue(t)}
            `
        }
    }),
    F1[t]
}
const L1 = {};
function due(t) {
    const e = [];
    for (let n = 0; n < t; n++)
        n > 0 && e.push("else"),
        n < t - 1 && e.push(`if(vTextureId < ${n}.5)`),
        e.push("{"),
        e.push(`	outColor = texture(uTextures[${n}], vUV);`),
        e.push("}");
    return e.join(`
`)
}
function l2(t) {
    return L1[t] || (L1[t] = {
        name: "texture-batch-bit",
        vertex: {
            header: `
                in vec2 aTextureIdAndRound;
                out float vTextureId;

            `,
            main: `
                vTextureId = aTextureIdAndRound.y;
            `,
            end: `
                if(aTextureIdAndRound.x == 1.)
                {
                    gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
                }
            `
        },
        fragment: {
            header: `
                in float vTextureId;

                uniform sampler2D uTextures[${t}];

            `,
            main: `

                ${due(t)}
            `
        }
    }),
    L1[t]
}
const th = {
    name: "round-pixels-bit",
    vertex: {
        header: `
            fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
            {
                return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
            }
        `
    }
}
  , nh = {
    name: "round-pixels-bit",
    vertex: {
        header: `
            vec2 roundPixels(vec2 position, vec2 targetSize)
            {
                return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
            }
        `
    }
}
  , GT = {};
function c2(t) {
    let e = GT[t];
    if (e)
        return e;
    const n = new Int32Array(t);
    for (let r = 0; r < t; r++)
        n[r] = r;
    return e = GT[t] = new gr({
        uTextures: {
            value: n,
            type: "i32",
            size: t
        }
    },{
        isStatic: !0
    }),
    e
}
class hue extends yi {
    constructor(e) {
        const n = eh({
            name: "batch",
            bits: [s2, l2(e), nh]
        })
          , r = Qd({
            name: "batch",
            bits: [o2, a2(e), th]
        });
        super({
            glProgram: n,
            gpuProgram: r,
            resources: {
                batchSamplers: c2(e)
            }
        })
    }
}
let $1 = null;
const MB = class DB extends zce {
    constructor(e) {
        super(e),
        this.geometry = new Kce,
        this.name = DB.extension.name,
        this.vertexSize = 6,
        $1 ?? ($1 = new hue(e.maxTextures)),
        this.shader = $1
    }
    packAttributes(e, n, r, i, o) {
        const s = o << 16 | e.roundPixels & 65535
          , a = e.transform
          , l = a.a
          , c = a.b
          , u = a.c
          , f = a.d
          , d = a.tx
          , h = a.ty
          , {positions: p, uvs: y} = e
          , v = e.color
          , g = e.attributeOffset
          , m = g + e.attributeSize;
        for (let _ = g; _ < m; _++) {
            const x = _ * 2
              , b = p[x]
              , w = p[x + 1];
            n[i++] = l * b + u * w + d,
            n[i++] = f * w + c * b + h,
            n[i++] = y[x],
            n[i++] = y[x + 1],
            r[i++] = v,
            r[i++] = s
        }
    }
    packQuadAttributes(e, n, r, i, o) {
        const s = e.texture
          , a = e.transform
          , l = a.a
          , c = a.b
          , u = a.c
          , f = a.d
          , d = a.tx
          , h = a.ty
          , p = e.bounds
          , y = p.maxX
          , v = p.minX
          , g = p.maxY
          , m = p.minY
          , _ = s.uvs
          , x = e.color
          , b = o << 16 | e.roundPixels & 65535;
        n[i + 0] = l * v + u * m + d,
        n[i + 1] = f * m + c * v + h,
        n[i + 2] = _.x0,
        n[i + 3] = _.y0,
        r[i + 4] = x,
        r[i + 5] = b,
        n[i + 6] = l * y + u * m + d,
        n[i + 7] = f * m + c * y + h,
        n[i + 8] = _.x1,
        n[i + 9] = _.y1,
        r[i + 10] = x,
        r[i + 11] = b,
        n[i + 12] = l * y + u * g + d,
        n[i + 13] = f * g + c * y + h,
        n[i + 14] = _.x2,
        n[i + 15] = _.y2,
        r[i + 16] = x,
        r[i + 17] = b,
        n[i + 18] = l * v + u * g + d,
        n[i + 19] = f * g + c * v + h,
        n[i + 20] = _.x3,
        n[i + 21] = _.y3,
        r[i + 22] = x,
        r[i + 23] = b
    }
}
;
MB.extension = {
    type: [V.Batcher],
    name: "default"
};
let u2 = MB;
function pue(t, e, n, r, i, o, s, a=null) {
    let l = 0;
    n *= e,
    i *= o;
    const c = a.a
      , u = a.b
      , f = a.c
      , d = a.d
      , h = a.tx
      , p = a.ty;
    for (; l < s; ) {
        const y = t[n]
          , v = t[n + 1];
        r[i] = c * y + f * v + h,
        r[i + 1] = u * y + d * v + p,
        i += o,
        n += e,
        l++
    }
}
function gue(t, e, n, r) {
    let i = 0;
    for (e *= n; i < r; )
        t[e] = 0,
        t[e + 1] = 0,
        e += n,
        i++
}
function BB(t, e, n, r, i) {
    const o = e.a
      , s = e.b
      , a = e.c
      , l = e.d
      , c = e.tx
      , u = e.ty;
    n || (n = 0),
    r || (r = 2),
    i || (i = t.length / r - n);
    let f = n * r;
    for (let d = 0; d < i; d++) {
        const h = t[f]
          , p = t[f + 1];
        t[f] = o * h + a * p + c,
        t[f + 1] = s * h + l * p + u,
        f += r
    }
}
const mue = new Oe;
class f2 {
    constructor() {
        this.packAsQuad = !1,
        this.batcherName = "default",
        this.topology = "triangle-list",
        this.applyTransform = !0,
        this.roundPixels = 0,
        this._batcher = null,
        this._batch = null
    }
    get uvs() {
        return this.geometryData.uvs
    }
    get positions() {
        return this.geometryData.vertices
    }
    get indices() {
        return this.geometryData.indices
    }
    get blendMode() {
        return this.renderable && this.applyTransform ? this.renderable.groupBlendMode : "normal"
    }
    get color() {
        const e = this.baseColor
          , n = e >> 16 | e & 65280 | (e & 255) << 16
          , r = this.renderable;
        return r ? LD(n, r.groupColor) + (this.alpha * r.groupAlpha * 255 << 24) : n + (this.alpha * 255 << 24)
    }
    get transform() {
        var e;
        return ((e = this.renderable) == null ? void 0 : e.groupTransform) || mue
    }
    copyTo(e) {
        e.indexOffset = this.indexOffset,
        e.indexSize = this.indexSize,
        e.attributeOffset = this.attributeOffset,
        e.attributeSize = this.attributeSize,
        e.baseColor = this.baseColor,
        e.alpha = this.alpha,
        e.texture = this.texture,
        e.geometryData = this.geometryData,
        e.topology = this.topology
    }
    reset() {
        this.applyTransform = !0,
        this.renderable = null,
        this.topology = "triangle-list"
    }
}
const md = {
    extension: {
        type: V.ShapeBuilder,
        name: "circle"
    },
    build(t, e) {
        let n, r, i, o, s, a;
        if (t.type === "circle") {
            const x = t;
            if (s = a = x.radius,
            s <= 0)
                return !1;
            n = x.x,
            r = x.y,
            i = o = 0
        } else if (t.type === "ellipse") {
            const x = t;
            if (s = x.halfWidth,
            a = x.halfHeight,
            s <= 0 || a <= 0)
                return !1;
            n = x.x,
            r = x.y,
            i = o = 0
        } else {
            const x = t
              , b = x.width / 2
              , w = x.height / 2;
            n = x.x + b,
            r = x.y + w,
            s = a = Math.max(0, Math.min(x.radius, Math.min(b, w))),
            i = b - s,
            o = w - a
        }
        if (i < 0 || o < 0)
            return !1;
        const l = Math.ceil(2.3 * Math.sqrt(s + a))
          , c = l * 8 + (i ? 4 : 0) + (o ? 4 : 0);
        if (c === 0)
            return !1;
        if (l === 0)
            return e[0] = e[6] = n + i,
            e[1] = e[3] = r + o,
            e[2] = e[4] = n - i,
            e[5] = e[7] = r - o,
            !0;
        let u = 0
          , f = l * 4 + (i ? 2 : 0) + 2
          , d = f
          , h = c
          , p = i + s
          , y = o
          , v = n + p
          , g = n - p
          , m = r + y;
        if (e[u++] = v,
        e[u++] = m,
        e[--f] = m,
        e[--f] = g,
        o) {
            const x = r - y;
            e[d++] = g,
            e[d++] = x,
            e[--h] = x,
            e[--h] = v
        }
        for (let x = 1; x < l; x++) {
            const b = Math.PI / 2 * (x / l)
              , w = i + Math.cos(b) * s
              , E = o + Math.sin(b) * a
              , S = n + w
              , P = n - w
              , C = r + E
              , A = r - E;
            e[u++] = S,
            e[u++] = C,
            e[--f] = C,
            e[--f] = P,
            e[d++] = P,
            e[d++] = A,
            e[--h] = A,
            e[--h] = S
        }
        p = i,
        y = o + a,
        v = n + p,
        g = n - p,
        m = r + y;
        const _ = r - y;
        return e[u++] = v,
        e[u++] = m,
        e[--h] = _,
        e[--h] = v,
        i && (e[u++] = g,
        e[u++] = m,
        e[--h] = _,
        e[--h] = g),
        !0
    },
    triangulate(t, e, n, r, i, o) {
        if (t.length === 0)
            return;
        let s = 0
          , a = 0;
        for (let u = 0; u < t.length; u += 2)
            s += t[u],
            a += t[u + 1];
        s /= t.length / 2,
        a /= t.length / 2;
        let l = r;
        e[l * n] = s,
        e[l * n + 1] = a;
        const c = l++;
        for (let u = 0; u < t.length; u += 2)
            e[l * n] = t[u],
            e[l * n + 1] = t[u + 1],
            u > 0 && (i[o++] = l,
            i[o++] = c,
            i[o++] = l - 1),
            l++;
        i[o++] = c + 1,
        i[o++] = c,
        i[o++] = l - 1
    }
}
  , vue = {
    ...md,
    extension: {
        ...md.extension,
        name: "ellipse"
    }
}
  , yue = {
    ...md,
    extension: {
        ...md.extension,
        name: "roundedRectangle"
    }
}
  , kB = 1e-4
  , HT = 1e-4;
function _ue(t) {
    const e = t.length;
    if (e < 6)
        return 1;
    let n = 0;
    for (let r = 0, i = t[e - 2], o = t[e - 1]; r < e; r += 2) {
        const s = t[r]
          , a = t[r + 1];
        n += (s - i) * (a + o),
        i = s,
        o = a
    }
    return n < 0 ? -1 : 1
}
function VT(t, e, n, r, i, o, s, a) {
    const l = t - n * i
      , c = e - r * i
      , u = t + n * o
      , f = e + r * o;
    let d, h;
    s ? (d = r,
    h = -n) : (d = -r,
    h = n);
    const p = l + d
      , y = c + h
      , v = u + d
      , g = f + h;
    return a.push(p, y),
    a.push(v, g),
    2
}
function Ea(t, e, n, r, i, o, s, a) {
    const l = n - t
      , c = r - e;
    let u = Math.atan2(l, c)
      , f = Math.atan2(i - t, o - e);
    a && u < f ? u += Math.PI * 2 : !a && u > f && (f += Math.PI * 2);
    let d = u;
    const h = f - u
      , p = Math.abs(h)
      , y = Math.sqrt(l * l + c * c)
      , v = (15 * p * Math.sqrt(y) / Math.PI >> 0) + 1
      , g = h / v;
    if (d += g,
    a) {
        s.push(t, e),
        s.push(n, r);
        for (let m = 1, _ = d; m < v; m++,
        _ += g)
            s.push(t, e),
            s.push(t + Math.sin(_) * y, e + Math.cos(_) * y);
        s.push(t, e),
        s.push(i, o)
    } else {
        s.push(n, r),
        s.push(t, e);
        for (let m = 1, _ = d; m < v; m++,
        _ += g)
            s.push(t + Math.sin(_) * y, e + Math.cos(_) * y),
            s.push(t, e);
        s.push(i, o),
        s.push(t, e)
    }
    return v * 2
}
function xue(t, e, n, r, i, o) {
    const s = kB;
    if (t.length === 0)
        return;
    const a = e;
    let l = a.alignment;
    if (e.alignment !== .5) {
        let K = _ue(t);
        n && (K *= -1),
        l = (l - .5) * K + .5
    }
    const c = new Gt(t[0],t[1])
      , u = new Gt(t[t.length - 2],t[t.length - 1])
      , f = r
      , d = Math.abs(c.x - u.x) < s && Math.abs(c.y - u.y) < s;
    if (f) {
        t = t.slice(),
        d && (t.pop(),
        t.pop(),
        u.set(t[t.length - 2], t[t.length - 1]));
        const K = (c.x + u.x) * .5
          , fe = (u.y + c.y) * .5;
        t.unshift(K, fe),
        t.push(K, fe)
    }
    const h = i
      , p = t.length / 2;
    let y = t.length;
    const v = h.length / 2
      , g = a.width / 2
      , m = g * g
      , _ = a.miterLimit * a.miterLimit;
    let x = t[0]
      , b = t[1]
      , w = t[2]
      , E = t[3]
      , S = 0
      , P = 0
      , C = -(b - E)
      , A = x - w
      , T = 0
      , I = 0
      , B = Math.sqrt(C * C + A * A);
    C /= B,
    A /= B,
    C *= g,
    A *= g;
    const G = l
      , N = (1 - G) * 2
      , U = G * 2;
    f || (a.cap === "round" ? y += Ea(x - C * (N - U) * .5, b - A * (N - U) * .5, x - C * N, b - A * N, x + C * U, b + A * U, h, !0) + 2 : a.cap === "square" && (y += VT(x, b, C, A, N, U, !0, h))),
    h.push(x - C * N, b - A * N),
    h.push(x + C * U, b + A * U);
    for (let K = 1; K < p - 1; ++K) {
        x = t[(K - 1) * 2],
        b = t[(K - 1) * 2 + 1],
        w = t[K * 2],
        E = t[K * 2 + 1],
        S = t[(K + 1) * 2],
        P = t[(K + 1) * 2 + 1],
        C = -(b - E),
        A = x - w,
        B = Math.sqrt(C * C + A * A),
        C /= B,
        A /= B,
        C *= g,
        A *= g,
        T = -(E - P),
        I = w - S,
        B = Math.sqrt(T * T + I * I),
        T /= B,
        I /= B,
        T *= g,
        I *= g;
        const fe = w - x
          , ue = b - E
          , X = w - S
          , ie = P - E
          , ge = fe * X + ue * ie
          , F = ue * X - ie * fe
          , q = F < 0;
        if (Math.abs(F) < .001 * Math.abs(ge)) {
            h.push(w - C * N, E - A * N),
            h.push(w + C * U, E + A * U),
            ge >= 0 && (a.join === "round" ? y += Ea(w, E, w - C * N, E - A * N, w - T * N, E - I * N, h, !1) + 4 : y += 2,
            h.push(w - T * U, E - I * U),
            h.push(w + T * N, E + I * N));
            continue
        }
        const L = (-C + x) * (-A + E) - (-C + w) * (-A + b)
          , ee = (-T + S) * (-I + E) - (-T + w) * (-I + P)
          , J = (fe * ee - X * L) / F
          , de = (ie * L - ue * ee) / F
          , pe = (J - w) * (J - w) + (de - E) * (de - E)
          , xe = w + (J - w) * N
          , O = E + (de - E) * N
          , $ = w - (J - w) * U
          , j = E - (de - E) * U
          , ae = Math.min(fe * fe + ue * ue, X * X + ie * ie)
          , ce = q ? N : U
          , M = ae + ce * ce * m;
        pe <= M ? a.join === "bevel" || pe / m > _ ? (q ? (h.push(xe, O),
        h.push(w + C * U, E + A * U),
        h.push(xe, O),
        h.push(w + T * U, E + I * U)) : (h.push(w - C * N, E - A * N),
        h.push($, j),
        h.push(w - T * N, E - I * N),
        h.push($, j)),
        y += 2) : a.join === "round" ? q ? (h.push(xe, O),
        h.push(w + C * U, E + A * U),
        y += Ea(w, E, w + C * U, E + A * U, w + T * U, E + I * U, h, !0) + 4,
        h.push(xe, O),
        h.push(w + T * U, E + I * U)) : (h.push(w - C * N, E - A * N),
        h.push($, j),
        y += Ea(w, E, w - C * N, E - A * N, w - T * N, E - I * N, h, !1) + 4,
        h.push(w - T * N, E - I * N),
        h.push($, j)) : (h.push(xe, O),
        h.push($, j)) : (h.push(w - C * N, E - A * N),
        h.push(w + C * U, E + A * U),
        a.join === "round" ? q ? y += Ea(w, E, w + C * U, E + A * U, w + T * U, E + I * U, h, !0) + 2 : y += Ea(w, E, w - C * N, E - A * N, w - T * N, E - I * N, h, !1) + 2 : a.join === "miter" && pe / m <= _ && (q ? (h.push($, j),
        h.push($, j)) : (h.push(xe, O),
        h.push(xe, O)),
        y += 2),
        h.push(w - T * N, E - I * N),
        h.push(w + T * U, E + I * U),
        y += 2)
    }
    x = t[(p - 2) * 2],
    b = t[(p - 2) * 2 + 1],
    w = t[(p - 1) * 2],
    E = t[(p - 1) * 2 + 1],
    C = -(b - E),
    A = x - w,
    B = Math.sqrt(C * C + A * A),
    C /= B,
    A /= B,
    C *= g,
    A *= g,
    h.push(w - C * N, E - A * N),
    h.push(w + C * U, E + A * U),
    f || (a.cap === "round" ? y += Ea(w - C * (N - U) * .5, E - A * (N - U) * .5, w - C * N, E - A * N, w + C * U, E + A * U, h, !1) + 2 : a.cap === "square" && (y += VT(w, E, C, A, N, U, !1, h)));
    const W = HT * HT;
    for (let K = v; K < y + v - 2; ++K)
        x = h[K * 2],
        b = h[K * 2 + 1],
        w = h[(K + 1) * 2],
        E = h[(K + 1) * 2 + 1],
        S = h[(K + 2) * 2],
        P = h[(K + 2) * 2 + 1],
        !(Math.abs(x * (E - P) + w * (P - b) + S * (b - E)) < W) && o.push(K, K + 1, K + 2)
}
function bue(t, e, n, r) {
    const i = kB;
    if (t.length === 0)
        return;
    const o = t[0]
      , s = t[1]
      , a = t[t.length - 2]
      , l = t[t.length - 1]
      , c = e || Math.abs(o - a) < i && Math.abs(s - l) < i
      , u = n
      , f = t.length / 2
      , d = u.length / 2;
    for (let h = 0; h < f; h++)
        u.push(t[h * 2]),
        u.push(t[h * 2 + 1]);
    for (let h = 0; h < f - 1; h++)
        r.push(d + h, d + h + 1);
    c && r.push(d + f - 1, d)
}
function NB(t, e, n, r, i, o, s) {
    const a = _ce(t, e, 2);
    if (!a)
        return;
    for (let c = 0; c < a.length; c += 3)
        o[s++] = a[c] + i,
        o[s++] = a[c + 1] + i,
        o[s++] = a[c + 2] + i;
    let l = i * r;
    for (let c = 0; c < t.length; c += 2)
        n[l] = t[c],
        n[l + 1] = t[c + 1],
        l += r
}
const wue = []
  , Eue = {
    extension: {
        type: V.ShapeBuilder,
        name: "polygon"
    },
    build(t, e) {
        for (let n = 0; n < t.points.length; n++)
            e[n] = t.points[n];
        return !0
    },
    triangulate(t, e, n, r, i, o) {
        NB(t, wue, e, n, r, i, o)
    }
}
  , Sue = {
    extension: {
        type: V.ShapeBuilder,
        name: "rectangle"
    },
    build(t, e) {
        const n = t
          , r = n.x
          , i = n.y
          , o = n.width
          , s = n.height;
        return o > 0 && s > 0 ? (e[0] = r,
        e[1] = i,
        e[2] = r + o,
        e[3] = i,
        e[4] = r + o,
        e[5] = i + s,
        e[6] = r,
        e[7] = i + s,
        !0) : !1
    },
    triangulate(t, e, n, r, i, o) {
        let s = 0;
        r *= n,
        e[r + s] = t[0],
        e[r + s + 1] = t[1],
        s += n,
        e[r + s] = t[2],
        e[r + s + 1] = t[3],
        s += n,
        e[r + s] = t[6],
        e[r + s + 1] = t[7],
        s += n,
        e[r + s] = t[4],
        e[r + s + 1] = t[5],
        s += n;
        const a = r / n;
        i[o++] = a,
        i[o++] = a + 1,
        i[o++] = a + 2,
        i[o++] = a + 1,
        i[o++] = a + 3,
        i[o++] = a + 2
    }
}
  , Cue = {
    extension: {
        type: V.ShapeBuilder,
        name: "triangle"
    },
    build(t, e) {
        return e[0] = t.x,
        e[1] = t.y,
        e[2] = t.x2,
        e[3] = t.y2,
        e[4] = t.x3,
        e[5] = t.y3,
        !0
    },
    triangulate(t, e, n, r, i, o) {
        let s = 0;
        r *= n,
        e[r + s] = t[0],
        e[r + s + 1] = t[1],
        s += n,
        e[r + s] = t[2],
        e[r + s + 1] = t[3],
        s += n,
        e[r + s] = t[4],
        e[r + s + 1] = t[5];
        const a = r / n;
        i[o++] = a,
        i[o++] = a + 1,
        i[o++] = a + 2
    }
}
  , Aue = new Oe
  , Tue = new vt;
function Pue(t, e, n, r) {
    const i = e.matrix ? t.copyFrom(e.matrix).invert() : t.identity();
    if (e.textureSpace === "local") {
        const s = n.getBounds(Tue);
        e.width && s.pad(e.width);
        const {x: a, y: l} = s
          , c = 1 / s.width
          , u = 1 / s.height
          , f = -a * c
          , d = -l * u
          , h = i.a
          , p = i.b
          , y = i.c
          , v = i.d;
        i.a *= c,
        i.b *= c,
        i.c *= u,
        i.d *= u,
        i.tx = f * h + d * y + i.tx,
        i.ty = f * p + d * v + i.ty
    } else
        i.translate(e.texture.frame.x, e.texture.frame.y),
        i.scale(1 / e.texture.source.width, 1 / e.texture.source.height);
    const o = e.texture.source.style;
    return !(e.fill instanceof ss) && o.addressMode === "clamp-to-edge" && (o.addressMode = "repeat",
    o.update()),
    r && i.append(Aue.copyFrom(r).invert()),
    i
}
const rm = {};
$e.handleByMap(V.ShapeBuilder, rm);
$e.add(Sue, Eue, Cue, md, vue, yue);
const Iue = new vt
  , Oue = new Oe;
function Rue(t, e) {
    const {geometryData: n, batches: r} = e;
    r.length = 0,
    n.indices.length = 0,
    n.vertices.length = 0,
    n.uvs.length = 0;
    for (let i = 0; i < t.instructions.length; i++) {
        const o = t.instructions[i];
        if (o.action === "texture")
            Mue(o.data, r, n);
        else if (o.action === "fill" || o.action === "stroke") {
            const s = o.action === "stroke"
              , a = o.data.path.shapePath
              , l = o.data.style
              , c = o.data.hole;
            s && c && zT(c.shapePath, l, !0, r, n),
            c && (a.shapePrimitives[a.shapePrimitives.length - 1].holes = c.shapePath.shapePrimitives),
            zT(a, l, s, r, n)
        }
    }
}
function Mue(t, e, n) {
    const r = []
      , i = rm.rectangle
      , o = Iue;
    o.x = t.dx,
    o.y = t.dy,
    o.width = t.dw,
    o.height = t.dh;
    const s = t.transform;
    if (!i.build(o, r))
        return;
    const {vertices: a, uvs: l, indices: c} = n
      , u = c.length
      , f = a.length / 2;
    s && BB(r, s),
    i.triangulate(r, a, 2, f, c, u);
    const d = t.image
      , h = d.uvs;
    l.push(h.x0, h.y0, h.x1, h.y1, h.x3, h.y3, h.x2, h.y2);
    const p = Hn.get(f2);
    p.indexOffset = u,
    p.indexSize = c.length - u,
    p.attributeOffset = f,
    p.attributeSize = a.length / 2 - f,
    p.baseColor = t.style,
    p.alpha = t.alpha,
    p.texture = d,
    p.geometryData = n,
    e.push(p)
}
function zT(t, e, n, r, i) {
    const {vertices: o, uvs: s, indices: a} = i;
    t.shapePrimitives.forEach( ({shape: l, transform: c, holes: u}) => {
        const f = []
          , d = rm[l.type];
        if (!d.build(l, f))
            return;
        const h = a.length
          , p = o.length / 2;
        let y = "triangle-list";
        if (c && BB(f, c),
        n) {
            const _ = l.closePath ?? !0
              , x = e;
            x.pixelLine ? (bue(f, _, o, a),
            y = "line-list") : xue(f, x, !1, _, o, a)
        } else if (u) {
            const _ = []
              , x = f.slice();
            Due(u).forEach(w => {
                _.push(x.length / 2),
                x.push(...w)
            }
            ),
            NB(x, _, o, 2, p, a, h)
        } else
            d.triangulate(f, o, 2, p, a, h);
        const v = s.length / 2
          , g = e.texture;
        if (g !== Ae.WHITE) {
            const _ = Pue(Oue, e, l, c);
            pue(o, 2, p, s, v, 2, o.length / 2 - p, _)
        } else
            gue(s, v, 2, o.length / 2 - p);
        const m = Hn.get(f2);
        m.indexOffset = h,
        m.indexSize = a.length - h,
        m.attributeOffset = p,
        m.attributeSize = o.length / 2 - p,
        m.baseColor = e.color,
        m.alpha = e.alpha,
        m.texture = g,
        m.geometryData = i,
        m.topology = y,
        r.push(m)
    }
    )
}
function Due(t) {
    const e = [];
    for (let n = 0; n < t.length; n++) {
        const r = t[n].shape
          , i = [];
        rm[r.type].build(r, i) && e.push(i)
    }
    return e
}
class Bue {
    constructor() {
        this.batches = [],
        this.geometryData = {
            vertices: [],
            uvs: [],
            indices: []
        }
    }
}
class kue {
    constructor() {
        this.instructions = new GD
    }
    init(e) {
        this.batcher = new u2({
            maxTextures: e
        }),
        this.instructions.reset()
    }
    get geometry() {
        return Fe(Uae, "GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),
        this.batcher.geometry
    }
}
const d2 = class W_ {
    constructor(e) {
        this._gpuContextHash = {},
        this._graphicsDataContextHash = Object.create(null),
        this._renderer = e,
        e.renderableGC.addManagedHash(this, "_gpuContextHash"),
        e.renderableGC.addManagedHash(this, "_graphicsDataContextHash")
    }
    init(e) {
        W_.defaultOptions.bezierSmoothness = (e == null ? void 0 : e.bezierSmoothness) ?? W_.defaultOptions.bezierSmoothness
    }
    getContextRenderData(e) {
        return this._graphicsDataContextHash[e.uid] || this._initContextRenderData(e)
    }
    updateGpuContext(e) {
        let n = this._gpuContextHash[e.uid] || this._initContext(e);
        if (e.dirty) {
            n ? this._cleanGraphicsContextData(e) : n = this._initContext(e),
            Rue(e, n);
            const r = e.batchMode;
            e.customShader || r === "no-batch" ? n.isBatchable = !1 : r === "auto" ? n.isBatchable = n.geometryData.vertices.length < 400 : n.isBatchable = !0,
            e.dirty = !1
        }
        return n
    }
    getGpuContext(e) {
        return this._gpuContextHash[e.uid] || this._initContext(e)
    }
    _initContextRenderData(e) {
        const n = Hn.get(kue, {
            maxTextures: this._renderer.limits.maxBatchableTextures
        })
          , {batches: r, geometryData: i} = this._gpuContextHash[e.uid]
          , o = i.vertices.length
          , s = i.indices.length;
        for (let u = 0; u < r.length; u++)
            r[u].applyTransform = !1;
        const a = n.batcher;
        a.ensureAttributeBuffer(o),
        a.ensureIndexBuffer(s),
        a.begin();
        for (let u = 0; u < r.length; u++) {
            const f = r[u];
            a.add(f)
        }
        a.finish(n.instructions);
        const l = a.geometry;
        l.indexBuffer.setDataWithSize(a.indexBuffer, a.indexSize, !0),
        l.buffers[0].setDataWithSize(a.attributeBuffer.float32View, a.attributeSize, !0);
        const c = a.batches;
        for (let u = 0; u < c.length; u++) {
            const f = c[u];
            f.bindGroup = i2(f.textures.textures, f.textures.count, this._renderer.limits.maxBatchableTextures)
        }
        return this._graphicsDataContextHash[e.uid] = n,
        n
    }
    _initContext(e) {
        const n = new Bue;
        return n.context = e,
        this._gpuContextHash[e.uid] = n,
        e.on("destroy", this.onGraphicsContextDestroy, this),
        this._gpuContextHash[e.uid]
    }
    onGraphicsContextDestroy(e) {
        this._cleanGraphicsContextData(e),
        e.off("destroy", this.onGraphicsContextDestroy, this),
        this._gpuContextHash[e.uid] = null
    }
    _cleanGraphicsContextData(e) {
        const n = this._gpuContextHash[e.uid];
        n.isBatchable || this._graphicsDataContextHash[e.uid] && (Hn.return(this.getContextRenderData(e)),
        this._graphicsDataContextHash[e.uid] = null),
        n.batches && n.batches.forEach(r => {
            Hn.return(r)
        }
        )
    }
    destroy() {
        for (const e in this._gpuContextHash)
            this._gpuContextHash[e] && this.onGraphicsContextDestroy(this._gpuContextHash[e].context)
    }
}
;
d2.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
    name: "graphicsContext"
};
d2.defaultOptions = {
    bezierSmoothness: .5
};
let h2 = d2;
const Nue = 8
  , sp = 11920929e-14
  , Fue = 1;
function FB(t, e, n, r, i, o, s, a, l, c) {
    const f = Math.min(.99, Math.max(0, c ?? h2.defaultOptions.bezierSmoothness));
    let d = (Fue - f) / 1;
    return d *= d,
    Lue(e, n, r, i, o, s, a, l, t, d),
    t
}
function Lue(t, e, n, r, i, o, s, a, l, c) {
    Y_(t, e, n, r, i, o, s, a, l, c, 0),
    l.push(s, a)
}
function Y_(t, e, n, r, i, o, s, a, l, c, u) {
    if (u > Nue)
        return;
    const f = (t + n) / 2
      , d = (e + r) / 2
      , h = (n + i) / 2
      , p = (r + o) / 2
      , y = (i + s) / 2
      , v = (o + a) / 2
      , g = (f + h) / 2
      , m = (d + p) / 2
      , _ = (h + y) / 2
      , x = (p + v) / 2
      , b = (g + _) / 2
      , w = (m + x) / 2;
    if (u > 0) {
        let E = s - t
          , S = a - e;
        const P = Math.abs((n - s) * S - (r - a) * E)
          , C = Math.abs((i - s) * S - (o - a) * E);
        if (P > sp && C > sp) {
            if ((P + C) * (P + C) <= c * (E * E + S * S)) {
                l.push(b, w);
                return
            }
        } else if (P > sp) {
            if (P * P <= c * (E * E + S * S)) {
                l.push(b, w);
                return
            }
        } else if (C > sp) {
            if (C * C <= c * (E * E + S * S)) {
                l.push(b, w);
                return
            }
        } else if (E = b - (t + s) / 2,
        S = w - (e + a) / 2,
        E * E + S * S <= c) {
            l.push(b, w);
            return
        }
    }
    Y_(t, e, f, d, g, m, b, w, l, c, u + 1),
    Y_(b, w, _, x, y, v, s, a, l, c, u + 1)
}
const $ue = 8
  , Uue = 11920929e-14
  , Gue = 1;
function Hue(t, e, n, r, i, o, s, a) {
    const c = Math.min(.99, Math.max(0, a ?? h2.defaultOptions.bezierSmoothness));
    let u = (Gue - c) / 1;
    return u *= u,
    Vue(e, n, r, i, o, s, t, u),
    t
}
function Vue(t, e, n, r, i, o, s, a) {
    X_(s, t, e, n, r, i, o, a, 0),
    s.push(i, o)
}
function X_(t, e, n, r, i, o, s, a, l) {
    if (l > $ue)
        return;
    const c = (e + r) / 2
      , u = (n + i) / 2
      , f = (r + o) / 2
      , d = (i + s) / 2
      , h = (c + f) / 2
      , p = (u + d) / 2;
    let y = o - e
      , v = s - n;
    const g = Math.abs((r - o) * v - (i - s) * y);
    if (g > Uue) {
        if (g * g <= a * (y * y + v * v)) {
            t.push(h, p);
            return
        }
    } else if (y = h - (e + o) / 2,
    v = p - (n + s) / 2,
    y * y + v * v <= a) {
        t.push(h, p);
        return
    }
    X_(t, e, n, c, u, h, p, a, l + 1),
    X_(t, h, p, f, d, o, s, a, l + 1)
}
function LB(t, e, n, r, i, o, s, a) {
    let l = Math.abs(i - o);
    (!s && i > o || s && o > i) && (l = 2 * Math.PI - l),
    a || (a = Math.max(6, Math.floor(6 * Math.pow(r, 1 / 3) * (l / Math.PI)))),
    a = Math.max(a, 3);
    let c = l / a
      , u = i;
    c *= s ? -1 : 1;
    for (let f = 0; f < a + 1; f++) {
        const d = Math.cos(u)
          , h = Math.sin(u)
          , p = e + d * r
          , y = n + h * r;
        t.push(p, y),
        u += c
    }
}
function zue(t, e, n, r, i, o) {
    const s = t[t.length - 2]
      , l = t[t.length - 1] - n
      , c = s - e
      , u = i - n
      , f = r - e
      , d = Math.abs(l * f - c * u);
    if (d < 1e-8 || o === 0) {
        (t[t.length - 2] !== e || t[t.length - 1] !== n) && t.push(e, n);
        return
    }
    const h = l * l + c * c
      , p = u * u + f * f
      , y = l * u + c * f
      , v = o * Math.sqrt(h) / d
      , g = o * Math.sqrt(p) / d
      , m = v * y / h
      , _ = g * y / p
      , x = v * f + g * c
      , b = v * u + g * l
      , w = c * (g + m)
      , E = l * (g + m)
      , S = f * (v + _)
      , P = u * (v + _)
      , C = Math.atan2(E - b, w - x)
      , A = Math.atan2(P - b, S - x);
    LB(t, x + e, b + n, o, C, A, c * u > f * l)
}
const Of = Math.PI * 2
  , U1 = {
    centerX: 0,
    centerY: 0,
    ang1: 0,
    ang2: 0
}
  , G1 = ({x: t, y: e}, n, r, i, o, s, a, l) => {
    t *= n,
    e *= r;
    const c = i * t - o * e
      , u = o * t + i * e;
    return l.x = c + s,
    l.y = u + a,
    l
}
;
function jue(t, e) {
    const n = e === -1.5707963267948966 ? -.551915024494 : 1.3333333333333333 * Math.tan(e / 4)
      , r = e === 1.5707963267948966 ? .551915024494 : n
      , i = Math.cos(t)
      , o = Math.sin(t)
      , s = Math.cos(t + e)
      , a = Math.sin(t + e);
    return [{
        x: i - o * r,
        y: o + i * r
    }, {
        x: s + a * r,
        y: a - s * r
    }, {
        x: s,
        y: a
    }]
}
const jT = (t, e, n, r) => {
    const i = t * r - e * n < 0 ? -1 : 1;
    let o = t * n + e * r;
    return o > 1 && (o = 1),
    o < -1 && (o = -1),
    i * Math.acos(o)
}
  , Wue = (t, e, n, r, i, o, s, a, l, c, u, f, d) => {
    const h = Math.pow(i, 2)
      , p = Math.pow(o, 2)
      , y = Math.pow(u, 2)
      , v = Math.pow(f, 2);
    let g = h * p - h * v - p * y;
    g < 0 && (g = 0),
    g /= h * v + p * y,
    g = Math.sqrt(g) * (s === a ? -1 : 1);
    const m = g * i / o * f
      , _ = g * -o / i * u
      , x = c * m - l * _ + (t + n) / 2
      , b = l * m + c * _ + (e + r) / 2
      , w = (u - m) / i
      , E = (f - _) / o
      , S = (-u - m) / i
      , P = (-f - _) / o
      , C = jT(1, 0, w, E);
    let A = jT(w, E, S, P);
    a === 0 && A > 0 && (A -= Of),
    a === 1 && A < 0 && (A += Of),
    d.centerX = x,
    d.centerY = b,
    d.ang1 = C,
    d.ang2 = A
}
;
function Yue(t, e, n, r, i, o, s, a=0, l=0, c=0) {
    if (o === 0 || s === 0)
        return;
    const u = Math.sin(a * Of / 360)
      , f = Math.cos(a * Of / 360)
      , d = f * (e - r) / 2 + u * (n - i) / 2
      , h = -u * (e - r) / 2 + f * (n - i) / 2;
    if (d === 0 && h === 0)
        return;
    o = Math.abs(o),
    s = Math.abs(s);
    const p = Math.pow(d, 2) / Math.pow(o, 2) + Math.pow(h, 2) / Math.pow(s, 2);
    p > 1 && (o *= Math.sqrt(p),
    s *= Math.sqrt(p)),
    Wue(e, n, r, i, o, s, l, c, u, f, d, h, U1);
    let {ang1: y, ang2: v} = U1;
    const {centerX: g, centerY: m} = U1;
    let _ = Math.abs(v) / (Of / 4);
    Math.abs(1 - _) < 1e-7 && (_ = 1);
    const x = Math.max(Math.ceil(_), 1);
    v /= x;
    let b = t[t.length - 2]
      , w = t[t.length - 1];
    const E = {
        x: 0,
        y: 0
    };
    for (let S = 0; S < x; S++) {
        const P = jue(y, v)
          , {x: C, y: A} = G1(P[0], o, s, f, u, g, m, E)
          , {x: T, y: I} = G1(P[1], o, s, f, u, g, m, E)
          , {x: B, y: G} = G1(P[2], o, s, f, u, g, m, E);
        FB(t, b, w, C, A, T, I, B, G),
        b = B,
        w = G,
        y += v
    }
}
function Xue(t, e, n) {
    const r = (s, a) => {
        const l = a.x - s.x
          , c = a.y - s.y
          , u = Math.sqrt(l * l + c * c)
          , f = l / u
          , d = c / u;
        return {
            len: u,
            nx: f,
            ny: d
        }
    }
      , i = (s, a) => {
        s === 0 ? t.moveTo(a.x, a.y) : t.lineTo(a.x, a.y)
    }
    ;
    let o = e[e.length - 1];
    for (let s = 0; s < e.length; s++) {
        const a = e[s % e.length]
          , l = a.radius ?? n;
        if (l <= 0) {
            i(s, a),
            o = a;
            continue
        }
        const c = e[(s + 1) % e.length]
          , u = r(a, o)
          , f = r(a, c);
        if (u.len < 1e-4 || f.len < 1e-4) {
            i(s, a),
            o = a;
            continue
        }
        let d = Math.asin(u.nx * f.ny - u.ny * f.nx)
          , h = 1
          , p = !1;
        u.nx * f.nx - u.ny * -f.ny < 0 ? d < 0 ? d = Math.PI + d : (d = Math.PI - d,
        h = -1,
        p = !0) : d > 0 && (h = -1,
        p = !0);
        const y = d / 2;
        let v, g = Math.abs(Math.cos(y) * l / Math.sin(y));
        g > Math.min(u.len / 2, f.len / 2) ? (g = Math.min(u.len / 2, f.len / 2),
        v = Math.abs(g * Math.sin(y) / Math.cos(y))) : v = l;
        const m = a.x + f.nx * g + -f.ny * v * h
          , _ = a.y + f.ny * g + f.nx * v * h
          , x = Math.atan2(u.ny, u.nx) + Math.PI / 2 * h
          , b = Math.atan2(f.ny, f.nx) - Math.PI / 2 * h;
        s === 0 && t.moveTo(m + Math.cos(x) * v, _ + Math.sin(x) * v),
        t.arc(m, _, v, x, b, p),
        o = a
    }
}
function Kue(t, e, n, r) {
    const i = (a, l) => Math.sqrt((a.x - l.x) ** 2 + (a.y - l.y) ** 2)
      , o = (a, l, c) => ({
        x: a.x + (l.x - a.x) * c,
        y: a.y + (l.y - a.y) * c
    })
      , s = e.length;
    for (let a = 0; a < s; a++) {
        const l = e[(a + 1) % s]
          , c = l.radius ?? n;
        if (c <= 0) {
            a === 0 ? t.moveTo(l.x, l.y) : t.lineTo(l.x, l.y);
            continue
        }
        const u = e[a]
          , f = e[(a + 2) % s]
          , d = i(u, l);
        let h;
        if (d < 1e-4)
            h = l;
        else {
            const v = Math.min(d / 2, c);
            h = o(l, u, v / d)
        }
        const p = i(f, l);
        let y;
        if (p < 1e-4)
            y = l;
        else {
            const v = Math.min(p / 2, c);
            y = o(l, f, v / p)
        }
        a === 0 ? t.moveTo(h.x, h.y) : t.lineTo(h.x, h.y),
        t.quadraticCurveTo(l.x, l.y, y.x, y.y, r)
    }
}
const que = new vt;
class Zue {
    constructor(e) {
        this.shapePrimitives = [],
        this._currentPoly = null,
        this._bounds = new Vn,
        this._graphicsPath2D = e,
        this.signed = e.checkForHoles
    }
    moveTo(e, n) {
        return this.startPoly(e, n),
        this
    }
    lineTo(e, n) {
        this._ensurePoly();
        const r = this._currentPoly.points
          , i = r[r.length - 2]
          , o = r[r.length - 1];
        return (i !== e || o !== n) && r.push(e, n),
        this
    }
    arc(e, n, r, i, o, s) {
        this._ensurePoly(!1);
        const a = this._currentPoly.points;
        return LB(a, e, n, r, i, o, s),
        this
    }
    arcTo(e, n, r, i, o) {
        this._ensurePoly();
        const s = this._currentPoly.points;
        return zue(s, e, n, r, i, o),
        this
    }
    arcToSvg(e, n, r, i, o, s, a) {
        const l = this._currentPoly.points;
        return Yue(l, this._currentPoly.lastX, this._currentPoly.lastY, s, a, e, n, r, i, o),
        this
    }
    bezierCurveTo(e, n, r, i, o, s, a) {
        this._ensurePoly();
        const l = this._currentPoly;
        return FB(this._currentPoly.points, l.lastX, l.lastY, e, n, r, i, o, s, a),
        this
    }
    quadraticCurveTo(e, n, r, i, o) {
        this._ensurePoly();
        const s = this._currentPoly;
        return Hue(this._currentPoly.points, s.lastX, s.lastY, e, n, r, i, o),
        this
    }
    closePath() {
        return this.endPoly(!0),
        this
    }
    addPath(e, n) {
        this.endPoly(),
        n && !n.isIdentity() && (e = e.clone(!0),
        e.transform(n));
        const r = this.shapePrimitives
          , i = r.length;
        for (let o = 0; o < e.instructions.length; o++) {
            const s = e.instructions[o];
            this[s.action](...s.data)
        }
        if (e.checkForHoles && r.length - i > 1) {
            let o = null;
            for (let s = i; s < r.length; s++) {
                const a = r[s];
                if (a.shape.type === "polygon") {
                    const l = a.shape
                      , c = o == null ? void 0 : o.shape;
                    c && c.containsPolygon(l) ? (o.holes || (o.holes = []),
                    o.holes.push(a),
                    r.copyWithin(s, s + 1),
                    r.length--,
                    s--) : o = a
                }
            }
        }
        return this
    }
    finish(e=!1) {
        this.endPoly(e)
    }
    rect(e, n, r, i, o) {
        return this.drawShape(new vt(e,n,r,i), o),
        this
    }
    circle(e, n, r, i) {
        return this.drawShape(new t2(e,n,r), i),
        this
    }
    poly(e, n, r) {
        const i = new If(e);
        return i.closePath = n,
        this.drawShape(i, r),
        this
    }
    regularPoly(e, n, r, i, o=0, s) {
        i = Math.max(i | 0, 3);
        const a = -1 * Math.PI / 2 + o
          , l = Math.PI * 2 / i
          , c = [];
        for (let u = 0; u < i; u++) {
            const f = a - u * l;
            c.push(e + r * Math.cos(f), n + r * Math.sin(f))
        }
        return this.poly(c, !0, s),
        this
    }
    roundPoly(e, n, r, i, o, s=0, a) {
        if (i = Math.max(i | 0, 3),
        o <= 0)
            return this.regularPoly(e, n, r, i, s);
        const l = r * Math.sin(Math.PI / i) - .001;
        o = Math.min(o, l);
        const c = -1 * Math.PI / 2 + s
          , u = Math.PI * 2 / i
          , f = (i - 2) * Math.PI / i / 2;
        for (let d = 0; d < i; d++) {
            const h = d * u + c
              , p = e + r * Math.cos(h)
              , y = n + r * Math.sin(h)
              , v = h + Math.PI + f
              , g = h - Math.PI - f
              , m = p + o * Math.cos(v)
              , _ = y + o * Math.sin(v)
              , x = p + o * Math.cos(g)
              , b = y + o * Math.sin(g);
            d === 0 ? this.moveTo(m, _) : this.lineTo(m, _),
            this.quadraticCurveTo(p, y, x, b, a)
        }
        return this.closePath()
    }
    roundShape(e, n, r=!1, i) {
        return e.length < 3 ? this : (r ? Kue(this, e, n, i) : Xue(this, e, n),
        this.closePath())
    }
    filletRect(e, n, r, i, o) {
        if (o === 0)
            return this.rect(e, n, r, i);
        const s = Math.min(r, i) / 2
          , a = Math.min(s, Math.max(-s, o))
          , l = e + r
          , c = n + i
          , u = a < 0 ? -a : 0
          , f = Math.abs(a);
        return this.moveTo(e, n + f).arcTo(e + u, n + u, e + f, n, f).lineTo(l - f, n).arcTo(l - u, n + u, l, n + f, f).lineTo(l, c - f).arcTo(l - u, c - u, e + r - f, c, f).lineTo(e + f, c).arcTo(e + u, c - u, e, c - f, f).closePath()
    }
    chamferRect(e, n, r, i, o, s) {
        if (o <= 0)
            return this.rect(e, n, r, i);
        const a = Math.min(o, Math.min(r, i) / 2)
          , l = e + r
          , c = n + i
          , u = [e + a, n, l - a, n, l, n + a, l, c - a, l - a, c, e + a, c, e, c - a, e, n + a];
        for (let f = u.length - 1; f >= 2; f -= 2)
            u[f] === u[f - 2] && u[f - 1] === u[f - 3] && u.splice(f - 1, 2);
        return this.poly(u, !0, s)
    }
    ellipse(e, n, r, i, o) {
        return this.drawShape(new n2(e,n,r,i), o),
        this
    }
    roundRect(e, n, r, i, o, s) {
        return this.drawShape(new r2(e,n,r,i,o), s),
        this
    }
    drawShape(e, n) {
        return this.endPoly(),
        this.shapePrimitives.push({
            shape: e,
            transform: n
        }),
        this
    }
    startPoly(e, n) {
        let r = this._currentPoly;
        return r && this.endPoly(),
        r = new If,
        r.points.push(e, n),
        this._currentPoly = r,
        this
    }
    endPoly(e=!1) {
        const n = this._currentPoly;
        return n && n.points.length > 2 && (n.closePath = e,
        this.shapePrimitives.push({
            shape: n
        })),
        this._currentPoly = null,
        this
    }
    _ensurePoly(e=!0) {
        if (!this._currentPoly && (this._currentPoly = new If,
        e)) {
            const n = this.shapePrimitives[this.shapePrimitives.length - 1];
            if (n) {
                let r = n.shape.x
                  , i = n.shape.y;
                if (n.transform && !n.transform.isIdentity()) {
                    const o = n.transform
                      , s = r;
                    r = o.a * r + o.c * i + o.tx,
                    i = o.b * s + o.d * i + o.ty
                }
                this._currentPoly.points.push(r, i)
            } else
                this._currentPoly.points.push(0, 0)
        }
    }
    buildPath() {
        const e = this._graphicsPath2D;
        this.shapePrimitives.length = 0,
        this._currentPoly = null;
        for (let n = 0; n < e.instructions.length; n++) {
            const r = e.instructions[n];
            this[r.action](...r.data)
        }
        this.finish()
    }
    get bounds() {
        const e = this._bounds;
        e.clear();
        const n = this.shapePrimitives;
        for (let r = 0; r < n.length; r++) {
            const i = n[r]
              , o = i.shape.getBounds(que);
            i.transform ? e.addRect(o, i.transform) : e.addRect(o)
        }
        return e
    }
}
class qc {
    constructor(e, n=!1) {
        this.instructions = [],
        this.uid = Ut("graphicsPath"),
        this._dirty = !0,
        this.checkForHoles = n,
        typeof e == "string" ? Dce(e, this) : this.instructions = (e == null ? void 0 : e.slice()) ?? []
    }
    get shapePath() {
        return this._shapePath || (this._shapePath = new Zue(this)),
        this._dirty && (this._dirty = !1,
        this._shapePath.buildPath()),
        this._shapePath
    }
    addPath(e, n) {
        return e = e.clone(),
        this.instructions.push({
            action: "addPath",
            data: [e, n]
        }),
        this._dirty = !0,
        this
    }
    arc(...e) {
        return this.instructions.push({
            action: "arc",
            data: e
        }),
        this._dirty = !0,
        this
    }
    arcTo(...e) {
        return this.instructions.push({
            action: "arcTo",
            data: e
        }),
        this._dirty = !0,
        this
    }
    arcToSvg(...e) {
        return this.instructions.push({
            action: "arcToSvg",
            data: e
        }),
        this._dirty = !0,
        this
    }
    bezierCurveTo(...e) {
        return this.instructions.push({
            action: "bezierCurveTo",
            data: e
        }),
        this._dirty = !0,
        this
    }
    bezierCurveToShort(e, n, r, i, o) {
        const s = this.instructions[this.instructions.length - 1]
          , a = this.getLastPoint(Gt.shared);
        let l = 0
          , c = 0;
        if (!s || s.action !== "bezierCurveTo")
            l = a.x,
            c = a.y;
        else {
            l = s.data[2],
            c = s.data[3];
            const u = a.x
              , f = a.y;
            l = u + (u - l),
            c = f + (f - c)
        }
        return this.instructions.push({
            action: "bezierCurveTo",
            data: [l, c, e, n, r, i, o]
        }),
        this._dirty = !0,
        this
    }
    closePath() {
        return this.instructions.push({
            action: "closePath",
            data: []
        }),
        this._dirty = !0,
        this
    }
    ellipse(...e) {
        return this.instructions.push({
            action: "ellipse",
            data: e
        }),
        this._dirty = !0,
        this
    }
    lineTo(...e) {
        return this.instructions.push({
            action: "lineTo",
            data: e
        }),
        this._dirty = !0,
        this
    }
    moveTo(...e) {
        return this.instructions.push({
            action: "moveTo",
            data: e
        }),
        this
    }
    quadraticCurveTo(...e) {
        return this.instructions.push({
            action: "quadraticCurveTo",
            data: e
        }),
        this._dirty = !0,
        this
    }
    quadraticCurveToShort(e, n, r) {
        const i = this.instructions[this.instructions.length - 1]
          , o = this.getLastPoint(Gt.shared);
        let s = 0
          , a = 0;
        if (!i || i.action !== "quadraticCurveTo")
            s = o.x,
            a = o.y;
        else {
            s = i.data[0],
            a = i.data[1];
            const l = o.x
              , c = o.y;
            s = l + (l - s),
            a = c + (c - a)
        }
        return this.instructions.push({
            action: "quadraticCurveTo",
            data: [s, a, e, n, r]
        }),
        this._dirty = !0,
        this
    }
    rect(e, n, r, i, o) {
        return this.instructions.push({
            action: "rect",
            data: [e, n, r, i, o]
        }),
        this._dirty = !0,
        this
    }
    circle(e, n, r, i) {
        return this.instructions.push({
            action: "circle",
            data: [e, n, r, i]
        }),
        this._dirty = !0,
        this
    }
    roundRect(...e) {
        return this.instructions.push({
            action: "roundRect",
            data: e
        }),
        this._dirty = !0,
        this
    }
    poly(...e) {
        return this.instructions.push({
            action: "poly",
            data: e
        }),
        this._dirty = !0,
        this
    }
    regularPoly(...e) {
        return this.instructions.push({
            action: "regularPoly",
            data: e
        }),
        this._dirty = !0,
        this
    }
    roundPoly(...e) {
        return this.instructions.push({
            action: "roundPoly",
            data: e
        }),
        this._dirty = !0,
        this
    }
    roundShape(...e) {
        return this.instructions.push({
            action: "roundShape",
            data: e
        }),
        this._dirty = !0,
        this
    }
    filletRect(...e) {
        return this.instructions.push({
            action: "filletRect",
            data: e
        }),
        this._dirty = !0,
        this
    }
    chamferRect(...e) {
        return this.instructions.push({
            action: "chamferRect",
            data: e
        }),
        this._dirty = !0,
        this
    }
    star(e, n, r, i, o, s, a) {
        o || (o = i / 2);
        const l = -1 * Math.PI / 2 + s
          , c = r * 2
          , u = Math.PI * 2 / c
          , f = [];
        for (let d = 0; d < c; d++) {
            const h = d % 2 ? o : i
              , p = d * u + l;
            f.push(e + h * Math.cos(p), n + h * Math.sin(p))
        }
        return this.poly(f, !0, a),
        this
    }
    clone(e=!1) {
        const n = new qc;
        if (n.checkForHoles = this.checkForHoles,
        !e)
            n.instructions = this.instructions.slice();
        else
            for (let r = 0; r < this.instructions.length; r++) {
                const i = this.instructions[r];
                n.instructions.push({
                    action: i.action,
                    data: i.data.slice()
                })
            }
        return n
    }
    clear() {
        return this.instructions.length = 0,
        this._dirty = !0,
        this
    }
    transform(e) {
        if (e.isIdentity())
            return this;
        const n = e.a
          , r = e.b
          , i = e.c
          , o = e.d
          , s = e.tx
          , a = e.ty;
        let l = 0
          , c = 0
          , u = 0
          , f = 0
          , d = 0
          , h = 0
          , p = 0
          , y = 0;
        for (let v = 0; v < this.instructions.length; v++) {
            const g = this.instructions[v]
              , m = g.data;
            switch (g.action) {
            case "moveTo":
            case "lineTo":
                l = m[0],
                c = m[1],
                m[0] = n * l + i * c + s,
                m[1] = r * l + o * c + a;
                break;
            case "bezierCurveTo":
                u = m[0],
                f = m[1],
                d = m[2],
                h = m[3],
                l = m[4],
                c = m[5],
                m[0] = n * u + i * f + s,
                m[1] = r * u + o * f + a,
                m[2] = n * d + i * h + s,
                m[3] = r * d + o * h + a,
                m[4] = n * l + i * c + s,
                m[5] = r * l + o * c + a;
                break;
            case "quadraticCurveTo":
                u = m[0],
                f = m[1],
                l = m[2],
                c = m[3],
                m[0] = n * u + i * f + s,
                m[1] = r * u + o * f + a,
                m[2] = n * l + i * c + s,
                m[3] = r * l + o * c + a;
                break;
            case "arcToSvg":
                l = m[5],
                c = m[6],
                p = m[0],
                y = m[1],
                m[0] = n * p + i * y,
                m[1] = r * p + o * y,
                m[5] = n * l + i * c + s,
                m[6] = r * l + o * c + a;
                break;
            case "circle":
                m[4] = ju(m[3], e);
                break;
            case "rect":
                m[4] = ju(m[4], e);
                break;
            case "ellipse":
                m[8] = ju(m[8], e);
                break;
            case "roundRect":
                m[5] = ju(m[5], e);
                break;
            case "addPath":
                m[0].transform(e);
                break;
            case "poly":
                m[2] = ju(m[2], e);
                break;
            default:
                Ne("unknown transform action", g.action);
                break
            }
        }
        return this._dirty = !0,
        this
    }
    get bounds() {
        return this.shapePath.bounds
    }
    getLastPoint(e) {
        let n = this.instructions.length - 1
          , r = this.instructions[n];
        if (!r)
            return e.x = 0,
            e.y = 0,
            e;
        for (; r.action === "closePath"; ) {
            if (n--,
            n < 0)
                return e.x = 0,
                e.y = 0,
                e;
            r = this.instructions[n]
        }
        switch (r.action) {
        case "moveTo":
        case "lineTo":
            e.x = r.data[0],
            e.y = r.data[1];
            break;
        case "quadraticCurveTo":
            e.x = r.data[2],
            e.y = r.data[3];
            break;
        case "bezierCurveTo":
            e.x = r.data[4],
            e.y = r.data[5];
            break;
        case "arc":
        case "arcToSvg":
            e.x = r.data[5],
            e.y = r.data[6];
            break;
        case "addPath":
            r.data[0].getLastPoint(e);
            break
        }
        return e
    }
}
function ju(t, e) {
    return t ? t.prepend(e) : e.clone()
}
function Zt(t, e, n) {
    const r = t.getAttribute(e);
    return r ? Number(r) : n
}
function Jue(t, e) {
    const n = t.querySelectorAll("defs");
    for (let r = 0; r < n.length; r++) {
        const i = n[r];
        for (let o = 0; o < i.children.length; o++) {
            const s = i.children[o];
            switch (s.nodeName.toLowerCase()) {
            case "lineargradient":
                e.defs[s.id] = Que(s);
                break;
            case "radialgradient":
                e.defs[s.id] = efe();
                break
            }
        }
    }
}
function Que(t) {
    const e = Zt(t, "x1", 0)
      , n = Zt(t, "y1", 0)
      , r = Zt(t, "x2", 1)
      , i = Zt(t, "y2", 0)
      , o = t.getAttribute("gradientUnits") || "objectBoundingBox"
      , s = new ss(e,n,r,i,o === "objectBoundingBox" ? "local" : "global");
    for (let a = 0; a < t.children.length; a++) {
        const l = t.children[a]
          , c = Zt(l, "offset", 0)
          , u = Rt.shared.setValue(l.getAttribute("stop-color")).toNumber();
        s.addColorStop(c, u)
    }
    return s
}
function efe(t) {
    return Ne("[SVG Parser] Radial gradients are not yet supported"),
    new ss(0,0,1,0)
}
function WT(t) {
    const e = t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);
    return e ? e[1] : ""
}
const YT = {
    fill: {
        type: "paint",
        default: 0
    },
    "fill-opacity": {
        type: "number",
        default: 1
    },
    stroke: {
        type: "paint",
        default: 0
    },
    "stroke-width": {
        type: "number",
        default: 1
    },
    "stroke-opacity": {
        type: "number",
        default: 1
    },
    "stroke-linecap": {
        type: "string",
        default: "butt"
    },
    "stroke-linejoin": {
        type: "string",
        default: "miter"
    },
    "stroke-miterlimit": {
        type: "number",
        default: 10
    },
    "stroke-dasharray": {
        type: "string",
        default: "none"
    },
    "stroke-dashoffset": {
        type: "number",
        default: 0
    },
    opacity: {
        type: "number",
        default: 1
    }
};
function $B(t, e) {
    const n = t.getAttribute("style")
      , r = {}
      , i = {}
      , o = {
        strokeStyle: r,
        fillStyle: i,
        useFill: !1,
        useStroke: !1
    };
    for (const s in YT) {
        const a = t.getAttribute(s);
        a && XT(e, o, s, a.trim())
    }
    if (n) {
        const s = n.split(";");
        for (let a = 0; a < s.length; a++) {
            const l = s[a].trim()
              , [c,u] = l.split(":");
            YT[c] && XT(e, o, c, u.trim())
        }
    }
    return {
        strokeStyle: o.useStroke ? r : null,
        fillStyle: o.useFill ? i : null,
        useFill: o.useFill,
        useStroke: o.useStroke
    }
}
function XT(t, e, n, r) {
    switch (n) {
    case "stroke":
        if (r !== "none") {
            if (r.startsWith("url(")) {
                const i = WT(r);
                e.strokeStyle.fill = t.defs[i]
            } else
                e.strokeStyle.color = Rt.shared.setValue(r).toNumber();
            e.useStroke = !0
        }
        break;
    case "stroke-width":
        e.strokeStyle.width = Number(r);
        break;
    case "fill":
        if (r !== "none") {
            if (r.startsWith("url(")) {
                const i = WT(r);
                e.fillStyle.fill = t.defs[i]
            } else
                e.fillStyle.color = Rt.shared.setValue(r).toNumber();
            e.useFill = !0
        }
        break;
    case "fill-opacity":
        e.fillStyle.alpha = Number(r);
        break;
    case "stroke-opacity":
        e.strokeStyle.alpha = Number(r);
        break;
    case "opacity":
        e.fillStyle.alpha = Number(r),
        e.strokeStyle.alpha = Number(r);
        break
    }
}
function tfe(t, e) {
    if (typeof t == "string") {
        const s = document.createElement("div");
        s.innerHTML = t.trim(),
        t = s.querySelector("svg")
    }
    const n = {
        context: e,
        defs: {},
        path: new qc
    };
    Jue(t, n);
    const r = t.children
      , {fillStyle: i, strokeStyle: o} = $B(t, n);
    for (let s = 0; s < r.length; s++) {
        const a = r[s];
        a.nodeName.toLowerCase() !== "defs" && UB(a, n, i, o)
    }
    return e
}
function UB(t, e, n, r) {
    const i = t.children
      , {fillStyle: o, strokeStyle: s} = $B(t, e);
    o && n ? n = {
        ...n,
        ...o
    } : o && (n = o),
    s && r ? r = {
        ...r,
        ...s
    } : s && (r = s);
    const a = !n && !r;
    a && (n = {
        color: 0
    });
    let l, c, u, f, d, h, p, y, v, g, m, _, x, b, w, E, S;
    switch (t.nodeName.toLowerCase()) {
    case "path":
        b = t.getAttribute("d"),
        t.getAttribute("fill-rule") === "evenodd" && Ne("SVG Evenodd fill rule not supported, your svg may render incorrectly"),
        w = new qc(b,!0),
        e.context.path(w),
        n && e.context.fill(n),
        r && e.context.stroke(r);
        break;
    case "circle":
        p = Zt(t, "cx", 0),
        y = Zt(t, "cy", 0),
        v = Zt(t, "r", 0),
        e.context.ellipse(p, y, v, v),
        n && e.context.fill(n),
        r && e.context.stroke(r);
        break;
    case "rect":
        l = Zt(t, "x", 0),
        c = Zt(t, "y", 0),
        E = Zt(t, "width", 0),
        S = Zt(t, "height", 0),
        g = Zt(t, "rx", 0),
        m = Zt(t, "ry", 0),
        g || m ? e.context.roundRect(l, c, E, S, g || m) : e.context.rect(l, c, E, S),
        n && e.context.fill(n),
        r && e.context.stroke(r);
        break;
    case "ellipse":
        p = Zt(t, "cx", 0),
        y = Zt(t, "cy", 0),
        g = Zt(t, "rx", 0),
        m = Zt(t, "ry", 0),
        e.context.beginPath(),
        e.context.ellipse(p, y, g, m),
        n && e.context.fill(n),
        r && e.context.stroke(r);
        break;
    case "line":
        u = Zt(t, "x1", 0),
        f = Zt(t, "y1", 0),
        d = Zt(t, "x2", 0),
        h = Zt(t, "y2", 0),
        e.context.beginPath(),
        e.context.moveTo(u, f),
        e.context.lineTo(d, h),
        r && e.context.stroke(r);
        break;
    case "polygon":
        x = t.getAttribute("points"),
        _ = x.match(/\d+/g).map(P => parseInt(P, 10)),
        e.context.poly(_, !0),
        n && e.context.fill(n),
        r && e.context.stroke(r);
        break;
    case "polyline":
        x = t.getAttribute("points"),
        _ = x.match(/\d+/g).map(P => parseInt(P, 10)),
        e.context.poly(_, !1),
        r && e.context.stroke(r);
        break;
    case "g":
    case "svg":
        break;
    default:
        {
            Ne(`[SVG parser] <${t.nodeName}> elements unsupported`);
            break
        }
    }
    a && (n = null);
    for (let P = 0; P < i.length; P++)
        UB(i[P], e, n, r)
}
function nfe(t) {
    return Rt.isColorLike(t)
}
function KT(t) {
    return t instanceof nm
}
function qT(t) {
    return t instanceof ss
}
function rfe(t) {
    return t instanceof Ae
}
function ife(t, e, n) {
    const r = Rt.shared.setValue(e ?? 0);
    return t.color = r.toNumber(),
    t.alpha = r.alpha === 1 ? n.alpha : r.alpha,
    t.texture = Ae.WHITE,
    {
        ...n,
        ...t
    }
}
function ofe(t, e, n) {
    return t.texture = e,
    {
        ...n,
        ...t
    }
}
function ZT(t, e, n) {
    return t.fill = e,
    t.color = 16777215,
    t.texture = e.texture,
    t.matrix = e.transform,
    {
        ...n,
        ...t
    }
}
function JT(t, e, n) {
    return e.buildGradient(),
    t.fill = e,
    t.color = 16777215,
    t.texture = e.texture,
    t.matrix = e.transform,
    t.textureSpace = e.textureSpace,
    {
        ...n,
        ...t
    }
}
function sfe(t, e) {
    const n = {
        ...e,
        ...t
    }
      , r = Rt.shared.setValue(n.color);
    return n.alpha *= r.alpha,
    n.color = r.toNumber(),
    n
}
function za(t, e) {
    if (t == null)
        return null;
    const n = {}
      , r = t;
    return nfe(t) ? ife(n, t, e) : rfe(t) ? ofe(n, t, e) : KT(t) ? ZT(n, t, e) : qT(t) ? JT(n, t, e) : r.fill && KT(r.fill) ? ZT(r, r.fill, e) : r.fill && qT(r.fill) ? JT(r, r.fill, e) : sfe(r, e)
}
function A0(t, e) {
    const {width: n, alignment: r, miterLimit: i, cap: o, join: s, pixelLine: a, ...l} = e
      , c = za(t, l);
    return c ? {
        width: n,
        alignment: r,
        miterLimit: i,
        cap: o,
        join: s,
        pixelLine: a,
        ...c
    } : null
}
const afe = new Gt
  , QT = new Oe
  , p2 = class Ki extends Jr {
    constructor() {
        super(...arguments),
        this.uid = Ut("graphicsContext"),
        this.dirty = !0,
        this.batchMode = "auto",
        this.instructions = [],
        this._activePath = new qc,
        this._transform = new Oe,
        this._fillStyle = {
            ...Ki.defaultFillStyle
        },
        this._strokeStyle = {
            ...Ki.defaultStrokeStyle
        },
        this._stateStack = [],
        this._tick = 0,
        this._bounds = new Vn,
        this._boundsDirty = !0
    }
    clone() {
        const e = new Ki;
        return e.batchMode = this.batchMode,
        e.instructions = this.instructions.slice(),
        e._activePath = this._activePath.clone(),
        e._transform = this._transform.clone(),
        e._fillStyle = {
            ...this._fillStyle
        },
        e._strokeStyle = {
            ...this._strokeStyle
        },
        e._stateStack = this._stateStack.slice(),
        e._bounds = this._bounds.clone(),
        e._boundsDirty = !0,
        e
    }
    get fillStyle() {
        return this._fillStyle
    }
    set fillStyle(e) {
        this._fillStyle = za(e, Ki.defaultFillStyle)
    }
    get strokeStyle() {
        return this._strokeStyle
    }
    set strokeStyle(e) {
        this._strokeStyle = A0(e, Ki.defaultStrokeStyle)
    }
    setFillStyle(e) {
        return this._fillStyle = za(e, Ki.defaultFillStyle),
        this
    }
    setStrokeStyle(e) {
        return this._strokeStyle = za(e, Ki.defaultStrokeStyle),
        this
    }
    texture(e, n, r, i, o, s) {
        return this.instructions.push({
            action: "texture",
            data: {
                image: e,
                dx: r || 0,
                dy: i || 0,
                dw: o || e.frame.width,
                dh: s || e.frame.height,
                transform: this._transform.clone(),
                alpha: this._fillStyle.alpha,
                style: n ? Rt.shared.setValue(n).toNumber() : 16777215
            }
        }),
        this.onUpdate(),
        this
    }
    beginPath() {
        return this._activePath = new qc,
        this
    }
    fill(e, n) {
        let r;
        const i = this.instructions[this.instructions.length - 1];
        return this._tick === 0 && i && i.action === "stroke" ? r = i.data.path : r = this._activePath.clone(),
        r ? (e != null && (n !== void 0 && typeof e == "number" && (Fe(rt, "GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),
        e = {
            color: e,
            alpha: n
        }),
        this._fillStyle = za(e, Ki.defaultFillStyle)),
        this.instructions.push({
            action: "fill",
            data: {
                style: this.fillStyle,
                path: r
            }
        }),
        this.onUpdate(),
        this._initNextPathLocation(),
        this._tick = 0,
        this) : this
    }
    _initNextPathLocation() {
        const {x: e, y: n} = this._activePath.getLastPoint(Gt.shared);
        this._activePath.clear(),
        this._activePath.moveTo(e, n)
    }
    stroke(e) {
        let n;
        const r = this.instructions[this.instructions.length - 1];
        return this._tick === 0 && r && r.action === "fill" ? n = r.data.path : n = this._activePath.clone(),
        n ? (e != null && (this._strokeStyle = A0(e, Ki.defaultStrokeStyle)),
        this.instructions.push({
            action: "stroke",
            data: {
                style: this.strokeStyle,
                path: n
            }
        }),
        this.onUpdate(),
        this._initNextPathLocation(),
        this._tick = 0,
        this) : this
    }
    cut() {
        for (let e = 0; e < 2; e++) {
            const n = this.instructions[this.instructions.length - 1 - e]
              , r = this._activePath.clone();
            if (n && (n.action === "stroke" || n.action === "fill"))
                if (n.data.hole)
                    n.data.hole.addPath(r);
                else {
                    n.data.hole = r;
                    break
                }
        }
        return this._initNextPathLocation(),
        this
    }
    arc(e, n, r, i, o, s) {
        this._tick++;
        const a = this._transform;
        return this._activePath.arc(a.a * e + a.c * n + a.tx, a.b * e + a.d * n + a.ty, r, i, o, s),
        this
    }
    arcTo(e, n, r, i, o) {
        this._tick++;
        const s = this._transform;
        return this._activePath.arcTo(s.a * e + s.c * n + s.tx, s.b * e + s.d * n + s.ty, s.a * r + s.c * i + s.tx, s.b * r + s.d * i + s.ty, o),
        this
    }
    arcToSvg(e, n, r, i, o, s, a) {
        this._tick++;
        const l = this._transform;
        return this._activePath.arcToSvg(e, n, r, i, o, l.a * s + l.c * a + l.tx, l.b * s + l.d * a + l.ty),
        this
    }
    bezierCurveTo(e, n, r, i, o, s, a) {
        this._tick++;
        const l = this._transform;
        return this._activePath.bezierCurveTo(l.a * e + l.c * n + l.tx, l.b * e + l.d * n + l.ty, l.a * r + l.c * i + l.tx, l.b * r + l.d * i + l.ty, l.a * o + l.c * s + l.tx, l.b * o + l.d * s + l.ty, a),
        this
    }
    closePath() {
        var e;
        return this._tick++,
        (e = this._activePath) == null || e.closePath(),
        this
    }
    ellipse(e, n, r, i) {
        return this._tick++,
        this._activePath.ellipse(e, n, r, i, this._transform.clone()),
        this
    }
    circle(e, n, r) {
        return this._tick++,
        this._activePath.circle(e, n, r, this._transform.clone()),
        this
    }
    path(e) {
        return this._tick++,
        this._activePath.addPath(e, this._transform.clone()),
        this
    }
    lineTo(e, n) {
        this._tick++;
        const r = this._transform;
        return this._activePath.lineTo(r.a * e + r.c * n + r.tx, r.b * e + r.d * n + r.ty),
        this
    }
    moveTo(e, n) {
        this._tick++;
        const r = this._transform
          , i = this._activePath.instructions
          , o = r.a * e + r.c * n + r.tx
          , s = r.b * e + r.d * n + r.ty;
        return i.length === 1 && i[0].action === "moveTo" ? (i[0].data[0] = o,
        i[0].data[1] = s,
        this) : (this._activePath.moveTo(o, s),
        this)
    }
    quadraticCurveTo(e, n, r, i, o) {
        this._tick++;
        const s = this._transform;
        return this._activePath.quadraticCurveTo(s.a * e + s.c * n + s.tx, s.b * e + s.d * n + s.ty, s.a * r + s.c * i + s.tx, s.b * r + s.d * i + s.ty, o),
        this
    }
    rect(e, n, r, i) {
        return this._tick++,
        this._activePath.rect(e, n, r, i, this._transform.clone()),
        this
    }
    roundRect(e, n, r, i, o) {
        return this._tick++,
        this._activePath.roundRect(e, n, r, i, o, this._transform.clone()),
        this
    }
    poly(e, n) {
        return this._tick++,
        this._activePath.poly(e, n, this._transform.clone()),
        this
    }
    regularPoly(e, n, r, i, o=0, s) {
        return this._tick++,
        this._activePath.regularPoly(e, n, r, i, o, s),
        this
    }
    roundPoly(e, n, r, i, o, s) {
        return this._tick++,
        this._activePath.roundPoly(e, n, r, i, o, s),
        this
    }
    roundShape(e, n, r, i) {
        return this._tick++,
        this._activePath.roundShape(e, n, r, i),
        this
    }
    filletRect(e, n, r, i, o) {
        return this._tick++,
        this._activePath.filletRect(e, n, r, i, o),
        this
    }
    chamferRect(e, n, r, i, o, s) {
        return this._tick++,
        this._activePath.chamferRect(e, n, r, i, o, s),
        this
    }
    star(e, n, r, i, o=0, s=0) {
        return this._tick++,
        this._activePath.star(e, n, r, i, o, s, this._transform.clone()),
        this
    }
    svg(e) {
        return this._tick++,
        tfe(e, this),
        this
    }
    restore() {
        const e = this._stateStack.pop();
        return e && (this._transform = e.transform,
        this._fillStyle = e.fillStyle,
        this._strokeStyle = e.strokeStyle),
        this
    }
    save() {
        return this._stateStack.push({
            transform: this._transform.clone(),
            fillStyle: {
                ...this._fillStyle
            },
            strokeStyle: {
                ...this._strokeStyle
            }
        }),
        this
    }
    getTransform() {
        return this._transform
    }
    resetTransform() {
        return this._transform.identity(),
        this
    }
    rotate(e) {
        return this._transform.rotate(e),
        this
    }
    scale(e, n=e) {
        return this._transform.scale(e, n),
        this
    }
    setTransform(e, n, r, i, o, s) {
        return e instanceof Oe ? (this._transform.set(e.a, e.b, e.c, e.d, e.tx, e.ty),
        this) : (this._transform.set(e, n, r, i, o, s),
        this)
    }
    transform(e, n, r, i, o, s) {
        return e instanceof Oe ? (this._transform.append(e),
        this) : (QT.set(e, n, r, i, o, s),
        this._transform.append(QT),
        this)
    }
    translate(e, n=e) {
        return this._transform.translate(e, n),
        this
    }
    clear() {
        return this._activePath.clear(),
        this.instructions.length = 0,
        this.resetTransform(),
        this.onUpdate(),
        this
    }
    onUpdate() {
        this.dirty || (this.emit("update", this, 16),
        this.dirty = !0,
        this._boundsDirty = !0)
    }
    get bounds() {
        if (!this._boundsDirty)
            return this._bounds;
        const e = this._bounds;
        e.clear();
        for (let n = 0; n < this.instructions.length; n++) {
            const r = this.instructions[n]
              , i = r.action;
            if (i === "fill") {
                const o = r.data;
                e.addBounds(o.path.bounds)
            } else if (i === "texture") {
                const o = r.data;
                e.addFrame(o.dx, o.dy, o.dx + o.dw, o.dy + o.dh, o.transform)
            }
            if (i === "stroke") {
                const o = r.data
                  , s = o.style.alignment
                  , a = o.style.width * (1 - s)
                  , l = o.path.bounds;
                e.addFrame(l.minX - a, l.minY - a, l.maxX + a, l.maxY + a)
            }
        }
        return e
    }
    containsPoint(e) {
        var i;
        if (!this.bounds.containsPoint(e.x, e.y))
            return !1;
        const n = this.instructions;
        let r = !1;
        for (let o = 0; o < n.length; o++) {
            const s = n[o]
              , a = s.data
              , l = a.path;
            if (!s.action || !l)
                continue;
            const c = a.style
              , u = l.shapePath.shapePrimitives;
            for (let f = 0; f < u.length; f++) {
                const d = u[f].shape;
                if (!c || !d)
                    continue;
                const h = u[f].transform
                  , p = h ? h.applyInverse(e, afe) : e;
                if (s.action === "fill")
                    r = d.contains(p.x, p.y);
                else {
                    const v = c;
                    r = d.strokeContains(p.x, p.y, v.width, v.alignment)
                }
                const y = a.hole;
                if (y) {
                    const v = (i = y.shapePath) == null ? void 0 : i.shapePrimitives;
                    if (v)
                        for (let g = 0; g < v.length; g++)
                            v[g].shape.contains(p.x, p.y) && (r = !1)
                }
                if (r)
                    return !0
            }
        }
        return r
    }
    destroy(e=!1) {
        if (this._stateStack.length = 0,
        this._transform = null,
        this.emit("destroy", this),
        this.removeAllListeners(),
        typeof e == "boolean" ? e : e == null ? void 0 : e.texture) {
            const r = typeof e == "boolean" ? e : e == null ? void 0 : e.textureSource;
            this._fillStyle.texture && (this._fillStyle.fill && "uid"in this._fillStyle.fill ? this._fillStyle.fill.destroy() : this._fillStyle.texture.destroy(r)),
            this._strokeStyle.texture && (this._strokeStyle.fill && "uid"in this._strokeStyle.fill ? this._strokeStyle.fill.destroy() : this._strokeStyle.texture.destroy(r))
        }
        this._fillStyle = null,
        this._strokeStyle = null,
        this.instructions = null,
        this._activePath = null,
        this._bounds = null,
        this._stateStack = null,
        this.customShader = null,
        this._transform = null
    }
}
;
p2.defaultFillStyle = {
    color: 16777215,
    alpha: 1,
    texture: Ae.WHITE,
    matrix: null,
    fill: null,
    textureSpace: "local"
};
p2.defaultStrokeStyle = {
    width: 1,
    color: 16777215,
    alpha: 1,
    alignment: .5,
    miterLimit: 10,
    cap: "butt",
    join: "miter",
    texture: Ae.WHITE,
    matrix: null,
    fill: null,
    textureSpace: "local",
    pixelLine: !1
};
let ci = p2;
const e3 = ["align", "breakWords", "cssOverrides", "fontVariant", "fontWeight", "leading", "letterSpacing", "lineHeight", "padding", "textBaseline", "trim", "whiteSpace", "wordWrap", "wordWrapWidth", "fontFamily", "fontStyle", "fontSize"];
function lfe(t) {
    const e = [];
    let n = 0;
    for (let r = 0; r < e3.length; r++) {
        const i = `_${e3[r]}`;
        e[n++] = t[i]
    }
    return n = GB(t._fill, e, n),
    n = ufe(t._stroke, e, n),
    n = ffe(t.dropShadow, e, n),
    n = cfe(t.filters, e, n),
    e.join("-")
}
function cfe(t, e, n) {
    if (!t)
        return n;
    for (const r of t)
        e[n++] = r.uid;
    return n
}
function GB(t, e, n) {
    var r;
    return t && (e[n++] = t.color,
    e[n++] = t.alpha,
    e[n++] = (r = t.fill) == null ? void 0 : r.styleKey),
    n
}
function ufe(t, e, n) {
    return t && (n = GB(t, e, n),
    e[n++] = t.width,
    e[n++] = t.alignment,
    e[n++] = t.cap,
    e[n++] = t.join,
    e[n++] = t.miterLimit),
    n
}
function ffe(t, e, n) {
    return t && (e[n++] = t.alpha,
    e[n++] = t.angle,
    e[n++] = t.blur,
    e[n++] = t.distance,
    e[n++] = Rt.shared.setValue(t.color).toNumber()),
    n
}
const g2 = class dc extends Jr {
    constructor(e={}) {
        super(),
        dfe(e);
        const n = {
            ...dc.defaultTextStyle,
            ...e
        };
        for (const r in n) {
            const i = r;
            this[i] = n[r]
        }
        this.update()
    }
    get align() {
        return this._align
    }
    set align(e) {
        this._align = e,
        this.update()
    }
    get breakWords() {
        return this._breakWords
    }
    set breakWords(e) {
        this._breakWords = e,
        this.update()
    }
    get dropShadow() {
        return this._dropShadow
    }
    set dropShadow(e) {
        e !== null && typeof e == "object" ? this._dropShadow = this._createProxy({
            ...dc.defaultDropShadow,
            ...e
        }) : this._dropShadow = e ? this._createProxy({
            ...dc.defaultDropShadow
        }) : null,
        this.update()
    }
    get fontFamily() {
        return this._fontFamily
    }
    set fontFamily(e) {
        this._fontFamily = e,
        this.update()
    }
    get fontSize() {
        return this._fontSize
    }
    set fontSize(e) {
        typeof e == "string" ? this._fontSize = parseInt(e, 10) : this._fontSize = e,
        this.update()
    }
    get fontStyle() {
        return this._fontStyle
    }
    set fontStyle(e) {
        this._fontStyle = e.toLowerCase(),
        this.update()
    }
    get fontVariant() {
        return this._fontVariant
    }
    set fontVariant(e) {
        this._fontVariant = e,
        this.update()
    }
    get fontWeight() {
        return this._fontWeight
    }
    set fontWeight(e) {
        this._fontWeight = e,
        this.update()
    }
    get leading() {
        return this._leading
    }
    set leading(e) {
        this._leading = e,
        this.update()
    }
    get letterSpacing() {
        return this._letterSpacing
    }
    set letterSpacing(e) {
        this._letterSpacing = e,
        this.update()
    }
    get lineHeight() {
        return this._lineHeight
    }
    set lineHeight(e) {
        this._lineHeight = e,
        this.update()
    }
    get padding() {
        return this._padding
    }
    set padding(e) {
        this._padding = e,
        this.update()
    }
    get filters() {
        return this._filters
    }
    set filters(e) {
        this._filters = e,
        this.update()
    }
    get trim() {
        return this._trim
    }
    set trim(e) {
        this._trim = e,
        this.update()
    }
    get textBaseline() {
        return this._textBaseline
    }
    set textBaseline(e) {
        this._textBaseline = e,
        this.update()
    }
    get whiteSpace() {
        return this._whiteSpace
    }
    set whiteSpace(e) {
        this._whiteSpace = e,
        this.update()
    }
    get wordWrap() {
        return this._wordWrap
    }
    set wordWrap(e) {
        this._wordWrap = e,
        this.update()
    }
    get wordWrapWidth() {
        return this._wordWrapWidth
    }
    set wordWrapWidth(e) {
        this._wordWrapWidth = e,
        this.update()
    }
    get fill() {
        return this._originalFill
    }
    set fill(e) {
        e !== this._originalFill && (this._originalFill = e,
        this._isFillStyle(e) && (this._originalFill = this._createProxy({
            ...ci.defaultFillStyle,
            ...e
        }, () => {
            this._fill = za({
                ...this._originalFill
            }, ci.defaultFillStyle)
        }
        )),
        this._fill = za(e === 0 ? "black" : e, ci.defaultFillStyle),
        this.update())
    }
    get stroke() {
        return this._originalStroke
    }
    set stroke(e) {
        e !== this._originalStroke && (this._originalStroke = e,
        this._isFillStyle(e) && (this._originalStroke = this._createProxy({
            ...ci.defaultStrokeStyle,
            ...e
        }, () => {
            this._stroke = A0({
                ...this._originalStroke
            }, ci.defaultStrokeStyle)
        }
        )),
        this._stroke = A0(e, ci.defaultStrokeStyle),
        this.update())
    }
    _generateKey() {
        return this._styleKey = lfe(this),
        this._styleKey
    }
    update() {
        this._styleKey = null,
        this.emit("update", this)
    }
    reset() {
        const e = dc.defaultTextStyle;
        for (const n in e)
            this[n] = e[n]
    }
    get styleKey() {
        return this._styleKey || this._generateKey()
    }
    clone() {
        return new dc({
            align: this.align,
            breakWords: this.breakWords,
            dropShadow: this._dropShadow ? {
                ...this._dropShadow
            } : null,
            fill: this._fill,
            fontFamily: this.fontFamily,
            fontSize: this.fontSize,
            fontStyle: this.fontStyle,
            fontVariant: this.fontVariant,
            fontWeight: this.fontWeight,
            leading: this.leading,
            letterSpacing: this.letterSpacing,
            lineHeight: this.lineHeight,
            padding: this.padding,
            stroke: this._stroke,
            textBaseline: this.textBaseline,
            whiteSpace: this.whiteSpace,
            wordWrap: this.wordWrap,
            wordWrapWidth: this.wordWrapWidth,
            filters: this._filters ? [...this._filters] : void 0
        })
    }
    _getFinalPadding() {
        let e = 0;
        if (this._filters)
            for (let n = 0; n < this._filters.length; n++)
                e += this._filters[n].padding;
        return Math.max(this._padding, e)
    }
    destroy(e=!1) {
        var r, i, o, s;
        if (this.removeAllListeners(),
        typeof e == "boolean" ? e : e == null ? void 0 : e.texture) {
            const a = typeof e == "boolean" ? e : e == null ? void 0 : e.textureSource;
            (r = this._fill) != null && r.texture && this._fill.texture.destroy(a),
            (i = this._originalFill) != null && i.texture && this._originalFill.texture.destroy(a),
            (o = this._stroke) != null && o.texture && this._stroke.texture.destroy(a),
            (s = this._originalStroke) != null && s.texture && this._originalStroke.texture.destroy(a)
        }
        this._fill = null,
        this._stroke = null,
        this.dropShadow = null,
        this._originalStroke = null,
        this._originalFill = null
    }
    _createProxy(e, n) {
        return new Proxy(e,{
            set: (r, i, o) => (r[i] = o,
            n == null || n(i, o),
            this.update(),
            !0)
        })
    }
    _isFillStyle(e) {
        return (e ?? null) !== null && !(Rt.isColorLike(e) || e instanceof ss || e instanceof nm)
    }
}
;
g2.defaultDropShadow = {
    alpha: 1,
    angle: Math.PI / 6,
    blur: 0,
    color: "black",
    distance: 5
};
g2.defaultTextStyle = {
    align: "left",
    breakWords: !1,
    dropShadow: null,
    fill: "black",
    fontFamily: "Arial",
    fontSize: 26,
    fontStyle: "normal",
    fontVariant: "normal",
    fontWeight: "normal",
    leading: 0,
    letterSpacing: 0,
    lineHeight: 0,
    padding: 0,
    stroke: null,
    textBaseline: "alphabetic",
    trim: !1,
    whiteSpace: "pre",
    wordWrap: !1,
    wordWrapWidth: 100
};
let bl = g2;
function dfe(t) {
    const e = t;
    if (typeof e.dropShadow == "boolean" && e.dropShadow) {
        const n = bl.defaultDropShadow;
        t.dropShadow = {
            alpha: e.dropShadowAlpha ?? n.alpha,
            angle: e.dropShadowAngle ?? n.angle,
            blur: e.dropShadowBlur ?? n.blur,
            color: e.dropShadowColor ?? n.color,
            distance: e.dropShadowDistance ?? n.distance
        }
    }
    if (e.strokeThickness !== void 0) {
        Fe(rt, "strokeThickness is now a part of stroke");
        const n = e.stroke;
        let r = {};
        if (Rt.isColorLike(n))
            r.color = n;
        else if (n instanceof ss || n instanceof nm)
            r.fill = n;
        else if (Object.hasOwnProperty.call(n, "color") || Object.hasOwnProperty.call(n, "fill"))
            r = n;
        else
            throw new Error("Invalid stroke value.");
        t.stroke = {
            ...r,
            width: e.strokeThickness
        }
    }
    if (Array.isArray(e.fillGradientStops)) {
        if (Fe(rt, "gradient fill is now a fill pattern: `new FillGradient(...)`"),
        !Array.isArray(e.fill) || e.fill.length === 0)
            throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");
        e.fill.length !== e.fillGradientStops.length && Ne("The number of fill colors must match the number of fill gradient stops.");
        const n = new ss({
            start: {
                x: 0,
                y: 0
            },
            end: {
                x: 0,
                y: 1
            },
            textureSpace: "local"
        })
          , r = e.fillGradientStops.slice()
          , i = e.fill.map(o => Rt.shared.setValue(o).toNumber());
        r.forEach( (o, s) => {
            n.addColorStop(o, i[s])
        }
        ),
        t.fill = {
            fill: n
        }
    }
}
class hfe {
    constructor(e) {
        this._canvasPool = Object.create(null),
        this.canvasOptions = e || {},
        this.enableFullScreen = !1
    }
    _createCanvasAndContext(e, n) {
        const r = je.get().createCanvas();
        r.width = e,
        r.height = n;
        const i = r.getContext("2d");
        return {
            canvas: r,
            context: i
        }
    }
    getOptimalCanvasAndContext(e, n, r=1) {
        e = Math.ceil(e * r - 1e-6),
        n = Math.ceil(n * r - 1e-6),
        e = Yc(e),
        n = Yc(n);
        const i = (e << 17) + (n << 1);
        this._canvasPool[i] || (this._canvasPool[i] = []);
        let o = this._canvasPool[i].pop();
        return o || (o = this._createCanvasAndContext(e, n)),
        o
    }
    returnCanvasAndContext(e) {
        const n = e.canvas
          , {width: r, height: i} = n
          , o = (r << 17) + (i << 1);
        e.context.resetTransform(),
        e.context.clearRect(0, 0, r, i),
        this._canvasPool[o].push(e)
    }
    clear() {
        this._canvasPool = {}
    }
}
const sa = new hfe
  , t3 = 1e5;
function T0(t, e, n, r=0) {
    if (t.texture === Ae.WHITE && !t.fill)
        return Rt.shared.setValue(t.color).setAlpha(t.alpha ?? 1).toHexa();
    if (t.fill) {
        if (t.fill instanceof nm) {
            const i = t.fill
              , o = e.createPattern(i.texture.source.resource, "repeat")
              , s = i.transform.copyTo(Oe.shared);
            return s.scale(i.texture.frame.width, i.texture.frame.height),
            o.setTransform(s),
            o
        } else if (t.fill instanceof ss) {
            const i = t.fill
              , o = i.type === "linear"
              , s = i.textureSpace === "local";
            let a = 1
              , l = 1;
            s && n && (a = n.width + r,
            l = n.height + r);
            let c, u = !1;
            if (o) {
                const {start: f, end: d} = i;
                c = e.createLinearGradient(f.x * a, f.y * l, d.x * a, d.y * l),
                u = Math.abs(d.x - f.x) < Math.abs((d.y - f.y) * .1)
            } else {
                const {center: f, innerRadius: d, outerCenter: h, outerRadius: p} = i;
                c = e.createRadialGradient(f.x * a, f.y * l, d * a, h.x * a, h.y * l, p * a)
            }
            if (u && s && n) {
                const f = n.lineHeight / l;
                for (let d = 0; d < n.lines.length; d++) {
                    const h = (d * n.lineHeight + r / 2) / l;
                    i.colorStops.forEach(p => {
                        const y = h + p.offset * f;
                        c.addColorStop(Math.floor(y * t3) / t3, Rt.shared.setValue(p.color).toHex())
                    }
                    )
                }
            } else
                i.colorStops.forEach(f => {
                    c.addColorStop(f.offset, Rt.shared.setValue(f.color).toHex())
                }
                );
            return c
        }
    } else {
        const i = e.createPattern(t.texture.source.resource, "repeat")
          , o = t.matrix.copyTo(Oe.shared);
        return o.scale(t.texture.frame.width, t.texture.frame.height),
        i.setTransform(o),
        i
    }
    return Ne("FillStyle not recognised", t),
    "red"
}
const HB = class VB extends EB {
    constructor(e) {
        super(),
        this.resolution = 1,
        this.pages = [],
        this._padding = 0,
        this._measureCache = Object.create(null),
        this._currentChars = [],
        this._currentX = 0,
        this._currentY = 0,
        this._currentMaxCharHeight = 0,
        this._currentPageIndex = -1,
        this._skipKerning = !1;
        const n = {
            ...VB.defaultOptions,
            ...e
        };
        this._textureSize = n.textureSize,
        this._mipmap = n.mipmap;
        const r = n.style.clone();
        n.overrideFill && (r._fill.color = 16777215,
        r._fill.alpha = 1,
        r._fill.texture = Ae.WHITE,
        r._fill.fill = null),
        this.applyFillAsTint = n.overrideFill;
        const i = r.fontSize;
        r.fontSize = this.baseMeasurementFontSize;
        const o = C0(r);
        n.overrideSize ? r._stroke && (r._stroke.width *= this.baseRenderedFontSize / i) : r.fontSize = this.baseRenderedFontSize = i,
        this._style = r,
        this._skipKerning = n.skipKerning ?? !1,
        this.resolution = n.resolution ?? 1,
        this._padding = n.padding ?? 4,
        n.textureStyle && (this._textureStyle = n.textureStyle instanceof yo ? n.textureStyle : new yo(n.textureStyle)),
        this.fontMetrics = Ii.measureFont(o),
        this.lineHeight = r.lineHeight || this.fontMetrics.fontSize || r.fontSize
    }
    ensureCharacters(e) {
        var v, g;
        const n = Ii.graphemeSegmenter(e).filter(m => !this._currentChars.includes(m)).filter( (m, _, x) => x.indexOf(m) === _);
        if (!n.length)
            return;
        this._currentChars = [...this._currentChars, ...n];
        let r;
        this._currentPageIndex === -1 ? r = this._nextPage() : r = this.pages[this._currentPageIndex];
        let {canvas: i, context: o} = r.canvasAndContext
          , s = r.texture.source;
        const a = this._style;
        let l = this._currentX
          , c = this._currentY
          , u = this._currentMaxCharHeight;
        const f = this.baseRenderedFontSize / this.baseMeasurementFontSize
          , d = this._padding * f;
        let h = !1;
        const p = i.width / this.resolution
          , y = i.height / this.resolution;
        for (let m = 0; m < n.length; m++) {
            const _ = n[m]
              , x = Ii.measureText(_, a, i, !1);
            x.lineHeight = x.height;
            const b = x.width * f
              , w = Math.ceil((a.fontStyle === "italic" ? 2 : 1) * b)
              , E = x.height * f
              , S = w + d * 2
              , P = E + d * 2;
            if (h = !1,
            _ !== `
` && _ !== "\r" && _ !== "	" && _ !== " " && (h = !0,
            u = Math.ceil(Math.max(P, u))),
            l + S > p && (c += u,
            u = P,
            l = 0,
            c + u > y)) {
                s.update();
                const A = this._nextPage();
                i = A.canvasAndContext.canvas,
                o = A.canvasAndContext.context,
                s = A.texture.source,
                l = 0,
                c = 0,
                u = 0
            }
            const C = b / f - (((v = a.dropShadow) == null ? void 0 : v.distance) ?? 0) - (((g = a._stroke) == null ? void 0 : g.width) ?? 0);
            if (this.chars[_] = {
                id: _.codePointAt(0),
                xOffset: -this._padding,
                yOffset: -this._padding,
                xAdvance: C,
                kerning: {}
            },
            h) {
                this._drawGlyph(o, x, l + d, c + d, f, a);
                const A = s.width * f
                  , T = s.height * f
                  , I = new vt(l / A * s.width,c / T * s.height,S / A * s.width,P / T * s.height);
                this.chars[_].texture = new Ae({
                    source: s,
                    frame: I
                }),
                l += Math.ceil(S)
            }
        }
        s.update(),
        this._currentX = l,
        this._currentY = c,
        this._currentMaxCharHeight = u,
        this._skipKerning && this._applyKerning(n, o)
    }
    get pageTextures() {
        return Fe(rt, "BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),
        this.pages
    }
    _applyKerning(e, n) {
        const r = this._measureCache;
        for (let i = 0; i < e.length; i++) {
            const o = e[i];
            for (let s = 0; s < this._currentChars.length; s++) {
                const a = this._currentChars[s];
                let l = r[o];
                l || (l = r[o] = n.measureText(o).width);
                let c = r[a];
                c || (c = r[a] = n.measureText(a).width);
                let u = n.measureText(o + a).width
                  , f = u - (l + c);
                f && (this.chars[o].kerning[a] = f),
                u = n.measureText(o + a).width,
                f = u - (l + c),
                f && (this.chars[a].kerning[o] = f)
            }
        }
    }
    _nextPage() {
        this._currentPageIndex++;
        const e = this.resolution
          , n = sa.getOptimalCanvasAndContext(this._textureSize, this._textureSize, e);
        this._setupContext(n.context, this._style, e);
        const r = e * (this.baseRenderedFontSize / this.baseMeasurementFontSize)
          , i = new Ae({
            source: new yl({
                resource: n.canvas,
                resolution: r,
                alphaMode: "premultiply-alpha-on-upload",
                autoGenerateMipmaps: this._mipmap
            })
        });
        this._textureStyle && (i.source.style = this._textureStyle);
        const o = {
            canvasAndContext: n,
            texture: i
        };
        return this.pages[this._currentPageIndex] = o,
        o
    }
    _setupContext(e, n, r) {
        n.fontSize = this.baseRenderedFontSize,
        e.scale(r, r),
        e.font = C0(n),
        n.fontSize = this.baseMeasurementFontSize,
        e.textBaseline = n.textBaseline;
        const i = n._stroke
          , o = (i == null ? void 0 : i.width) ?? 0;
        if (i && (e.lineWidth = o,
        e.lineJoin = i.join,
        e.miterLimit = i.miterLimit,
        e.strokeStyle = T0(i, e)),
        n._fill && (e.fillStyle = T0(n._fill, e)),
        n.dropShadow) {
            const s = n.dropShadow
              , a = Rt.shared.setValue(s.color).toArray()
              , l = s.blur * r
              , c = s.distance * r;
            e.shadowColor = `rgba(${a[0] * 255},${a[1] * 255},${a[2] * 255},${s.alpha})`,
            e.shadowBlur = l,
            e.shadowOffsetX = Math.cos(s.angle) * c,
            e.shadowOffsetY = Math.sin(s.angle) * c
        } else
            e.shadowColor = "black",
            e.shadowBlur = 0,
            e.shadowOffsetX = 0,
            e.shadowOffsetY = 0
    }
    _drawGlyph(e, n, r, i, o, s) {
        const a = n.text
          , l = n.fontProperties
          , c = s._stroke
          , u = ((c == null ? void 0 : c.width) ?? 0) * o
          , f = r + u / 2
          , d = i - u / 2
          , h = l.descent * o
          , p = n.lineHeight * o;
        let y = !1;
        s.stroke && u && (y = !0,
        e.strokeText(a, f, d + p - h));
        const {shadowBlur: v, shadowOffsetX: g, shadowOffsetY: m} = e;
        s._fill && (y && (e.shadowBlur = 0,
        e.shadowOffsetX = 0,
        e.shadowOffsetY = 0),
        e.fillText(a, f, d + p - h)),
        y && (e.shadowBlur = v,
        e.shadowOffsetX = g,
        e.shadowOffsetY = m)
    }
    destroy() {
        super.destroy();
        for (let e = 0; e < this.pages.length; e++) {
            const {canvasAndContext: n, texture: r} = this.pages[e];
            sa.returnCanvasAndContext(n),
            r.destroy(!0)
        }
        this.pages = null
    }
}
;
HB.defaultOptions = {
    textureSize: 512,
    style: new bl,
    mipmap: !0
};
let n3 = HB;
function zB(t, e, n, r) {
    const i = {
        width: 0,
        height: 0,
        offsetY: 0,
        scale: e.fontSize / n.baseMeasurementFontSize,
        lines: [{
            width: 0,
            charPositions: [],
            spaceWidth: 0,
            spacesIndex: [],
            chars: []
        }]
    };
    i.offsetY = n.baseLineOffset;
    let o = i.lines[0]
      , s = null
      , a = !0;
    const l = {
        spaceWord: !1,
        width: 0,
        start: 0,
        index: 0,
        positions: [],
        chars: []
    }
      , c = n.baseMeasurementFontSize / e.fontSize
      , u = e.letterSpacing * c
      , f = e.wordWrapWidth * c
      , d = e.lineHeight ? e.lineHeight * c : n.lineHeight
      , h = e.wordWrap && e.breakWords
      , p = g => {
        const m = o.width;
        for (let _ = 0; _ < l.index; _++) {
            const x = g.positions[_];
            o.chars.push(g.chars[_]),
            o.charPositions.push(x + m)
        }
        o.width += g.width,
        a = !1,
        l.width = 0,
        l.index = 0,
        l.chars.length = 0
    }
      , y = () => {
        let g = o.chars.length - 1;
        if (r) {
            let m = o.chars[g];
            for (; m === " "; )
                o.width -= n.chars[m].xAdvance,
                m = o.chars[--g]
        }
        i.width = Math.max(i.width, o.width),
        o = {
            width: 0,
            charPositions: [],
            chars: [],
            spaceWidth: 0,
            spacesIndex: []
        },
        a = !0,
        i.lines.push(o),
        i.height += d
    }
      , v = g => g - u > f;
    for (let g = 0; g < t.length + 1; g++) {
        let m;
        const _ = g === t.length;
        _ || (m = t[g]);
        const x = n.chars[m] || n.chars[" "];
        if (/(?:\s)/.test(m) || m === "\r" || m === `
` || _) {
            if (!a && e.wordWrap && v(o.width + l.width) ? (y(),
            p(l),
            _ || o.charPositions.push(0)) : (l.start = o.width,
            p(l),
            _ || o.charPositions.push(0)),
            m === "\r" || m === `
`)
                o.width !== 0 && y();
            else if (!_) {
                const S = x.xAdvance + (x.kerning[s] || 0) + u;
                o.width += S,
                o.spaceWidth = S,
                o.spacesIndex.push(o.charPositions.length),
                o.chars.push(m)
            }
        } else {
            const E = x.kerning[s] || 0
              , S = x.xAdvance + E + u;
            h && v(o.width + l.width + S) && (p(l),
            y()),
            l.positions[l.index++] = l.width + E,
            l.chars.push(m),
            l.width += S
        }
        s = m
    }
    return y(),
    e.align === "center" ? pfe(i) : e.align === "right" ? gfe(i) : e.align === "justify" && mfe(i),
    i
}
function pfe(t) {
    for (let e = 0; e < t.lines.length; e++) {
        const n = t.lines[e]
          , r = t.width / 2 - n.width / 2;
        for (let i = 0; i < n.charPositions.length; i++)
            n.charPositions[i] += r
    }
}
function gfe(t) {
    for (let e = 0; e < t.lines.length; e++) {
        const n = t.lines[e]
          , r = t.width - n.width;
        for (let i = 0; i < n.charPositions.length; i++)
            n.charPositions[i] += r
    }
}
function mfe(t) {
    const e = t.width;
    for (let n = 0; n < t.lines.length; n++) {
        const r = t.lines[n];
        let i = 0
          , o = r.spacesIndex[i++]
          , s = 0;
        const a = r.spacesIndex.length
          , c = (e - r.width) / a;
        for (let u = 0; u < r.charPositions.length; u++)
            u === o && (o = r.spacesIndex[i++],
            s += c),
            r.charPositions[u] += s
    }
}
function vfe(t) {
    if (t === "")
        return [];
    typeof t == "string" && (t = [t]);
    const e = [];
    for (let n = 0, r = t.length; n < r; n++) {
        const i = t[n];
        if (Array.isArray(i)) {
            if (i.length !== 2)
                throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);
            if (i[0].length === 0 || i[1].length === 0)
                throw new Error("[BitmapFont]: Invalid character delimiter.");
            const o = i[0].charCodeAt(0)
              , s = i[1].charCodeAt(0);
            if (s < o)
                throw new Error("[BitmapFont]: Invalid character range.");
            for (let a = o, l = s; a <= l; a++)
                e.push(String.fromCharCode(a))
        } else
            e.push(...Array.from(i))
    }
    if (e.length === 0)
        throw new Error("[BitmapFont]: Empty set when resolving characters.");
    return e
}
let ap = 0;
class yfe {
    constructor() {
        this.ALPHA = [["a", "z"], ["A", "Z"], " "],
        this.NUMERIC = [["0", "9"]],
        this.ALPHANUMERIC = [["a", "z"], ["A", "Z"], ["0", "9"], " "],
        this.ASCII = [[" ", "~"]],
        this.defaultOptions = {
            chars: this.ALPHANUMERIC,
            resolution: 1,
            padding: 4,
            skipKerning: !1,
            textureStyle: null
        }
    }
    getFont(e, n) {
        var s;
        let r = `${n.fontFamily}-bitmap`
          , i = !0;
        if (n._fill.fill && !n._stroke)
            r += n._fill.fill.styleKey,
            i = !1;
        else if (n._stroke || n.dropShadow) {
            let a = n.styleKey;
            a = a.substring(0, a.lastIndexOf("-")),
            r = `${a}-bitmap`,
            i = !1
        }
        if (!bt.has(r)) {
            const a = Object.create(n);
            a.lineHeight = 0;
            const l = new n3({
                style: a,
                overrideFill: i,
                overrideSize: !0,
                ...this.defaultOptions
            });
            ap++,
            ap > 50 && Ne("BitmapText", `You have dynamically created ${ap} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),
            l.once("destroy", () => {
                ap--,
                bt.remove(r)
            }
            ),
            bt.set(r, l)
        }
        const o = bt.get(r);
        return (s = o.ensureCharacters) == null || s.call(o, e),
        o
    }
    getLayout(e, n, r=!0) {
        const i = this.getFont(e, n)
          , o = Ii.graphemeSegmenter(e);
        return zB(o, n, i, r)
    }
    measureText(e, n, r=!0) {
        return this.getLayout(e, n, r)
    }
    install(...e) {
        var c, u, f, d;
        let n = e[0];
        typeof n == "string" && (n = {
            name: n,
            style: e[1],
            chars: (c = e[2]) == null ? void 0 : c.chars,
            resolution: (u = e[2]) == null ? void 0 : u.resolution,
            padding: (f = e[2]) == null ? void 0 : f.padding,
            skipKerning: (d = e[2]) == null ? void 0 : d.skipKerning
        },
        Fe(rt, "BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));
        const r = n == null ? void 0 : n.name;
        if (!r)
            throw new Error("[BitmapFontManager] Property `name` is required.");
        n = {
            ...this.defaultOptions,
            ...n
        };
        const i = n.style
          , o = i instanceof bl ? i : new bl(i)
          , s = n.dynamicFill ?? this._canUseTintForStyle(o)
          , a = new n3({
            style: o,
            overrideFill: s,
            skipKerning: n.skipKerning,
            padding: n.padding,
            resolution: n.resolution,
            overrideSize: !1,
            textureStyle: n.textureStyle
        })
          , l = vfe(n.chars);
        return a.ensureCharacters(l.join("")),
        bt.set(`${r}-bitmap`, a),
        a.once("destroy", () => bt.remove(`${r}-bitmap`)),
        a
    }
    uninstall(e) {
        const n = `${e}-bitmap`
          , r = bt.get(n);
        r && r.destroy()
    }
    _canUseTintForStyle(e) {
        return !e._stroke && (!e.dropShadow || e.dropShadow.color === 0) && !e._fill.fill && e._fill.color === 16777215
    }
}
const K_ = new yfe;
class jB extends EB {
    constructor(e, n) {
        super();
        const {textures: r, data: i} = e;
        Object.keys(i.pages).forEach(o => {
            const s = i.pages[parseInt(o, 10)]
              , a = r[s.id];
            this.pages.push({
                texture: a
            })
        }
        ),
        Object.keys(i.chars).forEach(o => {
            const s = i.chars[o]
              , {frame: a, source: l, rotate: c} = r[s.page]
              , u = Et.transformRectCoords(s, a, c, new vt)
              , f = new Ae({
                frame: u,
                orig: new vt(0,0,s.width,s.height),
                source: l,
                rotate: c
            });
            this.chars[o] = {
                id: o.codePointAt(0),
                xOffset: s.xOffset,
                yOffset: s.yOffset,
                xAdvance: s.xAdvance,
                kerning: s.kerning ?? {},
                texture: f
            }
        }
        ),
        this.baseRenderedFontSize = i.fontSize,
        this.baseMeasurementFontSize = i.fontSize,
        this.fontMetrics = {
            ascent: 0,
            descent: 0,
            fontSize: i.fontSize
        },
        this.baseLineOffset = i.baseLineOffset,
        this.lineHeight = i.lineHeight,
        this.fontFamily = i.fontFamily,
        this.distanceField = i.distanceField ?? {
            type: "none",
            range: 0
        },
        this.url = n
    }
    destroy() {
        super.destroy();
        for (let e = 0; e < this.pages.length; e++) {
            const {texture: n} = this.pages[e];
            n.destroy(!0)
        }
        this.pages = null
    }
    static install(e) {
        K_.install(e)
    }
    static uninstall(e) {
        K_.uninstall(e)
    }
}
const H1 = {
    test(t) {
        return typeof t == "string" && t.startsWith("info face=")
    },
    parse(t) {
        const e = t.match(/^[a-z]+\s+.+$/gm)
          , n = {
            info: [],
            common: [],
            page: [],
            char: [],
            chars: [],
            kerning: [],
            kernings: [],
            distanceField: []
        };
        for (const f in e) {
            const d = e[f].match(/^[a-z]+/gm)[0]
              , h = e[f].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm)
              , p = {};
            for (const y in h) {
                const v = h[y].split("=")
                  , g = v[0]
                  , m = v[1].replace(/"/gm, "")
                  , _ = parseFloat(m)
                  , x = isNaN(_) ? m : _;
                p[g] = x
            }
            n[d].push(p)
        }
        const r = {
            chars: {},
            pages: [],
            lineHeight: 0,
            fontSize: 0,
            fontFamily: "",
            distanceField: null,
            baseLineOffset: 0
        }
          , [i] = n.info
          , [o] = n.common
          , [s] = n.distanceField ?? [];
        s && (r.distanceField = {
            range: parseInt(s.distanceRange, 10),
            type: s.fieldType
        }),
        r.fontSize = parseInt(i.size, 10),
        r.fontFamily = i.face,
        r.lineHeight = parseInt(o.lineHeight, 10);
        const a = n.page;
        for (let f = 0; f < a.length; f++)
            r.pages.push({
                id: parseInt(a[f].id, 10) || 0,
                file: a[f].file
            });
        const l = {};
        r.baseLineOffset = r.lineHeight - parseInt(o.base, 10);
        const c = n.char;
        for (let f = 0; f < c.length; f++) {
            const d = c[f]
              , h = parseInt(d.id, 10);
            let p = d.letter ?? d.char ?? String.fromCharCode(h);
            p === "space" && (p = " "),
            l[h] = p,
            r.chars[p] = {
                id: h,
                page: parseInt(d.page, 10) || 0,
                x: parseInt(d.x, 10),
                y: parseInt(d.y, 10),
                width: parseInt(d.width, 10),
                height: parseInt(d.height, 10),
                xOffset: parseInt(d.xoffset, 10),
                yOffset: parseInt(d.yoffset, 10),
                xAdvance: parseInt(d.xadvance, 10),
                kerning: {}
            }
        }
        const u = n.kerning || [];
        for (let f = 0; f < u.length; f++) {
            const d = parseInt(u[f].first, 10)
              , h = parseInt(u[f].second, 10)
              , p = parseInt(u[f].amount, 10);
            r.chars[l[h]].kerning[l[d]] = p
        }
        return r
    }
}
  , r3 = {
    test(t) {
        const e = t;
        return typeof e != "string" && "getElementsByTagName"in e && e.getElementsByTagName("page").length && e.getElementsByTagName("info")[0].getAttribute("face") !== null
    },
    parse(t) {
        const e = {
            chars: {},
            pages: [],
            lineHeight: 0,
            fontSize: 0,
            fontFamily: "",
            distanceField: null,
            baseLineOffset: 0
        }
          , n = t.getElementsByTagName("info")[0]
          , r = t.getElementsByTagName("common")[0]
          , i = t.getElementsByTagName("distanceField")[0];
        i && (e.distanceField = {
            type: i.getAttribute("fieldType"),
            range: parseInt(i.getAttribute("distanceRange"), 10)
        });
        const o = t.getElementsByTagName("page")
          , s = t.getElementsByTagName("char")
          , a = t.getElementsByTagName("kerning");
        e.fontSize = parseInt(n.getAttribute("size"), 10),
        e.fontFamily = n.getAttribute("face"),
        e.lineHeight = parseInt(r.getAttribute("lineHeight"), 10);
        for (let c = 0; c < o.length; c++)
            e.pages.push({
                id: parseInt(o[c].getAttribute("id"), 10) || 0,
                file: o[c].getAttribute("file")
            });
        const l = {};
        e.baseLineOffset = e.lineHeight - parseInt(r.getAttribute("base"), 10);
        for (let c = 0; c < s.length; c++) {
            const u = s[c]
              , f = parseInt(u.getAttribute("id"), 10);
            let d = u.getAttribute("letter") ?? u.getAttribute("char") ?? String.fromCharCode(f);
            d === "space" && (d = " "),
            l[f] = d,
            e.chars[d] = {
                id: f,
                page: parseInt(u.getAttribute("page"), 10) || 0,
                x: parseInt(u.getAttribute("x"), 10),
                y: parseInt(u.getAttribute("y"), 10),
                width: parseInt(u.getAttribute("width"), 10),
                height: parseInt(u.getAttribute("height"), 10),
                xOffset: parseInt(u.getAttribute("xoffset"), 10),
                yOffset: parseInt(u.getAttribute("yoffset"), 10),
                xAdvance: parseInt(u.getAttribute("xadvance"), 10),
                kerning: {}
            }
        }
        for (let c = 0; c < a.length; c++) {
            const u = parseInt(a[c].getAttribute("first"), 10)
              , f = parseInt(a[c].getAttribute("second"), 10)
              , d = parseInt(a[c].getAttribute("amount"), 10);
            e.chars[l[f]].kerning[l[u]] = d
        }
        return e
    }
}
  , i3 = {
    test(t) {
        return typeof t == "string" && t.includes("<font>") ? r3.test(je.get().parseXML(t)) : !1
    },
    parse(t) {
        return r3.parse(je.get().parseXML(t))
    }
}
  , _fe = [".xml", ".fnt"]
  , xfe = {
    extension: {
        type: V.CacheParser,
        name: "cacheBitmapFont"
    },
    test: t => t instanceof jB,
    getCacheableAssets(t, e) {
        const n = {};
        return t.forEach(r => {
            n[r] = e,
            n[`${r}-bitmap`] = e
        }
        ),
        n[`${e.fontFamily}-bitmap`] = e,
        n
    }
}
  , bfe = {
    extension: {
        type: V.LoadParser,
        priority: ha.Normal
    },
    name: "loadBitmapFont",
    id: "bitmap-font",
    test(t) {
        return _fe.includes(Pr.extname(t).toLowerCase())
    },
    async testParse(t) {
        return H1.test(t) || i3.test(t)
    },
    async parse(t, e, n) {
        const r = H1.test(t) ? H1.parse(t) : i3.parse(t)
          , {src: i} = e
          , {pages: o} = r
          , s = []
          , a = r.distanceField ? {
            scaleMode: "linear",
            alphaMode: "premultiply-alpha-on-upload",
            autoGenerateMipmaps: !1,
            resolution: 1
        } : {};
        for (let f = 0; f < o.length; ++f) {
            const d = o[f].file;
            let h = Pr.join(Pr.dirname(i), d);
            h = k_(h, i),
            s.push({
                src: h,
                data: a
            })
        }
        const l = await n.load(s)
          , c = s.map(f => l[f.src]);
        return new jB({
            data: r,
            textures: c
        },i)
    },
    async load(t, e) {
        return await (await je.get().fetch(t)).text()
    },
    async unload(t, e, n) {
        await Promise.all(t.pages.map(r => n.unload(r.texture.source._sourceOrigin))),
        t.destroy()
    }
};
class wfe {
    constructor(e, n=!1) {
        this._loader = e,
        this._assetList = [],
        this._isLoading = !1,
        this._maxConcurrent = 1,
        this.verbose = n
    }
    add(e) {
        e.forEach(n => {
            this._assetList.push(n)
        }
        ),
        this.verbose && console.log("[BackgroundLoader] assets: ", this._assetList),
        this._isActive && !this._isLoading && this._next()
    }
    async _next() {
        if (this._assetList.length && this._isActive) {
            this._isLoading = !0;
            const e = []
              , n = Math.min(this._assetList.length, this._maxConcurrent);
            for (let r = 0; r < n; r++)
                e.push(this._assetList.pop());
            await this._loader.load(e),
            this._isLoading = !1,
            this._next()
        }
    }
    get active() {
        return this._isActive
    }
    set active(e) {
        this._isActive !== e && (this._isActive = e,
        e && !this._isLoading && this._next())
    }
}
const Efe = {
    extension: {
        type: V.CacheParser,
        name: "cacheTextureArray"
    },
    test: t => Array.isArray(t) && t.every(e => e instanceof Ae),
    getCacheableAssets: (t, e) => {
        const n = {};
        return t.forEach(r => {
            e.forEach( (i, o) => {
                n[r + (o === 0 ? "" : o + 1)] = i
            }
            )
        }
        ),
        n
    }
};
async function WB(t) {
    if ("Image"in globalThis)
        return new Promise(e => {
            const n = new Image;
            n.onload = () => {
                e(!0)
            }
            ,
            n.onerror = () => {
                e(!1)
            }
            ,
            n.src = t
        }
        );
    if ("createImageBitmap"in globalThis && "fetch"in globalThis) {
        try {
            const e = await (await fetch(t)).blob();
            await createImageBitmap(e)
        } catch {
            return !1
        }
        return !0
    }
    return !1
}
const Sfe = {
    extension: {
        type: V.DetectionParser,
        priority: 1
    },
    test: async () => WB("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),
    add: async t => [...t, "avif"],
    remove: async t => t.filter(e => e !== "avif")
}
  , o3 = ["png", "jpg", "jpeg"]
  , Cfe = {
    extension: {
        type: V.DetectionParser,
        priority: -1
    },
    test: () => Promise.resolve(!0),
    add: async t => [...t, ...o3],
    remove: async t => t.filter(e => !o3.includes(e))
}
  , Afe = "WorkerGlobalScope"in globalThis && globalThis instanceof globalThis.WorkerGlobalScope;
function im(t) {
    return Afe ? !1 : document.createElement("video").canPlayType(t) !== ""
}
const Tfe = {
    extension: {
        type: V.DetectionParser,
        priority: 0
    },
    test: async () => im("video/mp4"),
    add: async t => [...t, "mp4", "m4v"],
    remove: async t => t.filter(e => e !== "mp4" && e !== "m4v")
}
  , Pfe = {
    extension: {
        type: V.DetectionParser,
        priority: 0
    },
    test: async () => im("video/ogg"),
    add: async t => [...t, "ogv"],
    remove: async t => t.filter(e => e !== "ogv")
}
  , Ife = {
    extension: {
        type: V.DetectionParser,
        priority: 0
    },
    test: async () => im("video/webm"),
    add: async t => [...t, "webm"],
    remove: async t => t.filter(e => e !== "webm")
}
  , Ofe = {
    extension: {
        type: V.DetectionParser,
        priority: 0
    },
    test: async () => WB("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),
    add: async t => [...t, "webp"],
    remove: async t => t.filter(e => e !== "webp")
};
class Rfe {
    constructor() {
        this._parsers = [],
        this._parsersValidated = !1,
        this.parsers = new Proxy(this._parsers,{
            set: (e, n, r) => (this._parsersValidated = !1,
            e[n] = r,
            !0)
        }),
        this.promiseCache = {}
    }
    reset() {
        this._parsersValidated = !1,
        this.promiseCache = {}
    }
    _getLoadPromiseAndParser(e, n) {
        const r = {
            promise: null,
            parser: null
        };
        return r.promise = (async () => {
            var s, a;
            let i = null
              , o = null;
            if ((n.parser || n.loadParser) && (o = this._parserHash[n.parser || n.loadParser],
            n.loadParser && Ne(`[Assets] "loadParser" is deprecated, use "parser" instead for ${e}`),
            o || Ne(`[Assets] specified load parser "${n.parser || n.loadParser}" not found while loading ${e}`)),
            !o) {
                for (let l = 0; l < this.parsers.length; l++) {
                    const c = this.parsers[l];
                    if (c.load && ((s = c.test) != null && s.call(c, e, n, this))) {
                        o = c;
                        break
                    }
                }
                if (!o)
                    return Ne(`[Assets] ${e} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),
                    null
            }
            i = await o.load(e, n, this),
            r.parser = o;
            for (let l = 0; l < this.parsers.length; l++) {
                const c = this.parsers[l];
                c.parse && c.parse && await ((a = c.testParse) == null ? void 0 : a.call(c, i, n, this)) && (i = await c.parse(i, n, this) || i,
                r.parser = c)
            }
            return i
        }
        )(),
        r
    }
    async load(e, n) {
        this._parsersValidated || this._validateParsers();
        let r = 0;
        const i = {}
          , o = E0(e)
          , s = Pi(e, c => ({
            alias: [c],
            src: c,
            data: {}
        }))
          , a = s.length
          , l = s.map(async c => {
            const u = Pr.toAbsolute(c.src);
            if (!i[c.src])
                try {
                    this.promiseCache[u] || (this.promiseCache[u] = this._getLoadPromiseAndParser(u, c)),
                    i[c.src] = await this.promiseCache[u].promise,
                    n && n(++r / a)
                } catch (f) {
                    throw delete this.promiseCache[u],
                    delete i[c.src],
                    new Error(`[Loader.load] Failed to load ${u}.
${f}`)
                }
        }
        );
        return await Promise.all(l),
        o ? i[s[0].src] : i
    }
    async unload(e) {
        const r = Pi(e, i => ({
            alias: [i],
            src: i
        })).map(async i => {
            var a, l;
            const o = Pr.toAbsolute(i.src)
              , s = this.promiseCache[o];
            if (s) {
                const c = await s.promise;
                delete this.promiseCache[o],
                await ((l = (a = s.parser) == null ? void 0 : a.unload) == null ? void 0 : l.call(a, c, i, this))
            }
        }
        );
        await Promise.all(r)
    }
    _validateParsers() {
        this._parsersValidated = !0,
        this._parserHash = this._parsers.filter(e => e.name || e.id).reduce( (e, n) => (!n.name && !n.id ? Ne("[Assets] parser should have an id") : (e[n.name] || e[n.id]) && Ne(`[Assets] parser id conflict "${n.id}"`),
        e[n.name] = n,
        n.id && (e[n.id] = n),
        e), {})
    }
}
function bu(t, e) {
    if (Array.isArray(e)) {
        for (const n of e)
            if (t.startsWith(`data:${n}`))
                return !0;
        return !1
    }
    return t.startsWith(`data:${e}`)
}
function wu(t, e) {
    const n = t.split("?")[0]
      , r = Pr.extname(n).toLowerCase();
    return Array.isArray(e) ? e.includes(r) : r === e
}
const Mfe = ".json"
  , Dfe = "application/json"
  , Bfe = {
    extension: {
        type: V.LoadParser,
        priority: ha.Low
    },
    name: "loadJson",
    id: "json",
    test(t) {
        return bu(t, Dfe) || wu(t, Mfe)
    },
    async load(t) {
        return await (await je.get().fetch(t)).json()
    }
}
  , kfe = ".txt"
  , Nfe = "text/plain"
  , Ffe = {
    name: "loadTxt",
    id: "text",
    extension: {
        type: V.LoadParser,
        priority: ha.Low,
        name: "loadTxt"
    },
    test(t) {
        return bu(t, Nfe) || wu(t, kfe)
    },
    async load(t) {
        return await (await je.get().fetch(t)).text()
    }
}
  , Lfe = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"]
  , $fe = [".ttf", ".otf", ".woff", ".woff2"]
  , Ufe = ["font/ttf", "font/otf", "font/woff", "font/woff2"]
  , Gfe = /^(--|-?[A-Z_])[0-9A-Z_-]*$/i;
function Hfe(t) {
    const e = Pr.extname(t)
      , i = Pr.basename(t, e).replace(/(-|_)/g, " ").toLowerCase().split(" ").map(a => a.charAt(0).toUpperCase() + a.slice(1));
    let o = i.length > 0;
    for (const a of i)
        if (!a.match(Gfe)) {
            o = !1;
            break
        }
    let s = i.join(" ");
    return o || (s = `"${s.replace(/[\\"]/g, "\\$&")}"`),
    s
}
const Vfe = /^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;
function zfe(t) {
    return Vfe.test(t) ? t : encodeURI(t)
}
const jfe = {
    extension: {
        type: V.LoadParser,
        priority: ha.Low
    },
    name: "loadWebFont",
    id: "web-font",
    test(t) {
        return bu(t, Ufe) || wu(t, $fe)
    },
    async load(t, e) {
        var r, i, o;
        const n = je.get().getFontFaceSet();
        if (n) {
            const s = []
              , a = ((r = e.data) == null ? void 0 : r.family) ?? Hfe(t)
              , l = ((o = (i = e.data) == null ? void 0 : i.weights) == null ? void 0 : o.filter(u => Lfe.includes(u))) ?? ["normal"]
              , c = e.data ?? {};
            for (let u = 0; u < l.length; u++) {
                const f = l[u]
                  , d = new FontFace(a,`url(${zfe(t)})`,{
                    ...c,
                    weight: f
                });
                await d.load(),
                n.add(d),
                s.push(d)
            }
            return bt.has(`${a}-and-url`) ? bt.get(`${a}-and-url`).entries.push({
                url: t,
                faces: s
            }) : bt.set(`${a}-and-url`, {
                entries: [{
                    url: t,
                    faces: s
                }]
            }),
            s.length === 1 ? s[0] : s
        }
        return Ne("[loadWebFont] FontFace API is not supported. Skipping loading font"),
        null
    },
    unload(t) {
        const e = Array.isArray(t) ? t : [t]
          , n = e[0].family
          , r = bt.get(`${n}-and-url`)
          , i = r.entries.find(o => o.faces.some(s => e.indexOf(s) !== -1));
        i.faces = i.faces.filter(o => e.indexOf(o) === -1),
        i.faces.length === 0 && (r.entries = r.entries.filter(o => o !== i)),
        e.forEach(o => {
            je.get().getFontFaceSet().delete(o)
        }
        ),
        r.entries.length === 0 && bt.remove(`${n}-and-url`)
    }
};
function m2(t, e=1) {
    var r;
    const n = (r = xu.RETINA_PREFIX) == null ? void 0 : r.exec(t);
    return n ? parseFloat(n[1]) : e
}
function v2(t, e, n) {
    t.label = n,
    t._sourceOrigin = n;
    const r = new Ae({
        source: t,
        label: n
    })
      , i = () => {
        delete e.promiseCache[n],
        bt.has(n) && bt.remove(n)
    }
    ;
    return r.source.once("destroy", () => {
        e.promiseCache[n] && (Ne("[Assets] A TextureSource managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the TextureSource."),
        i())
    }
    ),
    r.once("destroy", () => {
        t.destroyed || (Ne("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),
        i())
    }
    ),
    r
}
const Wfe = ".svg"
  , Yfe = "image/svg+xml"
  , Xfe = {
    extension: {
        type: V.LoadParser,
        priority: ha.Low,
        name: "loadSVG"
    },
    name: "loadSVG",
    id: "svg",
    config: {
        crossOrigin: "anonymous",
        parseAsGraphicsContext: !1
    },
    test(t) {
        return bu(t, Yfe) || wu(t, Wfe)
    },
    async load(t, e, n) {
        var r;
        return ((r = e.data) == null ? void 0 : r.parseAsGraphicsContext) ?? this.config.parseAsGraphicsContext ? qfe(t) : Kfe(t, e, n, this.config.crossOrigin)
    },
    unload(t) {
        t.destroy(!0)
    }
};
async function Kfe(t, e, n, r) {
    var v, g, m;
    const o = await (await je.get().fetch(t)).blob()
      , s = URL.createObjectURL(o)
      , a = je.get().createImage();
    a.src = s,
    a.crossOrigin = r,
    await a.decode(),
    URL.revokeObjectURL(s);
    const l = ((v = e.data) == null ? void 0 : v.width) ?? a.width
      , c = ((g = e.data) == null ? void 0 : g.height) ?? a.height
      , u = ((m = e.data) == null ? void 0 : m.resolution) || m2(t)
      , f = je.get().createCanvas(l * u, c * u);
    f.getContext("2d").drawImage(a, 0, 0, l * u, c * u);
    const {parseAsGraphicsContext: h, ...p} = e.data ?? {}
      , y = new yl({
        resource: f,
        alphaMode: "premultiply-alpha-on-upload",
        resolution: u,
        ...p
    });
    return v2(y, n, t)
}
async function qfe(t) {
    const n = await (await je.get().fetch(t)).text()
      , r = new ci;
    return r.svg(n),
    r
}
const Zfe = `(function () {
    'use strict';

    const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
    async function checkImageBitmap() {
      try {
        if (typeof createImageBitmap !== "function")
          return false;
        const response = await fetch(WHITE_PNG);
        const imageBlob = await response.blob();
        const imageBitmap = await createImageBitmap(imageBlob);
        return imageBitmap.width === 1 && imageBitmap.height === 1;
      } catch (_e) {
        return false;
      }
    }
    void checkImageBitmap().then((result) => {
      self.postMessage(result);
    });

})();
`;
let Oc = null
  , q_ = class {
    constructor() {
        Oc || (Oc = URL.createObjectURL(new Blob([Zfe],{
            type: "application/javascript"
        }))),
        this.worker = new Worker(Oc)
    }
}
;
q_.revokeObjectURL = function() {
    Oc && (URL.revokeObjectURL(Oc),
    Oc = null)
}
;
const Jfe = `(function () {
    'use strict';

    async function loadImageBitmap(url, alphaMode) {
      const response = await fetch(url);
      if (!response.ok) {
        throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`);
      }
      const imageBlob = await response.blob();
      return alphaMode === "premultiplied-alpha" ? createImageBitmap(imageBlob, { premultiplyAlpha: "none" }) : createImageBitmap(imageBlob);
    }
    self.onmessage = async (event) => {
      try {
        const imageBitmap = await loadImageBitmap(event.data.data[0], event.data.data[1]);
        self.postMessage({
          data: imageBitmap,
          uuid: event.data.uuid,
          id: event.data.id
        }, [imageBitmap]);
      } catch (e) {
        self.postMessage({
          error: e,
          uuid: event.data.uuid,
          id: event.data.id
        });
      }
    };

})();
`;
let Rc = null;
class YB {
    constructor() {
        Rc || (Rc = URL.createObjectURL(new Blob([Jfe],{
            type: "application/javascript"
        }))),
        this.worker = new Worker(Rc)
    }
}
YB.revokeObjectURL = function() {
    Rc && (URL.revokeObjectURL(Rc),
    Rc = null)
}
;
let s3 = 0, V1;
class Qfe {
    constructor() {
        this._initialized = !1,
        this._createdWorkers = 0,
        this._workerPool = [],
        this._queue = [],
        this._resolveHash = {}
    }
    isImageBitmapSupported() {
        return this._isImageBitmapSupported !== void 0 ? this._isImageBitmapSupported : (this._isImageBitmapSupported = new Promise(e => {
            const {worker: n} = new q_;
            n.addEventListener("message", r => {
                n.terminate(),
                q_.revokeObjectURL(),
                e(r.data)
            }
            )
        }
        ),
        this._isImageBitmapSupported)
    }
    loadImageBitmap(e, n) {
        var r;
        return this._run("loadImageBitmap", [e, (r = n == null ? void 0 : n.data) == null ? void 0 : r.alphaMode])
    }
    async _initWorkers() {
        this._initialized || (this._initialized = !0)
    }
    _getWorker() {
        V1 === void 0 && (V1 = navigator.hardwareConcurrency || 4);
        let e = this._workerPool.pop();
        return !e && this._createdWorkers < V1 && (this._createdWorkers++,
        e = new YB().worker,
        e.addEventListener("message", n => {
            this._complete(n.data),
            this._returnWorker(n.target),
            this._next()
        }
        )),
        e
    }
    _returnWorker(e) {
        this._workerPool.push(e)
    }
    _complete(e) {
        e.error !== void 0 ? this._resolveHash[e.uuid].reject(e.error) : this._resolveHash[e.uuid].resolve(e.data),
        this._resolveHash[e.uuid] = null
    }
    async _run(e, n) {
        await this._initWorkers();
        const r = new Promise( (i, o) => {
            this._queue.push({
                id: e,
                arguments: n,
                resolve: i,
                reject: o
            })
        }
        );
        return this._next(),
        r
    }
    _next() {
        if (!this._queue.length)
            return;
        const e = this._getWorker();
        if (!e)
            return;
        const n = this._queue.pop()
          , r = n.id;
        this._resolveHash[s3] = {
            resolve: n.resolve,
            reject: n.reject
        },
        e.postMessage({
            data: n.arguments,
            uuid: s3++,
            id: r
        })
    }
    reset() {
        this._workerPool.forEach(e => e.terminate()),
        this._workerPool.length = 0,
        Object.values(this._resolveHash).forEach( ({reject: e}) => {
            e == null || e(new Error("WorkerManager destroyed"))
        }
        ),
        this._resolveHash = {},
        this._queue.length = 0,
        this._initialized = !1,
        this._createdWorkers = 0
    }
}
const a3 = new Qfe
  , ede = [".jpeg", ".jpg", ".png", ".webp", ".avif"]
  , tde = ["image/jpeg", "image/png", "image/webp", "image/avif"];
async function nde(t, e) {
    var i;
    const n = await je.get().fetch(t);
    if (!n.ok)
        throw new Error(`[loadImageBitmap] Failed to fetch ${t}: ${n.status} ${n.statusText}`);
    const r = await n.blob();
    return ((i = e == null ? void 0 : e.data) == null ? void 0 : i.alphaMode) === "premultiplied-alpha" ? createImageBitmap(r, {
        premultiplyAlpha: "none"
    }) : createImageBitmap(r)
}
const XB = {
    name: "loadTextures",
    id: "texture",
    extension: {
        type: V.LoadParser,
        priority: ha.High,
        name: "loadTextures"
    },
    config: {
        preferWorkers: !0,
        preferCreateImageBitmap: !0,
        crossOrigin: "anonymous"
    },
    test(t) {
        return bu(t, tde) || wu(t, ede)
    },
    async load(t, e, n) {
        var o;
        let r = null;
        globalThis.createImageBitmap && this.config.preferCreateImageBitmap ? this.config.preferWorkers && await a3.isImageBitmapSupported() ? r = await a3.loadImageBitmap(t, e) : r = await nde(t, e) : r = await new Promise( (s, a) => {
            r = je.get().createImage(),
            r.crossOrigin = this.config.crossOrigin,
            r.src = t,
            r.complete ? s(r) : (r.onload = () => {
                s(r)
            }
            ,
            r.onerror = a)
        }
        );
        const i = new yl({
            resource: r,
            alphaMode: "premultiply-alpha-on-upload",
            resolution: ((o = e.data) == null ? void 0 : o.resolution) || m2(t),
            ...e.data
        });
        return v2(i, n, t)
    },
    unload(t) {
        t.destroy(!0)
    }
}
  , rde = [".mp4", ".m4v", ".webm", ".ogg", ".ogv", ".h264", ".avi", ".mov"];
let z1, j1;
function ide(t, e, n) {
    n === void 0 && !e.startsWith("data:") ? t.crossOrigin = sde(e) : n !== !1 && (t.crossOrigin = typeof n == "string" ? n : "anonymous")
}
function ode(t) {
    return new Promise( (e, n) => {
        t.addEventListener("canplaythrough", r),
        t.addEventListener("error", i),
        t.load();
        function r() {
            o(),
            e()
        }
        function i(s) {
            o(),
            n(s)
        }
        function o() {
            t.removeEventListener("canplaythrough", r),
            t.removeEventListener("error", i)
        }
    }
    )
}
function sde(t, e=globalThis.location) {
    if (t.startsWith("data:"))
        return "";
    e || (e = globalThis.location);
    const n = new URL(t,document.baseURI);
    return n.hostname !== e.hostname || n.port !== e.port || n.protocol !== e.protocol ? "anonymous" : ""
}
function ade() {
    const t = []
      , e = [];
    for (const n of rde) {
        const r = Pf.MIME_TYPES[n.substring(1)] || `video/${n.substring(1)}`;
        im(r) && (t.push(n),
        e.includes(r) || e.push(r))
    }
    return {
        validVideoExtensions: t,
        validVideoMime: e
    }
}
const lde = {
    name: "loadVideo",
    id: "video",
    extension: {
        type: V.LoadParser,
        name: "loadVideo"
    },
    test(t) {
        if (!z1 || !j1) {
            const {validVideoExtensions: r, validVideoMime: i} = ade();
            z1 = r,
            j1 = i
        }
        const e = bu(t, j1)
          , n = wu(t, z1);
        return e || n
    },
    async load(t, e, n) {
        var l, c;
        const r = {
            ...Pf.defaultOptions,
            resolution: ((l = e.data) == null ? void 0 : l.resolution) || m2(t),
            alphaMode: ((c = e.data) == null ? void 0 : c.alphaMode) || await KD(),
            ...e.data
        }
          , i = document.createElement("video")
          , o = {
            preload: r.autoLoad !== !1 ? "auto" : void 0,
            "webkit-playsinline": r.playsinline !== !1 ? "" : void 0,
            playsinline: r.playsinline !== !1 ? "" : void 0,
            muted: r.muted === !0 ? "" : void 0,
            loop: r.loop === !0 ? "" : void 0,
            autoplay: r.autoPlay !== !1 ? "" : void 0
        };
        Object.keys(o).forEach(u => {
            const f = o[u];
            f !== void 0 && i.setAttribute(u, f)
        }
        ),
        r.muted === !0 && (i.muted = !0),
        ide(i, t, r.crossorigin);
        const s = document.createElement("source");
        let a;
        if (r.mime)
            a = r.mime;
        else if (t.startsWith("data:"))
            a = t.slice(5, t.indexOf(";"));
        else if (!t.startsWith("blob:")) {
            const u = t.split("?")[0].slice(t.lastIndexOf(".") + 1).toLowerCase();
            a = Pf.MIME_TYPES[u] || `video/${u}`
        }
        return s.src = t,
        a && (s.type = a),
        new Promise(u => {
            const f = async () => {
                const d = new Pf({
                    ...r,
                    resource: i
                });
                i.removeEventListener("canplay", f),
                e.data.preload && await ode(i),
                u(v2(d, n, t))
            }
            ;
            r.preload && !r.autoPlay && i.load(),
            i.addEventListener("canplay", f),
            i.appendChild(s)
        }
        )
    },
    unload(t) {
        t.destroy(!0)
    }
}
  , KB = {
    extension: {
        type: V.ResolveParser,
        name: "resolveTexture"
    },
    test: XB.test,
    parse: t => {
        var e;
        return {
            resolution: parseFloat(((e = xu.RETINA_PREFIX.exec(t)) == null ? void 0 : e[1]) ?? "1"),
            format: t.split(".").pop(),
            src: t
        }
    }
}
  , cde = {
    extension: {
        type: V.ResolveParser,
        priority: -2,
        name: "resolveJson"
    },
    test: t => xu.RETINA_PREFIX.test(t) && t.endsWith(".json"),
    parse: KB.parse
};
class ude {
    constructor() {
        this._detections = [],
        this._initialized = !1,
        this.resolver = new xu,
        this.loader = new Rfe,
        this.cache = bt,
        this._backgroundLoader = new wfe(this.loader),
        this._backgroundLoader.active = !0,
        this.reset()
    }
    async init(e={}) {
        var o, s;
        if (this._initialized) {
            Ne("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");
            return
        }
        if (this._initialized = !0,
        e.defaultSearchParams && this.resolver.setDefaultSearchParams(e.defaultSearchParams),
        e.basePath && (this.resolver.basePath = e.basePath),
        e.bundleIdentifier && this.resolver.setBundleIdentifier(e.bundleIdentifier),
        e.manifest) {
            let a = e.manifest;
            typeof a == "string" && (a = await this.load(a)),
            this.resolver.addManifest(a)
        }
        const n = ((o = e.texturePreference) == null ? void 0 : o.resolution) ?? 1
          , r = typeof n == "number" ? [n] : n
          , i = await this._detectFormats({
            preferredFormats: (s = e.texturePreference) == null ? void 0 : s.format,
            skipDetections: e.skipDetections,
            detections: this._detections
        });
        this.resolver.prefer({
            params: {
                format: i,
                resolution: r
            }
        }),
        e.preferences && this.setPreferences(e.preferences)
    }
    add(e) {
        this.resolver.add(e)
    }
    async load(e, n) {
        this._initialized || await this.init();
        const r = E0(e)
          , i = Pi(e).map(a => {
            if (typeof a != "string") {
                const l = this.resolver.getAlias(a);
                return l.some(c => !this.resolver.hasKey(c)) && this.add(a),
                Array.isArray(l) ? l[0] : l
            }
            return this.resolver.hasKey(a) || this.add({
                alias: a,
                src: a
            }),
            a
        }
        )
          , o = this.resolver.resolve(i)
          , s = await this._mapLoadToResolve(o, n);
        return r ? s[i[0]] : s
    }
    addBundle(e, n) {
        this.resolver.addBundle(e, n)
    }
    async loadBundle(e, n) {
        this._initialized || await this.init();
        let r = !1;
        typeof e == "string" && (r = !0,
        e = [e]);
        const i = this.resolver.resolveBundle(e)
          , o = {}
          , s = Object.keys(i);
        let a = 0
          , l = 0;
        const c = () => {
            n == null || n(++a / l)
        }
          , u = s.map(f => {
            const d = i[f]
              , h = Object.values(d)
              , p = [...new Set(h.flat())];
            return l += p.length,
            this._mapLoadToResolve(d, c).then(y => {
                o[f] = y
            }
            )
        }
        );
        return await Promise.all(u),
        r ? o[e[0]] : o
    }
    async backgroundLoad(e) {
        this._initialized || await this.init(),
        typeof e == "string" && (e = [e]);
        const n = this.resolver.resolve(e);
        this._backgroundLoader.add(Object.values(n))
    }
    async backgroundLoadBundle(e) {
        this._initialized || await this.init(),
        typeof e == "string" && (e = [e]);
        const n = this.resolver.resolveBundle(e);
        Object.values(n).forEach(r => {
            this._backgroundLoader.add(Object.values(r))
        }
        )
    }
    reset() {
        this.resolver.reset(),
        this.loader.reset(),
        this.cache.reset(),
        this._initialized = !1
    }
    get(e) {
        if (typeof e == "string")
            return bt.get(e);
        const n = {};
        for (let r = 0; r < e.length; r++)
            n[r] = bt.get(e[r]);
        return n
    }
    async _mapLoadToResolve(e, n) {
        const r = [...new Set(Object.values(e))];
        this._backgroundLoader.active = !1;
        const i = await this.loader.load(r, n);
        this._backgroundLoader.active = !0;
        const o = {};
        return r.forEach(s => {
            const a = i[s.src]
              , l = [s.src];
            s.alias && l.push(...s.alias),
            l.forEach(c => {
                o[c] = a
            }
            ),
            bt.set(l, a)
        }
        ),
        o
    }
    async unload(e) {
        this._initialized || await this.init();
        const n = Pi(e).map(i => typeof i != "string" ? i.src : i)
          , r = this.resolver.resolve(n);
        await this._unloadFromResolved(r)
    }
    async unloadBundle(e) {
        this._initialized || await this.init(),
        e = Pi(e);
        const n = this.resolver.resolveBundle(e)
          , r = Object.keys(n).map(i => this._unloadFromResolved(n[i]));
        await Promise.all(r)
    }
    async _unloadFromResolved(e) {
        const n = Object.values(e);
        n.forEach(r => {
            bt.remove(r.src)
        }
        ),
        await this.loader.unload(n)
    }
    async _detectFormats(e) {
        let n = [];
        e.preferredFormats && (n = Array.isArray(e.preferredFormats) ? e.preferredFormats : [e.preferredFormats]);
        for (const r of e.detections)
            e.skipDetections || await r.test() ? n = await r.add(n) : e.skipDetections || (n = await r.remove(n));
        return n = n.filter( (r, i) => n.indexOf(r) === i),
        n
    }
    get detections() {
        return this._detections
    }
    setPreferences(e) {
        this.loader.parsers.forEach(n => {
            n.config && Object.keys(n.config).filter(r => r in e).forEach(r => {
                n.config[r] = e[r]
            }
            )
        }
        )
    }
}
const lp = new ude;
$e.handleByList(V.LoadParser, lp.loader.parsers).handleByList(V.ResolveParser, lp.resolver.parsers).handleByList(V.CacheParser, lp.cache.parsers).handleByList(V.DetectionParser, lp.detections);
$e.add(Efe, Cfe, Sfe, Ofe, Tfe, Pfe, Ife, Bfe, Ffe, jfe, Xfe, XB, lde, bfe, xfe, KB, cde);
const l3 = {
    loader: V.LoadParser,
    resolver: V.ResolveParser,
    cache: V.CacheParser,
    detection: V.DetectionParser
};
$e.handle(V.Asset, t => {
    const e = t.ref;
    Object.entries(l3).filter( ([n]) => !!e[n]).forEach( ([n,r]) => $e.add(Object.assign(e[n], {
        extension: e[n].extension ?? r
    })))
}
, t => {
    const e = t.ref;
    Object.keys(l3).filter(n => !!e[n]).forEach(n => $e.remove(e[n]))
}
);
class qB {
    constructor(e) {
        this._attachedDomElements = [],
        this._renderer = e,
        this._renderer.runners.postrender.add(this),
        this._renderer.runners.init.add(this),
        this._domElement = document.createElement("div"),
        this._domElement.style.position = "absolute",
        this._domElement.style.top = "0",
        this._domElement.style.left = "0",
        this._domElement.style.pointerEvents = "none",
        this._domElement.style.zIndex = "1000"
    }
    init() {
        this._canvasObserver = new tB({
            domElement: this._domElement,
            renderer: this._renderer
        })
    }
    addRenderable(e, n) {
        this._attachedDomElements.includes(e) || this._attachedDomElements.push(e)
    }
    updateRenderable(e) {}
    validateRenderable(e) {
        return !0
    }
    postrender() {
        const e = this._attachedDomElements;
        if (e.length === 0) {
            this._domElement.remove();
            return
        }
        this._canvasObserver.ensureAttached();
        for (let n = 0; n < e.length; n++) {
            const r = e[n]
              , i = r.element;
            if (!r.parent || r.globalDisplayStatus < 7)
                i == null || i.remove(),
                e.splice(n, 1),
                n--;
            else {
                this._domElement.contains(i) || (i.style.position = "absolute",
                i.style.pointerEvents = "auto",
                this._domElement.appendChild(i));
                const o = r.worldTransform
                  , s = r._anchor
                  , a = r.width * s.x
                  , l = r.height * s.y;
                i.style.transformOrigin = `${a}px ${l}px`,
                i.style.transform = `matrix(${o.a}, ${o.b}, ${o.c}, ${o.d}, ${o.tx - a}, ${o.ty - l})`,
                i.style.opacity = r.groupAlpha.toString()
            }
        }
    }
    destroy() {
        var e;
        this._renderer.runners.postrender.remove(this);
        for (let n = 0; n < this._attachedDomElements.length; n++)
            (e = this._attachedDomElements[n].element) == null || e.remove();
        this._attachedDomElements.length = 0,
        this._domElement.remove(),
        this._canvasObserver.destroy(),
        this._renderer = null
    }
}
qB.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "dom"
};
class fde {
    constructor() {
        this.interactionFrequency = 10,
        this._deltaTime = 0,
        this._didMove = !1,
        this._tickerAdded = !1,
        this._pauseUpdate = !0
    }
    init(e) {
        this.removeTickerListener(),
        this.events = e,
        this.interactionFrequency = 10,
        this._deltaTime = 0,
        this._didMove = !1,
        this._tickerAdded = !1,
        this._pauseUpdate = !0
    }
    get pauseUpdate() {
        return this._pauseUpdate
    }
    set pauseUpdate(e) {
        this._pauseUpdate = e
    }
    addTickerListener() {
        this._tickerAdded || !this.domElement || (Un.system.add(this._tickerUpdate, this, _l.INTERACTION),
        this._tickerAdded = !0)
    }
    removeTickerListener() {
        this._tickerAdded && (Un.system.remove(this._tickerUpdate, this),
        this._tickerAdded = !1)
    }
    pointerMoved() {
        this._didMove = !0
    }
    _update() {
        if (!this.domElement || this._pauseUpdate)
            return;
        if (this._didMove) {
            this._didMove = !1;
            return
        }
        const e = this.events._rootPointerEvent;
        this.events.supportsTouchEvents && e.pointerType === "touch" || globalThis.document.dispatchEvent(this.events.supportsPointerEvents ? new PointerEvent("pointermove",{
            clientX: e.clientX,
            clientY: e.clientY,
            pointerType: e.pointerType,
            pointerId: e.pointerId
        }) : new MouseEvent("mousemove",{
            clientX: e.clientX,
            clientY: e.clientY
        }))
    }
    _tickerUpdate(e) {
        this._deltaTime += e.deltaTime,
        !(this._deltaTime < this.interactionFrequency) && (this._deltaTime = 0,
        this._update())
    }
}
const Ds = new fde;
class P0 extends Zd {
    constructor() {
        super(...arguments),
        this.client = new Gt,
        this.movement = new Gt,
        this.offset = new Gt,
        this.global = new Gt,
        this.screen = new Gt
    }
    get clientX() {
        return this.client.x
    }
    get clientY() {
        return this.client.y
    }
    get x() {
        return this.clientX
    }
    get y() {
        return this.clientY
    }
    get movementX() {
        return this.movement.x
    }
    get movementY() {
        return this.movement.y
    }
    get offsetX() {
        return this.offset.x
    }
    get offsetY() {
        return this.offset.y
    }
    get globalX() {
        return this.global.x
    }
    get globalY() {
        return this.global.y
    }
    get screenX() {
        return this.screen.x
    }
    get screenY() {
        return this.screen.y
    }
    getLocalPosition(e, n, r) {
        return e.worldTransform.applyInverse(r || this.global, n)
    }
    getModifierState(e) {
        return "getModifierState"in this.nativeEvent && this.nativeEvent.getModifierState(e)
    }
    initMouseEvent(e, n, r, i, o, s, a, l, c, u, f, d, h, p, y) {
        throw new Error("Method not implemented.")
    }
}
class Ei extends P0 {
    constructor() {
        super(...arguments),
        this.width = 0,
        this.height = 0,
        this.isPrimary = !1
    }
    getCoalescedEvents() {
        return this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove" ? [this] : []
    }
    getPredictedEvents() {
        throw new Error("getPredictedEvents is not supported!")
    }
}
class Zc extends P0 {
    constructor() {
        super(...arguments),
        this.DOM_DELTA_PIXEL = 0,
        this.DOM_DELTA_LINE = 1,
        this.DOM_DELTA_PAGE = 2
    }
}
Zc.DOM_DELTA_PIXEL = 0;
Zc.DOM_DELTA_LINE = 1;
Zc.DOM_DELTA_PAGE = 2;
const dde = 2048
  , hde = new Gt
  , Wu = new Gt;
class pde {
    constructor(e) {
        this.dispatch = new Jr,
        this.moveOnAll = !1,
        this.enableGlobalMoveEvents = !0,
        this.mappingState = {
            trackingData: {}
        },
        this.eventPool = new Map,
        this._allInteractiveElements = [],
        this._hitElements = [],
        this._isPointerMoveEvent = !1,
        this.rootTarget = e,
        this.hitPruneFn = this.hitPruneFn.bind(this),
        this.hitTestFn = this.hitTestFn.bind(this),
        this.mapPointerDown = this.mapPointerDown.bind(this),
        this.mapPointerMove = this.mapPointerMove.bind(this),
        this.mapPointerOut = this.mapPointerOut.bind(this),
        this.mapPointerOver = this.mapPointerOver.bind(this),
        this.mapPointerUp = this.mapPointerUp.bind(this),
        this.mapPointerUpOutside = this.mapPointerUpOutside.bind(this),
        this.mapWheel = this.mapWheel.bind(this),
        this.mappingTable = {},
        this.addEventMapping("pointerdown", this.mapPointerDown),
        this.addEventMapping("pointermove", this.mapPointerMove),
        this.addEventMapping("pointerout", this.mapPointerOut),
        this.addEventMapping("pointerleave", this.mapPointerOut),
        this.addEventMapping("pointerover", this.mapPointerOver),
        this.addEventMapping("pointerup", this.mapPointerUp),
        this.addEventMapping("pointerupoutside", this.mapPointerUpOutside),
        this.addEventMapping("wheel", this.mapWheel)
    }
    addEventMapping(e, n) {
        this.mappingTable[e] || (this.mappingTable[e] = []),
        this.mappingTable[e].push({
            fn: n,
            priority: 0
        }),
        this.mappingTable[e].sort( (r, i) => r.priority - i.priority)
    }
    dispatchEvent(e, n) {
        e.propagationStopped = !1,
        e.propagationImmediatelyStopped = !1,
        this.propagate(e, n),
        this.dispatch.emit(n || e.type, e)
    }
    mapEvent(e) {
        if (!this.rootTarget)
            return;
        const n = this.mappingTable[e.type];
        if (n)
            for (let r = 0, i = n.length; r < i; r++)
                n[r].fn(e);
        else
            Ne(`[EventBoundary]: Event mapping not defined for ${e.type}`)
    }
    hitTest(e, n) {
        Ds.pauseUpdate = !0;
        const i = this._isPointerMoveEvent && this.enableGlobalMoveEvents ? "hitTestMoveRecursive" : "hitTestRecursive"
          , o = this[i](this.rootTarget, this.rootTarget.eventMode, hde.set(e, n), this.hitTestFn, this.hitPruneFn);
        return o && o[0]
    }
    propagate(e, n) {
        if (!e.target)
            return;
        const r = e.composedPath();
        e.eventPhase = e.CAPTURING_PHASE;
        for (let i = 0, o = r.length - 1; i < o; i++)
            if (e.currentTarget = r[i],
            this.notifyTarget(e, n),
            e.propagationStopped || e.propagationImmediatelyStopped)
                return;
        if (e.eventPhase = e.AT_TARGET,
        e.currentTarget = e.target,
        this.notifyTarget(e, n),
        !(e.propagationStopped || e.propagationImmediatelyStopped)) {
            e.eventPhase = e.BUBBLING_PHASE;
            for (let i = r.length - 2; i >= 0; i--)
                if (e.currentTarget = r[i],
                this.notifyTarget(e, n),
                e.propagationStopped || e.propagationImmediatelyStopped)
                    return
        }
    }
    all(e, n, r=this._allInteractiveElements) {
        if (r.length === 0)
            return;
        e.eventPhase = e.BUBBLING_PHASE;
        const i = Array.isArray(n) ? n : [n];
        for (let o = r.length - 1; o >= 0; o--)
            i.forEach(s => {
                e.currentTarget = r[o],
                this.notifyTarget(e, s)
            }
            )
    }
    propagationPath(e) {
        const n = [e];
        for (let r = 0; r < dde && e !== this.rootTarget && e.parent; r++) {
            if (!e.parent)
                throw new Error("Cannot find propagation path to disconnected target");
            n.push(e.parent),
            e = e.parent
        }
        return n.reverse(),
        n
    }
    hitTestMoveRecursive(e, n, r, i, o, s=!1) {
        let a = !1;
        if (this._interactivePrune(e))
            return null;
        if ((e.eventMode === "dynamic" || n === "dynamic") && (Ds.pauseUpdate = !1),
        e.interactiveChildren && e.children) {
            const u = e.children;
            for (let f = u.length - 1; f >= 0; f--) {
                const d = u[f]
                  , h = this.hitTestMoveRecursive(d, this._isInteractive(n) ? n : d.eventMode, r, i, o, s || o(e, r));
                if (h) {
                    if (h.length > 0 && !h[h.length - 1].parent)
                        continue;
                    const p = e.isInteractive();
                    (h.length > 0 || p) && (p && this._allInteractiveElements.push(e),
                    h.push(e)),
                    this._hitElements.length === 0 && (this._hitElements = h),
                    a = !0
                }
            }
        }
        const l = this._isInteractive(n)
          , c = e.isInteractive();
        return c && c && this._allInteractiveElements.push(e),
        s || this._hitElements.length > 0 ? null : a ? this._hitElements : l && !o(e, r) && i(e, r) ? c ? [e] : [] : null
    }
    hitTestRecursive(e, n, r, i, o) {
        if (this._interactivePrune(e) || o(e, r))
            return null;
        if ((e.eventMode === "dynamic" || n === "dynamic") && (Ds.pauseUpdate = !1),
        e.interactiveChildren && e.children) {
            const l = e.children
              , c = r;
            for (let u = l.length - 1; u >= 0; u--) {
                const f = l[u]
                  , d = this.hitTestRecursive(f, this._isInteractive(n) ? n : f.eventMode, c, i, o);
                if (d) {
                    if (d.length > 0 && !d[d.length - 1].parent)
                        continue;
                    const h = e.isInteractive();
                    return (d.length > 0 || h) && d.push(e),
                    d
                }
            }
        }
        const s = this._isInteractive(n)
          , a = e.isInteractive();
        return s && i(e, r) ? a ? [e] : [] : null
    }
    _isInteractive(e) {
        return e === "static" || e === "dynamic"
    }
    _interactivePrune(e) {
        return !e || !e.visible || !e.renderable || !e.measurable || e.eventMode === "none" || e.eventMode === "passive" && !e.interactiveChildren
    }
    hitPruneFn(e, n) {
        if (e.hitArea && (e.worldTransform.applyInverse(n, Wu),
        !e.hitArea.contains(Wu.x, Wu.y)))
            return !0;
        if (e.effects && e.effects.length)
            for (let r = 0; r < e.effects.length; r++) {
                const i = e.effects[r];
                if (i.containsPoint && !i.containsPoint(n, this.hitTestFn))
                    return !0
            }
        return !1
    }
    hitTestFn(e, n) {
        return e.hitArea ? !0 : e != null && e.containsPoint ? (e.worldTransform.applyInverse(n, Wu),
        e.containsPoint(Wu)) : !1
    }
    notifyTarget(e, n) {
        var o, s;
        if (!e.currentTarget.isInteractive())
            return;
        n ?? (n = e.type);
        const r = `on${n}`;
        (s = (o = e.currentTarget)[r]) == null || s.call(o, e);
        const i = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? `${n}capture` : n;
        this._notifyListeners(e, i),
        e.eventPhase === e.AT_TARGET && this._notifyListeners(e, n)
    }
    mapPointerDown(e) {
        if (!(e instanceof Ei)) {
            Ne("EventBoundary cannot map a non-pointer event as a pointer event");
            return
        }
        const n = this.createPointerEvent(e);
        if (this.dispatchEvent(n, "pointerdown"),
        n.pointerType === "touch")
            this.dispatchEvent(n, "touchstart");
        else if (n.pointerType === "mouse" || n.pointerType === "pen") {
            const i = n.button === 2;
            this.dispatchEvent(n, i ? "rightdown" : "mousedown")
        }
        const r = this.trackingData(e.pointerId);
        r.pressTargetsByButton[e.button] = n.composedPath(),
        this.freeEvent(n)
    }
    mapPointerMove(e) {
        var l, c;
        if (!(e instanceof Ei)) {
            Ne("EventBoundary cannot map a non-pointer event as a pointer event");
            return
        }
        this._allInteractiveElements.length = 0,
        this._hitElements.length = 0,
        this._isPointerMoveEvent = !0;
        const n = this.createPointerEvent(e);
        this._isPointerMoveEvent = !1;
        const r = n.pointerType === "mouse" || n.pointerType === "pen"
          , i = this.trackingData(e.pointerId)
          , o = this.findMountedTarget(i.overTargets);
        if (((l = i.overTargets) == null ? void 0 : l.length) > 0 && o !== n.target) {
            const u = e.type === "mousemove" ? "mouseout" : "pointerout"
              , f = this.createPointerEvent(e, u, o);
            if (this.dispatchEvent(f, "pointerout"),
            r && this.dispatchEvent(f, "mouseout"),
            !n.composedPath().includes(o)) {
                const d = this.createPointerEvent(e, "pointerleave", o);
                for (d.eventPhase = d.AT_TARGET; d.target && !n.composedPath().includes(d.target); )
                    d.currentTarget = d.target,
                    this.notifyTarget(d),
                    r && this.notifyTarget(d, "mouseleave"),
                    d.target = d.target.parent;
                this.freeEvent(d)
            }
            this.freeEvent(f)
        }
        if (o !== n.target) {
            const u = e.type === "mousemove" ? "mouseover" : "pointerover"
              , f = this.clonePointerEvent(n, u);
            this.dispatchEvent(f, "pointerover"),
            r && this.dispatchEvent(f, "mouseover");
            let d = o == null ? void 0 : o.parent;
            for (; d && d !== this.rootTarget.parent && d !== n.target; )
                d = d.parent;
            if (!d || d === this.rootTarget.parent) {
                const p = this.clonePointerEvent(n, "pointerenter");
                for (p.eventPhase = p.AT_TARGET; p.target && p.target !== o && p.target !== this.rootTarget.parent; )
                    p.currentTarget = p.target,
                    this.notifyTarget(p),
                    r && this.notifyTarget(p, "mouseenter"),
                    p.target = p.target.parent;
                this.freeEvent(p)
            }
            this.freeEvent(f)
        }
        const s = []
          , a = this.enableGlobalMoveEvents ?? !0;
        this.moveOnAll ? s.push("pointermove") : this.dispatchEvent(n, "pointermove"),
        a && s.push("globalpointermove"),
        n.pointerType === "touch" && (this.moveOnAll ? s.splice(1, 0, "touchmove") : this.dispatchEvent(n, "touchmove"),
        a && s.push("globaltouchmove")),
        r && (this.moveOnAll ? s.splice(1, 0, "mousemove") : this.dispatchEvent(n, "mousemove"),
        a && s.push("globalmousemove"),
        this.cursor = (c = n.target) == null ? void 0 : c.cursor),
        s.length > 0 && this.all(n, s),
        this._allInteractiveElements.length = 0,
        this._hitElements.length = 0,
        i.overTargets = n.composedPath(),
        this.freeEvent(n)
    }
    mapPointerOver(e) {
        var s;
        if (!(e instanceof Ei)) {
            Ne("EventBoundary cannot map a non-pointer event as a pointer event");
            return
        }
        const n = this.trackingData(e.pointerId)
          , r = this.createPointerEvent(e)
          , i = r.pointerType === "mouse" || r.pointerType === "pen";
        this.dispatchEvent(r, "pointerover"),
        i && this.dispatchEvent(r, "mouseover"),
        r.pointerType === "mouse" && (this.cursor = (s = r.target) == null ? void 0 : s.cursor);
        const o = this.clonePointerEvent(r, "pointerenter");
        for (o.eventPhase = o.AT_TARGET; o.target && o.target !== this.rootTarget.parent; )
            o.currentTarget = o.target,
            this.notifyTarget(o),
            i && this.notifyTarget(o, "mouseenter"),
            o.target = o.target.parent;
        n.overTargets = r.composedPath(),
        this.freeEvent(r),
        this.freeEvent(o)
    }
    mapPointerOut(e) {
        if (!(e instanceof Ei)) {
            Ne("EventBoundary cannot map a non-pointer event as a pointer event");
            return
        }
        const n = this.trackingData(e.pointerId);
        if (n.overTargets) {
            const r = e.pointerType === "mouse" || e.pointerType === "pen"
              , i = this.findMountedTarget(n.overTargets)
              , o = this.createPointerEvent(e, "pointerout", i);
            this.dispatchEvent(o),
            r && this.dispatchEvent(o, "mouseout");
            const s = this.createPointerEvent(e, "pointerleave", i);
            for (s.eventPhase = s.AT_TARGET; s.target && s.target !== this.rootTarget.parent; )
                s.currentTarget = s.target,
                this.notifyTarget(s),
                r && this.notifyTarget(s, "mouseleave"),
                s.target = s.target.parent;
            n.overTargets = null,
            this.freeEvent(o),
            this.freeEvent(s)
        }
        this.cursor = null
    }
    mapPointerUp(e) {
        if (!(e instanceof Ei)) {
            Ne("EventBoundary cannot map a non-pointer event as a pointer event");
            return
        }
        const n = performance.now()
          , r = this.createPointerEvent(e);
        if (this.dispatchEvent(r, "pointerup"),
        r.pointerType === "touch")
            this.dispatchEvent(r, "touchend");
        else if (r.pointerType === "mouse" || r.pointerType === "pen") {
            const a = r.button === 2;
            this.dispatchEvent(r, a ? "rightup" : "mouseup")
        }
        const i = this.trackingData(e.pointerId)
          , o = this.findMountedTarget(i.pressTargetsByButton[e.button]);
        let s = o;
        if (o && !r.composedPath().includes(o)) {
            let a = o;
            for (; a && !r.composedPath().includes(a); ) {
                if (r.currentTarget = a,
                this.notifyTarget(r, "pointerupoutside"),
                r.pointerType === "touch")
                    this.notifyTarget(r, "touchendoutside");
                else if (r.pointerType === "mouse" || r.pointerType === "pen") {
                    const l = r.button === 2;
                    this.notifyTarget(r, l ? "rightupoutside" : "mouseupoutside")
                }
                a = a.parent
            }
            delete i.pressTargetsByButton[e.button],
            s = a
        }
        if (s) {
            const a = this.clonePointerEvent(r, "click");
            a.target = s,
            a.path = null,
            i.clicksByButton[e.button] || (i.clicksByButton[e.button] = {
                clickCount: 0,
                target: a.target,
                timeStamp: n
            });
            const l = i.clicksByButton[e.button];
            if (l.target === a.target && n - l.timeStamp < 200 ? ++l.clickCount : l.clickCount = 1,
            l.target = a.target,
            l.timeStamp = n,
            a.detail = l.clickCount,
            a.pointerType === "mouse") {
                const c = a.button === 2;
                this.dispatchEvent(a, c ? "rightclick" : "click")
            } else
                a.pointerType === "touch" && this.dispatchEvent(a, "tap");
            this.dispatchEvent(a, "pointertap"),
            this.freeEvent(a)
        }
        this.freeEvent(r)
    }
    mapPointerUpOutside(e) {
        if (!(e instanceof Ei)) {
            Ne("EventBoundary cannot map a non-pointer event as a pointer event");
            return
        }
        const n = this.trackingData(e.pointerId)
          , r = this.findMountedTarget(n.pressTargetsByButton[e.button])
          , i = this.createPointerEvent(e);
        if (r) {
            let o = r;
            for (; o; )
                i.currentTarget = o,
                this.notifyTarget(i, "pointerupoutside"),
                i.pointerType === "touch" ? this.notifyTarget(i, "touchendoutside") : (i.pointerType === "mouse" || i.pointerType === "pen") && this.notifyTarget(i, i.button === 2 ? "rightupoutside" : "mouseupoutside"),
                o = o.parent;
            delete n.pressTargetsByButton[e.button]
        }
        this.freeEvent(i)
    }
    mapWheel(e) {
        if (!(e instanceof Zc)) {
            Ne("EventBoundary cannot map a non-wheel event as a wheel event");
            return
        }
        const n = this.createWheelEvent(e);
        this.dispatchEvent(n),
        this.freeEvent(n)
    }
    findMountedTarget(e) {
        if (!e)
            return null;
        let n = e[0];
        for (let r = 1; r < e.length && e[r].parent === n; r++)
            n = e[r];
        return n
    }
    createPointerEvent(e, n, r) {
        const i = this.allocateEvent(Ei);
        return this.copyPointerData(e, i),
        this.copyMouseData(e, i),
        this.copyData(e, i),
        i.nativeEvent = e.nativeEvent,
        i.originalEvent = e,
        i.target = r ?? this.hitTest(i.global.x, i.global.y) ?? this._hitElements[0],
        typeof n == "string" && (i.type = n),
        i
    }
    createWheelEvent(e) {
        const n = this.allocateEvent(Zc);
        return this.copyWheelData(e, n),
        this.copyMouseData(e, n),
        this.copyData(e, n),
        n.nativeEvent = e.nativeEvent,
        n.originalEvent = e,
        n.target = this.hitTest(n.global.x, n.global.y),
        n
    }
    clonePointerEvent(e, n) {
        const r = this.allocateEvent(Ei);
        return r.nativeEvent = e.nativeEvent,
        r.originalEvent = e.originalEvent,
        this.copyPointerData(e, r),
        this.copyMouseData(e, r),
        this.copyData(e, r),
        r.target = e.target,
        r.path = e.composedPath().slice(),
        r.type = n ?? r.type,
        r
    }
    copyWheelData(e, n) {
        n.deltaMode = e.deltaMode,
        n.deltaX = e.deltaX,
        n.deltaY = e.deltaY,
        n.deltaZ = e.deltaZ
    }
    copyPointerData(e, n) {
        e instanceof Ei && n instanceof Ei && (n.pointerId = e.pointerId,
        n.width = e.width,
        n.height = e.height,
        n.isPrimary = e.isPrimary,
        n.pointerType = e.pointerType,
        n.pressure = e.pressure,
        n.tangentialPressure = e.tangentialPressure,
        n.tiltX = e.tiltX,
        n.tiltY = e.tiltY,
        n.twist = e.twist)
    }
    copyMouseData(e, n) {
        e instanceof P0 && n instanceof P0 && (n.altKey = e.altKey,
        n.button = e.button,
        n.buttons = e.buttons,
        n.client.copyFrom(e.client),
        n.ctrlKey = e.ctrlKey,
        n.metaKey = e.metaKey,
        n.movement.copyFrom(e.movement),
        n.screen.copyFrom(e.screen),
        n.shiftKey = e.shiftKey,
        n.global.copyFrom(e.global))
    }
    copyData(e, n) {
        n.isTrusted = e.isTrusted,
        n.srcElement = e.srcElement,
        n.timeStamp = performance.now(),
        n.type = e.type,
        n.detail = e.detail,
        n.view = e.view,
        n.which = e.which,
        n.layer.copyFrom(e.layer),
        n.page.copyFrom(e.page)
    }
    trackingData(e) {
        return this.mappingState.trackingData[e] || (this.mappingState.trackingData[e] = {
            pressTargetsByButton: {},
            clicksByButton: {},
            overTarget: null
        }),
        this.mappingState.trackingData[e]
    }
    allocateEvent(e) {
        this.eventPool.has(e) || this.eventPool.set(e, []);
        const n = this.eventPool.get(e).pop() || new e(this);
        return n.eventPhase = n.NONE,
        n.currentTarget = null,
        n.defaultPrevented = !1,
        n.path = null,
        n.target = null,
        n
    }
    freeEvent(e) {
        if (e.manager !== this)
            throw new Error("It is illegal to free an event not managed by this EventBoundary!");
        const n = e.constructor;
        this.eventPool.has(n) || this.eventPool.set(n, []),
        this.eventPool.get(n).push(e)
    }
    _notifyListeners(e, n) {
        const r = e.currentTarget._events[n];
        if (r)
            if ("fn"in r)
                r.once && e.currentTarget.removeListener(n, r.fn, void 0, !0),
                r.fn.call(r.context, e);
            else
                for (let i = 0, o = r.length; i < o && !e.propagationImmediatelyStopped; i++)
                    r[i].once && e.currentTarget.removeListener(n, r[i].fn, void 0, !0),
                    r[i].fn.call(r[i].context, e)
    }
}
const gde = 1
  , mde = {
    touchstart: "pointerdown",
    touchend: "pointerup",
    touchendoutside: "pointerupoutside",
    touchmove: "pointermove",
    touchcancel: "pointercancel"
}
  , y2 = class Z_ {
    constructor(e) {
        this.supportsTouchEvents = "ontouchstart"in globalThis,
        this.supportsPointerEvents = !!globalThis.PointerEvent,
        this.domElement = null,
        this.resolution = 1,
        this.renderer = e,
        this.rootBoundary = new pde(null),
        Ds.init(this),
        this.autoPreventDefault = !0,
        this._eventsAdded = !1,
        this._rootPointerEvent = new Ei(null),
        this._rootWheelEvent = new Zc(null),
        this.cursorStyles = {
            default: "inherit",
            pointer: "pointer"
        },
        this.features = new Proxy({
            ...Z_.defaultEventFeatures
        },{
            set: (n, r, i) => (r === "globalMove" && (this.rootBoundary.enableGlobalMoveEvents = i),
            n[r] = i,
            !0)
        }),
        this._onPointerDown = this._onPointerDown.bind(this),
        this._onPointerMove = this._onPointerMove.bind(this),
        this._onPointerUp = this._onPointerUp.bind(this),
        this._onPointerOverOut = this._onPointerOverOut.bind(this),
        this.onWheel = this.onWheel.bind(this)
    }
    static get defaultEventMode() {
        return this._defaultEventMode
    }
    init(e) {
        const {canvas: n, resolution: r} = this.renderer;
        this.setTargetElement(n),
        this.resolution = r,
        Z_._defaultEventMode = e.eventMode ?? "passive",
        Object.assign(this.features, e.eventFeatures ?? {}),
        this.rootBoundary.enableGlobalMoveEvents = this.features.globalMove
    }
    resolutionChange(e) {
        this.resolution = e
    }
    destroy() {
        this.setTargetElement(null),
        this.renderer = null,
        this._currentCursor = null
    }
    setCursor(e) {
        e || (e = "default");
        let n = !0;
        if (globalThis.OffscreenCanvas && this.domElement instanceof OffscreenCanvas && (n = !1),
        this._currentCursor === e)
            return;
        this._currentCursor = e;
        const r = this.cursorStyles[e];
        if (r)
            switch (typeof r) {
            case "string":
                n && (this.domElement.style.cursor = r);
                break;
            case "function":
                r(e);
                break;
            case "object":
                n && Object.assign(this.domElement.style, r);
                break
            }
        else
            n && typeof e == "string" && !Object.prototype.hasOwnProperty.call(this.cursorStyles, e) && (this.domElement.style.cursor = e)
    }
    get pointer() {
        return this._rootPointerEvent
    }
    _onPointerDown(e) {
        if (!this.features.click)
            return;
        this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
        const n = this._normalizeToPointerData(e);
        this.autoPreventDefault && n[0].isNormalized && (e.cancelable || !("cancelable"in e)) && e.preventDefault();
        for (let r = 0, i = n.length; r < i; r++) {
            const o = n[r]
              , s = this._bootstrapEvent(this._rootPointerEvent, o);
            this.rootBoundary.mapEvent(s)
        }
        this.setCursor(this.rootBoundary.cursor)
    }
    _onPointerMove(e) {
        if (!this.features.move)
            return;
        this.rootBoundary.rootTarget = this.renderer.lastObjectRendered,
        Ds.pointerMoved();
        const n = this._normalizeToPointerData(e);
        for (let r = 0, i = n.length; r < i; r++) {
            const o = this._bootstrapEvent(this._rootPointerEvent, n[r]);
            this.rootBoundary.mapEvent(o)
        }
        this.setCursor(this.rootBoundary.cursor)
    }
    _onPointerUp(e) {
        if (!this.features.click)
            return;
        this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
        let n = e.target;
        e.composedPath && e.composedPath().length > 0 && (n = e.composedPath()[0]);
        const r = n !== this.domElement ? "outside" : ""
          , i = this._normalizeToPointerData(e);
        for (let o = 0, s = i.length; o < s; o++) {
            const a = this._bootstrapEvent(this._rootPointerEvent, i[o]);
            a.type += r,
            this.rootBoundary.mapEvent(a)
        }
        this.setCursor(this.rootBoundary.cursor)
    }
    _onPointerOverOut(e) {
        if (!this.features.click)
            return;
        this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
        const n = this._normalizeToPointerData(e);
        for (let r = 0, i = n.length; r < i; r++) {
            const o = this._bootstrapEvent(this._rootPointerEvent, n[r]);
            this.rootBoundary.mapEvent(o)
        }
        this.setCursor(this.rootBoundary.cursor)
    }
    onWheel(e) {
        if (!this.features.wheel)
            return;
        const n = this.normalizeWheelEvent(e);
        this.rootBoundary.rootTarget = this.renderer.lastObjectRendered,
        this.rootBoundary.mapEvent(n)
    }
    setTargetElement(e) {
        this._removeEvents(),
        this.domElement = e,
        Ds.domElement = e,
        this._addEvents()
    }
    _addEvents() {
        if (this._eventsAdded || !this.domElement)
            return;
        Ds.addTickerListener();
        const e = this.domElement.style;
        e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none",
        e.msTouchAction = "none") : this.supportsPointerEvents && (e.touchAction = "none")),
        this.supportsPointerEvents ? (globalThis.document.addEventListener("pointermove", this._onPointerMove, !0),
        this.domElement.addEventListener("pointerdown", this._onPointerDown, !0),
        this.domElement.addEventListener("pointerleave", this._onPointerOverOut, !0),
        this.domElement.addEventListener("pointerover", this._onPointerOverOut, !0),
        globalThis.addEventListener("pointerup", this._onPointerUp, !0)) : (globalThis.document.addEventListener("mousemove", this._onPointerMove, !0),
        this.domElement.addEventListener("mousedown", this._onPointerDown, !0),
        this.domElement.addEventListener("mouseout", this._onPointerOverOut, !0),
        this.domElement.addEventListener("mouseover", this._onPointerOverOut, !0),
        globalThis.addEventListener("mouseup", this._onPointerUp, !0),
        this.supportsTouchEvents && (this.domElement.addEventListener("touchstart", this._onPointerDown, !0),
        this.domElement.addEventListener("touchend", this._onPointerUp, !0),
        this.domElement.addEventListener("touchmove", this._onPointerMove, !0))),
        this.domElement.addEventListener("wheel", this.onWheel, {
            passive: !0,
            capture: !0
        }),
        this._eventsAdded = !0
    }
    _removeEvents() {
        if (!this._eventsAdded || !this.domElement)
            return;
        Ds.removeTickerListener();
        const e = this.domElement.style;
        e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "",
        e.msTouchAction = "") : this.supportsPointerEvents && (e.touchAction = "")),
        this.supportsPointerEvents ? (globalThis.document.removeEventListener("pointermove", this._onPointerMove, !0),
        this.domElement.removeEventListener("pointerdown", this._onPointerDown, !0),
        this.domElement.removeEventListener("pointerleave", this._onPointerOverOut, !0),
        this.domElement.removeEventListener("pointerover", this._onPointerOverOut, !0),
        globalThis.removeEventListener("pointerup", this._onPointerUp, !0)) : (globalThis.document.removeEventListener("mousemove", this._onPointerMove, !0),
        this.domElement.removeEventListener("mousedown", this._onPointerDown, !0),
        this.domElement.removeEventListener("mouseout", this._onPointerOverOut, !0),
        this.domElement.removeEventListener("mouseover", this._onPointerOverOut, !0),
        globalThis.removeEventListener("mouseup", this._onPointerUp, !0),
        this.supportsTouchEvents && (this.domElement.removeEventListener("touchstart", this._onPointerDown, !0),
        this.domElement.removeEventListener("touchend", this._onPointerUp, !0),
        this.domElement.removeEventListener("touchmove", this._onPointerMove, !0))),
        this.domElement.removeEventListener("wheel", this.onWheel, !0),
        this.domElement = null,
        this._eventsAdded = !1
    }
    mapPositionToPoint(e, n, r) {
        const i = this.domElement.isConnected ? this.domElement.getBoundingClientRect() : {
            x: 0,
            y: 0,
            width: this.domElement.width,
            height: this.domElement.height,
            left: 0,
            top: 0
        }
          , o = 1 / this.resolution;
        e.x = (n - i.left) * (this.domElement.width / i.width) * o,
        e.y = (r - i.top) * (this.domElement.height / i.height) * o
    }
    _normalizeToPointerData(e) {
        const n = [];
        if (this.supportsTouchEvents && e instanceof TouchEvent)
            for (let r = 0, i = e.changedTouches.length; r < i; r++) {
                const o = e.changedTouches[r];
                typeof o.button > "u" && (o.button = 0),
                typeof o.buttons > "u" && (o.buttons = 1),
                typeof o.isPrimary > "u" && (o.isPrimary = e.touches.length === 1 && e.type === "touchstart"),
                typeof o.width > "u" && (o.width = o.radiusX || 1),
                typeof o.height > "u" && (o.height = o.radiusY || 1),
                typeof o.tiltX > "u" && (o.tiltX = 0),
                typeof o.tiltY > "u" && (o.tiltY = 0),
                typeof o.pointerType > "u" && (o.pointerType = "touch"),
                typeof o.pointerId > "u" && (o.pointerId = o.identifier || 0),
                typeof o.pressure > "u" && (o.pressure = o.force || .5),
                typeof o.twist > "u" && (o.twist = 0),
                typeof o.tangentialPressure > "u" && (o.tangentialPressure = 0),
                typeof o.layerX > "u" && (o.layerX = o.offsetX = o.clientX),
                typeof o.layerY > "u" && (o.layerY = o.offsetY = o.clientY),
                o.isNormalized = !0,
                o.type = e.type,
                n.push(o)
            }
        else if (!globalThis.MouseEvent || e instanceof MouseEvent && (!this.supportsPointerEvents || !(e instanceof globalThis.PointerEvent))) {
            const r = e;
            typeof r.isPrimary > "u" && (r.isPrimary = !0),
            typeof r.width > "u" && (r.width = 1),
            typeof r.height > "u" && (r.height = 1),
            typeof r.tiltX > "u" && (r.tiltX = 0),
            typeof r.tiltY > "u" && (r.tiltY = 0),
            typeof r.pointerType > "u" && (r.pointerType = "mouse"),
            typeof r.pointerId > "u" && (r.pointerId = gde),
            typeof r.pressure > "u" && (r.pressure = .5),
            typeof r.twist > "u" && (r.twist = 0),
            typeof r.tangentialPressure > "u" && (r.tangentialPressure = 0),
            r.isNormalized = !0,
            n.push(r)
        } else
            n.push(e);
        return n
    }
    normalizeWheelEvent(e) {
        const n = this._rootWheelEvent;
        return this._transferMouseData(n, e),
        n.deltaX = e.deltaX,
        n.deltaY = e.deltaY,
        n.deltaZ = e.deltaZ,
        n.deltaMode = e.deltaMode,
        this.mapPositionToPoint(n.screen, e.clientX, e.clientY),
        n.global.copyFrom(n.screen),
        n.offset.copyFrom(n.screen),
        n.nativeEvent = e,
        n.type = e.type,
        n
    }
    _bootstrapEvent(e, n) {
        return e.originalEvent = null,
        e.nativeEvent = n,
        e.pointerId = n.pointerId,
        e.width = n.width,
        e.height = n.height,
        e.isPrimary = n.isPrimary,
        e.pointerType = n.pointerType,
        e.pressure = n.pressure,
        e.tangentialPressure = n.tangentialPressure,
        e.tiltX = n.tiltX,
        e.tiltY = n.tiltY,
        e.twist = n.twist,
        this._transferMouseData(e, n),
        this.mapPositionToPoint(e.screen, n.clientX, n.clientY),
        e.global.copyFrom(e.screen),
        e.offset.copyFrom(e.screen),
        e.isTrusted = n.isTrusted,
        e.type === "pointerleave" && (e.type = "pointerout"),
        e.type.startsWith("mouse") && (e.type = e.type.replace("mouse", "pointer")),
        e.type.startsWith("touch") && (e.type = mde[e.type] || e.type),
        e
    }
    _transferMouseData(e, n) {
        e.isTrusted = n.isTrusted,
        e.srcElement = n.srcElement,
        e.timeStamp = performance.now(),
        e.type = n.type,
        e.altKey = n.altKey,
        e.button = n.button,
        e.buttons = n.buttons,
        e.client.x = n.clientX,
        e.client.y = n.clientY,
        e.ctrlKey = n.ctrlKey,
        e.metaKey = n.metaKey,
        e.movement.x = n.movementX,
        e.movement.y = n.movementY,
        e.page.x = n.pageX,
        e.page.y = n.pageY,
        e.relatedTarget = null,
        e.shiftKey = n.shiftKey
    }
}
;
y2.extension = {
    name: "events",
    type: [V.WebGLSystem, V.CanvasSystem, V.WebGPUSystem],
    priority: -1
};
y2.defaultEventFeatures = {
    move: !0,
    globalMove: !0,
    click: !0,
    wheel: !0
};
let ZB = y2;
const vde = {
    onclick: null,
    onmousedown: null,
    onmouseenter: null,
    onmouseleave: null,
    onmousemove: null,
    onglobalmousemove: null,
    onmouseout: null,
    onmouseover: null,
    onmouseup: null,
    onmouseupoutside: null,
    onpointercancel: null,
    onpointerdown: null,
    onpointerenter: null,
    onpointerleave: null,
    onpointermove: null,
    onglobalpointermove: null,
    onpointerout: null,
    onpointerover: null,
    onpointertap: null,
    onpointerup: null,
    onpointerupoutside: null,
    onrightclick: null,
    onrightdown: null,
    onrightup: null,
    onrightupoutside: null,
    ontap: null,
    ontouchcancel: null,
    ontouchend: null,
    ontouchendoutside: null,
    ontouchmove: null,
    onglobaltouchmove: null,
    ontouchstart: null,
    onwheel: null,
    get interactive() {
        return this.eventMode === "dynamic" || this.eventMode === "static"
    },
    set interactive(t) {
        this.eventMode = t ? "static" : "passive"
    },
    _internalEventMode: void 0,
    get eventMode() {
        return this._internalEventMode ?? ZB.defaultEventMode
    },
    set eventMode(t) {
        this._internalEventMode = t
    },
    isInteractive() {
        return this.eventMode === "static" || this.eventMode === "dynamic"
    },
    interactiveChildren: !0,
    hitArea: null,
    addEventListener(t, e, n) {
        const r = typeof n == "boolean" && n || typeof n == "object" && n.capture
          , i = typeof n == "object" ? n.signal : void 0
          , o = typeof n == "object" ? n.once === !0 : !1
          , s = typeof e == "function" ? void 0 : e;
        t = r ? `${t}capture` : t;
        const a = typeof e == "function" ? e : e.handleEvent
          , l = this;
        i && i.addEventListener("abort", () => {
            l.off(t, a, s)
        }
        ),
        o ? l.once(t, a, s) : l.on(t, a, s)
    },
    removeEventListener(t, e, n) {
        const r = typeof n == "boolean" && n || typeof n == "object" && n.capture
          , i = typeof e == "function" ? void 0 : e;
        t = r ? `${t}capture` : t,
        e = typeof e == "function" ? e : e.handleEvent,
        this.off(t, e, i)
    },
    dispatchEvent(t) {
        if (!(t instanceof Zd))
            throw new Error("Container cannot propagate events outside of the Federated Events API");
        return t.defaultPrevented = !1,
        t.path = null,
        t.target = this,
        t.manager.dispatchEvent(t),
        !t.defaultPrevented
    }
}
  , JB = {
    5: [.153388, .221461, .250301],
    7: [.071303, .131514, .189879, .214607],
    9: [.028532, .067234, .124009, .179044, .20236],
    11: [.0093, .028002, .065984, .121703, .175713, .198596],
    13: [.002406, .009255, .027867, .065666, .121117, .174868, .197641],
    15: [489e-6, .002403, .009246, .02784, .065602, .120999, .174697, .197448]
}
  , yde = ["in vec2 vBlurTexCoords[%size%];", "uniform sampler2D uTexture;", "out vec4 finalColor;", "void main(void)", "{", "    finalColor = vec4(0.0);", "    %blur%", "}"].join(`
`);
function _de(t) {
    const e = JB[t]
      , n = e.length;
    let r = yde
      , i = "";
    const o = "finalColor += texture(uTexture, vBlurTexCoords[%index%]) * %value%;";
    let s;
    for (let a = 0; a < t; a++) {
        let l = o.replace("%index%", a.toString());
        s = a,
        a >= n && (s = t - a - 1),
        l = l.replace("%value%", e[s].toString()),
        i += l,
        i += `
`
    }
    return r = r.replace("%blur%", i),
    r = r.replace("%size%", t.toString()),
    r
}
const xde = `
    in vec2 aPosition;

    uniform float uStrength;

    out vec2 vBlurTexCoords[%size%];

    uniform vec4 uInputSize;
    uniform vec4 uOutputFrame;
    uniform vec4 uOutputTexture;

    vec4 filterVertexPosition( void )
{
    vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;

    position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
    position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;

    return vec4(position, 0.0, 1.0);
}

    vec2 filterTextureCoord( void )
    {
        return aPosition * (uOutputFrame.zw * uInputSize.zw);
    }

    void main(void)
    {
        gl_Position = filterVertexPosition();

        float pixelStrength = uInputSize.%dimension% * uStrength;

        vec2 textureCoord = filterTextureCoord();
        %blur%
    }`;
function bde(t, e) {
    const n = Math.ceil(t / 2);
    let r = xde, i = "", o;
    e ? o = "vBlurTexCoords[%index%] =  textureCoord + vec2(%sampleIndex% * pixelStrength, 0.0);" : o = "vBlurTexCoords[%index%] =  textureCoord + vec2(0.0, %sampleIndex% * pixelStrength);";
    for (let s = 0; s < t; s++) {
        let a = o.replace("%index%", s.toString());
        a = a.replace("%sampleIndex%", `${s - (n - 1)}.0`),
        i += a,
        i += `
`
    }
    return r = r.replace("%blur%", i),
    r = r.replace("%size%", t.toString()),
    r = r.replace("%dimension%", e ? "z" : "w"),
    r
}
function wde(t, e) {
    const n = bde(e, t)
      , r = _de(e);
    return Fl.from({
        vertex: n,
        fragment: r,
        name: `blur-${t ? "horizontal" : "vertical"}-pass-filter`
    })
}
var Ede = `

struct GlobalFilterUniforms {
  uInputSize:vec4<f32>,
  uInputPixel:vec4<f32>,
  uInputClamp:vec4<f32>,
  uOutputFrame:vec4<f32>,
  uGlobalFrame:vec4<f32>,
  uOutputTexture:vec4<f32>,
};

struct BlurUniforms {
  uStrength:f32,
};

@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;
@group(0) @binding(1) var uTexture: texture_2d<f32>;
@group(0) @binding(2) var uSampler : sampler;

@group(1) @binding(0) var<uniform> blurUniforms : BlurUniforms;


struct VSOutput {
    @builtin(position) position: vec4<f32>,
    %blur-struct%
  };

fn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>
{
    var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;

    position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;
    position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;

    return vec4(position, 0.0, 1.0);
}

fn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
{
    return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);
}

fn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
{
  return  (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);  
}

fn getSize() -> vec2<f32>
{
  return gfu.uGlobalFrame.zw;
}


@vertex
fn mainVertex(
  @location(0) aPosition : vec2<f32>, 
) -> VSOutput {

  let filteredCord = filterTextureCoord(aPosition);

  let pixelStrength = gfu.uInputSize.%dimension% * blurUniforms.uStrength;

  return VSOutput(
   filterVertexPosition(aPosition),
    %blur-vertex-out%
  );
}

@fragment
fn mainFragment(
  @builtin(position) position: vec4<f32>,
  %blur-fragment-in%
) -> @location(0) vec4<f32> {

    var   finalColor = vec4(0.0);

    %blur-sampling%

    return finalColor;
}`;
function Sde(t, e) {
    const n = JB[e]
      , r = n.length
      , i = []
      , o = []
      , s = [];
    for (let f = 0; f < e; f++) {
        i[f] = `@location(${f}) offset${f}: vec2<f32>,`,
        t ? o[f] = `filteredCord + vec2(${f - r + 1} * pixelStrength, 0.0),` : o[f] = `filteredCord + vec2(0.0, ${f - r + 1} * pixelStrength),`;
        const d = f < r ? f : e - f - 1
          , h = n[d].toString();
        s[f] = `finalColor += textureSample(uTexture, uSampler, offset${f}) * ${h};`
    }
    const a = i.join(`
`)
      , l = o.join(`
`)
      , c = s.join(`
`)
      , u = Ede.replace("%blur-struct%", a).replace("%blur-vertex-out%", l).replace("%blur-fragment-in%", a).replace("%blur-sampling%", c).replace("%dimension%", t ? "z" : "w");
    return pa.from({
        vertex: {
            source: u,
            entryPoint: "mainVertex"
        },
        fragment: {
            source: u,
            entryPoint: "mainFragment"
        }
    })
}
const QB = class ek extends Qw {
    constructor(e) {
        e = {
            ...ek.defaultOptions,
            ...e
        };
        const n = wde(e.horizontal, e.kernelSize)
          , r = Sde(e.horizontal, e.kernelSize);
        super({
            glProgram: n,
            gpuProgram: r,
            resources: {
                blurUniforms: {
                    uStrength: {
                        value: 0,
                        type: "f32"
                    }
                }
            },
            ...e
        }),
        this.horizontal = e.horizontal,
        this._quality = 0,
        this.quality = e.quality,
        this.blur = e.strength,
        this._uniforms = this.resources.blurUniforms.uniforms
    }
    apply(e, n, r, i) {
        if (this._uniforms.uStrength = this.strength / this.passes,
        this.passes === 1)
            e.applyFilter(this, n, r, i);
        else {
            const o = cn.getSameSizeTexture(n);
            let s = n
              , a = o;
            this._state.blend = !1;
            const l = e.renderer.type === Kr.WEBGPU;
            for (let c = 0; c < this.passes - 1; c++) {
                e.applyFilter(this, s, a, c === 0 ? !0 : l);
                const u = a;
                a = s,
                s = u
            }
            this._state.blend = !0,
            e.applyFilter(this, s, r, i),
            cn.returnTexture(o)
        }
    }
    get blur() {
        return this.strength
    }
    set blur(e) {
        this.padding = 1 + Math.abs(e) * 2,
        this.strength = e
    }
    get quality() {
        return this._quality
    }
    set quality(e) {
        this._quality = e,
        this.passes = e
    }
}
;
QB.defaultOptions = {
    strength: 8,
    quality: 4,
    kernelSize: 5
};
let W1 = QB;
class Cde extends Qw {
    constructor(...e) {
        let n = e[0] ?? {};
        typeof n == "number" && (Fe(rt, "BlurFilter constructor params are now options object. See params: { strength, quality, resolution, kernelSize }"),
        n = {
            strength: n
        },
        e[1] !== void 0 && (n.quality = e[1]),
        e[2] !== void 0 && (n.resolution = e[2] || "inherit"),
        e[3] !== void 0 && (n.kernelSize = e[3])),
        n = {
            ...W1.defaultOptions,
            ...n
        };
        const {strength: r, strengthX: i, strengthY: o, quality: s, ...a} = n;
        super({
            ...a,
            compatibleRenderers: Kr.BOTH,
            resources: {}
        }),
        this._repeatEdgePixels = !1,
        this.blurXFilter = new W1({
            horizontal: !0,
            ...n
        }),
        this.blurYFilter = new W1({
            horizontal: !1,
            ...n
        }),
        this.quality = s,
        this.strengthX = i ?? r,
        this.strengthY = o ?? r,
        this.repeatEdgePixels = !1
    }
    apply(e, n, r, i) {
        const o = Math.abs(this.blurXFilter.strength)
          , s = Math.abs(this.blurYFilter.strength);
        if (o && s) {
            const a = cn.getSameSizeTexture(n);
            this.blurXFilter.blendMode = "normal",
            this.blurXFilter.apply(e, n, a, !0),
            this.blurYFilter.blendMode = this.blendMode,
            this.blurYFilter.apply(e, a, r, i),
            cn.returnTexture(a)
        } else
            s ? (this.blurYFilter.blendMode = this.blendMode,
            this.blurYFilter.apply(e, n, r, i)) : (this.blurXFilter.blendMode = this.blendMode,
            this.blurXFilter.apply(e, n, r, i))
    }
    updatePadding() {
        this._repeatEdgePixels ? this.padding = 0 : this.padding = Math.max(Math.abs(this.blurXFilter.blur), Math.abs(this.blurYFilter.blur)) * 2
    }
    get strength() {
        if (this.strengthX !== this.strengthY)
            throw new Error("BlurFilter's strengthX and strengthY are different");
        return this.strengthX
    }
    set strength(e) {
        this.blurXFilter.blur = this.blurYFilter.blur = e,
        this.updatePadding()
    }
    get quality() {
        return this.blurXFilter.quality
    }
    set quality(e) {
        this.blurXFilter.quality = this.blurYFilter.quality = e
    }
    get strengthX() {
        return this.blurXFilter.blur
    }
    set strengthX(e) {
        this.blurXFilter.blur = e,
        this.updatePadding()
    }
    get strengthY() {
        return this.blurYFilter.blur
    }
    set strengthY(e) {
        this.blurYFilter.blur = e,
        this.updatePadding()
    }
    get blur() {
        return Fe("8.3.0", "BlurFilter.blur is deprecated, please use BlurFilter.strength instead."),
        this.strength
    }
    set blur(e) {
        Fe("8.3.0", "BlurFilter.blur is deprecated, please use BlurFilter.strength instead."),
        this.strength = e
    }
    get blurX() {
        return Fe("8.3.0", "BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."),
        this.strengthX
    }
    set blurX(e) {
        Fe("8.3.0", "BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."),
        this.strengthX = e
    }
    get blurY() {
        return Fe("8.3.0", "BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."),
        this.strengthY
    }
    set blurY(e) {
        Fe("8.3.0", "BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."),
        this.strengthY = e
    }
    get repeatEdgePixels() {
        return this._repeatEdgePixels
    }
    set repeatEdgePixels(e) {
        this._repeatEdgePixels = e,
        this.updatePadding()
    }
}
Cde.defaultOptions = {
    strength: 8,
    quality: 4,
    kernelSize: 5
};
class tk {
    constructor(e) {
        this._renderer = e
    }
    push(e, n, r) {
        this._renderer.renderPipes.batch.break(r),
        r.add({
            renderPipeId: "filter",
            canBundle: !1,
            action: "pushFilter",
            container: n,
            filterEffect: e
        })
    }
    pop(e, n, r) {
        this._renderer.renderPipes.batch.break(r),
        r.add({
            renderPipeId: "filter",
            action: "popFilter",
            canBundle: !1
        })
    }
    execute(e) {
        e.action === "pushFilter" ? this._renderer.filter.push(e) : e.action === "popFilter" && this._renderer.filter.pop()
    }
    destroy() {
        this._renderer = null
    }
}
tk.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "filter"
};
function Ade(t, e) {
    e.clear();
    const n = e.matrix;
    for (let r = 0; r < t.length; r++) {
        const i = t[r];
        i.globalDisplayStatus < 7 || (e.matrix = i.worldTransform,
        e.addBounds(i.bounds))
    }
    return e.matrix = n,
    e
}
const Tde = new Jd({
    attributes: {
        aPosition: {
            buffer: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
            format: "float32x2",
            stride: 2 * 4,
            offset: 0
        }
    },
    indexBuffer: new Uint32Array([0, 1, 2, 0, 2, 3])
});
class Pde {
    constructor() {
        this.skip = !1,
        this.inputTexture = null,
        this.backTexture = null,
        this.filters = null,
        this.bounds = new Vn,
        this.container = null,
        this.blendRequired = !1,
        this.outputRenderSurface = null,
        this.globalFrame = {
            x: 0,
            y: 0,
            width: 0,
            height: 0
        }
    }
}
class nk {
    constructor(e) {
        this._filterStackIndex = 0,
        this._filterStack = [],
        this._filterGlobalUniforms = new gr({
            uInputSize: {
                value: new Float32Array(4),
                type: "vec4<f32>"
            },
            uInputPixel: {
                value: new Float32Array(4),
                type: "vec4<f32>"
            },
            uInputClamp: {
                value: new Float32Array(4),
                type: "vec4<f32>"
            },
            uOutputFrame: {
                value: new Float32Array(4),
                type: "vec4<f32>"
            },
            uGlobalFrame: {
                value: new Float32Array(4),
                type: "vec4<f32>"
            },
            uOutputTexture: {
                value: new Float32Array(4),
                type: "vec4<f32>"
            }
        }),
        this._globalFilterBindGroup = new Ko({}),
        this.renderer = e
    }
    get activeBackTexture() {
        var e;
        return (e = this._activeFilterData) == null ? void 0 : e.backTexture
    }
    push(e) {
        const n = this.renderer
          , r = e.filterEffect.filters
          , i = this._pushFilterData();
        i.skip = !1,
        i.filters = r,
        i.container = e.container,
        i.outputRenderSurface = n.renderTarget.renderSurface;
        const o = n.renderTarget.renderTarget.colorTexture.source
          , s = o.resolution
          , a = o.antialias;
        if (r.length === 0) {
            i.skip = !0;
            return
        }
        const l = i.bounds;
        if (this._calculateFilterArea(e, l),
        this._calculateFilterBounds(i, n.renderTarget.rootViewPort, a, s, 1),
        i.skip)
            return;
        const c = this._getPreviousFilterData()
          , u = this._findFilterResolution(s);
        let f = 0
          , d = 0;
        c && (f = c.bounds.minX,
        d = c.bounds.minY),
        this._calculateGlobalFrame(i, f, d, u, o.width, o.height),
        this._setupFilterTextures(i, l, n, c)
    }
    generateFilteredTexture({texture: e, filters: n}) {
        const r = this._pushFilterData();
        this._activeFilterData = r,
        r.skip = !1,
        r.filters = n;
        const i = e.source
          , o = i.resolution
          , s = i.antialias;
        if (n.length === 0)
            return r.skip = !0,
            e;
        const a = r.bounds;
        if (a.addRect(e.frame),
        this._calculateFilterBounds(r, a.rectangle, s, o, 0),
        r.skip)
            return e;
        const l = o
          , c = 0
          , u = 0;
        this._calculateGlobalFrame(r, c, u, l, i.width, i.height),
        r.outputRenderSurface = cn.getOptimalTexture(a.width, a.height, r.resolution, r.antialias),
        r.backTexture = Ae.EMPTY,
        r.inputTexture = e,
        this.renderer.renderTarget.finishRenderPass(),
        this._applyFiltersToTexture(r, !0);
        const d = r.outputRenderSurface;
        return d.source.alphaMode = "premultiplied-alpha",
        d
    }
    pop() {
        const e = this.renderer
          , n = this._popFilterData();
        n.skip || (e.globalUniforms.pop(),
        e.renderTarget.finishRenderPass(),
        this._activeFilterData = n,
        this._applyFiltersToTexture(n, !1),
        n.blendRequired && cn.returnTexture(n.backTexture),
        cn.returnTexture(n.inputTexture))
    }
    getBackTexture(e, n, r) {
        const i = e.colorTexture.source._resolution
          , o = cn.getOptimalTexture(n.width, n.height, i, !1);
        let s = n.minX
          , a = n.minY;
        r && (s -= r.minX,
        a -= r.minY),
        s = Math.floor(s * i),
        a = Math.floor(a * i);
        const l = Math.ceil(n.width * i)
          , c = Math.ceil(n.height * i);
        return this.renderer.renderTarget.copyToTexture(e, o, {
            x: s,
            y: a
        }, {
            width: l,
            height: c
        }, {
            x: 0,
            y: 0
        }),
        o
    }
    applyFilter(e, n, r, i) {
        const o = this.renderer
          , s = this._activeFilterData
          , l = s.outputRenderSurface === r
          , c = o.renderTarget.rootRenderTarget.colorTexture.source._resolution
          , u = this._findFilterResolution(c);
        let f = 0
          , d = 0;
        if (l) {
            const h = this._findPreviousFilterOffset();
            f = h.x,
            d = h.y
        }
        this._updateFilterUniforms(n, r, s, f, d, u, l, i),
        this._setupBindGroupsAndRender(e, n, o)
    }
    calculateSpriteMatrix(e, n) {
        const r = this._activeFilterData
          , i = e.set(r.inputTexture._source.width, 0, 0, r.inputTexture._source.height, r.bounds.minX, r.bounds.minY)
          , o = n.worldTransform.copyTo(Oe.shared)
          , s = n.renderGroup || n.parentRenderGroup;
        return s && s.cacheToLocalTransform && o.prepend(s.cacheToLocalTransform),
        o.invert(),
        i.prepend(o),
        i.scale(1 / n.texture.orig.width, 1 / n.texture.orig.height),
        i.translate(n.anchor.x, n.anchor.y),
        i
    }
    destroy() {}
    _setupBindGroupsAndRender(e, n, r) {
        if (r.renderPipes.uniformBatch) {
            const i = r.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);
            this._globalFilterBindGroup.setResource(i, 0)
        } else
            this._globalFilterBindGroup.setResource(this._filterGlobalUniforms, 0);
        this._globalFilterBindGroup.setResource(n.source, 1),
        this._globalFilterBindGroup.setResource(n.source.style, 2),
        e.groups[0] = this._globalFilterBindGroup,
        r.encoder.draw({
            geometry: Tde,
            shader: e,
            state: e._state,
            topology: "triangle-list"
        }),
        r.type === Kr.WEBGL && r.renderTarget.finishRenderPass()
    }
    _setupFilterTextures(e, n, r, i) {
        if (e.backTexture = Ae.EMPTY,
        e.blendRequired) {
            r.renderTarget.finishRenderPass();
            const o = r.renderTarget.getRenderTarget(e.outputRenderSurface);
            e.backTexture = this.getBackTexture(o, n, i == null ? void 0 : i.bounds)
        }
        e.inputTexture = cn.getOptimalTexture(n.width, n.height, e.resolution, e.antialias),
        r.renderTarget.bind(e.inputTexture, !0),
        r.globalUniforms.push({
            offset: n
        })
    }
    _calculateGlobalFrame(e, n, r, i, o, s) {
        const a = e.globalFrame;
        a.x = n * i,
        a.y = r * i,
        a.width = o * i,
        a.height = s * i
    }
    _updateFilterUniforms(e, n, r, i, o, s, a, l) {
        const c = this._filterGlobalUniforms.uniforms
          , u = c.uOutputFrame
          , f = c.uInputSize
          , d = c.uInputPixel
          , h = c.uInputClamp
          , p = c.uGlobalFrame
          , y = c.uOutputTexture;
        a ? (u[0] = r.bounds.minX - i,
        u[1] = r.bounds.minY - o) : (u[0] = 0,
        u[1] = 0),
        u[2] = e.frame.width,
        u[3] = e.frame.height,
        f[0] = e.source.width,
        f[1] = e.source.height,
        f[2] = 1 / f[0],
        f[3] = 1 / f[1],
        d[0] = e.source.pixelWidth,
        d[1] = e.source.pixelHeight,
        d[2] = 1 / d[0],
        d[3] = 1 / d[1],
        h[0] = .5 * d[2],
        h[1] = .5 * d[3],
        h[2] = e.frame.width * f[2] - .5 * d[2],
        h[3] = e.frame.height * f[3] - .5 * d[3];
        const v = this.renderer.renderTarget.rootRenderTarget.colorTexture;
        p[0] = i * s,
        p[1] = o * s,
        p[2] = v.source.width * s,
        p[3] = v.source.height * s,
        n instanceof Ae && (n.source.resource = null);
        const g = this.renderer.renderTarget.getRenderTarget(n);
        this.renderer.renderTarget.bind(n, !!l),
        n instanceof Ae ? (y[0] = n.frame.width,
        y[1] = n.frame.height) : (y[0] = g.width,
        y[1] = g.height),
        y[2] = g.isRoot ? -1 : 1,
        this._filterGlobalUniforms.update()
    }
    _findFilterResolution(e) {
        let n = this._filterStackIndex - 1;
        for (; n > 0 && this._filterStack[n].skip; )
            --n;
        return n > 0 && this._filterStack[n].inputTexture ? this._filterStack[n].inputTexture.source._resolution : e
    }
    _findPreviousFilterOffset() {
        let e = 0
          , n = 0
          , r = this._filterStackIndex;
        for (; r > 0; ) {
            r--;
            const i = this._filterStack[r];
            if (!i.skip) {
                e = i.bounds.minX,
                n = i.bounds.minY;
                break
            }
        }
        return {
            x: e,
            y: n
        }
    }
    _calculateFilterArea(e, n) {
        if (e.renderables ? Ade(e.renderables, n) : e.filterEffect.filterArea ? (n.clear(),
        n.addRect(e.filterEffect.filterArea),
        n.applyMatrix(e.container.worldTransform)) : e.container.getFastGlobalBounds(!0, n),
        e.container) {
            const i = (e.container.renderGroup || e.container.parentRenderGroup).cacheToLocalTransform;
            i && n.applyMatrix(i)
        }
    }
    _applyFiltersToTexture(e, n) {
        const r = e.inputTexture
          , i = e.bounds
          , o = e.filters;
        if (this._globalFilterBindGroup.setResource(r.source.style, 2),
        this._globalFilterBindGroup.setResource(e.backTexture.source, 3),
        o.length === 1)
            o[0].apply(this, r, e.outputRenderSurface, n);
        else {
            let s = e.inputTexture;
            const a = cn.getOptimalTexture(i.width, i.height, s.source._resolution, !1);
            let l = a
              , c = 0;
            for (c = 0; c < o.length - 1; ++c) {
                o[c].apply(this, s, l, !0);
                const f = s;
                s = l,
                l = f
            }
            o[c].apply(this, s, e.outputRenderSurface, n),
            cn.returnTexture(a)
        }
    }
    _calculateFilterBounds(e, n, r, i, o) {
        var y;
        const s = this.renderer
          , a = e.bounds
          , l = e.filters;
        let c = 1 / 0
          , u = 0
          , f = !0
          , d = !1
          , h = !1
          , p = !0;
        for (let v = 0; v < l.length; v++) {
            const g = l[v];
            if (c = Math.min(c, g.resolution === "inherit" ? i : g.resolution),
            u += g.padding,
            g.antialias === "off" ? f = !1 : g.antialias === "inherit" && f && (f = r),
            g.clipToViewport || (p = !1),
            !!!(g.compatibleRenderers & s.type)) {
                h = !1;
                break
            }
            if (g.blendRequired && !(((y = s.backBuffer) == null ? void 0 : y.useBackBuffer) ?? !0)) {
                Ne("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),
                h = !1;
                break
            }
            h = g.enabled || h,
            d || (d = g.blendRequired)
        }
        if (!h) {
            e.skip = !0;
            return
        }
        if (p && a.fitBounds(0, n.width / i, 0, n.height / i),
        a.scale(c).ceil().scale(1 / c).pad((u | 0) * o),
        !a.isPositive) {
            e.skip = !0;
            return
        }
        e.antialias = f,
        e.resolution = c,
        e.blendRequired = d
    }
    _popFilterData() {
        return this._filterStackIndex--,
        this._filterStack[this._filterStackIndex]
    }
    _getPreviousFilterData() {
        let e, n = this._filterStackIndex - 1;
        for (; n > 1 && (n--,
        e = this._filterStack[n],
        !!e.skip); )
            ;
        return e
    }
    _pushFilterData() {
        let e = this._filterStack[this._filterStackIndex];
        return e || (e = this._filterStack[this._filterStackIndex] = new Pde),
        this._filterStackIndex++,
        e
    }
}
nk.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem],
    name: "filter"
};
var Ide = `in vec2 vMaskCoord;
in vec2 vTextureCoord;

uniform sampler2D uTexture;
uniform sampler2D uMaskTexture;

uniform float uAlpha;
uniform vec4 uMaskClamp;
uniform float uInverse;

out vec4 finalColor;

void main(void)
{
    float clip = step(3.5,
        step(uMaskClamp.x, vMaskCoord.x) +
        step(uMaskClamp.y, vMaskCoord.y) +
        step(vMaskCoord.x, uMaskClamp.z) +
        step(vMaskCoord.y, uMaskClamp.w));

    // TODO look into why this is needed
    float npmAlpha = uAlpha;
    vec4 original = texture(uTexture, vTextureCoord);
    vec4 masky = texture(uMaskTexture, vMaskCoord);
    float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);

    float a = alphaMul * masky.r * npmAlpha * clip;

    if (uInverse == 1.0) {
        a = 1.0 - a;
    }

    finalColor = original * a;
}
`
  , Ode = `in vec2 aPosition;

out vec2 vTextureCoord;
out vec2 vMaskCoord;


uniform vec4 uInputSize;
uniform vec4 uOutputFrame;
uniform vec4 uOutputTexture;
uniform mat3 uFilterMatrix;

vec4 filterVertexPosition(  vec2 aPosition )
{
    vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
       
    position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
    position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;

    return vec4(position, 0.0, 1.0);
}

vec2 filterTextureCoord(  vec2 aPosition )
{
    return aPosition * (uOutputFrame.zw * uInputSize.zw);
}

vec2 getFilterCoord( vec2 aPosition )
{
    return  ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0)  ).xy;
}   

void main(void)
{
    gl_Position = filterVertexPosition(aPosition);
    vTextureCoord = filterTextureCoord(aPosition);
    vMaskCoord = getFilterCoord(aPosition);
}
`
  , c3 = `struct GlobalFilterUniforms {
  uInputSize:vec4<f32>,
  uInputPixel:vec4<f32>,
  uInputClamp:vec4<f32>,
  uOutputFrame:vec4<f32>,
  uGlobalFrame:vec4<f32>,
  uOutputTexture:vec4<f32>,
};

struct MaskUniforms {
  uFilterMatrix:mat3x3<f32>,
  uMaskClamp:vec4<f32>,
  uAlpha:f32,
  uInverse:f32,
};

@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;
@group(0) @binding(1) var uTexture: texture_2d<f32>;
@group(0) @binding(2) var uSampler : sampler;

@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;
@group(1) @binding(1) var uMaskTexture: texture_2d<f32>;

struct VSOutput {
    @builtin(position) position: vec4<f32>,
    @location(0) uv : vec2<f32>,
    @location(1) filterUv : vec2<f32>,
};

fn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>
{
    var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;

    position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;
    position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;

    return vec4(position, 0.0, 1.0);
}

fn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
{
    return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);
}

fn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
{
  return  (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);
}

fn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>
{
  return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0)  ).xy;
}

fn getSize() -> vec2<f32>
{
  return gfu.uGlobalFrame.zw;
}

@vertex
fn mainVertex(
  @location(0) aPosition : vec2<f32>,
) -> VSOutput {
  return VSOutput(
   filterVertexPosition(aPosition),
   filterTextureCoord(aPosition),
   getFilterCoord(aPosition)
  );
}

@fragment
fn mainFragment(
  @location(0) uv: vec2<f32>,
  @location(1) filterUv: vec2<f32>,
  @builtin(position) position: vec4<f32>
) -> @location(0) vec4<f32> {

    var maskClamp = filterUniforms.uMaskClamp;
    var uAlpha = filterUniforms.uAlpha;

    var clip = step(3.5,
      step(maskClamp.x, filterUv.x) +
      step(maskClamp.y, filterUv.y) +
      step(filterUv.x, maskClamp.z) +
      step(filterUv.y, maskClamp.w));

    var mask = textureSample(uMaskTexture, uSampler, filterUv);
    var source = textureSample(uTexture, uSampler, uv);
    var alphaMul = 1.0 - uAlpha * (1.0 - mask.a);

    var a: f32 = alphaMul * mask.r * uAlpha * clip;

    if (filterUniforms.uInverse == 1.0) {
        a = 1.0 - a;
    }

    return source * a;
}
`;
class Rde extends Qw {
    constructor(e) {
        const {sprite: n, ...r} = e
          , i = new RD(n.texture)
          , o = new gr({
            uFilterMatrix: {
                value: new Oe,
                type: "mat3x3<f32>"
            },
            uMaskClamp: {
                value: i.uClampFrame,
                type: "vec4<f32>"
            },
            uAlpha: {
                value: 1,
                type: "f32"
            },
            uInverse: {
                value: e.inverse ? 1 : 0,
                type: "f32"
            }
        })
          , s = pa.from({
            vertex: {
                source: c3,
                entryPoint: "mainVertex"
            },
            fragment: {
                source: c3,
                entryPoint: "mainFragment"
            }
        })
          , a = Fl.from({
            vertex: Ode,
            fragment: Ide,
            name: "mask-filter"
        });
        super({
            ...r,
            gpuProgram: s,
            glProgram: a,
            clipToViewport: !1,
            resources: {
                filterUniforms: o,
                uMaskTexture: n.texture.source
            }
        }),
        this.sprite = n,
        this._textureMatrix = i
    }
    set inverse(e) {
        this.resources.filterUniforms.uniforms.uInverse = e ? 1 : 0
    }
    get inverse() {
        return this.resources.filterUniforms.uniforms.uInverse === 1
    }
    apply(e, n, r, i) {
        this._textureMatrix.texture = this.sprite.texture,
        e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix, this.sprite).prepend(this._textureMatrix.mapCoord),
        this.resources.uMaskTexture = this.sprite.texture.source,
        e.applyFilter(this, n, r, i)
    }
}
class I0 extends qd {
    constructor(e) {
        e instanceof ci && (e = {
            context: e
        });
        const {context: n, roundPixels: r, ...i} = e || {};
        super({
            label: "Graphics",
            ...i
        }),
        this.renderPipeId = "graphics",
        n ? this._context = n : this._context = this._ownedContext = new ci,
        this._context.on("update", this.onViewUpdate, this),
        this.didViewUpdate = !0,
        this.allowChildren = !1,
        this.roundPixels = r ?? !1
    }
    set context(e) {
        e !== this._context && (this._context.off("update", this.onViewUpdate, this),
        this._context = e,
        this._context.on("update", this.onViewUpdate, this),
        this.onViewUpdate())
    }
    get context() {
        return this._context
    }
    get bounds() {
        return this._context.bounds
    }
    updateBounds() {}
    containsPoint(e) {
        return this._context.containsPoint(e)
    }
    destroy(e) {
        this._ownedContext && !e ? this._ownedContext.destroy(e) : (e === !0 || (e == null ? void 0 : e.context) === !0) && this._context.destroy(e),
        this._ownedContext = null,
        this._context = null,
        super.destroy(e)
    }
    _callContextMethod(e, n) {
        return this.context[e](...n),
        this
    }
    setFillStyle(...e) {
        return this._callContextMethod("setFillStyle", e)
    }
    setStrokeStyle(...e) {
        return this._callContextMethod("setStrokeStyle", e)
    }
    fill(...e) {
        return this._callContextMethod("fill", e)
    }
    stroke(...e) {
        return this._callContextMethod("stroke", e)
    }
    texture(...e) {
        return this._callContextMethod("texture", e)
    }
    beginPath() {
        return this._callContextMethod("beginPath", [])
    }
    cut() {
        return this._callContextMethod("cut", [])
    }
    arc(...e) {
        return this._callContextMethod("arc", e)
    }
    arcTo(...e) {
        return this._callContextMethod("arcTo", e)
    }
    arcToSvg(...e) {
        return this._callContextMethod("arcToSvg", e)
    }
    bezierCurveTo(...e) {
        return this._callContextMethod("bezierCurveTo", e)
    }
    closePath() {
        return this._callContextMethod("closePath", [])
    }
    ellipse(...e) {
        return this._callContextMethod("ellipse", e)
    }
    circle(...e) {
        return this._callContextMethod("circle", e)
    }
    path(...e) {
        return this._callContextMethod("path", e)
    }
    lineTo(...e) {
        return this._callContextMethod("lineTo", e)
    }
    moveTo(...e) {
        return this._callContextMethod("moveTo", e)
    }
    quadraticCurveTo(...e) {
        return this._callContextMethod("quadraticCurveTo", e)
    }
    rect(...e) {
        return this._callContextMethod("rect", e)
    }
    roundRect(...e) {
        return this._callContextMethod("roundRect", e)
    }
    poly(...e) {
        return this._callContextMethod("poly", e)
    }
    regularPoly(...e) {
        return this._callContextMethod("regularPoly", e)
    }
    roundPoly(...e) {
        return this._callContextMethod("roundPoly", e)
    }
    roundShape(...e) {
        return this._callContextMethod("roundShape", e)
    }
    filletRect(...e) {
        return this._callContextMethod("filletRect", e)
    }
    chamferRect(...e) {
        return this._callContextMethod("chamferRect", e)
    }
    star(...e) {
        return this._callContextMethod("star", e)
    }
    svg(...e) {
        return this._callContextMethod("svg", e)
    }
    restore(...e) {
        return this._callContextMethod("restore", e)
    }
    save() {
        return this._callContextMethod("save", [])
    }
    getTransform() {
        return this.context.getTransform()
    }
    resetTransform() {
        return this._callContextMethod("resetTransform", [])
    }
    rotateTransform(...e) {
        return this._callContextMethod("rotate", e)
    }
    scaleTransform(...e) {
        return this._callContextMethod("scale", e)
    }
    setTransform(...e) {
        return this._callContextMethod("setTransform", e)
    }
    transform(...e) {
        return this._callContextMethod("transform", e)
    }
    translateTransform(...e) {
        return this._callContextMethod("translate", e)
    }
    clear() {
        return this._callContextMethod("clear", [])
    }
    get fillStyle() {
        return this._context.fillStyle
    }
    set fillStyle(e) {
        this._context.fillStyle = e
    }
    get strokeStyle() {
        return this._context.strokeStyle
    }
    set strokeStyle(e) {
        this._context.strokeStyle = e
    }
    clone(e=!1) {
        return e ? new I0(this._context.clone()) : (this._ownedContext = null,
        new I0(this._context))
    }
    lineStyle(e, n, r) {
        Fe(rt, "Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");
        const i = {};
        return e && (i.width = e),
        n && (i.color = n),
        r && (i.alpha = r),
        this.context.strokeStyle = i,
        this
    }
    beginFill(e, n) {
        Fe(rt, "Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");
        const r = {};
        return e !== void 0 && (r.color = e),
        n !== void 0 && (r.alpha = n),
        this.context.fillStyle = r,
        this
    }
    endFill() {
        Fe(rt, "Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),
        this.context.fill();
        const e = this.context.strokeStyle;
        return (e.width !== ci.defaultStrokeStyle.width || e.color !== ci.defaultStrokeStyle.color || e.alpha !== ci.defaultStrokeStyle.alpha) && this.context.stroke(),
        this
    }
    drawCircle(...e) {
        return Fe(rt, "Graphics#drawCircle has been renamed to Graphics#circle"),
        this._callContextMethod("circle", e)
    }
    drawEllipse(...e) {
        return Fe(rt, "Graphics#drawEllipse has been renamed to Graphics#ellipse"),
        this._callContextMethod("ellipse", e)
    }
    drawPolygon(...e) {
        return Fe(rt, "Graphics#drawPolygon has been renamed to Graphics#poly"),
        this._callContextMethod("poly", e)
    }
    drawRect(...e) {
        return Fe(rt, "Graphics#drawRect has been renamed to Graphics#rect"),
        this._callContextMethod("rect", e)
    }
    drawRoundedRect(...e) {
        return Fe(rt, "Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),
        this._callContextMethod("roundRect", e)
    }
    drawStar(...e) {
        return Fe(rt, "Graphics#drawStar has been renamed to Graphics#star"),
        this._callContextMethod("star", e)
    }
}
const rk = class ik extends Jd {
    constructor(...e) {
        let n = e[0] ?? {};
        n instanceof Float32Array && (Fe(rt, "use new MeshGeometry({ positions, uvs, indices }) instead"),
        n = {
            positions: n,
            uvs: e[1],
            indices: e[2]
        }),
        n = {
            ...ik.defaultOptions,
            ...n
        };
        const r = n.positions || new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);
        let i = n.uvs;
        i || (n.positions ? i = new Float32Array(r.length) : i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]));
        const o = n.indices || new Uint32Array([0, 1, 2, 0, 2, 3])
          , s = n.shrinkBuffersToFit
          , a = new zr({
            data: r,
            label: "attribute-mesh-positions",
            shrinkToFit: s,
            usage: it.VERTEX | it.COPY_DST
        })
          , l = new zr({
            data: i,
            label: "attribute-mesh-uvs",
            shrinkToFit: s,
            usage: it.VERTEX | it.COPY_DST
        })
          , c = new zr({
            data: o,
            label: "index-mesh-buffer",
            shrinkToFit: s,
            usage: it.INDEX | it.COPY_DST
        });
        super({
            attributes: {
                aPosition: {
                    buffer: a,
                    format: "float32x2",
                    stride: 2 * 4,
                    offset: 0
                },
                aUV: {
                    buffer: l,
                    format: "float32x2",
                    stride: 2 * 4,
                    offset: 0
                }
            },
            indexBuffer: c,
            topology: n.topology
        }),
        this.batchMode = "auto"
    }
    get positions() {
        return this.attributes.aPosition.buffer.data
    }
    set positions(e) {
        this.attributes.aPosition.buffer.data = e
    }
    get uvs() {
        return this.attributes.aUV.buffer.data
    }
    set uvs(e) {
        this.attributes.aUV.buffer.data = e
    }
    get indices() {
        return this.indexBuffer.data
    }
    set indices(e) {
        this.indexBuffer.data = e
    }
}
;
rk.defaultOptions = {
    topology: "triangle-list",
    shrinkBuffersToFit: !1
};
let _2 = rk;
class Mde {
    constructor({matrix: e, observer: n}={}) {
        this.dirty = !0,
        this._matrix = e ?? new Oe,
        this.observer = n,
        this.position = new Jt(this,0,0),
        this.scale = new Jt(this,1,1),
        this.pivot = new Jt(this,0,0),
        this.skew = new Jt(this,0,0),
        this._rotation = 0,
        this._cx = 1,
        this._sx = 0,
        this._cy = 0,
        this._sy = 1
    }
    get matrix() {
        const e = this._matrix;
        return this.dirty && (e.a = this._cx * this.scale.x,
        e.b = this._sx * this.scale.x,
        e.c = this._cy * this.scale.y,
        e.d = this._sy * this.scale.y,
        e.tx = this.position.x - (this.pivot.x * e.a + this.pivot.y * e.c),
        e.ty = this.position.y - (this.pivot.x * e.b + this.pivot.y * e.d),
        this.dirty = !1),
        e
    }
    _onUpdate(e) {
        var n;
        this.dirty = !0,
        e === this.skew && this.updateSkew(),
        (n = this.observer) == null || n._onUpdate(this)
    }
    updateSkew() {
        this._cx = Math.cos(this._rotation + this.skew.y),
        this._sx = Math.sin(this._rotation + this.skew.y),
        this._cy = -Math.sin(this._rotation - this.skew.x),
        this._sy = Math.cos(this._rotation - this.skew.x),
        this.dirty = !0
    }
    toString() {
        return `[pixi.js/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`
    }
    setFromMatrix(e) {
        e.decompose(this),
        this.dirty = !0
    }
    get rotation() {
        return this._rotation
    }
    set rotation(e) {
        this._rotation !== e && (this._rotation = e,
        this._onUpdate(this.skew))
    }
}
const ok = class $p extends qd {
    constructor(...e) {
        let n = e[0] || {};
        n instanceof Ae && (n = {
            texture: n
        }),
        e.length > 1 && (Fe(rt, "use new TilingSprite({ texture, width:100, height:100 }) instead"),
        n.width = e[1],
        n.height = e[2]),
        n = {
            ...$p.defaultOptions,
            ...n
        };
        const {texture: r, anchor: i, tilePosition: o, tileScale: s, tileRotation: a, width: l, height: c, applyAnchorToTexture: u, roundPixels: f, ...d} = n ?? {};
        super({
            label: "TilingSprite",
            ...d
        }),
        this.renderPipeId = "tilingSprite",
        this.batched = !0,
        this.allowChildren = !1,
        this._anchor = new Jt({
            _onUpdate: () => {
                this.onViewUpdate()
            }
        }),
        this.applyAnchorToTexture = u,
        this.texture = r,
        this._width = l ?? r.width,
        this._height = c ?? r.height,
        this._tileTransform = new Mde({
            observer: {
                _onUpdate: () => this.onViewUpdate()
            }
        }),
        i && (this.anchor = i),
        this.tilePosition = o,
        this.tileScale = s,
        this.tileRotation = a,
        this.roundPixels = f ?? !1
    }
    static from(e, n={}) {
        return typeof e == "string" ? new $p({
            texture: bt.get(e),
            ...n
        }) : new $p({
            texture: e,
            ...n
        })
    }
    get uvRespectAnchor() {
        return Ne("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),
        this.applyAnchorToTexture
    }
    set uvRespectAnchor(e) {
        Ne("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),
        this.applyAnchorToTexture = e
    }
    get clampMargin() {
        return this._texture.textureMatrix.clampMargin
    }
    set clampMargin(e) {
        this._texture.textureMatrix.clampMargin = e
    }
    get anchor() {
        return this._anchor
    }
    set anchor(e) {
        typeof e == "number" ? this._anchor.set(e) : this._anchor.copyFrom(e)
    }
    get tilePosition() {
        return this._tileTransform.position
    }
    set tilePosition(e) {
        this._tileTransform.position.copyFrom(e)
    }
    get tileScale() {
        return this._tileTransform.scale
    }
    set tileScale(e) {
        typeof e == "number" ? this._tileTransform.scale.set(e) : this._tileTransform.scale.copyFrom(e)
    }
    set tileRotation(e) {
        this._tileTransform.rotation = e
    }
    get tileRotation() {
        return this._tileTransform.rotation
    }
    get tileTransform() {
        return this._tileTransform
    }
    set texture(e) {
        e || (e = Ae.EMPTY);
        const n = this._texture;
        n !== e && (n && n.dynamic && n.off("update", this.onViewUpdate, this),
        e.dynamic && e.on("update", this.onViewUpdate, this),
        this._texture = e,
        this.onViewUpdate())
    }
    get texture() {
        return this._texture
    }
    set width(e) {
        this._width = e,
        this.onViewUpdate()
    }
    get width() {
        return this._width
    }
    set height(e) {
        this._height = e,
        this.onViewUpdate()
    }
    get height() {
        return this._height
    }
    setSize(e, n) {
        typeof e == "object" && (n = e.height ?? e.width,
        e = e.width),
        this._width = e,
        this._height = n ?? e,
        this.onViewUpdate()
    }
    getSize(e) {
        return e || (e = {}),
        e.width = this._width,
        e.height = this._height,
        e
    }
    updateBounds() {
        const e = this._bounds
          , n = this._anchor
          , r = this._width
          , i = this._height;
        e.minX = -n._x * r,
        e.maxX = e.minX + r,
        e.minY = -n._y * i,
        e.maxY = e.minY + i
    }
    containsPoint(e) {
        const n = this._width
          , r = this._height
          , i = -n * this._anchor._x;
        let o = 0;
        return e.x >= i && e.x <= i + n && (o = -r * this._anchor._y,
        e.y >= o && e.y <= o + r)
    }
    destroy(e=!1) {
        if (super.destroy(e),
        this._anchor = null,
        this._tileTransform = null,
        this._bounds = null,
        typeof e == "boolean" ? e : e == null ? void 0 : e.texture) {
            const r = typeof e == "boolean" ? e : e == null ? void 0 : e.textureSource;
            this._texture.destroy(r)
        }
        this._texture = null
    }
}
;
ok.defaultOptions = {
    texture: Ae.EMPTY,
    anchor: {
        x: 0,
        y: 0
    },
    tilePosition: {
        x: 0,
        y: 0
    },
    tileScale: {
        x: 1,
        y: 1
    },
    tileRotation: 0,
    applyAnchorToTexture: !1
};
let APe = ok;
class Dde extends qd {
    constructor(e, n) {
        const {text: r, resolution: i, style: o, anchor: s, width: a, height: l, roundPixels: c, ...u} = e;
        super({
            ...u
        }),
        this.batched = !0,
        this._resolution = null,
        this._autoResolution = !0,
        this._didTextUpdate = !0,
        this._styleClass = n,
        this.text = r ?? "",
        this.style = o,
        this.resolution = i ?? null,
        this.allowChildren = !1,
        this._anchor = new Jt({
            _onUpdate: () => {
                this.onViewUpdate()
            }
        }),
        s && (this.anchor = s),
        this.roundPixels = c ?? !1,
        a !== void 0 && (this.width = a),
        l !== void 0 && (this.height = l)
    }
    get anchor() {
        return this._anchor
    }
    set anchor(e) {
        typeof e == "number" ? this._anchor.set(e) : this._anchor.copyFrom(e)
    }
    set text(e) {
        e = e.toString(),
        this._text !== e && (this._text = e,
        this.onViewUpdate())
    }
    get text() {
        return this._text
    }
    set resolution(e) {
        this._autoResolution = e === null,
        this._resolution = e,
        this.onViewUpdate()
    }
    get resolution() {
        return this._resolution
    }
    get style() {
        return this._style
    }
    set style(e) {
        var n;
        e || (e = {}),
        (n = this._style) == null || n.off("update", this.onViewUpdate, this),
        e instanceof this._styleClass ? this._style = e : this._style = new this._styleClass(e),
        this._style.on("update", this.onViewUpdate, this),
        this.onViewUpdate()
    }
    get width() {
        return Math.abs(this.scale.x) * this.bounds.width
    }
    set width(e) {
        this._setWidth(e, this.bounds.width)
    }
    get height() {
        return Math.abs(this.scale.y) * this.bounds.height
    }
    set height(e) {
        this._setHeight(e, this.bounds.height)
    }
    getSize(e) {
        return e || (e = {}),
        e.width = Math.abs(this.scale.x) * this.bounds.width,
        e.height = Math.abs(this.scale.y) * this.bounds.height,
        e
    }
    setSize(e, n) {
        typeof e == "object" ? (n = e.height ?? e.width,
        e = e.width) : n ?? (n = e),
        e !== void 0 && this._setWidth(e, this.bounds.width),
        n !== void 0 && this._setHeight(n, this.bounds.height)
    }
    containsPoint(e) {
        const n = this.bounds.width
          , r = this.bounds.height
          , i = -n * this.anchor.x;
        let o = 0;
        return e.x >= i && e.x <= i + n && (o = -r * this.anchor.y,
        e.y >= o && e.y <= o + r)
    }
    onViewUpdate() {
        this.didViewUpdate || (this._didTextUpdate = !0),
        super.onViewUpdate()
    }
    destroy(e=!1) {
        super.destroy(e),
        this.owner = null,
        this._bounds = null,
        this._anchor = null,
        (typeof e == "boolean" ? e : e != null && e.style) && this._style.destroy(e),
        this._style = null,
        this._text = null
    }
}
function Bde(t, e) {
    let n = t[0] ?? {};
    return (typeof n == "string" || t[1]) && (Fe(rt, `use new ${e}({ text: "hi!", style }) instead`),
    n = {
        text: n,
        style: t[1]
    }),
    n
}
let Sa = null
  , Uo = null;
function kde(t, e) {
    Sa || (Sa = je.get().createCanvas(256, 128),
    Uo = Sa.getContext("2d", {
        willReadFrequently: !0
    }),
    Uo.globalCompositeOperation = "copy",
    Uo.globalAlpha = 1),
    (Sa.width < t || Sa.height < e) && (Sa.width = Yc(t),
    Sa.height = Yc(e))
}
function u3(t, e, n) {
    for (let r = 0, i = 4 * n * e; r < e; ++r,
    i += 4)
        if (t[i + 3] !== 0)
            return !1;
    return !0
}
function f3(t, e, n, r, i) {
    const o = 4 * e;
    for (let s = r, a = r * o + 4 * n; s <= i; ++s,
    a += o)
        if (t[a + 3] !== 0)
            return !1;
    return !0
}
function Nde(...t) {
    let e = t[0];
    e.canvas || (e = {
        canvas: t[0],
        resolution: t[1]
    });
    const {canvas: n} = e
      , r = Math.min(e.resolution ?? 1, 1)
      , i = e.width ?? n.width
      , o = e.height ?? n.height;
    let s = e.output;
    if (kde(i, o),
    !Uo)
        throw new TypeError("Failed to get canvas 2D context");
    Uo.drawImage(n, 0, 0, i, o, 0, 0, i * r, o * r);
    const l = Uo.getImageData(0, 0, i, o).data;
    let c = 0
      , u = 0
      , f = i - 1
      , d = o - 1;
    for (; u < o && u3(l, i, u); )
        ++u;
    if (u === o)
        return vt.EMPTY;
    for (; u3(l, i, d); )
        --d;
    for (; f3(l, i, c, u, d); )
        ++c;
    for (; f3(l, i, f, u, d); )
        --f;
    return ++f,
    ++d,
    Uo.globalCompositeOperation = "source-over",
    Uo.strokeRect(c, u, f - c, d - u),
    Uo.globalCompositeOperation = "copy",
    s ?? (s = new vt),
    s.set(c / r, u / r, (f - c) / r, (d - u) / r),
    s
}
const d3 = new vt;
class Fde {
    getCanvasAndContext(e) {
        const {text: n, style: r, resolution: i=1} = e
          , o = r._getFinalPadding()
          , s = Ii.measureText(n || " ", r)
          , a = Math.ceil(Math.ceil(Math.max(1, s.width) + o * 2) * i)
          , l = Math.ceil(Math.ceil(Math.max(1, s.height) + o * 2) * i)
          , c = sa.getOptimalCanvasAndContext(a, l);
        this._renderTextToCanvas(n, r, o, i, c);
        const u = r.trim ? Nde({
            canvas: c.canvas,
            width: a,
            height: l,
            resolution: 1,
            output: d3
        }) : d3.set(0, 0, a, l);
        return {
            canvasAndContext: c,
            frame: u
        }
    }
    returnCanvasAndContext(e) {
        sa.returnCanvasAndContext(e)
    }
    _renderTextToCanvas(e, n, r, i, o) {
        var _, x, b, w;
        const {canvas: s, context: a} = o
          , l = C0(n)
          , c = Ii.measureText(e || " ", n)
          , u = c.lines
          , f = c.lineHeight
          , d = c.lineWidths
          , h = c.maxLineWidth
          , p = c.fontProperties
          , y = s.height;
        if (a.resetTransform(),
        a.scale(i, i),
        a.textBaseline = n.textBaseline,
        (_ = n._stroke) != null && _.width) {
            const E = n._stroke;
            a.lineWidth = E.width,
            a.miterLimit = E.miterLimit,
            a.lineJoin = E.join,
            a.lineCap = E.cap
        }
        a.font = l;
        let v, g;
        const m = n.dropShadow ? 2 : 1;
        for (let E = 0; E < m; ++E) {
            const S = n.dropShadow && E === 0
              , P = S ? Math.ceil(Math.max(1, y) + r * 2) : 0
              , C = P * i;
            if (S) {
                a.fillStyle = "black",
                a.strokeStyle = "black";
                const I = n.dropShadow
                  , B = I.color
                  , G = I.alpha;
                a.shadowColor = Rt.shared.setValue(B).setAlpha(G).toRgbaString();
                const N = I.blur * i
                  , U = I.distance * i;
                a.shadowBlur = N,
                a.shadowOffsetX = Math.cos(I.angle) * U,
                a.shadowOffsetY = Math.sin(I.angle) * U + C
            } else {
                if (a.fillStyle = n._fill ? T0(n._fill, a, c, r * 2) : null,
                (x = n._stroke) != null && x.width) {
                    const I = n._stroke.width * .5 + r * 2;
                    a.strokeStyle = T0(n._stroke, a, c, I)
                }
                a.shadowColor = "black"
            }
            let A = (f - p.fontSize) / 2;
            f - p.fontSize < 0 && (A = 0);
            const T = ((b = n._stroke) == null ? void 0 : b.width) ?? 0;
            for (let I = 0; I < u.length; I++)
                v = T / 2,
                g = T / 2 + I * f + p.ascent + A,
                n.align === "right" ? v += h - d[I] : n.align === "center" && (v += (h - d[I]) / 2),
                (w = n._stroke) != null && w.width && this._drawLetterSpacing(u[I], n, o, v + r, g + r - P, !0),
                n._fill !== void 0 && this._drawLetterSpacing(u[I], n, o, v + r, g + r - P)
        }
    }
    _drawLetterSpacing(e, n, r, i, o, s=!1) {
        const {context: a} = r
          , l = n.letterSpacing;
        let c = !1;
        if (Ii.experimentalLetterSpacingSupported && (Ii.experimentalLetterSpacing ? (a.letterSpacing = `${l}px`,
        a.textLetterSpacing = `${l}px`,
        c = !0) : (a.letterSpacing = "0px",
        a.textLetterSpacing = "0px")),
        l === 0 || c) {
            s ? a.strokeText(e, i, o) : a.fillText(e, i, o);
            return
        }
        let u = i;
        const f = Ii.graphemeSegmenter(e);
        let d = a.measureText(e).width
          , h = 0;
        for (let p = 0; p < f.length; ++p) {
            const y = f[p];
            s ? a.strokeText(y, u, o) : a.fillText(y, u, o);
            let v = "";
            for (let g = p + 1; g < f.length; ++g)
                v += f[g];
            h = a.measureText(v).width,
            u += d - h + l,
            d = h
        }
    }
}
const Rf = new Fde;
class TPe extends Dde {
    constructor(...e) {
        const n = Bde(e, "Text");
        super(n, bl),
        this.renderPipeId = "text",
        n.textureStyle && (this.textureStyle = n.textureStyle instanceof yo ? n.textureStyle : new yo(n.textureStyle))
    }
    updateBounds() {
        const e = this._bounds
          , n = this._anchor;
        let r = 0
          , i = 0;
        if (this._style.trim) {
            const {frame: o, canvasAndContext: s} = Rf.getCanvasAndContext({
                text: this.text,
                style: this._style,
                resolution: 1
            });
            Rf.returnCanvasAndContext(s),
            r = o.width,
            i = o.height
        } else {
            const o = Ii.measureText(this._text, this._style);
            r = o.width,
            i = o.height
        }
        e.minX = -n._x * r,
        e.maxX = e.minX + r,
        e.minY = -n._y * i,
        e.maxY = e.minY + i
    }
}
const h3 = "http://www.w3.org/2000/svg"
  , p3 = "http://www.w3.org/1999/xhtml";
class sk {
    constructor() {
        this.svgRoot = document.createElementNS(h3, "svg"),
        this.foreignObject = document.createElementNS(h3, "foreignObject"),
        this.domElement = document.createElementNS(p3, "div"),
        this.styleElement = document.createElementNS(p3, "style");
        const {foreignObject: e, svgRoot: n, styleElement: r, domElement: i} = this;
        e.setAttribute("width", "10000"),
        e.setAttribute("height", "10000"),
        e.style.overflow = "hidden",
        n.appendChild(e),
        e.appendChild(r),
        e.appendChild(i),
        this.image = je.get().createImage()
    }
}
let g3;
function Lde(t, e, n, r) {
    r || (r = g3 || (g3 = new sk));
    const {domElement: i, styleElement: o, svgRoot: s} = r;
    i.innerHTML = `<style>${e.cssStyle};</style><div style='padding:0'>${t}</div>`,
    i.setAttribute("style", "transform-origin: top left; display: inline-block"),
    n && (o.textContent = n),
    document.body.appendChild(s);
    const a = i.getBoundingClientRect();
    s.remove();
    const l = e.padding * 2;
    return {
        width: a.width - l,
        height: a.height - l
    }
}
class ak {
    constructor() {
        this._tempState = $i.for2d(),
        this._didUploadHash = {}
    }
    init(e) {
        e.renderer.runners.contextChange.add(this)
    }
    contextChange() {
        this._didUploadHash = {}
    }
    start(e, n, r) {
        const i = e.renderer
          , o = this._didUploadHash[r.uid];
        i.shader.bind(r, o),
        o || (this._didUploadHash[r.uid] = !0),
        i.shader.updateUniformGroup(i.globalUniforms.uniformGroup),
        i.geometry.bind(n, r.glProgram)
    }
    execute(e, n) {
        const r = e.renderer;
        this._tempState.blendMode = n.blendMode,
        r.state.set(this._tempState);
        const i = n.textures.textures;
        for (let o = 0; o < n.textures.count; o++)
            r.texture.bind(i[o], o);
        r.geometry.draw(n.topology, n.size, n.start)
    }
}
ak.extension = {
    type: [V.WebGLPipesAdaptor],
    name: "batch"
};
const cp = $i.for2d();
class lk {
    start(e, n, r) {
        const i = e.renderer
          , o = i.encoder
          , s = r.gpuProgram;
        this._shader = r,
        this._geometry = n,
        o.setGeometry(n, s),
        cp.blendMode = "normal",
        i.pipeline.getPipeline(n, s, cp);
        const a = i.globalUniforms.bindGroup;
        o.resetBindGroup(1),
        o.setBindGroup(0, a, s)
    }
    execute(e, n) {
        const r = this._shader.gpuProgram
          , i = e.renderer
          , o = i.encoder;
        if (!n.bindGroup) {
            const l = n.textures;
            n.bindGroup = i2(l.textures, l.count, i.limits.maxBatchableTextures)
        }
        cp.blendMode = n.blendMode;
        const s = i.bindGroup.getBindGroup(n.bindGroup, r, 1)
          , a = i.pipeline.getPipeline(this._geometry, r, cp, n.topology);
        n.bindGroup._touch(i.textureGC.count),
        o.setPipeline(a),
        o.renderPassEncoder.setBindGroup(1, s),
        o.renderPassEncoder.drawIndexed(n.size, 1, n.start)
    }
}
lk.extension = {
    type: [V.WebGPUPipesAdaptor],
    name: "batch"
};
const x2 = class ck {
    constructor(e, n) {
        var r, i;
        this.state = $i.for2d(),
        this._batchersByInstructionSet = Object.create(null),
        this._activeBatches = Object.create(null),
        this.renderer = e,
        this._adaptor = n,
        (i = (r = this._adaptor).init) == null || i.call(r, this)
    }
    static getBatcher(e) {
        return new this._availableBatchers[e]
    }
    buildStart(e) {
        let n = this._batchersByInstructionSet[e.uid];
        n || (n = this._batchersByInstructionSet[e.uid] = Object.create(null),
        n.default || (n.default = new u2({
            maxTextures: this.renderer.limits.maxBatchableTextures
        }))),
        this._activeBatches = n,
        this._activeBatch = this._activeBatches.default;
        for (const r in this._activeBatches)
            this._activeBatches[r].begin()
    }
    addToBatch(e, n) {
        if (this._activeBatch.name !== e.batcherName) {
            this._activeBatch.break(n);
            let r = this._activeBatches[e.batcherName];
            r || (r = this._activeBatches[e.batcherName] = ck.getBatcher(e.batcherName),
            r.begin()),
            this._activeBatch = r
        }
        this._activeBatch.add(e)
    }
    break(e) {
        this._activeBatch.break(e)
    }
    buildEnd(e) {
        this._activeBatch.break(e);
        const n = this._activeBatches;
        for (const r in n) {
            const i = n[r]
              , o = i.geometry;
            o.indexBuffer.setDataWithSize(i.indexBuffer, i.indexSize, !0),
            o.buffers[0].setDataWithSize(i.attributeBuffer.float32View, i.attributeSize, !1)
        }
    }
    upload(e) {
        const n = this._batchersByInstructionSet[e.uid];
        for (const r in n) {
            const i = n[r]
              , o = i.geometry;
            i.dirty && (i.dirty = !1,
            o.buffers[0].update(i.attributeSize * 4))
        }
    }
    execute(e) {
        if (e.action === "startBatch") {
            const n = e.batcher
              , r = n.geometry
              , i = n.shader;
            this._adaptor.start(this, r, i)
        }
        this._adaptor.execute(this, e)
    }
    destroy() {
        this.state = null,
        this.renderer = null,
        this._adaptor = null;
        for (const e in this._activeBatches)
            this._activeBatches[e].destroy();
        this._activeBatches = null
    }
}
;
x2.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "batch"
};
x2._availableBatchers = Object.create(null);
let uk = x2;
$e.handleByMap(V.Batcher, uk._availableBatchers);
$e.add(u2);
const Mf = {
    name: "local-uniform-bit",
    vertex: {
        header: `

            struct LocalUniforms {
                uTransformMatrix:mat3x3<f32>,
                uColor:vec4<f32>,
                uRound:f32,
            }

            @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
        `,
        main: `
            vColor *= localUniforms.uColor;
            modelMatrix *= localUniforms.uTransformMatrix;
        `,
        end: `
            if(localUniforms.uRound == 1)
            {
                vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
            }
        `
    }
}
  , $de = {
    ...Mf,
    vertex: {
        ...Mf.vertex,
        header: Mf.vertex.header.replace("group(1)", "group(2)")
    }
}
  , b2 = {
    name: "local-uniform-bit",
    vertex: {
        header: `

            uniform mat3 uTransformMatrix;
            uniform vec4 uColor;
            uniform float uRound;
        `,
        main: `
            vColor *= uColor;
            modelMatrix = uTransformMatrix;
        `,
        end: `
            if(uRound == 1.)
            {
                gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
            }
        `
    }
}
  , Ude = {
    name: "texture-bit",
    vertex: {
        header: `

        struct TextureUniforms {
            uTextureMatrix:mat3x3<f32>,
        }

        @group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;
        `,
        main: `
            uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;
        `
    },
    fragment: {
        header: `
            @group(2) @binding(0) var uTexture: texture_2d<f32>;
            @group(2) @binding(1) var uSampler: sampler;


        `,
        main: `
            outColor = textureSample(uTexture, uSampler, vUV);
        `
    }
}
  , Gde = {
    name: "texture-bit",
    vertex: {
        header: `
            uniform mat3 uTextureMatrix;
        `,
        main: `
            uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
        `
    },
    fragment: {
        header: `
        uniform sampler2D uTexture;


        `,
        main: `
            outColor = texture(uTexture, vUV);
        `
    }
}
  , Hde = new Vn;
class Vde extends x0 {
    constructor() {
        super(),
        this.filters = [new Rde({
            sprite: new vl(Ae.EMPTY),
            inverse: !1,
            resolution: "inherit",
            antialias: "inherit"
        })]
    }
    get sprite() {
        return this.filters[0].sprite
    }
    set sprite(e) {
        this.filters[0].sprite = e
    }
    get inverse() {
        return this.filters[0].inverse
    }
    set inverse(e) {
        this.filters[0].inverse = e
    }
}
class fk {
    constructor(e) {
        this._activeMaskStage = [],
        this._renderer = e
    }
    push(e, n, r) {
        const i = this._renderer;
        if (i.renderPipes.batch.break(r),
        r.add({
            renderPipeId: "alphaMask",
            action: "pushMaskBegin",
            mask: e,
            inverse: n._maskOptions.inverse,
            canBundle: !1,
            maskedContainer: n
        }),
        e.inverse = n._maskOptions.inverse,
        e.renderMaskToTexture) {
            const o = e.mask;
            o.includeInBuild = !0,
            o.collectRenderables(r, i, null),
            o.includeInBuild = !1
        }
        i.renderPipes.batch.break(r),
        r.add({
            renderPipeId: "alphaMask",
            action: "pushMaskEnd",
            mask: e,
            maskedContainer: n,
            inverse: n._maskOptions.inverse,
            canBundle: !1
        })
    }
    pop(e, n, r) {
        this._renderer.renderPipes.batch.break(r),
        r.add({
            renderPipeId: "alphaMask",
            action: "popMaskEnd",
            mask: e,
            inverse: n._maskOptions.inverse,
            canBundle: !1
        })
    }
    execute(e) {
        const n = this._renderer
          , r = e.mask.renderMaskToTexture;
        if (e.action === "pushMaskBegin") {
            const i = Hn.get(Vde);
            if (i.inverse = e.inverse,
            r) {
                e.mask.mask.measurable = !0;
                const o = Xw(e.mask.mask, !0, Hde);
                e.mask.mask.measurable = !1,
                o.ceil();
                const s = n.renderTarget.renderTarget.colorTexture.source
                  , a = cn.getOptimalTexture(o.width, o.height, s._resolution, s.antialias);
                n.renderTarget.push(a, !0),
                n.globalUniforms.push({
                    offset: o,
                    worldColor: 4294967295
                });
                const l = i.sprite;
                l.texture = a,
                l.worldTransform.tx = o.minX,
                l.worldTransform.ty = o.minY,
                this._activeMaskStage.push({
                    filterEffect: i,
                    maskedContainer: e.maskedContainer,
                    filterTexture: a
                })
            } else
                i.sprite = e.mask.mask,
                this._activeMaskStage.push({
                    filterEffect: i,
                    maskedContainer: e.maskedContainer
                })
        } else if (e.action === "pushMaskEnd") {
            const i = this._activeMaskStage[this._activeMaskStage.length - 1];
            r && (n.type === Kr.WEBGL && n.renderTarget.finishRenderPass(),
            n.renderTarget.pop(),
            n.globalUniforms.pop()),
            n.filter.push({
                renderPipeId: "filter",
                action: "pushFilter",
                container: i.maskedContainer,
                filterEffect: i.filterEffect,
                canBundle: !1
            })
        } else if (e.action === "popMaskEnd") {
            n.filter.pop();
            const i = this._activeMaskStage.pop();
            r && cn.returnTexture(i.filterTexture),
            Hn.return(i.filterEffect)
        }
    }
    destroy() {
        this._renderer = null,
        this._activeMaskStage = null
    }
}
fk.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "alphaMask"
};
class dk {
    constructor(e) {
        this._colorStack = [],
        this._colorStackIndex = 0,
        this._currentColor = 0,
        this._renderer = e
    }
    buildStart() {
        this._colorStack[0] = 15,
        this._colorStackIndex = 1,
        this._currentColor = 15
    }
    push(e, n, r) {
        this._renderer.renderPipes.batch.break(r);
        const o = this._colorStack;
        o[this._colorStackIndex] = o[this._colorStackIndex - 1] & e.mask;
        const s = this._colorStack[this._colorStackIndex];
        s !== this._currentColor && (this._currentColor = s,
        r.add({
            renderPipeId: "colorMask",
            colorMask: s,
            canBundle: !1
        })),
        this._colorStackIndex++
    }
    pop(e, n, r) {
        this._renderer.renderPipes.batch.break(r);
        const o = this._colorStack;
        this._colorStackIndex--;
        const s = o[this._colorStackIndex - 1];
        s !== this._currentColor && (this._currentColor = s,
        r.add({
            renderPipeId: "colorMask",
            colorMask: s,
            canBundle: !1
        }))
    }
    execute(e) {
        this._renderer.colorMask.setMask(e.colorMask)
    }
    destroy() {
        this._colorStack = null
    }
}
dk.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "colorMask"
};
class hk {
    constructor(e) {
        this._maskStackHash = {},
        this._maskHash = new WeakMap,
        this._renderer = e
    }
    push(e, n, r) {
        var i;
        const o = e
          , s = this._renderer;
        s.renderPipes.batch.break(r),
        s.renderPipes.blendMode.setBlendMode(o.mask, "none", r),
        r.add({
            renderPipeId: "stencilMask",
            action: "pushMaskBegin",
            mask: e,
            inverse: n._maskOptions.inverse,
            canBundle: !1
        });
        const a = o.mask;
        a.includeInBuild = !0,
        this._maskHash.has(o) || this._maskHash.set(o, {
            instructionsStart: 0,
            instructionsLength: 0
        });
        const l = this._maskHash.get(o);
        l.instructionsStart = r.instructionSize,
        a.collectRenderables(r, s, null),
        a.includeInBuild = !1,
        s.renderPipes.batch.break(r),
        r.add({
            renderPipeId: "stencilMask",
            action: "pushMaskEnd",
            mask: e,
            inverse: n._maskOptions.inverse,
            canBundle: !1
        });
        const c = r.instructionSize - l.instructionsStart - 1;
        l.instructionsLength = c;
        const u = s.renderTarget.renderTarget.uid;
        (i = this._maskStackHash)[u] ?? (i[u] = 0)
    }
    pop(e, n, r) {
        const i = e
          , o = this._renderer;
        o.renderPipes.batch.break(r),
        o.renderPipes.blendMode.setBlendMode(i.mask, "none", r),
        r.add({
            renderPipeId: "stencilMask",
            action: "popMaskBegin",
            inverse: n._maskOptions.inverse,
            canBundle: !1
        });
        const s = this._maskHash.get(e);
        for (let a = 0; a < s.instructionsLength; a++)
            r.instructions[r.instructionSize++] = r.instructions[s.instructionsStart++];
        r.add({
            renderPipeId: "stencilMask",
            action: "popMaskEnd",
            canBundle: !1
        })
    }
    execute(e) {
        var n;
        const r = this._renderer
          , i = r.renderTarget.renderTarget.uid;
        let o = (n = this._maskStackHash)[i] ?? (n[i] = 0);
        e.action === "pushMaskBegin" ? (r.renderTarget.ensureDepthStencil(),
        r.stencil.setStencilMode(sn.RENDERING_MASK_ADD, o),
        o++,
        r.colorMask.setMask(0)) : e.action === "pushMaskEnd" ? (e.inverse ? r.stencil.setStencilMode(sn.INVERSE_MASK_ACTIVE, o) : r.stencil.setStencilMode(sn.MASK_ACTIVE, o),
        r.colorMask.setMask(15)) : e.action === "popMaskBegin" ? (r.colorMask.setMask(0),
        o !== 0 ? r.stencil.setStencilMode(sn.RENDERING_MASK_REMOVE, o) : (r.renderTarget.clear(null, Ur.STENCIL),
        r.stencil.setStencilMode(sn.DISABLED, o)),
        o--) : e.action === "popMaskEnd" && (e.inverse ? r.stencil.setStencilMode(sn.INVERSE_MASK_ACTIVE, o) : r.stencil.setStencilMode(sn.MASK_ACTIVE, o),
        r.colorMask.setMask(15)),
        this._maskStackHash[i] = o
    }
    destroy() {
        this._renderer = null,
        this._maskStackHash = null,
        this._maskHash = null
    }
}
hk.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "stencilMask"
};
var Up = (t => (t[t.ELEMENT_ARRAY_BUFFER = 34963] = "ELEMENT_ARRAY_BUFFER",
t[t.ARRAY_BUFFER = 34962] = "ARRAY_BUFFER",
t[t.UNIFORM_BUFFER = 35345] = "UNIFORM_BUFFER",
t))(Up || {});
class zde {
    constructor(e, n) {
        this._lastBindBaseLocation = -1,
        this._lastBindCallId = -1,
        this.buffer = e || null,
        this.updateID = -1,
        this.byteLength = -1,
        this.type = n
    }
}
class pk {
    constructor(e) {
        this._gpuBuffers = Object.create(null),
        this._boundBufferBases = Object.create(null),
        this._minBaseLocation = 0,
        this._nextBindBaseIndex = this._minBaseLocation,
        this._bindCallId = 0,
        this._renderer = e,
        this._renderer.renderableGC.addManagedHash(this, "_gpuBuffers")
    }
    destroy() {
        this._renderer = null,
        this._gl = null,
        this._gpuBuffers = null,
        this._boundBufferBases = null
    }
    contextChange() {
        this._gl = this._renderer.gl,
        this._gpuBuffers = Object.create(null),
        this._maxBindings = this._renderer.limits.maxUniformBindings
    }
    getGlBuffer(e) {
        return this._gpuBuffers[e.uid] || this.createGLBuffer(e)
    }
    bind(e) {
        const {_gl: n} = this
          , r = this.getGlBuffer(e);
        n.bindBuffer(r.type, r.buffer)
    }
    bindBufferBase(e, n) {
        const {_gl: r} = this;
        this._boundBufferBases[n] !== e && (this._boundBufferBases[n] = e,
        e._lastBindBaseLocation = n,
        r.bindBufferBase(r.UNIFORM_BUFFER, n, e.buffer))
    }
    nextBindBase(e) {
        this._bindCallId++,
        this._minBaseLocation = 0,
        e && (this._boundBufferBases[0] = null,
        this._minBaseLocation = 1,
        this._nextBindBaseIndex < 1 && (this._nextBindBaseIndex = 1))
    }
    freeLocationForBufferBase(e) {
        let n = this.getLastBindBaseLocation(e);
        if (n >= this._minBaseLocation)
            return e._lastBindCallId = this._bindCallId,
            n;
        let r = 0
          , i = this._nextBindBaseIndex;
        for (; r < 2; ) {
            i >= this._maxBindings && (i = this._minBaseLocation,
            r++);
            const o = this._boundBufferBases[i];
            if (o && o._lastBindCallId === this._bindCallId) {
                i++;
                continue
            }
            break
        }
        return n = i,
        this._nextBindBaseIndex = i + 1,
        r >= 2 ? -1 : (e._lastBindCallId = this._bindCallId,
        this._boundBufferBases[n] = null,
        n)
    }
    getLastBindBaseLocation(e) {
        const n = e._lastBindBaseLocation;
        return this._boundBufferBases[n] === e ? n : -1
    }
    bindBufferRange(e, n, r, i) {
        const {_gl: o} = this;
        r || (r = 0),
        n || (n = 0),
        this._boundBufferBases[n] = null,
        o.bindBufferRange(o.UNIFORM_BUFFER, n || 0, e.buffer, r * 256, i || 256)
    }
    updateBuffer(e) {
        const {_gl: n} = this
          , r = this.getGlBuffer(e);
        if (e._updateID === r.updateID)
            return r;
        r.updateID = e._updateID,
        n.bindBuffer(r.type, r.buffer);
        const i = e.data
          , o = e.descriptor.usage & it.STATIC ? n.STATIC_DRAW : n.DYNAMIC_DRAW;
        return i ? r.byteLength >= i.byteLength ? n.bufferSubData(r.type, 0, i, 0, e._updateSize / i.BYTES_PER_ELEMENT) : (r.byteLength = i.byteLength,
        n.bufferData(r.type, i, o)) : (r.byteLength = e.descriptor.size,
        n.bufferData(r.type, r.byteLength, o)),
        r
    }
    destroyAll() {
        const e = this._gl;
        for (const n in this._gpuBuffers)
            e.deleteBuffer(this._gpuBuffers[n].buffer);
        this._gpuBuffers = Object.create(null)
    }
    onBufferDestroy(e, n) {
        const r = this._gpuBuffers[e.uid]
          , i = this._gl;
        n || i.deleteBuffer(r.buffer),
        this._gpuBuffers[e.uid] = null
    }
    createGLBuffer(e) {
        const {_gl: n} = this;
        let r = Up.ARRAY_BUFFER;
        e.descriptor.usage & it.INDEX ? r = Up.ELEMENT_ARRAY_BUFFER : e.descriptor.usage & it.UNIFORM && (r = Up.UNIFORM_BUFFER);
        const i = new zde(n.createBuffer(),r);
        return this._gpuBuffers[e.uid] = i,
        e.on("destroy", this.onBufferDestroy, this),
        i
    }
    resetState() {
        this._boundBufferBases = Object.create(null)
    }
}
pk.extension = {
    type: [V.WebGLSystem],
    name: "buffer"
};
const w2 = class gk {
    constructor(e) {
        this.supports = {
            uint32Indices: !0,
            uniformBufferObject: !0,
            vertexArrayObject: !0,
            srgbTextures: !0,
            nonPowOf2wrapping: !0,
            msaa: !0,
            nonPowOf2mipmaps: !0
        },
        this._renderer = e,
        this.extensions = Object.create(null),
        this.handleContextLost = this.handleContextLost.bind(this),
        this.handleContextRestored = this.handleContextRestored.bind(this)
    }
    get isLost() {
        return !this.gl || this.gl.isContextLost()
    }
    contextChange(e) {
        this.gl = e,
        this._renderer.gl = e
    }
    init(e) {
        e = {
            ...gk.defaultOptions,
            ...e
        };
        let n = this.multiView = e.multiView;
        if (e.context && n && (Ne("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),
        n = !1),
        n ? this.canvas = je.get().createCanvas(this._renderer.canvas.width, this._renderer.canvas.height) : this.canvas = this._renderer.view.canvas,
        e.context)
            this.initFromContext(e.context);
        else {
            const r = this._renderer.background.alpha < 1
              , i = e.premultipliedAlpha ?? !0
              , o = e.antialias && !this._renderer.backBuffer.useBackBuffer;
            this.createContext(e.preferWebGLVersion, {
                alpha: r,
                premultipliedAlpha: i,
                antialias: o,
                stencil: !0,
                preserveDrawingBuffer: e.preserveDrawingBuffer,
                powerPreference: e.powerPreference ?? "default"
            })
        }
    }
    ensureCanvasSize(e) {
        if (!this.multiView) {
            e !== this.canvas && Ne("multiView is disabled, but targetCanvas is not the main canvas");
            return
        }
        const {canvas: n} = this;
        (n.width < e.width || n.height < e.height) && (n.width = Math.max(e.width, e.width),
        n.height = Math.max(e.height, e.height))
    }
    initFromContext(e) {
        this.gl = e,
        this.webGLVersion = e instanceof je.get().getWebGLRenderingContext() ? 1 : 2,
        this.getExtensions(),
        this.validateContext(e),
        this._renderer.runners.contextChange.emit(e);
        const n = this._renderer.view.canvas;
        n.addEventListener("webglcontextlost", this.handleContextLost, !1),
        n.addEventListener("webglcontextrestored", this.handleContextRestored, !1)
    }
    createContext(e, n) {
        let r;
        const i = this.canvas;
        if (e === 2 && (r = i.getContext("webgl2", n)),
        !r && (r = i.getContext("webgl", n),
        !r))
            throw new Error("This browser does not support WebGL. Try using the canvas renderer");
        this.gl = r,
        this.initFromContext(this.gl)
    }
    getExtensions() {
        const {gl: e} = this
          , n = {
            anisotropicFiltering: e.getExtension("EXT_texture_filter_anisotropic"),
            floatTextureLinear: e.getExtension("OES_texture_float_linear"),
            s3tc: e.getExtension("WEBGL_compressed_texture_s3tc"),
            s3tc_sRGB: e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),
            etc: e.getExtension("WEBGL_compressed_texture_etc"),
            etc1: e.getExtension("WEBGL_compressed_texture_etc1"),
            pvrtc: e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
            atc: e.getExtension("WEBGL_compressed_texture_atc"),
            astc: e.getExtension("WEBGL_compressed_texture_astc"),
            bptc: e.getExtension("EXT_texture_compression_bptc"),
            rgtc: e.getExtension("EXT_texture_compression_rgtc"),
            loseContext: e.getExtension("WEBGL_lose_context")
        };
        if (this.webGLVersion === 1)
            this.extensions = {
                ...n,
                drawBuffers: e.getExtension("WEBGL_draw_buffers"),
                depthTexture: e.getExtension("WEBGL_depth_texture"),
                vertexArrayObject: e.getExtension("OES_vertex_array_object") || e.getExtension("MOZ_OES_vertex_array_object") || e.getExtension("WEBKIT_OES_vertex_array_object"),
                uint32ElementIndex: e.getExtension("OES_element_index_uint"),
                floatTexture: e.getExtension("OES_texture_float"),
                floatTextureLinear: e.getExtension("OES_texture_float_linear"),
                textureHalfFloat: e.getExtension("OES_texture_half_float"),
                textureHalfFloatLinear: e.getExtension("OES_texture_half_float_linear"),
                vertexAttribDivisorANGLE: e.getExtension("ANGLE_instanced_arrays"),
                srgb: e.getExtension("EXT_sRGB")
            };
        else {
            this.extensions = {
                ...n,
                colorBufferFloat: e.getExtension("EXT_color_buffer_float")
            };
            const r = e.getExtension("WEBGL_provoking_vertex");
            r && r.provokingVertexWEBGL(r.FIRST_VERTEX_CONVENTION_WEBGL)
        }
    }
    handleContextLost(e) {
        e.preventDefault(),
        this._contextLossForced && (this._contextLossForced = !1,
        setTimeout( () => {
            var n;
            this.gl.isContextLost() && ((n = this.extensions.loseContext) == null || n.restoreContext())
        }
        , 0))
    }
    handleContextRestored() {
        this.getExtensions(),
        this._renderer.runners.contextChange.emit(this.gl)
    }
    destroy() {
        var n;
        const e = this._renderer.view.canvas;
        this._renderer = null,
        e.removeEventListener("webglcontextlost", this.handleContextLost),
        e.removeEventListener("webglcontextrestored", this.handleContextRestored),
        this.gl.useProgram(null),
        (n = this.extensions.loseContext) == null || n.loseContext()
    }
    forceContextLoss() {
        var e;
        (e = this.extensions.loseContext) == null || e.loseContext(),
        this._contextLossForced = !0
    }
    validateContext(e) {
        const n = e.getContextAttributes();
        n && !n.stencil && Ne("Provided WebGL context does not have a stencil buffer, masks may not render correctly");
        const r = this.supports
          , i = this.webGLVersion === 2
          , o = this.extensions;
        r.uint32Indices = i || !!o.uint32ElementIndex,
        r.uniformBufferObject = i,
        r.vertexArrayObject = i || !!o.vertexArrayObject,
        r.srgbTextures = i || !!o.srgb,
        r.nonPowOf2wrapping = i,
        r.nonPowOf2mipmaps = i,
        r.msaa = i,
        r.uint32Indices || Ne("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")
    }
}
;
w2.extension = {
    type: [V.WebGLSystem],
    name: "context"
};
w2.defaultOptions = {
    context: null,
    premultipliedAlpha: !0,
    preserveDrawingBuffer: !1,
    powerPreference: void 0,
    preferWebGLVersion: 2,
    multiView: !1
};
let jde = w2;
function mk(t, e) {
    for (const n in t.attributes) {
        const r = t.attributes[n]
          , i = e[n];
        i ? (r.format ?? (r.format = i.format),
        r.offset ?? (r.offset = i.offset),
        r.instance ?? (r.instance = i.instance)) : Ne(`Attribute ${n} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)
    }
    Wde(t)
}
function Wde(t) {
    const {buffers: e, attributes: n} = t
      , r = {}
      , i = {};
    for (const o in e) {
        const s = e[o];
        r[s.uid] = 0,
        i[s.uid] = 0
    }
    for (const o in n) {
        const s = n[o];
        r[s.buffer.uid] += oa(s.format).stride
    }
    for (const o in n) {
        const s = n[o];
        s.stride ?? (s.stride = r[s.buffer.uid]),
        s.start ?? (s.start = i[s.buffer.uid]),
        i[s.buffer.uid] += oa(s.format).stride
    }
}
var J_ = (t => (t[t.RGBA = 6408] = "RGBA",
t[t.RGB = 6407] = "RGB",
t[t.RG = 33319] = "RG",
t[t.RED = 6403] = "RED",
t[t.RGBA_INTEGER = 36249] = "RGBA_INTEGER",
t[t.RGB_INTEGER = 36248] = "RGB_INTEGER",
t[t.RG_INTEGER = 33320] = "RG_INTEGER",
t[t.RED_INTEGER = 36244] = "RED_INTEGER",
t[t.ALPHA = 6406] = "ALPHA",
t[t.LUMINANCE = 6409] = "LUMINANCE",
t[t.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA",
t[t.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT",
t[t.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL",
t))(J_ || {})
  , vk = (t => (t[t.TEXTURE_2D = 3553] = "TEXTURE_2D",
t[t.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP",
t[t.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY",
t[t.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X",
t[t.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X",
t[t.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y",
t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y",
t[t.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z",
t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z",
t))(vk || {})
  , ut = (t => (t[t.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE",
t[t.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT",
t[t.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5",
t[t.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4",
t[t.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1",
t[t.UNSIGNED_INT = 5125] = "UNSIGNED_INT",
t[t.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV",
t[t.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV",
t[t.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8",
t[t.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV",
t[t.BYTE = 5120] = "BYTE",
t[t.SHORT = 5122] = "SHORT",
t[t.INT = 5124] = "INT",
t[t.FLOAT = 5126] = "FLOAT",
t[t.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV",
t[t.HALF_FLOAT = 36193] = "HALF_FLOAT",
t))(ut || {});
const m3 = {
    uint8x2: ut.UNSIGNED_BYTE,
    uint8x4: ut.UNSIGNED_BYTE,
    sint8x2: ut.BYTE,
    sint8x4: ut.BYTE,
    unorm8x2: ut.UNSIGNED_BYTE,
    unorm8x4: ut.UNSIGNED_BYTE,
    snorm8x2: ut.BYTE,
    snorm8x4: ut.BYTE,
    uint16x2: ut.UNSIGNED_SHORT,
    uint16x4: ut.UNSIGNED_SHORT,
    sint16x2: ut.SHORT,
    sint16x4: ut.SHORT,
    unorm16x2: ut.UNSIGNED_SHORT,
    unorm16x4: ut.UNSIGNED_SHORT,
    snorm16x2: ut.SHORT,
    snorm16x4: ut.SHORT,
    float16x2: ut.HALF_FLOAT,
    float16x4: ut.HALF_FLOAT,
    float32: ut.FLOAT,
    float32x2: ut.FLOAT,
    float32x3: ut.FLOAT,
    float32x4: ut.FLOAT,
    uint32: ut.UNSIGNED_INT,
    uint32x2: ut.UNSIGNED_INT,
    uint32x3: ut.UNSIGNED_INT,
    uint32x4: ut.UNSIGNED_INT,
    sint32: ut.INT,
    sint32x2: ut.INT,
    sint32x3: ut.INT,
    sint32x4: ut.INT
};
function Yde(t) {
    return m3[t] ?? m3.float32
}
const Xde = {
    "point-list": 0,
    "line-list": 1,
    "line-strip": 3,
    "triangle-list": 4,
    "triangle-strip": 5
};
class yk {
    constructor(e) {
        this._geometryVaoHash = Object.create(null),
        this._renderer = e,
        this._activeGeometry = null,
        this._activeVao = null,
        this.hasVao = !0,
        this.hasInstance = !0,
        this._renderer.renderableGC.addManagedHash(this, "_geometryVaoHash")
    }
    contextChange() {
        const e = this.gl = this._renderer.gl;
        if (!this._renderer.context.supports.vertexArrayObject)
            throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");
        const n = this._renderer.context.extensions.vertexArrayObject;
        n && (e.createVertexArray = () => n.createVertexArrayOES(),
        e.bindVertexArray = i => n.bindVertexArrayOES(i),
        e.deleteVertexArray = i => n.deleteVertexArrayOES(i));
        const r = this._renderer.context.extensions.vertexAttribDivisorANGLE;
        r && (e.drawArraysInstanced = (i, o, s, a) => {
            r.drawArraysInstancedANGLE(i, o, s, a)
        }
        ,
        e.drawElementsInstanced = (i, o, s, a, l) => {
            r.drawElementsInstancedANGLE(i, o, s, a, l)
        }
        ,
        e.vertexAttribDivisor = (i, o) => r.vertexAttribDivisorANGLE(i, o)),
        this._activeGeometry = null,
        this._activeVao = null,
        this._geometryVaoHash = Object.create(null)
    }
    bind(e, n) {
        const r = this.gl;
        this._activeGeometry = e;
        const i = this.getVao(e, n);
        this._activeVao !== i && (this._activeVao = i,
        r.bindVertexArray(i)),
        this.updateBuffers()
    }
    resetState() {
        this.unbind()
    }
    updateBuffers() {
        const e = this._activeGeometry
          , n = this._renderer.buffer;
        for (let r = 0; r < e.buffers.length; r++) {
            const i = e.buffers[r];
            n.updateBuffer(i)
        }
    }
    checkCompatibility(e, n) {
        const r = e.attributes
          , i = n._attributeData;
        for (const o in i)
            if (!r[o])
                throw new Error(`shader and geometry incompatible, geometry missing the "${o}" attribute`)
    }
    getSignature(e, n) {
        const r = e.attributes
          , i = n._attributeData
          , o = ["g", e.uid];
        for (const s in r)
            i[s] && o.push(s, i[s].location);
        return o.join("-")
    }
    getVao(e, n) {
        var r;
        return ((r = this._geometryVaoHash[e.uid]) == null ? void 0 : r[n._key]) || this.initGeometryVao(e, n)
    }
    initGeometryVao(e, n, r=!0) {
        const i = this._renderer.gl
          , o = this._renderer.buffer;
        this._renderer.shader._getProgramData(n),
        this.checkCompatibility(e, n);
        const s = this.getSignature(e, n);
        this._geometryVaoHash[e.uid] || (this._geometryVaoHash[e.uid] = Object.create(null),
        e.on("destroy", this.onGeometryDestroy, this));
        const a = this._geometryVaoHash[e.uid];
        let l = a[s];
        if (l)
            return a[n._key] = l,
            l;
        mk(e, n._attributeData);
        const c = e.buffers;
        l = i.createVertexArray(),
        i.bindVertexArray(l);
        for (let u = 0; u < c.length; u++) {
            const f = c[u];
            o.bind(f)
        }
        return this.activateVao(e, n),
        a[n._key] = l,
        a[s] = l,
        i.bindVertexArray(null),
        l
    }
    onGeometryDestroy(e, n) {
        const r = this._geometryVaoHash[e.uid]
          , i = this.gl;
        if (r) {
            if (n)
                for (const o in r)
                    this._activeVao !== r[o] && this.unbind(),
                    i.deleteVertexArray(r[o]);
            this._geometryVaoHash[e.uid] = null
        }
    }
    destroyAll(e=!1) {
        const n = this.gl;
        for (const r in this._geometryVaoHash) {
            if (e)
                for (const i in this._geometryVaoHash[r]) {
                    const o = this._geometryVaoHash[r];
                    this._activeVao !== o && this.unbind(),
                    n.deleteVertexArray(o[i])
                }
            this._geometryVaoHash[r] = null
        }
    }
    activateVao(e, n) {
        var a;
        const r = this._renderer.gl
          , i = this._renderer.buffer
          , o = e.attributes;
        e.indexBuffer && i.bind(e.indexBuffer);
        let s = null;
        for (const l in o) {
            const c = o[l]
              , u = c.buffer
              , f = i.getGlBuffer(u)
              , d = n._attributeData[l];
            if (d) {
                s !== f && (i.bind(u),
                s = f);
                const h = d.location;
                r.enableVertexAttribArray(h);
                const p = oa(c.format)
                  , y = Yde(c.format);
                if (((a = d.format) == null ? void 0 : a.substring(1, 4)) === "int" ? r.vertexAttribIPointer(h, p.size, y, c.stride, c.offset) : r.vertexAttribPointer(h, p.size, y, p.normalised, c.stride, c.offset),
                c.instance)
                    if (this.hasInstance) {
                        const v = c.divisor ?? 1;
                        r.vertexAttribDivisor(h, v)
                    } else
                        throw new Error("geometry error, GPU Instancing is not supported on this device")
            }
        }
    }
    draw(e, n, r, i) {
        const {gl: o} = this._renderer
          , s = this._activeGeometry
          , a = Xde[e || s.topology];
        if (i ?? (i = s.instanceCount),
        s.indexBuffer) {
            const l = s.indexBuffer.data.BYTES_PER_ELEMENT
              , c = l === 2 ? o.UNSIGNED_SHORT : o.UNSIGNED_INT;
            i > 1 ? o.drawElementsInstanced(a, n || s.indexBuffer.data.length, c, (r || 0) * l, i) : o.drawElements(a, n || s.indexBuffer.data.length, c, (r || 0) * l)
        } else
            i > 1 ? o.drawArraysInstanced(a, r || 0, n || s.getSize(), i) : o.drawArrays(a, r || 0, n || s.getSize());
        return this
    }
    unbind() {
        this.gl.bindVertexArray(null),
        this._activeVao = null,
        this._activeGeometry = null
    }
    destroy() {
        this._renderer = null,
        this.gl = null,
        this._activeVao = null,
        this._activeGeometry = null
    }
}
yk.extension = {
    type: [V.WebGLSystem],
    name: "geometry"
};
const Kde = new Jd({
    attributes: {
        aPosition: [-1, -1, 3, -1, -1, 3]
    }
})
  , E2 = class _k {
    constructor(e) {
        this.useBackBuffer = !1,
        this._useBackBufferThisRender = !1,
        this._renderer = e
    }
    init(e={}) {
        const {useBackBuffer: n, antialias: r} = {
            ..._k.defaultOptions,
            ...e
        };
        this.useBackBuffer = n,
        this._antialias = r,
        this._renderer.context.supports.msaa || (Ne("antialiasing, is not supported on when using the back buffer"),
        this._antialias = !1),
        this._state = $i.for2d();
        const i = new Fl({
            vertex: `
                attribute vec2 aPosition;
                out vec2 vUv;

                void main() {
                    gl_Position = vec4(aPosition, 0.0, 1.0);

                    vUv = (aPosition + 1.0) / 2.0;

                    // flip dem UVs
                    vUv.y = 1.0 - vUv.y;
                }`,
            fragment: `
                in vec2 vUv;
                out vec4 finalColor;

                uniform sampler2D uTexture;

                void main() {
                    finalColor = texture(uTexture, vUv);
                }`,
            name: "big-triangle"
        });
        this._bigTriangleShader = new yi({
            glProgram: i,
            resources: {
                uTexture: Ae.WHITE.source
            }
        })
    }
    renderStart(e) {
        const n = this._renderer.renderTarget.getRenderTarget(e.target);
        if (this._useBackBufferThisRender = this.useBackBuffer && !!n.isRoot,
        this._useBackBufferThisRender) {
            const r = this._renderer.renderTarget.getRenderTarget(e.target);
            this._targetTexture = r.colorTexture,
            e.target = this._getBackBufferTexture(r.colorTexture)
        }
    }
    renderEnd() {
        this._presentBackBuffer()
    }
    _presentBackBuffer() {
        const e = this._renderer;
        e.renderTarget.finishRenderPass(),
        this._useBackBufferThisRender && (e.renderTarget.bind(this._targetTexture, !1),
        this._bigTriangleShader.resources.uTexture = this._backBufferTexture.source,
        e.encoder.draw({
            geometry: Kde,
            shader: this._bigTriangleShader,
            state: this._state
        }))
    }
    _getBackBufferTexture(e) {
        return this._backBufferTexture = this._backBufferTexture || new Ae({
            source: new Cn({
                width: e.width,
                height: e.height,
                resolution: e._resolution,
                antialias: this._antialias
            })
        }),
        this._backBufferTexture.source.resize(e.width, e.height, e._resolution),
        this._backBufferTexture
    }
    destroy() {
        this._backBufferTexture && (this._backBufferTexture.destroy(),
        this._backBufferTexture = null)
    }
}
;
E2.extension = {
    type: [V.WebGLSystem],
    name: "backBuffer",
    priority: 1
};
E2.defaultOptions = {
    useBackBuffer: !1
};
let qde = E2;
class xk {
    constructor(e) {
        this._colorMaskCache = 15,
        this._renderer = e
    }
    setMask(e) {
        this._colorMaskCache !== e && (this._colorMaskCache = e,
        this._renderer.gl.colorMask(!!(e & 8), !!(e & 4), !!(e & 2), !!(e & 1)))
    }
}
xk.extension = {
    type: [V.WebGLSystem],
    name: "colorMask"
};
class bk {
    constructor(e) {
        this.commandFinished = Promise.resolve(),
        this._renderer = e
    }
    setGeometry(e, n) {
        this._renderer.geometry.bind(e, n.glProgram)
    }
    finishRenderPass() {}
    draw(e) {
        const n = this._renderer
          , {geometry: r, shader: i, state: o, skipSync: s, topology: a, size: l, start: c, instanceCount: u} = e;
        n.shader.bind(i, s),
        n.geometry.bind(r, n.shader._activeProgram),
        o && n.state.set(o),
        n.geometry.draw(a, l, c, u ?? r.instanceCount)
    }
    destroy() {
        this._renderer = null
    }
}
bk.extension = {
    type: [V.WebGLSystem],
    name: "encoder"
};
class wk {
    constructor(e) {
        this._renderer = e
    }
    contextChange() {
        const e = this._renderer.gl;
        this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
        this.maxBatchableTextures = CB(this.maxTextures, e),
        this.maxUniformBindings = e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS)
    }
    destroy() {}
}
wk.extension = {
    type: [V.WebGLSystem],
    name: "limits"
};
class Zde {
    constructor() {
        this.width = -1,
        this.height = -1,
        this.msaa = !1,
        this.msaaRenderBuffer = []
    }
}
const ga = [];
ga[sn.NONE] = void 0;
ga[sn.DISABLED] = {
    stencilWriteMask: 0,
    stencilReadMask: 0
};
ga[sn.RENDERING_MASK_ADD] = {
    stencilFront: {
        compare: "equal",
        passOp: "increment-clamp"
    },
    stencilBack: {
        compare: "equal",
        passOp: "increment-clamp"
    }
};
ga[sn.RENDERING_MASK_REMOVE] = {
    stencilFront: {
        compare: "equal",
        passOp: "decrement-clamp"
    },
    stencilBack: {
        compare: "equal",
        passOp: "decrement-clamp"
    }
};
ga[sn.MASK_ACTIVE] = {
    stencilWriteMask: 0,
    stencilFront: {
        compare: "equal",
        passOp: "keep"
    },
    stencilBack: {
        compare: "equal",
        passOp: "keep"
    }
};
ga[sn.INVERSE_MASK_ACTIVE] = {
    stencilWriteMask: 0,
    stencilFront: {
        compare: "not-equal",
        passOp: "keep"
    },
    stencilBack: {
        compare: "not-equal",
        passOp: "keep"
    }
};
class Ek {
    constructor(e) {
        this._stencilCache = {
            enabled: !1,
            stencilReference: 0,
            stencilMode: sn.NONE
        },
        this._renderTargetStencilState = Object.create(null),
        e.renderTarget.onRenderTargetChange.add(this)
    }
    contextChange(e) {
        this._gl = e,
        this._comparisonFuncMapping = {
            always: e.ALWAYS,
            never: e.NEVER,
            equal: e.EQUAL,
            "not-equal": e.NOTEQUAL,
            less: e.LESS,
            "less-equal": e.LEQUAL,
            greater: e.GREATER,
            "greater-equal": e.GEQUAL
        },
        this._stencilOpsMapping = {
            keep: e.KEEP,
            zero: e.ZERO,
            replace: e.REPLACE,
            invert: e.INVERT,
            "increment-clamp": e.INCR,
            "decrement-clamp": e.DECR,
            "increment-wrap": e.INCR_WRAP,
            "decrement-wrap": e.DECR_WRAP
        },
        this.resetState()
    }
    onRenderTargetChange(e) {
        if (this._activeRenderTarget === e)
            return;
        this._activeRenderTarget = e;
        let n = this._renderTargetStencilState[e.uid];
        n || (n = this._renderTargetStencilState[e.uid] = {
            stencilMode: sn.DISABLED,
            stencilReference: 0
        }),
        this.setStencilMode(n.stencilMode, n.stencilReference)
    }
    resetState() {
        this._stencilCache.enabled = !1,
        this._stencilCache.stencilMode = sn.NONE,
        this._stencilCache.stencilReference = 0
    }
    setStencilMode(e, n) {
        const r = this._renderTargetStencilState[this._activeRenderTarget.uid]
          , i = this._gl
          , o = ga[e]
          , s = this._stencilCache;
        if (r.stencilMode = e,
        r.stencilReference = n,
        e === sn.DISABLED) {
            this._stencilCache.enabled && (this._stencilCache.enabled = !1,
            i.disable(i.STENCIL_TEST));
            return
        }
        this._stencilCache.enabled || (this._stencilCache.enabled = !0,
        i.enable(i.STENCIL_TEST)),
        (e !== s.stencilMode || s.stencilReference !== n) && (s.stencilMode = e,
        s.stencilReference = n,
        i.stencilFunc(this._comparisonFuncMapping[o.stencilBack.compare], n, 255),
        i.stencilOp(i.KEEP, i.KEEP, this._stencilOpsMapping[o.stencilBack.passOp]))
    }
}
Ek.extension = {
    type: [V.WebGLSystem],
    name: "stencil"
};
class Sk {
    constructor(e) {
        this._syncFunctionHash = Object.create(null),
        this._adaptor = e,
        this._systemCheck()
    }
    _systemCheck() {
        if (!uB())
            throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")
    }
    ensureUniformGroup(e) {
        const n = this.getUniformGroupData(e);
        e.buffer || (e.buffer = new zr({
            data: new Float32Array(n.layout.size / 4),
            usage: it.UNIFORM | it.COPY_DST
        }))
    }
    getUniformGroupData(e) {
        return this._syncFunctionHash[e._signature] || this._initUniformGroup(e)
    }
    _initUniformGroup(e) {
        const n = e._signature;
        let r = this._syncFunctionHash[n];
        if (!r) {
            const i = Object.keys(e.uniformStructures).map(a => e.uniformStructures[a])
              , o = this._adaptor.createUboElements(i)
              , s = this._generateUboSync(o.uboElements);
            r = this._syncFunctionHash[n] = {
                layout: o,
                syncFunction: s
            }
        }
        return this._syncFunctionHash[n]
    }
    _generateUboSync(e) {
        return this._adaptor.generateUboSync(e)
    }
    syncUniformGroup(e, n, r) {
        const i = this.getUniformGroupData(e);
        e.buffer || (e.buffer = new zr({
            data: new Float32Array(i.layout.size / 4),
            usage: it.UNIFORM | it.COPY_DST
        }));
        let o = null;
        return n || (n = e.buffer.data,
        o = e.buffer.dataInt32),
        r || (r = 0),
        i.syncFunction(e.uniforms, n, o, r),
        !0
    }
    updateUniformGroup(e) {
        if (e.isStatic && !e._dirtyId)
            return !1;
        e._dirtyId = 0;
        const n = this.syncUniformGroup(e);
        return e.buffer.update(),
        n
    }
    destroy() {
        this._syncFunctionHash = null
    }
}
const Ck = {
    f32: 4,
    i32: 4,
    "vec2<f32>": 8,
    "vec3<f32>": 12,
    "vec4<f32>": 16,
    "vec2<i32>": 8,
    "vec3<i32>": 12,
    "vec4<i32>": 16,
    "mat2x2<f32>": 16 * 2,
    "mat3x3<f32>": 16 * 3,
    "mat4x4<f32>": 16 * 4
};
function Jde(t) {
    const e = t.map(o => ({
        data: o,
        offset: 0,
        size: 0
    }))
      , n = 16;
    let r = 0
      , i = 0;
    for (let o = 0; o < e.length; o++) {
        const s = e[o];
        if (r = Ck[s.data.type],
        !r)
            throw new Error(`Unknown type ${s.data.type}`);
        s.data.size > 1 && (r = Math.max(r, n) * s.data.size);
        const a = r === 12 ? 16 : r;
        s.size = r;
        const l = i % n;
        l > 0 && n - l < a ? i += (n - l) % 16 : i += (r - l % r) % r,
        s.offset = i,
        i += r
    }
    return i = Math.ceil(i / 16) * 16,
    {
        uboElements: e,
        size: i
    }
}
const ja = [{
    type: "mat3x3<f32>",
    test: t => t.value.a !== void 0,
    ubo: `
            var matrix = uv[name].toArray(true);
            data[offset] = matrix[0];
            data[offset + 1] = matrix[1];
            data[offset + 2] = matrix[2];
            data[offset + 4] = matrix[3];
            data[offset + 5] = matrix[4];
            data[offset + 6] = matrix[5];
            data[offset + 8] = matrix[6];
            data[offset + 9] = matrix[7];
            data[offset + 10] = matrix[8];
        `,
    uniform: `
            gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
        `
}, {
    type: "vec4<f32>",
    test: t => t.type === "vec4<f32>" && t.size === 1 && t.value.width !== void 0,
    ubo: `
            v = uv[name];
            data[offset] = v.x;
            data[offset + 1] = v.y;
            data[offset + 2] = v.width;
            data[offset + 3] = v.height;
        `,
    uniform: `
            cv = ud[name].value;
            v = uv[name];
            if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {
                cv[0] = v.x;
                cv[1] = v.y;
                cv[2] = v.width;
                cv[3] = v.height;
                gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);
            }
        `
}, {
    type: "vec2<f32>",
    test: t => t.type === "vec2<f32>" && t.size === 1 && t.value.x !== void 0,
    ubo: `
            v = uv[name];
            data[offset] = v.x;
            data[offset + 1] = v.y;
        `,
    uniform: `
            cv = ud[name].value;
            v = uv[name];
            if (cv[0] !== v.x || cv[1] !== v.y) {
                cv[0] = v.x;
                cv[1] = v.y;
                gl.uniform2f(ud[name].location, v.x, v.y);
            }
        `
}, {
    type: "vec4<f32>",
    test: t => t.type === "vec4<f32>" && t.size === 1 && t.value.red !== void 0,
    ubo: `
            v = uv[name];
            data[offset] = v.red;
            data[offset + 1] = v.green;
            data[offset + 2] = v.blue;
            data[offset + 3] = v.alpha;
        `,
    uniform: `
            cv = ud[name].value;
            v = uv[name];
            if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {
                cv[0] = v.red;
                cv[1] = v.green;
                cv[2] = v.blue;
                cv[3] = v.alpha;
                gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);
            }
        `
}, {
    type: "vec3<f32>",
    test: t => t.type === "vec3<f32>" && t.size === 1 && t.value.red !== void 0,
    ubo: `
            v = uv[name];
            data[offset] = v.red;
            data[offset + 1] = v.green;
            data[offset + 2] = v.blue;
        `,
    uniform: `
            cv = ud[name].value;
            v = uv[name];
            if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {
                cv[0] = v.red;
                cv[1] = v.green;
                cv[2] = v.blue;
                gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
            }
        `
}];
function Ak(t, e, n, r) {
    const i = [`
        var v = null;
        var v2 = null;
        var t = 0;
        var index = 0;
        var name = null;
        var arrayOffset = null;
    `];
    let o = 0;
    for (let a = 0; a < t.length; a++) {
        const l = t[a]
          , c = l.data.name;
        let u = !1
          , f = 0;
        for (let d = 0; d < ja.length; d++)
            if (ja[d].test(l.data)) {
                f = l.offset / 4,
                i.push(`name = "${c}";`, `offset += ${f - o};`, ja[d][e] || ja[d].ubo),
                u = !0;
                break
            }
        if (!u)
            if (l.data.size > 1)
                f = l.offset / 4,
                i.push(n(l, f - o));
            else {
                const d = r[l.data.type];
                f = l.offset / 4,
                i.push(`
                    v = uv.${c};
                    offset += ${f - o};
                    ${d};
                `)
            }
        o = f
    }
    const s = i.join(`
`);
    return new Function("uv","data","dataInt32","offset",s)
}
function rc(t, e) {
    return `
        for (let i = 0; i < ${t * e}; i++) {
            data[offset + (((i / ${t})|0) * 4) + (i % ${t})] = v[i];
        }
    `
}
const Tk = {
    f32: `
        data[offset] = v;`,
    i32: `
        dataInt32[offset] = v;`,
    "vec2<f32>": `
        data[offset] = v[0];
        data[offset + 1] = v[1];`,
    "vec3<f32>": `
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 2] = v[2];`,
    "vec4<f32>": `
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 2] = v[2];
        data[offset + 3] = v[3];`,
    "vec2<i32>": `
        dataInt32[offset] = v[0];
        dataInt32[offset + 1] = v[1];`,
    "vec3<i32>": `
        dataInt32[offset] = v[0];
        dataInt32[offset + 1] = v[1];
        dataInt32[offset + 2] = v[2];`,
    "vec4<i32>": `
        dataInt32[offset] = v[0];
        dataInt32[offset + 1] = v[1];
        dataInt32[offset + 2] = v[2];
        dataInt32[offset + 3] = v[3];`,
    "mat2x2<f32>": `
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 4] = v[2];
        data[offset + 5] = v[3];`,
    "mat3x3<f32>": `
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 2] = v[2];
        data[offset + 4] = v[3];
        data[offset + 5] = v[4];
        data[offset + 6] = v[5];
        data[offset + 8] = v[6];
        data[offset + 9] = v[7];
        data[offset + 10] = v[8];`,
    "mat4x4<f32>": `
        for (let i = 0; i < 16; i++) {
            data[offset + i] = v[i];
        }`,
    "mat3x2<f32>": rc(3, 2),
    "mat4x2<f32>": rc(4, 2),
    "mat2x3<f32>": rc(2, 3),
    "mat4x3<f32>": rc(4, 3),
    "mat2x4<f32>": rc(2, 4),
    "mat3x4<f32>": rc(3, 4)
}
  , Qde = {
    ...Tk,
    "mat2x2<f32>": `
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 2] = v[2];
        data[offset + 3] = v[3];
    `
};
function ehe(t, e) {
    const n = Math.max(Ck[t.data.type] / 16, 1)
      , r = t.data.value.length / t.data.size
      , i = (4 - r % 4) % 4
      , o = t.data.type.indexOf("i32") >= 0 ? "dataInt32" : "data";
    return `
        v = uv.${t.data.name};
        offset += ${e};

        arrayOffset = offset;

        t = 0;

        for(var i=0; i < ${t.data.size * n}; i++)
        {
            for(var j = 0; j < ${r}; j++)
            {
                ${o}[arrayOffset++] = v[t++];
            }
            ${i !== 0 ? `arrayOffset += ${i};` : ""}
        }
    `
}
function the(t) {
    return Ak(t, "uboStd40", ehe, Tk)
}
class Pk extends Sk {
    constructor() {
        super({
            createUboElements: Jde,
            generateUboSync: the
        })
    }
}
Pk.extension = {
    type: [V.WebGLSystem],
    name: "ubo"
};
class nhe {
    constructor() {
        this._clearColorCache = [0, 0, 0, 0],
        this._viewPortCache = new vt
    }
    init(e, n) {
        this._renderer = e,
        this._renderTargetSystem = n,
        e.runners.contextChange.add(this)
    }
    contextChange() {
        this._clearColorCache = [0, 0, 0, 0],
        this._viewPortCache = new vt
    }
    copyToTexture(e, n, r, i, o) {
        const s = this._renderTargetSystem
          , a = this._renderer
          , l = s.getGpuRenderTarget(e)
          , c = a.gl;
        return this.finishRenderPass(e),
        c.bindFramebuffer(c.FRAMEBUFFER, l.resolveTargetFramebuffer),
        a.texture.bind(n, 0),
        c.copyTexSubImage2D(c.TEXTURE_2D, 0, o.x, o.y, r.x, r.y, i.width, i.height),
        n
    }
    startRenderPass(e, n=!0, r, i) {
        const o = this._renderTargetSystem
          , s = e.colorTexture
          , a = o.getGpuRenderTarget(e);
        let l = i.y;
        e.isRoot && (l = s.pixelHeight - i.height),
        e.colorTextures.forEach(f => {
            this._renderer.texture.unbind(f)
        }
        );
        const c = this._renderer.gl;
        c.bindFramebuffer(c.FRAMEBUFFER, a.framebuffer);
        const u = this._viewPortCache;
        (u.x !== i.x || u.y !== l || u.width !== i.width || u.height !== i.height) && (u.x = i.x,
        u.y = l,
        u.width = i.width,
        u.height = i.height,
        c.viewport(i.x, l, i.width, i.height)),
        !a.depthStencilRenderBuffer && (e.stencil || e.depth) && this._initStencil(a),
        this.clear(e, n, r)
    }
    finishRenderPass(e) {
        const r = this._renderTargetSystem.getGpuRenderTarget(e);
        if (!r.msaa)
            return;
        const i = this._renderer.gl;
        i.bindFramebuffer(i.FRAMEBUFFER, r.resolveTargetFramebuffer),
        i.bindFramebuffer(i.READ_FRAMEBUFFER, r.framebuffer),
        i.blitFramebuffer(0, 0, r.width, r.height, 0, 0, r.width, r.height, i.COLOR_BUFFER_BIT, i.NEAREST),
        i.bindFramebuffer(i.FRAMEBUFFER, r.framebuffer)
    }
    initGpuRenderTarget(e) {
        const r = this._renderer.gl
          , i = new Zde;
        return e.colorTexture instanceof lo ? (this._renderer.context.ensureCanvasSize(e.colorTexture.resource),
        i.framebuffer = null,
        i) : (this._initColor(e, i),
        r.bindFramebuffer(r.FRAMEBUFFER, null),
        i)
    }
    destroyGpuRenderTarget(e) {
        const n = this._renderer.gl;
        e.framebuffer && (n.deleteFramebuffer(e.framebuffer),
        e.framebuffer = null),
        e.resolveTargetFramebuffer && (n.deleteFramebuffer(e.resolveTargetFramebuffer),
        e.resolveTargetFramebuffer = null),
        e.depthStencilRenderBuffer && (n.deleteRenderbuffer(e.depthStencilRenderBuffer),
        e.depthStencilRenderBuffer = null),
        e.msaaRenderBuffer.forEach(r => {
            n.deleteRenderbuffer(r)
        }
        ),
        e.msaaRenderBuffer = null
    }
    clear(e, n, r) {
        if (!n)
            return;
        const i = this._renderTargetSystem;
        typeof n == "boolean" && (n = n ? Ur.ALL : Ur.NONE);
        const o = this._renderer.gl;
        if (n & Ur.COLOR) {
            r ?? (r = i.defaultClearColor);
            const s = this._clearColorCache
              , a = r;
            (s[0] !== a[0] || s[1] !== a[1] || s[2] !== a[2] || s[3] !== a[3]) && (s[0] = a[0],
            s[1] = a[1],
            s[2] = a[2],
            s[3] = a[3],
            o.clearColor(a[0], a[1], a[2], a[3]))
        }
        o.clear(n)
    }
    resizeGpuRenderTarget(e) {
        if (e.isRoot)
            return;
        const r = this._renderTargetSystem.getGpuRenderTarget(e);
        this._resizeColor(e, r),
        (e.stencil || e.depth) && this._resizeStencil(r)
    }
    _initColor(e, n) {
        const r = this._renderer
          , i = r.gl
          , o = i.createFramebuffer();
        if (n.resolveTargetFramebuffer = o,
        i.bindFramebuffer(i.FRAMEBUFFER, o),
        n.width = e.colorTexture.source.pixelWidth,
        n.height = e.colorTexture.source.pixelHeight,
        e.colorTextures.forEach( (s, a) => {
            const l = s.source;
            l.antialias && (r.context.supports.msaa ? n.msaa = !0 : Ne("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),
            r.texture.bindSource(l, 0);
            const u = r.texture.getGlSource(l).texture;
            i.framebufferTexture2D(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + a, 3553, u, 0)
        }
        ),
        n.msaa) {
            const s = i.createFramebuffer();
            n.framebuffer = s,
            i.bindFramebuffer(i.FRAMEBUFFER, s),
            e.colorTextures.forEach( (a, l) => {
                const c = i.createRenderbuffer();
                n.msaaRenderBuffer[l] = c
            }
            )
        } else
            n.framebuffer = o;
        this._resizeColor(e, n)
    }
    _resizeColor(e, n) {
        const r = e.colorTexture.source;
        if (n.width = r.pixelWidth,
        n.height = r.pixelHeight,
        e.colorTextures.forEach( (i, o) => {
            o !== 0 && i.source.resize(r.width, r.height, r._resolution)
        }
        ),
        n.msaa) {
            const i = this._renderer
              , o = i.gl
              , s = n.framebuffer;
            o.bindFramebuffer(o.FRAMEBUFFER, s),
            e.colorTextures.forEach( (a, l) => {
                const c = a.source;
                i.texture.bindSource(c, 0);
                const f = i.texture.getGlSource(c).internalFormat
                  , d = n.msaaRenderBuffer[l];
                o.bindRenderbuffer(o.RENDERBUFFER, d),
                o.renderbufferStorageMultisample(o.RENDERBUFFER, 4, f, c.pixelWidth, c.pixelHeight),
                o.framebufferRenderbuffer(o.FRAMEBUFFER, o.COLOR_ATTACHMENT0 + l, o.RENDERBUFFER, d)
            }
            )
        }
    }
    _initStencil(e) {
        if (e.framebuffer === null)
            return;
        const n = this._renderer.gl
          , r = n.createRenderbuffer();
        e.depthStencilRenderBuffer = r,
        n.bindRenderbuffer(n.RENDERBUFFER, r),
        n.framebufferRenderbuffer(n.FRAMEBUFFER, n.DEPTH_STENCIL_ATTACHMENT, n.RENDERBUFFER, r),
        this._resizeStencil(e)
    }
    _resizeStencil(e) {
        const n = this._renderer.gl;
        n.bindRenderbuffer(n.RENDERBUFFER, e.depthStencilRenderBuffer),
        e.msaa ? n.renderbufferStorageMultisample(n.RENDERBUFFER, 4, n.DEPTH24_STENCIL8, e.width, e.height) : n.renderbufferStorage(n.RENDERBUFFER, this._renderer.context.webGLVersion === 2 ? n.DEPTH24_STENCIL8 : n.DEPTH_STENCIL, e.width, e.height)
    }
    prerender(e) {
        const n = e.colorTexture.resource;
        this._renderer.context.multiView && lo.test(n) && this._renderer.context.ensureCanvasSize(n)
    }
    postrender(e) {
        if (this._renderer.context.multiView && lo.test(e.colorTexture.resource)) {
            const n = this._renderer.context.canvas
              , r = e.colorTexture;
            r.context2D.drawImage(n, 0, r.pixelHeight - n.height)
        }
    }
}
function rhe(t, e, n, r, i, o) {
    const s = o ? 1 : -1;
    return t.identity(),
    t.a = 1 / r * 2,
    t.d = s * (1 / i * 2),
    t.tx = -1 - e * t.a,
    t.ty = -s - n * t.d,
    t
}
const Yu = new Map;
function Ik(t, e) {
    if (!Yu.has(t)) {
        const n = new Ae({
            source: new lo({
                resource: t,
                ...e
            })
        })
          , r = () => {
            Yu.get(t) === n && Yu.delete(t)
        }
        ;
        n.once("destroy", r),
        n.source.once("destroy", r),
        Yu.set(t, n)
    }
    return Yu.get(t)
}
function ihe(t) {
    const e = t.colorTexture.source.resource;
    return globalThis.HTMLCanvasElement && e instanceof HTMLCanvasElement && document.body.contains(e)
}
const Ok = class Rk {
    constructor(e={}) {
        if (this.uid = Ut("renderTarget"),
        this.colorTextures = [],
        this.dirtyId = 0,
        this.isRoot = !1,
        this._size = new Float32Array(2),
        this._managedColorTextures = !1,
        e = {
            ...Rk.defaultOptions,
            ...e
        },
        this.stencil = e.stencil,
        this.depth = e.depth,
        this.isRoot = e.isRoot,
        typeof e.colorTextures == "number") {
            this._managedColorTextures = !0;
            for (let n = 0; n < e.colorTextures; n++)
                this.colorTextures.push(new Cn({
                    width: e.width,
                    height: e.height,
                    resolution: e.resolution,
                    antialias: e.antialias
                }))
        } else {
            this.colorTextures = [...e.colorTextures.map(r => r.source)];
            const n = this.colorTexture.source;
            this.resize(n.width, n.height, n._resolution)
        }
        this.colorTexture.source.on("resize", this.onSourceResize, this),
        (e.depthStencilTexture || this.stencil) && (e.depthStencilTexture instanceof Ae || e.depthStencilTexture instanceof Cn ? this.depthStencilTexture = e.depthStencilTexture.source : this.ensureDepthStencilTexture())
    }
    get size() {
        const e = this._size;
        return e[0] = this.pixelWidth,
        e[1] = this.pixelHeight,
        e
    }
    get width() {
        return this.colorTexture.source.width
    }
    get height() {
        return this.colorTexture.source.height
    }
    get pixelWidth() {
        return this.colorTexture.source.pixelWidth
    }
    get pixelHeight() {
        return this.colorTexture.source.pixelHeight
    }
    get resolution() {
        return this.colorTexture.source._resolution
    }
    get colorTexture() {
        return this.colorTextures[0]
    }
    onSourceResize(e) {
        this.resize(e.width, e.height, e._resolution, !0)
    }
    ensureDepthStencilTexture() {
        this.depthStencilTexture || (this.depthStencilTexture = new Cn({
            width: this.width,
            height: this.height,
            resolution: this.resolution,
            format: "depth24plus-stencil8",
            autoGenerateMipmaps: !1,
            antialias: !1,
            mipLevelCount: 1
        }))
    }
    resize(e, n, r=this.resolution, i=!1) {
        this.dirtyId++,
        this.colorTextures.forEach( (o, s) => {
            i && s === 0 || o.source.resize(e, n, r)
        }
        ),
        this.depthStencilTexture && this.depthStencilTexture.source.resize(e, n, r)
    }
    destroy() {
        this.colorTexture.source.off("resize", this.onSourceResize, this),
        this._managedColorTextures && this.colorTextures.forEach(e => {
            e.destroy()
        }
        ),
        this.depthStencilTexture && (this.depthStencilTexture.destroy(),
        delete this.depthStencilTexture)
    }
}
;
Ok.defaultOptions = {
    width: 0,
    height: 0,
    resolution: 1,
    colorTextures: 1,
    stencil: !1,
    depth: !1,
    antialias: !1,
    isRoot: !1
};
let Q_ = Ok;
class Mk {
    constructor(e) {
        this.rootViewPort = new vt,
        this.viewport = new vt,
        this.onRenderTargetChange = new gB("onRenderTargetChange"),
        this.projectionMatrix = new Oe,
        this.defaultClearColor = [0, 0, 0, 0],
        this._renderSurfaceToRenderTargetHash = new Map,
        this._gpuRenderTargetHash = Object.create(null),
        this._renderTargetStack = [],
        this._renderer = e,
        e.renderableGC.addManagedHash(this, "_gpuRenderTargetHash")
    }
    finishRenderPass() {
        this.adaptor.finishRenderPass(this.renderTarget)
    }
    renderStart({target: e, clear: n, clearColor: r, frame: i}) {
        var o, s;
        this._renderTargetStack.length = 0,
        this.push(e, n, r, i),
        this.rootViewPort.copyFrom(this.viewport),
        this.rootRenderTarget = this.renderTarget,
        this.renderingToScreen = ihe(this.rootRenderTarget),
        (s = (o = this.adaptor).prerender) == null || s.call(o, this.rootRenderTarget)
    }
    postrender() {
        var e, n;
        (n = (e = this.adaptor).postrender) == null || n.call(e, this.rootRenderTarget)
    }
    bind(e, n=!0, r, i) {
        const o = this.getRenderTarget(e)
          , s = this.renderTarget !== o;
        this.renderTarget = o,
        this.renderSurface = e;
        const a = this.getGpuRenderTarget(o);
        (o.pixelWidth !== a.width || o.pixelHeight !== a.height) && (this.adaptor.resizeGpuRenderTarget(o),
        a.width = o.pixelWidth,
        a.height = o.pixelHeight);
        const l = o.colorTexture
          , c = this.viewport
          , u = l.pixelWidth
          , f = l.pixelHeight;
        if (!i && e instanceof Ae && (i = e.frame),
        i) {
            const d = l._resolution;
            c.x = i.x * d + .5 | 0,
            c.y = i.y * d + .5 | 0,
            c.width = i.width * d + .5 | 0,
            c.height = i.height * d + .5 | 0
        } else
            c.x = 0,
            c.y = 0,
            c.width = u,
            c.height = f;
        return rhe(this.projectionMatrix, 0, 0, c.width / l.resolution, c.height / l.resolution, !o.isRoot),
        this.adaptor.startRenderPass(o, n, r, c),
        s && this.onRenderTargetChange.emit(o),
        o
    }
    clear(e, n=Ur.ALL, r) {
        n && (e && (e = this.getRenderTarget(e)),
        this.adaptor.clear(e || this.renderTarget, n, r, this.viewport))
    }
    contextChange() {
        this._gpuRenderTargetHash = Object.create(null)
    }
    push(e, n=Ur.ALL, r, i) {
        const o = this.bind(e, n, r, i);
        return this._renderTargetStack.push({
            renderTarget: o,
            frame: i
        }),
        o
    }
    pop() {
        this._renderTargetStack.pop();
        const e = this._renderTargetStack[this._renderTargetStack.length - 1];
        this.bind(e.renderTarget, !1, null, e.frame)
    }
    getRenderTarget(e) {
        return e.isTexture && (e = e.source),
        this._renderSurfaceToRenderTargetHash.get(e) ?? this._initRenderTarget(e)
    }
    copyToTexture(e, n, r, i, o) {
        r.x < 0 && (i.width += r.x,
        o.x -= r.x,
        r.x = 0),
        r.y < 0 && (i.height += r.y,
        o.y -= r.y,
        r.y = 0);
        const {pixelWidth: s, pixelHeight: a} = e;
        return i.width = Math.min(i.width, s - r.x),
        i.height = Math.min(i.height, a - r.y),
        this.adaptor.copyToTexture(e, n, r, i, o)
    }
    ensureDepthStencil() {
        this.renderTarget.stencil || (this.renderTarget.stencil = !0,
        this.adaptor.startRenderPass(this.renderTarget, !1, null, this.viewport))
    }
    destroy() {
        this._renderer = null,
        this._renderSurfaceToRenderTargetHash.forEach( (e, n) => {
            e !== n && e.destroy()
        }
        ),
        this._renderSurfaceToRenderTargetHash.clear(),
        this._gpuRenderTargetHash = Object.create(null)
    }
    _initRenderTarget(e) {
        let n = null;
        return lo.test(e) && (e = Ik(e).source),
        e instanceof Q_ ? n = e : e instanceof Cn && (n = new Q_({
            colorTextures: [e]
        }),
        e.source instanceof lo && (n.isRoot = !0),
        e.once("destroy", () => {
            n.destroy(),
            this._renderSurfaceToRenderTargetHash.delete(e);
            const r = this._gpuRenderTargetHash[n.uid];
            r && (this._gpuRenderTargetHash[n.uid] = null,
            this.adaptor.destroyGpuRenderTarget(r))
        }
        )),
        this._renderSurfaceToRenderTargetHash.set(e, n),
        n
    }
    getGpuRenderTarget(e) {
        return this._gpuRenderTargetHash[e.uid] || (this._gpuRenderTargetHash[e.uid] = this.adaptor.initGpuRenderTarget(e))
    }
    resetState() {
        this.renderTarget = null,
        this.renderSurface = null
    }
}
class Dk extends Mk {
    constructor(e) {
        super(e),
        this.adaptor = new nhe,
        this.adaptor.init(e, this)
    }
}
Dk.extension = {
    type: [V.WebGLSystem],
    name: "renderTarget"
};
class S2 extends Jr {
    constructor({buffer: e, offset: n, size: r}) {
        super(),
        this.uid = Ut("buffer"),
        this._resourceType = "bufferResource",
        this._touched = 0,
        this._resourceId = Ut("resource"),
        this._bufferResource = !0,
        this.destroyed = !1,
        this.buffer = e,
        this.offset = n | 0,
        this.size = r,
        this.buffer.on("change", this.onBufferChange, this)
    }
    onBufferChange() {
        this._resourceId = Ut("resource"),
        this.emit("change", this)
    }
    destroy(e=!1) {
        this.destroyed = !0,
        e && this.buffer.destroy(),
        this.emit("change", this),
        this.buffer = null
    }
}
function ohe(t, e) {
    const n = []
      , r = [`
        var g = s.groups;
        var sS = r.shader;
        var p = s.glProgram;
        var ugS = r.uniformGroup;
        var resources;
    `];
    let i = !1
      , o = 0;
    const s = e._getProgramData(t.glProgram);
    for (const l in t.groups) {
        const c = t.groups[l];
        n.push(`
            resources = g[${l}].resources;
        `);
        for (const u in c.resources) {
            const f = c.resources[u];
            if (f instanceof gr)
                if (f.ubo) {
                    const d = t._uniformBindMap[l][Number(u)];
                    n.push(`
                        sS.bindUniformBlock(
                            resources[${u}],
                            '${d}',
                            ${t.glProgram._uniformBlockData[d].index}
                        );
                    `)
                } else
                    n.push(`
                        ugS.updateUniformGroup(resources[${u}], p, sD);
                    `);
            else if (f instanceof S2) {
                const d = t._uniformBindMap[l][Number(u)];
                n.push(`
                    sS.bindUniformBlock(
                        resources[${u}],
                        '${d}',
                        ${t.glProgram._uniformBlockData[d].index}
                    );
                `)
            } else if (f instanceof Cn) {
                const d = t._uniformBindMap[l][u]
                  , h = s.uniformData[d];
                h && (i || (i = !0,
                r.push(`
                        var tS = r.texture;
                        `)),
                e._gl.uniform1i(h.location, o),
                n.push(`
                        tS.bind(resources[${u}], ${o});
                    `),
                o++)
            }
        }
    }
    const a = [...r, ...n].join(`
`);
    return new Function("r","s","sD",a)
}
class she {
    constructor(e, n) {
        this.program = e,
        this.uniformData = n,
        this.uniformGroups = {},
        this.uniformDirtyGroups = {},
        this.uniformBlockBindings = {}
    }
    destroy() {
        this.uniformData = null,
        this.uniformGroups = null,
        this.uniformDirtyGroups = null,
        this.uniformBlockBindings = null,
        this.program = null
    }
}
function v3(t, e, n) {
    const r = t.createShader(e);
    return t.shaderSource(r, n),
    t.compileShader(r),
    r
}
function Y1(t) {
    const e = new Array(t);
    for (let n = 0; n < e.length; n++)
        e[n] = !1;
    return e
}
function Bk(t, e) {
    switch (t) {
    case "float":
        return 0;
    case "vec2":
        return new Float32Array(2 * e);
    case "vec3":
        return new Float32Array(3 * e);
    case "vec4":
        return new Float32Array(4 * e);
    case "int":
    case "uint":
    case "sampler2D":
    case "sampler2DArray":
        return 0;
    case "ivec2":
        return new Int32Array(2 * e);
    case "ivec3":
        return new Int32Array(3 * e);
    case "ivec4":
        return new Int32Array(4 * e);
    case "uvec2":
        return new Uint32Array(2 * e);
    case "uvec3":
        return new Uint32Array(3 * e);
    case "uvec4":
        return new Uint32Array(4 * e);
    case "bool":
        return !1;
    case "bvec2":
        return Y1(2 * e);
    case "bvec3":
        return Y1(3 * e);
    case "bvec4":
        return Y1(4 * e);
    case "mat2":
        return new Float32Array([1, 0, 0, 1]);
    case "mat3":
        return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);
    case "mat4":
        return new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
    }
    return null
}
let up = null;
const y3 = {
    FLOAT: "float",
    FLOAT_VEC2: "vec2",
    FLOAT_VEC3: "vec3",
    FLOAT_VEC4: "vec4",
    INT: "int",
    INT_VEC2: "ivec2",
    INT_VEC3: "ivec3",
    INT_VEC4: "ivec4",
    UNSIGNED_INT: "uint",
    UNSIGNED_INT_VEC2: "uvec2",
    UNSIGNED_INT_VEC3: "uvec3",
    UNSIGNED_INT_VEC4: "uvec4",
    BOOL: "bool",
    BOOL_VEC2: "bvec2",
    BOOL_VEC3: "bvec3",
    BOOL_VEC4: "bvec4",
    FLOAT_MAT2: "mat2",
    FLOAT_MAT3: "mat3",
    FLOAT_MAT4: "mat4",
    SAMPLER_2D: "sampler2D",
    INT_SAMPLER_2D: "sampler2D",
    UNSIGNED_INT_SAMPLER_2D: "sampler2D",
    SAMPLER_CUBE: "samplerCube",
    INT_SAMPLER_CUBE: "samplerCube",
    UNSIGNED_INT_SAMPLER_CUBE: "samplerCube",
    SAMPLER_2D_ARRAY: "sampler2DArray",
    INT_SAMPLER_2D_ARRAY: "sampler2DArray",
    UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
}
  , ahe = {
    float: "float32",
    vec2: "float32x2",
    vec3: "float32x3",
    vec4: "float32x4",
    int: "sint32",
    ivec2: "sint32x2",
    ivec3: "sint32x3",
    ivec4: "sint32x4",
    uint: "uint32",
    uvec2: "uint32x2",
    uvec3: "uint32x3",
    uvec4: "uint32x4",
    bool: "uint32",
    bvec2: "uint32x2",
    bvec3: "uint32x3",
    bvec4: "uint32x4"
};
function kk(t, e) {
    if (!up) {
        const n = Object.keys(y3);
        up = {};
        for (let r = 0; r < n.length; ++r) {
            const i = n[r];
            up[t[i]] = y3[i]
        }
    }
    return up[e]
}
function lhe(t, e) {
    const n = kk(t, e);
    return ahe[n] || "float32"
}
function che(t, e, n=!1) {
    const r = {}
      , i = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES);
    for (let s = 0; s < i; s++) {
        const a = e.getActiveAttrib(t, s);
        if (a.name.startsWith("gl_"))
            continue;
        const l = lhe(e, a.type);
        r[a.name] = {
            location: 0,
            format: l,
            stride: oa(l).stride,
            offset: 0,
            instance: !1,
            start: 0
        }
    }
    const o = Object.keys(r);
    if (n) {
        o.sort( (s, a) => s > a ? 1 : -1);
        for (let s = 0; s < o.length; s++)
            r[o[s]].location = s,
            e.bindAttribLocation(t, s, o[s]);
        e.linkProgram(t)
    } else
        for (let s = 0; s < o.length; s++)
            r[o[s]].location = e.getAttribLocation(t, o[s]);
    return r
}
function uhe(t, e) {
    if (!e.ACTIVE_UNIFORM_BLOCKS)
        return {};
    const n = {}
      , r = e.getProgramParameter(t, e.ACTIVE_UNIFORM_BLOCKS);
    for (let i = 0; i < r; i++) {
        const o = e.getActiveUniformBlockName(t, i)
          , s = e.getUniformBlockIndex(t, o)
          , a = e.getActiveUniformBlockParameter(t, i, e.UNIFORM_BLOCK_DATA_SIZE);
        n[o] = {
            name: o,
            index: s,
            size: a
        }
    }
    return n
}
function fhe(t, e) {
    const n = {}
      , r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS);
    for (let i = 0; i < r; i++) {
        const o = e.getActiveUniform(t, i)
          , s = o.name.replace(/\[.*?\]$/, "")
          , a = !!o.name.match(/\[.*?\]$/)
          , l = kk(e, o.type);
        n[s] = {
            name: s,
            index: i,
            type: l,
            size: o.size,
            isArray: a,
            value: Bk(l, o.size)
        }
    }
    return n
}
function _3(t, e) {
    const n = t.getShaderSource(e).split(`
`).map( (c, u) => `${u}: ${c}`)
      , r = t.getShaderInfoLog(e)
      , i = r.split(`
`)
      , o = {}
      , s = i.map(c => parseFloat(c.replace(/^ERROR\: 0\:([\d]+)\:.*$/, "$1"))).filter(c => c && !o[c] ? (o[c] = !0,
    !0) : !1)
      , a = [""];
    s.forEach(c => {
        n[c - 1] = `%c${n[c - 1]}%c`,
        a.push("background: #FF0000; color:#FFFFFF; font-size: 10px", "font-size: 10px")
    }
    );
    const l = n.join(`
`);
    a[0] = l,
    console.error(r),
    console.groupCollapsed("click to view full shader code"),
    console.warn(...a),
    console.groupEnd()
}
function dhe(t, e, n, r) {
    t.getProgramParameter(e, t.LINK_STATUS) || (t.getShaderParameter(n, t.COMPILE_STATUS) || _3(t, n),
    t.getShaderParameter(r, t.COMPILE_STATUS) || _3(t, r),
    console.error("PixiJS Error: Could not initialize shader."),
    t.getProgramInfoLog(e) !== "" && console.warn("PixiJS Warning: gl.getProgramInfoLog()", t.getProgramInfoLog(e)))
}
function hhe(t, e) {
    const n = v3(t, t.VERTEX_SHADER, e.vertex)
      , r = v3(t, t.FRAGMENT_SHADER, e.fragment)
      , i = t.createProgram();
    t.attachShader(i, n),
    t.attachShader(i, r);
    const o = e.transformFeedbackVaryings;
    o && (typeof t.transformFeedbackVaryings != "function" ? Ne("TransformFeedback is not supported but TransformFeedbackVaryings are given.") : t.transformFeedbackVaryings(i, o.names, o.bufferMode === "separate" ? t.SEPARATE_ATTRIBS : t.INTERLEAVED_ATTRIBS)),
    t.linkProgram(i),
    t.getProgramParameter(i, t.LINK_STATUS) || dhe(t, i, n, r),
    e._attributeData = che(i, t, !/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),
    e._uniformData = fhe(i, t),
    e._uniformBlockData = uhe(i, t),
    t.deleteShader(n),
    t.deleteShader(r);
    const s = {};
    for (const l in e._uniformData) {
        const c = e._uniformData[l];
        s[l] = {
            location: t.getUniformLocation(i, l),
            value: Bk(c.type, c.size)
        }
    }
    return new she(i,s)
}
const fp = {
    textureCount: 0,
    blockIndex: 0
};
class Nk {
    constructor(e) {
        this._activeProgram = null,
        this._programDataHash = Object.create(null),
        this._shaderSyncFunctions = Object.create(null),
        this._renderer = e,
        this._renderer.renderableGC.addManagedHash(this, "_programDataHash")
    }
    contextChange(e) {
        this._gl = e,
        this._programDataHash = Object.create(null),
        this._shaderSyncFunctions = Object.create(null),
        this._activeProgram = null
    }
    bind(e, n) {
        if (this._setProgram(e.glProgram),
        n)
            return;
        fp.textureCount = 0,
        fp.blockIndex = 0;
        let r = this._shaderSyncFunctions[e.glProgram._key];
        r || (r = this._shaderSyncFunctions[e.glProgram._key] = this._generateShaderSync(e, this)),
        this._renderer.buffer.nextBindBase(!!e.glProgram.transformFeedbackVaryings),
        r(this._renderer, e, fp)
    }
    updateUniformGroup(e) {
        this._renderer.uniformGroup.updateUniformGroup(e, this._activeProgram, fp)
    }
    bindUniformBlock(e, n, r=0) {
        const i = this._renderer.buffer
          , o = this._getProgramData(this._activeProgram)
          , s = e._bufferResource;
        s || this._renderer.ubo.updateUniformGroup(e);
        const a = e.buffer
          , l = i.updateBuffer(a)
          , c = i.freeLocationForBufferBase(l);
        if (s) {
            const {offset: f, size: d} = e;
            f === 0 && d === a.data.byteLength ? i.bindBufferBase(l, c) : i.bindBufferRange(l, c, f)
        } else
            i.getLastBindBaseLocation(l) !== c && i.bindBufferBase(l, c);
        const u = this._activeProgram._uniformBlockData[n].index;
        o.uniformBlockBindings[r] !== c && (o.uniformBlockBindings[r] = c,
        this._renderer.gl.uniformBlockBinding(o.program, u, c))
    }
    _setProgram(e) {
        if (this._activeProgram === e)
            return;
        this._activeProgram = e;
        const n = this._getProgramData(e);
        this._gl.useProgram(n.program)
    }
    _getProgramData(e) {
        return this._programDataHash[e._key] || this._createProgramData(e)
    }
    _createProgramData(e) {
        const n = e._key;
        return this._programDataHash[n] = hhe(this._gl, e),
        this._programDataHash[n]
    }
    destroy() {
        for (const e of Object.keys(this._programDataHash))
            this._programDataHash[e].destroy(),
            this._programDataHash[e] = null;
        this._programDataHash = null
    }
    _generateShaderSync(e, n) {
        return ohe(e, n)
    }
    resetState() {
        this._activeProgram = null
    }
}
Nk.extension = {
    type: [V.WebGLSystem],
    name: "shader"
};
const phe = {
    f32: `if (cv !== v) {
            cu.value = v;
            gl.uniform1f(location, v);
        }`,
    "vec2<f32>": `if (cv[0] !== v[0] || cv[1] !== v[1]) {
            cv[0] = v[0];
            cv[1] = v[1];
            gl.uniform2f(location, v[0], v[1]);
        }`,
    "vec3<f32>": `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
            cv[0] = v[0];
            cv[1] = v[1];
            cv[2] = v[2];
            gl.uniform3f(location, v[0], v[1], v[2]);
        }`,
    "vec4<f32>": `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
            cv[0] = v[0];
            cv[1] = v[1];
            cv[2] = v[2];
            cv[3] = v[3];
            gl.uniform4f(location, v[0], v[1], v[2], v[3]);
        }`,
    i32: `if (cv !== v) {
            cu.value = v;
            gl.uniform1i(location, v);
        }`,
    "vec2<i32>": `if (cv[0] !== v[0] || cv[1] !== v[1]) {
            cv[0] = v[0];
            cv[1] = v[1];
            gl.uniform2i(location, v[0], v[1]);
        }`,
    "vec3<i32>": `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
            cv[0] = v[0];
            cv[1] = v[1];
            cv[2] = v[2];
            gl.uniform3i(location, v[0], v[1], v[2]);
        }`,
    "vec4<i32>": `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
            cv[0] = v[0];
            cv[1] = v[1];
            cv[2] = v[2];
            cv[3] = v[3];
            gl.uniform4i(location, v[0], v[1], v[2], v[3]);
        }`,
    u32: `if (cv !== v) {
            cu.value = v;
            gl.uniform1ui(location, v);
        }`,
    "vec2<u32>": `if (cv[0] !== v[0] || cv[1] !== v[1]) {
            cv[0] = v[0];
            cv[1] = v[1];
            gl.uniform2ui(location, v[0], v[1]);
        }`,
    "vec3<u32>": `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
            cv[0] = v[0];
            cv[1] = v[1];
            cv[2] = v[2];
            gl.uniform3ui(location, v[0], v[1], v[2]);
        }`,
    "vec4<u32>": `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
            cv[0] = v[0];
            cv[1] = v[1];
            cv[2] = v[2];
            cv[3] = v[3];
            gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
        }`,
    bool: `if (cv !== v) {
            cu.value = v;
            gl.uniform1i(location, v);
        }`,
    "vec2<bool>": `if (cv[0] !== v[0] || cv[1] !== v[1]) {
            cv[0] = v[0];
            cv[1] = v[1];
            gl.uniform2i(location, v[0], v[1]);
        }`,
    "vec3<bool>": `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
            cv[0] = v[0];
            cv[1] = v[1];
            cv[2] = v[2];
            gl.uniform3i(location, v[0], v[1], v[2]);
        }`,
    "vec4<bool>": `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
            cv[0] = v[0];
            cv[1] = v[1];
            cv[2] = v[2];
            cv[3] = v[3];
            gl.uniform4i(location, v[0], v[1], v[2], v[3]);
        }`,
    "mat2x2<f32>": "gl.uniformMatrix2fv(location, false, v);",
    "mat3x3<f32>": "gl.uniformMatrix3fv(location, false, v);",
    "mat4x4<f32>": "gl.uniformMatrix4fv(location, false, v);"
}
  , ghe = {
    f32: "gl.uniform1fv(location, v);",
    "vec2<f32>": "gl.uniform2fv(location, v);",
    "vec3<f32>": "gl.uniform3fv(location, v);",
    "vec4<f32>": "gl.uniform4fv(location, v);",
    "mat2x2<f32>": "gl.uniformMatrix2fv(location, false, v);",
    "mat3x3<f32>": "gl.uniformMatrix3fv(location, false, v);",
    "mat4x4<f32>": "gl.uniformMatrix4fv(location, false, v);",
    i32: "gl.uniform1iv(location, v);",
    "vec2<i32>": "gl.uniform2iv(location, v);",
    "vec3<i32>": "gl.uniform3iv(location, v);",
    "vec4<i32>": "gl.uniform4iv(location, v);",
    u32: "gl.uniform1iv(location, v);",
    "vec2<u32>": "gl.uniform2iv(location, v);",
    "vec3<u32>": "gl.uniform3iv(location, v);",
    "vec4<u32>": "gl.uniform4iv(location, v);",
    bool: "gl.uniform1iv(location, v);",
    "vec2<bool>": "gl.uniform2iv(location, v);",
    "vec3<bool>": "gl.uniform3iv(location, v);",
    "vec4<bool>": "gl.uniform4iv(location, v);"
};
function mhe(t, e) {
    const n = [`
        var v = null;
        var cv = null;
        var cu = null;
        var t = 0;
        var gl = renderer.gl;
        var name = null;
    `];
    for (const r in t.uniforms) {
        if (!e[r]) {
            t.uniforms[r]instanceof gr ? t.uniforms[r].ubo ? n.push(`
                        renderer.shader.bindUniformBlock(uv.${r}, "${r}");
                    `) : n.push(`
                        renderer.shader.updateUniformGroup(uv.${r});
                    `) : t.uniforms[r]instanceof S2 && n.push(`
                        renderer.shader.bindBufferResource(uv.${r}, "${r}");
                    `);
            continue
        }
        const i = t.uniformStructures[r];
        let o = !1;
        for (let s = 0; s < ja.length; s++) {
            const a = ja[s];
            if (i.type === a.type && a.test(i)) {
                n.push(`name = "${r}";`, ja[s].uniform),
                o = !0;
                break
            }
        }
        if (!o) {
            const a = (i.size === 1 ? phe : ghe)[i.type].replace("location", `ud["${r}"].location`);
            n.push(`
            cu = ud["${r}"];
            cv = cu.value;
            v = uv["${r}"];
            ${a};`)
        }
    }
    return new Function("ud","uv","renderer","syncData",n.join(`
`))
}
class Fk {
    constructor(e) {
        this._cache = {},
        this._uniformGroupSyncHash = {},
        this._renderer = e,
        this.gl = null,
        this._cache = {}
    }
    contextChange(e) {
        this.gl = e
    }
    updateUniformGroup(e, n, r) {
        const i = this._renderer.shader._getProgramData(n);
        (!e.isStatic || e._dirtyId !== i.uniformDirtyGroups[e.uid]) && (i.uniformDirtyGroups[e.uid] = e._dirtyId,
        this._getUniformSyncFunction(e, n)(i.uniformData, e.uniforms, this._renderer, r))
    }
    _getUniformSyncFunction(e, n) {
        var r;
        return ((r = this._uniformGroupSyncHash[e._signature]) == null ? void 0 : r[n._key]) || this._createUniformSyncFunction(e, n)
    }
    _createUniformSyncFunction(e, n) {
        const r = this._uniformGroupSyncHash[e._signature] || (this._uniformGroupSyncHash[e._signature] = {})
          , i = this._getSignature(e, n._uniformData, "u");
        return this._cache[i] || (this._cache[i] = this._generateUniformsSync(e, n._uniformData)),
        r[n._key] = this._cache[i],
        r[n._key]
    }
    _generateUniformsSync(e, n) {
        return mhe(e, n)
    }
    _getSignature(e, n, r) {
        const i = e.uniforms
          , o = [`${r}-`];
        for (const s in i)
            o.push(s),
            n[s] && o.push(n[s].type);
        return o.join("-")
    }
    destroy() {
        this._renderer = null,
        this._cache = null
    }
}
Fk.extension = {
    type: [V.WebGLSystem],
    name: "uniformGroup"
};
function vhe(t) {
    const e = {};
    if (e.normal = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
    e.add = [t.ONE, t.ONE],
    e.multiply = [t.DST_COLOR, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA],
    e.screen = [t.ONE, t.ONE_MINUS_SRC_COLOR, t.ONE, t.ONE_MINUS_SRC_ALPHA],
    e.none = [0, 0],
    e["normal-npm"] = [t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA],
    e["add-npm"] = [t.SRC_ALPHA, t.ONE, t.ONE, t.ONE],
    e["screen-npm"] = [t.SRC_ALPHA, t.ONE_MINUS_SRC_COLOR, t.ONE, t.ONE_MINUS_SRC_ALPHA],
    e.erase = [t.ZERO, t.ONE_MINUS_SRC_ALPHA],
    !(t instanceof je.get().getWebGLRenderingContext()))
        e.min = [t.ONE, t.ONE, t.ONE, t.ONE, t.MIN, t.MIN],
        e.max = [t.ONE, t.ONE, t.ONE, t.ONE, t.MAX, t.MAX];
    else {
        const r = t.getExtension("EXT_blend_minmax");
        r && (e.min = [t.ONE, t.ONE, t.ONE, t.ONE, r.MIN_EXT, r.MIN_EXT],
        e.max = [t.ONE, t.ONE, t.ONE, t.ONE, r.MAX_EXT, r.MAX_EXT])
    }
    return e
}
const yhe = 0
  , _he = 1
  , xhe = 2
  , bhe = 3
  , whe = 4
  , Ehe = 5
  , Lk = class ex {
    constructor(e) {
        this._invertFrontFace = !1,
        this.gl = null,
        this.stateId = 0,
        this.polygonOffset = 0,
        this.blendMode = "none",
        this._blendEq = !1,
        this.map = [],
        this.map[yhe] = this.setBlend,
        this.map[_he] = this.setOffset,
        this.map[xhe] = this.setCullFace,
        this.map[bhe] = this.setDepthTest,
        this.map[whe] = this.setFrontFace,
        this.map[Ehe] = this.setDepthMask,
        this.checks = [],
        this.defaultState = $i.for2d(),
        e.renderTarget.onRenderTargetChange.add(this)
    }
    onRenderTargetChange(e) {
        this._invertFrontFace = !e.isRoot,
        this._cullFace ? this.setFrontFace(this._frontFace) : this._frontFaceDirty = !0
    }
    contextChange(e) {
        this.gl = e,
        this.blendModesMap = vhe(e),
        this.resetState()
    }
    set(e) {
        if (e || (e = this.defaultState),
        this.stateId !== e.data) {
            let n = this.stateId ^ e.data
              , r = 0;
            for (; n; )
                n & 1 && this.map[r].call(this, !!(e.data & 1 << r)),
                n >>= 1,
                r++;
            this.stateId = e.data
        }
        for (let n = 0; n < this.checks.length; n++)
            this.checks[n](this, e)
    }
    forceState(e) {
        e || (e = this.defaultState);
        for (let n = 0; n < this.map.length; n++)
            this.map[n].call(this, !!(e.data & 1 << n));
        for (let n = 0; n < this.checks.length; n++)
            this.checks[n](this, e);
        this.stateId = e.data
    }
    setBlend(e) {
        this._updateCheck(ex._checkBlendMode, e),
        this.gl[e ? "enable" : "disable"](this.gl.BLEND)
    }
    setOffset(e) {
        this._updateCheck(ex._checkPolygonOffset, e),
        this.gl[e ? "enable" : "disable"](this.gl.POLYGON_OFFSET_FILL)
    }
    setDepthTest(e) {
        this.gl[e ? "enable" : "disable"](this.gl.DEPTH_TEST)
    }
    setDepthMask(e) {
        this.gl.depthMask(e)
    }
    setCullFace(e) {
        this._cullFace = e,
        this.gl[e ? "enable" : "disable"](this.gl.CULL_FACE),
        this._cullFace && this._frontFaceDirty && this.setFrontFace(this._frontFace)
    }
    setFrontFace(e) {
        this._frontFace = e,
        this._frontFaceDirty = !1;
        const n = this._invertFrontFace ? !e : e;
        this._glFrontFace !== n && (this._glFrontFace = n,
        this.gl.frontFace(this.gl[n ? "CW" : "CCW"]))
    }
    setBlendMode(e) {
        if (this.blendModesMap[e] || (e = "normal"),
        e === this.blendMode)
            return;
        this.blendMode = e;
        const n = this.blendModesMap[e]
          , r = this.gl;
        n.length === 2 ? r.blendFunc(n[0], n[1]) : r.blendFuncSeparate(n[0], n[1], n[2], n[3]),
        n.length === 6 ? (this._blendEq = !0,
        r.blendEquationSeparate(n[4], n[5])) : this._blendEq && (this._blendEq = !1,
        r.blendEquationSeparate(r.FUNC_ADD, r.FUNC_ADD))
    }
    setPolygonOffset(e, n) {
        this.gl.polygonOffset(e, n)
    }
    resetState() {
        this._glFrontFace = !1,
        this._frontFace = !1,
        this._cullFace = !1,
        this._frontFaceDirty = !1,
        this._invertFrontFace = !1,
        this.gl.frontFace(this.gl.CCW),
        this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, !1),
        this.forceState(this.defaultState),
        this._blendEq = !0,
        this.blendMode = "",
        this.setBlendMode("normal")
    }
    _updateCheck(e, n) {
        const r = this.checks.indexOf(e);
        n && r === -1 ? this.checks.push(e) : !n && r !== -1 && this.checks.splice(r, 1)
    }
    static _checkBlendMode(e, n) {
        e.setBlendMode(n.blendMode)
    }
    static _checkPolygonOffset(e, n) {
        e.setPolygonOffset(1, n.polygonOffset)
    }
    destroy() {
        this.gl = null,
        this.checks.length = 0
    }
}
;
Lk.extension = {
    type: [V.WebGLSystem],
    name: "state"
};
let She = Lk;
class Che {
    constructor(e) {
        this.target = vk.TEXTURE_2D,
        this.texture = e,
        this.width = -1,
        this.height = -1,
        this.type = ut.UNSIGNED_BYTE,
        this.internalFormat = J_.RGBA,
        this.format = J_.RGBA,
        this.samplerType = 0
    }
}
const Ahe = {
    id: "buffer",
    upload(t, e, n) {
        e.width === t.width || e.height === t.height ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.width, t.height, e.format, e.type, t.resource) : n.texImage2D(e.target, 0, e.internalFormat, t.width, t.height, 0, e.format, e.type, t.resource),
        e.width = t.width,
        e.height = t.height
    }
}
  , The = {
    "bc1-rgba-unorm": !0,
    "bc1-rgba-unorm-srgb": !0,
    "bc2-rgba-unorm": !0,
    "bc2-rgba-unorm-srgb": !0,
    "bc3-rgba-unorm": !0,
    "bc3-rgba-unorm-srgb": !0,
    "bc4-r-unorm": !0,
    "bc4-r-snorm": !0,
    "bc5-rg-unorm": !0,
    "bc5-rg-snorm": !0,
    "bc6h-rgb-ufloat": !0,
    "bc6h-rgb-float": !0,
    "bc7-rgba-unorm": !0,
    "bc7-rgba-unorm-srgb": !0,
    "etc2-rgb8unorm": !0,
    "etc2-rgb8unorm-srgb": !0,
    "etc2-rgb8a1unorm": !0,
    "etc2-rgb8a1unorm-srgb": !0,
    "etc2-rgba8unorm": !0,
    "etc2-rgba8unorm-srgb": !0,
    "eac-r11unorm": !0,
    "eac-r11snorm": !0,
    "eac-rg11unorm": !0,
    "eac-rg11snorm": !0,
    "astc-4x4-unorm": !0,
    "astc-4x4-unorm-srgb": !0,
    "astc-5x4-unorm": !0,
    "astc-5x4-unorm-srgb": !0,
    "astc-5x5-unorm": !0,
    "astc-5x5-unorm-srgb": !0,
    "astc-6x5-unorm": !0,
    "astc-6x5-unorm-srgb": !0,
    "astc-6x6-unorm": !0,
    "astc-6x6-unorm-srgb": !0,
    "astc-8x5-unorm": !0,
    "astc-8x5-unorm-srgb": !0,
    "astc-8x6-unorm": !0,
    "astc-8x6-unorm-srgb": !0,
    "astc-8x8-unorm": !0,
    "astc-8x8-unorm-srgb": !0,
    "astc-10x5-unorm": !0,
    "astc-10x5-unorm-srgb": !0,
    "astc-10x6-unorm": !0,
    "astc-10x6-unorm-srgb": !0,
    "astc-10x8-unorm": !0,
    "astc-10x8-unorm-srgb": !0,
    "astc-10x10-unorm": !0,
    "astc-10x10-unorm-srgb": !0,
    "astc-12x10-unorm": !0,
    "astc-12x10-unorm-srgb": !0,
    "astc-12x12-unorm": !0,
    "astc-12x12-unorm-srgb": !0
}
  , Phe = {
    id: "compressed",
    upload(t, e, n) {
        n.pixelStorei(n.UNPACK_ALIGNMENT, 4);
        let r = t.pixelWidth
          , i = t.pixelHeight;
        const o = !!The[t.format];
        for (let s = 0; s < t.resource.length; s++) {
            const a = t.resource[s];
            o ? n.compressedTexImage2D(n.TEXTURE_2D, s, e.internalFormat, r, i, 0, a) : n.texImage2D(n.TEXTURE_2D, s, e.internalFormat, r, i, 0, e.format, e.type, a),
            r = Math.max(r >> 1, 1),
            i = Math.max(i >> 1, 1)
        }
    }
}
  , $k = {
    id: "image",
    upload(t, e, n, r) {
        const i = e.width
          , o = e.height
          , s = t.pixelWidth
          , a = t.pixelHeight
          , l = t.resourceWidth
          , c = t.resourceHeight;
        l < s || c < a ? ((i !== s || o !== a) && n.texImage2D(e.target, 0, e.internalFormat, s, a, 0, e.format, e.type, null),
        r === 2 ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, l, c, e.format, e.type, t.resource) : n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, e.format, e.type, t.resource)) : i === s && o === a ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, e.format, e.type, t.resource) : r === 2 ? n.texImage2D(e.target, 0, e.internalFormat, s, a, 0, e.format, e.type, t.resource) : n.texImage2D(e.target, 0, e.internalFormat, e.format, e.type, t.resource),
        e.width = s,
        e.height = a
    }
}
  , Ihe = {
    id: "video",
    upload(t, e, n, r) {
        if (!t.isValid) {
            n.texImage2D(e.target, 0, e.internalFormat, 1, 1, 0, e.format, e.type, null);
            return
        }
        $k.upload(t, e, n, r)
    }
}
  , x3 = {
    linear: 9729,
    nearest: 9728
}
  , Ohe = {
    linear: {
        linear: 9987,
        nearest: 9985
    },
    nearest: {
        linear: 9986,
        nearest: 9984
    }
}
  , X1 = {
    "clamp-to-edge": 33071,
    repeat: 10497,
    "mirror-repeat": 33648
}
  , Rhe = {
    never: 512,
    less: 513,
    equal: 514,
    "less-equal": 515,
    greater: 516,
    "not-equal": 517,
    "greater-equal": 518,
    always: 519
};
function b3(t, e, n, r, i, o, s, a) {
    const l = o;
    if (!a || t.addressModeU !== "repeat" || t.addressModeV !== "repeat" || t.addressModeW !== "repeat") {
        const c = X1[s ? "clamp-to-edge" : t.addressModeU]
          , u = X1[s ? "clamp-to-edge" : t.addressModeV]
          , f = X1[s ? "clamp-to-edge" : t.addressModeW];
        e[i](l, e.TEXTURE_WRAP_S, c),
        e[i](l, e.TEXTURE_WRAP_T, u),
        e.TEXTURE_WRAP_R && e[i](l, e.TEXTURE_WRAP_R, f)
    }
    if ((!a || t.magFilter !== "linear") && e[i](l, e.TEXTURE_MAG_FILTER, x3[t.magFilter]),
    n) {
        if (!a || t.mipmapFilter !== "linear") {
            const c = Ohe[t.minFilter][t.mipmapFilter];
            e[i](l, e.TEXTURE_MIN_FILTER, c)
        }
    } else
        e[i](l, e.TEXTURE_MIN_FILTER, x3[t.minFilter]);
    if (r && t.maxAnisotropy > 1) {
        const c = Math.min(t.maxAnisotropy, e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
        e[i](l, r.TEXTURE_MAX_ANISOTROPY_EXT, c)
    }
    t.compare && e[i](l, e.TEXTURE_COMPARE_FUNC, Rhe[t.compare])
}
function Mhe(t) {
    return {
        r8unorm: t.RED,
        r8snorm: t.RED,
        r8uint: t.RED,
        r8sint: t.RED,
        r16uint: t.RED,
        r16sint: t.RED,
        r16float: t.RED,
        rg8unorm: t.RG,
        rg8snorm: t.RG,
        rg8uint: t.RG,
        rg8sint: t.RG,
        r32uint: t.RED,
        r32sint: t.RED,
        r32float: t.RED,
        rg16uint: t.RG,
        rg16sint: t.RG,
        rg16float: t.RG,
        rgba8unorm: t.RGBA,
        "rgba8unorm-srgb": t.RGBA,
        rgba8snorm: t.RGBA,
        rgba8uint: t.RGBA,
        rgba8sint: t.RGBA,
        bgra8unorm: t.RGBA,
        "bgra8unorm-srgb": t.RGBA,
        rgb9e5ufloat: t.RGB,
        rgb10a2unorm: t.RGBA,
        rg11b10ufloat: t.RGB,
        rg32uint: t.RG,
        rg32sint: t.RG,
        rg32float: t.RG,
        rgba16uint: t.RGBA,
        rgba16sint: t.RGBA,
        rgba16float: t.RGBA,
        rgba32uint: t.RGBA,
        rgba32sint: t.RGBA,
        rgba32float: t.RGBA,
        stencil8: t.STENCIL_INDEX8,
        depth16unorm: t.DEPTH_COMPONENT,
        depth24plus: t.DEPTH_COMPONENT,
        "depth24plus-stencil8": t.DEPTH_STENCIL,
        depth32float: t.DEPTH_COMPONENT,
        "depth32float-stencil8": t.DEPTH_STENCIL
    }
}
function Dhe(t, e) {
    let n = {}
      , r = t.RGBA;
    return t instanceof je.get().getWebGLRenderingContext() ? e.srgb && (n = {
        "rgba8unorm-srgb": e.srgb.SRGB8_ALPHA8_EXT,
        "bgra8unorm-srgb": e.srgb.SRGB8_ALPHA8_EXT
    }) : (n = {
        "rgba8unorm-srgb": t.SRGB8_ALPHA8,
        "bgra8unorm-srgb": t.SRGB8_ALPHA8
    },
    r = t.RGBA8),
    {
        r8unorm: t.R8,
        r8snorm: t.R8_SNORM,
        r8uint: t.R8UI,
        r8sint: t.R8I,
        r16uint: t.R16UI,
        r16sint: t.R16I,
        r16float: t.R16F,
        rg8unorm: t.RG8,
        rg8snorm: t.RG8_SNORM,
        rg8uint: t.RG8UI,
        rg8sint: t.RG8I,
        r32uint: t.R32UI,
        r32sint: t.R32I,
        r32float: t.R32F,
        rg16uint: t.RG16UI,
        rg16sint: t.RG16I,
        rg16float: t.RG16F,
        rgba8unorm: t.RGBA,
        ...n,
        rgba8snorm: t.RGBA8_SNORM,
        rgba8uint: t.RGBA8UI,
        rgba8sint: t.RGBA8I,
        bgra8unorm: r,
        rgb9e5ufloat: t.RGB9_E5,
        rgb10a2unorm: t.RGB10_A2,
        rg11b10ufloat: t.R11F_G11F_B10F,
        rg32uint: t.RG32UI,
        rg32sint: t.RG32I,
        rg32float: t.RG32F,
        rgba16uint: t.RGBA16UI,
        rgba16sint: t.RGBA16I,
        rgba16float: t.RGBA16F,
        rgba32uint: t.RGBA32UI,
        rgba32sint: t.RGBA32I,
        rgba32float: t.RGBA32F,
        stencil8: t.STENCIL_INDEX8,
        depth16unorm: t.DEPTH_COMPONENT16,
        depth24plus: t.DEPTH_COMPONENT24,
        "depth24plus-stencil8": t.DEPTH24_STENCIL8,
        depth32float: t.DEPTH_COMPONENT32F,
        "depth32float-stencil8": t.DEPTH32F_STENCIL8,
        ...e.s3tc ? {
            "bc1-rgba-unorm": e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,
            "bc2-rgba-unorm": e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,
            "bc3-rgba-unorm": e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT
        } : {},
        ...e.s3tc_sRGB ? {
            "bc1-rgba-unorm-srgb": e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
            "bc2-rgba-unorm-srgb": e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
            "bc3-rgba-unorm-srgb": e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
        } : {},
        ...e.rgtc ? {
            "bc4-r-unorm": e.rgtc.COMPRESSED_RED_RGTC1_EXT,
            "bc4-r-snorm": e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,
            "bc5-rg-unorm": e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,
            "bc5-rg-snorm": e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT
        } : {},
        ...e.bptc ? {
            "bc6h-rgb-float": e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
            "bc6h-rgb-ufloat": e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
            "bc7-rgba-unorm": e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,
            "bc7-rgba-unorm-srgb": e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT
        } : {},
        ...e.etc ? {
            "etc2-rgb8unorm": e.etc.COMPRESSED_RGB8_ETC2,
            "etc2-rgb8unorm-srgb": e.etc.COMPRESSED_SRGB8_ETC2,
            "etc2-rgb8a1unorm": e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
            "etc2-rgb8a1unorm-srgb": e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
            "etc2-rgba8unorm": e.etc.COMPRESSED_RGBA8_ETC2_EAC,
            "etc2-rgba8unorm-srgb": e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
            "eac-r11unorm": e.etc.COMPRESSED_R11_EAC,
            "eac-rg11unorm": e.etc.COMPRESSED_SIGNED_RG11_EAC
        } : {},
        ...e.astc ? {
            "astc-4x4-unorm": e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,
            "astc-4x4-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
            "astc-5x4-unorm": e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,
            "astc-5x4-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
            "astc-5x5-unorm": e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,
            "astc-5x5-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
            "astc-6x5-unorm": e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,
            "astc-6x5-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
            "astc-6x6-unorm": e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,
            "astc-6x6-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
            "astc-8x5-unorm": e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,
            "astc-8x5-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
            "astc-8x6-unorm": e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,
            "astc-8x6-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
            "astc-8x8-unorm": e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,
            "astc-8x8-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
            "astc-10x5-unorm": e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,
            "astc-10x5-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
            "astc-10x6-unorm": e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,
            "astc-10x6-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
            "astc-10x8-unorm": e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,
            "astc-10x8-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
            "astc-10x10-unorm": e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,
            "astc-10x10-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
            "astc-12x10-unorm": e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,
            "astc-12x10-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
            "astc-12x12-unorm": e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,
            "astc-12x12-unorm-srgb": e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
        } : {}
    }
}
function Bhe(t) {
    return {
        r8unorm: t.UNSIGNED_BYTE,
        r8snorm: t.BYTE,
        r8uint: t.UNSIGNED_BYTE,
        r8sint: t.BYTE,
        r16uint: t.UNSIGNED_SHORT,
        r16sint: t.SHORT,
        r16float: t.HALF_FLOAT,
        rg8unorm: t.UNSIGNED_BYTE,
        rg8snorm: t.BYTE,
        rg8uint: t.UNSIGNED_BYTE,
        rg8sint: t.BYTE,
        r32uint: t.UNSIGNED_INT,
        r32sint: t.INT,
        r32float: t.FLOAT,
        rg16uint: t.UNSIGNED_SHORT,
        rg16sint: t.SHORT,
        rg16float: t.HALF_FLOAT,
        rgba8unorm: t.UNSIGNED_BYTE,
        "rgba8unorm-srgb": t.UNSIGNED_BYTE,
        rgba8snorm: t.BYTE,
        rgba8uint: t.UNSIGNED_BYTE,
        rgba8sint: t.BYTE,
        bgra8unorm: t.UNSIGNED_BYTE,
        "bgra8unorm-srgb": t.UNSIGNED_BYTE,
        rgb9e5ufloat: t.UNSIGNED_INT_5_9_9_9_REV,
        rgb10a2unorm: t.UNSIGNED_INT_2_10_10_10_REV,
        rg11b10ufloat: t.UNSIGNED_INT_10F_11F_11F_REV,
        rg32uint: t.UNSIGNED_INT,
        rg32sint: t.INT,
        rg32float: t.FLOAT,
        rgba16uint: t.UNSIGNED_SHORT,
        rgba16sint: t.SHORT,
        rgba16float: t.HALF_FLOAT,
        rgba32uint: t.UNSIGNED_INT,
        rgba32sint: t.INT,
        rgba32float: t.FLOAT,
        stencil8: t.UNSIGNED_BYTE,
        depth16unorm: t.UNSIGNED_SHORT,
        depth24plus: t.UNSIGNED_INT,
        "depth24plus-stencil8": t.UNSIGNED_INT_24_8,
        depth32float: t.FLOAT,
        "depth32float-stencil8": t.FLOAT_32_UNSIGNED_INT_24_8_REV
    }
}
const khe = 4;
class Uk {
    constructor(e) {
        this.managedTextures = [],
        this._glTextures = Object.create(null),
        this._glSamplers = Object.create(null),
        this._boundTextures = [],
        this._activeTextureLocation = -1,
        this._boundSamplers = Object.create(null),
        this._uploads = {
            image: $k,
            buffer: Ahe,
            video: Ihe,
            compressed: Phe
        },
        this._premultiplyAlpha = !1,
        this._useSeparateSamplers = !1,
        this._renderer = e,
        this._renderer.renderableGC.addManagedHash(this, "_glTextures"),
        this._renderer.renderableGC.addManagedHash(this, "_glSamplers")
    }
    contextChange(e) {
        this._gl = e,
        this._mapFormatToInternalFormat || (this._mapFormatToInternalFormat = Dhe(e, this._renderer.context.extensions),
        this._mapFormatToType = Bhe(e),
        this._mapFormatToFormat = Mhe(e)),
        this._glTextures = Object.create(null),
        this._glSamplers = Object.create(null),
        this._boundSamplers = Object.create(null),
        this._premultiplyAlpha = !1;
        for (let n = 0; n < 16; n++)
            this.bind(Ae.EMPTY, n)
    }
    initSource(e) {
        this.bind(e)
    }
    bind(e, n=0) {
        const r = e.source;
        e ? (this.bindSource(r, n),
        this._useSeparateSamplers && this._bindSampler(r.style, n)) : (this.bindSource(null, n),
        this._useSeparateSamplers && this._bindSampler(null, n))
    }
    bindSource(e, n=0) {
        const r = this._gl;
        if (e._touched = this._renderer.textureGC.count,
        this._boundTextures[n] !== e) {
            this._boundTextures[n] = e,
            this._activateLocation(n),
            e || (e = Ae.EMPTY.source);
            const i = this.getGlSource(e);
            r.bindTexture(i.target, i.texture)
        }
    }
    _bindSampler(e, n=0) {
        const r = this._gl;
        if (!e) {
            this._boundSamplers[n] = null,
            r.bindSampler(n, null);
            return
        }
        const i = this._getGlSampler(e);
        this._boundSamplers[n] !== i && (this._boundSamplers[n] = i,
        r.bindSampler(n, i))
    }
    unbind(e) {
        const n = e.source
          , r = this._boundTextures
          , i = this._gl;
        for (let o = 0; o < r.length; o++)
            if (r[o] === n) {
                this._activateLocation(o);
                const s = this.getGlSource(n);
                i.bindTexture(s.target, null),
                r[o] = null
            }
    }
    _activateLocation(e) {
        this._activeTextureLocation !== e && (this._activeTextureLocation = e,
        this._gl.activeTexture(this._gl.TEXTURE0 + e))
    }
    _initSource(e) {
        const n = this._gl
          , r = new Che(n.createTexture());
        if (r.type = this._mapFormatToType[e.format],
        r.internalFormat = this._mapFormatToInternalFormat[e.format],
        r.format = this._mapFormatToFormat[e.format],
        e.autoGenerateMipmaps && (this._renderer.context.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
            const i = Math.max(e.width, e.height);
            e.mipLevelCount = Math.floor(Math.log2(i)) + 1
        }
        return this._glTextures[e.uid] = r,
        this.managedTextures.includes(e) || (e.on("update", this.onSourceUpdate, this),
        e.on("resize", this.onSourceUpdate, this),
        e.on("styleChange", this.onStyleChange, this),
        e.on("destroy", this.onSourceDestroy, this),
        e.on("unload", this.onSourceUnload, this),
        e.on("updateMipmaps", this.onUpdateMipmaps, this),
        this.managedTextures.push(e)),
        this.onSourceUpdate(e),
        this.updateStyle(e, !1),
        r
    }
    onStyleChange(e) {
        this.updateStyle(e, !1)
    }
    updateStyle(e, n) {
        const r = this._gl
          , i = this.getGlSource(e);
        r.bindTexture(r.TEXTURE_2D, i.texture),
        this._boundTextures[this._activeTextureLocation] = e,
        b3(e.style, r, e.mipLevelCount > 1, this._renderer.context.extensions.anisotropicFiltering, "texParameteri", r.TEXTURE_2D, !this._renderer.context.supports.nonPowOf2wrapping && !e.isPowerOfTwo, n)
    }
    onSourceUnload(e) {
        const n = this._glTextures[e.uid];
        n && (this.unbind(e),
        this._glTextures[e.uid] = null,
        this._gl.deleteTexture(n.texture))
    }
    onSourceUpdate(e) {
        const n = this._gl
          , r = this.getGlSource(e);
        n.bindTexture(n.TEXTURE_2D, r.texture),
        this._boundTextures[this._activeTextureLocation] = e;
        const i = e.alphaMode === "premultiply-alpha-on-upload";
        this._premultiplyAlpha !== i && (this._premultiplyAlpha = i,
        n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, i)),
        this._uploads[e.uploadMethodId] ? this._uploads[e.uploadMethodId].upload(e, r, n, this._renderer.context.webGLVersion) : n.texImage2D(n.TEXTURE_2D, 0, n.RGBA, e.pixelWidth, e.pixelHeight, 0, n.RGBA, n.UNSIGNED_BYTE, null),
        e.autoGenerateMipmaps && e.mipLevelCount > 1 && this.onUpdateMipmaps(e, !1)
    }
    onUpdateMipmaps(e, n=!0) {
        n && this.bindSource(e, 0);
        const r = this.getGlSource(e);
        this._gl.generateMipmap(r.target)
    }
    onSourceDestroy(e) {
        e.off("destroy", this.onSourceDestroy, this),
        e.off("update", this.onSourceUpdate, this),
        e.off("resize", this.onSourceUpdate, this),
        e.off("unload", this.onSourceUnload, this),
        e.off("styleChange", this.onStyleChange, this),
        e.off("updateMipmaps", this.onUpdateMipmaps, this),
        this.managedTextures.splice(this.managedTextures.indexOf(e), 1),
        this.onSourceUnload(e)
    }
    _initSampler(e) {
        const n = this._gl
          , r = this._gl.createSampler();
        return this._glSamplers[e._resourceId] = r,
        b3(e, n, this._boundTextures[this._activeTextureLocation].mipLevelCount > 1, this._renderer.context.extensions.anisotropicFiltering, "samplerParameteri", r, !1, !0),
        this._glSamplers[e._resourceId]
    }
    _getGlSampler(e) {
        return this._glSamplers[e._resourceId] || this._initSampler(e)
    }
    getGlSource(e) {
        return this._glTextures[e.uid] || this._initSource(e)
    }
    generateCanvas(e) {
        const {pixels: n, width: r, height: i} = this.getPixels(e)
          , o = je.get().createCanvas();
        o.width = r,
        o.height = i;
        const s = o.getContext("2d");
        if (s) {
            const a = s.createImageData(r, i);
            a.data.set(n),
            s.putImageData(a, 0, 0)
        }
        return o
    }
    getPixels(e) {
        const n = e.source.resolution
          , r = e.frame
          , i = Math.max(Math.round(r.width * n), 1)
          , o = Math.max(Math.round(r.height * n), 1)
          , s = new Uint8Array(khe * i * o)
          , a = this._renderer
          , l = a.renderTarget.getRenderTarget(e)
          , c = a.renderTarget.getGpuRenderTarget(l)
          , u = a.gl;
        return u.bindFramebuffer(u.FRAMEBUFFER, c.resolveTargetFramebuffer),
        u.readPixels(Math.round(r.x * n), Math.round(r.y * n), i, o, u.RGBA, u.UNSIGNED_BYTE, s),
        {
            pixels: new Uint8ClampedArray(s.buffer),
            width: i,
            height: o
        }
    }
    destroy() {
        this.managedTextures.slice().forEach(e => this.onSourceDestroy(e)),
        this.managedTextures = null,
        this._renderer = null
    }
    resetState() {
        this._activeTextureLocation = -1,
        this._boundTextures.fill(Ae.EMPTY.source),
        this._boundSamplers = Object.create(null);
        const e = this._gl;
        this._premultiplyAlpha = !1,
        e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha)
    }
}
Uk.extension = {
    type: [V.WebGLSystem],
    name: "texture"
};
class Gk {
    contextChange(e) {
        const n = new gr({
            uColor: {
                value: new Float32Array([1, 1, 1, 1]),
                type: "vec4<f32>"
            },
            uTransformMatrix: {
                value: new Oe,
                type: "mat3x3<f32>"
            },
            uRound: {
                value: 0,
                type: "f32"
            }
        })
          , r = e.limits.maxBatchableTextures
          , i = eh({
            name: "graphics",
            bits: [s2, l2(r), b2, nh]
        });
        this.shader = new yi({
            glProgram: i,
            resources: {
                localUniforms: n,
                batchSamplers: c2(r)
            }
        })
    }
    execute(e, n) {
        const r = n.context
          , i = r.customShader || this.shader
          , o = e.renderer
          , s = o.graphicsContext
          , {batcher: a, instructions: l} = s.getContextRenderData(r);
        i.groups[0] = o.globalUniforms.bindGroup,
        o.state.set(e.state),
        o.shader.bind(i),
        o.geometry.bind(a.geometry, i.glProgram);
        const c = l.instructions;
        for (let u = 0; u < l.instructionSize; u++) {
            const f = c[u];
            if (f.size) {
                for (let d = 0; d < f.textures.count; d++)
                    o.texture.bind(f.textures.textures[d], d);
                o.geometry.draw(f.topology, f.size, f.start)
            }
        }
    }
    destroy() {
        this.shader.destroy(!0),
        this.shader = null
    }
}
Gk.extension = {
    type: [V.WebGLPipesAdaptor],
    name: "graphics"
};
class Hk {
    init() {
        const e = eh({
            name: "mesh",
            bits: [b2, Gde, nh]
        });
        this._shader = new yi({
            glProgram: e,
            resources: {
                uTexture: Ae.EMPTY.source,
                textureUniforms: {
                    uTextureMatrix: {
                        type: "mat3x3<f32>",
                        value: new Oe
                    }
                }
            }
        })
    }
    execute(e, n) {
        const r = e.renderer;
        let i = n._shader;
        if (i) {
            if (!i.glProgram) {
                Ne("Mesh shader has no glProgram", n.shader);
                return
            }
        } else {
            i = this._shader;
            const o = n.texture
              , s = o.source;
            i.resources.uTexture = s,
            i.resources.uSampler = s.style,
            i.resources.textureUniforms.uniforms.uTextureMatrix = o.textureMatrix.mapCoord
        }
        i.groups[100] = r.globalUniforms.bindGroup,
        i.groups[101] = e.localUniformsBindGroup,
        r.encoder.draw({
            geometry: n._geometry,
            shader: i,
            state: n.state
        })
    }
    destroy() {
        this._shader.destroy(!0),
        this._shader = null
    }
}
Hk.extension = {
    type: [V.WebGLPipesAdaptor],
    name: "mesh"
};
class Vk {
    constructor(e) {
        this._renderer = e
    }
    updateRenderable() {}
    destroyRenderable() {}
    validateRenderable() {
        return !1
    }
    addRenderable(e, n) {
        this._renderer.renderPipes.batch.break(n),
        n.add(e)
    }
    execute(e) {
        e.isRenderable && e.render(this._renderer)
    }
    destroy() {
        this._renderer = null
    }
}
Vk.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "customRender"
};
class om {
    constructor() {
        this.batcherName = "default",
        this.topology = "triangle-list",
        this.attributeSize = 4,
        this.indexSize = 6,
        this.packAsQuad = !0,
        this.roundPixels = 0,
        this._attributeStart = 0,
        this._batcher = null,
        this._batch = null
    }
    get blendMode() {
        return this.renderable.groupBlendMode
    }
    get color() {
        return this.renderable.groupColorAlpha
    }
    reset() {
        this.renderable = null,
        this.texture = null,
        this._batcher = null,
        this._batch = null,
        this.bounds = null
    }
    destroy() {}
}
function tx(t, e) {
    const n = t.instructionSet
      , r = n.instructions;
    for (let i = 0; i < n.instructionSize; i++) {
        const o = r[i];
        e[o.renderPipeId].execute(o)
    }
}
const Nhe = new Oe;
class zk {
    constructor(e) {
        this._renderer = e
    }
    addRenderGroup(e, n) {
        e.isCachedAsTexture ? this._addRenderableCacheAsTexture(e, n) : this._addRenderableDirect(e, n)
    }
    execute(e) {
        e.isRenderable && (e.isCachedAsTexture ? this._executeCacheAsTexture(e) : this._executeDirect(e))
    }
    destroy() {
        this._renderer = null
    }
    _addRenderableDirect(e, n) {
        this._renderer.renderPipes.batch.break(n),
        e._batchableRenderGroup && (Hn.return(e._batchableRenderGroup),
        e._batchableRenderGroup = null),
        n.add(e)
    }
    _addRenderableCacheAsTexture(e, n) {
        const r = e._batchableRenderGroup ?? (e._batchableRenderGroup = Hn.get(om));
        r.renderable = e.root,
        r.transform = e.root.relativeGroupTransform,
        r.texture = e.texture,
        r.bounds = e._textureBounds,
        n.add(e),
        this._renderer.renderPipes.batch.addToBatch(r, n)
    }
    _executeCacheAsTexture(e) {
        if (e.textureNeedsUpdate) {
            e.textureNeedsUpdate = !1;
            const n = Nhe.identity().translate(-e._textureBounds.x, -e._textureBounds.y);
            this._renderer.renderTarget.push(e.texture, !0, null, e.texture.frame),
            this._renderer.globalUniforms.push({
                worldTransformMatrix: n,
                worldColor: 4294967295
            }),
            tx(e, this._renderer.renderPipes),
            this._renderer.renderTarget.finishRenderPass(),
            this._renderer.renderTarget.pop(),
            this._renderer.globalUniforms.pop()
        }
        e._batchableRenderGroup._batcher.updateElement(e._batchableRenderGroup),
        e._batchableRenderGroup._batcher.geometry.buffers[0].update()
    }
    _executeDirect(e) {
        this._renderer.globalUniforms.push({
            worldTransformMatrix: e.inverseParentTextureTransform,
            worldColor: e.worldColorAlpha
        }),
        tx(e, this._renderer.renderPipes),
        this._renderer.globalUniforms.pop()
    }
}
zk.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "renderGroup"
};
function nx(t, e) {
    e || (e = 0);
    for (let n = e; n < t.length && t[n]; n++)
        t[n] = null
}
const Fhe = new Xr
  , w3 = Tf | w0 | Zw;
function jk(t, e=!1) {
    Lhe(t);
    const n = t.childrenToUpdate
      , r = t.updateTick++;
    for (const i in n) {
        const o = Number(i)
          , s = n[i]
          , a = s.list
          , l = s.index;
        for (let c = 0; c < l; c++) {
            const u = a[c];
            u.parentRenderGroup === t && u.relativeRenderGroupDepth === o && Wk(u, r, 0)
        }
        nx(a, l),
        s.index = 0
    }
    if (e)
        for (let i = 0; i < t.renderGroupChildren.length; i++)
            jk(t.renderGroupChildren[i], e)
}
function Lhe(t) {
    const e = t.root;
    let n;
    if (t.renderGroupParent) {
        const r = t.renderGroupParent;
        t.worldTransform.appendFrom(e.relativeGroupTransform, r.worldTransform),
        t.worldColor = b0(e.groupColor, r.worldColor),
        n = e.groupAlpha * r.worldAlpha
    } else
        t.worldTransform.copyFrom(e.localTransform),
        t.worldColor = e.localColor,
        n = e.localAlpha;
    n = n < 0 ? 0 : n > 1 ? 1 : n,
    t.worldAlpha = n,
    t.worldColorAlpha = t.worldColor + ((n * 255 | 0) << 24)
}
function Wk(t, e, n) {
    if (e === t.updateTick)
        return;
    t.updateTick = e,
    t.didChange = !1;
    const r = t.localTransform;
    t.updateLocalTransform();
    const i = t.parent;
    if (i && !i.renderGroup ? (n |= t._updateFlags,
    t.relativeGroupTransform.appendFrom(r, i.relativeGroupTransform),
    n & w3 && E3(t, i, n)) : (n = t._updateFlags,
    t.relativeGroupTransform.copyFrom(r),
    n & w3 && E3(t, Fhe, n)),
    !t.renderGroup) {
        const o = t.children
          , s = o.length;
        for (let c = 0; c < s; c++)
            Wk(o[c], e, n);
        const a = t.parentRenderGroup
          , l = t;
        l.renderPipeId && !a.structureDidChange && a.updateRenderable(l)
    }
}
function E3(t, e, n) {
    if (n & w0) {
        t.groupColor = b0(t.localColor, e.groupColor);
        let r = t.localAlpha * e.groupAlpha;
        r = r < 0 ? 0 : r > 1 ? 1 : r,
        t.groupAlpha = r,
        t.groupColorAlpha = t.groupColor + ((r * 255 | 0) << 24)
    }
    n & Zw && (t.groupBlendMode = t.localBlendMode === "inherit" ? e.groupBlendMode : t.localBlendMode),
    n & Tf && (t.globalDisplayStatus = t.localDisplayStatus & e.globalDisplayStatus),
    t._updateFlags = 0
}
function $he(t, e) {
    const {list: n, index: r} = t.childrenRenderablesToUpdate;
    let i = !1;
    for (let o = 0; o < r; o++) {
        const s = n[o];
        if (i = e[s.renderPipeId].validateRenderable(s),
        i)
            break
    }
    return t.structureDidChange = i,
    i
}
const Uhe = new Oe;
class Yk {
    constructor(e) {
        this._renderer = e
    }
    render({container: e, transform: n}) {
        const r = e.parent
          , i = e.renderGroup.renderGroupParent;
        e.parent = null,
        e.renderGroup.renderGroupParent = null;
        const o = this._renderer;
        let s = Uhe;
        n && (s = s.copyFrom(e.renderGroup.localTransform),
        e.renderGroup.localTransform.copyFrom(n));
        const a = o.renderPipes;
        this._updateCachedRenderGroups(e.renderGroup, null),
        this._updateRenderGroups(e.renderGroup),
        o.globalUniforms.start({
            worldTransformMatrix: n ? e.renderGroup.localTransform : e.renderGroup.worldTransform,
            worldColor: e.renderGroup.worldColorAlpha
        }),
        tx(e.renderGroup, a),
        a.uniformBatch && a.uniformBatch.renderEnd(),
        n && e.renderGroup.localTransform.copyFrom(s),
        e.parent = r,
        e.renderGroup.renderGroupParent = i
    }
    destroy() {
        this._renderer = null
    }
    _updateCachedRenderGroups(e, n) {
        if (e.isCachedAsTexture) {
            if (!e.updateCacheTexture)
                return;
            n = e
        }
        e._parentCacheAsTextureRenderGroup = n;
        for (let r = e.renderGroupChildren.length - 1; r >= 0; r--)
            this._updateCachedRenderGroups(e.renderGroupChildren[r], n);
        if (e.invalidateMatrices(),
        e.isCachedAsTexture) {
            if (e.textureNeedsUpdate) {
                const r = e.root.getLocalBounds();
                r.ceil();
                const i = e.texture;
                e.texture && cn.returnTexture(e.texture, !0);
                const o = this._renderer
                  , s = e.textureOptions.resolution || o.view.resolution
                  , a = e.textureOptions.antialias ?? o.view.antialias
                  , l = e.textureOptions.scaleMode ?? "linear"
                  , c = cn.getOptimalTexture(r.width, r.height, s, a);
                c._source.style = new yo({
                    scaleMode: l
                }),
                e.texture = c,
                e._textureBounds || (e._textureBounds = new Vn),
                e._textureBounds.copyFrom(r),
                i !== e.texture && e.renderGroupParent && (e.renderGroupParent.structureDidChange = !0)
            }
        } else
            e.texture && (cn.returnTexture(e.texture, !0),
            e.texture = null)
    }
    _updateRenderGroups(e) {
        const n = this._renderer
          , r = n.renderPipes;
        if (e.runOnRender(n),
        e.instructionSet.renderPipes = r,
        e.structureDidChange ? nx(e.childrenRenderablesToUpdate.list, 0) : $he(e, r),
        jk(e),
        e.structureDidChange ? (e.structureDidChange = !1,
        this._buildInstructions(e, n)) : this._updateRenderables(e),
        e.childrenRenderablesToUpdate.index = 0,
        n.renderPipes.batch.upload(e.instructionSet),
        !(e.isCachedAsTexture && !e.textureNeedsUpdate))
            for (let i = 0; i < e.renderGroupChildren.length; i++)
                this._updateRenderGroups(e.renderGroupChildren[i])
    }
    _updateRenderables(e) {
        const {list: n, index: r} = e.childrenRenderablesToUpdate;
        for (let i = 0; i < r; i++) {
            const o = n[i];
            o.didViewUpdate && e.updateRenderable(o)
        }
        nx(n, r)
    }
    _buildInstructions(e, n) {
        const r = e.root
          , i = e.instructionSet;
        i.reset();
        const o = n.renderPipes ? n : n.batch.renderer
          , s = o.renderPipes;
        s.batch.buildStart(i),
        s.blendMode.buildStart(),
        s.colorMask.buildStart(),
        r.sortableChildren && r.sortChildren(),
        r.collectRenderablesWithEffects(i, o, null),
        s.batch.buildEnd(i),
        s.blendMode.buildEnd(i)
    }
}
Yk.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
    name: "renderGroup"
};
class Xk {
    constructor(e) {
        this._renderer = e
    }
    addRenderable(e, n) {
        const r = this._getGpuSprite(e);
        e.didViewUpdate && this._updateBatchableSprite(e, r),
        this._renderer.renderPipes.batch.addToBatch(r, n)
    }
    updateRenderable(e) {
        const n = this._getGpuSprite(e);
        e.didViewUpdate && this._updateBatchableSprite(e, n),
        n._batcher.updateElement(n)
    }
    validateRenderable(e) {
        const n = this._getGpuSprite(e);
        return !n._batcher.checkAndUpdateTexture(n, e._texture)
    }
    _updateBatchableSprite(e, n) {
        n.bounds = e.visualBounds,
        n.texture = e._texture
    }
    _getGpuSprite(e) {
        return e._gpuData[this._renderer.uid] || this._initGPUSprite(e)
    }
    _initGPUSprite(e) {
        const n = new om;
        return n.renderable = e,
        n.transform = e.groupTransform,
        n.texture = e._texture,
        n.bounds = e.visualBounds,
        n.roundPixels = this._renderer._roundPixels | e._roundPixels,
        e._gpuData[this._renderer.uid] = n,
        n
    }
    destroy() {
        this._renderer = null
    }
}
Xk.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "sprite"
};
const C2 = class Kk {
    constructor() {
        this.clearBeforeRender = !0,
        this._backgroundColor = new Rt(0),
        this.color = this._backgroundColor,
        this.alpha = 1
    }
    init(e) {
        e = {
            ...Kk.defaultOptions,
            ...e
        },
        this.clearBeforeRender = e.clearBeforeRender,
        this.color = e.background || e.backgroundColor || this._backgroundColor,
        this.alpha = e.backgroundAlpha,
        this._backgroundColor.setAlpha(e.backgroundAlpha)
    }
    get color() {
        return this._backgroundColor
    }
    set color(e) {
        Rt.shared.setValue(e).alpha < 1 && this._backgroundColor.alpha === 1 && Ne("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."),
        this._backgroundColor.setValue(e)
    }
    get alpha() {
        return this._backgroundColor.alpha
    }
    set alpha(e) {
        this._backgroundColor.setAlpha(e)
    }
    get colorRgba() {
        return this._backgroundColor.toArray()
    }
    destroy() {}
}
;
C2.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
    name: "background",
    priority: 0
};
C2.defaultOptions = {
    backgroundAlpha: 1,
    backgroundColor: 0,
    clearBeforeRender: !0
};
let Ghe = C2;
const Df = {};
$e.handle(V.BlendMode, t => {
    if (!t.name)
        throw new Error("BlendMode extension must have a name property");
    Df[t.name] = t.ref
}
, t => {
    delete Df[t.name]
}
);
class qk {
    constructor(e) {
        this._isAdvanced = !1,
        this._filterHash = Object.create(null),
        this._renderer = e,
        this._renderer.runners.prerender.add(this)
    }
    prerender() {
        this._activeBlendMode = "normal",
        this._isAdvanced = !1
    }
    setBlendMode(e, n, r) {
        if (this._activeBlendMode === n) {
            this._isAdvanced && this._renderableList.push(e);
            return
        }
        this._activeBlendMode = n,
        this._isAdvanced && this._endAdvancedBlendMode(r),
        this._isAdvanced = !!Df[n],
        this._isAdvanced && (this._beginAdvancedBlendMode(r),
        this._renderableList.push(e))
    }
    _beginAdvancedBlendMode(e) {
        this._renderer.renderPipes.batch.break(e);
        const n = this._activeBlendMode;
        if (!Df[n]) {
            Ne(`Unable to assign BlendMode: '${n}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);
            return
        }
        let r = this._filterHash[n];
        r || (r = this._filterHash[n] = new x0,
        r.filters = [new Df[n]]);
        const i = {
            renderPipeId: "filter",
            action: "pushFilter",
            renderables: [],
            filterEffect: r,
            canBundle: !1
        };
        this._renderableList = i.renderables,
        e.add(i)
    }
    _endAdvancedBlendMode(e) {
        this._renderableList = null,
        this._renderer.renderPipes.batch.break(e),
        e.add({
            renderPipeId: "filter",
            action: "popFilter",
            canBundle: !1
        })
    }
    buildStart() {
        this._isAdvanced = !1
    }
    buildEnd(e) {
        this._isAdvanced && this._endAdvancedBlendMode(e)
    }
    destroy() {
        this._renderer = null,
        this._renderableList = null;
        for (const e in this._filterHash)
            this._filterHash[e].destroy();
        this._filterHash = null
    }
}
qk.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "blendMode"
};
const K1 = {
    png: "image/png",
    jpg: "image/jpeg",
    webp: "image/webp"
}
  , A2 = class Zk {
    constructor(e) {
        this._renderer = e
    }
    _normalizeOptions(e, n={}) {
        return e instanceof Xr || e instanceof Ae ? {
            target: e,
            ...n
        } : {
            ...n,
            ...e
        }
    }
    async image(e) {
        const n = je.get().createImage();
        return n.src = await this.base64(e),
        n
    }
    async base64(e) {
        e = this._normalizeOptions(e, Zk.defaultImageOptions);
        const {format: n, quality: r} = e
          , i = this.canvas(e);
        if (i.toBlob !== void 0)
            return new Promise( (o, s) => {
                i.toBlob(a => {
                    if (!a) {
                        s(new Error("ICanvas.toBlob failed!"));
                        return
                    }
                    const l = new FileReader;
                    l.onload = () => o(l.result),
                    l.onerror = s,
                    l.readAsDataURL(a)
                }
                , K1[n], r)
            }
            );
        if (i.toDataURL !== void 0)
            return i.toDataURL(K1[n], r);
        if (i.convertToBlob !== void 0) {
            const o = await i.convertToBlob({
                type: K1[n],
                quality: r
            });
            return new Promise( (s, a) => {
                const l = new FileReader;
                l.onload = () => s(l.result),
                l.onerror = a,
                l.readAsDataURL(o)
            }
            )
        }
        throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")
    }
    canvas(e) {
        e = this._normalizeOptions(e);
        const n = e.target
          , r = this._renderer;
        if (n instanceof Ae)
            return r.texture.generateCanvas(n);
        const i = r.textureGenerator.generateTexture(e)
          , o = r.texture.generateCanvas(i);
        return i.destroy(!0),
        o
    }
    pixels(e) {
        e = this._normalizeOptions(e);
        const n = e.target
          , r = this._renderer
          , i = n instanceof Ae ? n : r.textureGenerator.generateTexture(e)
          , o = r.texture.getPixels(i);
        return n instanceof Xr && i.destroy(!0),
        o
    }
    texture(e) {
        return e = this._normalizeOptions(e),
        e.target instanceof Ae ? e.target : this._renderer.textureGenerator.generateTexture(e)
    }
    download(e) {
        e = this._normalizeOptions(e);
        const n = this.canvas(e)
          , r = document.createElement("a");
        r.download = e.filename ?? "image.png",
        r.href = n.toDataURL("image/png"),
        document.body.appendChild(r),
        r.click(),
        document.body.removeChild(r)
    }
    log(e) {
        const n = e.width ?? 200;
        e = this._normalizeOptions(e);
        const r = this.canvas(e)
          , i = r.toDataURL();
        console.log(`[Pixi Texture] ${r.width}px ${r.height}px`);
        const o = ["font-size: 1px;", `padding: ${n}px 300px;`, `background: url(${i}) no-repeat;`, "background-size: contain;"].join(" ");
        console.log("%c ", o)
    }
    destroy() {
        this._renderer = null
    }
}
;
A2.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem],
    name: "extract"
};
A2.defaultImageOptions = {
    format: "png",
    quality: 1
};
let Hhe = A2;
class T2 extends Ae {
    static create(e) {
        return new T2({
            source: new Cn(e)
        })
    }
    resize(e, n, r) {
        return this.source.resize(e, n, r),
        this
    }
}
const Vhe = new vt
  , zhe = new Vn
  , jhe = [0, 0, 0, 0];
class Jk {
    constructor(e) {
        this._renderer = e
    }
    generateTexture(e) {
        var c;
        e instanceof Xr && (e = {
            target: e,
            frame: void 0,
            textureSourceOptions: {},
            resolution: void 0
        });
        const n = e.resolution || this._renderer.resolution
          , r = e.antialias || this._renderer.view.antialias
          , i = e.target;
        let o = e.clearColor;
        o ? o = Array.isArray(o) && o.length === 4 ? o : Rt.shared.setValue(o).toArray() : o = jhe;
        const s = ((c = e.frame) == null ? void 0 : c.copyTo(Vhe)) || qw(i, zhe).rectangle;
        s.width = Math.max(s.width, 1 / n) | 0,
        s.height = Math.max(s.height, 1 / n) | 0;
        const a = T2.create({
            ...e.textureSourceOptions,
            width: s.width,
            height: s.height,
            resolution: n,
            antialias: r
        })
          , l = Oe.shared.translate(-s.x, -s.y);
        return this._renderer.render({
            container: i,
            transform: l,
            target: a,
            clearColor: o
        }),
        a.source.updateMipmaps(),
        a
    }
    destroy() {
        this._renderer = null
    }
}
Jk.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem],
    name: "textureGenerator"
};
function rh(t, e, n) {
    const r = (t >> 24 & 255) / 255;
    e[n++] = (t & 255) / 255 * r,
    e[n++] = (t >> 8 & 255) / 255 * r,
    e[n++] = (t >> 16 & 255) / 255 * r,
    e[n++] = r
}
class Qk {
    constructor(e) {
        this._stackIndex = 0,
        this._globalUniformDataStack = [],
        this._uniformsPool = [],
        this._activeUniforms = [],
        this._bindGroupPool = [],
        this._activeBindGroups = [],
        this._renderer = e
    }
    reset() {
        this._stackIndex = 0;
        for (let e = 0; e < this._activeUniforms.length; e++)
            this._uniformsPool.push(this._activeUniforms[e]);
        for (let e = 0; e < this._activeBindGroups.length; e++)
            this._bindGroupPool.push(this._activeBindGroups[e]);
        this._activeUniforms.length = 0,
        this._activeBindGroups.length = 0
    }
    start(e) {
        this.reset(),
        this.push(e)
    }
    bind({size: e, projectionMatrix: n, worldTransformMatrix: r, worldColor: i, offset: o}) {
        const s = this._renderer.renderTarget.renderTarget
          , a = this._stackIndex ? this._globalUniformDataStack[this._stackIndex - 1] : {
            projectionData: s,
            worldTransformMatrix: new Oe,
            worldColor: 4294967295,
            offset: new Gt
        }
          , l = {
            projectionMatrix: n || this._renderer.renderTarget.projectionMatrix,
            resolution: e || s.size,
            worldTransformMatrix: r || a.worldTransformMatrix,
            worldColor: i || a.worldColor,
            offset: o || a.offset,
            bindGroup: null
        }
          , c = this._uniformsPool.pop() || this._createUniforms();
        this._activeUniforms.push(c);
        const u = c.uniforms;
        u.uProjectionMatrix = l.projectionMatrix,
        u.uResolution = l.resolution,
        u.uWorldTransformMatrix.copyFrom(l.worldTransformMatrix),
        u.uWorldTransformMatrix.tx -= l.offset.x,
        u.uWorldTransformMatrix.ty -= l.offset.y,
        rh(l.worldColor, u.uWorldColorAlpha, 0),
        c.update();
        let f;
        this._renderer.renderPipes.uniformBatch ? f = this._renderer.renderPipes.uniformBatch.getUniformBindGroup(c, !1) : (f = this._bindGroupPool.pop() || new Ko,
        this._activeBindGroups.push(f),
        f.setResource(c, 0)),
        l.bindGroup = f,
        this._currentGlobalUniformData = l
    }
    push(e) {
        this.bind(e),
        this._globalUniformDataStack[this._stackIndex++] = this._currentGlobalUniformData
    }
    pop() {
        this._currentGlobalUniformData = this._globalUniformDataStack[--this._stackIndex - 1],
        this._renderer.type === Kr.WEBGL && this._currentGlobalUniformData.bindGroup.resources[0].update()
    }
    get bindGroup() {
        return this._currentGlobalUniformData.bindGroup
    }
    get globalUniformData() {
        return this._currentGlobalUniformData
    }
    get uniformGroup() {
        return this._currentGlobalUniformData.bindGroup.resources[0]
    }
    _createUniforms() {
        return new gr({
            uProjectionMatrix: {
                value: new Oe,
                type: "mat3x3<f32>"
            },
            uWorldTransformMatrix: {
                value: new Oe,
                type: "mat3x3<f32>"
            },
            uWorldColorAlpha: {
                value: new Float32Array(4),
                type: "vec4<f32>"
            },
            uResolution: {
                value: [0, 0],
                type: "vec2<f32>"
            }
        },{
            isStatic: !0
        })
    }
    destroy() {
        this._renderer = null
    }
}
Qk.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
    name: "globalUniforms"
};
let Whe = 1;
class eN {
    constructor() {
        this._tasks = [],
        this._offset = 0
    }
    init() {
        Un.system.add(this._update, this)
    }
    repeat(e, n, r=!0) {
        const i = Whe++;
        let o = 0;
        return r && (this._offset += 1e3,
        o = this._offset),
        this._tasks.push({
            func: e,
            duration: n,
            start: performance.now(),
            offset: o,
            last: performance.now(),
            repeat: !0,
            id: i
        }),
        i
    }
    cancel(e) {
        for (let n = 0; n < this._tasks.length; n++)
            if (this._tasks[n].id === e) {
                this._tasks.splice(n, 1);
                return
            }
    }
    _update() {
        const e = performance.now();
        for (let n = 0; n < this._tasks.length; n++) {
            const r = this._tasks[n];
            if (e - r.offset - r.last >= r.duration) {
                const i = e - r.start;
                r.func(i),
                r.last = e
            }
        }
    }
    destroy() {
        Un.system.remove(this._update, this),
        this._tasks.length = 0
    }
}
eN.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
    name: "scheduler",
    priority: 0
};
let S3 = !1;
function Yhe(t) {
    if (!S3) {
        if (je.get().getNavigator().userAgent.toLowerCase().indexOf("chrome") > -1) {
            const e = [`%c  %c  %c  %c  %c PixiJS %c v${S0} (${t}) http://www.pixijs.com/

`, "background: #E72264; padding:5px 0;", "background: #6CA2EA; padding:5px 0;", "background: #B5D33D; padding:5px 0;", "background: #FED23F; padding:5px 0;", "color: #FFFFFF; background: #E72264; padding:5px 0;", "color: #E72264; background: #FFFFFF; padding:5px 0;"];
            globalThis.console.log(...e)
        } else
            globalThis.console && globalThis.console.log(`PixiJS ${S0} - ${t} - http://www.pixijs.com/`);
        S3 = !0
    }
}
class P2 {
    constructor(e) {
        this._renderer = e
    }
    init(e) {
        if (e.hello) {
            let n = this._renderer.name;
            this._renderer.type === Kr.WEBGL && (n += ` ${this._renderer.context.webGLVersion}`),
            Yhe(n)
        }
    }
}
P2.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
    name: "hello",
    priority: -2
};
P2.defaultOptions = {
    hello: !1
};
function Xhe(t) {
    let e = !1;
    for (const r in t)
        if (t[r] == null) {
            e = !0;
            break
        }
    if (!e)
        return t;
    const n = Object.create(null);
    for (const r in t) {
        const i = t[r];
        i && (n[r] = i)
    }
    return n
}
function Khe(t) {
    let e = 0;
    for (let n = 0; n < t.length; n++)
        t[n] == null ? e++ : t[n - e] = t[n];
    return t.length -= e,
    t
}
let qhe = 0;
const I2 = class tN {
    constructor(e) {
        this._managedRenderables = [],
        this._managedHashes = [],
        this._managedArrays = [],
        this._renderer = e
    }
    init(e) {
        e = {
            ...tN.defaultOptions,
            ...e
        },
        this.maxUnusedTime = e.renderableGCMaxUnusedTime,
        this._frequency = e.renderableGCFrequency,
        this.enabled = e.renderableGCActive
    }
    get enabled() {
        return !!this._handler
    }
    set enabled(e) {
        this.enabled !== e && (e ? (this._handler = this._renderer.scheduler.repeat( () => this.run(), this._frequency, !1),
        this._hashHandler = this._renderer.scheduler.repeat( () => {
            for (const n of this._managedHashes)
                n.context[n.hash] = Xhe(n.context[n.hash])
        }
        , this._frequency),
        this._arrayHandler = this._renderer.scheduler.repeat( () => {
            for (const n of this._managedArrays)
                Khe(n.context[n.hash])
        }
        , this._frequency)) : (this._renderer.scheduler.cancel(this._handler),
        this._renderer.scheduler.cancel(this._hashHandler),
        this._renderer.scheduler.cancel(this._arrayHandler)))
    }
    addManagedHash(e, n) {
        this._managedHashes.push({
            context: e,
            hash: n
        })
    }
    addManagedArray(e, n) {
        this._managedArrays.push({
            context: e,
            hash: n
        })
    }
    prerender({container: e}) {
        this._now = performance.now(),
        e.renderGroup.gcTick = qhe++,
        this._updateInstructionGCTick(e.renderGroup, e.renderGroup.gcTick)
    }
    addRenderable(e) {
        this.enabled && (e._lastUsed === -1 && (this._managedRenderables.push(e),
        e.once("destroyed", this._removeRenderable, this)),
        e._lastUsed = this._now)
    }
    run() {
        var o;
        const e = this._now
          , n = this._managedRenderables
          , r = this._renderer.renderPipes;
        let i = 0;
        for (let s = 0; s < n.length; s++) {
            const a = n[s];
            if (a === null) {
                i++;
                continue
            }
            const l = a.renderGroup ?? a.parentRenderGroup
              , c = ((o = l == null ? void 0 : l.instructionSet) == null ? void 0 : o.gcTick) ?? -1;
            if (((l == null ? void 0 : l.gcTick) ?? 0) === c && (a._lastUsed = e),
            e - a._lastUsed > this.maxUnusedTime) {
                if (!a.destroyed) {
                    const u = r;
                    l && (l.structureDidChange = !0),
                    u[a.renderPipeId].destroyRenderable(a)
                }
                a._lastUsed = -1,
                i++,
                a.off("destroyed", this._removeRenderable, this)
            } else
                n[s - i] = a
        }
        n.length -= i
    }
    destroy() {
        this.enabled = !1,
        this._renderer = null,
        this._managedRenderables.length = 0,
        this._managedHashes.length = 0,
        this._managedArrays.length = 0
    }
    _removeRenderable(e) {
        const n = this._managedRenderables.indexOf(e);
        n >= 0 && (e.off("destroyed", this._removeRenderable, this),
        this._managedRenderables[n] = null)
    }
    _updateInstructionGCTick(e, n) {
        e.instructionSet.gcTick = n;
        for (const r of e.renderGroupChildren)
            this._updateInstructionGCTick(r, n)
    }
}
;
I2.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem],
    name: "renderableGC",
    priority: 0
};
I2.defaultOptions = {
    renderableGCActive: !0,
    renderableGCMaxUnusedTime: 6e4,
    renderableGCFrequency: 3e4
};
let Zhe = I2;
const O2 = class nN {
    constructor(e) {
        this._renderer = e,
        this.count = 0,
        this.checkCount = 0
    }
    init(e) {
        e = {
            ...nN.defaultOptions,
            ...e
        },
        this.checkCountMax = e.textureGCCheckCountMax,
        this.maxIdle = e.textureGCAMaxIdle ?? e.textureGCMaxIdle,
        this.active = e.textureGCActive
    }
    postrender() {
        this._renderer.renderingToScreen && (this.count++,
        this.active && (this.checkCount++,
        this.checkCount > this.checkCountMax && (this.checkCount = 0,
        this.run())))
    }
    run() {
        const e = this._renderer.texture.managedTextures;
        for (let n = 0; n < e.length; n++) {
            const r = e[n];
            r.autoGarbageCollect && r.resource && r._touched > -1 && this.count - r._touched > this.maxIdle && (r._touched = -1,
            r.unload())
        }
    }
    destroy() {
        this._renderer = null
    }
}
;
O2.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem],
    name: "textureGC"
};
O2.defaultOptions = {
    textureGCActive: !0,
    textureGCAMaxIdle: null,
    textureGCMaxIdle: 60 * 60,
    textureGCCheckCountMax: 600
};
let Jhe = O2;
const R2 = class rN {
    get autoDensity() {
        return this.texture.source.autoDensity
    }
    set autoDensity(e) {
        this.texture.source.autoDensity = e
    }
    get resolution() {
        return this.texture.source._resolution
    }
    set resolution(e) {
        this.texture.source.resize(this.texture.source.width, this.texture.source.height, e)
    }
    init(e) {
        e = {
            ...rN.defaultOptions,
            ...e
        },
        e.view && (Fe(rt, "ViewSystem.view has been renamed to ViewSystem.canvas"),
        e.canvas = e.view),
        this.screen = new vt(0,0,e.width,e.height),
        this.canvas = e.canvas || je.get().createCanvas(),
        this.antialias = !!e.antialias,
        this.texture = Ik(this.canvas, e),
        this.renderTarget = new Q_({
            colorTextures: [this.texture],
            depth: !!e.depth,
            isRoot: !0
        }),
        this.texture.source.transparent = e.backgroundAlpha < 1,
        this.resolution = e.resolution
    }
    resize(e, n, r) {
        this.texture.source.resize(e, n, r),
        this.screen.width = this.texture.frame.width,
        this.screen.height = this.texture.frame.height
    }
    destroy(e=!1) {
        (typeof e == "boolean" ? e : !!(e != null && e.removeView)) && this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas)
    }
}
;
R2.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
    name: "view",
    priority: 0
};
R2.defaultOptions = {
    width: 800,
    height: 600,
    autoDensity: !1,
    antialias: !1
};
let Qhe = R2;
const iN = [Ghe, Qk, P2, Qhe, Yk, Jhe, Jk, Hhe, _B, Zhe, eN]
  , oN = [qk, uk, Xk, zk, fk, hk, dk, Vk]
  , epe = [...iN, Pk, qde, jde, wk, pk, Uk, Dk, yk, Fk, Nk, bk, She, Ek, xk]
  , tpe = [...oN]
  , npe = [ak, Hk, Gk]
  , sN = []
  , aN = []
  , lN = [];
$e.handleByNamedList(V.WebGLSystem, sN);
$e.handleByNamedList(V.WebGLPipes, aN);
$e.handleByNamedList(V.WebGLPipesAdaptor, lN);
$e.add(...epe, ...tpe, ...npe);
class rpe extends tm {
    constructor() {
        const e = {
            name: "webgl",
            type: Kr.WEBGL,
            systems: sN,
            renderPipes: aN,
            renderPipeAdaptors: lN
        };
        super(e)
    }
}
const ipe = Object.freeze(Object.defineProperty({
    __proto__: null,
    WebGLRenderer: rpe
}, Symbol.toStringTag, {
    value: "Module"
}));
class cN {
    constructor(e) {
        this._hash = Object.create(null),
        this._renderer = e,
        this._renderer.renderableGC.addManagedHash(this, "_hash")
    }
    contextChange(e) {
        this._gpu = e
    }
    getBindGroup(e, n, r) {
        return e._updateKey(),
        this._hash[e._key] || this._createBindGroup(e, n, r)
    }
    _createBindGroup(e, n, r) {
        const i = this._gpu.device
          , o = n.layout[r]
          , s = []
          , a = this._renderer;
        for (const u in o) {
            const f = e.resources[u] ?? e.resources[o[u]];
            let d;
            if (f._resourceType === "uniformGroup") {
                const h = f;
                a.ubo.updateUniformGroup(h);
                const p = h.buffer;
                d = {
                    buffer: a.buffer.getGPUBuffer(p),
                    offset: 0,
                    size: p.descriptor.size
                }
            } else if (f._resourceType === "buffer") {
                const h = f;
                d = {
                    buffer: a.buffer.getGPUBuffer(h),
                    offset: 0,
                    size: h.descriptor.size
                }
            } else if (f._resourceType === "bufferResource") {
                const h = f;
                d = {
                    buffer: a.buffer.getGPUBuffer(h.buffer),
                    offset: h.offset,
                    size: h.size
                }
            } else if (f._resourceType === "textureSampler") {
                const h = f;
                d = a.texture.getGpuSampler(h)
            } else if (f._resourceType === "textureSource") {
                const h = f;
                d = a.texture.getGpuSource(h).createView({})
            }
            s.push({
                binding: o[u],
                resource: d
            })
        }
        const l = a.shader.getProgramData(n).bindGroups[r]
          , c = i.createBindGroup({
            layout: l,
            entries: s
        });
        return this._hash[e._key] = c,
        c
    }
    destroy() {
        for (const e of Object.keys(this._hash))
            this._hash[e] = null;
        this._hash = null,
        this._renderer = null
    }
}
cN.extension = {
    type: [V.WebGPUSystem],
    name: "bindGroup"
};
class uN {
    constructor(e) {
        this._gpuBuffers = Object.create(null),
        this._managedBuffers = [],
        e.renderableGC.addManagedHash(this, "_gpuBuffers")
    }
    contextChange(e) {
        this._gpu = e
    }
    getGPUBuffer(e) {
        return this._gpuBuffers[e.uid] || this.createGPUBuffer(e)
    }
    updateBuffer(e) {
        const n = this._gpuBuffers[e.uid] || this.createGPUBuffer(e)
          , r = e.data;
        return e._updateID && r && (e._updateID = 0,
        this._gpu.device.queue.writeBuffer(n, 0, r.buffer, 0, (e._updateSize || r.byteLength) + 3 & -4)),
        n
    }
    destroyAll() {
        for (const e in this._gpuBuffers)
            this._gpuBuffers[e].destroy();
        this._gpuBuffers = {}
    }
    createGPUBuffer(e) {
        this._gpuBuffers[e.uid] || (e.on("update", this.updateBuffer, this),
        e.on("change", this.onBufferChange, this),
        e.on("destroy", this.onBufferDestroy, this),
        this._managedBuffers.push(e));
        const n = this._gpu.device.createBuffer(e.descriptor);
        return e._updateID = 0,
        e.data && (z_(e.data.buffer, n.getMappedRange()),
        n.unmap()),
        this._gpuBuffers[e.uid] = n,
        n
    }
    onBufferChange(e) {
        this._gpuBuffers[e.uid].destroy(),
        e._updateID = 0,
        this._gpuBuffers[e.uid] = this.createGPUBuffer(e)
    }
    onBufferDestroy(e) {
        this._managedBuffers.splice(this._managedBuffers.indexOf(e), 1),
        this._destroyBuffer(e)
    }
    destroy() {
        this._managedBuffers.forEach(e => this._destroyBuffer(e)),
        this._managedBuffers = null,
        this._gpuBuffers = null
    }
    _destroyBuffer(e) {
        this._gpuBuffers[e.uid].destroy(),
        e.off("update", this.updateBuffer, this),
        e.off("change", this.onBufferChange, this),
        e.off("destroy", this.onBufferDestroy, this),
        this._gpuBuffers[e.uid] = null
    }
}
uN.extension = {
    type: [V.WebGPUSystem],
    name: "buffer"
};
class ope {
    constructor({minUniformOffsetAlignment: e}) {
        this._minUniformOffsetAlignment = 256,
        this.byteIndex = 0,
        this._minUniformOffsetAlignment = e,
        this.data = new Float32Array(65535)
    }
    clear() {
        this.byteIndex = 0
    }
    addEmptyGroup(e) {
        if (e > this._minUniformOffsetAlignment / 4)
            throw new Error(`UniformBufferBatch: array is too large: ${e * 4}`);
        const n = this.byteIndex;
        let r = n + e * 4;
        if (r = Math.ceil(r / this._minUniformOffsetAlignment) * this._minUniformOffsetAlignment,
        r > this.data.length * 4)
            throw new Error("UniformBufferBatch: ubo batch got too big");
        return this.byteIndex = r,
        n
    }
    addGroup(e) {
        const n = this.addEmptyGroup(e.length);
        for (let r = 0; r < e.length; r++)
            this.data[n / 4 + r] = e[r];
        return n
    }
    destroy() {
        this.data = null
    }
}
class fN {
    constructor(e) {
        this._colorMaskCache = 15,
        this._renderer = e
    }
    setMask(e) {
        this._colorMaskCache !== e && (this._colorMaskCache = e,
        this._renderer.pipeline.setColorMask(e))
    }
    destroy() {
        this._renderer = null,
        this._colorMaskCache = null
    }
}
fN.extension = {
    type: [V.WebGPUSystem],
    name: "colorMask"
};
class M2 {
    constructor(e) {
        this._renderer = e
    }
    async init(e) {
        return this._initPromise ? this._initPromise : (this._initPromise = (e.gpu ? Promise.resolve(e.gpu) : this._createDeviceAndAdaptor(e)).then(n => {
            this.gpu = n,
            this._renderer.runners.contextChange.emit(this.gpu)
        }
        ),
        this._initPromise)
    }
    contextChange(e) {
        this._renderer.gpu = e
    }
    async _createDeviceAndAdaptor(e) {
        const n = await je.get().getNavigator().gpu.requestAdapter({
            powerPreference: e.powerPreference,
            forceFallbackAdapter: e.forceFallbackAdapter
        })
          , r = ["texture-compression-bc", "texture-compression-astc", "texture-compression-etc2"].filter(o => n.features.has(o))
          , i = await n.requestDevice({
            requiredFeatures: r
        });
        return {
            adapter: n,
            device: i
        }
    }
    destroy() {
        this.gpu = null,
        this._renderer = null
    }
}
M2.extension = {
    type: [V.WebGPUSystem],
    name: "device"
};
M2.defaultOptions = {
    powerPreference: void 0,
    forceFallbackAdapter: !1
};
class dN {
    constructor(e) {
        this._boundBindGroup = Object.create(null),
        this._boundVertexBuffer = Object.create(null),
        this._renderer = e
    }
    renderStart() {
        this.commandFinished = new Promise(e => {
            this._resolveCommandFinished = e
        }
        ),
        this.commandEncoder = this._renderer.gpu.device.createCommandEncoder()
    }
    beginRenderPass(e) {
        this.endRenderPass(),
        this._clearCache(),
        this.renderPassEncoder = this.commandEncoder.beginRenderPass(e.descriptor)
    }
    endRenderPass() {
        this.renderPassEncoder && this.renderPassEncoder.end(),
        this.renderPassEncoder = null
    }
    setViewport(e) {
        this.renderPassEncoder.setViewport(e.x, e.y, e.width, e.height, 0, 1)
    }
    setPipelineFromGeometryProgramAndState(e, n, r, i) {
        const o = this._renderer.pipeline.getPipeline(e, n, r, i);
        this.setPipeline(o)
    }
    setPipeline(e) {
        this._boundPipeline !== e && (this._boundPipeline = e,
        this.renderPassEncoder.setPipeline(e))
    }
    _setVertexBuffer(e, n) {
        this._boundVertexBuffer[e] !== n && (this._boundVertexBuffer[e] = n,
        this.renderPassEncoder.setVertexBuffer(e, this._renderer.buffer.updateBuffer(n)))
    }
    _setIndexBuffer(e) {
        if (this._boundIndexBuffer === e)
            return;
        this._boundIndexBuffer = e;
        const n = e.data.BYTES_PER_ELEMENT === 2 ? "uint16" : "uint32";
        this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e), n)
    }
    resetBindGroup(e) {
        this._boundBindGroup[e] = null
    }
    setBindGroup(e, n, r) {
        if (this._boundBindGroup[e] === n)
            return;
        this._boundBindGroup[e] = n,
        n._touch(this._renderer.textureGC.count);
        const i = this._renderer.bindGroup.getBindGroup(n, r, e);
        this.renderPassEncoder.setBindGroup(e, i)
    }
    setGeometry(e, n) {
        const r = this._renderer.pipeline.getBufferNamesToBind(e, n);
        for (const i in r)
            this._setVertexBuffer(i, e.attributes[r[i]].buffer);
        e.indexBuffer && this._setIndexBuffer(e.indexBuffer)
    }
    _setShaderBindGroups(e, n) {
        for (const r in e.groups) {
            const i = e.groups[r];
            n || this._syncBindGroup(i),
            this.setBindGroup(r, i, e.gpuProgram)
        }
    }
    _syncBindGroup(e) {
        for (const n in e.resources) {
            const r = e.resources[n];
            r.isUniformGroup && this._renderer.ubo.updateUniformGroup(r)
        }
    }
    draw(e) {
        const {geometry: n, shader: r, state: i, topology: o, size: s, start: a, instanceCount: l, skipSync: c} = e;
        this.setPipelineFromGeometryProgramAndState(n, r.gpuProgram, i, o),
        this.setGeometry(n, r.gpuProgram),
        this._setShaderBindGroups(r, c),
        n.indexBuffer ? this.renderPassEncoder.drawIndexed(s || n.indexBuffer.data.length, l ?? n.instanceCount, a || 0) : this.renderPassEncoder.draw(s || n.getSize(), l ?? n.instanceCount, a || 0)
    }
    finishRenderPass() {
        this.renderPassEncoder && (this.renderPassEncoder.end(),
        this.renderPassEncoder = null)
    }
    postrender() {
        this.finishRenderPass(),
        this._gpu.device.queue.submit([this.commandEncoder.finish()]),
        this._resolveCommandFinished(),
        this.commandEncoder = null
    }
    restoreRenderPass() {
        const e = this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget, !1, [0, 0, 0, 1]);
        this.renderPassEncoder = this.commandEncoder.beginRenderPass(e);
        const n = this._boundPipeline
          , r = {
            ...this._boundVertexBuffer
        }
          , i = this._boundIndexBuffer
          , o = {
            ...this._boundBindGroup
        };
        this._clearCache();
        const s = this._renderer.renderTarget.viewport;
        this.renderPassEncoder.setViewport(s.x, s.y, s.width, s.height, 0, 1),
        this.setPipeline(n);
        for (const a in r)
            this._setVertexBuffer(a, r[a]);
        for (const a in o)
            this.setBindGroup(a, o[a], null);
        this._setIndexBuffer(i)
    }
    _clearCache() {
        for (let e = 0; e < 16; e++)
            this._boundBindGroup[e] = null,
            this._boundVertexBuffer[e] = null;
        this._boundIndexBuffer = null,
        this._boundPipeline = null
    }
    destroy() {
        this._renderer = null,
        this._gpu = null,
        this._boundBindGroup = null,
        this._boundVertexBuffer = null,
        this._boundIndexBuffer = null,
        this._boundPipeline = null
    }
    contextChange(e) {
        this._gpu = e
    }
}
dN.extension = {
    type: [V.WebGPUSystem],
    name: "encoder",
    priority: 1
};
class hN {
    constructor(e) {
        this._renderer = e
    }
    contextChange() {
        this.maxTextures = this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,
        this.maxBatchableTextures = this.maxTextures
    }
    destroy() {}
}
hN.extension = {
    type: [V.WebGPUSystem],
    name: "limits"
};
class pN {
    constructor(e) {
        this._renderTargetStencilState = Object.create(null),
        this._renderer = e,
        e.renderTarget.onRenderTargetChange.add(this)
    }
    onRenderTargetChange(e) {
        let n = this._renderTargetStencilState[e.uid];
        n || (n = this._renderTargetStencilState[e.uid] = {
            stencilMode: sn.DISABLED,
            stencilReference: 0
        }),
        this._activeRenderTarget = e,
        this.setStencilMode(n.stencilMode, n.stencilReference)
    }
    setStencilMode(e, n) {
        const r = this._renderTargetStencilState[this._activeRenderTarget.uid];
        r.stencilMode = e,
        r.stencilReference = n;
        const i = this._renderer;
        i.pipeline.setStencilMode(e),
        i.encoder.renderPassEncoder.setStencilReference(n)
    }
    destroy() {
        this._renderer.renderTarget.onRenderTargetChange.remove(this),
        this._renderer = null,
        this._activeRenderTarget = null,
        this._renderTargetStencilState = null
    }
}
pN.extension = {
    type: [V.WebGPUSystem],
    name: "stencil"
};
const Gp = {
    i32: {
        align: 4,
        size: 4
    },
    u32: {
        align: 4,
        size: 4
    },
    f32: {
        align: 4,
        size: 4
    },
    f16: {
        align: 2,
        size: 2
    },
    "vec2<i32>": {
        align: 8,
        size: 8
    },
    "vec2<u32>": {
        align: 8,
        size: 8
    },
    "vec2<f32>": {
        align: 8,
        size: 8
    },
    "vec2<f16>": {
        align: 4,
        size: 4
    },
    "vec3<i32>": {
        align: 16,
        size: 12
    },
    "vec3<u32>": {
        align: 16,
        size: 12
    },
    "vec3<f32>": {
        align: 16,
        size: 12
    },
    "vec3<f16>": {
        align: 8,
        size: 6
    },
    "vec4<i32>": {
        align: 16,
        size: 16
    },
    "vec4<u32>": {
        align: 16,
        size: 16
    },
    "vec4<f32>": {
        align: 16,
        size: 16
    },
    "vec4<f16>": {
        align: 8,
        size: 8
    },
    "mat2x2<f32>": {
        align: 8,
        size: 16
    },
    "mat2x2<f16>": {
        align: 4,
        size: 8
    },
    "mat3x2<f32>": {
        align: 8,
        size: 24
    },
    "mat3x2<f16>": {
        align: 4,
        size: 12
    },
    "mat4x2<f32>": {
        align: 8,
        size: 32
    },
    "mat4x2<f16>": {
        align: 4,
        size: 16
    },
    "mat2x3<f32>": {
        align: 16,
        size: 32
    },
    "mat2x3<f16>": {
        align: 8,
        size: 16
    },
    "mat3x3<f32>": {
        align: 16,
        size: 48
    },
    "mat3x3<f16>": {
        align: 8,
        size: 24
    },
    "mat4x3<f32>": {
        align: 16,
        size: 64
    },
    "mat4x3<f16>": {
        align: 8,
        size: 32
    },
    "mat2x4<f32>": {
        align: 16,
        size: 32
    },
    "mat2x4<f16>": {
        align: 8,
        size: 16
    },
    "mat3x4<f32>": {
        align: 16,
        size: 48
    },
    "mat3x4<f16>": {
        align: 8,
        size: 24
    },
    "mat4x4<f32>": {
        align: 16,
        size: 64
    },
    "mat4x4<f16>": {
        align: 8,
        size: 32
    }
};
function spe(t) {
    const e = t.map(r => ({
        data: r,
        offset: 0,
        size: 0
    }));
    let n = 0;
    for (let r = 0; r < e.length; r++) {
        const i = e[r];
        let o = Gp[i.data.type].size;
        const s = Gp[i.data.type].align;
        if (!Gp[i.data.type])
            throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${i.data.type}`);
        i.data.size > 1 && (o = Math.max(o, s) * i.data.size),
        n = Math.ceil(n / s) * s,
        i.size = o,
        i.offset = n,
        n += o
    }
    return n = Math.ceil(n / 16) * 16,
    {
        uboElements: e,
        size: n
    }
}
function ape(t, e) {
    const {size: n, align: r} = Gp[t.data.type]
      , i = (r - n) / 4
      , o = t.data.type.indexOf("i32") >= 0 ? "dataInt32" : "data";
    return `
         v = uv.${t.data.name};
         ${e !== 0 ? `offset += ${e};` : ""}

         arrayOffset = offset;

         t = 0;

         for(var i=0; i < ${t.data.size * (n / 4)}; i++)
         {
             for(var j = 0; j < ${n / 4}; j++)
             {
                 ${o}[arrayOffset++] = v[t++];
             }
             ${i !== 0 ? `arrayOffset += ${i};` : ""}
         }
     `
}
function lpe(t) {
    return Ak(t, "uboWgsl", ape, Qde)
}
class gN extends Sk {
    constructor() {
        super({
            createUboElements: spe,
            generateUboSync: lpe
        })
    }
}
gN.extension = {
    type: [V.WebGPUSystem],
    name: "ubo"
};
const bs = 128;
class mN {
    constructor(e) {
        this._bindGroupHash = Object.create(null),
        this._buffers = [],
        this._bindGroups = [],
        this._bufferResources = [],
        this._renderer = e,
        this._renderer.renderableGC.addManagedHash(this, "_bindGroupHash"),
        this._batchBuffer = new ope({
            minUniformOffsetAlignment: bs
        });
        const n = 256 / bs;
        for (let r = 0; r < n; r++) {
            let i = it.UNIFORM | it.COPY_DST;
            r === 0 && (i |= it.COPY_SRC),
            this._buffers.push(new zr({
                data: this._batchBuffer.data,
                usage: i
            }))
        }
    }
    renderEnd() {
        this._uploadBindGroups(),
        this._resetBindGroups()
    }
    _resetBindGroups() {
        for (const e in this._bindGroupHash)
            this._bindGroupHash[e] = null;
        this._batchBuffer.clear()
    }
    getUniformBindGroup(e, n) {
        if (!n && this._bindGroupHash[e.uid])
            return this._bindGroupHash[e.uid];
        this._renderer.ubo.ensureUniformGroup(e);
        const r = e.buffer.data
          , i = this._batchBuffer.addEmptyGroup(r.length);
        return this._renderer.ubo.syncUniformGroup(e, this._batchBuffer.data, i / 4),
        this._bindGroupHash[e.uid] = this._getBindGroup(i / bs),
        this._bindGroupHash[e.uid]
    }
    getUboResource(e) {
        this._renderer.ubo.updateUniformGroup(e);
        const n = e.buffer.data
          , r = this._batchBuffer.addGroup(n);
        return this._getBufferResource(r / bs)
    }
    getArrayBindGroup(e) {
        const n = this._batchBuffer.addGroup(e);
        return this._getBindGroup(n / bs)
    }
    getArrayBufferResource(e) {
        const r = this._batchBuffer.addGroup(e) / bs;
        return this._getBufferResource(r)
    }
    _getBufferResource(e) {
        if (!this._bufferResources[e]) {
            const n = this._buffers[e % 2];
            this._bufferResources[e] = new S2({
                buffer: n,
                offset: (e / 2 | 0) * 256,
                size: bs
            })
        }
        return this._bufferResources[e]
    }
    _getBindGroup(e) {
        if (!this._bindGroups[e]) {
            const n = new Ko({
                0: this._getBufferResource(e)
            });
            this._bindGroups[e] = n
        }
        return this._bindGroups[e]
    }
    _uploadBindGroups() {
        const e = this._renderer.buffer
          , n = this._buffers[0];
        n.update(this._batchBuffer.byteIndex),
        e.updateBuffer(n);
        const r = this._renderer.gpu.device.createCommandEncoder();
        for (let i = 1; i < this._buffers.length; i++) {
            const o = this._buffers[i];
            r.copyBufferToBuffer(e.getGPUBuffer(n), bs, e.getGPUBuffer(o), 0, this._batchBuffer.byteIndex)
        }
        this._renderer.gpu.device.queue.submit([r.finish()])
    }
    destroy() {
        for (let e = 0; e < this._bindGroups.length; e++)
            this._bindGroups[e].destroy();
        this._bindGroups = null,
        this._bindGroupHash = null;
        for (let e = 0; e < this._buffers.length; e++)
            this._buffers[e].destroy();
        this._buffers = null;
        for (let e = 0; e < this._bufferResources.length; e++)
            this._bufferResources[e].destroy();
        this._bufferResources = null,
        this._batchBuffer.destroy(),
        this._bindGroupHash = null,
        this._renderer = null
    }
}
mN.extension = {
    type: [V.WebGPUPipes],
    name: "uniformBatch"
};
const cpe = {
    "point-list": 0,
    "line-list": 1,
    "line-strip": 2,
    "triangle-list": 3,
    "triangle-strip": 4
};
function upe(t, e, n, r, i) {
    return t << 24 | e << 16 | n << 10 | r << 5 | i
}
function fpe(t, e, n, r) {
    return n << 6 | t << 3 | r << 1 | e
}
class vN {
    constructor(e) {
        this._moduleCache = Object.create(null),
        this._bufferLayoutsCache = Object.create(null),
        this._bindingNamesCache = Object.create(null),
        this._pipeCache = Object.create(null),
        this._pipeStateCaches = Object.create(null),
        this._colorMask = 15,
        this._multisampleCount = 1,
        this._renderer = e
    }
    contextChange(e) {
        this._gpu = e,
        this.setStencilMode(sn.DISABLED),
        this._updatePipeHash()
    }
    setMultisampleCount(e) {
        this._multisampleCount !== e && (this._multisampleCount = e,
        this._updatePipeHash())
    }
    setRenderTarget(e) {
        this._multisampleCount = e.msaaSamples,
        this._depthStencilAttachment = e.descriptor.depthStencilAttachment ? 1 : 0,
        this._updatePipeHash()
    }
    setColorMask(e) {
        this._colorMask !== e && (this._colorMask = e,
        this._updatePipeHash())
    }
    setStencilMode(e) {
        this._stencilMode !== e && (this._stencilMode = e,
        this._stencilState = ga[e],
        this._updatePipeHash())
    }
    setPipeline(e, n, r, i) {
        const o = this.getPipeline(e, n, r);
        i.setPipeline(o)
    }
    getPipeline(e, n, r, i) {
        e._layoutKey || (mk(e, n.attributeData),
        this._generateBufferKey(e)),
        i || (i = e.topology);
        const o = upe(e._layoutKey, n._layoutKey, r.data, r._blendModeId, cpe[i]);
        return this._pipeCache[o] ? this._pipeCache[o] : (this._pipeCache[o] = this._createPipeline(e, n, r, i),
        this._pipeCache[o])
    }
    _createPipeline(e, n, r, i) {
        const o = this._gpu.device
          , s = this._createVertexBufferLayouts(e, n)
          , a = this._renderer.state.getColorTargets(r);
        a[0].writeMask = this._stencilMode === sn.RENDERING_MASK_ADD ? 0 : this._colorMask;
        const l = this._renderer.shader.getProgramData(n).pipeline
          , c = {
            vertex: {
                module: this._getModule(n.vertex.source),
                entryPoint: n.vertex.entryPoint,
                buffers: s
            },
            fragment: {
                module: this._getModule(n.fragment.source),
                entryPoint: n.fragment.entryPoint,
                targets: a
            },
            primitive: {
                topology: i,
                cullMode: r.cullMode
            },
            layout: l,
            multisample: {
                count: this._multisampleCount
            },
            label: "PIXI Pipeline"
        };
        return this._depthStencilAttachment && (c.depthStencil = {
            ...this._stencilState,
            format: "depth24plus-stencil8",
            depthWriteEnabled: r.depthTest,
            depthCompare: r.depthTest ? "less" : "always"
        }),
        o.createRenderPipeline(c)
    }
    _getModule(e) {
        return this._moduleCache[e] || this._createModule(e)
    }
    _createModule(e) {
        const n = this._gpu.device;
        return this._moduleCache[e] = n.createShaderModule({
            code: e
        }),
        this._moduleCache[e]
    }
    _generateBufferKey(e) {
        const n = [];
        let r = 0;
        const i = Object.keys(e.attributes).sort();
        for (let s = 0; s < i.length; s++) {
            const a = e.attributes[i[s]];
            n[r++] = a.offset,
            n[r++] = a.format,
            n[r++] = a.stride,
            n[r++] = a.instance
        }
        const o = n.join("|");
        return e._layoutKey = fd(o, "geometry"),
        e._layoutKey
    }
    _generateAttributeLocationsKey(e) {
        const n = [];
        let r = 0;
        const i = Object.keys(e.attributeData).sort();
        for (let s = 0; s < i.length; s++) {
            const a = e.attributeData[i[s]];
            n[r++] = a.location
        }
        const o = n.join("|");
        return e._attributeLocationsKey = fd(o, "programAttributes"),
        e._attributeLocationsKey
    }
    getBufferNamesToBind(e, n) {
        const r = e._layoutKey << 16 | n._attributeLocationsKey;
        if (this._bindingNamesCache[r])
            return this._bindingNamesCache[r];
        const i = this._createVertexBufferLayouts(e, n)
          , o = Object.create(null)
          , s = n.attributeData;
        for (let a = 0; a < i.length; a++) {
            const c = Object.values(i[a].attributes)[0].shaderLocation;
            for (const u in s)
                if (s[u].location === c) {
                    o[a] = u;
                    break
                }
        }
        return this._bindingNamesCache[r] = o,
        o
    }
    _createVertexBufferLayouts(e, n) {
        n._attributeLocationsKey || this._generateAttributeLocationsKey(n);
        const r = e._layoutKey << 16 | n._attributeLocationsKey;
        if (this._bufferLayoutsCache[r])
            return this._bufferLayoutsCache[r];
        const i = [];
        return e.buffers.forEach(o => {
            const s = {
                arrayStride: 0,
                stepMode: "vertex",
                attributes: []
            }
              , a = s.attributes;
            for (const l in n.attributeData) {
                const c = e.attributes[l];
                (c.divisor ?? 1) !== 1 && Ne(`Attribute ${l} has an invalid divisor value of '${c.divisor}'. WebGPU only supports a divisor value of 1`),
                c.buffer === o && (s.arrayStride = c.stride,
                s.stepMode = c.instance ? "instance" : "vertex",
                a.push({
                    shaderLocation: n.attributeData[l].location,
                    offset: c.offset,
                    format: c.format
                }))
            }
            a.length && i.push(s)
        }
        ),
        this._bufferLayoutsCache[r] = i,
        i
    }
    _updatePipeHash() {
        const e = fpe(this._stencilMode, this._multisampleCount, this._colorMask, this._depthStencilAttachment);
        this._pipeStateCaches[e] || (this._pipeStateCaches[e] = Object.create(null)),
        this._pipeCache = this._pipeStateCaches[e]
    }
    destroy() {
        this._renderer = null,
        this._bufferLayoutsCache = null
    }
}
vN.extension = {
    type: [V.WebGPUSystem],
    name: "pipeline"
};
class dpe {
    constructor() {
        this.contexts = [],
        this.msaaTextures = [],
        this.msaaSamples = 1
    }
}
class hpe {
    init(e, n) {
        this._renderer = e,
        this._renderTargetSystem = n
    }
    copyToTexture(e, n, r, i, o) {
        const s = this._renderer
          , a = this._getGpuColorTexture(e)
          , l = s.texture.getGpuSource(n.source);
        return s.encoder.commandEncoder.copyTextureToTexture({
            texture: a,
            origin: r
        }, {
            texture: l,
            origin: o
        }, i),
        n
    }
    startRenderPass(e, n=!0, r, i) {
        const s = this._renderTargetSystem.getGpuRenderTarget(e)
          , a = this.getDescriptor(e, n, r);
        s.descriptor = a,
        this._renderer.pipeline.setRenderTarget(s),
        this._renderer.encoder.beginRenderPass(s),
        this._renderer.encoder.setViewport(i)
    }
    finishRenderPass() {
        this._renderer.encoder.endRenderPass()
    }
    _getGpuColorTexture(e) {
        const n = this._renderTargetSystem.getGpuRenderTarget(e);
        return n.contexts[0] ? n.contexts[0].getCurrentTexture() : this._renderer.texture.getGpuSource(e.colorTextures[0].source)
    }
    getDescriptor(e, n, r) {
        typeof n == "boolean" && (n = n ? Ur.ALL : Ur.NONE);
        const i = this._renderTargetSystem
          , o = i.getGpuRenderTarget(e)
          , s = e.colorTextures.map( (c, u) => {
            const f = o.contexts[u];
            let d, h;
            f ? d = f.getCurrentTexture().createView() : d = this._renderer.texture.getGpuSource(c).createView({
                mipLevelCount: 1
            }),
            o.msaaTextures[u] && (h = d,
            d = this._renderer.texture.getTextureView(o.msaaTextures[u]));
            const p = n & Ur.COLOR ? "clear" : "load";
            return r ?? (r = i.defaultClearColor),
            {
                view: d,
                resolveTarget: h,
                clearValue: r,
                storeOp: "store",
                loadOp: p
            }
        }
        );
        let a;
        if ((e.stencil || e.depth) && !e.depthStencilTexture && (e.ensureDepthStencilTexture(),
        e.depthStencilTexture.source.sampleCount = o.msaa ? 4 : 1),
        e.depthStencilTexture) {
            const c = n & Ur.STENCIL ? "clear" : "load"
              , u = n & Ur.DEPTH ? "clear" : "load";
            a = {
                view: this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),
                stencilStoreOp: "store",
                stencilLoadOp: c,
                depthClearValue: 1,
                depthLoadOp: u,
                depthStoreOp: "store"
            }
        }
        return {
            colorAttachments: s,
            depthStencilAttachment: a
        }
    }
    clear(e, n=!0, r, i) {
        if (!n)
            return;
        const {gpu: o, encoder: s} = this._renderer
          , a = o.device;
        if (s.commandEncoder === null) {
            const c = a.createCommandEncoder()
              , u = this.getDescriptor(e, n, r)
              , f = c.beginRenderPass(u);
            f.setViewport(i.x, i.y, i.width, i.height, 0, 1),
            f.end();
            const d = c.finish();
            a.queue.submit([d])
        } else
            this.startRenderPass(e, n, r, i)
    }
    initGpuRenderTarget(e) {
        e.isRoot = !0;
        const n = new dpe;
        return e.colorTextures.forEach( (r, i) => {
            if (r instanceof lo) {
                const o = r.resource.getContext("webgpu")
                  , s = r.transparent ? "premultiplied" : "opaque";
                try {
                    o.configure({
                        device: this._renderer.gpu.device,
                        usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC,
                        format: "bgra8unorm",
                        alphaMode: s
                    })
                } catch (a) {
                    console.error(a)
                }
                n.contexts[i] = o
            }
            if (n.msaa = r.source.antialias,
            r.source.antialias) {
                const o = new Cn({
                    width: 0,
                    height: 0,
                    sampleCount: 4
                });
                n.msaaTextures[i] = o
            }
        }
        ),
        n.msaa && (n.msaaSamples = 4,
        e.depthStencilTexture && (e.depthStencilTexture.source.sampleCount = 4)),
        n
    }
    destroyGpuRenderTarget(e) {
        e.contexts.forEach(n => {
            n.unconfigure()
        }
        ),
        e.msaaTextures.forEach(n => {
            n.destroy()
        }
        ),
        e.msaaTextures.length = 0,
        e.contexts.length = 0
    }
    ensureDepthStencilTexture(e) {
        const n = this._renderTargetSystem.getGpuRenderTarget(e);
        e.depthStencilTexture && n.msaa && (e.depthStencilTexture.source.sampleCount = 4)
    }
    resizeGpuRenderTarget(e) {
        const n = this._renderTargetSystem.getGpuRenderTarget(e);
        n.width = e.width,
        n.height = e.height,
        n.msaa && e.colorTextures.forEach( (r, i) => {
            const o = n.msaaTextures[i];
            o == null || o.resize(r.source.width, r.source.height, r.source._resolution)
        }
        )
    }
}
class yN extends Mk {
    constructor(e) {
        super(e),
        this.adaptor = new hpe,
        this.adaptor.init(e, this)
    }
}
yN.extension = {
    type: [V.WebGPUSystem],
    name: "renderTarget"
};
class _N {
    constructor() {
        this._gpuProgramData = Object.create(null)
    }
    contextChange(e) {
        this._gpu = e
    }
    getProgramData(e) {
        return this._gpuProgramData[e._layoutKey] || this._createGPUProgramData(e)
    }
    _createGPUProgramData(e) {
        const n = this._gpu.device
          , r = e.gpuLayout.map(o => n.createBindGroupLayout({
            entries: o
        }))
          , i = {
            bindGroupLayouts: r
        };
        return this._gpuProgramData[e._layoutKey] = {
            bindGroups: r,
            pipeline: n.createPipelineLayout(i)
        },
        this._gpuProgramData[e._layoutKey]
    }
    destroy() {
        this._gpu = null,
        this._gpuProgramData = null
    }
}
_N.extension = {
    type: [V.WebGPUSystem],
    name: "shader"
};
const Dr = {};
Dr.normal = {
    alpha: {
        srcFactor: "one",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    },
    color: {
        srcFactor: "one",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    }
};
Dr.add = {
    alpha: {
        srcFactor: "src-alpha",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    },
    color: {
        srcFactor: "one",
        dstFactor: "one",
        operation: "add"
    }
};
Dr.multiply = {
    alpha: {
        srcFactor: "one",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    },
    color: {
        srcFactor: "dst",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    }
};
Dr.screen = {
    alpha: {
        srcFactor: "one",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    },
    color: {
        srcFactor: "one",
        dstFactor: "one-minus-src",
        operation: "add"
    }
};
Dr.overlay = {
    alpha: {
        srcFactor: "one",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    },
    color: {
        srcFactor: "one",
        dstFactor: "one-minus-src",
        operation: "add"
    }
};
Dr.none = {
    alpha: {
        srcFactor: "one",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    },
    color: {
        srcFactor: "zero",
        dstFactor: "zero",
        operation: "add"
    }
};
Dr["normal-npm"] = {
    alpha: {
        srcFactor: "one",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    },
    color: {
        srcFactor: "src-alpha",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    }
};
Dr["add-npm"] = {
    alpha: {
        srcFactor: "one",
        dstFactor: "one",
        operation: "add"
    },
    color: {
        srcFactor: "src-alpha",
        dstFactor: "one",
        operation: "add"
    }
};
Dr["screen-npm"] = {
    alpha: {
        srcFactor: "one",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    },
    color: {
        srcFactor: "src-alpha",
        dstFactor: "one-minus-src",
        operation: "add"
    }
};
Dr.erase = {
    alpha: {
        srcFactor: "zero",
        dstFactor: "one-minus-src-alpha",
        operation: "add"
    },
    color: {
        srcFactor: "zero",
        dstFactor: "one-minus-src",
        operation: "add"
    }
};
Dr.min = {
    alpha: {
        srcFactor: "one",
        dstFactor: "one",
        operation: "min"
    },
    color: {
        srcFactor: "one",
        dstFactor: "one",
        operation: "min"
    }
};
Dr.max = {
    alpha: {
        srcFactor: "one",
        dstFactor: "one",
        operation: "max"
    },
    color: {
        srcFactor: "one",
        dstFactor: "one",
        operation: "max"
    }
};
class xN {
    constructor() {
        this.defaultState = new $i,
        this.defaultState.blend = !0
    }
    contextChange(e) {
        this.gpu = e
    }
    getColorTargets(e) {
        return [{
            format: "bgra8unorm",
            writeMask: 0,
            blend: Dr[e.blendMode] || Dr.normal
        }]
    }
    destroy() {
        this.gpu = null
    }
}
xN.extension = {
    type: [V.WebGPUSystem],
    name: "state"
};
const ppe = {
    type: "image",
    upload(t, e, n) {
        const r = t.resource
          , i = (t.pixelWidth | 0) * (t.pixelHeight | 0)
          , o = r.byteLength / i;
        n.device.queue.writeTexture({
            texture: e
        }, r, {
            offset: 0,
            rowsPerImage: t.pixelHeight,
            bytesPerRow: t.pixelHeight * o
        }, {
            width: t.pixelWidth,
            height: t.pixelHeight,
            depthOrArrayLayers: 1
        })
    }
}
  , bN = {
    "bc1-rgba-unorm": {
        blockBytes: 8,
        blockWidth: 4,
        blockHeight: 4
    },
    "bc2-rgba-unorm": {
        blockBytes: 16,
        blockWidth: 4,
        blockHeight: 4
    },
    "bc3-rgba-unorm": {
        blockBytes: 16,
        blockWidth: 4,
        blockHeight: 4
    },
    "bc7-rgba-unorm": {
        blockBytes: 16,
        blockWidth: 4,
        blockHeight: 4
    },
    "etc1-rgb-unorm": {
        blockBytes: 8,
        blockWidth: 4,
        blockHeight: 4
    },
    "etc2-rgba8unorm": {
        blockBytes: 16,
        blockWidth: 4,
        blockHeight: 4
    },
    "astc-4x4-unorm": {
        blockBytes: 16,
        blockWidth: 4,
        blockHeight: 4
    }
}
  , gpe = {
    blockBytes: 4,
    blockWidth: 1,
    blockHeight: 1
}
  , mpe = {
    type: "compressed",
    upload(t, e, n) {
        let r = t.pixelWidth
          , i = t.pixelHeight;
        const o = bN[t.format] || gpe;
        for (let s = 0; s < t.resource.length; s++) {
            const a = t.resource[s]
              , l = Math.ceil(r / o.blockWidth) * o.blockBytes;
            n.device.queue.writeTexture({
                texture: e,
                mipLevel: s
            }, a, {
                offset: 0,
                bytesPerRow: l
            }, {
                width: Math.ceil(r / o.blockWidth) * o.blockWidth,
                height: Math.ceil(i / o.blockHeight) * o.blockHeight,
                depthOrArrayLayers: 1
            }),
            r = Math.max(r >> 1, 1),
            i = Math.max(i >> 1, 1)
        }
    }
}
  , wN = {
    type: "image",
    upload(t, e, n) {
        const r = t.resource;
        if (!r)
            return;
        if (globalThis.HTMLImageElement && r instanceof HTMLImageElement) {
            const a = je.get().createCanvas(r.width, r.height);
            a.getContext("2d").drawImage(r, 0, 0, r.width, r.height),
            t.resource = a,
            Ne("ImageSource: Image element passed, converting to canvas and replacing resource.")
        }
        const i = Math.min(e.width, t.resourceWidth || t.pixelWidth)
          , o = Math.min(e.height, t.resourceHeight || t.pixelHeight)
          , s = t.alphaMode === "premultiply-alpha-on-upload";
        n.device.queue.copyExternalImageToTexture({
            source: r
        }, {
            texture: e,
            premultipliedAlpha: s
        }, {
            width: i,
            height: o
        })
    }
}
  , vpe = {
    type: "video",
    upload(t, e, n) {
        wN.upload(t, e, n)
    }
};
class ype {
    constructor(e) {
        this.device = e,
        this.sampler = e.createSampler({
            minFilter: "linear"
        }),
        this.pipelines = {}
    }
    _getMipmapPipeline(e) {
        let n = this.pipelines[e];
        return n || (this.mipmapShaderModule || (this.mipmapShaderModule = this.device.createShaderModule({
            code: `
                        var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
                        vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));

                        struct VertexOutput {
                        @builtin(position) position : vec4<f32>,
                        @location(0) texCoord : vec2<f32>,
                        };

                        @vertex
                        fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {
                        var output : VertexOutput;
                        output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);
                        output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);
                        return output;
                        }

                        @group(0) @binding(0) var imgSampler : sampler;
                        @group(0) @binding(1) var img : texture_2d<f32>;

                        @fragment
                        fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
                        return textureSample(img, imgSampler, texCoord);
                        }
                    `
        })),
        n = this.device.createRenderPipeline({
            layout: "auto",
            vertex: {
                module: this.mipmapShaderModule,
                entryPoint: "vertexMain"
            },
            fragment: {
                module: this.mipmapShaderModule,
                entryPoint: "fragmentMain",
                targets: [{
                    format: e
                }]
            }
        }),
        this.pipelines[e] = n),
        n
    }
    generateMipmap(e) {
        const n = this._getMipmapPipeline(e.format);
        if (e.dimension === "3d" || e.dimension === "1d")
            throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");
        let r = e;
        const i = e.depthOrArrayLayers || 1
          , o = e.usage & GPUTextureUsage.RENDER_ATTACHMENT;
        if (!o) {
            const l = {
                size: {
                    width: Math.ceil(e.width / 2),
                    height: Math.ceil(e.height / 2),
                    depthOrArrayLayers: i
                },
                format: e.format,
                usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_SRC | GPUTextureUsage.RENDER_ATTACHMENT,
                mipLevelCount: e.mipLevelCount - 1
            };
            r = this.device.createTexture(l)
        }
        const s = this.device.createCommandEncoder({})
          , a = n.getBindGroupLayout(0);
        for (let l = 0; l < i; ++l) {
            let c = e.createView({
                baseMipLevel: 0,
                mipLevelCount: 1,
                dimension: "2d",
                baseArrayLayer: l,
                arrayLayerCount: 1
            })
              , u = o ? 1 : 0;
            for (let f = 1; f < e.mipLevelCount; ++f) {
                const d = r.createView({
                    baseMipLevel: u++,
                    mipLevelCount: 1,
                    dimension: "2d",
                    baseArrayLayer: l,
                    arrayLayerCount: 1
                })
                  , h = s.beginRenderPass({
                    colorAttachments: [{
                        view: d,
                        storeOp: "store",
                        loadOp: "clear",
                        clearValue: {
                            r: 0,
                            g: 0,
                            b: 0,
                            a: 0
                        }
                    }]
                })
                  , p = this.device.createBindGroup({
                    layout: a,
                    entries: [{
                        binding: 0,
                        resource: this.sampler
                    }, {
                        binding: 1,
                        resource: c
                    }]
                });
                h.setPipeline(n),
                h.setBindGroup(0, p),
                h.draw(3, 1, 0, 0),
                h.end(),
                c = d
            }
        }
        if (!o) {
            const l = {
                width: Math.ceil(e.width / 2),
                height: Math.ceil(e.height / 2),
                depthOrArrayLayers: i
            };
            for (let c = 1; c < e.mipLevelCount; ++c)
                s.copyTextureToTexture({
                    texture: r,
                    mipLevel: c - 1
                }, {
                    texture: e,
                    mipLevel: c
                }, l),
                l.width = Math.ceil(l.width / 2),
                l.height = Math.ceil(l.height / 2)
        }
        return this.device.queue.submit([s.finish()]),
        o || r.destroy(),
        e
    }
}
class EN {
    constructor(e) {
        this.managedTextures = [],
        this._gpuSources = Object.create(null),
        this._gpuSamplers = Object.create(null),
        this._bindGroupHash = Object.create(null),
        this._textureViewHash = Object.create(null),
        this._uploads = {
            image: wN,
            buffer: ppe,
            video: vpe,
            compressed: mpe
        },
        this._renderer = e,
        e.renderableGC.addManagedHash(this, "_gpuSources"),
        e.renderableGC.addManagedHash(this, "_gpuSamplers"),
        e.renderableGC.addManagedHash(this, "_bindGroupHash"),
        e.renderableGC.addManagedHash(this, "_textureViewHash")
    }
    contextChange(e) {
        this._gpu = e
    }
    initSource(e) {
        return this._gpuSources[e.uid] ? this._gpuSources[e.uid] : this._initSource(e)
    }
    _initSource(e) {
        if (e.autoGenerateMipmaps) {
            const l = Math.max(e.pixelWidth, e.pixelHeight);
            e.mipLevelCount = Math.floor(Math.log2(l)) + 1
        }
        let n = GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST;
        e.uploadMethodId !== "compressed" && (n |= GPUTextureUsage.RENDER_ATTACHMENT,
        n |= GPUTextureUsage.COPY_SRC);
        const r = bN[e.format] || {
            blockBytes: 4,
            blockWidth: 1,
            blockHeight: 1
        }
          , i = Math.ceil(e.pixelWidth / r.blockWidth) * r.blockWidth
          , o = Math.ceil(e.pixelHeight / r.blockHeight) * r.blockHeight
          , s = {
            label: e.label,
            size: {
                width: i,
                height: o
            },
            format: e.format,
            sampleCount: e.sampleCount,
            mipLevelCount: e.mipLevelCount,
            dimension: e.dimension,
            usage: n
        }
          , a = this._gpuSources[e.uid] = this._gpu.device.createTexture(s);
        return this.managedTextures.includes(e) || (e.on("update", this.onSourceUpdate, this),
        e.on("resize", this.onSourceResize, this),
        e.on("destroy", this.onSourceDestroy, this),
        e.on("unload", this.onSourceUnload, this),
        e.on("updateMipmaps", this.onUpdateMipmaps, this),
        this.managedTextures.push(e)),
        this.onSourceUpdate(e),
        a
    }
    onSourceUpdate(e) {
        const n = this.getGpuSource(e);
        n && (this._uploads[e.uploadMethodId] && this._uploads[e.uploadMethodId].upload(e, n, this._gpu),
        e.autoGenerateMipmaps && e.mipLevelCount > 1 && this.onUpdateMipmaps(e))
    }
    onSourceUnload(e) {
        const n = this._gpuSources[e.uid];
        n && (this._gpuSources[e.uid] = null,
        n.destroy())
    }
    onUpdateMipmaps(e) {
        this._mipmapGenerator || (this._mipmapGenerator = new ype(this._gpu.device));
        const n = this.getGpuSource(e);
        this._mipmapGenerator.generateMipmap(n)
    }
    onSourceDestroy(e) {
        e.off("update", this.onSourceUpdate, this),
        e.off("unload", this.onSourceUnload, this),
        e.off("destroy", this.onSourceDestroy, this),
        e.off("resize", this.onSourceResize, this),
        e.off("updateMipmaps", this.onUpdateMipmaps, this),
        this.managedTextures.splice(this.managedTextures.indexOf(e), 1),
        this.onSourceUnload(e)
    }
    onSourceResize(e) {
        const n = this._gpuSources[e.uid];
        n ? (n.width !== e.pixelWidth || n.height !== e.pixelHeight) && (this._textureViewHash[e.uid] = null,
        this._bindGroupHash[e.uid] = null,
        this.onSourceUnload(e),
        this.initSource(e)) : this.initSource(e)
    }
    _initSampler(e) {
        return this._gpuSamplers[e._resourceId] = this._gpu.device.createSampler(e),
        this._gpuSamplers[e._resourceId]
    }
    getGpuSampler(e) {
        return this._gpuSamplers[e._resourceId] || this._initSampler(e)
    }
    getGpuSource(e) {
        return this._gpuSources[e.uid] || this.initSource(e)
    }
    getTextureBindGroup(e) {
        return this._bindGroupHash[e.uid] ?? this._createTextureBindGroup(e)
    }
    _createTextureBindGroup(e) {
        const n = e.source;
        return this._bindGroupHash[e.uid] = new Ko({
            0: n,
            1: n.style,
            2: new gr({
                uTextureMatrix: {
                    type: "mat3x3<f32>",
                    value: e.textureMatrix.mapCoord
                }
            })
        }),
        this._bindGroupHash[e.uid]
    }
    getTextureView(e) {
        const n = e.source;
        return this._textureViewHash[n.uid] ?? this._createTextureView(n)
    }
    _createTextureView(e) {
        return this._textureViewHash[e.uid] = this.getGpuSource(e).createView(),
        this._textureViewHash[e.uid]
    }
    generateCanvas(e) {
        const n = this._renderer
          , r = n.gpu.device.createCommandEncoder()
          , i = je.get().createCanvas();
        i.width = e.source.pixelWidth,
        i.height = e.source.pixelHeight;
        const o = i.getContext("webgpu");
        return o.configure({
            device: n.gpu.device,
            usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC,
            format: je.get().getNavigator().gpu.getPreferredCanvasFormat(),
            alphaMode: "premultiplied"
        }),
        r.copyTextureToTexture({
            texture: n.texture.getGpuSource(e.source),
            origin: {
                x: 0,
                y: 0
            }
        }, {
            texture: o.getCurrentTexture()
        }, {
            width: i.width,
            height: i.height
        }),
        n.gpu.device.queue.submit([r.finish()]),
        i
    }
    getPixels(e) {
        const n = this.generateCanvas(e)
          , r = sa.getOptimalCanvasAndContext(n.width, n.height)
          , i = r.context;
        i.drawImage(n, 0, 0);
        const {width: o, height: s} = n
          , a = i.getImageData(0, 0, o, s)
          , l = new Uint8ClampedArray(a.data.buffer);
        return sa.returnCanvasAndContext(r),
        {
            pixels: l,
            width: o,
            height: s
        }
    }
    destroy() {
        this.managedTextures.slice().forEach(e => this.onSourceDestroy(e)),
        this.managedTextures = null;
        for (const e of Object.keys(this._bindGroupHash)) {
            const n = Number(e)
              , r = this._bindGroupHash[n];
            r == null || r.destroy(),
            this._bindGroupHash[n] = null
        }
        this._gpu = null,
        this._mipmapGenerator = null,
        this._gpuSources = null,
        this._bindGroupHash = null,
        this._textureViewHash = null,
        this._gpuSamplers = null
    }
}
EN.extension = {
    type: [V.WebGPUSystem],
    name: "texture"
};
class SN {
    constructor() {
        this._maxTextures = 0
    }
    contextChange(e) {
        const n = new gr({
            uTransformMatrix: {
                value: new Oe,
                type: "mat3x3<f32>"
            },
            uColor: {
                value: new Float32Array([1, 1, 1, 1]),
                type: "vec4<f32>"
            },
            uRound: {
                value: 0,
                type: "f32"
            }
        });
        this._maxTextures = e.limits.maxBatchableTextures;
        const r = Qd({
            name: "graphics",
            bits: [o2, a2(this._maxTextures), $de, th]
        });
        this.shader = new yi({
            gpuProgram: r,
            resources: {
                localUniforms: n
            }
        })
    }
    execute(e, n) {
        const r = n.context
          , i = r.customShader || this.shader
          , o = e.renderer
          , s = o.graphicsContext
          , {batcher: a, instructions: l} = s.getContextRenderData(r)
          , c = o.encoder;
        c.setGeometry(a.geometry, i.gpuProgram);
        const u = o.globalUniforms.bindGroup;
        c.setBindGroup(0, u, i.gpuProgram);
        const f = o.renderPipes.uniformBatch.getUniformBindGroup(i.resources.localUniforms, !0);
        c.setBindGroup(2, f, i.gpuProgram);
        const d = l.instructions;
        let h = null;
        for (let p = 0; p < l.instructionSize; p++) {
            const y = d[p];
            if (y.topology !== h && (h = y.topology,
            c.setPipelineFromGeometryProgramAndState(a.geometry, i.gpuProgram, e.state, y.topology)),
            i.groups[1] = y.bindGroup,
            !y.gpuBindGroup) {
                const v = y.textures;
                y.bindGroup = i2(v.textures, v.count, this._maxTextures),
                y.gpuBindGroup = o.bindGroup.getBindGroup(y.bindGroup, i.gpuProgram, 1)
            }
            c.setBindGroup(1, y.bindGroup, i.gpuProgram),
            c.renderPassEncoder.drawIndexed(y.size, 1, y.start)
        }
    }
    destroy() {
        this.shader.destroy(!0),
        this.shader = null
    }
}
SN.extension = {
    type: [V.WebGPUPipesAdaptor],
    name: "graphics"
};
class CN {
    init() {
        const e = Qd({
            name: "mesh",
            bits: [Mf, Ude, th]
        });
        this._shader = new yi({
            gpuProgram: e,
            resources: {
                uTexture: Ae.EMPTY._source,
                uSampler: Ae.EMPTY._source.style,
                textureUniforms: {
                    uTextureMatrix: {
                        type: "mat3x3<f32>",
                        value: new Oe
                    }
                }
            }
        })
    }
    execute(e, n) {
        const r = e.renderer;
        let i = n._shader;
        if (!i)
            i = this._shader,
            i.groups[2] = r.texture.getTextureBindGroup(n.texture);
        else if (!i.gpuProgram) {
            Ne("Mesh shader has no gpuProgram", n.shader);
            return
        }
        const o = i.gpuProgram;
        if (o.autoAssignGlobalUniforms && (i.groups[0] = r.globalUniforms.bindGroup),
        o.autoAssignLocalUniforms) {
            const s = e.localUniforms;
            i.groups[1] = r.renderPipes.uniformBatch.getUniformBindGroup(s, !0)
        }
        r.encoder.draw({
            geometry: n._geometry,
            shader: i,
            state: n.state
        })
    }
    destroy() {
        this._shader.destroy(!0),
        this._shader = null
    }
}
CN.extension = {
    type: [V.WebGPUPipesAdaptor],
    name: "mesh"
};
const _pe = [...iN, gN, dN, M2, hN, uN, EN, yN, _N, xN, vN, fN, pN, cN]
  , xpe = [...oN, mN]
  , bpe = [lk, CN, SN]
  , AN = []
  , TN = []
  , PN = [];
$e.handleByNamedList(V.WebGPUSystem, AN);
$e.handleByNamedList(V.WebGPUPipes, TN);
$e.handleByNamedList(V.WebGPUPipesAdaptor, PN);
$e.add(..._pe, ...xpe, ...bpe);
class wpe extends tm {
    constructor() {
        const e = {
            name: "webgpu",
            type: Kr.WEBGPU,
            systems: AN,
            renderPipes: TN,
            renderPipeAdaptors: PN
        };
        super(e)
    }
}
const Epe = Object.freeze(Object.defineProperty({
    __proto__: null,
    WebGPURenderer: wpe
}, Symbol.toStringTag, {
    value: "Module"
}));
class Spe {
    constructor() {
        this.batches = [],
        this.batched = !1
    }
    destroy() {
        this.batches.forEach(e => {
            Hn.return(e)
        }
        ),
        this.batches.length = 0
    }
}
class IN {
    constructor(e, n) {
        this.state = $i.for2d(),
        this.renderer = e,
        this._adaptor = n,
        this.renderer.runners.contextChange.add(this)
    }
    contextChange() {
        this._adaptor.contextChange(this.renderer)
    }
    validateRenderable(e) {
        const n = e.context
          , r = !!e._gpuData
          , i = this.renderer.graphicsContext.updateGpuContext(n);
        return !!(i.isBatchable || r !== i.isBatchable)
    }
    addRenderable(e, n) {
        const r = this.renderer.graphicsContext.updateGpuContext(e.context);
        e.didViewUpdate && this._rebuild(e),
        r.isBatchable ? this._addToBatcher(e, n) : (this.renderer.renderPipes.batch.break(n),
        n.add(e))
    }
    updateRenderable(e) {
        const r = this._getGpuDataForRenderable(e).batches;
        for (let i = 0; i < r.length; i++) {
            const o = r[i];
            o._batcher.updateElement(o)
        }
    }
    execute(e) {
        if (!e.isRenderable)
            return;
        const n = this.renderer
          , r = e.context;
        if (!n.graphicsContext.getGpuContext(r).batches.length)
            return;
        const o = r.customShader || this._adaptor.shader;
        this.state.blendMode = e.groupBlendMode;
        const s = o.resources.localUniforms.uniforms;
        s.uTransformMatrix = e.groupTransform,
        s.uRound = n._roundPixels | e._roundPixels,
        rh(e.groupColorAlpha, s.uColor, 0),
        this._adaptor.execute(this, e)
    }
    _rebuild(e) {
        const n = this._getGpuDataForRenderable(e)
          , r = this.renderer.graphicsContext.updateGpuContext(e.context);
        n.destroy(),
        r.isBatchable && this._updateBatchesForRenderable(e, n)
    }
    _addToBatcher(e, n) {
        const r = this.renderer.renderPipes.batch
          , i = this._getGpuDataForRenderable(e).batches;
        for (let o = 0; o < i.length; o++) {
            const s = i[o];
            r.addToBatch(s, n)
        }
    }
    _getGpuDataForRenderable(e) {
        return e._gpuData[this.renderer.uid] || this._initGpuDataForRenderable(e)
    }
    _initGpuDataForRenderable(e) {
        const n = new Spe;
        return e._gpuData[this.renderer.uid] = n,
        n
    }
    _updateBatchesForRenderable(e, n) {
        const r = e.context
          , i = this.renderer.graphicsContext.getGpuContext(r)
          , o = this.renderer._roundPixels | e._roundPixels;
        n.batches = i.batches.map(s => {
            const a = Hn.get(f2);
            return s.copyTo(a),
            a.renderable = e,
            a.roundPixels = o,
            a
        }
        )
    }
    destroy() {
        this.renderer = null,
        this._adaptor.destroy(),
        this._adaptor = null,
        this.state = null
    }
}
IN.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "graphics"
};
const ON = class RN extends _2 {
    constructor(...e) {
        super({});
        let n = e[0] ?? {};
        typeof n == "number" && (Fe(rt, "PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),
        n = {
            width: n,
            height: e[1],
            verticesX: e[2],
            verticesY: e[3]
        }),
        this.build(n)
    }
    build(e) {
        e = {
            ...RN.defaultOptions,
            ...e
        },
        this.verticesX = this.verticesX ?? e.verticesX,
        this.verticesY = this.verticesY ?? e.verticesY,
        this.width = this.width ?? e.width,
        this.height = this.height ?? e.height;
        const n = this.verticesX * this.verticesY
          , r = []
          , i = []
          , o = []
          , s = this.verticesX - 1
          , a = this.verticesY - 1
          , l = this.width / s
          , c = this.height / a;
        for (let f = 0; f < n; f++) {
            const d = f % this.verticesX
              , h = f / this.verticesX | 0;
            r.push(d * l, h * c),
            i.push(d / s, h / a)
        }
        const u = s * a;
        for (let f = 0; f < u; f++) {
            const d = f % s
              , h = f / s | 0
              , p = h * this.verticesX + d
              , y = h * this.verticesX + d + 1
              , v = (h + 1) * this.verticesX + d
              , g = (h + 1) * this.verticesX + d + 1;
            o.push(p, y, v, y, g, v)
        }
        this.buffers[0].data = new Float32Array(r),
        this.buffers[1].data = new Float32Array(i),
        this.indexBuffer.data = new Uint32Array(o),
        this.buffers[0].update(),
        this.buffers[1].update(),
        this.indexBuffer.update()
    }
}
;
ON.defaultOptions = {
    width: 100,
    height: 100,
    verticesX: 10,
    verticesY: 10
};
let Cpe = ON;
class D2 {
    constructor() {
        this.batcherName = "default",
        this.packAsQuad = !1,
        this.indexOffset = 0,
        this.attributeOffset = 0,
        this.roundPixels = 0,
        this._batcher = null,
        this._batch = null,
        this._textureMatrixUpdateId = -1,
        this._uvUpdateId = -1
    }
    get blendMode() {
        return this.renderable.groupBlendMode
    }
    get topology() {
        return this._topology || this.geometry.topology
    }
    set topology(e) {
        this._topology = e
    }
    reset() {
        this.renderable = null,
        this.texture = null,
        this._batcher = null,
        this._batch = null,
        this.geometry = null,
        this._uvUpdateId = -1,
        this._textureMatrixUpdateId = -1
    }
    setTexture(e) {
        this.texture !== e && (this.texture = e,
        this._textureMatrixUpdateId = -1)
    }
    get uvs() {
        const n = this.geometry.getBuffer("aUV")
          , r = n.data;
        let i = r;
        const o = this.texture.textureMatrix;
        return o.isSimple || (i = this._transformedUvs,
        (this._textureMatrixUpdateId !== o._updateID || this._uvUpdateId !== n._updateID) && ((!i || i.length < r.length) && (i = this._transformedUvs = new Float32Array(r.length)),
        this._textureMatrixUpdateId = o._updateID,
        this._uvUpdateId = n._updateID,
        o.multiplyUvs(r, i))),
        i
    }
    get positions() {
        return this.geometry.positions
    }
    get indices() {
        return this.geometry.indices
    }
    get color() {
        return this.renderable.groupColorAlpha
    }
    get groupTransform() {
        return this.renderable.groupTransform
    }
    get attributeSize() {
        return this.geometry.positions.length / 2
    }
    get indexSize() {
        return this.geometry.indices.length
    }
}
class C3 {
    destroy() {}
}
class MN {
    constructor(e, n) {
        this.localUniforms = new gr({
            uTransformMatrix: {
                value: new Oe,
                type: "mat3x3<f32>"
            },
            uColor: {
                value: new Float32Array([1, 1, 1, 1]),
                type: "vec4<f32>"
            },
            uRound: {
                value: 0,
                type: "f32"
            }
        }),
        this.localUniformsBindGroup = new Ko({
            0: this.localUniforms
        }),
        this.renderer = e,
        this._adaptor = n,
        this._adaptor.init()
    }
    validateRenderable(e) {
        const n = this._getMeshData(e)
          , r = n.batched
          , i = e.batched;
        if (n.batched = i,
        r !== i)
            return !0;
        if (i) {
            const o = e._geometry;
            if (o.indices.length !== n.indexSize || o.positions.length !== n.vertexSize)
                return n.indexSize = o.indices.length,
                n.vertexSize = o.positions.length,
                !0;
            const s = this._getBatchableMesh(e);
            return s.texture.uid !== e._texture.uid && (s._textureMatrixUpdateId = -1),
            !s._batcher.checkAndUpdateTexture(s, e._texture)
        }
        return !1
    }
    addRenderable(e, n) {
        var o, s;
        const r = this.renderer.renderPipes.batch
          , i = this._getMeshData(e);
        if (e.didViewUpdate && (i.indexSize = (o = e._geometry.indices) == null ? void 0 : o.length,
        i.vertexSize = (s = e._geometry.positions) == null ? void 0 : s.length),
        i.batched) {
            const a = this._getBatchableMesh(e);
            a.setTexture(e._texture),
            a.geometry = e._geometry,
            r.addToBatch(a, n)
        } else
            r.break(n),
            n.add(e)
    }
    updateRenderable(e) {
        if (e.batched) {
            const n = this._getBatchableMesh(e);
            n.setTexture(e._texture),
            n.geometry = e._geometry,
            n._batcher.updateElement(n)
        }
    }
    execute(e) {
        if (!e.isRenderable)
            return;
        e.state.blendMode = gd(e.groupBlendMode, e.texture._source);
        const n = this.localUniforms;
        n.uniforms.uTransformMatrix = e.groupTransform,
        n.uniforms.uRound = this.renderer._roundPixels | e._roundPixels,
        n.update(),
        rh(e.groupColorAlpha, n.uniforms.uColor, 0),
        this._adaptor.execute(this, e)
    }
    _getMeshData(e) {
        var n, r;
        return (n = e._gpuData)[r = this.renderer.uid] || (n[r] = new C3),
        e._gpuData[this.renderer.uid].meshData || this._initMeshData(e)
    }
    _initMeshData(e) {
        return e._gpuData[this.renderer.uid].meshData = {
            batched: e.batched,
            indexSize: 0,
            vertexSize: 0
        },
        e._gpuData[this.renderer.uid].meshData
    }
    _getBatchableMesh(e) {
        var n, r;
        return (n = e._gpuData)[r = this.renderer.uid] || (n[r] = new C3),
        e._gpuData[this.renderer.uid].batchableMesh || this._initBatchableMesh(e)
    }
    _initBatchableMesh(e) {
        const n = new D2;
        return n.renderable = e,
        n.setTexture(e._texture),
        n.transform = e.groupTransform,
        n.roundPixels = this.renderer._roundPixels | e._roundPixels,
        e._gpuData[this.renderer.uid].batchableMesh = n,
        n
    }
    destroy() {
        this.localUniforms = null,
        this.localUniformsBindGroup = null,
        this._adaptor.destroy(),
        this._adaptor = null,
        this.renderer = null
    }
}
MN.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "mesh"
};
class Ape {
    execute(e, n) {
        const r = e.state
          , i = e.renderer
          , o = n.shader || e.defaultShader;
        o.resources.uTexture = n.texture._source,
        o.resources.uniforms = e.localUniforms;
        const s = i.gl
          , a = e.getBuffers(n);
        i.shader.bind(o),
        i.state.set(r),
        i.geometry.bind(a.geometry, o.glProgram);
        const c = a.geometry.indexBuffer.data.BYTES_PER_ELEMENT === 2 ? s.UNSIGNED_SHORT : s.UNSIGNED_INT;
        s.drawElements(s.TRIANGLES, n.particleChildren.length * 6, c, 0)
    }
}
class Tpe {
    execute(e, n) {
        const r = e.renderer
          , i = n.shader || e.defaultShader;
        i.groups[0] = r.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms, !0),
        i.groups[1] = r.texture.getTextureBindGroup(n.texture);
        const o = e.state
          , s = e.getBuffers(n);
        r.encoder.draw({
            geometry: s.geometry,
            shader: n.shader || e.defaultShader,
            state: o,
            size: n.particleChildren.length * 6
        })
    }
}
function A3(t, e=null) {
    const n = t * 6;
    if (n > 65535 ? e || (e = new Uint32Array(n)) : e || (e = new Uint16Array(n)),
    e.length !== n)
        throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${n}`);
    for (let r = 0, i = 0; r < n; r += 6,
    i += 4)
        e[r + 0] = i + 0,
        e[r + 1] = i + 1,
        e[r + 2] = i + 2,
        e[r + 3] = i + 0,
        e[r + 4] = i + 2,
        e[r + 5] = i + 3;
    return e
}
function Ppe(t) {
    return {
        dynamicUpdate: T3(t, !0),
        staticUpdate: T3(t, !1)
    }
}
function T3(t, e) {
    const n = [];
    n.push(`

        var index = 0;

        for (let i = 0; i < ps.length; ++i)
        {
            const p = ps[i];

            `);
    let r = 0;
    for (const o in t) {
        const s = t[o];
        if (e !== s.dynamic)
            continue;
        n.push(`offset = index + ${r}`),
        n.push(s.code);
        const a = oa(s.format);
        r += a.stride / 4
    }
    n.push(`
            index += stride * 4;
        }
    `),
    n.unshift(`
        var stride = ${r};
    `);
    const i = n.join(`
`);
    return new Function("ps","f32v","u32v",i)
}
class Ipe {
    constructor(e) {
        this._size = 0,
        this._generateParticleUpdateCache = {};
        const n = this._size = e.size ?? 1e3
          , r = e.properties;
        let i = 0
          , o = 0;
        for (const u in r) {
            const f = r[u]
              , d = oa(f.format);
            f.dynamic ? o += d.stride : i += d.stride
        }
        this._dynamicStride = o / 4,
        this._staticStride = i / 4,
        this.staticAttributeBuffer = new vc(n * 4 * i),
        this.dynamicAttributeBuffer = new vc(n * 4 * o),
        this.indexBuffer = A3(n);
        const s = new Jd;
        let a = 0
          , l = 0;
        this._staticBuffer = new zr({
            data: new Float32Array(1),
            label: "static-particle-buffer",
            shrinkToFit: !1,
            usage: it.VERTEX | it.COPY_DST
        }),
        this._dynamicBuffer = new zr({
            data: new Float32Array(1),
            label: "dynamic-particle-buffer",
            shrinkToFit: !1,
            usage: it.VERTEX | it.COPY_DST
        });
        for (const u in r) {
            const f = r[u]
              , d = oa(f.format);
            f.dynamic ? (s.addAttribute(f.attributeName, {
                buffer: this._dynamicBuffer,
                stride: this._dynamicStride * 4,
                offset: a * 4,
                format: f.format
            }),
            a += d.size) : (s.addAttribute(f.attributeName, {
                buffer: this._staticBuffer,
                stride: this._staticStride * 4,
                offset: l * 4,
                format: f.format
            }),
            l += d.size)
        }
        s.addIndex(this.indexBuffer);
        const c = this.getParticleUpdate(r);
        this._dynamicUpload = c.dynamicUpdate,
        this._staticUpload = c.staticUpdate,
        this.geometry = s
    }
    getParticleUpdate(e) {
        const n = Ope(e);
        return this._generateParticleUpdateCache[n] ? this._generateParticleUpdateCache[n] : (this._generateParticleUpdateCache[n] = this.generateParticleUpdate(e),
        this._generateParticleUpdateCache[n])
    }
    generateParticleUpdate(e) {
        return Ppe(e)
    }
    update(e, n) {
        e.length > this._size && (n = !0,
        this._size = Math.max(e.length, this._size * 1.5 | 0),
        this.staticAttributeBuffer = new vc(this._size * this._staticStride * 4 * 4),
        this.dynamicAttributeBuffer = new vc(this._size * this._dynamicStride * 4 * 4),
        this.indexBuffer = A3(this._size),
        this.geometry.indexBuffer.setDataWithSize(this.indexBuffer, this.indexBuffer.byteLength, !0));
        const r = this.dynamicAttributeBuffer;
        if (this._dynamicUpload(e, r.float32View, r.uint32View),
        this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View, e.length * this._dynamicStride * 4, !0),
        n) {
            const i = this.staticAttributeBuffer;
            this._staticUpload(e, i.float32View, i.uint32View),
            this._staticBuffer.setDataWithSize(i.float32View, e.length * this._staticStride * 4, !0)
        }
    }
    destroy() {
        this._staticBuffer.destroy(),
        this._dynamicBuffer.destroy(),
        this.geometry.destroy()
    }
}
function Ope(t) {
    const e = [];
    for (const n in t) {
        const r = t[n];
        e.push(n, r.code, r.dynamic ? "d" : "s")
    }
    return e.join("_")
}
var Rpe = `varying vec2 vUV;
varying vec4 vColor;

uniform sampler2D uTexture;

void main(void){
    vec4 color = texture2D(uTexture, vUV) * vColor;
    gl_FragColor = color;
}`
  , Mpe = `attribute vec2 aVertex;
attribute vec2 aUV;
attribute vec4 aColor;

attribute vec2 aPosition;
attribute float aRotation;

uniform mat3 uTranslationMatrix;
uniform float uRound;
uniform vec2 uResolution;
uniform vec4 uColor;

varying vec2 vUV;
varying vec4 vColor;

vec2 roundPixels(vec2 position, vec2 targetSize)
{       
    return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
}

void main(void){
    float cosRotation = cos(aRotation);
    float sinRotation = sin(aRotation);
    float x = aVertex.x * cosRotation - aVertex.y * sinRotation;
    float y = aVertex.x * sinRotation + aVertex.y * cosRotation;

    vec2 v = vec2(x, y);
    v = v + aPosition;

    gl_Position = vec4((uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);

    if(uRound == 1.0)
    {
        gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
    }

    vUV = aUV;
    vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor;
}
`
  , P3 = `
struct ParticleUniforms {
  uProjectionMatrix:mat3x3<f32>,
  uColor:vec4<f32>,
  uResolution:vec2<f32>,
  uRoundPixels:f32,
};

@group(0) @binding(0) var<uniform> uniforms: ParticleUniforms;

@group(1) @binding(0) var uTexture: texture_2d<f32>;
@group(1) @binding(1) var uSampler : sampler;

struct VSOutput {
    @builtin(position) position: vec4<f32>,
    @location(0) uv : vec2<f32>,
    @location(1) color : vec4<f32>,
  };
@vertex
fn mainVertex(
  @location(0) aVertex: vec2<f32>,
  @location(1) aPosition: vec2<f32>,
  @location(2) aUV: vec2<f32>,
  @location(3) aColor: vec4<f32>,
  @location(4) aRotation: f32,
) -> VSOutput {
  
   let v = vec2(
       aVertex.x * cos(aRotation) - aVertex.y * sin(aRotation),
       aVertex.x * sin(aRotation) + aVertex.y * cos(aRotation)
   ) + aPosition;

   let position = vec4((uniforms.uProjectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);

    let vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uniforms.uColor;

  return VSOutput(
   position,
   aUV,
   vColor,
  );
}

@fragment
fn mainFragment(
  @location(0) uv: vec2<f32>,
  @location(1) color: vec4<f32>,
  @builtin(position) position: vec4<f32>,
) -> @location(0) vec4<f32> {

    var sample = textureSample(uTexture, uSampler, uv) * color;
   
    return sample;
}`;
class Dpe extends yi {
    constructor() {
        const e = Fl.from({
            vertex: Mpe,
            fragment: Rpe
        })
          , n = pa.from({
            fragment: {
                source: P3,
                entryPoint: "mainFragment"
            },
            vertex: {
                source: P3,
                entryPoint: "mainVertex"
            }
        });
        super({
            glProgram: e,
            gpuProgram: n,
            resources: {
                uTexture: Ae.WHITE.source,
                uSampler: new yo({}),
                uniforms: {
                    uTranslationMatrix: {
                        value: new Oe,
                        type: "mat3x3<f32>"
                    },
                    uColor: {
                        value: new Rt(16777215),
                        type: "vec4<f32>"
                    },
                    uRound: {
                        value: 1,
                        type: "f32"
                    },
                    uResolution: {
                        value: [0, 0],
                        type: "vec2<f32>"
                    }
                }
            }
        })
    }
}
class DN {
    constructor(e, n) {
        this.state = $i.for2d(),
        this.localUniforms = new gr({
            uTranslationMatrix: {
                value: new Oe,
                type: "mat3x3<f32>"
            },
            uColor: {
                value: new Float32Array(4),
                type: "vec4<f32>"
            },
            uRound: {
                value: 1,
                type: "f32"
            },
            uResolution: {
                value: [0, 0],
                type: "vec2<f32>"
            }
        }),
        this.renderer = e,
        this.adaptor = n,
        this.defaultShader = new Dpe,
        this.state = $i.for2d()
    }
    validateRenderable(e) {
        return !1
    }
    addRenderable(e, n) {
        this.renderer.renderPipes.batch.break(n),
        n.add(e)
    }
    getBuffers(e) {
        return e._gpuData[this.renderer.uid] || this._initBuffer(e)
    }
    _initBuffer(e) {
        return e._gpuData[this.renderer.uid] = new Ipe({
            size: e.particleChildren.length,
            properties: e._properties
        }),
        e._gpuData[this.renderer.uid]
    }
    updateRenderable(e) {}
    execute(e) {
        const n = e.particleChildren;
        if (n.length === 0)
            return;
        const r = this.renderer
          , i = this.getBuffers(e);
        e.texture || (e.texture = n[0].texture);
        const o = this.state;
        i.update(n, e._childrenDirty),
        e._childrenDirty = !1,
        o.blendMode = gd(e.blendMode, e.texture._source);
        const s = this.localUniforms.uniforms
          , a = s.uTranslationMatrix;
        e.worldTransform.copyTo(a),
        a.prepend(r.globalUniforms.globalUniformData.projectionMatrix),
        s.uResolution = r.globalUniforms.globalUniformData.resolution,
        s.uRound = r._roundPixels | e._roundPixels,
        rh(e.groupColorAlpha, s.uColor, 0),
        this.adaptor.execute(this, e)
    }
    destroy() {
        this.defaultShader && (this.defaultShader.destroy(),
        this.defaultShader = null)
    }
}
class BN extends DN {
    constructor(e) {
        super(e, new Ape)
    }
}
BN.extension = {
    type: [V.WebGLPipes],
    name: "particle"
};
class kN extends DN {
    constructor(e) {
        super(e, new Tpe)
    }
}
kN.extension = {
    type: [V.WebGPUPipes],
    name: "particle"
};
const NN = class rx {
    constructor(e) {
        if (e instanceof Ae)
            this.texture = e,
            D_(this, rx.defaultOptions, {});
        else {
            const n = {
                ...rx.defaultOptions,
                ...e
            };
            D_(this, n, {})
        }
    }
    get alpha() {
        return this._alpha
    }
    set alpha(e) {
        this._alpha = Math.min(Math.max(e, 0), 1),
        this._updateColor()
    }
    get tint() {
        return Af(this._tint)
    }
    set tint(e) {
        this._tint = Rt.shared.setValue(e ?? 16777215).toBgrNumber(),
        this._updateColor()
    }
    _updateColor() {
        this.color = this._tint + ((this._alpha * 255 | 0) << 24)
    }
}
;
NN.defaultOptions = {
    anchorX: 0,
    anchorY: 0,
    x: 0,
    y: 0,
    scaleX: 1,
    scaleY: 1,
    rotation: 0,
    tint: 16777215,
    alpha: 1
};
let PPe = NN;
const I3 = {
    vertex: {
        attributeName: "aVertex",
        format: "float32x2",
        code: `
            const texture = p.texture;
            const sx = p.scaleX;
            const sy = p.scaleY;
            const ax = p.anchorX;
            const ay = p.anchorY;
            const trim = texture.trim;
            const orig = texture.orig;

            if (trim)
            {
                w1 = trim.x - (ax * orig.width);
                w0 = w1 + trim.width;

                h1 = trim.y - (ay * orig.height);
                h0 = h1 + trim.height;
            }
            else
            {
                w1 = -ax * (orig.width);
                w0 = w1 + orig.width;

                h1 = -ay * (orig.height);
                h0 = h1 + orig.height;
            }

            f32v[offset] = w1 * sx;
            f32v[offset + 1] = h1 * sy;

            f32v[offset + stride] = w0 * sx;
            f32v[offset + stride + 1] = h1 * sy;

            f32v[offset + (stride * 2)] = w0 * sx;
            f32v[offset + (stride * 2) + 1] = h0 * sy;

            f32v[offset + (stride * 3)] = w1 * sx;
            f32v[offset + (stride * 3) + 1] = h0 * sy;
        `,
        dynamic: !1
    },
    position: {
        attributeName: "aPosition",
        format: "float32x2",
        code: `
            var x = p.x;
            var y = p.y;

            f32v[offset] = x;
            f32v[offset + 1] = y;

            f32v[offset + stride] = x;
            f32v[offset + stride + 1] = y;

            f32v[offset + (stride * 2)] = x;
            f32v[offset + (stride * 2) + 1] = y;

            f32v[offset + (stride * 3)] = x;
            f32v[offset + (stride * 3) + 1] = y;
        `,
        dynamic: !0
    },
    rotation: {
        attributeName: "aRotation",
        format: "float32",
        code: `
            var rotation = p.rotation;

            f32v[offset] = rotation;
            f32v[offset + stride] = rotation;
            f32v[offset + (stride * 2)] = rotation;
            f32v[offset + (stride * 3)] = rotation;
        `,
        dynamic: !1
    },
    uvs: {
        attributeName: "aUV",
        format: "float32x2",
        code: `
            var uvs = p.texture.uvs;

            f32v[offset] = uvs.x0;
            f32v[offset + 1] = uvs.y0;

            f32v[offset + stride] = uvs.x1;
            f32v[offset + stride + 1] = uvs.y1;

            f32v[offset + (stride * 2)] = uvs.x2;
            f32v[offset + (stride * 2) + 1] = uvs.y2;

            f32v[offset + (stride * 3)] = uvs.x3;
            f32v[offset + (stride * 3) + 1] = uvs.y3;
        `,
        dynamic: !1
    },
    color: {
        attributeName: "aColor",
        format: "unorm8x4",
        code: `
            const c = p.color;

            u32v[offset] = c;
            u32v[offset + stride] = c;
            u32v[offset + (stride * 2)] = c;
            u32v[offset + (stride * 3)] = c;
        `,
        dynamic: !1
    }
}
  , Bpe = new Vn(0,0,0,0)
  , FN = class ix extends qd {
    constructor(e={}) {
        e = {
            ...ix.defaultOptions,
            ...e,
            dynamicProperties: {
                ...ix.defaultOptions.dynamicProperties,
                ...e == null ? void 0 : e.dynamicProperties
            }
        };
        const {dynamicProperties: n, shader: r, roundPixels: i, texture: o, particles: s, ...a} = e;
        super({
            label: "ParticleContainer",
            ...a
        }),
        this.renderPipeId = "particle",
        this.batched = !1,
        this._childrenDirty = !1,
        this.texture = o || null,
        this.shader = r,
        this._properties = {};
        for (const l in I3) {
            const c = I3[l]
              , u = n[l];
            this._properties[l] = {
                ...c,
                dynamic: u
            }
        }
        this.allowChildren = !0,
        this.roundPixels = i ?? !1,
        this.particleChildren = s ?? []
    }
    addParticle(...e) {
        for (let n = 0; n < e.length; n++)
            this.particleChildren.push(e[n]);
        return this.onViewUpdate(),
        e[0]
    }
    removeParticle(...e) {
        let n = !1;
        for (let r = 0; r < e.length; r++) {
            const i = this.particleChildren.indexOf(e[r]);
            i > -1 && (this.particleChildren.splice(i, 1),
            n = !0)
        }
        return n && this.onViewUpdate(),
        e[0]
    }
    update() {
        this._childrenDirty = !0
    }
    onViewUpdate() {
        this._childrenDirty = !0,
        super.onViewUpdate()
    }
    get bounds() {
        return Bpe
    }
    updateBounds() {}
    destroy(e=!1) {
        var r, i;
        if (super.destroy(e),
        typeof e == "boolean" ? e : e == null ? void 0 : e.texture) {
            const o = typeof e == "boolean" ? e : e == null ? void 0 : e.textureSource
              , s = this.texture ?? ((r = this.particleChildren[0]) == null ? void 0 : r.texture);
            s && s.destroy(o)
        }
        this.texture = null,
        (i = this.shader) == null || i.destroy()
    }
    removeParticles(e, n) {
        e ?? (e = 0),
        n ?? (n = this.particleChildren.length);
        const r = this.particleChildren.splice(e, n - e);
        return this.onViewUpdate(),
        r
    }
    removeParticleAt(e) {
        const n = this.particleChildren.splice(e, 1);
        return this.onViewUpdate(),
        n[0]
    }
    addParticleAt(e, n) {
        return this.particleChildren.splice(n, 0, e),
        this.onViewUpdate(),
        e
    }
    addChild(...e) {
        throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")
    }
    removeChild(...e) {
        throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")
    }
    removeChildren(e, n) {
        throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")
    }
    removeChildAt(e) {
        throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")
    }
    getChildAt(e) {
        throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")
    }
    setChildIndex(e, n) {
        throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")
    }
    getChildIndex(e) {
        throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")
    }
    addChildAt(e, n) {
        throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")
    }
    swapChildren(e, n) {
        throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")
    }
    reparentChild(...e) {
        throw new Error("ParticleContainer.reparentChild() is not available with the particle container")
    }
    reparentChildAt(e, n) {
        throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")
    }
}
;
FN.defaultOptions = {
    dynamicProperties: {
        vertex: !1,
        position: !0,
        rotation: !1,
        uvs: !1,
        color: !1
    },
    roundPixels: !1
};
let IPe = FN;
const LN = class $N extends Cpe {
    constructor(e={}) {
        e = {
            ...$N.defaultOptions,
            ...e
        },
        super({
            width: e.width,
            height: e.height,
            verticesX: 4,
            verticesY: 4
        }),
        this.update(e)
    }
    update(e) {
        var n, r;
        this.width = e.width ?? this.width,
        this.height = e.height ?? this.height,
        this._originalWidth = e.originalWidth ?? this._originalWidth,
        this._originalHeight = e.originalHeight ?? this._originalHeight,
        this._leftWidth = e.leftWidth ?? this._leftWidth,
        this._rightWidth = e.rightWidth ?? this._rightWidth,
        this._topHeight = e.topHeight ?? this._topHeight,
        this._bottomHeight = e.bottomHeight ?? this._bottomHeight,
        this._anchorX = (n = e.anchor) == null ? void 0 : n.x,
        this._anchorY = (r = e.anchor) == null ? void 0 : r.y,
        this.updateUvs(),
        this.updatePositions()
    }
    updatePositions() {
        const e = this.positions
          , {width: n, height: r, _leftWidth: i, _rightWidth: o, _topHeight: s, _bottomHeight: a, _anchorX: l, _anchorY: c} = this
          , u = i + o
          , f = n > u ? 1 : n / u
          , d = s + a
          , h = r > d ? 1 : r / d
          , p = Math.min(f, h)
          , y = l * n
          , v = c * r;
        e[0] = e[8] = e[16] = e[24] = -y,
        e[2] = e[10] = e[18] = e[26] = i * p - y,
        e[4] = e[12] = e[20] = e[28] = n - o * p - y,
        e[6] = e[14] = e[22] = e[30] = n - y,
        e[1] = e[3] = e[5] = e[7] = -v,
        e[9] = e[11] = e[13] = e[15] = s * p - v,
        e[17] = e[19] = e[21] = e[23] = r - a * p - v,
        e[25] = e[27] = e[29] = e[31] = r - v,
        this.getBuffer("aPosition").update()
    }
    updateUvs() {
        const e = this.uvs;
        e[0] = e[8] = e[16] = e[24] = 0,
        e[1] = e[3] = e[5] = e[7] = 0,
        e[6] = e[14] = e[22] = e[30] = 1,
        e[25] = e[27] = e[29] = e[31] = 1;
        const n = 1 / this._originalWidth
          , r = 1 / this._originalHeight;
        e[2] = e[10] = e[18] = e[26] = n * this._leftWidth,
        e[9] = e[11] = e[13] = e[15] = r * this._topHeight,
        e[4] = e[12] = e[20] = e[28] = 1 - n * this._rightWidth,
        e[17] = e[19] = e[21] = e[23] = 1 - r * this._bottomHeight,
        this.getBuffer("aUV").update()
    }
}
;
LN.defaultOptions = {
    width: 100,
    height: 100,
    leftWidth: 10,
    topHeight: 10,
    rightWidth: 10,
    bottomHeight: 10,
    originalWidth: 100,
    originalHeight: 100
};
let kpe = LN;
class Npe extends D2 {
    constructor() {
        super(),
        this.geometry = new kpe
    }
    destroy() {
        this.geometry.destroy()
    }
}
class UN {
    constructor(e) {
        this._renderer = e
    }
    addRenderable(e, n) {
        const r = this._getGpuSprite(e);
        e.didViewUpdate && this._updateBatchableSprite(e, r),
        this._renderer.renderPipes.batch.addToBatch(r, n)
    }
    updateRenderable(e) {
        const n = this._getGpuSprite(e);
        e.didViewUpdate && this._updateBatchableSprite(e, n),
        n._batcher.updateElement(n)
    }
    validateRenderable(e) {
        const n = this._getGpuSprite(e);
        return !n._batcher.checkAndUpdateTexture(n, e._texture)
    }
    _updateBatchableSprite(e, n) {
        n.geometry.update(e),
        n.setTexture(e._texture)
    }
    _getGpuSprite(e) {
        return e._gpuData[this._renderer.uid] || this._initGPUSprite(e)
    }
    _initGPUSprite(e) {
        const n = e._gpuData[this._renderer.uid] = new Npe
          , r = n;
        return r.renderable = e,
        r.transform = e.groupTransform,
        r.texture = e._texture,
        r.roundPixels = this._renderer._roundPixels | e._roundPixels,
        e.didViewUpdate || this._updateBatchableSprite(e, r),
        n
    }
    destroy() {
        this._renderer = null
    }
}
UN.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "nineSliceSprite"
};
const Fpe = {
    name: "tiling-bit",
    vertex: {
        header: `
            struct TilingUniforms {
                uMapCoord:mat3x3<f32>,
                uClampFrame:vec4<f32>,
                uClampOffset:vec2<f32>,
                uTextureTransform:mat3x3<f32>,
                uSizeAnchor:vec4<f32>
            };

            @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
            @group(2) @binding(1) var uTexture: texture_2d<f32>;
            @group(2) @binding(2) var uSampler: sampler;
        `,
        main: `
            uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;

            position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;
        `
    },
    fragment: {
        header: `
            struct TilingUniforms {
                uMapCoord:mat3x3<f32>,
                uClampFrame:vec4<f32>,
                uClampOffset:vec2<f32>,
                uTextureTransform:mat3x3<f32>,
                uSizeAnchor:vec4<f32>
            };

            @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
            @group(2) @binding(1) var uTexture: texture_2d<f32>;
            @group(2) @binding(2) var uSampler: sampler;
        `,
        main: `

            var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);
            coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;
            var unclamped = coord;
            coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);

            var bias = 0.;

            if(unclamped.x == coord.x && unclamped.y == coord.y)
            {
                bias = -32.;
            }

            outColor = textureSampleBias(uTexture, uSampler, coord, bias);
        `
    }
}
  , Lpe = {
    name: "tiling-bit",
    vertex: {
        header: `
            uniform mat3 uTextureTransform;
            uniform vec4 uSizeAnchor;

        `,
        main: `
            uv = (uTextureTransform * vec3(aUV, 1.0)).xy;

            position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;
        `
    },
    fragment: {
        header: `
            uniform sampler2D uTexture;
            uniform mat3 uMapCoord;
            uniform vec4 uClampFrame;
            uniform vec2 uClampOffset;
        `,
        main: `

        vec2 coord = vUV + ceil(uClampOffset - vUV);
        coord = (uMapCoord * vec3(coord, 1.0)).xy;
        vec2 unclamped = coord;
        coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);

        outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0

        `
    }
};
let q1, Z1;
class $pe extends yi {
    constructor() {
        q1 ?? (q1 = Qd({
            name: "tiling-sprite-shader",
            bits: [Mf, Fpe, th]
        })),
        Z1 ?? (Z1 = eh({
            name: "tiling-sprite-shader",
            bits: [b2, Lpe, nh]
        }));
        const e = new gr({
            uMapCoord: {
                value: new Oe,
                type: "mat3x3<f32>"
            },
            uClampFrame: {
                value: new Float32Array([0, 0, 1, 1]),
                type: "vec4<f32>"
            },
            uClampOffset: {
                value: new Float32Array([0, 0]),
                type: "vec2<f32>"
            },
            uTextureTransform: {
                value: new Oe,
                type: "mat3x3<f32>"
            },
            uSizeAnchor: {
                value: new Float32Array([100, 100, .5, .5]),
                type: "vec4<f32>"
            }
        });
        super({
            glProgram: Z1,
            gpuProgram: q1,
            resources: {
                localUniforms: new gr({
                    uTransformMatrix: {
                        value: new Oe,
                        type: "mat3x3<f32>"
                    },
                    uColor: {
                        value: new Float32Array([1, 1, 1, 1]),
                        type: "vec4<f32>"
                    },
                    uRound: {
                        value: 0,
                        type: "f32"
                    }
                }),
                tilingUniforms: e,
                uTexture: Ae.EMPTY.source,
                uSampler: Ae.EMPTY.source.style
            }
        })
    }
    updateUniforms(e, n, r, i, o, s) {
        const a = this.resources.tilingUniforms
          , l = s.width
          , c = s.height
          , u = s.textureMatrix
          , f = a.uniforms.uTextureTransform;
        f.set(r.a * l / e, r.b * l / n, r.c * c / e, r.d * c / n, r.tx / e, r.ty / n),
        f.invert(),
        a.uniforms.uMapCoord = u.mapCoord,
        a.uniforms.uClampFrame = u.uClampFrame,
        a.uniforms.uClampOffset = u.uClampOffset,
        a.uniforms.uTextureTransform = f,
        a.uniforms.uSizeAnchor[0] = e,
        a.uniforms.uSizeAnchor[1] = n,
        a.uniforms.uSizeAnchor[2] = i,
        a.uniforms.uSizeAnchor[3] = o,
        s && (this.resources.uTexture = s.source,
        this.resources.uSampler = s.source.style)
    }
}
class Upe extends _2 {
    constructor() {
        super({
            positions: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
            uvs: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
            indices: new Uint32Array([0, 1, 2, 0, 2, 3])
        })
    }
}
function Gpe(t, e) {
    const n = t.anchor.x
      , r = t.anchor.y;
    e[0] = -n * t.width,
    e[1] = -r * t.height,
    e[2] = (1 - n) * t.width,
    e[3] = -r * t.height,
    e[4] = (1 - n) * t.width,
    e[5] = (1 - r) * t.height,
    e[6] = -n * t.width,
    e[7] = (1 - r) * t.height
}
function Hpe(t, e, n, r) {
    let i = 0;
    const o = t.length / (e || 2)
      , s = r.a
      , a = r.b
      , l = r.c
      , c = r.d
      , u = r.tx
      , f = r.ty;
    for (n *= e; i < o; ) {
        const d = t[n]
          , h = t[n + 1];
        t[n] = s * d + l * h + u,
        t[n + 1] = a * d + c * h + f,
        n += e,
        i++
    }
}
function Vpe(t, e) {
    const n = t.texture
      , r = n.frame.width
      , i = n.frame.height;
    let o = 0
      , s = 0;
    t.applyAnchorToTexture && (o = t.anchor.x,
    s = t.anchor.y),
    e[0] = e[6] = -o,
    e[2] = e[4] = 1 - o,
    e[1] = e[3] = -s,
    e[5] = e[7] = 1 - s;
    const a = Oe.shared;
    a.copyFrom(t._tileTransform.matrix),
    a.tx /= t.width,
    a.ty /= t.height,
    a.invert(),
    a.scale(t.width / r, t.height / i),
    Hpe(e, 2, 0, a)
}
const Hp = new Upe;
class zpe {
    constructor() {
        this.canBatch = !0,
        this.geometry = new _2({
            indices: Hp.indices.slice(),
            positions: Hp.positions.slice(),
            uvs: Hp.uvs.slice()
        })
    }
    destroy() {
        var e;
        this.geometry.destroy(),
        (e = this.shader) == null || e.destroy()
    }
}
class GN {
    constructor(e) {
        this._state = $i.default2d,
        this._renderer = e
    }
    validateRenderable(e) {
        const n = this._getTilingSpriteData(e)
          , r = n.canBatch;
        this._updateCanBatch(e);
        const i = n.canBatch;
        if (i && i === r) {
            const {batchableMesh: o} = n;
            return !o._batcher.checkAndUpdateTexture(o, e.texture)
        }
        return r !== i
    }
    addRenderable(e, n) {
        const r = this._renderer.renderPipes.batch;
        this._updateCanBatch(e);
        const i = this._getTilingSpriteData(e)
          , {geometry: o, canBatch: s} = i;
        if (s) {
            i.batchableMesh || (i.batchableMesh = new D2);
            const a = i.batchableMesh;
            e.didViewUpdate && (this._updateBatchableMesh(e),
            a.geometry = o,
            a.renderable = e,
            a.transform = e.groupTransform,
            a.setTexture(e._texture)),
            a.roundPixels = this._renderer._roundPixels | e._roundPixels,
            r.addToBatch(a, n)
        } else
            r.break(n),
            i.shader || (i.shader = new $pe),
            this.updateRenderable(e),
            n.add(e)
    }
    execute(e) {
        const {shader: n} = this._getTilingSpriteData(e);
        n.groups[0] = this._renderer.globalUniforms.bindGroup;
        const r = n.resources.localUniforms.uniforms;
        r.uTransformMatrix = e.groupTransform,
        r.uRound = this._renderer._roundPixels | e._roundPixels,
        rh(e.groupColorAlpha, r.uColor, 0),
        this._state.blendMode = gd(e.groupBlendMode, e.texture._source),
        this._renderer.encoder.draw({
            geometry: Hp,
            shader: n,
            state: this._state
        })
    }
    updateRenderable(e) {
        const n = this._getTilingSpriteData(e)
          , {canBatch: r} = n;
        if (r) {
            const {batchableMesh: i} = n;
            e.didViewUpdate && this._updateBatchableMesh(e),
            i._batcher.updateElement(i)
        } else if (e.didViewUpdate) {
            const {shader: i} = n;
            i.updateUniforms(e.width, e.height, e._tileTransform.matrix, e.anchor.x, e.anchor.y, e.texture)
        }
    }
    _getTilingSpriteData(e) {
        return e._gpuData[this._renderer.uid] || this._initTilingSpriteData(e)
    }
    _initTilingSpriteData(e) {
        const n = new zpe;
        return n.renderable = e,
        e._gpuData[this._renderer.uid] = n,
        n
    }
    _updateBatchableMesh(e) {
        const n = this._getTilingSpriteData(e)
          , {geometry: r} = n
          , i = e.texture.source.style;
        i.addressMode !== "repeat" && (i.addressMode = "repeat",
        i.update()),
        Vpe(e, r.uvs),
        Gpe(e, r.positions)
    }
    destroy() {
        this._renderer = null
    }
    _updateCanBatch(e) {
        const n = this._getTilingSpriteData(e)
          , r = e.texture;
        let i = !0;
        return this._renderer.type === Kr.WEBGL && (i = this._renderer.context.supports.nonPowOf2wrapping),
        n.canBatch = r.textureMatrix.isSimple && (i || r.source.isPowerOfTwo),
        n.canBatch
    }
}
GN.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "tilingSprite"
};
const jpe = {
    name: "local-uniform-msdf-bit",
    vertex: {
        header: `
            struct LocalUniforms {
                uColor:vec4<f32>,
                uTransformMatrix:mat3x3<f32>,
                uDistance: f32,
                uRound:f32,
            }

            @group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
        `,
        main: `
            vColor *= localUniforms.uColor;
            modelMatrix *= localUniforms.uTransformMatrix;
        `,
        end: `
            if(localUniforms.uRound == 1)
            {
                vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
            }
        `
    },
    fragment: {
        header: `
            struct LocalUniforms {
                uColor:vec4<f32>,
                uTransformMatrix:mat3x3<f32>,
                uDistance: f32
            }

            @group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
         `,
        main: `
            outColor = vec4<f32>(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));
        `
    }
}
  , Wpe = {
    name: "local-uniform-msdf-bit",
    vertex: {
        header: `
            uniform mat3 uTransformMatrix;
            uniform vec4 uColor;
            uniform float uRound;
        `,
        main: `
            vColor *= uColor;
            modelMatrix *= uTransformMatrix;
        `,
        end: `
            if(uRound == 1.)
            {
                gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
            }
        `
    },
    fragment: {
        header: `
            uniform float uDistance;
         `,
        main: `
            outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));
        `
    }
}
  , Ype = {
    name: "msdf-bit",
    fragment: {
        header: `
            fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {

                // MSDF
                var median = msdfColor.r + msdfColor.g + msdfColor.b -
                    min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
                    max(msdfColor.r, max(msdfColor.g, msdfColor.b));

                // SDF
                median = min(median, msdfColor.a);

                var screenPxDistance = distance * (median - 0.5);
                var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
                if (median < 0.01) {
                    alpha = 0.0;
                } else if (median > 0.99) {
                    alpha = 1.0;
                }

                // Gamma correction for coverage-like alpha
                var luma: f32 = dot(shapeColor.rgb, vec3<f32>(0.299, 0.587, 0.114));
                var gamma: f32 = mix(1.0, 1.0 / 2.2, luma);
                var coverage: f32 = pow(shapeColor.a * alpha, gamma);

                return coverage;

            }
        `
    }
}
  , Xpe = {
    name: "msdf-bit",
    fragment: {
        header: `
            float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {

                // MSDF
                float median = msdfColor.r + msdfColor.g + msdfColor.b -
                                min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
                                max(msdfColor.r, max(msdfColor.g, msdfColor.b));

                // SDF
                median = min(median, msdfColor.a);

                float screenPxDistance = distance * (median - 0.5);
                float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);

                if (median < 0.01) {
                    alpha = 0.0;
                } else if (median > 0.99) {
                    alpha = 1.0;
                }

                // Gamma correction for coverage-like alpha
                float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));
                float gamma = mix(1.0, 1.0 / 2.2, luma);
                float coverage = pow(shapeColor.a * alpha, gamma);

                return coverage;
            }
        `
    }
};
let J1, Q1;
class Kpe extends yi {
    constructor(e) {
        const n = new gr({
            uColor: {
                value: new Float32Array([1, 1, 1, 1]),
                type: "vec4<f32>"
            },
            uTransformMatrix: {
                value: new Oe,
                type: "mat3x3<f32>"
            },
            uDistance: {
                value: 4,
                type: "f32"
            },
            uRound: {
                value: 0,
                type: "f32"
            }
        });
        J1 ?? (J1 = Qd({
            name: "sdf-shader",
            bits: [o2, a2(e), jpe, Ype, th]
        })),
        Q1 ?? (Q1 = eh({
            name: "sdf-shader",
            bits: [s2, l2(e), Wpe, Xpe, nh]
        })),
        super({
            glProgram: Q1,
            gpuProgram: J1,
            resources: {
                localUniforms: n,
                batchSamplers: c2(e)
            }
        })
    }
}
class qpe extends I0 {
    destroy() {
        this.context.customShader && this.context.customShader.destroy(),
        super.destroy()
    }
}
class HN {
    constructor(e) {
        this._renderer = e,
        this._renderer.renderableGC.addManagedHash(this, "_gpuBitmapText")
    }
    validateRenderable(e) {
        const n = this._getGpuBitmapText(e);
        return this._renderer.renderPipes.graphics.validateRenderable(n)
    }
    addRenderable(e, n) {
        const r = this._getGpuBitmapText(e);
        O3(e, r),
        e._didTextUpdate && (e._didTextUpdate = !1,
        this._updateContext(e, r)),
        this._renderer.renderPipes.graphics.addRenderable(r, n),
        r.context.customShader && this._updateDistanceField(e)
    }
    updateRenderable(e) {
        const n = this._getGpuBitmapText(e);
        O3(e, n),
        this._renderer.renderPipes.graphics.updateRenderable(n),
        n.context.customShader && this._updateDistanceField(e)
    }
    _updateContext(e, n) {
        const {context: r} = n
          , i = K_.getFont(e.text, e._style);
        r.clear(),
        i.distanceField.type !== "none" && (r.customShader || (r.customShader = new Kpe(this._renderer.limits.maxBatchableTextures)));
        const o = Ii.graphemeSegmenter(e.text)
          , s = e._style;
        let a = i.baseLineOffset;
        const l = zB(o, s, i, !0)
          , c = s.padding
          , u = l.scale;
        let f = l.width
          , d = l.height + l.offsetY;
        s._stroke && (f += s._stroke.width / u,
        d += s._stroke.width / u),
        r.translate(-e._anchor._x * f - c, -e._anchor._y * d - c).scale(u, u);
        const h = i.applyFillAsTint ? s._fill.color : 16777215;
        let p = i.fontMetrics.fontSize
          , y = i.lineHeight;
        s.lineHeight && (p = s.fontSize / u,
        y = s.lineHeight / u);
        let v = (y - p) / 2;
        v - i.baseLineOffset < 0 && (v = 0);
        for (let g = 0; g < l.lines.length; g++) {
            const m = l.lines[g];
            for (let _ = 0; _ < m.charPositions.length; _++) {
                const x = m.chars[_]
                  , b = i.chars[x];
                if (b != null && b.texture) {
                    const w = b.texture;
                    r.texture(w, h || "black", Math.round(m.charPositions[_] + b.xOffset), Math.round(a + b.yOffset + v), w.orig.width, w.orig.height)
                }
            }
            a += y
        }
    }
    _getGpuBitmapText(e) {
        return e._gpuData[this._renderer.uid] || this.initGpuText(e)
    }
    initGpuText(e) {
        const n = new qpe;
        return e._gpuData[this._renderer.uid] = n,
        this._updateContext(e, n),
        n
    }
    _updateDistanceField(e) {
        const n = this._getGpuBitmapText(e).context
          , r = e._style.fontFamily
          , i = bt.get(`${r}-bitmap`)
          , {a: o, b: s, c: a, d: l} = e.groupTransform
          , c = Math.sqrt(o * o + s * s)
          , u = Math.sqrt(a * a + l * l)
          , f = (Math.abs(c) + Math.abs(u)) / 2
          , d = i.baseRenderedFontSize / e._style.fontSize
          , h = f * i.distanceField.range * (1 / d);
        n.customShader.resources.localUniforms.uniforms.uDistance = h
    }
    destroy() {
        this._renderer = null
    }
}
HN.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "bitmapText"
};
function O3(t, e) {
    e.groupTransform = t.groupTransform,
    e.groupColorAlpha = t.groupColorAlpha,
    e.groupColor = t.groupColor,
    e.groupBlendMode = t.groupBlendMode,
    e.globalDisplayStatus = t.globalDisplayStatus,
    e.groupTransform = t.groupTransform,
    e.localDisplayStatus = t.localDisplayStatus,
    e.groupAlpha = t.groupAlpha,
    e._roundPixels = t._roundPixels
}
class Zpe extends om {
    constructor(e) {
        super(),
        this.generatingTexture = !1,
        this._renderer = e,
        e.runners.resolutionChange.add(this)
    }
    resolutionChange() {
        const e = this.renderable;
        e._autoResolution && e.onViewUpdate()
    }
    destroy() {
        this._renderer.htmlText.returnTexturePromise(this.texturePromise),
        this.texturePromise = null,
        this._renderer = null
    }
}
function ox(t, e) {
    const {texture: n, bounds: r} = t
      , i = e._style._getFinalPadding();
    MD(r, e._anchor, n);
    const o = e._anchor._x * i * 2
      , s = e._anchor._y * i * 2;
    r.minX -= i - o,
    r.minY -= i - s,
    r.maxX -= i - o,
    r.maxY -= i - s
}
class VN {
    constructor(e) {
        this._renderer = e
    }
    validateRenderable(e) {
        return e._didTextUpdate
    }
    addRenderable(e, n) {
        const r = this._getGpuText(e);
        e._didTextUpdate && (this._updateGpuText(e).catch(i => {
            console.error(i)
        }
        ),
        e._didTextUpdate = !1,
        ox(r, e)),
        this._renderer.renderPipes.batch.addToBatch(r, n)
    }
    updateRenderable(e) {
        const n = this._getGpuText(e);
        n._batcher.updateElement(n)
    }
    async _updateGpuText(e) {
        e._didTextUpdate = !1;
        const n = this._getGpuText(e);
        if (n.generatingTexture)
            return;
        n.texturePromise && (this._renderer.htmlText.returnTexturePromise(n.texturePromise),
        n.texturePromise = null),
        n.generatingTexture = !0,
        e._resolution = e._autoResolution ? this._renderer.resolution : e.resolution;
        const r = this._renderer.htmlText.getTexturePromise(e);
        n.texturePromise = r,
        n.texture = await r;
        const i = e.renderGroup || e.parentRenderGroup;
        i && (i.structureDidChange = !0),
        n.generatingTexture = !1,
        ox(n, e)
    }
    _getGpuText(e) {
        return e._gpuData[this._renderer.uid] || this.initGpuText(e)
    }
    initGpuText(e) {
        const n = new Zpe(this._renderer);
        return n.renderable = e,
        n.transform = e.groupTransform,
        n.texture = Ae.EMPTY,
        n.bounds = {
            minX: 0,
            maxX: 1,
            minY: 0,
            maxY: 0
        },
        n.roundPixels = this._renderer._roundPixels | e._roundPixels,
        e._resolution = e._autoResolution ? this._renderer.resolution : e.resolution,
        e._gpuData[this._renderer.uid] = n,
        n
    }
    destroy() {
        this._renderer = null
    }
}
VN.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "htmlText"
};
function Jpe() {
    const {userAgent: t} = je.get().getNavigator();
    return /^((?!chrome|android).)*safari/i.test(t)
}
const Qpe = new Vn;
function zN(t, e, n, r) {
    const i = Qpe;
    i.minX = 0,
    i.minY = 0,
    i.maxX = t.width / r | 0,
    i.maxY = t.height / r | 0;
    const o = cn.getOptimalTexture(i.width, i.height, r, !1);
    return o.source.uploadMethodId = "image",
    o.source.resource = t,
    o.source.alphaMode = "premultiply-alpha-on-upload",
    o.frame.width = e / r,
    o.frame.height = n / r,
    o.source.emit("update", o.source),
    o.updateUvs(),
    o
}
function e0e(t, e) {
    const n = e.fontFamily
      , r = []
      , i = {}
      , o = /font-family:([^;"\s]+)/g
      , s = t.match(o);
    function a(l) {
        i[l] || (r.push(l),
        i[l] = !0)
    }
    if (Array.isArray(n))
        for (let l = 0; l < n.length; l++)
            a(n[l]);
    else
        a(n);
    s && s.forEach(l => {
        const c = l.split(":")[1].trim();
        a(c)
    }
    );
    for (const l in e.tagStyles) {
        const c = e.tagStyles[l].fontFamily;
        a(c)
    }
    return r
}
async function t0e(t) {
    const n = await (await je.get().fetch(t)).blob()
      , r = new FileReader;
    return await new Promise( (o, s) => {
        r.onloadend = () => o(r.result),
        r.onerror = s,
        r.readAsDataURL(n)
    }
    )
}
async function n0e(t, e) {
    const n = await t0e(e);
    return `@font-face {
        font-family: "${t.fontFamily}";
        font-weight: ${t.fontWeight};
        font-style: ${t.fontStyle};
        src: url('${n}');
    }`
}
const ev = new Map;
async function r0e(t) {
    const e = t.filter(n => bt.has(`${n}-and-url`)).map(n => {
        if (!ev.has(n)) {
            const {entries: r} = bt.get(`${n}-and-url`)
              , i = [];
            r.forEach(o => {
                const s = o.url
                  , l = o.faces.map(c => ({
                    weight: c.weight,
                    style: c.style
                }));
                i.push(...l.map(c => n0e({
                    fontWeight: c.weight,
                    fontStyle: c.style,
                    fontFamily: n
                }, s)))
            }
            ),
            ev.set(n, Promise.all(i).then(o => o.join(`
`)))
        }
        return ev.get(n)
    }
    );
    return (await Promise.all(e)).join(`
`)
}
function i0e(t, e, n, r, i) {
    const {domElement: o, styleElement: s, svgRoot: a} = i;
    o.innerHTML = `<style>${e.cssStyle}</style><div style='padding:0;'>${t}</div>`,
    o.setAttribute("style", `transform: scale(${n});transform-origin: top left; display: inline-block`),
    s.textContent = r;
    const {width: l, height: c} = i.image;
    return a.setAttribute("width", l.toString()),
    a.setAttribute("height", c.toString()),
    new XMLSerializer().serializeToString(a)
}
function o0e(t, e) {
    const n = sa.getOptimalCanvasAndContext(t.width, t.height, e)
      , {context: r} = n;
    return r.clearRect(0, 0, t.width, t.height),
    r.drawImage(t, 0, 0),
    n
}
function s0e(t, e, n) {
    return new Promise(async r => {
        n && await new Promise(i => setTimeout(i, 100)),
        t.onload = () => {
            r()
        }
        ,
        t.src = `data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,
        t.crossOrigin = "anonymous"
    }
    )
}
class jN {
    constructor(e) {
        this._renderer = e,
        this._createCanvas = e.type === Kr.WEBGPU
    }
    getTexture(e) {
        return this.getTexturePromise(e)
    }
    getTexturePromise(e) {
        return this._buildTexturePromise(e)
    }
    async _buildTexturePromise(e) {
        const {text: n, style: r, resolution: i, textureStyle: o} = e
          , s = Hn.get(sk)
          , a = e0e(n, r)
          , l = await r0e(a)
          , c = Lde(n, r, l, s)
          , u = Math.ceil(Math.ceil(Math.max(1, c.width) + r.padding * 2) * i)
          , f = Math.ceil(Math.ceil(Math.max(1, c.height) + r.padding * 2) * i)
          , d = s.image
          , h = 2;
        d.width = (u | 0) + h,
        d.height = (f | 0) + h;
        const p = i0e(n, r, i, l, s);
        await s0e(d, p, Jpe() && a.length > 0);
        const y = d;
        let v;
        this._createCanvas && (v = o0e(d, i));
        const g = zN(v ? v.canvas : y, d.width - h, d.height - h, i);
        return o && (g.source.style = o),
        this._createCanvas && (this._renderer.texture.initSource(g.source),
        sa.returnCanvasAndContext(v)),
        Hn.return(s),
        g
    }
    returnTexturePromise(e) {
        e.then(n => {
            this._cleanUp(n)
        }
        ).catch( () => {
            Ne("HTMLTextSystem: Failed to clean texture")
        }
        )
    }
    _cleanUp(e) {
        cn.returnTexture(e, !0),
        e.source.resource = null,
        e.source.uploadMethodId = "unknown"
    }
    destroy() {
        this._renderer = null
    }
}
jN.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
    name: "htmlText"
};
class a0e extends om {
    constructor(e) {
        super(),
        this._renderer = e,
        e.runners.resolutionChange.add(this)
    }
    resolutionChange() {
        const e = this.renderable;
        e._autoResolution && e.onViewUpdate()
    }
    destroy() {
        this._renderer.canvasText.returnTexture(this.texture),
        this._renderer = null
    }
}
class WN {
    constructor(e) {
        this._renderer = e
    }
    validateRenderable(e) {
        return e._didTextUpdate
    }
    addRenderable(e, n) {
        const r = this._getGpuText(e);
        e._didTextUpdate && (this._updateGpuText(e),
        e._didTextUpdate = !1),
        this._renderer.renderPipes.batch.addToBatch(r, n)
    }
    updateRenderable(e) {
        const n = this._getGpuText(e);
        n._batcher.updateElement(n)
    }
    _updateGpuText(e) {
        const n = this._getGpuText(e);
        n.texture && this._renderer.canvasText.returnTexture(n.texture),
        e._resolution = e._autoResolution ? this._renderer.resolution : e.resolution,
        n.texture = this._renderer.canvasText.getTexture(e),
        ox(n, e)
    }
    _getGpuText(e) {
        return e._gpuData[this._renderer.uid] || this.initGpuText(e)
    }
    initGpuText(e) {
        const n = new a0e(this._renderer);
        return n.renderable = e,
        n.transform = e.groupTransform,
        n.bounds = {
            minX: 0,
            maxX: 1,
            minY: 0,
            maxY: 0
        },
        n.roundPixels = this._renderer._roundPixels | e._roundPixels,
        e._gpuData[this._renderer.uid] = n,
        n
    }
    destroy() {
        this._renderer = null
    }
}
WN.extension = {
    type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
    name: "text"
};
class YN {
    constructor(e) {
        this._renderer = e
    }
    getTexture(e, n, r, i) {
        typeof e == "string" && (Fe("8.0.0", "CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),
        e = {
            text: e,
            style: r,
            resolution: n
        }),
        e.style instanceof bl || (e.style = new bl(e.style)),
        e.textureStyle instanceof yo || (e.textureStyle = new yo(e.textureStyle)),
        typeof e.text != "string" && (e.text = e.text.toString());
        const {text: o, style: s, textureStyle: a} = e
          , l = e.resolution ?? this._renderer.resolution
          , {frame: c, canvasAndContext: u} = Rf.getCanvasAndContext({
            text: o,
            style: s,
            resolution: l
        })
          , f = zN(u.canvas, c.width, c.height, l);
        if (a && (f.source.style = a),
        s.trim && (c.pad(s.padding),
        f.frame.copyFrom(c),
        f.frame.scale(1 / l),
        f.updateUvs()),
        s.filters) {
            const d = this._applyFilters(f, s.filters);
            return this.returnTexture(f),
            Rf.returnCanvasAndContext(u),
            d
        }
        return this._renderer.texture.initSource(f._source),
        Rf.returnCanvasAndContext(u),
        f
    }
    returnTexture(e) {
        const n = e.source;
        n.resource = null,
        n.uploadMethodId = "unknown",
        n.alphaMode = "no-premultiply-alpha",
        cn.returnTexture(e, !0)
    }
    renderTextToCanvas() {
        Fe("8.10.0", "CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")
    }
    _applyFilters(e, n) {
        const r = this._renderer.renderTarget.renderTarget
          , i = this._renderer.filter.generateFilteredTexture({
            texture: e,
            filters: n
        });
        return this._renderer.renderTarget.bind(r, !1),
        i
    }
    destroy() {
        this._renderer = null
    }
}
YN.extension = {
    type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
    name: "canvasText"
};
$e.add(Rae, Mae);
var il = {}
  , XN = {}
  , qo = {};
Object.defineProperty(qo, "__esModule", {
    value: !0
});
qo.loop = qo.conditional = qo.parse = void 0;
var l0e = function t(e, n) {
    var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}
      , i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : r;
    if (Array.isArray(n))
        n.forEach(function(s) {
            return t(e, s, r, i)
        });
    else if (typeof n == "function")
        n(e, r, i, t);
    else {
        var o = Object.keys(n)[0];
        Array.isArray(n[o]) ? (i[o] = {},
        t(e, n[o], r, i[o])) : i[o] = n[o](e, r, i, t)
    }
    return r
};
qo.parse = l0e;
var c0e = function(e, n) {
    return function(r, i, o, s) {
        n(r, i, o) && s(r, e, i, o)
    }
};
qo.conditional = c0e;
var u0e = function(e, n) {
    return function(r, i, o, s) {
        for (var a = [], l = r.pos; n(r, i, o); ) {
            var c = {};
            if (s(r, e, i, c),
            r.pos === l)
                break;
            l = r.pos,
            a.push(c)
        }
        return a
    }
};
qo.loop = u0e;
var on = {};
Object.defineProperty(on, "__esModule", {
    value: !0
});
on.readBits = on.readArray = on.readUnsigned = on.readString = on.peekBytes = on.readBytes = on.peekByte = on.readByte = on.buildStream = void 0;
var f0e = function(e) {
    return {
        data: e,
        pos: 0
    }
};
on.buildStream = f0e;
var KN = function() {
    return function(e) {
        return e.data[e.pos++]
    }
};
on.readByte = KN;
var d0e = function() {
    var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
    return function(n) {
        return n.data[n.pos + e]
    }
};
on.peekByte = d0e;
var sm = function(e) {
    return function(n) {
        return n.data.subarray(n.pos, n.pos += e)
    }
};
on.readBytes = sm;
var h0e = function(e) {
    return function(n) {
        return n.data.subarray(n.pos, n.pos + e)
    }
};
on.peekBytes = h0e;
var p0e = function(e) {
    return function(n) {
        return Array.from(sm(e)(n)).map(function(r) {
            return String.fromCharCode(r)
        }).join("")
    }
};
on.readString = p0e;
var g0e = function(e) {
    return function(n) {
        var r = sm(2)(n);
        return e ? (r[1] << 8) + r[0] : (r[0] << 8) + r[1]
    }
};
on.readUnsigned = g0e;
var m0e = function(e, n) {
    return function(r, i, o) {
        for (var s = typeof n == "function" ? n(r, i, o) : n, a = sm(e), l = new Array(s), c = 0; c < s; c++)
            l[c] = a(r);
        return l
    }
};
on.readArray = m0e;
var v0e = function(e, n, r) {
    for (var i = 0, o = 0; o < r; o++)
        i += e[n + o] && Math.pow(2, r - o - 1);
    return i
}
  , y0e = function(e) {
    return function(n) {
        for (var r = KN()(n), i = new Array(8), o = 0; o < 8; o++)
            i[7 - o] = !!(r & 1 << o);
        return Object.keys(e).reduce(function(s, a) {
            var l = e[a];
            return l.length ? s[a] = v0e(i, l.index, l.length) : s[a] = i[l.index],
            s
        }, {})
    }
};
on.readBits = y0e;
(function(t) {
    Object.defineProperty(t, "__esModule", {
        value: !0
    }),
    t.default = void 0;
    var e = qo
      , n = on
      , r = {
        blocks: function(d) {
            for (var h = 0, p = [], y = d.data.length, v = 0, g = (0,
            n.readByte)()(d); g !== h && g; g = (0,
            n.readByte)()(d)) {
                if (d.pos + g >= y) {
                    var m = y - d.pos;
                    p.push((0,
                    n.readBytes)(m)(d)),
                    v += m;
                    break
                }
                p.push((0,
                n.readBytes)(g)(d)),
                v += g
            }
            for (var _ = new Uint8Array(v), x = 0, b = 0; b < p.length; b++)
                _.set(p[b], x),
                x += p[b].length;
            return _
        }
    }
      , i = (0,
    e.conditional)({
        gce: [{
            codes: (0,
            n.readBytes)(2)
        }, {
            byteSize: (0,
            n.readByte)()
        }, {
            extras: (0,
            n.readBits)({
                future: {
                    index: 0,
                    length: 3
                },
                disposal: {
                    index: 3,
                    length: 3
                },
                userInput: {
                    index: 6
                },
                transparentColorGiven: {
                    index: 7
                }
            })
        }, {
            delay: (0,
            n.readUnsigned)(!0)
        }, {
            transparentColorIndex: (0,
            n.readByte)()
        }, {
            terminator: (0,
            n.readByte)()
        }]
    }, function(f) {
        var d = (0,
        n.peekBytes)(2)(f);
        return d[0] === 33 && d[1] === 249
    })
      , o = (0,
    e.conditional)({
        image: [{
            code: (0,
            n.readByte)()
        }, {
            descriptor: [{
                left: (0,
                n.readUnsigned)(!0)
            }, {
                top: (0,
                n.readUnsigned)(!0)
            }, {
                width: (0,
                n.readUnsigned)(!0)
            }, {
                height: (0,
                n.readUnsigned)(!0)
            }, {
                lct: (0,
                n.readBits)({
                    exists: {
                        index: 0
                    },
                    interlaced: {
                        index: 1
                    },
                    sort: {
                        index: 2
                    },
                    future: {
                        index: 3,
                        length: 2
                    },
                    size: {
                        index: 5,
                        length: 3
                    }
                })
            }]
        }, (0,
        e.conditional)({
            lct: (0,
            n.readArray)(3, function(f, d, h) {
                return Math.pow(2, h.descriptor.lct.size + 1)
            })
        }, function(f, d, h) {
            return h.descriptor.lct.exists
        }), {
            data: [{
                minCodeSize: (0,
                n.readByte)()
            }, r]
        }]
    }, function(f) {
        return (0,
        n.peekByte)()(f) === 44
    })
      , s = (0,
    e.conditional)({
        text: [{
            codes: (0,
            n.readBytes)(2)
        }, {
            blockSize: (0,
            n.readByte)()
        }, {
            preData: function(d, h, p) {
                return (0,
                n.readBytes)(p.text.blockSize)(d)
            }
        }, r]
    }, function(f) {
        var d = (0,
        n.peekBytes)(2)(f);
        return d[0] === 33 && d[1] === 1
    })
      , a = (0,
    e.conditional)({
        application: [{
            codes: (0,
            n.readBytes)(2)
        }, {
            blockSize: (0,
            n.readByte)()
        }, {
            id: function(d, h, p) {
                return (0,
                n.readString)(p.blockSize)(d)
            }
        }, r]
    }, function(f) {
        var d = (0,
        n.peekBytes)(2)(f);
        return d[0] === 33 && d[1] === 255
    })
      , l = (0,
    e.conditional)({
        comment: [{
            codes: (0,
            n.readBytes)(2)
        }, r]
    }, function(f) {
        var d = (0,
        n.peekBytes)(2)(f);
        return d[0] === 33 && d[1] === 254
    })
      , c = [{
        header: [{
            signature: (0,
            n.readString)(3)
        }, {
            version: (0,
            n.readString)(3)
        }]
    }, {
        lsd: [{
            width: (0,
            n.readUnsigned)(!0)
        }, {
            height: (0,
            n.readUnsigned)(!0)
        }, {
            gct: (0,
            n.readBits)({
                exists: {
                    index: 0
                },
                resolution: {
                    index: 1,
                    length: 3
                },
                sort: {
                    index: 4
                },
                size: {
                    index: 5,
                    length: 3
                }
            })
        }, {
            backgroundColorIndex: (0,
            n.readByte)()
        }, {
            pixelAspectRatio: (0,
            n.readByte)()
        }]
    }, (0,
    e.conditional)({
        gct: (0,
        n.readArray)(3, function(f, d) {
            return Math.pow(2, d.lsd.gct.size + 1)
        })
    }, function(f, d) {
        return d.lsd.gct.exists
    }), {
        frames: (0,
        e.loop)([i, a, l, o, s], function(f) {
            var d = (0,
            n.peekByte)()(f);
            return d === 33 || d === 44
        })
    }]
      , u = c;
    t.default = u
}
)(XN);
var am = {};
Object.defineProperty(am, "__esModule", {
    value: !0
});
am.deinterlace = void 0;
var _0e = function(e, n) {
    for (var r = new Array(e.length), i = e.length / n, o = function(d, h) {
        var p = e.slice(h * n, (h + 1) * n);
        r.splice.apply(r, [d * n, n].concat(p))
    }, s = [0, 4, 2, 1], a = [8, 8, 4, 2], l = 0, c = 0; c < 4; c++)
        for (var u = s[c]; u < i; u += a[c])
            o(u, l),
            l++;
    return r
};
am.deinterlace = _0e;
var lm = {};
Object.defineProperty(lm, "__esModule", {
    value: !0
});
lm.lzw = void 0;
var x0e = function(e, n, r) {
    var i = 4096, o = -1, s = r, a, l, c, u, f, d, h, w, p, y, b, v, E, S, C, P, g = new Array(r), m = new Array(i), _ = new Array(i), x = new Array(i + 1);
    for (v = e,
    l = 1 << v,
    f = l + 1,
    a = l + 2,
    h = o,
    u = v + 1,
    c = (1 << u) - 1,
    p = 0; p < l; p++)
        m[p] = 0,
        _[p] = p;
    var b, w, E, S, P, C;
    for (b = w = E = S = P = C = 0,
    y = 0; y < s; ) {
        if (S === 0) {
            if (w < u) {
                b += n[C] << w,
                w += 8,
                C++;
                continue
            }
            if (p = b & c,
            b >>= u,
            w -= u,
            p > a || p == f)
                break;
            if (p == l) {
                u = v + 1,
                c = (1 << u) - 1,
                a = l + 2,
                h = o;
                continue
            }
            if (h == o) {
                x[S++] = _[p],
                h = p,
                E = p;
                continue
            }
            for (d = p,
            p == a && (x[S++] = E,
            p = h); p > l; )
                x[S++] = _[p],
                p = m[p];
            E = _[p] & 255,
            x[S++] = E,
            a < i && (m[a] = h,
            _[a] = E,
            a++,
            !(a & c) && a < i && (u++,
            c += a)),
            h = d
        }
        S--,
        g[P++] = x[S],
        y++
    }
    for (y = P; y < s; y++)
        g[y] = 0;
    return g
};
lm.lzw = x0e;
Object.defineProperty(il, "__esModule", {
    value: !0
});
var qN = il.decompressFrames = il.decompressFrame = ZN = il.parseGIF = void 0
  , b0e = A0e(XN)
  , w0e = qo
  , E0e = on
  , S0e = am
  , C0e = lm;
function A0e(t) {
    return t && t.__esModule ? t : {
        default: t
    }
}
var T0e = function(e) {
    var n = new Uint8Array(e);
    return (0,
    w0e.parse)((0,
    E0e.buildStream)(n), b0e.default)
}
  , ZN = il.parseGIF = T0e
  , P0e = function(e) {
    for (var n = e.pixels.length, r = new Uint8ClampedArray(n * 4), i = 0; i < n; i++) {
        var o = i * 4
          , s = e.pixels[i]
          , a = e.colorTable[s] || [0, 0, 0];
        r[o] = a[0],
        r[o + 1] = a[1],
        r[o + 2] = a[2],
        r[o + 3] = s !== e.transparentIndex ? 255 : 0
    }
    return r
}
  , JN = function(e, n, r) {
    if (!e.image) {
        console.warn("gif frame does not have associated image.");
        return
    }
    var i = e.image
      , o = i.descriptor.width * i.descriptor.height
      , s = (0,
    C0e.lzw)(i.data.minCodeSize, i.data.blocks, o);
    i.descriptor.lct.interlaced && (s = (0,
    S0e.deinterlace)(s, i.descriptor.width));
    var a = {
        pixels: s,
        dims: {
            top: e.image.descriptor.top,
            left: e.image.descriptor.left,
            width: e.image.descriptor.width,
            height: e.image.descriptor.height
        }
    };
    return i.descriptor.lct && i.descriptor.lct.exists ? a.colorTable = i.lct : a.colorTable = n,
    e.gce && (a.delay = (e.gce.delay || 10) * 10,
    a.disposalType = e.gce.extras.disposal,
    e.gce.extras.transparentColorGiven && (a.transparentIndex = e.gce.transparentColorIndex)),
    r && (a.patch = P0e(a)),
    a
};
il.decompressFrame = JN;
var I0e = function(e, n) {
    return e.frames.filter(function(r) {
        return r.image
    }).map(function(r) {
        return JN(r, e.gct, n)
    })
};
qN = il.decompressFrames = I0e;
class cm {
    constructor(e) {
        if (!e || !e.length)
            throw new Error("Invalid frames");
        const [{texture: {width: n, height: r}}] = e;
        this.width = n,
        this.height = r,
        this.frames = e,
        this.textures = this.frames.map(i => i.texture),
        this.totalFrames = this.frames.length,
        this.duration = this.frames[this.totalFrames - 1].end
    }
    destroy() {
        for (const e of this.textures)
            e.destroy(!0);
        for (const e of this.frames)
            e.texture = null;
        this.frames.length = 0,
        this.textures.length = 0,
        Object.assign(this, {
            frames: null,
            textures: null,
            width: 0,
            height: 0,
            duration: 0,
            totalFrames: 0
        })
    }
    static from(e, n) {
        if (!e || e.byteLength === 0)
            throw new Error("Invalid buffer");
        const r = v => {
            let g = null;
            for (const m of v.frames)
                g = m.gce ?? g,
                "image"in m && !("gce"in m) && (m.gce = g)
        }
          , i = ZN(e);
        r(i);
        const o = qN(i, !0)
          , s = []
          , a = i.lsd.width
          , l = i.lsd.height
          , c = je.get().createCanvas(a, l)
          , u = c.getContext("2d", {
            willReadFrequently: !0
        })
          , f = je.get().createCanvas()
          , d = f.getContext("2d");
        let h = 0
          , p = null;
        const y = 1e3 / ((n == null ? void 0 : n.fps) ?? 30);
        for (let v = 0; v < o.length; v++) {
            const {disposalType: g=2, delay: m=y, patch: _, dims: {width: x, height: b, left: w, top: E}} = o[v];
            f.width = x,
            f.height = b,
            d.clearRect(0, 0, x, b);
            const S = d.createImageData(x, b);
            S.data.set(_),
            d.putImageData(S, 0, 0),
            g === 3 && (p = u.getImageData(0, 0, a, l)),
            u.drawImage(f, w, E);
            const P = u.getImageData(0, 0, a, l);
            g === 2 ? u.clearRect(0, 0, a, l) : g === 3 && u.putImageData(p, 0, 0);
            const C = je.get().createCanvas(P.width, P.height);
            C.getContext("2d").putImageData(P, 0, 0),
            s.push({
                start: h,
                end: h + m,
                texture: new Ae({
                    source: new lo({
                        resource: C
                    })
                })
            }),
            h += m
        }
        return c.width = c.height = 0,
        f.width = f.height = 0,
        new cm(s)
    }
}
const O0e = {
    extension: V.Asset,
    detection: {
        test: async () => !0,
        add: async t => [...t, "gif"],
        remove: async t => t.filter(e => e !== "gif")
    },
    loader: {
        name: "gifLoader",
        id: "gif",
        test: t => Pr.extname(t) === ".gif" || t.startsWith("data:image/gif"),
        load: async (t, e) => {
            const r = await (await je.get().fetch(t)).arrayBuffer();
            return cm.from(r, e == null ? void 0 : e.data)
        }
        ,
        unload: async t => {
            t.destroy()
        }
    }
}
  , QN = class sx extends vl {
    constructor(...e) {
        const n = e[0]instanceof cm ? {
            source: e[0]
        } : e[0]
          , {scaleMode: r, source: i, fps: o, loop: s, animationSpeed: a, autoPlay: l, autoUpdate: c, onComplete: u, onFrameChange: f, onLoop: d, ...h} = Object.assign({}, sx.defaultOptions, n);
        super({
            texture: Ae.EMPTY,
            ...h
        }),
        this.animationSpeed = 1,
        this.loop = !0,
        this.duration = 0,
        this.autoPlay = !0,
        this.dirty = !1,
        this._currentFrame = 0,
        this._autoUpdate = !1,
        this._isConnectedToTicker = !1,
        this._playing = !1,
        this._currentTime = 0,
        this.onRender = () => this._updateFrame(),
        this.texture = i.textures[0],
        this.duration = i.frames[i.frames.length - 1].end,
        this._source = i,
        this._playing = !1,
        this._currentTime = 0,
        this._isConnectedToTicker = !1,
        Object.assign(this, {
            fps: o,
            loop: s,
            animationSpeed: a,
            autoPlay: l,
            autoUpdate: c,
            onComplete: u,
            onFrameChange: f,
            onLoop: d
        }),
        this.currentFrame = 0,
        l && this.play()
    }
    stop() {
        this._playing && (this._playing = !1,
        this._autoUpdate && this._isConnectedToTicker && (Un.shared.remove(this.update, this),
        this._isConnectedToTicker = !1))
    }
    play() {
        this._playing || (this._playing = !0,
        this._autoUpdate && !this._isConnectedToTicker && (Un.shared.add(this.update, this, _l.HIGH),
        this._isConnectedToTicker = !0),
        !this.loop && this.currentFrame === this._source.frames.length - 1 && (this._currentTime = 0))
    }
    get progress() {
        return this._currentTime / this.duration
    }
    get playing() {
        return this._playing
    }
    update(e) {
        var s, a;
        if (!this._playing)
            return;
        const n = this.animationSpeed * e.deltaTime / Un.targetFPMS
          , r = this._currentTime + n
          , i = r % this.duration
          , o = this._source.frames.findIndex(l => l.start <= i && l.end > i);
        r >= this.duration ? this.loop ? (this._currentTime = i,
        this._updateFrameIndex(o),
        (s = this.onLoop) == null || s.call(this)) : (this._currentTime = this.duration,
        this._updateFrameIndex(this.totalFrames - 1),
        (a = this.onComplete) == null || a.call(this),
        this.stop()) : (this._currentTime = i,
        this._updateFrameIndex(o))
    }
    _updateFrame() {
        this.dirty && (this.texture = this._source.frames[this._currentFrame].texture,
        this.dirty = !1)
    }
    get autoUpdate() {
        return this._autoUpdate
    }
    set autoUpdate(e) {
        e !== this._autoUpdate && (this._autoUpdate = e,
        !this._autoUpdate && this._isConnectedToTicker ? (Un.shared.remove(this.update, this),
        this._isConnectedToTicker = !1) : this._autoUpdate && !this._isConnectedToTicker && this._playing && (Un.shared.add(this.update, this),
        this._isConnectedToTicker = !0))
    }
    get currentFrame() {
        return this._currentFrame
    }
    set currentFrame(e) {
        this._updateFrameIndex(e),
        this._currentTime = this._source.frames[e].start
    }
    get source() {
        return this._source
    }
    _updateFrameIndex(e) {
        var n;
        if (e < 0 || e >= this.totalFrames)
            throw new Error(`Frame index out of range, expecting 0 to ${this.totalFrames}, got ${e}`);
        this._currentFrame !== e && (this._currentFrame = e,
        this.dirty = !0,
        (n = this.onFrameChange) == null || n.call(this, e))
    }
    get totalFrames() {
        return this._source.totalFrames
    }
    destroy(e=!1) {
        this.stop(),
        super.destroy(),
        e && this._source.destroy();
        const n = null;
        this._source = n,
        this.onComplete = n,
        this.onFrameChange = n,
        this.onLoop = n
    }
    clone() {
        const e = new sx({
            source: this._source,
            autoUpdate: this._autoUpdate,
            loop: this.loop,
            autoPlay: this.autoPlay,
            scaleMode: this.texture.source.scaleMode,
            animationSpeed: this.animationSpeed,
            onComplete: this.onComplete,
            onFrameChange: this.onFrameChange,
            onLoop: this.onLoop
        });
        return e.dirty = !0,
        e
    }
}
;
QN.defaultOptions = {
    scaleMode: "linear",
    fps: 30,
    loop: !0,
    animationSpeed: 1,
    autoPlay: !0,
    autoUpdate: !0,
    onComplete: null,
    onFrameChange: null,
    onLoop: null
};
let OPe = QN;
$e.add(O0e);
var e5 = {
    exports: {}
};
(function(t, e) {
    (function(n, r) {
        t.exports = r()
    }
    )(fl, function() {
        return function(n, r, i) {
            n = n || {};
            var o = r.prototype
              , s = {
                future: "in %s",
                past: "%s ago",
                s: "a few seconds",
                m: "a minute",
                mm: "%d minutes",
                h: "an hour",
                hh: "%d hours",
                d: "a day",
                dd: "%d days",
                M: "a month",
                MM: "%d months",
                y: "a year",
                yy: "%d years"
            };
            function a(c, u, f, d) {
                return o.fromToBase(c, u, f, d)
            }
            i.en.relativeTime = s,
            o.fromToBase = function(c, u, f, d, h) {
                for (var p, y, v, g = f.$locale().relativeTime || s, m = n.thresholds || [{
                    l: "s",
                    r: 44,
                    d: "second"
                }, {
                    l: "m",
                    r: 89
                }, {
                    l: "mm",
                    r: 44,
                    d: "minute"
                }, {
                    l: "h",
                    r: 89
                }, {
                    l: "hh",
                    r: 21,
                    d: "hour"
                }, {
                    l: "d",
                    r: 35
                }, {
                    l: "dd",
                    r: 25,
                    d: "day"
                }, {
                    l: "M",
                    r: 45
                }, {
                    l: "MM",
                    r: 10,
                    d: "month"
                }, {
                    l: "y",
                    r: 17
                }, {
                    l: "yy",
                    d: "year"
                }], _ = m.length, x = 0; x < _; x += 1) {
                    var b = m[x];
                    b.d && (p = d ? i(c).diff(f, b.d, !0) : f.diff(c, b.d, !0));
                    var w = (n.rounding || Math.round)(Math.abs(p));
                    if (v = p > 0,
                    w <= b.r || !b.r) {
                        w <= 1 && x > 0 && (b = m[x - 1]);
                        var E = g[b.l];
                        h && (w = h("" + w)),
                        y = typeof E == "string" ? E.replace("%d", w) : E(w, u, b.l, v);
                        break
                    }
                }
                if (u)
                    return y;
                var S = v ? g.future : g.past;
                return typeof S == "function" ? S(y) : S.replace("%s", y)
            }
            ,
            o.to = function(c, u) {
                return a(c, u, this, !0)
            }
            ,
            o.from = function(c, u) {
                return a(c, u, this)
            }
            ;
            var l = function(c) {
                return c.$u ? i.utc() : i()
            };
            o.toNow = function(c) {
                return this.to(l(this), c)
            }
            ,
            o.fromNow = function(c) {
                return this.from(l(this), c)
            }
        }
    })
}
)(e5);
var R0e = e5.exports;
const RPe = hu(R0e);
var M0e = {
    exports: {}
};
(function(t, e) {
    (function(n, r) {
        t.exports = r(sw)
    }
    )(fl, function(n) {
        function r(s) {
            return s && typeof s == "object" && "default"in s ? s : {
                default: s
            }
        }
        var i = r(n)
          , o = {
            name: "zh-cn",
            weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
            weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
            weekdaysMin: "日_一_二_三_四_五_六".split("_"),
            months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
            monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
            ordinal: function(s, a) {
                return a === "W" ? s + "周" : s + "日"
            },
            weekStart: 1,
            yearStart: 4,
            formats: {
                LT: "HH:mm",
                LTS: "HH:mm:ss",
                L: "YYYY/MM/DD",
                LL: "YYYY年M月D日",
                LLL: "YYYY年M月D日Ah点mm分",
                LLLL: "YYYY年M月D日ddddAh点mm分",
                l: "YYYY/M/D",
                ll: "YYYY年M月D日",
                lll: "YYYY年M月D日 HH:mm",
                llll: "YYYY年M月D日dddd HH:mm"
            },
            relativeTime: {
                future: "%s内",
                past: "%s前",
                s: "几秒",
                m: "1 分钟",
                mm: "%d 分钟",
                h: "1 小时",
                hh: "%d 小时",
                d: "1 天",
                dd: "%d 天",
                M: "1 个月",
                MM: "%d 个月",
                y: "1 年",
                yy: "%d 年"
            },
            meridiem: function(s, a) {
                var l = 100 * s + a;
                return l < 600 ? "凌晨" : l < 900 ? "早上" : l < 1100 ? "上午" : l < 1300 ? "中午" : l < 1800 ? "下午" : "晚上"
            }
        };
        return i.default.locale(o, null, !0),
        o
    })
}
)(M0e);
var D0e = {
    exports: {}
};
(function(t, e) {
    (function(n, r) {
        t.exports = r(sw)
    }
    )(fl, function(n) {
        function r(s) {
            return s && typeof s == "object" && "default"in s ? s : {
                default: s
            }
        }
        var i = r(n)
          , o = {
            name: "zh-tw",
            weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
            weekdaysShort: "週日_週一_週二_週三_週四_週五_週六".split("_"),
            weekdaysMin: "日_一_二_三_四_五_六".split("_"),
            months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
            monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
            ordinal: function(s, a) {
                return a === "W" ? s + "週" : s + "日"
            },
            formats: {
                LT: "HH:mm",
                LTS: "HH:mm:ss",
                L: "YYYY/MM/DD",
                LL: "YYYY年M月D日",
                LLL: "YYYY年M月D日 HH:mm",
                LLLL: "YYYY年M月D日dddd HH:mm",
                l: "YYYY/M/D",
                ll: "YYYY年M月D日",
                lll: "YYYY年M月D日 HH:mm",
                llll: "YYYY年M月D日dddd HH:mm"
            },
            relativeTime: {
                future: "%s內",
                past: "%s前",
                s: "幾秒",
                m: "1 分鐘",
                mm: "%d 分鐘",
                h: "1 小時",
                hh: "%d 小時",
                d: "1 天",
                dd: "%d 天",
                M: "1 個月",
                MM: "%d 個月",
                y: "1 年",
                yy: "%d 年"
            },
            meridiem: function(s, a) {
                var l = 100 * s + a;
                return l < 600 ? "凌晨" : l < 900 ? "早上" : l < 1100 ? "上午" : l < 1300 ? "中午" : l < 1800 ? "下午" : "晚上"
            }
        };
        return i.default.locale(o, null, !0),
        o
    })
}
)(D0e);
var B0e = {
    exports: {}
};
(function(t, e) {
    (function(n, r) {
        t.exports = r()
    }
    )(fl, function() {
        return {
            name: "en",
            weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
            months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
            ordinal: function(n) {
                var r = ["th", "st", "nd", "rd"]
                  , i = n % 100;
                return "[" + n + (r[(i - 20) % 10] || r[i] || r[0]) + "]"
            }
        }
    })
}
)(B0e);
const t5 = new Proxy({},{
    get(t, e) {
        throw new Error(`Module "" has been externalized for browser compatibility. Cannot access ".${e}" in client code.  See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.`)
    }
})
  , k0e = Object.freeze(Object.defineProperty({
    __proto__: null,
    default: t5
}, Symbol.toStringTag, {
    value: "Module"
}));
var ax = null;
function N0e(t) {
    try {
        return crypto.getRandomValues(new Uint8Array(t))
    } catch {}
    try {
        return t5.randomBytes(t)
    } catch {}
    if (!ax)
        throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative");
    return ax(t)
}
function F0e(t) {
    ax = t
}
function B2(t, e) {
    if (t = t || k2,
    typeof t != "number")
        throw Error("Illegal arguments: " + typeof t + ", " + typeof e);
    t < 4 ? t = 4 : t > 31 && (t = 31);
    var n = [];
    return n.push("$2b$"),
    t < 10 && n.push("0"),
    n.push(t.toString()),
    n.push("$"),
    n.push(O0(N0e(vd), vd)),
    n.join("")
}
function n5(t, e, n) {
    if (typeof e == "function" && (n = e,
    e = void 0),
    typeof t == "function" && (n = t,
    t = void 0),
    typeof t > "u")
        t = k2;
    else if (typeof t != "number")
        throw Error("illegal arguments: " + typeof t);
    function r(i) {
        Di(function() {
            try {
                i(null, B2(t))
            } catch (o) {
                i(o)
            }
        })
    }
    if (n) {
        if (typeof n != "function")
            throw Error("Illegal callback: " + typeof n);
        r(n)
    } else
        return new Promise(function(i, o) {
            r(function(s, a) {
                if (s) {
                    o(s);
                    return
                }
                i(a)
            })
        }
        )
}
function r5(t, e) {
    if (typeof e > "u" && (e = k2),
    typeof e == "number" && (e = B2(e)),
    typeof t != "string" || typeof e != "string")
        throw Error("Illegal arguments: " + typeof t + ", " + typeof e);
    return lx(t, e)
}
function i5(t, e, n, r) {
    function i(o) {
        typeof t == "string" && typeof e == "number" ? n5(e, function(s, a) {
            lx(t, a, o, r)
        }) : typeof t == "string" && typeof e == "string" ? lx(t, e, o, r) : Di(o.bind(this, Error("Illegal arguments: " + typeof t + ", " + typeof e)))
    }
    if (n) {
        if (typeof n != "function")
            throw Error("Illegal callback: " + typeof n);
        i(n)
    } else
        return new Promise(function(o, s) {
            i(function(a, l) {
                if (a) {
                    s(a);
                    return
                }
                o(l)
            })
        }
        )
}
function o5(t, e) {
    for (var n = t.length ^ e.length, r = 0; r < t.length; ++r)
        n |= t.charCodeAt(r) ^ e.charCodeAt(r);
    return n === 0
}
function L0e(t, e) {
    if (typeof t != "string" || typeof e != "string")
        throw Error("Illegal arguments: " + typeof t + ", " + typeof e);
    return e.length !== 60 ? !1 : o5(r5(t, e.substring(0, e.length - 31)), e)
}
function $0e(t, e, n, r) {
    function i(o) {
        if (typeof t != "string" || typeof e != "string") {
            Di(o.bind(this, Error("Illegal arguments: " + typeof t + ", " + typeof e)));
            return
        }
        if (e.length !== 60) {
            Di(o.bind(this, null, !1));
            return
        }
        i5(t, e.substring(0, 29), function(s, a) {
            s ? o(s) : o(null, o5(a, e))
        }, r)
    }
    if (n) {
        if (typeof n != "function")
            throw Error("Illegal callback: " + typeof n);
        i(n)
    } else
        return new Promise(function(o, s) {
            i(function(a, l) {
                if (a) {
                    s(a);
                    return
                }
                o(l)
            })
        }
        )
}
function U0e(t) {
    if (typeof t != "string")
        throw Error("Illegal arguments: " + typeof t);
    return parseInt(t.split("$")[2], 10)
}
function G0e(t) {
    if (typeof t != "string")
        throw Error("Illegal arguments: " + typeof t);
    if (t.length !== 60)
        throw Error("Illegal hash length: " + t.length + " != 60");
    return t.substring(0, 29)
}
function H0e(t) {
    if (typeof t != "string")
        throw Error("Illegal arguments: " + typeof t);
    return s5(t) > 72
}
var Di = typeof process < "u" && process && typeof process.nextTick == "function" ? typeof setImmediate == "function" ? setImmediate : process.nextTick : setTimeout;
function s5(t) {
    for (var e = 0, n = 0, r = 0; r < t.length; ++r)
        n = t.charCodeAt(r),
        n < 128 ? e += 1 : n < 2048 ? e += 2 : (n & 64512) === 55296 && (t.charCodeAt(r + 1) & 64512) === 56320 ? (++r,
        e += 4) : e += 3;
    return e
}
function V0e(t) {
    for (var e = 0, n, r, i = new Array(s5(t)), o = 0, s = t.length; o < s; ++o)
        n = t.charCodeAt(o),
        n < 128 ? i[e++] = n : n < 2048 ? (i[e++] = n >> 6 | 192,
        i[e++] = n & 63 | 128) : (n & 64512) === 55296 && ((r = t.charCodeAt(o + 1)) & 64512) === 56320 ? (n = 65536 + ((n & 1023) << 10) + (r & 1023),
        ++o,
        i[e++] = n >> 18 | 240,
        i[e++] = n >> 12 & 63 | 128,
        i[e++] = n >> 6 & 63 | 128,
        i[e++] = n & 63 | 128) : (i[e++] = n >> 12 | 224,
        i[e++] = n >> 6 & 63 | 128,
        i[e++] = n & 63 | 128);
    return i
}
var ic = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split("")
  , ws = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1];
function O0(t, e) {
    var n = 0, r = [], i, o;
    if (e <= 0 || e > t.length)
        throw Error("Illegal len: " + e);
    for (; n < e; ) {
        if (i = t[n++] & 255,
        r.push(ic[i >> 2 & 63]),
        i = (i & 3) << 4,
        n >= e) {
            r.push(ic[i & 63]);
            break
        }
        if (o = t[n++] & 255,
        i |= o >> 4 & 15,
        r.push(ic[i & 63]),
        i = (o & 15) << 2,
        n >= e) {
            r.push(ic[i & 63]);
            break
        }
        o = t[n++] & 255,
        i |= o >> 6 & 3,
        r.push(ic[i & 63]),
        r.push(ic[o & 63])
    }
    return r.join("")
}
function a5(t, e) {
    var n = 0, r = t.length, i = 0, o = [], s, a, l, c, u, f;
    if (e <= 0)
        throw Error("Illegal len: " + e);
    for (; n < r - 1 && i < e && (f = t.charCodeAt(n++),
    s = f < ws.length ? ws[f] : -1,
    f = t.charCodeAt(n++),
    a = f < ws.length ? ws[f] : -1,
    !(s == -1 || a == -1 || (u = s << 2 >>> 0,
    u |= (a & 48) >> 4,
    o.push(String.fromCharCode(u)),
    ++i >= e || n >= r) || (f = t.charCodeAt(n++),
    l = f < ws.length ? ws[f] : -1,
    l == -1) || (u = (a & 15) << 4 >>> 0,
    u |= (l & 60) >> 2,
    o.push(String.fromCharCode(u)),
    ++i >= e || n >= r))); )
        f = t.charCodeAt(n++),
        c = f < ws.length ? ws[f] : -1,
        u = (l & 3) << 6 >>> 0,
        u |= c,
        o.push(String.fromCharCode(u)),
        ++i;
    var d = [];
    for (n = 0; n < i; n++)
        d.push(o[n].charCodeAt(0));
    return d
}
var vd = 16
  , k2 = 10
  , z0e = 16
  , j0e = 100
  , R3 = [608135816, 2242054355, 320440878, 57701188, 2752067618, 698298832, 137296536, 3964562569, 1160258022, 953160567, 3193202383, 887688300, 3232508343, 3380367581, 1065670069, 3041331479, 2450970073, 2306472731]
  , M3 = [3509652390, 2564797868, 805139163, 3491422135, 3101798381, 1780907670, 3128725573, 4046225305, 614570311, 3012652279, 134345442, 2240740374, 1667834072, 1901547113, 2757295779, 4103290238, 227898511, 1921955416, 1904987480, 2182433518, 2069144605, 3260701109, 2620446009, 720527379, 3318853667, 677414384, 3393288472, 3101374703, 2390351024, 1614419982, 1822297739, 2954791486, 3608508353, 3174124327, 2024746970, 1432378464, 3864339955, 2857741204, 1464375394, 1676153920, 1439316330, 715854006, 3033291828, 289532110, 2706671279, 2087905683, 3018724369, 1668267050, 732546397, 1947742710, 3462151702, 2609353502, 2950085171, 1814351708, 2050118529, 680887927, 999245976, 1800124847, 3300911131, 1713906067, 1641548236, 4213287313, 1216130144, 1575780402, 4018429277, 3917837745, 3693486850, 3949271944, 596196993, 3549867205, 258830323, 2213823033, 772490370, 2760122372, 1774776394, 2652871518, 566650946, 4142492826, 1728879713, 2882767088, 1783734482, 3629395816, 2517608232, 2874225571, 1861159788, 326777828, 3124490320, 2130389656, 2716951837, 967770486, 1724537150, 2185432712, 2364442137, 1164943284, 2105845187, 998989502, 3765401048, 2244026483, 1075463327, 1455516326, 1322494562, 910128902, 469688178, 1117454909, 936433444, 3490320968, 3675253459, 1240580251, 122909385, 2157517691, 634681816, 4142456567, 3825094682, 3061402683, 2540495037, 79693498, 3249098678, 1084186820, 1583128258, 426386531, 1761308591, 1047286709, 322548459, 995290223, 1845252383, 2603652396, 3431023940, 2942221577, 3202600964, 3727903485, 1712269319, 422464435, 3234572375, 1170764815, 3523960633, 3117677531, 1434042557, 442511882, 3600875718, 1076654713, 1738483198, 4213154764, 2393238008, 3677496056, 1014306527, 4251020053, 793779912, 2902807211, 842905082, 4246964064, 1395751752, 1040244610, 2656851899, 3396308128, 445077038, 3742853595, 3577915638, 679411651, 2892444358, 2354009459, 1767581616, 3150600392, 3791627101, 3102740896, 284835224, 4246832056, 1258075500, 768725851, 2589189241, 3069724005, 3532540348, 1274779536, 3789419226, 2764799539, 1660621633, 3471099624, 4011903706, 913787905, 3497959166, 737222580, 2514213453, 2928710040, 3937242737, 1804850592, 3499020752, 2949064160, 2386320175, 2390070455, 2415321851, 4061277028, 2290661394, 2416832540, 1336762016, 1754252060, 3520065937, 3014181293, 791618072, 3188594551, 3933548030, 2332172193, 3852520463, 3043980520, 413987798, 3465142937, 3030929376, 4245938359, 2093235073, 3534596313, 375366246, 2157278981, 2479649556, 555357303, 3870105701, 2008414854, 3344188149, 4221384143, 3956125452, 2067696032, 3594591187, 2921233993, 2428461, 544322398, 577241275, 1471733935, 610547355, 4027169054, 1432588573, 1507829418, 2025931657, 3646575487, 545086370, 48609733, 2200306550, 1653985193, 298326376, 1316178497, 3007786442, 2064951626, 458293330, 2589141269, 3591329599, 3164325604, 727753846, 2179363840, 146436021, 1461446943, 4069977195, 705550613, 3059967265, 3887724982, 4281599278, 3313849956, 1404054877, 2845806497, 146425753, 1854211946, 1266315497, 3048417604, 3681880366, 3289982499, 290971e4, 1235738493, 2632868024, 2414719590, 3970600049, 1771706367, 1449415276, 3266420449, 422970021, 1963543593, 2690192192, 3826793022, 1062508698, 1531092325, 1804592342, 2583117782, 2714934279, 4024971509, 1294809318, 4028980673, 1289560198, 2221992742, 1669523910, 35572830, 157838143, 1052438473, 1016535060, 1802137761, 1753167236, 1386275462, 3080475397, 2857371447, 1040679964, 2145300060, 2390574316, 1461121720, 2956646967, 4031777805, 4028374788, 33600511, 2920084762, 1018524850, 629373528, 3691585981, 3515945977, 2091462646, 2486323059, 586499841, 988145025, 935516892, 3367335476, 2599673255, 2839830854, 265290510, 3972581182, 2759138881, 3795373465, 1005194799, 847297441, 406762289, 1314163512, 1332590856, 1866599683, 4127851711, 750260880, 613907577, 1450815602, 3165620655, 3734664991, 3650291728, 3012275730, 3704569646, 1427272223, 778793252, 1343938022, 2676280711, 2052605720, 1946737175, 3164576444, 3914038668, 3967478842, 3682934266, 1661551462, 3294938066, 4011595847, 840292616, 3712170807, 616741398, 312560963, 711312465, 1351876610, 322626781, 1910503582, 271666773, 2175563734, 1594956187, 70604529, 3617834859, 1007753275, 1495573769, 4069517037, 2549218298, 2663038764, 504708206, 2263041392, 3941167025, 2249088522, 1514023603, 1998579484, 1312622330, 694541497, 2582060303, 2151582166, 1382467621, 776784248, 2618340202, 3323268794, 2497899128, 2784771155, 503983604, 4076293799, 907881277, 423175695, 432175456, 1378068232, 4145222326, 3954048622, 3938656102, 3820766613, 2793130115, 2977904593, 26017576, 3274890735, 3194772133, 1700274565, 1756076034, 4006520079, 3677328699, 720338349, 1533947780, 354530856, 688349552, 3973924725, 1637815568, 332179504, 3949051286, 53804574, 2852348879, 3044236432, 1282449977, 3583942155, 3416972820, 4006381244, 1617046695, 2628476075, 3002303598, 1686838959, 431878346, 2686675385, 1700445008, 1080580658, 1009431731, 832498133, 3223435511, 2605976345, 2271191193, 2516031870, 1648197032, 4164389018, 2548247927, 300782431, 375919233, 238389289, 3353747414, 2531188641, 2019080857, 1475708069, 455242339, 2609103871, 448939670, 3451063019, 1395535956, 2413381860, 1841049896, 1491858159, 885456874, 4264095073, 4001119347, 1565136089, 3898914787, 1108368660, 540939232, 1173283510, 2745871338, 3681308437, 4207628240, 3343053890, 4016749493, 1699691293, 1103962373, 3625875870, 2256883143, 3830138730, 1031889488, 3479347698, 1535977030, 4236805024, 3251091107, 2132092099, 1774941330, 1199868427, 1452454533, 157007616, 2904115357, 342012276, 595725824, 1480756522, 206960106, 497939518, 591360097, 863170706, 2375253569, 3596610801, 1814182875, 2094937945, 3421402208, 1082520231, 3463918190, 2785509508, 435703966, 3908032597, 1641649973, 2842273706, 3305899714, 1510255612, 2148256476, 2655287854, 3276092548, 4258621189, 236887753, 3681803219, 274041037, 1734335097, 3815195456, 3317970021, 1899903192, 1026095262, 4050517792, 356393447, 2410691914, 3873677099, 3682840055, 3913112168, 2491498743, 4132185628, 2489919796, 1091903735, 1979897079, 3170134830, 3567386728, 3557303409, 857797738, 1136121015, 1342202287, 507115054, 2535736646, 337727348, 3213592640, 1301675037, 2528481711, 1895095763, 1721773893, 3216771564, 62756741, 2142006736, 835421444, 2531993523, 1442658625, 3659876326, 2882144922, 676362277, 1392781812, 170690266, 3921047035, 1759253602, 3611846912, 1745797284, 664899054, 1329594018, 3901205900, 3045908486, 2062866102, 2865634940, 3543621612, 3464012697, 1080764994, 553557557, 3656615353, 3996768171, 991055499, 499776247, 1265440854, 648242737, 3940784050, 980351604, 3713745714, 1749149687, 3396870395, 4211799374, 3640570775, 1161844396, 3125318951, 1431517754, 545492359, 4268468663, 3499529547, 1437099964, 2702547544, 3433638243, 2581715763, 2787789398, 1060185593, 1593081372, 2418618748, 4260947970, 69676912, 2159744348, 86519011, 2512459080, 3838209314, 1220612927, 3339683548, 133810670, 1090789135, 1078426020, 1569222167, 845107691, 3583754449, 4072456591, 1091646820, 628848692, 1613405280, 3757631651, 526609435, 236106946, 48312990, 2942717905, 3402727701, 1797494240, 859738849, 992217954, 4005476642, 2243076622, 3870952857, 3732016268, 765654824, 3490871365, 2511836413, 1685915746, 3888969200, 1414112111, 2273134842, 3281911079, 4080962846, 172450625, 2569994100, 980381355, 4109958455, 2819808352, 2716589560, 2568741196, 3681446669, 3329971472, 1835478071, 660984891, 3704678404, 4045999559, 3422617507, 3040415634, 1762651403, 1719377915, 3470491036, 2693910283, 3642056355, 3138596744, 1364962596, 2073328063, 1983633131, 926494387, 3423689081, 2150032023, 4096667949, 1749200295, 3328846651, 309677260, 2016342300, 1779581495, 3079819751, 111262694, 1274766160, 443224088, 298511866, 1025883608, 3806446537, 1145181785, 168956806, 3641502830, 3584813610, 1689216846, 3666258015, 3200248200, 1692713982, 2646376535, 4042768518, 1618508792, 1610833997, 3523052358, 4130873264, 2001055236, 3610705100, 2202168115, 4028541809, 2961195399, 1006657119, 2006996926, 3186142756, 1430667929, 3210227297, 1314452623, 4074634658, 4101304120, 2273951170, 1399257539, 3367210612, 3027628629, 1190975929, 2062231137, 2333990788, 2221543033, 2438960610, 1181637006, 548689776, 2362791313, 3372408396, 3104550113, 3145860560, 296247880, 1970579870, 3078560182, 3769228297, 1714227617, 3291629107, 3898220290, 166772364, 1251581989, 493813264, 448347421, 195405023, 2709975567, 677966185, 3703036547, 1463355134, 2715995803, 1338867538, 1343315457, 2802222074, 2684532164, 233230375, 2599980071, 2000651841, 3277868038, 1638401717, 4028070440, 3237316320, 6314154, 819756386, 300326615, 590932579, 1405279636, 3267499572, 3150704214, 2428286686, 3959192993, 3461946742, 1862657033, 1266418056, 963775037, 2089974820, 2263052895, 1917689273, 448879540, 3550394620, 3981727096, 150775221, 3627908307, 1303187396, 508620638, 2975983352, 2726630617, 1817252668, 1876281319, 1457606340, 908771278, 3720792119, 3617206836, 2455994898, 1729034894, 1080033504, 976866871, 3556439503, 2881648439, 1522871579, 1555064734, 1336096578, 3548522304, 2579274686, 3574697629, 3205460757, 3593280638, 3338716283, 3079412587, 564236357, 2993598910, 1781952180, 1464380207, 3163844217, 3332601554, 1699332808, 1393555694, 1183702653, 3581086237, 1288719814, 691649499, 2847557200, 2895455976, 3193889540, 2717570544, 1781354906, 1676643554, 2592534050, 3230253752, 1126444790, 2770207658, 2633158820, 2210423226, 2615765581, 2414155088, 3127139286, 673620729, 2805611233, 1269405062, 4015350505, 3341807571, 4149409754, 1057255273, 2012875353, 2162469141, 2276492801, 2601117357, 993977747, 3918593370, 2654263191, 753973209, 36408145, 2530585658, 25011837, 3520020182, 2088578344, 530523599, 2918365339, 1524020338, 1518925132, 3760827505, 3759777254, 1202760957, 3985898139, 3906192525, 674977740, 4174734889, 2031300136, 2019492241, 3983892565, 4153806404, 3822280332, 352677332, 2297720250, 60907813, 90501309, 3286998549, 1016092578, 2535922412, 2839152426, 457141659, 509813237, 4120667899, 652014361, 1966332200, 2975202805, 55981186, 2327461051, 676427537, 3255491064, 2882294119, 3433927263, 1307055953, 942726286, 933058658, 2468411793, 3933900994, 4215176142, 1361170020, 2001714738, 2830558078, 3274259782, 1222529897, 1679025792, 2729314320, 3714953764, 1770335741, 151462246, 3013232138, 1682292957, 1483529935, 471910574, 1539241949, 458788160, 3436315007, 1807016891, 3718408830, 978976581, 1043663428, 3165965781, 1927990952, 4200891579, 2372276910, 3208408903, 3533431907, 1412390302, 2931980059, 4132332400, 1947078029, 3881505623, 4168226417, 2941484381, 1077988104, 1320477388, 886195818, 18198404, 3786409e3, 2509781533, 112762804, 3463356488, 1866414978, 891333506, 18488651, 661792760, 1628790961, 3885187036, 3141171499, 876946877, 2693282273, 1372485963, 791857591, 2686433993, 3759982718, 3167212022, 3472953795, 2716379847, 445679433, 3561995674, 3504004811, 3574258232, 54117162, 3331405415, 2381918588, 3769707343, 4154350007, 1140177722, 4074052095, 668550556, 3214352940, 367459370, 261225585, 2610173221, 4209349473, 3468074219, 3265815641, 314222801, 3066103646, 3808782860, 282218597, 3406013506, 3773591054, 379116347, 1285071038, 846784868, 2669647154, 3771962079, 3550491691, 2305946142, 453669953, 1268987020, 3317592352, 3279303384, 3744833421, 2610507566, 3859509063, 266596637, 3847019092, 517658769, 3462560207, 3443424879, 370717030, 4247526661, 2224018117, 4143653529, 4112773975, 2788324899, 2477274417, 1456262402, 2901442914, 1517677493, 1846949527, 2295493580, 3734397586, 2176403920, 1280348187, 1908823572, 3871786941, 846861322, 1172426758, 3287448474, 3383383037, 1655181056, 3139813346, 901632758, 1897031941, 2986607138, 3066810236, 3447102507, 1393639104, 373351379, 950779232, 625454576, 3124240540, 4148612726, 2007998917, 544563296, 2244738638, 2330496472, 2058025392, 1291430526, 424198748, 50039436, 29584100, 3605783033, 2429876329, 2791104160, 1057563949, 3255363231, 3075367218, 3463963227, 1469046755, 985887462]
  , l5 = [1332899944, 1700884034, 1701343084, 1684370003, 1668446532, 1869963892];
function yd(t, e, n, r) {
    var i, o = t[e], s = t[e + 1];
    return o ^= n[0],
    i = r[o >>> 24],
    i += r[256 | o >> 16 & 255],
    i ^= r[512 | o >> 8 & 255],
    i += r[768 | o & 255],
    s ^= i ^ n[1],
    i = r[s >>> 24],
    i += r[256 | s >> 16 & 255],
    i ^= r[512 | s >> 8 & 255],
    i += r[768 | s & 255],
    o ^= i ^ n[2],
    i = r[o >>> 24],
    i += r[256 | o >> 16 & 255],
    i ^= r[512 | o >> 8 & 255],
    i += r[768 | o & 255],
    s ^= i ^ n[3],
    i = r[s >>> 24],
    i += r[256 | s >> 16 & 255],
    i ^= r[512 | s >> 8 & 255],
    i += r[768 | s & 255],
    o ^= i ^ n[4],
    i = r[o >>> 24],
    i += r[256 | o >> 16 & 255],
    i ^= r[512 | o >> 8 & 255],
    i += r[768 | o & 255],
    s ^= i ^ n[5],
    i = r[s >>> 24],
    i += r[256 | s >> 16 & 255],
    i ^= r[512 | s >> 8 & 255],
    i += r[768 | s & 255],
    o ^= i ^ n[6],
    i = r[o >>> 24],
    i += r[256 | o >> 16 & 255],
    i ^= r[512 | o >> 8 & 255],
    i += r[768 | o & 255],
    s ^= i ^ n[7],
    i = r[s >>> 24],
    i += r[256 | s >> 16 & 255],
    i ^= r[512 | s >> 8 & 255],
    i += r[768 | s & 255],
    o ^= i ^ n[8],
    i = r[o >>> 24],
    i += r[256 | o >> 16 & 255],
    i ^= r[512 | o >> 8 & 255],
    i += r[768 | o & 255],
    s ^= i ^ n[9],
    i = r[s >>> 24],
    i += r[256 | s >> 16 & 255],
    i ^= r[512 | s >> 8 & 255],
    i += r[768 | s & 255],
    o ^= i ^ n[10],
    i = r[o >>> 24],
    i += r[256 | o >> 16 & 255],
    i ^= r[512 | o >> 8 & 255],
    i += r[768 | o & 255],
    s ^= i ^ n[11],
    i = r[s >>> 24],
    i += r[256 | s >> 16 & 255],
    i ^= r[512 | s >> 8 & 255],
    i += r[768 | s & 255],
    o ^= i ^ n[12],
    i = r[o >>> 24],
    i += r[256 | o >> 16 & 255],
    i ^= r[512 | o >> 8 & 255],
    i += r[768 | o & 255],
    s ^= i ^ n[13],
    i = r[s >>> 24],
    i += r[256 | s >> 16 & 255],
    i ^= r[512 | s >> 8 & 255],
    i += r[768 | s & 255],
    o ^= i ^ n[14],
    i = r[o >>> 24],
    i += r[256 | o >> 16 & 255],
    i ^= r[512 | o >> 8 & 255],
    i += r[768 | o & 255],
    s ^= i ^ n[15],
    i = r[s >>> 24],
    i += r[256 | s >> 16 & 255],
    i ^= r[512 | s >> 8 & 255],
    i += r[768 | s & 255],
    o ^= i ^ n[16],
    t[e] = s ^ n[z0e + 1],
    t[e + 1] = o,
    t
}
function hc(t, e) {
    for (var n = 0, r = 0; n < 4; ++n)
        r = r << 8 | t[e] & 255,
        e = (e + 1) % t.length;
    return {
        key: r,
        offp: e
    }
}
function D3(t, e, n) {
    for (var r = 0, i = [0, 0], o = e.length, s = n.length, a, l = 0; l < o; l++)
        a = hc(t, r),
        r = a.offp,
        e[l] = e[l] ^ a.key;
    for (l = 0; l < o; l += 2)
        i = yd(i, 0, e, n),
        e[l] = i[0],
        e[l + 1] = i[1];
    for (l = 0; l < s; l += 2)
        i = yd(i, 0, e, n),
        n[l] = i[0],
        n[l + 1] = i[1]
}
function W0e(t, e, n, r) {
    for (var i = 0, o = [0, 0], s = n.length, a = r.length, l, c = 0; c < s; c++)
        l = hc(e, i),
        i = l.offp,
        n[c] = n[c] ^ l.key;
    for (i = 0,
    c = 0; c < s; c += 2)
        l = hc(t, i),
        i = l.offp,
        o[0] ^= l.key,
        l = hc(t, i),
        i = l.offp,
        o[1] ^= l.key,
        o = yd(o, 0, n, r),
        n[c] = o[0],
        n[c + 1] = o[1];
    for (c = 0; c < a; c += 2)
        l = hc(t, i),
        i = l.offp,
        o[0] ^= l.key,
        l = hc(t, i),
        i = l.offp,
        o[1] ^= l.key,
        o = yd(o, 0, n, r),
        r[c] = o[0],
        r[c + 1] = o[1]
}
function B3(t, e, n, r, i) {
    var o = l5.slice(), s = o.length, a;
    if (n < 4 || n > 31)
        if (a = Error("Illegal number of rounds (4-31): " + n),
        r) {
            Di(r.bind(this, a));
            return
        } else
            throw a;
    if (e.length !== vd)
        if (a = Error("Illegal salt length: " + e.length + " != " + vd),
        r) {
            Di(r.bind(this, a));
            return
        } else
            throw a;
    n = 1 << n >>> 0;
    var l, c, u = 0, f;
    typeof Int32Array == "function" ? (l = new Int32Array(R3),
    c = new Int32Array(M3)) : (l = R3.slice(),
    c = M3.slice()),
    W0e(e, t, l, c);
    function d() {
        if (i && i(u / n),
        u < n)
            for (var p = Date.now(); u < n && (u = u + 1,
            D3(t, l, c),
            D3(e, l, c),
            !(Date.now() - p > j0e)); )
                ;
        else {
            for (u = 0; u < 64; u++)
                for (f = 0; f < s >> 1; f++)
                    yd(o, f << 1, l, c);
            var y = [];
            for (u = 0; u < s; u++)
                y.push((o[u] >> 24 & 255) >>> 0),
                y.push((o[u] >> 16 & 255) >>> 0),
                y.push((o[u] >> 8 & 255) >>> 0),
                y.push((o[u] & 255) >>> 0);
            if (r) {
                r(null, y);
                return
            } else
                return y
        }
        r && Di(d)
    }
    if (typeof r < "u")
        d();
    else
        for (var h; ; )
            if (typeof (h = d()) < "u")
                return h || []
}
function lx(t, e, n, r) {
    var i;
    if (typeof t != "string" || typeof e != "string")
        if (i = Error("Invalid string / salt: Not a string"),
        n) {
            Di(n.bind(this, i));
            return
        } else
            throw i;
    var o, s;
    if (e.charAt(0) !== "$" || e.charAt(1) !== "2")
        if (i = Error("Invalid salt version: " + e.substring(0, 2)),
        n) {
            Di(n.bind(this, i));
            return
        } else
            throw i;
    if (e.charAt(2) === "$")
        o = String.fromCharCode(0),
        s = 3;
    else {
        if (o = e.charAt(2),
        o !== "a" && o !== "b" && o !== "y" || e.charAt(3) !== "$")
            if (i = Error("Invalid salt revision: " + e.substring(2, 4)),
            n) {
                Di(n.bind(this, i));
                return
            } else
                throw i;
        s = 4
    }
    if (e.charAt(s + 2) > "$")
        if (i = Error("Missing salt rounds"),
        n) {
            Di(n.bind(this, i));
            return
        } else
            throw i;
    var a = parseInt(e.substring(s, s + 1), 10) * 10
      , l = parseInt(e.substring(s + 1, s + 2), 10)
      , c = a + l
      , u = e.substring(s + 3, s + 25);
    t += o >= "a" ? "\0" : "";
    var f = V0e(t)
      , d = a5(u, vd);
    function h(p) {
        var y = [];
        return y.push("$2"),
        o >= "a" && y.push(o),
        y.push("$"),
        c < 10 && y.push("0"),
        y.push(c.toString()),
        y.push("$"),
        y.push(O0(d, d.length)),
        y.push(O0(p, l5.length * 4 - 1)),
        y.join("")
    }
    if (typeof n > "u")
        return h(B3(f, d, c));
    B3(f, d, c, function(p, y) {
        p ? n(p, null) : n(null, h(y))
    }, r)
}
function Y0e(t, e) {
    return O0(t, e)
}
function X0e(t, e) {
    return a5(t, e)
}
const MPe = {
    setRandomFallback: F0e,
    genSaltSync: B2,
    genSalt: n5,
    hashSync: r5,
    hash: i5,
    compareSync: L0e,
    compare: $0e,
    getRounds: U0e,
    getSalt: G0e,
    truncates: H0e,
    encodeBase64: Y0e,
    decodeBase64: X0e
};
/*! Capacitor: https://capacitorjs.com/ - MIT License */
var Jc;
(function(t) {
    t.Unimplemented = "UNIMPLEMENTED",
    t.Unavailable = "UNAVAILABLE"
}
)(Jc || (Jc = {}));
class tv extends Error {
    constructor(e, n, r) {
        super(e),
        this.message = e,
        this.code = n,
        this.data = r
    }
}
const K0e = t => {
    var e, n;
    return t != null && t.androidBridge ? "android" : !((n = (e = t == null ? void 0 : t.webkit) === null || e === void 0 ? void 0 : e.messageHandlers) === null || n === void 0) && n.bridge ? "ios" : "web"
}
  , q0e = t => {
    const e = t.CapacitorCustomPlatform || null
      , n = t.Capacitor || {}
      , r = n.Plugins = n.Plugins || {}
      , i = () => e !== null ? e.name : K0e(t)
      , o = () => i() !== "web"
      , s = f => {
        const d = c.get(f);
        return !!(d != null && d.platforms.has(i()) || a(f))
    }
      , a = f => {
        var d;
        return (d = n.PluginHeaders) === null || d === void 0 ? void 0 : d.find(h => h.name === f)
    }
      , l = f => t.console.error(f)
      , c = new Map
      , u = (f, d={}) => {
        const h = c.get(f);
        if (h)
            return console.warn(`Capacitor plugin "${f}" already registered. Cannot register plugins twice.`),
            h.proxy;
        const p = i()
          , y = a(f);
        let v;
        const g = async () => (!v && p in d ? v = typeof d[p] == "function" ? v = await d[p]() : v = d[p] : e !== null && !v && "web"in d && (v = typeof d.web == "function" ? v = await d.web() : v = d.web),
        v)
          , m = (S, P) => {
            var C, A;
            if (y) {
                const T = y == null ? void 0 : y.methods.find(I => P === I.name);
                if (T)
                    return T.rtype === "promise" ? I => n.nativePromise(f, P.toString(), I) : (I, B) => n.nativeCallback(f, P.toString(), I, B);
                if (S)
                    return (C = S[P]) === null || C === void 0 ? void 0 : C.bind(S)
            } else {
                if (S)
                    return (A = S[P]) === null || A === void 0 ? void 0 : A.bind(S);
                throw new tv(`"${f}" plugin is not implemented on ${p}`,Jc.Unimplemented)
            }
        }
          , _ = S => {
            let P;
            const C = (...A) => {
                const T = g().then(I => {
                    const B = m(I, S);
                    if (B) {
                        const G = B(...A);
                        return P = G == null ? void 0 : G.remove,
                        G
                    } else
                        throw new tv(`"${f}.${S}()" is not implemented on ${p}`,Jc.Unimplemented)
                }
                );
                return S === "addListener" && (T.remove = async () => P()),
                T
            }
            ;
            return C.toString = () => `${S.toString()}() { [capacitor code] }`,
            Object.defineProperty(C, "name", {
                value: S,
                writable: !1,
                configurable: !1
            }),
            C
        }
          , x = _("addListener")
          , b = _("removeListener")
          , w = (S, P) => {
            const C = x({
                eventName: S
            }, P)
              , A = async () => {
                const I = await C;
                b({
                    eventName: S,
                    callbackId: I
                }, P)
            }
              , T = new Promise(I => C.then( () => I({
                remove: A
            })));
            return T.remove = async () => {
                console.warn("Using addListener() without 'await' is deprecated."),
                await A()
            }
            ,
            T
        }
          , E = new Proxy({},{
            get(S, P) {
                switch (P) {
                case "$$typeof":
                    return;
                case "toJSON":
                    return () => ({});
                case "addListener":
                    return y ? w : x;
                case "removeListener":
                    return b;
                default:
                    return _(P)
                }
            }
        });
        return r[f] = E,
        c.set(f, {
            name: f,
            proxy: E,
            platforms: new Set([...Object.keys(d), ...y ? [p] : []])
        }),
        E
    }
    ;
    return n.convertFileSrc || (n.convertFileSrc = f => f),
    n.getPlatform = i,
    n.handleError = l,
    n.isNativePlatform = o,
    n.isPluginAvailable = s,
    n.registerPlugin = u,
    n.Exception = tv,
    n.DEBUG = !!n.DEBUG,
    n.isLoggingEnabled = !!n.isLoggingEnabled,
    n
}
  , Z0e = t => t.Capacitor = q0e(t)
  , cx = Z0e(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {})
  , N2 = cx.registerPlugin;
class F2 {
    constructor() {
        this.listeners = {},
        this.retainedEventArguments = {},
        this.windowListeners = {}
    }
    addListener(e, n) {
        let r = !1;
        this.listeners[e] || (this.listeners[e] = [],
        r = !0),
        this.listeners[e].push(n);
        const o = this.windowListeners[e];
        o && !o.registered && this.addWindowListener(o),
        r && this.sendRetainedArgumentsForEvent(e);
        const s = async () => this.removeListener(e, n);
        return Promise.resolve({
            remove: s
        })
    }
    async removeAllListeners() {
        this.listeners = {};
        for (const e in this.windowListeners)
            this.removeWindowListener(this.windowListeners[e]);
        this.windowListeners = {}
    }
    notifyListeners(e, n, r) {
        const i = this.listeners[e];
        if (!i) {
            if (r) {
                let o = this.retainedEventArguments[e];
                o || (o = []),
                o.push(n),
                this.retainedEventArguments[e] = o
            }
            return
        }
        i.forEach(o => o(n))
    }
    hasListeners(e) {
        var n;
        return !!(!((n = this.listeners[e]) === null || n === void 0) && n.length)
    }
    registerWindowListener(e, n) {
        this.windowListeners[n] = {
            registered: !1,
            windowEventName: e,
            pluginEventName: n,
            handler: r => {
                this.notifyListeners(n, r)
            }
        }
    }
    unimplemented(e="not implemented") {
        return new cx.Exception(e,Jc.Unimplemented)
    }
    unavailable(e="not available") {
        return new cx.Exception(e,Jc.Unavailable)
    }
    async removeListener(e, n) {
        const r = this.listeners[e];
        if (!r)
            return;
        const i = r.indexOf(n);
        this.listeners[e].splice(i, 1),
        this.listeners[e].length || this.removeWindowListener(this.windowListeners[e])
    }
    addWindowListener(e) {
        window.addEventListener(e.windowEventName, e.handler),
        e.registered = !0
    }
    removeWindowListener(e) {
        e && (window.removeEventListener(e.windowEventName, e.handler),
        e.registered = !1)
    }
    sendRetainedArgumentsForEvent(e) {
        const n = this.retainedEventArguments[e];
        n && (delete this.retainedEventArguments[e],
        n.forEach(r => {
            this.notifyListeners(e, r)
        }
        ))
    }
}
const k3 = t => encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape)
  , N3 = t => t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
class J0e extends F2 {
    async getCookies() {
        const e = document.cookie
          , n = {};
        return e.split(";").forEach(r => {
            if (r.length <= 0)
                return;
            let[i,o] = r.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
            i = N3(i).trim(),
            o = N3(o).trim(),
            n[i] = o
        }
        ),
        n
    }
    async setCookie(e) {
        try {
            const n = k3(e.key)
              , r = k3(e.value)
              , i = `; expires=${(e.expires || "").replace("expires=", "")}`
              , o = (e.path || "/").replace("path=", "")
              , s = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
            document.cookie = `${n}=${r || ""}${i}; path=${o}; ${s};`
        } catch (n) {
            return Promise.reject(n)
        }
    }
    async deleteCookie(e) {
        try {
            document.cookie = `${e.key}=; Max-Age=0`
        } catch (n) {
            return Promise.reject(n)
        }
    }
    async clearCookies() {
        try {
            const e = document.cookie.split(";") || [];
            for (const n of e)
                document.cookie = n.replace(/^ +/, "").replace(/=.*/, `=;expires=${new Date().toUTCString()};path=/`)
        } catch (e) {
            return Promise.reject(e)
        }
    }
    async clearAllCookies() {
        try {
            await this.clearCookies()
        } catch (e) {
            return Promise.reject(e)
        }
    }
}
N2("CapacitorCookies", {
    web: () => new J0e
});
const Q0e = async t => new Promise( (e, n) => {
    const r = new FileReader;
    r.onload = () => {
        const i = r.result;
        e(i.indexOf(",") >= 0 ? i.split(",")[1] : i)
    }
    ,
    r.onerror = i => n(i),
    r.readAsDataURL(t)
}
)
  , ege = (t={}) => {
    const e = Object.keys(t);
    return Object.keys(t).map(i => i.toLocaleLowerCase()).reduce( (i, o, s) => (i[o] = t[e[s]],
    i), {})
}
  , tge = (t, e=!0) => t ? Object.entries(t).reduce( (r, i) => {
    const [o,s] = i;
    let a, l;
    return Array.isArray(s) ? (l = "",
    s.forEach(c => {
        a = e ? encodeURIComponent(c) : c,
        l += `${o}=${a}&`
    }
    ),
    l.slice(0, -1)) : (a = e ? encodeURIComponent(s) : s,
    l = `${o}=${a}`),
    `${r}&${l}`
}
, "").substr(1) : null
  , nge = (t, e={}) => {
    const n = Object.assign({
        method: t.method || "GET",
        headers: t.headers
    }, e)
      , i = ege(t.headers)["content-type"] || "";
    if (typeof t.data == "string")
        n.body = t.data;
    else if (i.includes("application/x-www-form-urlencoded")) {
        const o = new URLSearchParams;
        for (const [s,a] of Object.entries(t.data || {}))
            o.set(s, a);
        n.body = o.toString()
    } else if (i.includes("multipart/form-data") || t.data instanceof FormData) {
        const o = new FormData;
        if (t.data instanceof FormData)
            t.data.forEach( (a, l) => {
                o.append(l, a)
            }
            );
        else
            for (const a of Object.keys(t.data))
                o.append(a, t.data[a]);
        n.body = o;
        const s = new Headers(n.headers);
        s.delete("content-type"),
        n.headers = s
    } else
        (i.includes("application/json") || typeof t.data == "object") && (n.body = JSON.stringify(t.data));
    return n
}
;
class rge extends F2 {
    async request(e) {
        const n = nge(e, e.webFetchExtra)
          , r = tge(e.params, e.shouldEncodeUrlParams)
          , i = r ? `${e.url}?${r}` : e.url
          , o = await fetch(i, n)
          , s = o.headers.get("content-type") || "";
        let {responseType: a="text"} = o.ok ? e : {};
        s.includes("application/json") && (a = "json");
        let l, c;
        switch (a) {
        case "arraybuffer":
        case "blob":
            c = await o.blob(),
            l = await Q0e(c);
            break;
        case "json":
            l = await o.json();
            break;
        case "document":
        case "text":
        default:
            l = await o.text()
        }
        const u = {};
        return o.headers.forEach( (f, d) => {
            u[d] = f
        }
        ),
        {
            data: l,
            headers: u,
            status: o.status,
            url: o.url
        }
    }
    async get(e) {
        return this.request(Object.assign(Object.assign({}, e), {
            method: "GET"
        }))
    }
    async post(e) {
        return this.request(Object.assign(Object.assign({}, e), {
            method: "POST"
        }))
    }
    async put(e) {
        return this.request(Object.assign(Object.assign({}, e), {
            method: "PUT"
        }))
    }
    async patch(e) {
        return this.request(Object.assign(Object.assign({}, e), {
            method: "PATCH"
        }))
    }
    async delete(e) {
        return this.request(Object.assign(Object.assign({}, e), {
            method: "DELETE"
        }))
    }
}
N2("CapacitorHttp", {
    web: () => new rge
});
const DPe = N2("App", {
    web: () => Uf( () => Promise.resolve().then( () => qAe), void 0).then(t => new t.AppWeb)
});
const ige = () => {}
;
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const c5 = function(t) {
    const e = [];
    let n = 0;
    for (let r = 0; r < t.length; r++) {
        let i = t.charCodeAt(r);
        i < 128 ? e[n++] = i : i < 2048 ? (e[n++] = i >> 6 | 192,
        e[n++] = i & 63 | 128) : (i & 64512) === 55296 && r + 1 < t.length && (t.charCodeAt(r + 1) & 64512) === 56320 ? (i = 65536 + ((i & 1023) << 10) + (t.charCodeAt(++r) & 1023),
        e[n++] = i >> 18 | 240,
        e[n++] = i >> 12 & 63 | 128,
        e[n++] = i >> 6 & 63 | 128,
        e[n++] = i & 63 | 128) : (e[n++] = i >> 12 | 224,
        e[n++] = i >> 6 & 63 | 128,
        e[n++] = i & 63 | 128)
    }
    return e
}
  , oge = function(t) {
    const e = [];
    let n = 0
      , r = 0;
    for (; n < t.length; ) {
        const i = t[n++];
        if (i < 128)
            e[r++] = String.fromCharCode(i);
        else if (i > 191 && i < 224) {
            const o = t[n++];
            e[r++] = String.fromCharCode((i & 31) << 6 | o & 63)
        } else if (i > 239 && i < 365) {
            const o = t[n++]
              , s = t[n++]
              , a = t[n++]
              , l = ((i & 7) << 18 | (o & 63) << 12 | (s & 63) << 6 | a & 63) - 65536;
            e[r++] = String.fromCharCode(55296 + (l >> 10)),
            e[r++] = String.fromCharCode(56320 + (l & 1023))
        } else {
            const o = t[n++]
              , s = t[n++];
            e[r++] = String.fromCharCode((i & 15) << 12 | (o & 63) << 6 | s & 63)
        }
    }
    return e.join("")
}
  , u5 = {
    byteToCharMap_: null,
    charToByteMap_: null,
    byteToCharMapWebSafe_: null,
    charToByteMapWebSafe_: null,
    ENCODED_VALS_BASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
    get ENCODED_VALS() {
        return this.ENCODED_VALS_BASE + "+/="
    },
    get ENCODED_VALS_WEBSAFE() {
        return this.ENCODED_VALS_BASE + "-_."
    },
    HAS_NATIVE_SUPPORT: typeof atob == "function",
    encodeByteArray(t, e) {
        if (!Array.isArray(t))
            throw Error("encodeByteArray takes an array as a parameter");
        this.init_();
        const n = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_
          , r = [];
        for (let i = 0; i < t.length; i += 3) {
            const o = t[i]
              , s = i + 1 < t.length
              , a = s ? t[i + 1] : 0
              , l = i + 2 < t.length
              , c = l ? t[i + 2] : 0
              , u = o >> 2
              , f = (o & 3) << 4 | a >> 4;
            let d = (a & 15) << 2 | c >> 6
              , h = c & 63;
            l || (h = 64,
            s || (d = 64)),
            r.push(n[u], n[f], n[d], n[h])
        }
        return r.join("")
    },
    encodeString(t, e) {
        return this.HAS_NATIVE_SUPPORT && !e ? btoa(t) : this.encodeByteArray(c5(t), e)
    },
    decodeString(t, e) {
        return this.HAS_NATIVE_SUPPORT && !e ? atob(t) : oge(this.decodeStringToByteArray(t, e))
    },
    decodeStringToByteArray(t, e) {
        this.init_();
        const n = e ? this.charToByteMapWebSafe_ : this.charToByteMap_
          , r = [];
        for (let i = 0; i < t.length; ) {
            const o = n[t.charAt(i++)]
              , a = i < t.length ? n[t.charAt(i)] : 0;
            ++i;
            const c = i < t.length ? n[t.charAt(i)] : 64;
            ++i;
            const f = i < t.length ? n[t.charAt(i)] : 64;
            if (++i,
            o == null || a == null || c == null || f == null)
                throw new sge;
            const d = o << 2 | a >> 4;
            if (r.push(d),
            c !== 64) {
                const h = a << 4 & 240 | c >> 2;
                if (r.push(h),
                f !== 64) {
                    const p = c << 6 & 192 | f;
                    r.push(p)
                }
            }
        }
        return r
    },
    init_() {
        if (!this.byteToCharMap_) {
            this.byteToCharMap_ = {},
            this.charToByteMap_ = {},
            this.byteToCharMapWebSafe_ = {},
            this.charToByteMapWebSafe_ = {};
            for (let t = 0; t < this.ENCODED_VALS.length; t++)
                this.byteToCharMap_[t] = this.ENCODED_VALS.charAt(t),
                this.charToByteMap_[this.byteToCharMap_[t]] = t,
                this.byteToCharMapWebSafe_[t] = this.ENCODED_VALS_WEBSAFE.charAt(t),
                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]] = t,
                t >= this.ENCODED_VALS_BASE.length && (this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)] = t,
                this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)] = t)
        }
    }
};
class sge extends Error {
    constructor() {
        super(...arguments),
        this.name = "DecodeBase64StringError"
    }
}
const age = function(t) {
    const e = c5(t);
    return u5.encodeByteArray(e, !0)
}
  , f5 = function(t) {
    return age(t).replace(/\./g, "")
}
  , lge = function(t) {
    try {
        return u5.decodeString(t, !0)
    } catch (e) {
        console.error("base64Decode failed: ", e)
    }
    return null
};
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function cge() {
    if (typeof self < "u")
        return self;
    if (typeof window < "u")
        return window;
    if (typeof global < "u")
        return global;
    throw new Error("Unable to locate global object.")
}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const uge = () => cge().__FIREBASE_DEFAULTS__
  , fge = () => {
    if (typeof process > "u" || typeof process.env > "u")
        return;
    const t = {}.__FIREBASE_DEFAULTS__;
    if (t)
        return JSON.parse(t)
}
  , dge = () => {
    if (typeof document > "u")
        return;
    let t;
    try {
        t = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)
    } catch {
        return
    }
    const e = t && lge(t[1]);
    return e && JSON.parse(e)
}
  , hge = () => {
    try {
        return ige() || uge() || fge() || dge()
    } catch (t) {
        console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);
        return
    }
}
  , d5 = () => {
    var t;
    return (t = hge()) === null || t === void 0 ? void 0 : t.config
}
;
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class pge {
    constructor() {
        this.reject = () => {}
        ,
        this.resolve = () => {}
        ,
        this.promise = new Promise( (e, n) => {
            this.resolve = e,
            this.reject = n
        }
        )
    }
    wrapCallback(e) {
        return (n, r) => {
            n ? this.reject(n) : this.resolve(r),
            typeof e == "function" && (this.promise.catch( () => {}
            ),
            e.length === 1 ? e(n) : e(n, r))
        }
    }
}
function gge() {
    const t = typeof chrome == "object" ? chrome.runtime : typeof browser == "object" ? browser.runtime : void 0;
    return typeof t == "object" && t.id !== void 0
}
function L2() {
    try {
        return typeof indexedDB == "object"
    } catch {
        return !1
    }
}
function $2() {
    return new Promise( (t, e) => {
        try {
            let n = !0;
            const r = "validate-browser-context-for-indexeddb-analytics-module"
              , i = self.indexedDB.open(r);
            i.onsuccess = () => {
                i.result.close(),
                n || self.indexedDB.deleteDatabase(r),
                t(!0)
            }
            ,
            i.onupgradeneeded = () => {
                n = !1
            }
            ,
            i.onerror = () => {
                var o;
                e(((o = i.error) === null || o === void 0 ? void 0 : o.message) || "")
            }
        } catch (n) {
            e(n)
        }
    }
    )
}
function h5() {
    return !(typeof navigator > "u" || !navigator.cookieEnabled)
}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const mge = "FirebaseError";
class Ll extends Error {
    constructor(e, n, r) {
        super(n),
        this.code = e,
        this.customData = r,
        this.name = mge,
        Object.setPrototypeOf(this, Ll.prototype),
        Error.captureStackTrace && Error.captureStackTrace(this, ih.prototype.create)
    }
}
class ih {
    constructor(e, n, r) {
        this.service = e,
        this.serviceName = n,
        this.errors = r
    }
    create(e, ...n) {
        const r = n[0] || {}
          , i = `${this.service}/${e}`
          , o = this.errors[e]
          , s = o ? vge(o, r) : "Error"
          , a = `${this.serviceName}: ${s} (${i}).`;
        return new Ll(i,a,r)
    }
}
function vge(t, e) {
    return t.replace(yge, (n, r) => {
        const i = e[r];
        return i != null ? String(i) : `<${r}?>`
    }
    )
}
const yge = /\{\$([^}]+)}/g;
function R0(t, e) {
    if (t === e)
        return !0;
    const n = Object.keys(t)
      , r = Object.keys(e);
    for (const i of n) {
        if (!r.includes(i))
            return !1;
        const o = t[i]
          , s = e[i];
        if (F3(o) && F3(s)) {
            if (!R0(o, s))
                return !1
        } else if (o !== s)
            return !1
    }
    for (const i of r)
        if (!n.includes(i))
            return !1;
    return !0
}
function F3(t) {
    return t !== null && typeof t == "object"
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const _ge = 1e3
  , xge = 2
  , bge = 4 * 60 * 60 * 1e3
  , wge = .5;
function L3(t, e=_ge, n=xge) {
    const r = e * Math.pow(n, t)
      , i = Math.round(wge * r * (Math.random() - .5) * 2);
    return Math.min(bge, r + i)
}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function oh(t) {
    return t && t._delegate ? t._delegate : t
}
class _o {
    constructor(e, n, r) {
        this.name = e,
        this.instanceFactory = n,
        this.type = r,
        this.multipleInstances = !1,
        this.serviceProps = {},
        this.instantiationMode = "LAZY",
        this.onInstanceCreated = null
    }
    setInstantiationMode(e) {
        return this.instantiationMode = e,
        this
    }
    setMultipleInstances(e) {
        return this.multipleInstances = e,
        this
    }
    setServiceProps(e) {
        return this.serviceProps = e,
        this
    }
    setInstanceCreatedCallback(e) {
        return this.onInstanceCreated = e,
        this
    }
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const Da = "[DEFAULT]";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class Ege {
    constructor(e, n) {
        this.name = e,
        this.container = n,
        this.component = null,
        this.instances = new Map,
        this.instancesDeferred = new Map,
        this.instancesOptions = new Map,
        this.onInitCallbacks = new Map
    }
    get(e) {
        const n = this.normalizeInstanceIdentifier(e);
        if (!this.instancesDeferred.has(n)) {
            const r = new pge;
            if (this.instancesDeferred.set(n, r),
            this.isInitialized(n) || this.shouldAutoInitialize())
                try {
                    const i = this.getOrInitializeService({
                        instanceIdentifier: n
                    });
                    i && r.resolve(i)
                } catch {}
        }
        return this.instancesDeferred.get(n).promise
    }
    getImmediate(e) {
        var n;
        const r = this.normalizeInstanceIdentifier(e == null ? void 0 : e.identifier)
          , i = (n = e == null ? void 0 : e.optional) !== null && n !== void 0 ? n : !1;
        if (this.isInitialized(r) || this.shouldAutoInitialize())
            try {
                return this.getOrInitializeService({
                    instanceIdentifier: r
                })
            } catch (o) {
                if (i)
                    return null;
                throw o
            }
        else {
            if (i)
                return null;
            throw Error(`Service ${this.name} is not available`)
        }
    }
    getComponent() {
        return this.component
    }
    setComponent(e) {
        if (e.name !== this.name)
            throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);
        if (this.component)
            throw Error(`Component for ${this.name} has already been provided`);
        if (this.component = e,
        !!this.shouldAutoInitialize()) {
            if (Cge(e))
                try {
                    this.getOrInitializeService({
                        instanceIdentifier: Da
                    })
                } catch {}
            for (const [n,r] of this.instancesDeferred.entries()) {
                const i = this.normalizeInstanceIdentifier(n);
                try {
                    const o = this.getOrInitializeService({
                        instanceIdentifier: i
                    });
                    r.resolve(o)
                } catch {}
            }
        }
    }
    clearInstance(e=Da) {
        this.instancesDeferred.delete(e),
        this.instancesOptions.delete(e),
        this.instances.delete(e)
    }
    async delete() {
        const e = Array.from(this.instances.values());
        await Promise.all([...e.filter(n => "INTERNAL"in n).map(n => n.INTERNAL.delete()), ...e.filter(n => "_delete"in n).map(n => n._delete())])
    }
    isComponentSet() {
        return this.component != null
    }
    isInitialized(e=Da) {
        return this.instances.has(e)
    }
    getOptions(e=Da) {
        return this.instancesOptions.get(e) || {}
    }
    initialize(e={}) {
        const {options: n={}} = e
          , r = this.normalizeInstanceIdentifier(e.instanceIdentifier);
        if (this.isInitialized(r))
            throw Error(`${this.name}(${r}) has already been initialized`);
        if (!this.isComponentSet())
            throw Error(`Component ${this.name} has not been registered yet`);
        const i = this.getOrInitializeService({
            instanceIdentifier: r,
            options: n
        });
        for (const [o,s] of this.instancesDeferred.entries()) {
            const a = this.normalizeInstanceIdentifier(o);
            r === a && s.resolve(i)
        }
        return i
    }
    onInit(e, n) {
        var r;
        const i = this.normalizeInstanceIdentifier(n)
          , o = (r = this.onInitCallbacks.get(i)) !== null && r !== void 0 ? r : new Set;
        o.add(e),
        this.onInitCallbacks.set(i, o);
        const s = this.instances.get(i);
        return s && e(s, i),
        () => {
            o.delete(e)
        }
    }
    invokeOnInitCallbacks(e, n) {
        const r = this.onInitCallbacks.get(n);
        if (r)
            for (const i of r)
                try {
                    i(e, n)
                } catch {}
    }
    getOrInitializeService({instanceIdentifier: e, options: n={}}) {
        let r = this.instances.get(e);
        if (!r && this.component && (r = this.component.instanceFactory(this.container, {
            instanceIdentifier: Sge(e),
            options: n
        }),
        this.instances.set(e, r),
        this.instancesOptions.set(e, n),
        this.invokeOnInitCallbacks(r, e),
        this.component.onInstanceCreated))
            try {
                this.component.onInstanceCreated(this.container, e, r)
            } catch {}
        return r || null
    }
    normalizeInstanceIdentifier(e=Da) {
        return this.component ? this.component.multipleInstances ? e : Da : e
    }
    shouldAutoInitialize() {
        return !!this.component && this.component.instantiationMode !== "EXPLICIT"
    }
}
function Sge(t) {
    return t === Da ? void 0 : t
}
function Cge(t) {
    return t.instantiationMode === "EAGER"
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class Age {
    constructor(e) {
        this.name = e,
        this.providers = new Map
    }
    addComponent(e) {
        const n = this.getProvider(e.name);
        if (n.isComponentSet())
            throw new Error(`Component ${e.name} has already been registered with ${this.name}`);
        n.setComponent(e)
    }
    addOrOverwriteComponent(e) {
        this.getProvider(e.name).isComponentSet() && this.providers.delete(e.name),
        this.addComponent(e)
    }
    getProvider(e) {
        if (this.providers.has(e))
            return this.providers.get(e);
        const n = new Ege(e,this);
        return this.providers.set(e, n),
        n
    }
    getProviders() {
        return Array.from(this.providers.values())
    }
}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
var Nt;
(function(t) {
    t[t.DEBUG = 0] = "DEBUG",
    t[t.VERBOSE = 1] = "VERBOSE",
    t[t.INFO = 2] = "INFO",
    t[t.WARN = 3] = "WARN",
    t[t.ERROR = 4] = "ERROR",
    t[t.SILENT = 5] = "SILENT"
}
)(Nt || (Nt = {}));
const Tge = {
    debug: Nt.DEBUG,
    verbose: Nt.VERBOSE,
    info: Nt.INFO,
    warn: Nt.WARN,
    error: Nt.ERROR,
    silent: Nt.SILENT
}
  , Pge = Nt.INFO
  , Ige = {
    [Nt.DEBUG]: "log",
    [Nt.VERBOSE]: "log",
    [Nt.INFO]: "info",
    [Nt.WARN]: "warn",
    [Nt.ERROR]: "error"
}
  , Oge = (t, e, ...n) => {
    if (e < t.logLevel)
        return;
    const r = new Date().toISOString()
      , i = Ige[e];
    if (i)
        console[i](`[${r}]  ${t.name}:`, ...n);
    else
        throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)
}
;
class p5 {
    constructor(e) {
        this.name = e,
        this._logLevel = Pge,
        this._logHandler = Oge,
        this._userLogHandler = null
    }
    get logLevel() {
        return this._logLevel
    }
    set logLevel(e) {
        if (!(e in Nt))
            throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);
        this._logLevel = e
    }
    setLogLevel(e) {
        this._logLevel = typeof e == "string" ? Tge[e] : e
    }
    get logHandler() {
        return this._logHandler
    }
    set logHandler(e) {
        if (typeof e != "function")
            throw new TypeError("Value assigned to `logHandler` must be a function");
        this._logHandler = e
    }
    get userLogHandler() {
        return this._userLogHandler
    }
    set userLogHandler(e) {
        this._userLogHandler = e
    }
    debug(...e) {
        this._userLogHandler && this._userLogHandler(this, Nt.DEBUG, ...e),
        this._logHandler(this, Nt.DEBUG, ...e)
    }
    log(...e) {
        this._userLogHandler && this._userLogHandler(this, Nt.VERBOSE, ...e),
        this._logHandler(this, Nt.VERBOSE, ...e)
    }
    info(...e) {
        this._userLogHandler && this._userLogHandler(this, Nt.INFO, ...e),
        this._logHandler(this, Nt.INFO, ...e)
    }
    warn(...e) {
        this._userLogHandler && this._userLogHandler(this, Nt.WARN, ...e),
        this._logHandler(this, Nt.WARN, ...e)
    }
    error(...e) {
        this._userLogHandler && this._userLogHandler(this, Nt.ERROR, ...e),
        this._logHandler(this, Nt.ERROR, ...e)
    }
}
const Rge = (t, e) => e.some(n => t instanceof n);
let $3, U3;
function Mge() {
    return $3 || ($3 = [IDBDatabase, IDBObjectStore, IDBIndex, IDBCursor, IDBTransaction])
}
function Dge() {
    return U3 || (U3 = [IDBCursor.prototype.advance, IDBCursor.prototype.continue, IDBCursor.prototype.continuePrimaryKey])
}
const g5 = new WeakMap
  , ux = new WeakMap
  , m5 = new WeakMap
  , nv = new WeakMap
  , U2 = new WeakMap;
function Bge(t) {
    const e = new Promise( (n, r) => {
        const i = () => {
            t.removeEventListener("success", o),
            t.removeEventListener("error", s)
        }
          , o = () => {
            n(Zo(t.result)),
            i()
        }
          , s = () => {
            r(t.error),
            i()
        }
        ;
        t.addEventListener("success", o),
        t.addEventListener("error", s)
    }
    );
    return e.then(n => {
        n instanceof IDBCursor && g5.set(n, t)
    }
    ).catch( () => {}
    ),
    U2.set(e, t),
    e
}
function kge(t) {
    if (ux.has(t))
        return;
    const e = new Promise( (n, r) => {
        const i = () => {
            t.removeEventListener("complete", o),
            t.removeEventListener("error", s),
            t.removeEventListener("abort", s)
        }
          , o = () => {
            n(),
            i()
        }
          , s = () => {
            r(t.error || new DOMException("AbortError","AbortError")),
            i()
        }
        ;
        t.addEventListener("complete", o),
        t.addEventListener("error", s),
        t.addEventListener("abort", s)
    }
    );
    ux.set(t, e)
}
let fx = {
    get(t, e, n) {
        if (t instanceof IDBTransaction) {
            if (e === "done")
                return ux.get(t);
            if (e === "objectStoreNames")
                return t.objectStoreNames || m5.get(t);
            if (e === "store")
                return n.objectStoreNames[1] ? void 0 : n.objectStore(n.objectStoreNames[0])
        }
        return Zo(t[e])
    },
    set(t, e, n) {
        return t[e] = n,
        !0
    },
    has(t, e) {
        return t instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in t
    }
};
function Nge(t) {
    fx = t(fx)
}
function Fge(t) {
    return t === IDBDatabase.prototype.transaction && !("objectStoreNames"in IDBTransaction.prototype) ? function(e, ...n) {
        const r = t.call(rv(this), e, ...n);
        return m5.set(r, e.sort ? e.sort() : [e]),
        Zo(r)
    }
    : Dge().includes(t) ? function(...e) {
        return t.apply(rv(this), e),
        Zo(g5.get(this))
    }
    : function(...e) {
        return Zo(t.apply(rv(this), e))
    }
}
function Lge(t) {
    return typeof t == "function" ? Fge(t) : (t instanceof IDBTransaction && kge(t),
    Rge(t, Mge()) ? new Proxy(t,fx) : t)
}
function Zo(t) {
    if (t instanceof IDBRequest)
        return Bge(t);
    if (nv.has(t))
        return nv.get(t);
    const e = Lge(t);
    return e !== t && (nv.set(t, e),
    U2.set(e, t)),
    e
}
const rv = t => U2.get(t);
function um(t, e, {blocked: n, upgrade: r, blocking: i, terminated: o}={}) {
    const s = indexedDB.open(t, e)
      , a = Zo(s);
    return r && s.addEventListener("upgradeneeded", l => {
        r(Zo(s.result), l.oldVersion, l.newVersion, Zo(s.transaction), l)
    }
    ),
    n && s.addEventListener("blocked", l => n(l.oldVersion, l.newVersion, l)),
    a.then(l => {
        o && l.addEventListener("close", () => o()),
        i && l.addEventListener("versionchange", c => i(c.oldVersion, c.newVersion, c))
    }
    ).catch( () => {}
    ),
    a
}
function iv(t, {blocked: e}={}) {
    const n = indexedDB.deleteDatabase(t);
    return e && n.addEventListener("blocked", r => e(r.oldVersion, r)),
    Zo(n).then( () => {}
    )
}
const $ge = ["get", "getKey", "getAll", "getAllKeys", "count"]
  , Uge = ["put", "add", "delete", "clear"]
  , ov = new Map;
function G3(t, e) {
    if (!(t instanceof IDBDatabase && !(e in t) && typeof e == "string"))
        return;
    if (ov.get(e))
        return ov.get(e);
    const n = e.replace(/FromIndex$/, "")
      , r = e !== n
      , i = Uge.includes(n);
    if (!(n in (r ? IDBIndex : IDBObjectStore).prototype) || !(i || $ge.includes(n)))
        return;
    const o = async function(s, ...a) {
        const l = this.transaction(s, i ? "readwrite" : "readonly");
        let c = l.store;
        return r && (c = c.index(a.shift())),
        (await Promise.all([c[n](...a), i && l.done]))[0]
    };
    return ov.set(e, o),
    o
}
Nge(t => ({
    ...t,
    get: (e, n, r) => G3(e, n) || t.get(e, n, r),
    has: (e, n) => !!G3(e, n) || t.has(e, n)
}));
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class Gge {
    constructor(e) {
        this.container = e
    }
    getPlatformInfoString() {
        return this.container.getProviders().map(n => {
            if (Hge(n)) {
                const r = n.getImmediate();
                return `${r.library}/${r.version}`
            } else
                return null
        }
        ).filter(n => n).join(" ")
    }
}
function Hge(t) {
    const e = t.getComponent();
    return (e == null ? void 0 : e.type) === "VERSION"
}
const dx = "@firebase/app"
  , H3 = "0.13.2";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const as = new p5("@firebase/app")
  , Vge = "@firebase/app-compat"
  , zge = "@firebase/analytics-compat"
  , jge = "@firebase/analytics"
  , Wge = "@firebase/app-check-compat"
  , Yge = "@firebase/app-check"
  , Xge = "@firebase/auth"
  , Kge = "@firebase/auth-compat"
  , qge = "@firebase/database"
  , Zge = "@firebase/data-connect"
  , Jge = "@firebase/database-compat"
  , Qge = "@firebase/functions"
  , eme = "@firebase/functions-compat"
  , tme = "@firebase/installations"
  , nme = "@firebase/installations-compat"
  , rme = "@firebase/messaging"
  , ime = "@firebase/messaging-compat"
  , ome = "@firebase/performance"
  , sme = "@firebase/performance-compat"
  , ame = "@firebase/remote-config"
  , lme = "@firebase/remote-config-compat"
  , cme = "@firebase/storage"
  , ume = "@firebase/storage-compat"
  , fme = "@firebase/firestore"
  , dme = "@firebase/ai"
  , hme = "@firebase/firestore-compat"
  , pme = "firebase";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const hx = "[DEFAULT]"
  , gme = {
    [dx]: "fire-core",
    [Vge]: "fire-core-compat",
    [jge]: "fire-analytics",
    [zge]: "fire-analytics-compat",
    [Yge]: "fire-app-check",
    [Wge]: "fire-app-check-compat",
    [Xge]: "fire-auth",
    [Kge]: "fire-auth-compat",
    [qge]: "fire-rtdb",
    [Zge]: "fire-data-connect",
    [Jge]: "fire-rtdb-compat",
    [Qge]: "fire-fn",
    [eme]: "fire-fn-compat",
    [tme]: "fire-iid",
    [nme]: "fire-iid-compat",
    [rme]: "fire-fcm",
    [ime]: "fire-fcm-compat",
    [ome]: "fire-perf",
    [sme]: "fire-perf-compat",
    [ame]: "fire-rc",
    [lme]: "fire-rc-compat",
    [cme]: "fire-gcs",
    [ume]: "fire-gcs-compat",
    [fme]: "fire-fst",
    [hme]: "fire-fst-compat",
    [dme]: "fire-vertex",
    "fire-js": "fire-js",
    [pme]: "fire-js-all"
};
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const M0 = new Map
  , mme = new Map
  , px = new Map;
function V3(t, e) {
    try {
        t.container.addComponent(e)
    } catch (n) {
        as.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`, n)
    }
}
function ls(t) {
    const e = t.name;
    if (px.has(e))
        return as.debug(`There were multiple attempts to register component ${e}.`),
        !1;
    px.set(e, t);
    for (const n of M0.values())
        V3(n, t);
    for (const n of mme.values())
        V3(n, t);
    return !0
}
function sh(t, e) {
    const n = t.container.getProvider("heartbeat").getImmediate({
        optional: !0
    });
    return n && n.triggerHeartbeat(),
    t.container.getProvider(e)
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const vme = {
    "no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
    "bad-app-name": "Illegal App name: '{$appName}'",
    "duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
    "app-deleted": "Firebase App named '{$appName}' already deleted",
    "server-app-deleted": "Firebase Server App has been deleted",
    "no-options": "Need to provide options, when not being deployed to hosting via source.",
    "invalid-app-argument": "firebase.{$appName}() takes either no argument or a Firebase App instance.",
    "invalid-log-argument": "First argument to `onLog` must be null or a function.",
    "idb-open": "Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.",
    "idb-get": "Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",
    "idb-set": "Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",
    "idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.",
    "finalization-registry-not-supported": "FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.",
    "invalid-server-app-environment": "FirebaseServerApp is not for use in browser environments."
}
  , Xs = new ih("app","Firebase",vme);
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class yme {
    constructor(e, n, r) {
        this._isDeleted = !1,
        this._options = Object.assign({}, e),
        this._config = Object.assign({}, n),
        this._name = n.name,
        this._automaticDataCollectionEnabled = n.automaticDataCollectionEnabled,
        this._container = r,
        this.container.addComponent(new _o("app", () => this,"PUBLIC"))
    }
    get automaticDataCollectionEnabled() {
        return this.checkDestroyed(),
        this._automaticDataCollectionEnabled
    }
    set automaticDataCollectionEnabled(e) {
        this.checkDestroyed(),
        this._automaticDataCollectionEnabled = e
    }
    get name() {
        return this.checkDestroyed(),
        this._name
    }
    get options() {
        return this.checkDestroyed(),
        this._options
    }
    get config() {
        return this.checkDestroyed(),
        this._config
    }
    get container() {
        return this._container
    }
    get isDeleted() {
        return this._isDeleted
    }
    set isDeleted(e) {
        this._isDeleted = e
    }
    checkDestroyed() {
        if (this.isDeleted)
            throw Xs.create("app-deleted", {
                appName: this._name
            })
    }
}
function _me(t, e={}) {
    let n = t;
    typeof e != "object" && (e = {
        name: e
    });
    const r = Object.assign({
        name: hx,
        automaticDataCollectionEnabled: !0
    }, e)
      , i = r.name;
    if (typeof i != "string" || !i)
        throw Xs.create("bad-app-name", {
            appName: String(i)
        });
    if (n || (n = d5()),
    !n)
        throw Xs.create("no-options");
    const o = M0.get(i);
    if (o) {
        if (R0(n, o.options) && R0(r, o.config))
            return o;
        throw Xs.create("duplicate-app", {
            appName: i
        })
    }
    const s = new Age(i);
    for (const l of px.values())
        s.addComponent(l);
    const a = new yme(n,r,s);
    return M0.set(i, a),
    a
}
function v5(t=hx) {
    const e = M0.get(t);
    if (!e && t === hx && d5())
        return _me();
    if (!e)
        throw Xs.create("no-app", {
            appName: t
        });
    return e
}
function co(t, e, n) {
    var r;
    let i = (r = gme[t]) !== null && r !== void 0 ? r : t;
    n && (i += `-${n}`);
    const o = i.match(/\s|\//)
      , s = e.match(/\s|\//);
    if (o || s) {
        const a = [`Unable to register library "${i}" with version "${e}":`];
        o && a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),
        o && s && a.push("and"),
        s && a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),
        as.warn(a.join(" "));
        return
    }
    ls(new _o(`${i}-version`, () => ({
        library: i,
        version: e
    }),"VERSION"))
}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const xme = "firebase-heartbeat-database"
  , bme = 1
  , _d = "firebase-heartbeat-store";
let sv = null;
function y5() {
    return sv || (sv = um(xme, bme, {
        upgrade: (t, e) => {
            switch (e) {
            case 0:
                try {
                    t.createObjectStore(_d)
                } catch (n) {
                    console.warn(n)
                }
            }
        }
    }).catch(t => {
        throw Xs.create("idb-open", {
            originalErrorMessage: t.message
        })
    }
    )),
    sv
}
async function wme(t) {
    try {
        const n = (await y5()).transaction(_d)
          , r = await n.objectStore(_d).get(_5(t));
        return await n.done,
        r
    } catch (e) {
        if (e instanceof Ll)
            as.warn(e.message);
        else {
            const n = Xs.create("idb-get", {
                originalErrorMessage: e == null ? void 0 : e.message
            });
            as.warn(n.message)
        }
    }
}
async function z3(t, e) {
    try {
        const r = (await y5()).transaction(_d, "readwrite");
        await r.objectStore(_d).put(e, _5(t)),
        await r.done
    } catch (n) {
        if (n instanceof Ll)
            as.warn(n.message);
        else {
            const r = Xs.create("idb-set", {
                originalErrorMessage: n == null ? void 0 : n.message
            });
            as.warn(r.message)
        }
    }
}
function _5(t) {
    return `${t.name}!${t.options.appId}`
}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const Eme = 1024
  , Sme = 30;
class Cme {
    constructor(e) {
        this.container = e,
        this._heartbeatsCache = null;
        const n = this.container.getProvider("app").getImmediate();
        this._storage = new Tme(n),
        this._heartbeatsCachePromise = this._storage.read().then(r => (this._heartbeatsCache = r,
        r))
    }
    async triggerHeartbeat() {
        var e, n;
        try {
            const i = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString()
              , o = j3();
            if (((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null && (this._heartbeatsCache = await this._heartbeatsCachePromise,
            ((n = this._heartbeatsCache) === null || n === void 0 ? void 0 : n.heartbeats) == null) || this._heartbeatsCache.lastSentHeartbeatDate === o || this._heartbeatsCache.heartbeats.some(s => s.date === o))
                return;
            if (this._heartbeatsCache.heartbeats.push({
                date: o,
                agent: i
            }),
            this._heartbeatsCache.heartbeats.length > Sme) {
                const s = Pme(this._heartbeatsCache.heartbeats);
                this._heartbeatsCache.heartbeats.splice(s, 1)
            }
            return this._storage.overwrite(this._heartbeatsCache)
        } catch (r) {
            as.warn(r)
        }
    }
    async getHeartbeatsHeader() {
        var e;
        try {
            if (this._heartbeatsCache === null && await this._heartbeatsCachePromise,
            ((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null || this._heartbeatsCache.heartbeats.length === 0)
                return "";
            const n = j3()
              , {heartbeatsToSend: r, unsentEntries: i} = Ame(this._heartbeatsCache.heartbeats)
              , o = f5(JSON.stringify({
                version: 2,
                heartbeats: r
            }));
            return this._heartbeatsCache.lastSentHeartbeatDate = n,
            i.length > 0 ? (this._heartbeatsCache.heartbeats = i,
            await this._storage.overwrite(this._heartbeatsCache)) : (this._heartbeatsCache.heartbeats = [],
            this._storage.overwrite(this._heartbeatsCache)),
            o
        } catch (n) {
            return as.warn(n),
            ""
        }
    }
}
function j3() {
    return new Date().toISOString().substring(0, 10)
}
function Ame(t, e=Eme) {
    const n = [];
    let r = t.slice();
    for (const i of t) {
        const o = n.find(s => s.agent === i.agent);
        if (o) {
            if (o.dates.push(i.date),
            W3(n) > e) {
                o.dates.pop();
                break
            }
        } else if (n.push({
            agent: i.agent,
            dates: [i.date]
        }),
        W3(n) > e) {
            n.pop();
            break
        }
        r = r.slice(1)
    }
    return {
        heartbeatsToSend: n,
        unsentEntries: r
    }
}
class Tme {
    constructor(e) {
        this.app = e,
        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck()
    }
    async runIndexedDBEnvironmentCheck() {
        return L2() ? $2().then( () => !0).catch( () => !1) : !1
    }
    async read() {
        if (await this._canUseIndexedDBPromise) {
            const n = await wme(this.app);
            return n != null && n.heartbeats ? n : {
                heartbeats: []
            }
        } else
            return {
                heartbeats: []
            }
    }
    async overwrite(e) {
        var n;
        if (await this._canUseIndexedDBPromise) {
            const i = await this.read();
            return z3(this.app, {
                lastSentHeartbeatDate: (n = e.lastSentHeartbeatDate) !== null && n !== void 0 ? n : i.lastSentHeartbeatDate,
                heartbeats: e.heartbeats
            })
        } else
            return
    }
    async add(e) {
        var n;
        if (await this._canUseIndexedDBPromise) {
            const i = await this.read();
            return z3(this.app, {
                lastSentHeartbeatDate: (n = e.lastSentHeartbeatDate) !== null && n !== void 0 ? n : i.lastSentHeartbeatDate,
                heartbeats: [...i.heartbeats, ...e.heartbeats]
            })
        } else
            return
    }
}
function W3(t) {
    return f5(JSON.stringify({
        version: 2,
        heartbeats: t
    })).length
}
function Pme(t) {
    if (t.length === 0)
        return -1;
    let e = 0
      , n = t[0].date;
    for (let r = 1; r < t.length; r++)
        t[r].date < n && (n = t[r].date,
        e = r);
    return e
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function Ime(t) {
    ls(new _o("platform-logger",e => new Gge(e),"PRIVATE")),
    ls(new _o("heartbeat",e => new Cme(e),"PRIVATE")),
    co(dx, H3, t),
    co(dx, H3, "esm2017"),
    co("fire-js", "")
}
Ime("");
var Ome = "firebase"
  , Rme = "11.10.0";
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
co(Ome, Rme, "app");
const x5 = "@firebase/installations"
  , G2 = "0.6.18";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const b5 = 1e4
  , w5 = `w:${G2}`
  , E5 = "FIS_v2"
  , Mme = "https://firebaseinstallations.googleapis.com/v1"
  , Dme = 60 * 60 * 1e3
  , Bme = "installations"
  , kme = "Installations";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const Nme = {
    "missing-app-config-values": 'Missing App configuration value: "{$valueName}"',
    "not-registered": "Firebase Installation is not registered.",
    "installation-not-found": "Firebase Installation not found.",
    "request-failed": '{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',
    "app-offline": "Could not process request. Application offline.",
    "delete-pending-registration": "Can't delete installation while there is a pending registration request."
}
  , wl = new ih(Bme,kme,Nme);
function S5(t) {
    return t instanceof Ll && t.code.includes("request-failed")
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function C5({projectId: t}) {
    return `${Mme}/projects/${t}/installations`
}
function A5(t) {
    return {
        token: t.token,
        requestStatus: 2,
        expiresIn: Lme(t.expiresIn),
        creationTime: Date.now()
    }
}
async function T5(t, e) {
    const r = (await e.json()).error;
    return wl.create("request-failed", {
        requestName: t,
        serverCode: r.code,
        serverMessage: r.message,
        serverStatus: r.status
    })
}
function P5({apiKey: t}) {
    return new Headers({
        "Content-Type": "application/json",
        Accept: "application/json",
        "x-goog-api-key": t
    })
}
function Fme(t, {refreshToken: e}) {
    const n = P5(t);
    return n.append("Authorization", $me(e)),
    n
}
async function I5(t) {
    const e = await t();
    return e.status >= 500 && e.status < 600 ? t() : e
}
function Lme(t) {
    return Number(t.replace("s", "000"))
}
function $me(t) {
    return `${E5} ${t}`
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function Ume({appConfig: t, heartbeatServiceProvider: e}, {fid: n}) {
    const r = C5(t)
      , i = P5(t)
      , o = e.getImmediate({
        optional: !0
    });
    if (o) {
        const c = await o.getHeartbeatsHeader();
        c && i.append("x-firebase-client", c)
    }
    const s = {
        fid: n,
        authVersion: E5,
        appId: t.appId,
        sdkVersion: w5
    }
      , a = {
        method: "POST",
        headers: i,
        body: JSON.stringify(s)
    }
      , l = await I5( () => fetch(r, a));
    if (l.ok) {
        const c = await l.json();
        return {
            fid: c.fid || n,
            registrationStatus: 2,
            refreshToken: c.refreshToken,
            authToken: A5(c.authToken)
        }
    } else
        throw await T5("Create Installation", l)
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function O5(t) {
    return new Promise(e => {
        setTimeout(e, t)
    }
    )
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function Gme(t) {
    return btoa(String.fromCharCode(...t)).replace(/\+/g, "-").replace(/\//g, "_")
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const Hme = /^[cdef][\w-]{21}$/
  , gx = "";
function Vme() {
    try {
        const t = new Uint8Array(17);
        (self.crypto || self.msCrypto).getRandomValues(t),
        t[0] = 112 + t[0] % 16;
        const n = zme(t);
        return Hme.test(n) ? n : gx
    } catch {
        return gx
    }
}
function zme(t) {
    return Gme(t).substr(0, 22)
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function fm(t) {
    return `${t.appName}!${t.appId}`
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const R5 = new Map;
function M5(t, e) {
    const n = fm(t);
    D5(n, e),
    jme(n, e)
}
function D5(t, e) {
    const n = R5.get(t);
    if (n)
        for (const r of n)
            r(e)
}
function jme(t, e) {
    const n = Wme();
    n && n.postMessage({
        key: t,
        fid: e
    }),
    Yme()
}
let Wa = null;
function Wme() {
    return !Wa && "BroadcastChannel"in self && (Wa = new BroadcastChannel("[Firebase] FID Change"),
    Wa.onmessage = t => {
        D5(t.data.key, t.data.fid)
    }
    ),
    Wa
}
function Yme() {
    R5.size === 0 && Wa && (Wa.close(),
    Wa = null)
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const Xme = "firebase-installations-database"
  , Kme = 1
  , El = "firebase-installations-store";
let av = null;
function H2() {
    return av || (av = um(Xme, Kme, {
        upgrade: (t, e) => {
            switch (e) {
            case 0:
                t.createObjectStore(El)
            }
        }
    })),
    av
}
async function D0(t, e) {
    const n = fm(t)
      , i = (await H2()).transaction(El, "readwrite")
      , o = i.objectStore(El)
      , s = await o.get(n);
    return await o.put(e, n),
    await i.done,
    (!s || s.fid !== e.fid) && M5(t, e.fid),
    e
}
async function B5(t) {
    const e = fm(t)
      , r = (await H2()).transaction(El, "readwrite");
    await r.objectStore(El).delete(e),
    await r.done
}
async function dm(t, e) {
    const n = fm(t)
      , i = (await H2()).transaction(El, "readwrite")
      , o = i.objectStore(El)
      , s = await o.get(n)
      , a = e(s);
    return a === void 0 ? await o.delete(n) : await o.put(a, n),
    await i.done,
    a && (!s || s.fid !== a.fid) && M5(t, a.fid),
    a
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function V2(t) {
    let e;
    const n = await dm(t.appConfig, r => {
        const i = qme(r)
          , o = Zme(t, i);
        return e = o.registrationPromise,
        o.installationEntry
    }
    );
    return n.fid === gx ? {
        installationEntry: await e
    } : {
        installationEntry: n,
        registrationPromise: e
    }
}
function qme(t) {
    const e = t || {
        fid: Vme(),
        registrationStatus: 0
    };
    return k5(e)
}
function Zme(t, e) {
    if (e.registrationStatus === 0) {
        if (!navigator.onLine) {
            const i = Promise.reject(wl.create("app-offline"));
            return {
                installationEntry: e,
                registrationPromise: i
            }
        }
        const n = {
            fid: e.fid,
            registrationStatus: 1,
            registrationTime: Date.now()
        }
          , r = Jme(t, n);
        return {
            installationEntry: n,
            registrationPromise: r
        }
    } else
        return e.registrationStatus === 1 ? {
            installationEntry: e,
            registrationPromise: Qme(t)
        } : {
            installationEntry: e
        }
}
async function Jme(t, e) {
    try {
        const n = await Ume(t, e);
        return D0(t.appConfig, n)
    } catch (n) {
        throw S5(n) && n.customData.serverCode === 409 ? await B5(t.appConfig) : await D0(t.appConfig, {
            fid: e.fid,
            registrationStatus: 0
        }),
        n
    }
}
async function Qme(t) {
    let e = await Y3(t.appConfig);
    for (; e.registrationStatus === 1; )
        await O5(100),
        e = await Y3(t.appConfig);
    if (e.registrationStatus === 0) {
        const {installationEntry: n, registrationPromise: r} = await V2(t);
        return r || n
    }
    return e
}
function Y3(t) {
    return dm(t, e => {
        if (!e)
            throw wl.create("installation-not-found");
        return k5(e)
    }
    )
}
function k5(t) {
    return e1e(t) ? {
        fid: t.fid,
        registrationStatus: 0
    } : t
}
function e1e(t) {
    return t.registrationStatus === 1 && t.registrationTime + b5 < Date.now()
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function t1e({appConfig: t, heartbeatServiceProvider: e}, n) {
    const r = n1e(t, n)
      , i = Fme(t, n)
      , o = e.getImmediate({
        optional: !0
    });
    if (o) {
        const c = await o.getHeartbeatsHeader();
        c && i.append("x-firebase-client", c)
    }
    const s = {
        installation: {
            sdkVersion: w5,
            appId: t.appId
        }
    }
      , a = {
        method: "POST",
        headers: i,
        body: JSON.stringify(s)
    }
      , l = await I5( () => fetch(r, a));
    if (l.ok) {
        const c = await l.json();
        return A5(c)
    } else
        throw await T5("Generate Auth Token", l)
}
function n1e(t, {fid: e}) {
    return `${C5(t)}/${e}/authTokens:generate`
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function z2(t, e=!1) {
    let n;
    const r = await dm(t.appConfig, o => {
        if (!N5(o))
            throw wl.create("not-registered");
        const s = o.authToken;
        if (!e && o1e(s))
            return o;
        if (s.requestStatus === 1)
            return n = r1e(t, e),
            o;
        {
            if (!navigator.onLine)
                throw wl.create("app-offline");
            const a = a1e(o);
            return n = i1e(t, a),
            a
        }
    }
    );
    return n ? await n : r.authToken
}
async function r1e(t, e) {
    let n = await X3(t.appConfig);
    for (; n.authToken.requestStatus === 1; )
        await O5(100),
        n = await X3(t.appConfig);
    const r = n.authToken;
    return r.requestStatus === 0 ? z2(t, e) : r
}
function X3(t) {
    return dm(t, e => {
        if (!N5(e))
            throw wl.create("not-registered");
        const n = e.authToken;
        return l1e(n) ? Object.assign(Object.assign({}, e), {
            authToken: {
                requestStatus: 0
            }
        }) : e
    }
    )
}
async function i1e(t, e) {
    try {
        const n = await t1e(t, e)
          , r = Object.assign(Object.assign({}, e), {
            authToken: n
        });
        return await D0(t.appConfig, r),
        n
    } catch (n) {
        if (S5(n) && (n.customData.serverCode === 401 || n.customData.serverCode === 404))
            await B5(t.appConfig);
        else {
            const r = Object.assign(Object.assign({}, e), {
                authToken: {
                    requestStatus: 0
                }
            });
            await D0(t.appConfig, r)
        }
        throw n
    }
}
function N5(t) {
    return t !== void 0 && t.registrationStatus === 2
}
function o1e(t) {
    return t.requestStatus === 2 && !s1e(t)
}
function s1e(t) {
    const e = Date.now();
    return e < t.creationTime || t.creationTime + t.expiresIn < e + Dme
}
function a1e(t) {
    const e = {
        requestStatus: 1,
        requestTime: Date.now()
    };
    return Object.assign(Object.assign({}, t), {
        authToken: e
    })
}
function l1e(t) {
    return t.requestStatus === 1 && t.requestTime + b5 < Date.now()
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function c1e(t) {
    const e = t
      , {installationEntry: n, registrationPromise: r} = await V2(e);
    return r ? r.catch(console.error) : z2(e).catch(console.error),
    n.fid
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function u1e(t, e=!1) {
    const n = t;
    return await f1e(n),
    (await z2(n, e)).token
}
async function f1e(t) {
    const {registrationPromise: e} = await V2(t);
    e && await e
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function d1e(t) {
    if (!t || !t.options)
        throw lv("App Configuration");
    if (!t.name)
        throw lv("App Name");
    const e = ["projectId", "apiKey", "appId"];
    for (const n of e)
        if (!t.options[n])
            throw lv(n);
    return {
        appName: t.name,
        projectId: t.options.projectId,
        apiKey: t.options.apiKey,
        appId: t.options.appId
    }
}
function lv(t) {
    return wl.create("missing-app-config-values", {
        valueName: t
    })
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const F5 = "installations"
  , h1e = "installations-internal"
  , p1e = t => {
    const e = t.getProvider("app").getImmediate()
      , n = d1e(e)
      , r = sh(e, "heartbeat");
    return {
        app: e,
        appConfig: n,
        heartbeatServiceProvider: r,
        _delete: () => Promise.resolve()
    }
}
  , g1e = t => {
    const e = t.getProvider("app").getImmediate()
      , n = sh(e, F5).getImmediate();
    return {
        getId: () => c1e(n),
        getToken: i => u1e(n, i)
    }
}
;
function m1e() {
    ls(new _o(F5,p1e,"PUBLIC")),
    ls(new _o(h1e,g1e,"PRIVATE"))
}
m1e();
co(x5, G2);
co(x5, G2, "esm2017");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const B0 = "analytics"
  , v1e = "firebase_id"
  , y1e = "origin"
  , _1e = 60 * 1e3
  , x1e = "https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig"
  , j2 = "https://www.googletagmanager.com/gtag/js";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const Ir = new p5("@firebase/analytics");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const b1e = {
    "already-exists": "A Firebase Analytics instance with the appId {$id}  already exists. Only one Firebase Analytics instance can be created for each appId.",
    "already-initialized": "initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.",
    "already-initialized-settings": "Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.",
    "interop-component-reg-failed": "Firebase Analytics Interop Component failed to instantiate: {$reason}",
    "invalid-analytics-context": "Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}",
    "indexeddb-unavailable": "IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}",
    "fetch-throttle": "The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.",
    "config-fetch-failed": "Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}",
    "no-api-key": 'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',
    "no-app-id": 'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',
    "no-client-id": 'The "client_id" field is empty.',
    "invalid-gtag-resource": "Trusted Types detected an invalid gtag resource: {$gtagURL}."
}
  , jr = new ih("analytics","Analytics",b1e);
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function w1e(t) {
    if (!t.startsWith(j2)) {
        const e = jr.create("invalid-gtag-resource", {
            gtagURL: t
        });
        return Ir.warn(e.message),
        ""
    }
    return t
}
function L5(t) {
    return Promise.all(t.map(e => e.catch(n => n)))
}
function E1e(t, e) {
    let n;
    return window.trustedTypes && (n = window.trustedTypes.createPolicy(t, e)),
    n
}
function S1e(t, e) {
    const n = E1e("firebase-js-sdk-policy", {
        createScriptURL: w1e
    })
      , r = document.createElement("script")
      , i = `${j2}?l=${t}&id=${e}`;
    r.src = n ? n == null ? void 0 : n.createScriptURL(i) : i,
    r.async = !0,
    document.head.appendChild(r)
}
function C1e(t) {
    let e = [];
    return Array.isArray(window[t]) ? e = window[t] : window[t] = e,
    e
}
async function A1e(t, e, n, r, i, o) {
    const s = r[i];
    try {
        if (s)
            await e[s];
        else {
            const l = (await L5(n)).find(c => c.measurementId === i);
            l && await e[l.appId]
        }
    } catch (a) {
        Ir.error(a)
    }
    t("config", i, o)
}
async function T1e(t, e, n, r, i) {
    try {
        let o = [];
        if (i && i.send_to) {
            let s = i.send_to;
            Array.isArray(s) || (s = [s]);
            const a = await L5(n);
            for (const l of s) {
                const c = a.find(f => f.measurementId === l)
                  , u = c && e[c.appId];
                if (u)
                    o.push(u);
                else {
                    o = [];
                    break
                }
            }
        }
        o.length === 0 && (o = Object.values(e)),
        await Promise.all(o),
        t("event", r, i || {})
    } catch (o) {
        Ir.error(o)
    }
}
function P1e(t, e, n, r) {
    async function i(o, ...s) {
        try {
            if (o === "event") {
                const [a,l] = s;
                await T1e(t, e, n, a, l)
            } else if (o === "config") {
                const [a,l] = s;
                await A1e(t, e, n, r, a, l)
            } else if (o === "consent") {
                const [a,l] = s;
                t("consent", a, l)
            } else if (o === "get") {
                const [a,l,c] = s;
                t("get", a, l, c)
            } else if (o === "set") {
                const [a] = s;
                t("set", a)
            } else
                t(o, ...s)
        } catch (a) {
            Ir.error(a)
        }
    }
    return i
}
function I1e(t, e, n, r, i) {
    let o = function(...s) {
        window[r].push(arguments)
    };
    return window[i] && typeof window[i] == "function" && (o = window[i]),
    window[i] = P1e(o, t, e, n),
    {
        gtagCore: o,
        wrappedGtag: window[i]
    }
}
function O1e(t) {
    const e = window.document.getElementsByTagName("script");
    for (const n of Object.values(e))
        if (n.src && n.src.includes(j2) && n.src.includes(t))
            return n;
    return null
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const R1e = 30
  , M1e = 1e3;
class D1e {
    constructor(e={}, n=M1e) {
        this.throttleMetadata = e,
        this.intervalMillis = n
    }
    getThrottleMetadata(e) {
        return this.throttleMetadata[e]
    }
    setThrottleMetadata(e, n) {
        this.throttleMetadata[e] = n
    }
    deleteThrottleMetadata(e) {
        delete this.throttleMetadata[e]
    }
}
const $5 = new D1e;
function B1e(t) {
    return new Headers({
        Accept: "application/json",
        "x-goog-api-key": t
    })
}
async function k1e(t) {
    var e;
    const {appId: n, apiKey: r} = t
      , i = {
        method: "GET",
        headers: B1e(r)
    }
      , o = x1e.replace("{app-id}", n)
      , s = await fetch(o, i);
    if (s.status !== 200 && s.status !== 304) {
        let a = "";
        try {
            const l = await s.json();
            !((e = l.error) === null || e === void 0) && e.message && (a = l.error.message)
        } catch {}
        throw jr.create("config-fetch-failed", {
            httpStatus: s.status,
            responseMessage: a
        })
    }
    return s.json()
}
async function N1e(t, e=$5, n) {
    const {appId: r, apiKey: i, measurementId: o} = t.options;
    if (!r)
        throw jr.create("no-app-id");
    if (!i) {
        if (o)
            return {
                measurementId: o,
                appId: r
            };
        throw jr.create("no-api-key")
    }
    const s = e.getThrottleMetadata(r) || {
        backoffCount: 0,
        throttleEndTimeMillis: Date.now()
    }
      , a = new $1e;
    return setTimeout(async () => {
        a.abort()
    }
    , n !== void 0 ? n : _1e),
    U5({
        appId: r,
        apiKey: i,
        measurementId: o
    }, s, a, e)
}
async function U5(t, {throttleEndTimeMillis: e, backoffCount: n}, r, i=$5) {
    var o;
    const {appId: s, measurementId: a} = t;
    try {
        await F1e(r, e)
    } catch (l) {
        if (a)
            return Ir.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${l == null ? void 0 : l.message}]`),
            {
                appId: s,
                measurementId: a
            };
        throw l
    }
    try {
        const l = await k1e(t);
        return i.deleteThrottleMetadata(s),
        l
    } catch (l) {
        const c = l;
        if (!L1e(c)) {
            if (i.deleteThrottleMetadata(s),
            a)
                return Ir.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${c == null ? void 0 : c.message}]`),
                {
                    appId: s,
                    measurementId: a
                };
            throw l
        }
        const u = Number((o = c == null ? void 0 : c.customData) === null || o === void 0 ? void 0 : o.httpStatus) === 503 ? L3(n, i.intervalMillis, R1e) : L3(n, i.intervalMillis)
          , f = {
            throttleEndTimeMillis: Date.now() + u,
            backoffCount: n + 1
        };
        return i.setThrottleMetadata(s, f),
        Ir.debug(`Calling attemptFetch again in ${u} millis`),
        U5(t, f, r, i)
    }
}
function F1e(t, e) {
    return new Promise( (n, r) => {
        const i = Math.max(e - Date.now(), 0)
          , o = setTimeout(n, i);
        t.addEventListener( () => {
            clearTimeout(o),
            r(jr.create("fetch-throttle", {
                throttleEndTimeMillis: e
            }))
        }
        )
    }
    )
}
function L1e(t) {
    if (!(t instanceof Ll) || !t.customData)
        return !1;
    const e = Number(t.customData.httpStatus);
    return e === 429 || e === 500 || e === 503 || e === 504
}
class $1e {
    constructor() {
        this.listeners = []
    }
    addEventListener(e) {
        this.listeners.push(e)
    }
    abort() {
        this.listeners.forEach(e => e())
    }
}
async function U1e(t, e, n, r, i) {
    if (i && i.global) {
        t("event", n, r);
        return
    } else {
        const o = await e
          , s = Object.assign(Object.assign({}, r), {
            send_to: o
        });
        t("event", n, s)
    }
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function G1e() {
    if (L2())
        try {
            await $2()
        } catch (t) {
            return Ir.warn(jr.create("indexeddb-unavailable", {
                errorInfo: t == null ? void 0 : t.toString()
            }).message),
            !1
        }
    else
        return Ir.warn(jr.create("indexeddb-unavailable", {
            errorInfo: "IndexedDB is not available in this environment."
        }).message),
        !1;
    return !0
}
async function H1e(t, e, n, r, i, o, s) {
    var a;
    const l = N1e(t);
    l.then(h => {
        n[h.measurementId] = h.appId,
        t.options.measurementId && h.measurementId !== t.options.measurementId && Ir.warn(`The measurement ID in the local Firebase config (${t.options.measurementId}) does not match the measurement ID fetched from the server (${h.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)
    }
    ).catch(h => Ir.error(h)),
    e.push(l);
    const c = G1e().then(h => {
        if (h)
            return r.getId()
    }
    )
      , [u,f] = await Promise.all([l, c]);
    O1e(o) || S1e(o, u.measurementId),
    i("js", new Date);
    const d = (a = s == null ? void 0 : s.config) !== null && a !== void 0 ? a : {};
    return d[y1e] = "firebase",
    d.update = !0,
    f != null && (d[v1e] = f),
    i("config", u.measurementId, d),
    u.measurementId
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class V1e {
    constructor(e) {
        this.app = e
    }
    _delete() {
        return delete Bf[this.app.options.appId],
        Promise.resolve()
    }
}
let Bf = {}
  , K3 = [];
const q3 = {};
let cv = "dataLayer", z1e = "gtag", Z3, G5, J3 = !1;
function j1e() {
    const t = [];
    if (gge() && t.push("This is a browser extension environment."),
    h5() || t.push("Cookies are not available."),
    t.length > 0) {
        const e = t.map( (r, i) => `(${i + 1}) ${r}`).join(" ")
          , n = jr.create("invalid-analytics-context", {
            errorInfo: e
        });
        Ir.warn(n.message)
    }
}
function W1e(t, e, n) {
    j1e();
    const r = t.options.appId;
    if (!r)
        throw jr.create("no-app-id");
    if (!t.options.apiKey)
        if (t.options.measurementId)
            Ir.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${t.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);
        else
            throw jr.create("no-api-key");
    if (Bf[r] != null)
        throw jr.create("already-exists", {
            id: r
        });
    if (!J3) {
        C1e(cv);
        const {wrappedGtag: o, gtagCore: s} = I1e(Bf, K3, q3, cv, z1e);
        G5 = o,
        Z3 = s,
        J3 = !0
    }
    return Bf[r] = H1e(t, K3, q3, e, Z3, cv, n),
    new V1e(t)
}
function BPe(t=v5()) {
    t = oh(t);
    const e = sh(t, B0);
    return e.isInitialized() ? e.getImmediate() : Y1e(t)
}
function Y1e(t, e={}) {
    const n = sh(t, B0);
    if (n.isInitialized()) {
        const i = n.getImmediate();
        if (R0(e, n.getOptions()))
            return i;
        throw jr.create("already-initialized")
    }
    return n.initialize({
        options: e
    })
}
function X1e(t, e, n, r) {
    t = oh(t),
    U1e(G5, Bf[t.app.options.appId], e, n, r).catch(i => Ir.error(i))
}
const Q3 = "@firebase/analytics"
  , eP = "0.10.17";
function K1e() {
    ls(new _o(B0, (e, {options: n}) => {
        const r = e.getProvider("app").getImmediate()
          , i = e.getProvider("installations-internal").getImmediate();
        return W1e(r, i, n)
    }
    ,"PUBLIC")),
    ls(new _o("analytics-internal",t,"PRIVATE")),
    co(Q3, eP),
    co(Q3, eP, "esm2017");
    function t(e) {
        try {
            const n = e.getProvider(B0).getImmediate();
            return {
                logEvent: (r, i, o) => X1e(n, r, i, o)
            }
        } catch (n) {
            throw jr.create("interop-component-reg-failed", {
                reason: n
            })
        }
    }
}
K1e();
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const q1e = "/firebase-messaging-sw.js"
  , Z1e = "/firebase-cloud-messaging-push-scope"
  , H5 = "BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4"
  , J1e = "https://fcmregistrations.googleapis.com/v1"
  , V5 = "google.c.a.c_id"
  , Q1e = "google.c.a.c_l"
  , eve = "google.c.a.ts"
  , tve = "google.c.a.e"
  , tP = 1e4;
var nP;
(function(t) {
    t[t.DATA_MESSAGE = 1] = "DATA_MESSAGE",
    t[t.DISPLAY_NOTIFICATION = 3] = "DISPLAY_NOTIFICATION"
}
)(nP || (nP = {}));
/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
var xd;
(function(t) {
    t.PUSH_RECEIVED = "push-received",
    t.NOTIFICATION_CLICKED = "notification-clicked"
}
)(xd || (xd = {}));
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function No(t) {
    const e = new Uint8Array(t);
    return btoa(String.fromCharCode(...e)).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_")
}
function nve(t) {
    const e = "=".repeat((4 - t.length % 4) % 4)
      , n = (t + e).replace(/\-/g, "+").replace(/_/g, "/")
      , r = atob(n)
      , i = new Uint8Array(r.length);
    for (let o = 0; o < r.length; ++o)
        i[o] = r.charCodeAt(o);
    return i
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const uv = "fcm_token_details_db"
  , rve = 5
  , rP = "fcm_token_object_Store";
async function ive(t) {
    if ("databases"in indexedDB && !(await indexedDB.databases()).map(o => o.name).includes(uv))
        return null;
    let e = null;
    return (await um(uv, rve, {
        upgrade: async (r, i, o, s) => {
            var a;
            if (i < 2 || !r.objectStoreNames.contains(rP))
                return;
            const l = s.objectStore(rP)
              , c = await l.index("fcmSenderId").get(t);
            if (await l.clear(),
            !!c) {
                if (i === 2) {
                    const u = c;
                    if (!u.auth || !u.p256dh || !u.endpoint)
                        return;
                    e = {
                        token: u.fcmToken,
                        createTime: (a = u.createTime) !== null && a !== void 0 ? a : Date.now(),
                        subscriptionOptions: {
                            auth: u.auth,
                            p256dh: u.p256dh,
                            endpoint: u.endpoint,
                            swScope: u.swScope,
                            vapidKey: typeof u.vapidKey == "string" ? u.vapidKey : No(u.vapidKey)
                        }
                    }
                } else if (i === 3) {
                    const u = c;
                    e = {
                        token: u.fcmToken,
                        createTime: u.createTime,
                        subscriptionOptions: {
                            auth: No(u.auth),
                            p256dh: No(u.p256dh),
                            endpoint: u.endpoint,
                            swScope: u.swScope,
                            vapidKey: No(u.vapidKey)
                        }
                    }
                } else if (i === 4) {
                    const u = c;
                    e = {
                        token: u.fcmToken,
                        createTime: u.createTime,
                        subscriptionOptions: {
                            auth: No(u.auth),
                            p256dh: No(u.p256dh),
                            endpoint: u.endpoint,
                            swScope: u.swScope,
                            vapidKey: No(u.vapidKey)
                        }
                    }
                }
            }
        }
    })).close(),
    await iv(uv),
    await iv("fcm_vapid_details_db"),
    await iv("undefined"),
    ove(e) ? e : null
}
function ove(t) {
    if (!t || !t.subscriptionOptions)
        return !1;
    const {subscriptionOptions: e} = t;
    return typeof t.createTime == "number" && t.createTime > 0 && typeof t.token == "string" && t.token.length > 0 && typeof e.auth == "string" && e.auth.length > 0 && typeof e.p256dh == "string" && e.p256dh.length > 0 && typeof e.endpoint == "string" && e.endpoint.length > 0 && typeof e.swScope == "string" && e.swScope.length > 0 && typeof e.vapidKey == "string" && e.vapidKey.length > 0
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const sve = "firebase-messaging-database"
  , ave = 1
  , bd = "firebase-messaging-store";
let fv = null;
function z5() {
    return fv || (fv = um(sve, ave, {
        upgrade: (t, e) => {
            switch (e) {
            case 0:
                t.createObjectStore(bd)
            }
        }
    })),
    fv
}
async function lve(t) {
    const e = j5(t)
      , r = await (await z5()).transaction(bd).objectStore(bd).get(e);
    if (r)
        return r;
    {
        const i = await ive(t.appConfig.senderId);
        if (i)
            return await W2(t, i),
            i
    }
}
async function W2(t, e) {
    const n = j5(t)
      , i = (await z5()).transaction(bd, "readwrite");
    return await i.objectStore(bd).put(e, n),
    await i.done,
    e
}
function j5({appConfig: t}) {
    return t.appId
}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const cve = {
    "missing-app-config-values": 'Missing App configuration value: "{$valueName}"',
    "only-available-in-window": "This method is available in a Window context.",
    "only-available-in-sw": "This method is available in a service worker context.",
    "permission-default": "The notification permission was not granted and dismissed instead.",
    "permission-blocked": "The notification permission was not granted and blocked instead.",
    "unsupported-browser": "This browser doesn't support the API's required to use the Firebase SDK.",
    "indexed-db-unsupported": "This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)",
    "failed-service-worker-registration": "We are unable to register the default service worker. {$browserErrorMessage}",
    "token-subscribe-failed": "A problem occurred while subscribing the user to FCM: {$errorInfo}",
    "token-subscribe-no-token": "FCM returned no token when subscribing the user to push.",
    "token-unsubscribe-failed": "A problem occurred while unsubscribing the user from FCM: {$errorInfo}",
    "token-update-failed": "A problem occurred while updating the user from FCM: {$errorInfo}",
    "token-update-no-token": "FCM returned no token when updating the user to push.",
    "use-sw-after-get-token": "The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",
    "invalid-sw-registration": "The input to useServiceWorker() must be a ServiceWorkerRegistration.",
    "invalid-bg-handler": "The input to setBackgroundMessageHandler() must be a function.",
    "invalid-vapid-key": "The public VAPID key must be a string.",
    "use-vapid-key-after-get-token": "The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."
}
  , Jn = new ih("messaging","Messaging",cve);
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function uve(t, e) {
    const n = await X2(t)
      , r = W5(e)
      , i = {
        method: "POST",
        headers: n,
        body: JSON.stringify(r)
    };
    let o;
    try {
        o = await (await fetch(Y2(t.appConfig), i)).json()
    } catch (s) {
        throw Jn.create("token-subscribe-failed", {
            errorInfo: s == null ? void 0 : s.toString()
        })
    }
    if (o.error) {
        const s = o.error.message;
        throw Jn.create("token-subscribe-failed", {
            errorInfo: s
        })
    }
    if (!o.token)
        throw Jn.create("token-subscribe-no-token");
    return o.token
}
async function fve(t, e) {
    const n = await X2(t)
      , r = W5(e.subscriptionOptions)
      , i = {
        method: "PATCH",
        headers: n,
        body: JSON.stringify(r)
    };
    let o;
    try {
        o = await (await fetch(`${Y2(t.appConfig)}/${e.token}`, i)).json()
    } catch (s) {
        throw Jn.create("token-update-failed", {
            errorInfo: s == null ? void 0 : s.toString()
        })
    }
    if (o.error) {
        const s = o.error.message;
        throw Jn.create("token-update-failed", {
            errorInfo: s
        })
    }
    if (!o.token)
        throw Jn.create("token-update-no-token");
    return o.token
}
async function dve(t, e) {
    const r = {
        method: "DELETE",
        headers: await X2(t)
    };
    try {
        const o = await (await fetch(`${Y2(t.appConfig)}/${e}`, r)).json();
        if (o.error) {
            const s = o.error.message;
            throw Jn.create("token-unsubscribe-failed", {
                errorInfo: s
            })
        }
    } catch (i) {
        throw Jn.create("token-unsubscribe-failed", {
            errorInfo: i == null ? void 0 : i.toString()
        })
    }
}
function Y2({projectId: t}) {
    return `${J1e}/projects/${t}/registrations`
}
async function X2({appConfig: t, installations: e}) {
    const n = await e.getToken();
    return new Headers({
        "Content-Type": "application/json",
        Accept: "application/json",
        "x-goog-api-key": t.apiKey,
        "x-goog-firebase-installations-auth": `FIS ${n}`
    })
}
function W5({p256dh: t, auth: e, endpoint: n, vapidKey: r}) {
    const i = {
        web: {
            endpoint: n,
            auth: e,
            p256dh: t
        }
    };
    return r !== H5 && (i.web.applicationPubKey = r),
    i
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const hve = 7 * 24 * 60 * 60 * 1e3;
async function pve(t) {
    const e = await mve(t.swRegistration, t.vapidKey)
      , n = {
        vapidKey: t.vapidKey,
        swScope: t.swRegistration.scope,
        endpoint: e.endpoint,
        auth: No(e.getKey("auth")),
        p256dh: No(e.getKey("p256dh"))
    }
      , r = await lve(t.firebaseDependencies);
    if (r) {
        if (vve(r.subscriptionOptions, n))
            return Date.now() >= r.createTime + hve ? gve(t, {
                token: r.token,
                createTime: Date.now(),
                subscriptionOptions: n
            }) : r.token;
        try {
            await dve(t.firebaseDependencies, r.token)
        } catch (i) {
            console.warn(i)
        }
        return iP(t.firebaseDependencies, n)
    } else
        return iP(t.firebaseDependencies, n)
}
async function gve(t, e) {
    try {
        const n = await fve(t.firebaseDependencies, e)
          , r = Object.assign(Object.assign({}, e), {
            token: n,
            createTime: Date.now()
        });
        return await W2(t.firebaseDependencies, r),
        n
    } catch (n) {
        throw n
    }
}
async function iP(t, e) {
    const r = {
        token: await uve(t, e),
        createTime: Date.now(),
        subscriptionOptions: e
    };
    return await W2(t, r),
    r.token
}
async function mve(t, e) {
    const n = await t.pushManager.getSubscription();
    return n || t.pushManager.subscribe({
        userVisibleOnly: !0,
        applicationServerKey: nve(e)
    })
}
function vve(t, e) {
    const n = e.vapidKey === t.vapidKey
      , r = e.endpoint === t.endpoint
      , i = e.auth === t.auth
      , o = e.p256dh === t.p256dh;
    return n && r && i && o
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function oP(t) {
    const e = {
        from: t.from,
        collapseKey: t.collapse_key,
        messageId: t.fcmMessageId
    };
    return yve(e, t),
    _ve(e, t),
    xve(e, t),
    e
}
function yve(t, e) {
    if (!e.notification)
        return;
    t.notification = {};
    const n = e.notification.title;
    n && (t.notification.title = n);
    const r = e.notification.body;
    r && (t.notification.body = r);
    const i = e.notification.image;
    i && (t.notification.image = i);
    const o = e.notification.icon;
    o && (t.notification.icon = o)
}
function _ve(t, e) {
    e.data && (t.data = e.data)
}
function xve(t, e) {
    var n, r, i, o, s;
    if (!e.fcmOptions && !(!((n = e.notification) === null || n === void 0) && n.click_action))
        return;
    t.fcmOptions = {};
    const a = (i = (r = e.fcmOptions) === null || r === void 0 ? void 0 : r.link) !== null && i !== void 0 ? i : (o = e.notification) === null || o === void 0 ? void 0 : o.click_action;
    a && (t.fcmOptions.link = a);
    const l = (s = e.fcmOptions) === null || s === void 0 ? void 0 : s.analytics_label;
    l && (t.fcmOptions.analyticsLabel = l)
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function bve(t) {
    return typeof t == "object" && !!t && V5 in t
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
wve("AzSCbw63g1R0nCw85jG8", "Iaya3yLKwmgvh7cF0q4");
function wve(t, e) {
    const n = [];
    for (let r = 0; r < t.length; r++)
        n.push(t.charAt(r)),
        r < e.length && n.push(e.charAt(r));
    return n.join("")
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function Eve(t) {
    if (!t || !t.options)
        throw dv("App Configuration Object");
    if (!t.name)
        throw dv("App Name");
    const e = ["projectId", "apiKey", "appId", "messagingSenderId"]
      , {options: n} = t;
    for (const r of e)
        if (!n[r])
            throw dv(r);
    return {
        appName: t.name,
        projectId: n.projectId,
        apiKey: n.apiKey,
        appId: n.appId,
        senderId: n.messagingSenderId
    }
}
function dv(t) {
    return Jn.create("missing-app-config-values", {
        valueName: t
    })
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class Sve {
    constructor(e, n, r) {
        this.deliveryMetricsExportedToBigQueryEnabled = !1,
        this.onBackgroundMessageHandler = null,
        this.onMessageHandler = null,
        this.logEvents = [],
        this.isLogServiceStarted = !1;
        const i = Eve(e);
        this.firebaseDependencies = {
            app: e,
            appConfig: i,
            installations: n,
            analyticsProvider: r
        }
    }
    _delete() {
        return Promise.resolve()
    }
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function Cve(t) {
    try {
        t.swRegistration = await navigator.serviceWorker.register(q1e, {
            scope: Z1e
        }),
        t.swRegistration.update().catch( () => {}
        ),
        await Ave(t.swRegistration)
    } catch (e) {
        throw Jn.create("failed-service-worker-registration", {
            browserErrorMessage: e == null ? void 0 : e.message
        })
    }
}
async function Ave(t) {
    return new Promise( (e, n) => {
        const r = setTimeout( () => n(new Error(`Service worker not registered after ${tP} ms`)), tP)
          , i = t.installing || t.waiting;
        t.active ? (clearTimeout(r),
        e()) : i ? i.onstatechange = o => {
            var s;
            ((s = o.target) === null || s === void 0 ? void 0 : s.state) === "activated" && (i.onstatechange = null,
            clearTimeout(r),
            e())
        }
        : (clearTimeout(r),
        n(new Error("No incoming service worker found.")))
    }
    )
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function Tve(t, e) {
    if (!e && !t.swRegistration && await Cve(t),
    !(!e && t.swRegistration)) {
        if (!(e instanceof ServiceWorkerRegistration))
            throw Jn.create("invalid-sw-registration");
        t.swRegistration = e
    }
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function Pve(t, e) {
    e ? t.vapidKey = e : t.vapidKey || (t.vapidKey = H5)
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function Y5(t, e) {
    if (!navigator)
        throw Jn.create("only-available-in-window");
    if (Notification.permission === "default" && await Notification.requestPermission(),
    Notification.permission !== "granted")
        throw Jn.create("permission-blocked");
    return await Pve(t, e == null ? void 0 : e.vapidKey),
    await Tve(t, e == null ? void 0 : e.serviceWorkerRegistration),
    pve(t)
}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function Ive(t, e, n) {
    const r = Ove(e);
    (await t.firebaseDependencies.analyticsProvider.get()).logEvent(r, {
        message_id: n[V5],
        message_name: n[Q1e],
        message_time: n[eve],
        message_device_time: Math.floor(Date.now() / 1e3)
    })
}
function Ove(t) {
    switch (t) {
    case xd.NOTIFICATION_CLICKED:
        return "notification_open";
    case xd.PUSH_RECEIVED:
        return "notification_foreground";
    default:
        throw new Error
    }
}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function Rve(t, e) {
    const n = e.data;
    if (!n.isFirebaseMessaging)
        return;
    t.onMessageHandler && n.messageType === xd.PUSH_RECEIVED && (typeof t.onMessageHandler == "function" ? t.onMessageHandler(oP(n)) : t.onMessageHandler.next(oP(n)));
    const r = n.data;
    bve(r) && r[tve] === "1" && await Ive(t, n.messageType, r)
}
const sP = "@firebase/messaging"
  , aP = "0.12.22";
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const Mve = t => {
    const e = new Sve(t.getProvider("app").getImmediate(),t.getProvider("installations-internal").getImmediate(),t.getProvider("analytics-internal"));
    return navigator.serviceWorker.addEventListener("message", n => Rve(e, n)),
    e
}
  , Dve = t => {
    const e = t.getProvider("messaging").getImmediate();
    return {
        getToken: r => Y5(e, r)
    }
}
;
function Bve() {
    ls(new _o("messaging",Mve,"PUBLIC")),
    ls(new _o("messaging-internal",Dve,"PRIVATE")),
    co(sP, aP),
    co(sP, aP, "esm2017")
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function kve() {
    try {
        await $2()
    } catch {
        return !1
    }
    return typeof window < "u" && L2() && h5() && "serviceWorker"in navigator && "PushManager"in window && "Notification"in window && "fetch"in window && ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification") && PushSubscription.prototype.hasOwnProperty("getKey")
}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function Nve(t, e) {
    if (!navigator)
        throw Jn.create("only-available-in-window");
    return t.onMessageHandler = e,
    () => {
        t.onMessageHandler = null
    }
}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function kPe(t=v5()) {
    return kve().then(e => {
        if (!e)
            throw Jn.create("unsupported-browser")
    }
    , e => {
        throw Jn.create("indexed-db-unsupported")
    }
    ),
    sh(oh(t), "messaging").getImmediate()
}
async function NPe(t, e) {
    return t = oh(t),
    Y5(t, e)
}
function FPe(t, e) {
    return t = oh(t),
    Nve(t, e)
}
Bve();
$e.add(Lle);
$e.mixin(Xr, $le);
$e.add(bB);
$e.add(wB);
$e.add(ZB);
$e.mixin(Xr, vde);
$e.add(qB);
$e.add(IN);
$e.add(h2);
$e.add(MN);
$e.add(BN);
$e.add(kN);
$e.add(YN);
$e.add(WN);
$e.add(HN);
$e.add(jN);
$e.add(VN);
$e.add(GN);
$e.add(UN);
$e.add(nk);
$e.add(tk);
const Fve = Object.freeze(Object.defineProperty({
    __proto__: null
}, Symbol.toStringTag, {
    value: "Module"
}))
  , Lve = Object.freeze(Object.defineProperty({
    __proto__: null
}, Symbol.toStringTag, {
    value: "Module"
}));
var ah = {}
  , $ve = function() {
    return typeof Promise == "function" && Promise.prototype && Promise.prototype.then
}
  , X5 = {}
  , Qr = {};
let K2;
const Uve = [0, 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085, 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706];
Qr.getSymbolSize = function(e) {
    if (!e)
        throw new Error('"version" cannot be null or undefined');
    if (e < 1 || e > 40)
        throw new Error('"version" should be in range from 1 to 40');
    return e * 4 + 17
}
;
Qr.getSymbolTotalCodewords = function(e) {
    return Uve[e]
}
;
Qr.getBCHDigit = function(t) {
    let e = 0;
    for (; t !== 0; )
        e++,
        t >>>= 1;
    return e
}
;
Qr.setToSJISFunction = function(e) {
    if (typeof e != "function")
        throw new Error('"toSJISFunc" is not a valid function.');
    K2 = e
}
;
Qr.isKanjiModeEnabled = function() {
    return typeof K2 < "u"
}
;
Qr.toSJIS = function(e) {
    return K2(e)
}
;
var hm = {};
(function(t) {
    t.L = {
        bit: 1
    },
    t.M = {
        bit: 0
    },
    t.Q = {
        bit: 3
    },
    t.H = {
        bit: 2
    };
    function e(n) {
        if (typeof n != "string")
            throw new Error("Param is not a string");
        switch (n.toLowerCase()) {
        case "l":
        case "low":
            return t.L;
        case "m":
        case "medium":
            return t.M;
        case "q":
        case "quartile":
            return t.Q;
        case "h":
        case "high":
            return t.H;
        default:
            throw new Error("Unknown EC Level: " + n)
        }
    }
    t.isValid = function(r) {
        return r && typeof r.bit < "u" && r.bit >= 0 && r.bit < 4
    }
    ,
    t.from = function(r, i) {
        if (t.isValid(r))
            return r;
        try {
            return e(r)
        } catch {
            return i
        }
    }
}
)(hm);
function K5() {
    this.buffer = [],
    this.length = 0
}
K5.prototype = {
    get: function(t) {
        const e = Math.floor(t / 8);
        return (this.buffer[e] >>> 7 - t % 8 & 1) === 1
    },
    put: function(t, e) {
        for (let n = 0; n < e; n++)
            this.putBit((t >>> e - n - 1 & 1) === 1)
    },
    getLengthInBits: function() {
        return this.length
    },
    putBit: function(t) {
        const e = Math.floor(this.length / 8);
        this.buffer.length <= e && this.buffer.push(0),
        t && (this.buffer[e] |= 128 >>> this.length % 8),
        this.length++
    }
};
var Gve = K5;
function lh(t) {
    if (!t || t < 1)
        throw new Error("BitMatrix size must be defined and greater than 0");
    this.size = t,
    this.data = new Uint8Array(t * t),
    this.reservedBit = new Uint8Array(t * t)
}
lh.prototype.set = function(t, e, n, r) {
    const i = t * this.size + e;
    this.data[i] = n,
    r && (this.reservedBit[i] = !0)
}
;
lh.prototype.get = function(t, e) {
    return this.data[t * this.size + e]
}
;
lh.prototype.xor = function(t, e, n) {
    this.data[t * this.size + e] ^= n
}
;
lh.prototype.isReserved = function(t, e) {
    return this.reservedBit[t * this.size + e]
}
;
var Hve = lh
  , q5 = {};
(function(t) {
    const e = Qr.getSymbolSize;
    t.getRowColCoords = function(r) {
        if (r === 1)
            return [];
        const i = Math.floor(r / 7) + 2
          , o = e(r)
          , s = o === 145 ? 26 : Math.ceil((o - 13) / (2 * i - 2)) * 2
          , a = [o - 7];
        for (let l = 1; l < i - 1; l++)
            a[l] = a[l - 1] - s;
        return a.push(6),
        a.reverse()
    }
    ,
    t.getPositions = function(r) {
        const i = []
          , o = t.getRowColCoords(r)
          , s = o.length;
        for (let a = 0; a < s; a++)
            for (let l = 0; l < s; l++)
                a === 0 && l === 0 || a === 0 && l === s - 1 || a === s - 1 && l === 0 || i.push([o[a], o[l]]);
        return i
    }
}
)(q5);
var Z5 = {};
const Vve = Qr.getSymbolSize
  , lP = 7;
Z5.getPositions = function(e) {
    const n = Vve(e);
    return [[0, 0], [n - lP, 0], [0, n - lP]]
}
;
var J5 = {};
(function(t) {
    t.Patterns = {
        PATTERN000: 0,
        PATTERN001: 1,
        PATTERN010: 2,
        PATTERN011: 3,
        PATTERN100: 4,
        PATTERN101: 5,
        PATTERN110: 6,
        PATTERN111: 7
    };
    const e = {
        N1: 3,
        N2: 3,
        N3: 40,
        N4: 10
    };
    t.isValid = function(i) {
        return i != null && i !== "" && !isNaN(i) && i >= 0 && i <= 7
    }
    ,
    t.from = function(i) {
        return t.isValid(i) ? parseInt(i, 10) : void 0
    }
    ,
    t.getPenaltyN1 = function(i) {
        const o = i.size;
        let s = 0
          , a = 0
          , l = 0
          , c = null
          , u = null;
        for (let f = 0; f < o; f++) {
            a = l = 0,
            c = u = null;
            for (let d = 0; d < o; d++) {
                let h = i.get(f, d);
                h === c ? a++ : (a >= 5 && (s += e.N1 + (a - 5)),
                c = h,
                a = 1),
                h = i.get(d, f),
                h === u ? l++ : (l >= 5 && (s += e.N1 + (l - 5)),
                u = h,
                l = 1)
            }
            a >= 5 && (s += e.N1 + (a - 5)),
            l >= 5 && (s += e.N1 + (l - 5))
        }
        return s
    }
    ,
    t.getPenaltyN2 = function(i) {
        const o = i.size;
        let s = 0;
        for (let a = 0; a < o - 1; a++)
            for (let l = 0; l < o - 1; l++) {
                const c = i.get(a, l) + i.get(a, l + 1) + i.get(a + 1, l) + i.get(a + 1, l + 1);
                (c === 4 || c === 0) && s++
            }
        return s * e.N2
    }
    ,
    t.getPenaltyN3 = function(i) {
        const o = i.size;
        let s = 0
          , a = 0
          , l = 0;
        for (let c = 0; c < o; c++) {
            a = l = 0;
            for (let u = 0; u < o; u++)
                a = a << 1 & 2047 | i.get(c, u),
                u >= 10 && (a === 1488 || a === 93) && s++,
                l = l << 1 & 2047 | i.get(u, c),
                u >= 10 && (l === 1488 || l === 93) && s++
        }
        return s * e.N3
    }
    ,
    t.getPenaltyN4 = function(i) {
        let o = 0;
        const s = i.data.length;
        for (let l = 0; l < s; l++)
            o += i.data[l];
        return Math.abs(Math.ceil(o * 100 / s / 5) - 10) * e.N4
    }
    ;
    function n(r, i, o) {
        switch (r) {
        case t.Patterns.PATTERN000:
            return (i + o) % 2 === 0;
        case t.Patterns.PATTERN001:
            return i % 2 === 0;
        case t.Patterns.PATTERN010:
            return o % 3 === 0;
        case t.Patterns.PATTERN011:
            return (i + o) % 3 === 0;
        case t.Patterns.PATTERN100:
            return (Math.floor(i / 2) + Math.floor(o / 3)) % 2 === 0;
        case t.Patterns.PATTERN101:
            return i * o % 2 + i * o % 3 === 0;
        case t.Patterns.PATTERN110:
            return (i * o % 2 + i * o % 3) % 2 === 0;
        case t.Patterns.PATTERN111:
            return (i * o % 3 + (i + o) % 2) % 2 === 0;
        default:
            throw new Error("bad maskPattern:" + r)
        }
    }
    t.applyMask = function(i, o) {
        const s = o.size;
        for (let a = 0; a < s; a++)
            for (let l = 0; l < s; l++)
                o.isReserved(l, a) || o.xor(l, a, n(i, l, a))
    }
    ,
    t.getBestMask = function(i, o) {
        const s = Object.keys(t.Patterns).length;
        let a = 0
          , l = 1 / 0;
        for (let c = 0; c < s; c++) {
            o(c),
            t.applyMask(c, i);
            const u = t.getPenaltyN1(i) + t.getPenaltyN2(i) + t.getPenaltyN3(i) + t.getPenaltyN4(i);
            t.applyMask(c, i),
            u < l && (l = u,
            a = c)
        }
        return a
    }
}
)(J5);
var pm = {};
const Fs = hm
  , dp = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 4, 1, 2, 4, 4, 2, 4, 4, 4, 2, 4, 6, 5, 2, 4, 6, 6, 2, 5, 8, 8, 4, 5, 8, 8, 4, 5, 8, 11, 4, 8, 10, 11, 4, 9, 12, 16, 4, 9, 16, 16, 6, 10, 12, 18, 6, 10, 17, 16, 6, 11, 16, 19, 6, 13, 18, 21, 7, 14, 21, 25, 8, 16, 20, 25, 8, 17, 23, 25, 9, 17, 23, 34, 9, 18, 25, 30, 10, 20, 27, 32, 12, 21, 29, 35, 12, 23, 34, 37, 12, 25, 34, 40, 13, 26, 35, 42, 14, 28, 38, 45, 15, 29, 40, 48, 16, 31, 43, 51, 17, 33, 45, 54, 18, 35, 48, 57, 19, 37, 51, 60, 19, 38, 53, 63, 20, 40, 56, 66, 21, 43, 59, 70, 22, 45, 62, 74, 24, 47, 65, 77, 25, 49, 68, 81]
  , hp = [7, 10, 13, 17, 10, 16, 22, 28, 15, 26, 36, 44, 20, 36, 52, 64, 26, 48, 72, 88, 36, 64, 96, 112, 40, 72, 108, 130, 48, 88, 132, 156, 60, 110, 160, 192, 72, 130, 192, 224, 80, 150, 224, 264, 96, 176, 260, 308, 104, 198, 288, 352, 120, 216, 320, 384, 132, 240, 360, 432, 144, 280, 408, 480, 168, 308, 448, 532, 180, 338, 504, 588, 196, 364, 546, 650, 224, 416, 600, 700, 224, 442, 644, 750, 252, 476, 690, 816, 270, 504, 750, 900, 300, 560, 810, 960, 312, 588, 870, 1050, 336, 644, 952, 1110, 360, 700, 1020, 1200, 390, 728, 1050, 1260, 420, 784, 1140, 1350, 450, 812, 1200, 1440, 480, 868, 1290, 1530, 510, 924, 1350, 1620, 540, 980, 1440, 1710, 570, 1036, 1530, 1800, 570, 1064, 1590, 1890, 600, 1120, 1680, 1980, 630, 1204, 1770, 2100, 660, 1260, 1860, 2220, 720, 1316, 1950, 2310, 750, 1372, 2040, 2430];
pm.getBlocksCount = function(e, n) {
    switch (n) {
    case Fs.L:
        return dp[(e - 1) * 4 + 0];
    case Fs.M:
        return dp[(e - 1) * 4 + 1];
    case Fs.Q:
        return dp[(e - 1) * 4 + 2];
    case Fs.H:
        return dp[(e - 1) * 4 + 3];
    default:
        return
    }
}
;
pm.getTotalCodewordsCount = function(e, n) {
    switch (n) {
    case Fs.L:
        return hp[(e - 1) * 4 + 0];
    case Fs.M:
        return hp[(e - 1) * 4 + 1];
    case Fs.Q:
        return hp[(e - 1) * 4 + 2];
    case Fs.H:
        return hp[(e - 1) * 4 + 3];
    default:
        return
    }
}
;
var Q5 = {}
  , gm = {};
const kf = new Uint8Array(512)
  , k0 = new Uint8Array(256);
(function() {
    let e = 1;
    for (let n = 0; n < 255; n++)
        kf[n] = e,
        k0[e] = n,
        e <<= 1,
        e & 256 && (e ^= 285);
    for (let n = 255; n < 512; n++)
        kf[n] = kf[n - 255]
}
)();
gm.log = function(e) {
    if (e < 1)
        throw new Error("log(" + e + ")");
    return k0[e]
}
;
gm.exp = function(e) {
    return kf[e]
}
;
gm.mul = function(e, n) {
    return e === 0 || n === 0 ? 0 : kf[k0[e] + k0[n]]
}
;
(function(t) {
    const e = gm;
    t.mul = function(r, i) {
        const o = new Uint8Array(r.length + i.length - 1);
        for (let s = 0; s < r.length; s++)
            for (let a = 0; a < i.length; a++)
                o[s + a] ^= e.mul(r[s], i[a]);
        return o
    }
    ,
    t.mod = function(r, i) {
        let o = new Uint8Array(r);
        for (; o.length - i.length >= 0; ) {
            const s = o[0];
            for (let l = 0; l < i.length; l++)
                o[l] ^= e.mul(i[l], s);
            let a = 0;
            for (; a < o.length && o[a] === 0; )
                a++;
            o = o.slice(a)
        }
        return o
    }
    ,
    t.generateECPolynomial = function(r) {
        let i = new Uint8Array([1]);
        for (let o = 0; o < r; o++)
            i = t.mul(i, new Uint8Array([1, e.exp(o)]));
        return i
    }
}
)(Q5);
const e9 = Q5;
function q2(t) {
    this.genPoly = void 0,
    this.degree = t,
    this.degree && this.initialize(this.degree)
}
q2.prototype.initialize = function(e) {
    this.degree = e,
    this.genPoly = e9.generateECPolynomial(this.degree)
}
;
q2.prototype.encode = function(e) {
    if (!this.genPoly)
        throw new Error("Encoder not initialized");
    const n = new Uint8Array(e.length + this.degree);
    n.set(e);
    const r = e9.mod(n, this.genPoly)
      , i = this.degree - r.length;
    if (i > 0) {
        const o = new Uint8Array(this.degree);
        return o.set(r, i),
        o
    }
    return r
}
;
var zve = q2
  , t9 = {}
  , ma = {}
  , Z2 = {};
Z2.isValid = function(e) {
    return !isNaN(e) && e >= 1 && e <= 40
}
;
var Co = {};
const n9 = "[0-9]+"
  , jve = "[A-Z $%*+\\-./:]+";
let wd = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
wd = wd.replace(/u/g, "\\u");
const Wve = "(?:(?![A-Z0-9 $%*+\\-./:]|" + wd + `)(?:.|[\r
]))+`;
Co.KANJI = new RegExp(wd,"g");
Co.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");
Co.BYTE = new RegExp(Wve,"g");
Co.NUMERIC = new RegExp(n9,"g");
Co.ALPHANUMERIC = new RegExp(jve,"g");
const Yve = new RegExp("^" + wd + "$")
  , Xve = new RegExp("^" + n9 + "$")
  , Kve = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
Co.testKanji = function(e) {
    return Yve.test(e)
}
;
Co.testNumeric = function(e) {
    return Xve.test(e)
}
;
Co.testAlphanumeric = function(e) {
    return Kve.test(e)
}
;
(function(t) {
    const e = Z2
      , n = Co;
    t.NUMERIC = {
        id: "Numeric",
        bit: 1,
        ccBits: [10, 12, 14]
    },
    t.ALPHANUMERIC = {
        id: "Alphanumeric",
        bit: 2,
        ccBits: [9, 11, 13]
    },
    t.BYTE = {
        id: "Byte",
        bit: 4,
        ccBits: [8, 16, 16]
    },
    t.KANJI = {
        id: "Kanji",
        bit: 8,
        ccBits: [8, 10, 12]
    },
    t.MIXED = {
        bit: -1
    },
    t.getCharCountIndicator = function(o, s) {
        if (!o.ccBits)
            throw new Error("Invalid mode: " + o);
        if (!e.isValid(s))
            throw new Error("Invalid version: " + s);
        return s >= 1 && s < 10 ? o.ccBits[0] : s < 27 ? o.ccBits[1] : o.ccBits[2]
    }
    ,
    t.getBestModeForData = function(o) {
        return n.testNumeric(o) ? t.NUMERIC : n.testAlphanumeric(o) ? t.ALPHANUMERIC : n.testKanji(o) ? t.KANJI : t.BYTE
    }
    ,
    t.toString = function(o) {
        if (o && o.id)
            return o.id;
        throw new Error("Invalid mode")
    }
    ,
    t.isValid = function(o) {
        return o && o.bit && o.ccBits
    }
    ;
    function r(i) {
        if (typeof i != "string")
            throw new Error("Param is not a string");
        switch (i.toLowerCase()) {
        case "numeric":
            return t.NUMERIC;
        case "alphanumeric":
            return t.ALPHANUMERIC;
        case "kanji":
            return t.KANJI;
        case "byte":
            return t.BYTE;
        default:
            throw new Error("Unknown mode: " + i)
        }
    }
    t.from = function(o, s) {
        if (t.isValid(o))
            return o;
        try {
            return r(o)
        } catch {
            return s
        }
    }
}
)(ma);
(function(t) {
    const e = Qr
      , n = pm
      , r = hm
      , i = ma
      , o = Z2
      , s = 7973
      , a = e.getBCHDigit(s);
    function l(d, h, p) {
        for (let y = 1; y <= 40; y++)
            if (h <= t.getCapacity(y, p, d))
                return y
    }
    function c(d, h) {
        return i.getCharCountIndicator(d, h) + 4
    }
    function u(d, h) {
        let p = 0;
        return d.forEach(function(y) {
            const v = c(y.mode, h);
            p += v + y.getBitsLength()
        }),
        p
    }
    function f(d, h) {
        for (let p = 1; p <= 40; p++)
            if (u(d, p) <= t.getCapacity(p, h, i.MIXED))
                return p
    }
    t.from = function(h, p) {
        return o.isValid(h) ? parseInt(h, 10) : p
    }
    ,
    t.getCapacity = function(h, p, y) {
        if (!o.isValid(h))
            throw new Error("Invalid QR Code version");
        typeof y > "u" && (y = i.BYTE);
        const v = e.getSymbolTotalCodewords(h)
          , g = n.getTotalCodewordsCount(h, p)
          , m = (v - g) * 8;
        if (y === i.MIXED)
            return m;
        const _ = m - c(y, h);
        switch (y) {
        case i.NUMERIC:
            return Math.floor(_ / 10 * 3);
        case i.ALPHANUMERIC:
            return Math.floor(_ / 11 * 2);
        case i.KANJI:
            return Math.floor(_ / 13);
        case i.BYTE:
        default:
            return Math.floor(_ / 8)
        }
    }
    ,
    t.getBestVersionForData = function(h, p) {
        let y;
        const v = r.from(p, r.M);
        if (Array.isArray(h)) {
            if (h.length > 1)
                return f(h, v);
            if (h.length === 0)
                return 1;
            y = h[0]
        } else
            y = h;
        return l(y.mode, y.getLength(), v)
    }
    ,
    t.getEncodedBits = function(h) {
        if (!o.isValid(h) || h < 7)
            throw new Error("Invalid QR Code version");
        let p = h << 12;
        for (; e.getBCHDigit(p) - a >= 0; )
            p ^= s << e.getBCHDigit(p) - a;
        return h << 12 | p
    }
}
)(t9);
var r9 = {};
const mx = Qr
  , i9 = 1335
  , qve = 21522
  , cP = mx.getBCHDigit(i9);
r9.getEncodedBits = function(e, n) {
    const r = e.bit << 3 | n;
    let i = r << 10;
    for (; mx.getBCHDigit(i) - cP >= 0; )
        i ^= i9 << mx.getBCHDigit(i) - cP;
    return (r << 10 | i) ^ qve
}
;
var o9 = {};
const Zve = ma;
function Qc(t) {
    this.mode = Zve.NUMERIC,
    this.data = t.toString()
}
Qc.getBitsLength = function(e) {
    return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0)
}
;
Qc.prototype.getLength = function() {
    return this.data.length
}
;
Qc.prototype.getBitsLength = function() {
    return Qc.getBitsLength(this.data.length)
}
;
Qc.prototype.write = function(e) {
    let n, r, i;
    for (n = 0; n + 3 <= this.data.length; n += 3)
        r = this.data.substr(n, 3),
        i = parseInt(r, 10),
        e.put(i, 10);
    const o = this.data.length - n;
    o > 0 && (r = this.data.substr(n),
    i = parseInt(r, 10),
    e.put(i, o * 3 + 1))
}
;
var Jve = Qc;
const Qve = ma
  , hv = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", " ", "$", "%", "*", "+", "-", ".", "/", ":"];
function eu(t) {
    this.mode = Qve.ALPHANUMERIC,
    this.data = t
}
eu.getBitsLength = function(e) {
    return 11 * Math.floor(e / 2) + 6 * (e % 2)
}
;
eu.prototype.getLength = function() {
    return this.data.length
}
;
eu.prototype.getBitsLength = function() {
    return eu.getBitsLength(this.data.length)
}
;
eu.prototype.write = function(e) {
    let n;
    for (n = 0; n + 2 <= this.data.length; n += 2) {
        let r = hv.indexOf(this.data[n]) * 45;
        r += hv.indexOf(this.data[n + 1]),
        e.put(r, 11)
    }
    this.data.length % 2 && e.put(hv.indexOf(this.data[n]), 6)
}
;
var eye = eu;
const tye = ma;
function tu(t) {
    this.mode = tye.BYTE,
    typeof t == "string" ? this.data = new TextEncoder().encode(t) : this.data = new Uint8Array(t)
}
tu.getBitsLength = function(e) {
    return e * 8
}
;
tu.prototype.getLength = function() {
    return this.data.length
}
;
tu.prototype.getBitsLength = function() {
    return tu.getBitsLength(this.data.length)
}
;
tu.prototype.write = function(t) {
    for (let e = 0, n = this.data.length; e < n; e++)
        t.put(this.data[e], 8)
}
;
var nye = tu;
const rye = ma
  , iye = Qr;
function nu(t) {
    this.mode = rye.KANJI,
    this.data = t
}
nu.getBitsLength = function(e) {
    return e * 13
}
;
nu.prototype.getLength = function() {
    return this.data.length
}
;
nu.prototype.getBitsLength = function() {
    return nu.getBitsLength(this.data.length)
}
;
nu.prototype.write = function(t) {
    let e;
    for (e = 0; e < this.data.length; e++) {
        let n = iye.toSJIS(this.data[e]);
        if (n >= 33088 && n <= 40956)
            n -= 33088;
        else if (n >= 57408 && n <= 60351)
            n -= 49472;
        else
            throw new Error("Invalid SJIS character: " + this.data[e] + `
Make sure your charset is UTF-8`);
        n = (n >>> 8 & 255) * 192 + (n & 255),
        t.put(n, 13)
    }
}
;
var oye = nu
  , s9 = {
    exports: {}
};
(function(t) {
    var e = {
        single_source_shortest_paths: function(n, r, i) {
            var o = {}
              , s = {};
            s[r] = 0;
            var a = e.PriorityQueue.make();
            a.push(r, 0);
            for (var l, c, u, f, d, h, p, y, v; !a.empty(); ) {
                l = a.pop(),
                c = l.value,
                f = l.cost,
                d = n[c] || {};
                for (u in d)
                    d.hasOwnProperty(u) && (h = d[u],
                    p = f + h,
                    y = s[u],
                    v = typeof s[u] > "u",
                    (v || y > p) && (s[u] = p,
                    a.push(u, p),
                    o[u] = c))
            }
            if (typeof i < "u" && typeof s[i] > "u") {
                var g = ["Could not find a path from ", r, " to ", i, "."].join("");
                throw new Error(g)
            }
            return o
        },
        extract_shortest_path_from_predecessor_list: function(n, r) {
            for (var i = [], o = r; o; )
                i.push(o),
                n[o],
                o = n[o];
            return i.reverse(),
            i
        },
        find_path: function(n, r, i) {
            var o = e.single_source_shortest_paths(n, r, i);
            return e.extract_shortest_path_from_predecessor_list(o, i)
        },
        PriorityQueue: {
            make: function(n) {
                var r = e.PriorityQueue, i = {}, o;
                n = n || {};
                for (o in r)
                    r.hasOwnProperty(o) && (i[o] = r[o]);
                return i.queue = [],
                i.sorter = n.sorter || r.default_sorter,
                i
            },
            default_sorter: function(n, r) {
                return n.cost - r.cost
            },
            push: function(n, r) {
                var i = {
                    value: n,
                    cost: r
                };
                this.queue.push(i),
                this.queue.sort(this.sorter)
            },
            pop: function() {
                return this.queue.shift()
            },
            empty: function() {
                return this.queue.length === 0
            }
        }
    };
    t.exports = e
}
)(s9);
var sye = s9.exports;
(function(t) {
    const e = ma
      , n = Jve
      , r = eye
      , i = nye
      , o = oye
      , s = Co
      , a = Qr
      , l = sye;
    function c(g) {
        return unescape(encodeURIComponent(g)).length
    }
    function u(g, m, _) {
        const x = [];
        let b;
        for (; (b = g.exec(_)) !== null; )
            x.push({
                data: b[0],
                index: b.index,
                mode: m,
                length: b[0].length
            });
        return x
    }
    function f(g) {
        const m = u(s.NUMERIC, e.NUMERIC, g)
          , _ = u(s.ALPHANUMERIC, e.ALPHANUMERIC, g);
        let x, b;
        return a.isKanjiModeEnabled() ? (x = u(s.BYTE, e.BYTE, g),
        b = u(s.KANJI, e.KANJI, g)) : (x = u(s.BYTE_KANJI, e.BYTE, g),
        b = []),
        m.concat(_, x, b).sort(function(E, S) {
            return E.index - S.index
        }).map(function(E) {
            return {
                data: E.data,
                mode: E.mode,
                length: E.length
            }
        })
    }
    function d(g, m) {
        switch (m) {
        case e.NUMERIC:
            return n.getBitsLength(g);
        case e.ALPHANUMERIC:
            return r.getBitsLength(g);
        case e.KANJI:
            return o.getBitsLength(g);
        case e.BYTE:
            return i.getBitsLength(g)
        }
    }
    function h(g) {
        return g.reduce(function(m, _) {
            const x = m.length - 1 >= 0 ? m[m.length - 1] : null;
            return x && x.mode === _.mode ? (m[m.length - 1].data += _.data,
            m) : (m.push(_),
            m)
        }, [])
    }
    function p(g) {
        const m = [];
        for (let _ = 0; _ < g.length; _++) {
            const x = g[_];
            switch (x.mode) {
            case e.NUMERIC:
                m.push([x, {
                    data: x.data,
                    mode: e.ALPHANUMERIC,
                    length: x.length
                }, {
                    data: x.data,
                    mode: e.BYTE,
                    length: x.length
                }]);
                break;
            case e.ALPHANUMERIC:
                m.push([x, {
                    data: x.data,
                    mode: e.BYTE,
                    length: x.length
                }]);
                break;
            case e.KANJI:
                m.push([x, {
                    data: x.data,
                    mode: e.BYTE,
                    length: c(x.data)
                }]);
                break;
            case e.BYTE:
                m.push([{
                    data: x.data,
                    mode: e.BYTE,
                    length: c(x.data)
                }])
            }
        }
        return m
    }
    function y(g, m) {
        const _ = {}
          , x = {
            start: {}
        };
        let b = ["start"];
        for (let w = 0; w < g.length; w++) {
            const E = g[w]
              , S = [];
            for (let P = 0; P < E.length; P++) {
                const C = E[P]
                  , A = "" + w + P;
                S.push(A),
                _[A] = {
                    node: C,
                    lastCount: 0
                },
                x[A] = {};
                for (let T = 0; T < b.length; T++) {
                    const I = b[T];
                    _[I] && _[I].node.mode === C.mode ? (x[I][A] = d(_[I].lastCount + C.length, C.mode) - d(_[I].lastCount, C.mode),
                    _[I].lastCount += C.length) : (_[I] && (_[I].lastCount = C.length),
                    x[I][A] = d(C.length, C.mode) + 4 + e.getCharCountIndicator(C.mode, m))
                }
            }
            b = S
        }
        for (let w = 0; w < b.length; w++)
            x[b[w]].end = 0;
        return {
            map: x,
            table: _
        }
    }
    function v(g, m) {
        let _;
        const x = e.getBestModeForData(g);
        if (_ = e.from(m, x),
        _ !== e.BYTE && _.bit < x.bit)
            throw new Error('"' + g + '" cannot be encoded with mode ' + e.toString(_) + `.
 Suggested mode is: ` + e.toString(x));
        switch (_ === e.KANJI && !a.isKanjiModeEnabled() && (_ = e.BYTE),
        _) {
        case e.NUMERIC:
            return new n(g);
        case e.ALPHANUMERIC:
            return new r(g);
        case e.KANJI:
            return new o(g);
        case e.BYTE:
            return new i(g)
        }
    }
    t.fromArray = function(m) {
        return m.reduce(function(_, x) {
            return typeof x == "string" ? _.push(v(x, null)) : x.data && _.push(v(x.data, x.mode)),
            _
        }, [])
    }
    ,
    t.fromString = function(m, _) {
        const x = f(m, a.isKanjiModeEnabled())
          , b = p(x)
          , w = y(b, _)
          , E = l.find_path(w.map, "start", "end")
          , S = [];
        for (let P = 1; P < E.length - 1; P++)
            S.push(w.table[E[P]].node);
        return t.fromArray(h(S))
    }
    ,
    t.rawSplit = function(m) {
        return t.fromArray(f(m, a.isKanjiModeEnabled()))
    }
}
)(o9);
const mm = Qr
  , pv = hm
  , aye = Gve
  , lye = Hve
  , cye = q5
  , uye = Z5
  , vx = J5
  , yx = pm
  , fye = zve
  , N0 = t9
  , dye = r9
  , hye = ma
  , gv = o9;
function pye(t, e) {
    const n = t.size
      , r = uye.getPositions(e);
    for (let i = 0; i < r.length; i++) {
        const o = r[i][0]
          , s = r[i][1];
        for (let a = -1; a <= 7; a++)
            if (!(o + a <= -1 || n <= o + a))
                for (let l = -1; l <= 7; l++)
                    s + l <= -1 || n <= s + l || (a >= 0 && a <= 6 && (l === 0 || l === 6) || l >= 0 && l <= 6 && (a === 0 || a === 6) || a >= 2 && a <= 4 && l >= 2 && l <= 4 ? t.set(o + a, s + l, !0, !0) : t.set(o + a, s + l, !1, !0))
    }
}
function gye(t) {
    const e = t.size;
    for (let n = 8; n < e - 8; n++) {
        const r = n % 2 === 0;
        t.set(n, 6, r, !0),
        t.set(6, n, r, !0)
    }
}
function mye(t, e) {
    const n = cye.getPositions(e);
    for (let r = 0; r < n.length; r++) {
        const i = n[r][0]
          , o = n[r][1];
        for (let s = -2; s <= 2; s++)
            for (let a = -2; a <= 2; a++)
                s === -2 || s === 2 || a === -2 || a === 2 || s === 0 && a === 0 ? t.set(i + s, o + a, !0, !0) : t.set(i + s, o + a, !1, !0)
    }
}
function vye(t, e) {
    const n = t.size
      , r = N0.getEncodedBits(e);
    let i, o, s;
    for (let a = 0; a < 18; a++)
        i = Math.floor(a / 3),
        o = a % 3 + n - 8 - 3,
        s = (r >> a & 1) === 1,
        t.set(i, o, s, !0),
        t.set(o, i, s, !0)
}
function mv(t, e, n) {
    const r = t.size
      , i = dye.getEncodedBits(e, n);
    let o, s;
    for (o = 0; o < 15; o++)
        s = (i >> o & 1) === 1,
        o < 6 ? t.set(o, 8, s, !0) : o < 8 ? t.set(o + 1, 8, s, !0) : t.set(r - 15 + o, 8, s, !0),
        o < 8 ? t.set(8, r - o - 1, s, !0) : o < 9 ? t.set(8, 15 - o - 1 + 1, s, !0) : t.set(8, 15 - o - 1, s, !0);
    t.set(r - 8, 8, 1, !0)
}
function yye(t, e) {
    const n = t.size;
    let r = -1
      , i = n - 1
      , o = 7
      , s = 0;
    for (let a = n - 1; a > 0; a -= 2)
        for (a === 6 && a--; ; ) {
            for (let l = 0; l < 2; l++)
                if (!t.isReserved(i, a - l)) {
                    let c = !1;
                    s < e.length && (c = (e[s] >>> o & 1) === 1),
                    t.set(i, a - l, c),
                    o--,
                    o === -1 && (s++,
                    o = 7)
                }
            if (i += r,
            i < 0 || n <= i) {
                i -= r,
                r = -r;
                break
            }
        }
}
function _ye(t, e, n) {
    const r = new aye;
    n.forEach(function(l) {
        r.put(l.mode.bit, 4),
        r.put(l.getLength(), hye.getCharCountIndicator(l.mode, t)),
        l.write(r)
    });
    const i = mm.getSymbolTotalCodewords(t)
      , o = yx.getTotalCodewordsCount(t, e)
      , s = (i - o) * 8;
    for (r.getLengthInBits() + 4 <= s && r.put(0, 4); r.getLengthInBits() % 8 !== 0; )
        r.putBit(0);
    const a = (s - r.getLengthInBits()) / 8;
    for (let l = 0; l < a; l++)
        r.put(l % 2 ? 17 : 236, 8);
    return xye(r, t, e)
}
function xye(t, e, n) {
    const r = mm.getSymbolTotalCodewords(e)
      , i = yx.getTotalCodewordsCount(e, n)
      , o = r - i
      , s = yx.getBlocksCount(e, n)
      , a = r % s
      , l = s - a
      , c = Math.floor(r / s)
      , u = Math.floor(o / s)
      , f = u + 1
      , d = c - u
      , h = new fye(d);
    let p = 0;
    const y = new Array(s)
      , v = new Array(s);
    let g = 0;
    const m = new Uint8Array(t.buffer);
    for (let E = 0; E < s; E++) {
        const S = E < l ? u : f;
        y[E] = m.slice(p, p + S),
        v[E] = h.encode(y[E]),
        p += S,
        g = Math.max(g, S)
    }
    const _ = new Uint8Array(r);
    let x = 0, b, w;
    for (b = 0; b < g; b++)
        for (w = 0; w < s; w++)
            b < y[w].length && (_[x++] = y[w][b]);
    for (b = 0; b < d; b++)
        for (w = 0; w < s; w++)
            _[x++] = v[w][b];
    return _
}
function bye(t, e, n, r) {
    let i;
    if (Array.isArray(t))
        i = gv.fromArray(t);
    else if (typeof t == "string") {
        let c = e;
        if (!c) {
            const u = gv.rawSplit(t);
            c = N0.getBestVersionForData(u, n)
        }
        i = gv.fromString(t, c || 40)
    } else
        throw new Error("Invalid data");
    const o = N0.getBestVersionForData(i, n);
    if (!o)
        throw new Error("The amount of data is too big to be stored in a QR Code");
    if (!e)
        e = o;
    else if (e < o)
        throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: ` + o + `.
`);
    const s = _ye(e, n, i)
      , a = mm.getSymbolSize(e)
      , l = new lye(a);
    return pye(l, e),
    gye(l),
    mye(l, e),
    mv(l, n, 0),
    e >= 7 && vye(l, e),
    yye(l, s),
    isNaN(r) && (r = vx.getBestMask(l, mv.bind(null, l, n))),
    vx.applyMask(r, l),
    mv(l, n, r),
    {
        modules: l,
        version: e,
        errorCorrectionLevel: n,
        maskPattern: r,
        segments: i
    }
}
X5.create = function(e, n) {
    if (typeof e > "u" || e === "")
        throw new Error("No input text");
    let r = pv.M, i, o;
    return typeof n < "u" && (r = pv.from(n.errorCorrectionLevel, pv.M),
    i = N0.from(n.version),
    o = vx.from(n.maskPattern),
    n.toSJISFunc && mm.setToSJISFunction(n.toSJISFunc)),
    bye(e, i, r, o)
}
;
var a9 = {}
  , J2 = {};
(function(t) {
    function e(n) {
        if (typeof n == "number" && (n = n.toString()),
        typeof n != "string")
            throw new Error("Color should be defined as hex string");
        let r = n.slice().replace("#", "").split("");
        if (r.length < 3 || r.length === 5 || r.length > 8)
            throw new Error("Invalid hex color: " + n);
        (r.length === 3 || r.length === 4) && (r = Array.prototype.concat.apply([], r.map(function(o) {
            return [o, o]
        }))),
        r.length === 6 && r.push("F", "F");
        const i = parseInt(r.join(""), 16);
        return {
            r: i >> 24 & 255,
            g: i >> 16 & 255,
            b: i >> 8 & 255,
            a: i & 255,
            hex: "#" + r.slice(0, 6).join("")
        }
    }
    t.getOptions = function(r) {
        r || (r = {}),
        r.color || (r.color = {});
        const i = typeof r.margin > "u" || r.margin === null || r.margin < 0 ? 4 : r.margin
          , o = r.width && r.width >= 21 ? r.width : void 0
          , s = r.scale || 4;
        return {
            width: o,
            scale: o ? 4 : s,
            margin: i,
            color: {
                dark: e(r.color.dark || "#000000ff"),
                light: e(r.color.light || "#ffffffff")
            },
            type: r.type,
            rendererOpts: r.rendererOpts || {}
        }
    }
    ,
    t.getScale = function(r, i) {
        return i.width && i.width >= r + i.margin * 2 ? i.width / (r + i.margin * 2) : i.scale
    }
    ,
    t.getImageWidth = function(r, i) {
        const o = t.getScale(r, i);
        return Math.floor((r + i.margin * 2) * o)
    }
    ,
    t.qrToImageData = function(r, i, o) {
        const s = i.modules.size
          , a = i.modules.data
          , l = t.getScale(s, o)
          , c = Math.floor((s + o.margin * 2) * l)
          , u = o.margin * l
          , f = [o.color.light, o.color.dark];
        for (let d = 0; d < c; d++)
            for (let h = 0; h < c; h++) {
                let p = (d * c + h) * 4
                  , y = o.color.light;
                if (d >= u && h >= u && d < c - u && h < c - u) {
                    const v = Math.floor((d - u) / l)
                      , g = Math.floor((h - u) / l);
                    y = f[a[v * s + g] ? 1 : 0]
                }
                r[p++] = y.r,
                r[p++] = y.g,
                r[p++] = y.b,
                r[p] = y.a
            }
    }
}
)(J2);
(function(t) {
    const e = J2;
    function n(i, o, s) {
        i.clearRect(0, 0, o.width, o.height),
        o.style || (o.style = {}),
        o.height = s,
        o.width = s,
        o.style.height = s + "px",
        o.style.width = s + "px"
    }
    function r() {
        try {
            return document.createElement("canvas")
        } catch {
            throw new Error("You need to specify a canvas element")
        }
    }
    t.render = function(o, s, a) {
        let l = a
          , c = s;
        typeof l > "u" && (!s || !s.getContext) && (l = s,
        s = void 0),
        s || (c = r()),
        l = e.getOptions(l);
        const u = e.getImageWidth(o.modules.size, l)
          , f = c.getContext("2d")
          , d = f.createImageData(u, u);
        return e.qrToImageData(d.data, o, l),
        n(f, c, u),
        f.putImageData(d, 0, 0),
        c
    }
    ,
    t.renderToDataURL = function(o, s, a) {
        let l = a;
        typeof l > "u" && (!s || !s.getContext) && (l = s,
        s = void 0),
        l || (l = {});
        const c = t.render(o, s, l)
          , u = l.type || "image/png"
          , f = l.rendererOpts || {};
        return c.toDataURL(u, f.quality)
    }
}
)(a9);
var l9 = {};
const wye = J2;
function uP(t, e) {
    const n = t.a / 255
      , r = e + '="' + t.hex + '"';
    return n < 1 ? r + " " + e + '-opacity="' + n.toFixed(2).slice(1) + '"' : r
}
function vv(t, e, n) {
    let r = t + e;
    return typeof n < "u" && (r += " " + n),
    r
}
function Eye(t, e, n) {
    let r = ""
      , i = 0
      , o = !1
      , s = 0;
    for (let a = 0; a < t.length; a++) {
        const l = Math.floor(a % e)
          , c = Math.floor(a / e);
        !l && !o && (o = !0),
        t[a] ? (s++,
        a > 0 && l > 0 && t[a - 1] || (r += o ? vv("M", l + n, .5 + c + n) : vv("m", i, 0),
        i = 0,
        o = !1),
        l + 1 < e && t[a + 1] || (r += vv("h", s),
        s = 0)) : i++
    }
    return r
}
l9.render = function(e, n, r) {
    const i = wye.getOptions(n)
      , o = e.modules.size
      , s = e.modules.data
      , a = o + i.margin * 2
      , l = i.color.light.a ? "<path " + uP(i.color.light, "fill") + ' d="M0 0h' + a + "v" + a + 'H0z"/>' : ""
      , c = "<path " + uP(i.color.dark, "stroke") + ' d="' + Eye(s, o, i.margin) + '"/>'
      , u = 'viewBox="0 0 ' + a + " " + a + '"'
      , d = '<svg xmlns="http://www.w3.org/2000/svg" ' + (i.width ? 'width="' + i.width + '" height="' + i.width + '" ' : "") + u + ' shape-rendering="crispEdges">' + l + c + `</svg>
`;
    return typeof r == "function" && r(null, d),
    d
}
;
const Sye = $ve
  , _x = X5
  , c9 = a9
  , Cye = l9;
function Q2(t, e, n, r, i) {
    const o = [].slice.call(arguments, 1)
      , s = o.length
      , a = typeof o[s - 1] == "function";
    if (!a && !Sye())
        throw new Error("Callback required as last argument");
    if (a) {
        if (s < 2)
            throw new Error("Too few arguments provided");
        s === 2 ? (i = n,
        n = e,
        e = r = void 0) : s === 3 && (e.getContext && typeof i > "u" ? (i = r,
        r = void 0) : (i = r,
        r = n,
        n = e,
        e = void 0))
    } else {
        if (s < 1)
            throw new Error("Too few arguments provided");
        return s === 1 ? (n = e,
        e = r = void 0) : s === 2 && !e.getContext && (r = n,
        n = e,
        e = void 0),
        new Promise(function(l, c) {
            try {
                const u = _x.create(n, r);
                l(t(u, e, r))
            } catch (u) {
                c(u)
            }
        }
        )
    }
    try {
        const l = _x.create(n, r);
        i(null, t(l, e, r))
    } catch (l) {
        i(l)
    }
}
ah.create = _x.create;
ah.toCanvas = Q2.bind(null, c9.render);
ah.toDataURL = Q2.bind(null, c9.renderToDataURL);
ah.toString = Q2.bind(null, function(t, e, n) {
    return Cye.render(t, n)
});
function LPe(t, e) {
    const n = T6(t)
      , r = Z("");
    return ve(n, async i => {
        n.value && ra && (r.value = await ah.toDataURL(i, e))
    }
    , {
        immediate: !0
    }),
    r
}
function fP(t) {
    return t !== null && typeof t == "object" && "constructor"in t && t.constructor === Object
}
function eE(t={}, e={}) {
    Object.keys(e).forEach(n => {
        typeof t[n] > "u" ? t[n] = e[n] : fP(e[n]) && fP(t[n]) && Object.keys(e[n]).length > 0 && eE(t[n], e[n])
    }
    )
}
const u9 = {
    body: {},
    addEventListener() {},
    removeEventListener() {},
    activeElement: {
        blur() {},
        nodeName: ""
    },
    querySelector() {
        return null
    },
    querySelectorAll() {
        return []
    },
    getElementById() {
        return null
    },
    createEvent() {
        return {
            initEvent() {}
        }
    },
    createElement() {
        return {
            children: [],
            childNodes: [],
            style: {},
            setAttribute() {},
            getElementsByTagName() {
                return []
            }
        }
    },
    createElementNS() {
        return {}
    },
    importNode() {
        return null
    },
    location: {
        hash: "",
        host: "",
        hostname: "",
        href: "",
        origin: "",
        pathname: "",
        protocol: "",
        search: ""
    }
};
function Qn() {
    const t = typeof document < "u" ? document : {};
    return eE(t, u9),
    t
}
const Aye = {
    document: u9,
    navigator: {
        userAgent: ""
    },
    location: {
        hash: "",
        host: "",
        hostname: "",
        href: "",
        origin: "",
        pathname: "",
        protocol: "",
        search: ""
    },
    history: {
        replaceState() {},
        pushState() {},
        go() {},
        back() {}
    },
    CustomEvent: function() {
        return this
    },
    addEventListener() {},
    removeEventListener() {},
    getComputedStyle() {
        return {
            getPropertyValue() {
                return ""
            }
        }
    },
    Image() {},
    Date() {},
    screen: {},
    setTimeout() {},
    clearTimeout() {},
    matchMedia() {
        return {}
    },
    requestAnimationFrame(t) {
        return typeof setTimeout > "u" ? (t(),
        null) : setTimeout(t, 0)
    },
    cancelAnimationFrame(t) {
        typeof setTimeout > "u" || clearTimeout(t)
    }
};
function kn() {
    const t = typeof window < "u" ? window : {};
    return eE(t, Aye),
    t
}
function Tye(t) {
    const e = t.__proto__;
    Object.defineProperty(t, "__proto__", {
        get() {
            return e
        },
        set(n) {
            e.__proto__ = n
        }
    })
}
class Ls extends Array {
    constructor(e) {
        typeof e == "number" ? super(e) : (super(...e || []),
        Tye(this))
    }
}
function ch(t=[]) {
    const e = [];
    return t.forEach(n => {
        Array.isArray(n) ? e.push(...ch(n)) : e.push(n)
    }
    ),
    e
}
function f9(t, e) {
    return Array.prototype.filter.call(t, e)
}
function Pye(t) {
    const e = [];
    for (let n = 0; n < t.length; n += 1)
        e.indexOf(t[n]) === -1 && e.push(t[n]);
    return e
}
function Iye(t, e) {
    if (typeof t != "string")
        return [t];
    const n = []
      , r = e.querySelectorAll(t);
    for (let i = 0; i < r.length; i += 1)
        n.push(r[i]);
    return n
}
function Ie(t, e) {
    const n = kn()
      , r = Qn();
    let i = [];
    if (!e && t instanceof Ls)
        return t;
    if (!t)
        return new Ls(i);
    if (typeof t == "string") {
        const o = t.trim();
        if (o.indexOf("<") >= 0 && o.indexOf(">") >= 0) {
            let s = "div";
            o.indexOf("<li") === 0 && (s = "ul"),
            o.indexOf("<tr") === 0 && (s = "tbody"),
            (o.indexOf("<td") === 0 || o.indexOf("<th") === 0) && (s = "tr"),
            o.indexOf("<tbody") === 0 && (s = "table"),
            o.indexOf("<option") === 0 && (s = "select");
            const a = r.createElement(s);
            a.innerHTML = o;
            for (let l = 0; l < a.childNodes.length; l += 1)
                i.push(a.childNodes[l])
        } else
            i = Iye(t.trim(), e || r)
    } else if (t.nodeType || t === n || t === r)
        i.push(t);
    else if (Array.isArray(t)) {
        if (t instanceof Ls)
            return t;
        i = t
    }
    return new Ls(Pye(i))
}
Ie.fn = Ls.prototype;
function Oye(...t) {
    const e = ch(t.map(n => n.split(" ")));
    return this.forEach(n => {
        n.classList.add(...e)
    }
    ),
    this
}
function Rye(...t) {
    const e = ch(t.map(n => n.split(" ")));
    return this.forEach(n => {
        n.classList.remove(...e)
    }
    ),
    this
}
function Mye(...t) {
    const e = ch(t.map(n => n.split(" ")));
    this.forEach(n => {
        e.forEach(r => {
            n.classList.toggle(r)
        }
        )
    }
    )
}
function Dye(...t) {
    const e = ch(t.map(n => n.split(" ")));
    return f9(this, n => e.filter(r => n.classList.contains(r)).length > 0).length > 0
}
function Bye(t, e) {
    if (arguments.length === 1 && typeof t == "string")
        return this[0] ? this[0].getAttribute(t) : void 0;
    for (let n = 0; n < this.length; n += 1)
        if (arguments.length === 2)
            this[n].setAttribute(t, e);
        else
            for (const r in t)
                this[n][r] = t[r],
                this[n].setAttribute(r, t[r]);
    return this
}
function kye(t) {
    for (let e = 0; e < this.length; e += 1)
        this[e].removeAttribute(t);
    return this
}
function Nye(t) {
    for (let e = 0; e < this.length; e += 1)
        this[e].style.transform = t;
    return this
}
function Fye(t) {
    for (let e = 0; e < this.length; e += 1)
        this[e].style.transitionDuration = typeof t != "string" ? `${t}ms` : t;
    return this
}
function Lye(...t) {
    let[e,n,r,i] = t;
    typeof t[1] == "function" && ([e,r,i] = t,
    n = void 0),
    i || (i = !1);
    function o(c) {
        const u = c.target;
        if (!u)
            return;
        const f = c.target.dom7EventData || [];
        if (f.indexOf(c) < 0 && f.unshift(c),
        Ie(u).is(n))
            r.apply(u, f);
        else {
            const d = Ie(u).parents();
            for (let h = 0; h < d.length; h += 1)
                Ie(d[h]).is(n) && r.apply(d[h], f)
        }
    }
    function s(c) {
        const u = c && c.target ? c.target.dom7EventData || [] : [];
        u.indexOf(c) < 0 && u.unshift(c),
        r.apply(this, u)
    }
    const a = e.split(" ");
    let l;
    for (let c = 0; c < this.length; c += 1) {
        const u = this[c];
        if (n)
            for (l = 0; l < a.length; l += 1) {
                const f = a[l];
                u.dom7LiveListeners || (u.dom7LiveListeners = {}),
                u.dom7LiveListeners[f] || (u.dom7LiveListeners[f] = []),
                u.dom7LiveListeners[f].push({
                    listener: r,
                    proxyListener: o
                }),
                u.addEventListener(f, o, i)
            }
        else
            for (l = 0; l < a.length; l += 1) {
                const f = a[l];
                u.dom7Listeners || (u.dom7Listeners = {}),
                u.dom7Listeners[f] || (u.dom7Listeners[f] = []),
                u.dom7Listeners[f].push({
                    listener: r,
                    proxyListener: s
                }),
                u.addEventListener(f, s, i)
            }
    }
    return this
}
function $ye(...t) {
    let[e,n,r,i] = t;
    typeof t[1] == "function" && ([e,r,i] = t,
    n = void 0),
    i || (i = !1);
    const o = e.split(" ");
    for (let s = 0; s < o.length; s += 1) {
        const a = o[s];
        for (let l = 0; l < this.length; l += 1) {
            const c = this[l];
            let u;
            if (!n && c.dom7Listeners ? u = c.dom7Listeners[a] : n && c.dom7LiveListeners && (u = c.dom7LiveListeners[a]),
            u && u.length)
                for (let f = u.length - 1; f >= 0; f -= 1) {
                    const d = u[f];
                    r && d.listener === r || r && d.listener && d.listener.dom7proxy && d.listener.dom7proxy === r ? (c.removeEventListener(a, d.proxyListener, i),
                    u.splice(f, 1)) : r || (c.removeEventListener(a, d.proxyListener, i),
                    u.splice(f, 1))
                }
        }
    }
    return this
}
function Uye(...t) {
    const e = kn()
      , n = t[0].split(" ")
      , r = t[1];
    for (let i = 0; i < n.length; i += 1) {
        const o = n[i];
        for (let s = 0; s < this.length; s += 1) {
            const a = this[s];
            if (e.CustomEvent) {
                const l = new e.CustomEvent(o,{
                    detail: r,
                    bubbles: !0,
                    cancelable: !0
                });
                a.dom7EventData = t.filter( (c, u) => u > 0),
                a.dispatchEvent(l),
                a.dom7EventData = [],
                delete a.dom7EventData
            }
        }
    }
    return this
}
function Gye(t) {
    const e = this;
    function n(r) {
        r.target === this && (t.call(this, r),
        e.off("transitionend", n))
    }
    return t && e.on("transitionend", n),
    this
}
function Hye(t) {
    if (this.length > 0) {
        if (t) {
            const e = this.styles();
            return this[0].offsetWidth + parseFloat(e.getPropertyValue("margin-right")) + parseFloat(e.getPropertyValue("margin-left"))
        }
        return this[0].offsetWidth
    }
    return null
}
function Vye(t) {
    if (this.length > 0) {
        if (t) {
            const e = this.styles();
            return this[0].offsetHeight + parseFloat(e.getPropertyValue("margin-top")) + parseFloat(e.getPropertyValue("margin-bottom"))
        }
        return this[0].offsetHeight
    }
    return null
}
function zye() {
    if (this.length > 0) {
        const t = kn()
          , e = Qn()
          , n = this[0]
          , r = n.getBoundingClientRect()
          , i = e.body
          , o = n.clientTop || i.clientTop || 0
          , s = n.clientLeft || i.clientLeft || 0
          , a = n === t ? t.scrollY : n.scrollTop
          , l = n === t ? t.scrollX : n.scrollLeft;
        return {
            top: r.top + a - o,
            left: r.left + l - s
        }
    }
    return null
}
function jye() {
    const t = kn();
    return this[0] ? t.getComputedStyle(this[0], null) : {}
}
function Wye(t, e) {
    const n = kn();
    let r;
    if (arguments.length === 1)
        if (typeof t == "string") {
            if (this[0])
                return n.getComputedStyle(this[0], null).getPropertyValue(t)
        } else {
            for (r = 0; r < this.length; r += 1)
                for (const i in t)
                    this[r].style[i] = t[i];
            return this
        }
    if (arguments.length === 2 && typeof t == "string") {
        for (r = 0; r < this.length; r += 1)
            this[r].style[t] = e;
        return this
    }
    return this
}
function Yye(t) {
    return t ? (this.forEach( (e, n) => {
        t.apply(e, [e, n])
    }
    ),
    this) : this
}
function Xye(t) {
    const e = f9(this, t);
    return Ie(e)
}
function Kye(t) {
    if (typeof t > "u")
        return this[0] ? this[0].innerHTML : null;
    for (let e = 0; e < this.length; e += 1)
        this[e].innerHTML = t;
    return this
}
function qye(t) {
    if (typeof t > "u")
        return this[0] ? this[0].textContent.trim() : null;
    for (let e = 0; e < this.length; e += 1)
        this[e].textContent = t;
    return this
}
function Zye(t) {
    const e = kn()
      , n = Qn()
      , r = this[0];
    let i, o;
    if (!r || typeof t > "u")
        return !1;
    if (typeof t == "string") {
        if (r.matches)
            return r.matches(t);
        if (r.webkitMatchesSelector)
            return r.webkitMatchesSelector(t);
        if (r.msMatchesSelector)
            return r.msMatchesSelector(t);
        for (i = Ie(t),
        o = 0; o < i.length; o += 1)
            if (i[o] === r)
                return !0;
        return !1
    }
    if (t === n)
        return r === n;
    if (t === e)
        return r === e;
    if (t.nodeType || t instanceof Ls) {
        for (i = t.nodeType ? [t] : t,
        o = 0; o < i.length; o += 1)
            if (i[o] === r)
                return !0;
        return !1
    }
    return !1
}
function Jye() {
    let t = this[0], e;
    if (t) {
        for (e = 0; (t = t.previousSibling) !== null; )
            t.nodeType === 1 && (e += 1);
        return e
    }
}
function Qye(t) {
    if (typeof t > "u")
        return this;
    const e = this.length;
    if (t > e - 1)
        return Ie([]);
    if (t < 0) {
        const n = e + t;
        return n < 0 ? Ie([]) : Ie([this[n]])
    }
    return Ie([this[t]])
}
function e_e(...t) {
    let e;
    const n = Qn();
    for (let r = 0; r < t.length; r += 1) {
        e = t[r];
        for (let i = 0; i < this.length; i += 1)
            if (typeof e == "string") {
                const o = n.createElement("div");
                for (o.innerHTML = e; o.firstChild; )
                    this[i].appendChild(o.firstChild)
            } else if (e instanceof Ls)
                for (let o = 0; o < e.length; o += 1)
                    this[i].appendChild(e[o]);
            else
                this[i].appendChild(e)
    }
    return this
}
function t_e(t) {
    const e = Qn();
    let n, r;
    for (n = 0; n < this.length; n += 1)
        if (typeof t == "string") {
            const i = e.createElement("div");
            for (i.innerHTML = t,
            r = i.childNodes.length - 1; r >= 0; r -= 1)
                this[n].insertBefore(i.childNodes[r], this[n].childNodes[0])
        } else if (t instanceof Ls)
            for (r = 0; r < t.length; r += 1)
                this[n].insertBefore(t[r], this[n].childNodes[0]);
        else
            this[n].insertBefore(t, this[n].childNodes[0]);
    return this
}
function n_e(t) {
    return this.length > 0 ? t ? this[0].nextElementSibling && Ie(this[0].nextElementSibling).is(t) ? Ie([this[0].nextElementSibling]) : Ie([]) : this[0].nextElementSibling ? Ie([this[0].nextElementSibling]) : Ie([]) : Ie([])
}
function r_e(t) {
    const e = [];
    let n = this[0];
    if (!n)
        return Ie([]);
    for (; n.nextElementSibling; ) {
        const r = n.nextElementSibling;
        t ? Ie(r).is(t) && e.push(r) : e.push(r),
        n = r
    }
    return Ie(e)
}
function i_e(t) {
    if (this.length > 0) {
        const e = this[0];
        return t ? e.previousElementSibling && Ie(e.previousElementSibling).is(t) ? Ie([e.previousElementSibling]) : Ie([]) : e.previousElementSibling ? Ie([e.previousElementSibling]) : Ie([])
    }
    return Ie([])
}
function o_e(t) {
    const e = [];
    let n = this[0];
    if (!n)
        return Ie([]);
    for (; n.previousElementSibling; ) {
        const r = n.previousElementSibling;
        t ? Ie(r).is(t) && e.push(r) : e.push(r),
        n = r
    }
    return Ie(e)
}
function s_e(t) {
    const e = [];
    for (let n = 0; n < this.length; n += 1)
        this[n].parentNode !== null && (t ? Ie(this[n].parentNode).is(t) && e.push(this[n].parentNode) : e.push(this[n].parentNode));
    return Ie(e)
}
function a_e(t) {
    const e = [];
    for (let n = 0; n < this.length; n += 1) {
        let r = this[n].parentNode;
        for (; r; )
            t ? Ie(r).is(t) && e.push(r) : e.push(r),
            r = r.parentNode
    }
    return Ie(e)
}
function l_e(t) {
    let e = this;
    return typeof t > "u" ? Ie([]) : (e.is(t) || (e = e.parents(t).eq(0)),
    e)
}
function c_e(t) {
    const e = [];
    for (let n = 0; n < this.length; n += 1) {
        const r = this[n].querySelectorAll(t);
        for (let i = 0; i < r.length; i += 1)
            e.push(r[i])
    }
    return Ie(e)
}
function u_e(t) {
    const e = [];
    for (let n = 0; n < this.length; n += 1) {
        const r = this[n].children;
        for (let i = 0; i < r.length; i += 1)
            (!t || Ie(r[i]).is(t)) && e.push(r[i])
    }
    return Ie(e)
}
function f_e() {
    for (let t = 0; t < this.length; t += 1)
        this[t].parentNode && this[t].parentNode.removeChild(this[t]);
    return this
}
const dP = {
    addClass: Oye,
    removeClass: Rye,
    hasClass: Dye,
    toggleClass: Mye,
    attr: Bye,
    removeAttr: kye,
    transform: Nye,
    transition: Fye,
    on: Lye,
    off: $ye,
    trigger: Uye,
    transitionEnd: Gye,
    outerWidth: Hye,
    outerHeight: Vye,
    styles: jye,
    offset: zye,
    css: Wye,
    each: Yye,
    html: Kye,
    text: qye,
    is: Zye,
    index: Jye,
    eq: Qye,
    append: e_e,
    prepend: t_e,
    next: n_e,
    nextAll: r_e,
    prev: i_e,
    prevAll: o_e,
    parent: s_e,
    parents: a_e,
    closest: l_e,
    find: c_e,
    children: u_e,
    filter: Xye,
    remove: f_e
};
Object.keys(dP).forEach(t => {
    Object.defineProperty(Ie.fn, t, {
        value: dP[t],
        writable: !0
    })
}
);
function d_e(t) {
    const e = t;
    Object.keys(e).forEach(n => {
        try {
            e[n] = null
        } catch {}
        try {
            delete e[n]
        } catch {}
    }
    )
}
function F0(t, e=0) {
    return setTimeout(t, e)
}
function Ed() {
    return Date.now()
}
function h_e(t) {
    const e = kn();
    let n;
    return e.getComputedStyle && (n = e.getComputedStyle(t, null)),
    !n && t.currentStyle && (n = t.currentStyle),
    n || (n = t.style),
    n
}
function p_e(t, e="x") {
    const n = kn();
    let r, i, o;
    const s = h_e(t);
    return n.WebKitCSSMatrix ? (i = s.transform || s.webkitTransform,
    i.split(",").length > 6 && (i = i.split(", ").map(a => a.replace(",", ".")).join(", ")),
    o = new n.WebKitCSSMatrix(i === "none" ? "" : i)) : (o = s.MozTransform || s.OTransform || s.MsTransform || s.msTransform || s.transform || s.getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,"),
    r = o.toString().split(",")),
    e === "x" && (n.WebKitCSSMatrix ? i = o.m41 : r.length === 16 ? i = parseFloat(r[12]) : i = parseFloat(r[4])),
    e === "y" && (n.WebKitCSSMatrix ? i = o.m42 : r.length === 16 ? i = parseFloat(r[13]) : i = parseFloat(r[5])),
    i || 0
}
function pp(t) {
    return typeof t == "object" && t !== null && t.constructor && Object.prototype.toString.call(t).slice(8, -1) === "Object"
}
function g_e(t) {
    return typeof window < "u" && typeof window.HTMLElement < "u" ? t instanceof HTMLElement : t && (t.nodeType === 1 || t.nodeType === 11)
}
function $r(...t) {
    const e = Object(t[0])
      , n = ["__proto__", "constructor", "prototype"];
    for (let r = 1; r < t.length; r += 1) {
        const i = t[r];
        if (i != null && !g_e(i)) {
            const o = Object.keys(Object(i)).filter(s => n.indexOf(s) < 0);
            for (let s = 0, a = o.length; s < a; s += 1) {
                const l = o[s]
                  , c = Object.getOwnPropertyDescriptor(i, l);
                c !== void 0 && c.enumerable && (pp(e[l]) && pp(i[l]) ? i[l].__swiper__ ? e[l] = i[l] : $r(e[l], i[l]) : !pp(e[l]) && pp(i[l]) ? (e[l] = {},
                i[l].__swiper__ ? e[l] = i[l] : $r(e[l], i[l])) : e[l] = i[l])
            }
        }
    }
    return e
}
function gp(t, e, n) {
    t.style.setProperty(e, n)
}
function d9({swiper: t, targetPosition: e, side: n}) {
    const r = kn()
      , i = -t.translate;
    let o = null, s;
    const a = t.params.speed;
    t.wrapperEl.style.scrollSnapType = "none",
    r.cancelAnimationFrame(t.cssModeFrameID);
    const l = e > i ? "next" : "prev"
      , c = (f, d) => l === "next" && f >= d || l === "prev" && f <= d
      , u = () => {
        s = new Date().getTime(),
        o === null && (o = s);
        const f = Math.max(Math.min((s - o) / a, 1), 0)
          , d = .5 - Math.cos(f * Math.PI) / 2;
        let h = i + d * (e - i);
        if (c(h, e) && (h = e),
        t.wrapperEl.scrollTo({
            [n]: h
        }),
        c(h, e)) {
            t.wrapperEl.style.overflow = "hidden",
            t.wrapperEl.style.scrollSnapType = "",
            setTimeout( () => {
                t.wrapperEl.style.overflow = "",
                t.wrapperEl.scrollTo({
                    [n]: h
                })
            }
            ),
            r.cancelAnimationFrame(t.cssModeFrameID);
            return
        }
        t.cssModeFrameID = r.requestAnimationFrame(u)
    }
    ;
    u()
}
let yv;
function m_e() {
    const t = kn()
      , e = Qn();
    return {
        smoothScroll: e.documentElement && "scrollBehavior"in e.documentElement.style,
        touch: !!("ontouchstart"in t || t.DocumentTouch && e instanceof t.DocumentTouch),
        passiveListener: function() {
            let r = !1;
            try {
                const i = Object.defineProperty({}, "passive", {
                    get() {
                        r = !0
                    }
                });
                t.addEventListener("testPassiveListener", null, i)
            } catch {}
            return r
        }(),
        gestures: function() {
            return "ongesturestart"in t
        }()
    }
}
function h9() {
    return yv || (yv = m_e()),
    yv
}
let _v;
function v_e({userAgent: t}={}) {
    const e = h9()
      , n = kn()
      , r = n.navigator.platform
      , i = t || n.navigator.userAgent
      , o = {
        ios: !1,
        android: !1
    }
      , s = n.screen.width
      , a = n.screen.height
      , l = i.match(/(Android);?[\s\/]+([\d.]+)?/);
    let c = i.match(/(iPad).*OS\s([\d_]+)/);
    const u = i.match(/(iPod)(.*OS\s([\d_]+))?/)
      , f = !c && i.match(/(iPhone\sOS|iOS)\s([\d_]+)/)
      , d = r === "Win32";
    let h = r === "MacIntel";
    const p = ["1024x1366", "1366x1024", "834x1194", "1194x834", "834x1112", "1112x834", "768x1024", "1024x768", "820x1180", "1180x820", "810x1080", "1080x810"];
    return !c && h && e.touch && p.indexOf(`${s}x${a}`) >= 0 && (c = i.match(/(Version)\/([\d.]+)/),
    c || (c = [0, 1, "13_0_0"]),
    h = !1),
    l && !d && (o.os = "android",
    o.android = !0),
    (c || f || u) && (o.os = "ios",
    o.ios = !0),
    o
}
function y_e(t={}) {
    return _v || (_v = v_e(t)),
    _v
}
let xv;
function __e() {
    const t = kn();
    function e() {
        const n = t.navigator.userAgent.toLowerCase();
        return n.indexOf("safari") >= 0 && n.indexOf("chrome") < 0 && n.indexOf("android") < 0
    }
    return {
        isSafari: e(),
        isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(t.navigator.userAgent)
    }
}
function x_e() {
    return xv || (xv = __e()),
    xv
}
function b_e({swiper: t, on: e, emit: n}) {
    const r = kn();
    let i = null
      , o = null;
    const s = () => {
        !t || t.destroyed || !t.initialized || (n("beforeResize"),
        n("resize"))
    }
      , a = () => {
        !t || t.destroyed || !t.initialized || (i = new ResizeObserver(u => {
            o = r.requestAnimationFrame( () => {
                const {width: f, height: d} = t;
                let h = f
                  , p = d;
                u.forEach( ({contentBoxSize: y, contentRect: v, target: g}) => {
                    g && g !== t.el || (h = v ? v.width : (y[0] || y).inlineSize,
                    p = v ? v.height : (y[0] || y).blockSize)
                }
                ),
                (h !== f || p !== d) && s()
            }
            )
        }
        ),
        i.observe(t.el))
    }
      , l = () => {
        o && r.cancelAnimationFrame(o),
        i && i.unobserve && t.el && (i.unobserve(t.el),
        i = null)
    }
      , c = () => {
        !t || t.destroyed || !t.initialized || n("orientationchange")
    }
    ;
    e("init", () => {
        if (t.params.resizeObserver && typeof r.ResizeObserver < "u") {
            a();
            return
        }
        r.addEventListener("resize", s),
        r.addEventListener("orientationchange", c)
    }
    ),
    e("destroy", () => {
        l(),
        r.removeEventListener("resize", s),
        r.removeEventListener("orientationchange", c)
    }
    )
}
function w_e({swiper: t, extendParams: e, on: n, emit: r}) {
    const i = []
      , o = kn()
      , s = (c, u={}) => {
        const f = o.MutationObserver || o.WebkitMutationObserver
          , d = new f(h => {
            if (h.length === 1) {
                r("observerUpdate", h[0]);
                return
            }
            const p = function() {
                r("observerUpdate", h[0])
            };
            o.requestAnimationFrame ? o.requestAnimationFrame(p) : o.setTimeout(p, 0)
        }
        );
        d.observe(c, {
            attributes: typeof u.attributes > "u" ? !0 : u.attributes,
            childList: typeof u.childList > "u" ? !0 : u.childList,
            characterData: typeof u.characterData > "u" ? !0 : u.characterData
        }),
        i.push(d)
    }
      , a = () => {
        if (t.params.observer) {
            if (t.params.observeParents) {
                const c = t.$el.parents();
                for (let u = 0; u < c.length; u += 1)
                    s(c[u])
            }
            s(t.$el[0], {
                childList: t.params.observeSlideChildren
            }),
            s(t.$wrapperEl[0], {
                attributes: !1
            })
        }
    }
      , l = () => {
        i.forEach(c => {
            c.disconnect()
        }
        ),
        i.splice(0, i.length)
    }
    ;
    e({
        observer: !1,
        observeParents: !1,
        observeSlideChildren: !1
    }),
    n("init", a),
    n("destroy", l)
}
const E_e = {
    on(t, e, n) {
        const r = this;
        if (!r.eventsListeners || r.destroyed || typeof e != "function")
            return r;
        const i = n ? "unshift" : "push";
        return t.split(" ").forEach(o => {
            r.eventsListeners[o] || (r.eventsListeners[o] = []),
            r.eventsListeners[o][i](e)
        }
        ),
        r
    },
    once(t, e, n) {
        const r = this;
        if (!r.eventsListeners || r.destroyed || typeof e != "function")
            return r;
        function i(...o) {
            r.off(t, i),
            i.__emitterProxy && delete i.__emitterProxy,
            e.apply(r, o)
        }
        return i.__emitterProxy = e,
        r.on(t, i, n)
    },
    onAny(t, e) {
        const n = this;
        if (!n.eventsListeners || n.destroyed || typeof t != "function")
            return n;
        const r = e ? "unshift" : "push";
        return n.eventsAnyListeners.indexOf(t) < 0 && n.eventsAnyListeners[r](t),
        n
    },
    offAny(t) {
        const e = this;
        if (!e.eventsListeners || e.destroyed || !e.eventsAnyListeners)
            return e;
        const n = e.eventsAnyListeners.indexOf(t);
        return n >= 0 && e.eventsAnyListeners.splice(n, 1),
        e
    },
    off(t, e) {
        const n = this;
        return !n.eventsListeners || n.destroyed || !n.eventsListeners || t.split(" ").forEach(r => {
            typeof e > "u" ? n.eventsListeners[r] = [] : n.eventsListeners[r] && n.eventsListeners[r].forEach( (i, o) => {
                (i === e || i.__emitterProxy && i.__emitterProxy === e) && n.eventsListeners[r].splice(o, 1)
            }
            )
        }
        ),
        n
    },
    emit(...t) {
        const e = this;
        if (!e.eventsListeners || e.destroyed || !e.eventsListeners)
            return e;
        let n, r, i;
        return typeof t[0] == "string" || Array.isArray(t[0]) ? (n = t[0],
        r = t.slice(1, t.length),
        i = e) : (n = t[0].events,
        r = t[0].data,
        i = t[0].context || e),
        r.unshift(i),
        (Array.isArray(n) ? n : n.split(" ")).forEach(s => {
            e.eventsAnyListeners && e.eventsAnyListeners.length && e.eventsAnyListeners.forEach(a => {
                a.apply(i, [s, ...r])
            }
            ),
            e.eventsListeners && e.eventsListeners[s] && e.eventsListeners[s].forEach(a => {
                a.apply(i, r)
            }
            )
        }
        ),
        e
    }
};
function S_e() {
    const t = this;
    let e, n;
    const r = t.$el;
    typeof t.params.width < "u" && t.params.width !== null ? e = t.params.width : e = r[0].clientWidth,
    typeof t.params.height < "u" && t.params.height !== null ? n = t.params.height : n = r[0].clientHeight,
    !(e === 0 && t.isHorizontal() || n === 0 && t.isVertical()) && (e = e - parseInt(r.css("padding-left") || 0, 10) - parseInt(r.css("padding-right") || 0, 10),
    n = n - parseInt(r.css("padding-top") || 0, 10) - parseInt(r.css("padding-bottom") || 0, 10),
    Number.isNaN(e) && (e = 0),
    Number.isNaN(n) && (n = 0),
    Object.assign(t, {
        width: e,
        height: n,
        size: t.isHorizontal() ? e : n
    }))
}
function C_e() {
    const t = this;
    function e(C) {
        return t.isHorizontal() ? C : {
            width: "height",
            "margin-top": "margin-left",
            "margin-bottom ": "margin-right",
            "margin-left": "margin-top",
            "margin-right": "margin-bottom",
            "padding-left": "padding-top",
            "padding-right": "padding-bottom",
            marginRight: "marginBottom"
        }[C]
    }
    function n(C, A) {
        return parseFloat(C.getPropertyValue(e(A)) || 0)
    }
    const r = t.params
      , {$wrapperEl: i, size: o, rtlTranslate: s, wrongRTL: a} = t
      , l = t.virtual && r.virtual.enabled
      , c = l ? t.virtual.slides.length : t.slides.length
      , u = i.children(`.${t.params.slideClass}`)
      , f = l ? t.virtual.slides.length : u.length;
    let d = [];
    const h = []
      , p = [];
    let y = r.slidesOffsetBefore;
    typeof y == "function" && (y = r.slidesOffsetBefore.call(t));
    let v = r.slidesOffsetAfter;
    typeof v == "function" && (v = r.slidesOffsetAfter.call(t));
    const g = t.snapGrid.length
      , m = t.slidesGrid.length;
    let _ = r.spaceBetween
      , x = -y
      , b = 0
      , w = 0;
    if (typeof o > "u")
        return;
    typeof _ == "string" && _.indexOf("%") >= 0 && (_ = parseFloat(_.replace("%", "")) / 100 * o),
    t.virtualSize = -_,
    s ? u.css({
        marginLeft: "",
        marginBottom: "",
        marginTop: ""
    }) : u.css({
        marginRight: "",
        marginBottom: "",
        marginTop: ""
    }),
    r.centeredSlides && r.cssMode && (gp(t.wrapperEl, "--swiper-centered-offset-before", ""),
    gp(t.wrapperEl, "--swiper-centered-offset-after", ""));
    const E = r.grid && r.grid.rows > 1 && t.grid;
    E && t.grid.initSlides(f);
    let S;
    const P = r.slidesPerView === "auto" && r.breakpoints && Object.keys(r.breakpoints).filter(C => typeof r.breakpoints[C].slidesPerView < "u").length > 0;
    for (let C = 0; C < f; C += 1) {
        S = 0;
        const A = u.eq(C);
        if (E && t.grid.updateSlide(C, A, f, e),
        A.css("display") !== "none") {
            if (r.slidesPerView === "auto") {
                P && (u[C].style[e("width")] = "");
                const T = getComputedStyle(A[0])
                  , I = A[0].style.transform
                  , B = A[0].style.webkitTransform;
                if (I && (A[0].style.transform = "none"),
                B && (A[0].style.webkitTransform = "none"),
                r.roundLengths)
                    S = t.isHorizontal() ? A.outerWidth(!0) : A.outerHeight(!0);
                else {
                    const G = n(T, "width")
                      , N = n(T, "padding-left")
                      , U = n(T, "padding-right")
                      , W = n(T, "margin-left")
                      , K = n(T, "margin-right")
                      , fe = T.getPropertyValue("box-sizing");
                    if (fe && fe === "border-box")
                        S = G + W + K;
                    else {
                        const {clientWidth: ue, offsetWidth: X} = A[0];
                        S = G + N + U + W + K + (X - ue)
                    }
                }
                I && (A[0].style.transform = I),
                B && (A[0].style.webkitTransform = B),
                r.roundLengths && (S = Math.floor(S))
            } else
                S = (o - (r.slidesPerView - 1) * _) / r.slidesPerView,
                r.roundLengths && (S = Math.floor(S)),
                u[C] && (u[C].style[e("width")] = `${S}px`);
            u[C] && (u[C].swiperSlideSize = S),
            p.push(S),
            r.centeredSlides ? (x = x + S / 2 + b / 2 + _,
            b === 0 && C !== 0 && (x = x - o / 2 - _),
            C === 0 && (x = x - o / 2 - _),
            Math.abs(x) < 1 / 1e3 && (x = 0),
            r.roundLengths && (x = Math.floor(x)),
            w % r.slidesPerGroup === 0 && d.push(x),
            h.push(x)) : (r.roundLengths && (x = Math.floor(x)),
            (w - Math.min(t.params.slidesPerGroupSkip, w)) % t.params.slidesPerGroup === 0 && d.push(x),
            h.push(x),
            x = x + S + _),
            t.virtualSize += S + _,
            b = S,
            w += 1
        }
    }
    if (t.virtualSize = Math.max(t.virtualSize, o) + v,
    s && a && (r.effect === "slide" || r.effect === "coverflow") && i.css({
        width: `${t.virtualSize + r.spaceBetween}px`
    }),
    r.setWrapperSize && i.css({
        [e("width")]: `${t.virtualSize + r.spaceBetween}px`
    }),
    E && t.grid.updateWrapperSize(S, d, e),
    !r.centeredSlides) {
        const C = [];
        for (let A = 0; A < d.length; A += 1) {
            let T = d[A];
            r.roundLengths && (T = Math.floor(T)),
            d[A] <= t.virtualSize - o && C.push(T)
        }
        d = C,
        Math.floor(t.virtualSize - o) - Math.floor(d[d.length - 1]) > 1 && d.push(t.virtualSize - o)
    }
    if (d.length === 0 && (d = [0]),
    r.spaceBetween !== 0) {
        const C = t.isHorizontal() && s ? "marginLeft" : e("marginRight");
        u.filter( (A, T) => r.cssMode ? T !== u.length - 1 : !0).css({
            [C]: `${_}px`
        })
    }
    if (r.centeredSlides && r.centeredSlidesBounds) {
        let C = 0;
        p.forEach(T => {
            C += T + (r.spaceBetween ? r.spaceBetween : 0)
        }
        ),
        C -= r.spaceBetween;
        const A = C - o;
        d = d.map(T => T < 0 ? -y : T > A ? A + v : T)
    }
    if (r.centerInsufficientSlides) {
        let C = 0;
        if (p.forEach(A => {
            C += A + (r.spaceBetween ? r.spaceBetween : 0)
        }
        ),
        C -= r.spaceBetween,
        C < o) {
            const A = (o - C) / 2;
            d.forEach( (T, I) => {
                d[I] = T - A
            }
            ),
            h.forEach( (T, I) => {
                h[I] = T + A
            }
            )
        }
    }
    if (Object.assign(t, {
        slides: u,
        snapGrid: d,
        slidesGrid: h,
        slidesSizesGrid: p
    }),
    r.centeredSlides && r.cssMode && !r.centeredSlidesBounds) {
        gp(t.wrapperEl, "--swiper-centered-offset-before", `${-d[0]}px`),
        gp(t.wrapperEl, "--swiper-centered-offset-after", `${t.size / 2 - p[p.length - 1] / 2}px`);
        const C = -t.snapGrid[0]
          , A = -t.slidesGrid[0];
        t.snapGrid = t.snapGrid.map(T => T + C),
        t.slidesGrid = t.slidesGrid.map(T => T + A)
    }
    if (f !== c && t.emit("slidesLengthChange"),
    d.length !== g && (t.params.watchOverflow && t.checkOverflow(),
    t.emit("snapGridLengthChange")),
    h.length !== m && t.emit("slidesGridLengthChange"),
    r.watchSlidesProgress && t.updateSlidesOffset(),
    !l && !r.cssMode && (r.effect === "slide" || r.effect === "fade")) {
        const C = `${r.containerModifierClass}backface-hidden`
          , A = t.$el.hasClass(C);
        f <= r.maxBackfaceHiddenSlides ? A || t.$el.addClass(C) : A && t.$el.removeClass(C)
    }
}
function A_e(t) {
    const e = this
      , n = []
      , r = e.virtual && e.params.virtual.enabled;
    let i = 0, o;
    typeof t == "number" ? e.setTransition(t) : t === !0 && e.setTransition(e.params.speed);
    const s = a => r ? e.slides.filter(l => parseInt(l.getAttribute("data-swiper-slide-index"), 10) === a)[0] : e.slides.eq(a)[0];
    if (e.params.slidesPerView !== "auto" && e.params.slidesPerView > 1)
        if (e.params.centeredSlides)
            (e.visibleSlides || Ie([])).each(a => {
                n.push(a)
            }
            );
        else
            for (o = 0; o < Math.ceil(e.params.slidesPerView); o += 1) {
                const a = e.activeIndex + o;
                if (a > e.slides.length && !r)
                    break;
                n.push(s(a))
            }
    else
        n.push(s(e.activeIndex));
    for (o = 0; o < n.length; o += 1)
        if (typeof n[o] < "u") {
            const a = n[o].offsetHeight;
            i = a > i ? a : i
        }
    (i || i === 0) && e.$wrapperEl.css("height", `${i}px`)
}
function T_e() {
    const t = this
      , e = t.slides;
    for (let n = 0; n < e.length; n += 1)
        e[n].swiperSlideOffset = t.isHorizontal() ? e[n].offsetLeft : e[n].offsetTop
}
function P_e(t=this && this.translate || 0) {
    const e = this
      , n = e.params
      , {slides: r, rtlTranslate: i, snapGrid: o} = e;
    if (r.length === 0)
        return;
    typeof r[0].swiperSlideOffset > "u" && e.updateSlidesOffset();
    let s = -t;
    i && (s = t),
    r.removeClass(n.slideVisibleClass),
    e.visibleSlidesIndexes = [],
    e.visibleSlides = [];
    for (let a = 0; a < r.length; a += 1) {
        const l = r[a];
        let c = l.swiperSlideOffset;
        n.cssMode && n.centeredSlides && (c -= r[0].swiperSlideOffset);
        const u = (s + (n.centeredSlides ? e.minTranslate() : 0) - c) / (l.swiperSlideSize + n.spaceBetween)
          , f = (s - o[0] + (n.centeredSlides ? e.minTranslate() : 0) - c) / (l.swiperSlideSize + n.spaceBetween)
          , d = -(s - c)
          , h = d + e.slidesSizesGrid[a];
        (d >= 0 && d < e.size - 1 || h > 1 && h <= e.size || d <= 0 && h >= e.size) && (e.visibleSlides.push(l),
        e.visibleSlidesIndexes.push(a),
        r.eq(a).addClass(n.slideVisibleClass)),
        l.progress = i ? -u : u,
        l.originalProgress = i ? -f : f
    }
    e.visibleSlides = Ie(e.visibleSlides)
}
function I_e(t) {
    const e = this;
    if (typeof t > "u") {
        const c = e.rtlTranslate ? -1 : 1;
        t = e && e.translate && e.translate * c || 0
    }
    const n = e.params
      , r = e.maxTranslate() - e.minTranslate();
    let {progress: i, isBeginning: o, isEnd: s} = e;
    const a = o
      , l = s;
    r === 0 ? (i = 0,
    o = !0,
    s = !0) : (i = (t - e.minTranslate()) / r,
    o = i <= 0,
    s = i >= 1),
    Object.assign(e, {
        progress: i,
        isBeginning: o,
        isEnd: s
    }),
    (n.watchSlidesProgress || n.centeredSlides && n.autoHeight) && e.updateSlidesProgress(t),
    o && !a && e.emit("reachBeginning toEdge"),
    s && !l && e.emit("reachEnd toEdge"),
    (a && !o || l && !s) && e.emit("fromEdge"),
    e.emit("progress", i)
}
function O_e() {
    const t = this
      , {slides: e, params: n, $wrapperEl: r, activeIndex: i, realIndex: o} = t
      , s = t.virtual && n.virtual.enabled;
    e.removeClass(`${n.slideActiveClass} ${n.slideNextClass} ${n.slidePrevClass} ${n.slideDuplicateActiveClass} ${n.slideDuplicateNextClass} ${n.slideDuplicatePrevClass}`);
    let a;
    s ? a = t.$wrapperEl.find(`.${n.slideClass}[data-swiper-slide-index="${i}"]`) : a = e.eq(i),
    a.addClass(n.slideActiveClass),
    n.loop && (a.hasClass(n.slideDuplicateClass) ? r.children(`.${n.slideClass}:not(.${n.slideDuplicateClass})[data-swiper-slide-index="${o}"]`).addClass(n.slideDuplicateActiveClass) : r.children(`.${n.slideClass}.${n.slideDuplicateClass}[data-swiper-slide-index="${o}"]`).addClass(n.slideDuplicateActiveClass));
    let l = a.nextAll(`.${n.slideClass}`).eq(0).addClass(n.slideNextClass);
    n.loop && l.length === 0 && (l = e.eq(0),
    l.addClass(n.slideNextClass));
    let c = a.prevAll(`.${n.slideClass}`).eq(0).addClass(n.slidePrevClass);
    n.loop && c.length === 0 && (c = e.eq(-1),
    c.addClass(n.slidePrevClass)),
    n.loop && (l.hasClass(n.slideDuplicateClass) ? r.children(`.${n.slideClass}:not(.${n.slideDuplicateClass})[data-swiper-slide-index="${l.attr("data-swiper-slide-index")}"]`).addClass(n.slideDuplicateNextClass) : r.children(`.${n.slideClass}.${n.slideDuplicateClass}[data-swiper-slide-index="${l.attr("data-swiper-slide-index")}"]`).addClass(n.slideDuplicateNextClass),
    c.hasClass(n.slideDuplicateClass) ? r.children(`.${n.slideClass}:not(.${n.slideDuplicateClass})[data-swiper-slide-index="${c.attr("data-swiper-slide-index")}"]`).addClass(n.slideDuplicatePrevClass) : r.children(`.${n.slideClass}.${n.slideDuplicateClass}[data-swiper-slide-index="${c.attr("data-swiper-slide-index")}"]`).addClass(n.slideDuplicatePrevClass)),
    t.emitSlidesClasses()
}
function R_e(t) {
    const e = this
      , n = e.rtlTranslate ? e.translate : -e.translate
      , {slidesGrid: r, snapGrid: i, params: o, activeIndex: s, realIndex: a, snapIndex: l} = e;
    let c = t, u;
    if (typeof c > "u") {
        for (let d = 0; d < r.length; d += 1)
            typeof r[d + 1] < "u" ? n >= r[d] && n < r[d + 1] - (r[d + 1] - r[d]) / 2 ? c = d : n >= r[d] && n < r[d + 1] && (c = d + 1) : n >= r[d] && (c = d);
        o.normalizeSlideIndex && (c < 0 || typeof c > "u") && (c = 0)
    }
    if (i.indexOf(n) >= 0)
        u = i.indexOf(n);
    else {
        const d = Math.min(o.slidesPerGroupSkip, c);
        u = d + Math.floor((c - d) / o.slidesPerGroup)
    }
    if (u >= i.length && (u = i.length - 1),
    c === s) {
        u !== l && (e.snapIndex = u,
        e.emit("snapIndexChange"));
        return
    }
    const f = parseInt(e.slides.eq(c).attr("data-swiper-slide-index") || c, 10);
    Object.assign(e, {
        snapIndex: u,
        realIndex: f,
        previousIndex: s,
        activeIndex: c
    }),
    e.emit("activeIndexChange"),
    e.emit("snapIndexChange"),
    a !== f && e.emit("realIndexChange"),
    (e.initialized || e.params.runCallbacksOnInit) && e.emit("slideChange")
}
function M_e(t) {
    const e = this
      , n = e.params
      , r = Ie(t).closest(`.${n.slideClass}`)[0];
    let i = !1, o;
    if (r) {
        for (let s = 0; s < e.slides.length; s += 1)
            if (e.slides[s] === r) {
                i = !0,
                o = s;
                break
            }
    }
    if (r && i)
        e.clickedSlide = r,
        e.virtual && e.params.virtual.enabled ? e.clickedIndex = parseInt(Ie(r).attr("data-swiper-slide-index"), 10) : e.clickedIndex = o;
    else {
        e.clickedSlide = void 0,
        e.clickedIndex = void 0;
        return
    }
    n.slideToClickedSlide && e.clickedIndex !== void 0 && e.clickedIndex !== e.activeIndex && e.slideToClickedSlide()
}
const D_e = {
    updateSize: S_e,
    updateSlides: C_e,
    updateAutoHeight: A_e,
    updateSlidesOffset: T_e,
    updateSlidesProgress: P_e,
    updateProgress: I_e,
    updateSlidesClasses: O_e,
    updateActiveIndex: R_e,
    updateClickedSlide: M_e
};
function B_e(t=this.isHorizontal() ? "x" : "y") {
    const e = this
      , {params: n, rtlTranslate: r, translate: i, $wrapperEl: o} = e;
    if (n.virtualTranslate)
        return r ? -i : i;
    if (n.cssMode)
        return i;
    let s = p_e(o[0], t);
    return r && (s = -s),
    s || 0
}
function k_e(t, e) {
    const n = this
      , {rtlTranslate: r, params: i, $wrapperEl: o, wrapperEl: s, progress: a} = n;
    let l = 0
      , c = 0;
    const u = 0;
    n.isHorizontal() ? l = r ? -t : t : c = t,
    i.roundLengths && (l = Math.floor(l),
    c = Math.floor(c)),
    i.cssMode ? s[n.isHorizontal() ? "scrollLeft" : "scrollTop"] = n.isHorizontal() ? -l : -c : i.virtualTranslate || o.transform(`translate3d(${l}px, ${c}px, ${u}px)`),
    n.previousTranslate = n.translate,
    n.translate = n.isHorizontal() ? l : c;
    let f;
    const d = n.maxTranslate() - n.minTranslate();
    d === 0 ? f = 0 : f = (t - n.minTranslate()) / d,
    f !== a && n.updateProgress(t),
    n.emit("setTranslate", n.translate, e)
}
function N_e() {
    return -this.snapGrid[0]
}
function F_e() {
    return -this.snapGrid[this.snapGrid.length - 1]
}
function L_e(t=0, e=this.params.speed, n=!0, r=!0, i) {
    const o = this
      , {params: s, wrapperEl: a} = o;
    if (o.animating && s.preventInteractionOnTransition)
        return !1;
    const l = o.minTranslate()
      , c = o.maxTranslate();
    let u;
    if (r && t > l ? u = l : r && t < c ? u = c : u = t,
    o.updateProgress(u),
    s.cssMode) {
        const f = o.isHorizontal();
        if (e === 0)
            a[f ? "scrollLeft" : "scrollTop"] = -u;
        else {
            if (!o.support.smoothScroll)
                return d9({
                    swiper: o,
                    targetPosition: -u,
                    side: f ? "left" : "top"
                }),
                !0;
            a.scrollTo({
                [f ? "left" : "top"]: -u,
                behavior: "smooth"
            })
        }
        return !0
    }
    return e === 0 ? (o.setTransition(0),
    o.setTranslate(u),
    n && (o.emit("beforeTransitionStart", e, i),
    o.emit("transitionEnd"))) : (o.setTransition(e),
    o.setTranslate(u),
    n && (o.emit("beforeTransitionStart", e, i),
    o.emit("transitionStart")),
    o.animating || (o.animating = !0,
    o.onTranslateToWrapperTransitionEnd || (o.onTranslateToWrapperTransitionEnd = function(d) {
        !o || o.destroyed || d.target === this && (o.$wrapperEl[0].removeEventListener("transitionend", o.onTranslateToWrapperTransitionEnd),
        o.$wrapperEl[0].removeEventListener("webkitTransitionEnd", o.onTranslateToWrapperTransitionEnd),
        o.onTranslateToWrapperTransitionEnd = null,
        delete o.onTranslateToWrapperTransitionEnd,
        n && o.emit("transitionEnd"))
    }
    ),
    o.$wrapperEl[0].addEventListener("transitionend", o.onTranslateToWrapperTransitionEnd),
    o.$wrapperEl[0].addEventListener("webkitTransitionEnd", o.onTranslateToWrapperTransitionEnd))),
    !0
}
const $_e = {
    getTranslate: B_e,
    setTranslate: k_e,
    minTranslate: N_e,
    maxTranslate: F_e,
    translateTo: L_e
};
function U_e(t, e) {
    const n = this;
    n.params.cssMode || n.$wrapperEl.transition(t),
    n.emit("setTransition", t, e)
}
function p9({swiper: t, runCallbacks: e, direction: n, step: r}) {
    const {activeIndex: i, previousIndex: o} = t;
    let s = n;
    if (s || (i > o ? s = "next" : i < o ? s = "prev" : s = "reset"),
    t.emit(`transition${r}`),
    e && i !== o) {
        if (s === "reset") {
            t.emit(`slideResetTransition${r}`);
            return
        }
        t.emit(`slideChangeTransition${r}`),
        s === "next" ? t.emit(`slideNextTransition${r}`) : t.emit(`slidePrevTransition${r}`)
    }
}
function G_e(t=!0, e) {
    const n = this
      , {params: r} = n;
    r.cssMode || (r.autoHeight && n.updateAutoHeight(),
    p9({
        swiper: n,
        runCallbacks: t,
        direction: e,
        step: "Start"
    }))
}
function H_e(t=!0, e) {
    const n = this
      , {params: r} = n;
    n.animating = !1,
    !r.cssMode && (n.setTransition(0),
    p9({
        swiper: n,
        runCallbacks: t,
        direction: e,
        step: "End"
    }))
}
const V_e = {
    setTransition: U_e,
    transitionStart: G_e,
    transitionEnd: H_e
};
function z_e(t=0, e=this.params.speed, n=!0, r, i) {
    if (typeof t != "number" && typeof t != "string")
        throw new Error(`The 'index' argument cannot have type other than 'number' or 'string'. [${typeof t}] given.`);
    if (typeof t == "string") {
        const _ = parseInt(t, 10);
        if (!isFinite(_))
            throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${t}] given.`);
        t = _
    }
    const o = this;
    let s = t;
    s < 0 && (s = 0);
    const {params: a, snapGrid: l, slidesGrid: c, previousIndex: u, activeIndex: f, rtlTranslate: d, wrapperEl: h, enabled: p} = o;
    if (o.animating && a.preventInteractionOnTransition || !p && !r && !i)
        return !1;
    const y = Math.min(o.params.slidesPerGroupSkip, s);
    let v = y + Math.floor((s - y) / o.params.slidesPerGroup);
    v >= l.length && (v = l.length - 1);
    const g = -l[v];
    if (a.normalizeSlideIndex)
        for (let _ = 0; _ < c.length; _ += 1) {
            const x = -Math.floor(g * 100)
              , b = Math.floor(c[_] * 100)
              , w = Math.floor(c[_ + 1] * 100);
            typeof c[_ + 1] < "u" ? x >= b && x < w - (w - b) / 2 ? s = _ : x >= b && x < w && (s = _ + 1) : x >= b && (s = _)
        }
    if (o.initialized && s !== f && (!o.allowSlideNext && g < o.translate && g < o.minTranslate() || !o.allowSlidePrev && g > o.translate && g > o.maxTranslate() && (f || 0) !== s))
        return !1;
    s !== (u || 0) && n && o.emit("beforeSlideChangeStart"),
    o.updateProgress(g);
    let m;
    if (s > f ? m = "next" : s < f ? m = "prev" : m = "reset",
    d && -g === o.translate || !d && g === o.translate)
        return o.updateActiveIndex(s),
        a.autoHeight && o.updateAutoHeight(),
        o.updateSlidesClasses(),
        a.effect !== "slide" && o.setTranslate(g),
        m !== "reset" && (o.transitionStart(n, m),
        o.transitionEnd(n, m)),
        !1;
    if (a.cssMode) {
        const _ = o.isHorizontal()
          , x = d ? g : -g;
        if (e === 0) {
            const b = o.virtual && o.params.virtual.enabled;
            b && (o.wrapperEl.style.scrollSnapType = "none",
            o._immediateVirtual = !0),
            h[_ ? "scrollLeft" : "scrollTop"] = x,
            b && requestAnimationFrame( () => {
                o.wrapperEl.style.scrollSnapType = "",
                o._swiperImmediateVirtual = !1
            }
            )
        } else {
            if (!o.support.smoothScroll)
                return d9({
                    swiper: o,
                    targetPosition: x,
                    side: _ ? "left" : "top"
                }),
                !0;
            h.scrollTo({
                [_ ? "left" : "top"]: x,
                behavior: "smooth"
            })
        }
        return !0
    }
    return o.setTransition(e),
    o.setTranslate(g),
    o.updateActiveIndex(s),
    o.updateSlidesClasses(),
    o.emit("beforeTransitionStart", e, r),
    o.transitionStart(n, m),
    e === 0 ? o.transitionEnd(n, m) : o.animating || (o.animating = !0,
    o.onSlideToWrapperTransitionEnd || (o.onSlideToWrapperTransitionEnd = function(x) {
        !o || o.destroyed || x.target === this && (o.$wrapperEl[0].removeEventListener("transitionend", o.onSlideToWrapperTransitionEnd),
        o.$wrapperEl[0].removeEventListener("webkitTransitionEnd", o.onSlideToWrapperTransitionEnd),
        o.onSlideToWrapperTransitionEnd = null,
        delete o.onSlideToWrapperTransitionEnd,
        o.transitionEnd(n, m))
    }
    ),
    o.$wrapperEl[0].addEventListener("transitionend", o.onSlideToWrapperTransitionEnd),
    o.$wrapperEl[0].addEventListener("webkitTransitionEnd", o.onSlideToWrapperTransitionEnd)),
    !0
}
function j_e(t=0, e=this.params.speed, n=!0, r) {
    if (typeof t == "string") {
        const s = parseInt(t, 10);
        if (!isFinite(s))
            throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${t}] given.`);
        t = s
    }
    const i = this;
    let o = t;
    return i.params.loop && (o += i.loopedSlides),
    i.slideTo(o, e, n, r)
}
function W_e(t=this.params.speed, e=!0, n) {
    const r = this
      , {animating: i, enabled: o, params: s} = r;
    if (!o)
        return r;
    let a = s.slidesPerGroup;
    s.slidesPerView === "auto" && s.slidesPerGroup === 1 && s.slidesPerGroupAuto && (a = Math.max(r.slidesPerViewDynamic("current", !0), 1));
    const l = r.activeIndex < s.slidesPerGroupSkip ? 1 : a;
    if (s.loop) {
        if (i && s.loopPreventsSlide)
            return !1;
        r.loopFix(),
        r._clientLeft = r.$wrapperEl[0].clientLeft
    }
    return s.rewind && r.isEnd ? r.slideTo(0, t, e, n) : r.slideTo(r.activeIndex + l, t, e, n)
}
function Y_e(t=this.params.speed, e=!0, n) {
    const r = this
      , {params: i, animating: o, snapGrid: s, slidesGrid: a, rtlTranslate: l, enabled: c} = r;
    if (!c)
        return r;
    if (i.loop) {
        if (o && i.loopPreventsSlide)
            return !1;
        r.loopFix(),
        r._clientLeft = r.$wrapperEl[0].clientLeft
    }
    const u = l ? r.translate : -r.translate;
    function f(v) {
        return v < 0 ? -Math.floor(Math.abs(v)) : Math.floor(v)
    }
    const d = f(u)
      , h = s.map(v => f(v));
    let p = s[h.indexOf(d) - 1];
    if (typeof p > "u" && i.cssMode) {
        let v;
        s.forEach( (g, m) => {
            d >= g && (v = m)
        }
        ),
        typeof v < "u" && (p = s[v > 0 ? v - 1 : v])
    }
    let y = 0;
    if (typeof p < "u" && (y = a.indexOf(p),
    y < 0 && (y = r.activeIndex - 1),
    i.slidesPerView === "auto" && i.slidesPerGroup === 1 && i.slidesPerGroupAuto && (y = y - r.slidesPerViewDynamic("previous", !0) + 1,
    y = Math.max(y, 0))),
    i.rewind && r.isBeginning) {
        const v = r.params.virtual && r.params.virtual.enabled && r.virtual ? r.virtual.slides.length - 1 : r.slides.length - 1;
        return r.slideTo(v, t, e, n)
    }
    return r.slideTo(y, t, e, n)
}
function X_e(t=this.params.speed, e=!0, n) {
    const r = this;
    return r.slideTo(r.activeIndex, t, e, n)
}
function K_e(t=this.params.speed, e=!0, n, r=.5) {
    const i = this;
    let o = i.activeIndex;
    const s = Math.min(i.params.slidesPerGroupSkip, o)
      , a = s + Math.floor((o - s) / i.params.slidesPerGroup)
      , l = i.rtlTranslate ? i.translate : -i.translate;
    if (l >= i.snapGrid[a]) {
        const c = i.snapGrid[a]
          , u = i.snapGrid[a + 1];
        l - c > (u - c) * r && (o += i.params.slidesPerGroup)
    } else {
        const c = i.snapGrid[a - 1]
          , u = i.snapGrid[a];
        l - c <= (u - c) * r && (o -= i.params.slidesPerGroup)
    }
    return o = Math.max(o, 0),
    o = Math.min(o, i.slidesGrid.length - 1),
    i.slideTo(o, t, e, n)
}
function q_e() {
    const t = this
      , {params: e, $wrapperEl: n} = t
      , r = e.slidesPerView === "auto" ? t.slidesPerViewDynamic() : e.slidesPerView;
    let i = t.clickedIndex, o;
    if (e.loop) {
        if (t.animating)
            return;
        o = parseInt(Ie(t.clickedSlide).attr("data-swiper-slide-index"), 10),
        e.centeredSlides ? i < t.loopedSlides - r / 2 || i > t.slides.length - t.loopedSlides + r / 2 ? (t.loopFix(),
        i = n.children(`.${e.slideClass}[data-swiper-slide-index="${o}"]:not(.${e.slideDuplicateClass})`).eq(0).index(),
        F0( () => {
            t.slideTo(i)
        }
        )) : t.slideTo(i) : i > t.slides.length - r ? (t.loopFix(),
        i = n.children(`.${e.slideClass}[data-swiper-slide-index="${o}"]:not(.${e.slideDuplicateClass})`).eq(0).index(),
        F0( () => {
            t.slideTo(i)
        }
        )) : t.slideTo(i)
    } else
        t.slideTo(i)
}
const Z_e = {
    slideTo: z_e,
    slideToLoop: j_e,
    slideNext: W_e,
    slidePrev: Y_e,
    slideReset: X_e,
    slideToClosest: K_e,
    slideToClickedSlide: q_e
};
function J_e() {
    const t = this
      , e = Qn()
      , {params: n, $wrapperEl: r} = t
      , i = r.children().length > 0 ? Ie(r.children()[0].parentNode) : r;
    i.children(`.${n.slideClass}.${n.slideDuplicateClass}`).remove();
    let o = i.children(`.${n.slideClass}`);
    if (n.loopFillGroupWithBlank) {
        const l = n.slidesPerGroup - o.length % n.slidesPerGroup;
        if (l !== n.slidesPerGroup) {
            for (let c = 0; c < l; c += 1) {
                const u = Ie(e.createElement("div")).addClass(`${n.slideClass} ${n.slideBlankClass}`);
                i.append(u)
            }
            o = i.children(`.${n.slideClass}`)
        }
    }
    n.slidesPerView === "auto" && !n.loopedSlides && (n.loopedSlides = o.length),
    t.loopedSlides = Math.ceil(parseFloat(n.loopedSlides || n.slidesPerView, 10)),
    t.loopedSlides += n.loopAdditionalSlides,
    t.loopedSlides > o.length && t.params.loopedSlidesLimit && (t.loopedSlides = o.length);
    const s = []
      , a = [];
    o.each( (l, c) => {
        Ie(l).attr("data-swiper-slide-index", c)
    }
    );
    for (let l = 0; l < t.loopedSlides; l += 1) {
        const c = l - Math.floor(l / o.length) * o.length;
        a.push(o.eq(c)[0]),
        s.unshift(o.eq(o.length - c - 1)[0])
    }
    for (let l = 0; l < a.length; l += 1)
        i.append(Ie(a[l].cloneNode(!0)).addClass(n.slideDuplicateClass));
    for (let l = s.length - 1; l >= 0; l -= 1)
        i.prepend(Ie(s[l].cloneNode(!0)).addClass(n.slideDuplicateClass))
}
function Q_e() {
    const t = this;
    t.emit("beforeLoopFix");
    const {activeIndex: e, slides: n, loopedSlides: r, allowSlidePrev: i, allowSlideNext: o, snapGrid: s, rtlTranslate: a} = t;
    let l;
    t.allowSlidePrev = !0,
    t.allowSlideNext = !0;
    const u = -s[e] - t.getTranslate();
    e < r ? (l = n.length - r * 3 + e,
    l += r,
    t.slideTo(l, 0, !1, !0) && u !== 0 && t.setTranslate((a ? -t.translate : t.translate) - u)) : e >= n.length - r && (l = -n.length + e + r,
    l += r,
    t.slideTo(l, 0, !1, !0) && u !== 0 && t.setTranslate((a ? -t.translate : t.translate) - u)),
    t.allowSlidePrev = i,
    t.allowSlideNext = o,
    t.emit("loopFix")
}
function exe() {
    const t = this
      , {$wrapperEl: e, params: n, slides: r} = t;
    e.children(`.${n.slideClass}.${n.slideDuplicateClass},.${n.slideClass}.${n.slideBlankClass}`).remove(),
    r.removeAttr("data-swiper-slide-index")
}
const txe = {
    loopCreate: J_e,
    loopFix: Q_e,
    loopDestroy: exe
};
function nxe(t) {
    const e = this;
    if (e.support.touch || !e.params.simulateTouch || e.params.watchOverflow && e.isLocked || e.params.cssMode)
        return;
    const n = e.params.touchEventsTarget === "container" ? e.el : e.wrapperEl;
    n.style.cursor = "move",
    n.style.cursor = t ? "grabbing" : "grab"
}
function rxe() {
    const t = this;
    t.support.touch || t.params.watchOverflow && t.isLocked || t.params.cssMode || (t[t.params.touchEventsTarget === "container" ? "el" : "wrapperEl"].style.cursor = "")
}
const ixe = {
    setGrabCursor: nxe,
    unsetGrabCursor: rxe
};
function oxe(t, e=this) {
    function n(r) {
        if (!r || r === Qn() || r === kn())
            return null;
        r.assignedSlot && (r = r.assignedSlot);
        const i = r.closest(t);
        return !i && !r.getRootNode ? null : i || n(r.getRootNode().host)
    }
    return n(e)
}
function sxe(t) {
    const e = this
      , n = Qn()
      , r = kn()
      , i = e.touchEventsData
      , {params: o, touches: s, enabled: a} = e;
    if (!a || e.animating && o.preventInteractionOnTransition)
        return;
    !e.animating && o.cssMode && o.loop && e.loopFix();
    let l = t;
    l.originalEvent && (l = l.originalEvent);
    let c = Ie(l.target);
    if (o.touchEventsTarget === "wrapper" && !c.closest(e.wrapperEl).length || (i.isTouchEvent = l.type === "touchstart",
    !i.isTouchEvent && "which"in l && l.which === 3) || !i.isTouchEvent && "button"in l && l.button > 0 || i.isTouched && i.isMoved)
        return;
    const u = !!o.noSwipingClass && o.noSwipingClass !== ""
      , f = t.composedPath ? t.composedPath() : t.path;
    u && l.target && l.target.shadowRoot && f && (c = Ie(f[0]));
    const d = o.noSwipingSelector ? o.noSwipingSelector : `.${o.noSwipingClass}`
      , h = !!(l.target && l.target.shadowRoot);
    if (o.noSwiping && (h ? oxe(d, c[0]) : c.closest(d)[0])) {
        e.allowClick = !0;
        return
    }
    if (o.swipeHandler && !c.closest(o.swipeHandler)[0])
        return;
    s.currentX = l.type === "touchstart" ? l.targetTouches[0].pageX : l.pageX,
    s.currentY = l.type === "touchstart" ? l.targetTouches[0].pageY : l.pageY;
    const p = s.currentX
      , y = s.currentY
      , v = o.edgeSwipeDetection || o.iOSEdgeSwipeDetection
      , g = o.edgeSwipeThreshold || o.iOSEdgeSwipeThreshold;
    if (v && (p <= g || p >= r.innerWidth - g))
        if (v === "prevent")
            t.preventDefault();
        else
            return;
    if (Object.assign(i, {
        isTouched: !0,
        isMoved: !1,
        allowTouchCallbacks: !0,
        isScrolling: void 0,
        startMoving: void 0
    }),
    s.startX = p,
    s.startY = y,
    i.touchStartTime = Ed(),
    e.allowClick = !0,
    e.updateSize(),
    e.swipeDirection = void 0,
    o.threshold > 0 && (i.allowThresholdMove = !1),
    l.type !== "touchstart") {
        let m = !0;
        c.is(i.focusableElements) && (m = !1,
        c[0].nodeName === "SELECT" && (i.isTouched = !1)),
        n.activeElement && Ie(n.activeElement).is(i.focusableElements) && n.activeElement !== c[0] && n.activeElement.blur();
        const _ = m && e.allowTouchMove && o.touchStartPreventDefault;
        (o.touchStartForcePreventDefault || _) && !c[0].isContentEditable && l.preventDefault()
    }
    e.params.freeMode && e.params.freeMode.enabled && e.freeMode && e.animating && !o.cssMode && e.freeMode.onTouchStart(),
    e.emit("touchStart", l)
}
function axe(t) {
    const e = Qn()
      , n = this
      , r = n.touchEventsData
      , {params: i, touches: o, rtlTranslate: s, enabled: a} = n;
    if (!a)
        return;
    let l = t;
    if (l.originalEvent && (l = l.originalEvent),
    !r.isTouched) {
        r.startMoving && r.isScrolling && n.emit("touchMoveOpposite", l);
        return
    }
    if (r.isTouchEvent && l.type !== "touchmove")
        return;
    const c = l.type === "touchmove" && l.targetTouches && (l.targetTouches[0] || l.changedTouches[0])
      , u = l.type === "touchmove" ? c.pageX : l.pageX
      , f = l.type === "touchmove" ? c.pageY : l.pageY;
    if (l.preventedByNestedSwiper) {
        o.startX = u,
        o.startY = f;
        return
    }
    if (!n.allowTouchMove) {
        Ie(l.target).is(r.focusableElements) || (n.allowClick = !1),
        r.isTouched && (Object.assign(o, {
            startX: u,
            startY: f,
            currentX: u,
            currentY: f
        }),
        r.touchStartTime = Ed());
        return
    }
    if (r.isTouchEvent && i.touchReleaseOnEdges && !i.loop) {
        if (n.isVertical()) {
            if (f < o.startY && n.translate <= n.maxTranslate() || f > o.startY && n.translate >= n.minTranslate()) {
                r.isTouched = !1,
                r.isMoved = !1;
                return
            }
        } else if (u < o.startX && n.translate <= n.maxTranslate() || u > o.startX && n.translate >= n.minTranslate())
            return
    }
    if (r.isTouchEvent && e.activeElement && l.target === e.activeElement && Ie(l.target).is(r.focusableElements)) {
        r.isMoved = !0,
        n.allowClick = !1;
        return
    }
    if (r.allowTouchCallbacks && n.emit("touchMove", l),
    l.targetTouches && l.targetTouches.length > 1)
        return;
    o.currentX = u,
    o.currentY = f;
    const d = o.currentX - o.startX
      , h = o.currentY - o.startY;
    if (n.params.threshold && Math.sqrt(d ** 2 + h ** 2) < n.params.threshold)
        return;
    if (typeof r.isScrolling > "u") {
        let g;
        n.isHorizontal() && o.currentY === o.startY || n.isVertical() && o.currentX === o.startX ? r.isScrolling = !1 : d * d + h * h >= 25 && (g = Math.atan2(Math.abs(h), Math.abs(d)) * 180 / Math.PI,
        r.isScrolling = n.isHorizontal() ? g > i.touchAngle : 90 - g > i.touchAngle)
    }
    if (r.isScrolling && n.emit("touchMoveOpposite", l),
    typeof r.startMoving > "u" && (o.currentX !== o.startX || o.currentY !== o.startY) && (r.startMoving = !0),
    r.isScrolling) {
        r.isTouched = !1;
        return
    }
    if (!r.startMoving)
        return;
    n.allowClick = !1,
    !i.cssMode && l.cancelable && l.preventDefault(),
    i.touchMoveStopPropagation && !i.nested && l.stopPropagation(),
    r.isMoved || (i.loop && !i.cssMode && n.loopFix(),
    r.startTranslate = n.getTranslate(),
    n.setTransition(0),
    n.animating && n.$wrapperEl.trigger("webkitTransitionEnd transitionend"),
    r.allowMomentumBounce = !1,
    i.grabCursor && (n.allowSlideNext === !0 || n.allowSlidePrev === !0) && n.setGrabCursor(!0),
    n.emit("sliderFirstMove", l)),
    n.emit("sliderMove", l),
    r.isMoved = !0;
    let p = n.isHorizontal() ? d : h;
    o.diff = p,
    p *= i.touchRatio,
    s && (p = -p),
    n.swipeDirection = p > 0 ? "prev" : "next",
    r.currentTranslate = p + r.startTranslate;
    let y = !0
      , v = i.resistanceRatio;
    if (i.touchReleaseOnEdges && (v = 0),
    p > 0 && r.currentTranslate > n.minTranslate() ? (y = !1,
    i.resistance && (r.currentTranslate = n.minTranslate() - 1 + (-n.minTranslate() + r.startTranslate + p) ** v)) : p < 0 && r.currentTranslate < n.maxTranslate() && (y = !1,
    i.resistance && (r.currentTranslate = n.maxTranslate() + 1 - (n.maxTranslate() - r.startTranslate - p) ** v)),
    y && (l.preventedByNestedSwiper = !0),
    !n.allowSlideNext && n.swipeDirection === "next" && r.currentTranslate < r.startTranslate && (r.currentTranslate = r.startTranslate),
    !n.allowSlidePrev && n.swipeDirection === "prev" && r.currentTranslate > r.startTranslate && (r.currentTranslate = r.startTranslate),
    !n.allowSlidePrev && !n.allowSlideNext && (r.currentTranslate = r.startTranslate),
    i.threshold > 0)
        if (Math.abs(p) > i.threshold || r.allowThresholdMove) {
            if (!r.allowThresholdMove) {
                r.allowThresholdMove = !0,
                o.startX = o.currentX,
                o.startY = o.currentY,
                r.currentTranslate = r.startTranslate,
                o.diff = n.isHorizontal() ? o.currentX - o.startX : o.currentY - o.startY;
                return
            }
        } else {
            r.currentTranslate = r.startTranslate;
            return
        }
    !i.followFinger || i.cssMode || ((i.freeMode && i.freeMode.enabled && n.freeMode || i.watchSlidesProgress) && (n.updateActiveIndex(),
    n.updateSlidesClasses()),
    n.params.freeMode && i.freeMode.enabled && n.freeMode && n.freeMode.onTouchMove(),
    n.updateProgress(r.currentTranslate),
    n.setTranslate(r.currentTranslate))
}
function lxe(t) {
    const e = this
      , n = e.touchEventsData
      , {params: r, touches: i, rtlTranslate: o, slidesGrid: s, enabled: a} = e;
    if (!a)
        return;
    let l = t;
    if (l.originalEvent && (l = l.originalEvent),
    n.allowTouchCallbacks && e.emit("touchEnd", l),
    n.allowTouchCallbacks = !1,
    !n.isTouched) {
        n.isMoved && r.grabCursor && e.setGrabCursor(!1),
        n.isMoved = !1,
        n.startMoving = !1;
        return
    }
    r.grabCursor && n.isMoved && n.isTouched && (e.allowSlideNext === !0 || e.allowSlidePrev === !0) && e.setGrabCursor(!1);
    const c = Ed()
      , u = c - n.touchStartTime;
    if (e.allowClick) {
        const m = l.path || l.composedPath && l.composedPath();
        e.updateClickedSlide(m && m[0] || l.target),
        e.emit("tap click", l),
        u < 300 && c - n.lastClickTime < 300 && e.emit("doubleTap doubleClick", l)
    }
    if (n.lastClickTime = Ed(),
    F0( () => {
        e.destroyed || (e.allowClick = !0)
    }
    ),
    !n.isTouched || !n.isMoved || !e.swipeDirection || i.diff === 0 || n.currentTranslate === n.startTranslate) {
        n.isTouched = !1,
        n.isMoved = !1,
        n.startMoving = !1;
        return
    }
    n.isTouched = !1,
    n.isMoved = !1,
    n.startMoving = !1;
    let f;
    if (r.followFinger ? f = o ? e.translate : -e.translate : f = -n.currentTranslate,
    r.cssMode)
        return;
    if (e.params.freeMode && r.freeMode.enabled) {
        e.freeMode.onTouchEnd({
            currentPos: f
        });
        return
    }
    let d = 0
      , h = e.slidesSizesGrid[0];
    for (let m = 0; m < s.length; m += m < r.slidesPerGroupSkip ? 1 : r.slidesPerGroup) {
        const _ = m < r.slidesPerGroupSkip - 1 ? 1 : r.slidesPerGroup;
        typeof s[m + _] < "u" ? f >= s[m] && f < s[m + _] && (d = m,
        h = s[m + _] - s[m]) : f >= s[m] && (d = m,
        h = s[s.length - 1] - s[s.length - 2])
    }
    let p = null
      , y = null;
    r.rewind && (e.isBeginning ? y = e.params.virtual && e.params.virtual.enabled && e.virtual ? e.virtual.slides.length - 1 : e.slides.length - 1 : e.isEnd && (p = 0));
    const v = (f - s[d]) / h
      , g = d < r.slidesPerGroupSkip - 1 ? 1 : r.slidesPerGroup;
    if (u > r.longSwipesMs) {
        if (!r.longSwipes) {
            e.slideTo(e.activeIndex);
            return
        }
        e.swipeDirection === "next" && (v >= r.longSwipesRatio ? e.slideTo(r.rewind && e.isEnd ? p : d + g) : e.slideTo(d)),
        e.swipeDirection === "prev" && (v > 1 - r.longSwipesRatio ? e.slideTo(d + g) : y !== null && v < 0 && Math.abs(v) > r.longSwipesRatio ? e.slideTo(y) : e.slideTo(d))
    } else {
        if (!r.shortSwipes) {
            e.slideTo(e.activeIndex);
            return
        }
        e.navigation && (l.target === e.navigation.nextEl || l.target === e.navigation.prevEl) ? l.target === e.navigation.nextEl ? e.slideTo(d + g) : e.slideTo(d) : (e.swipeDirection === "next" && e.slideTo(p !== null ? p : d + g),
        e.swipeDirection === "prev" && e.slideTo(y !== null ? y : d))
    }
}
function hP() {
    const t = this
      , {params: e, el: n} = t;
    if (n && n.offsetWidth === 0)
        return;
    e.breakpoints && t.setBreakpoint();
    const {allowSlideNext: r, allowSlidePrev: i, snapGrid: o} = t;
    t.allowSlideNext = !0,
    t.allowSlidePrev = !0,
    t.updateSize(),
    t.updateSlides(),
    t.updateSlidesClasses(),
    (e.slidesPerView === "auto" || e.slidesPerView > 1) && t.isEnd && !t.isBeginning && !t.params.centeredSlides ? t.slideTo(t.slides.length - 1, 0, !1, !0) : t.slideTo(t.activeIndex, 0, !1, !0),
    t.autoplay && t.autoplay.running && t.autoplay.paused && t.autoplay.run(),
    t.allowSlidePrev = i,
    t.allowSlideNext = r,
    t.params.watchOverflow && o !== t.snapGrid && t.checkOverflow()
}
function cxe(t) {
    const e = this;
    e.enabled && (e.allowClick || (e.params.preventClicks && t.preventDefault(),
    e.params.preventClicksPropagation && e.animating && (t.stopPropagation(),
    t.stopImmediatePropagation())))
}
function uxe() {
    const t = this
      , {wrapperEl: e, rtlTranslate: n, enabled: r} = t;
    if (!r)
        return;
    t.previousTranslate = t.translate,
    t.isHorizontal() ? t.translate = -e.scrollLeft : t.translate = -e.scrollTop,
    t.translate === 0 && (t.translate = 0),
    t.updateActiveIndex(),
    t.updateSlidesClasses();
    let i;
    const o = t.maxTranslate() - t.minTranslate();
    o === 0 ? i = 0 : i = (t.translate - t.minTranslate()) / o,
    i !== t.progress && t.updateProgress(n ? -t.translate : t.translate),
    t.emit("setTranslate", t.translate, !1)
}
let pP = !1;
function fxe() {}
const g9 = (t, e) => {
    const n = Qn()
      , {params: r, touchEvents: i, el: o, wrapperEl: s, device: a, support: l} = t
      , c = !!r.nested
      , u = e === "on" ? "addEventListener" : "removeEventListener"
      , f = e;
    if (!l.touch)
        o[u](i.start, t.onTouchStart, !1),
        n[u](i.move, t.onTouchMove, c),
        n[u](i.end, t.onTouchEnd, !1);
    else {
        const d = i.start === "touchstart" && l.passiveListener && r.passiveListeners ? {
            passive: !0,
            capture: !1
        } : !1;
        o[u](i.start, t.onTouchStart, d),
        o[u](i.move, t.onTouchMove, l.passiveListener ? {
            passive: !1,
            capture: c
        } : c),
        o[u](i.end, t.onTouchEnd, d),
        i.cancel && o[u](i.cancel, t.onTouchEnd, d)
    }
    (r.preventClicks || r.preventClicksPropagation) && o[u]("click", t.onClick, !0),
    r.cssMode && s[u]("scroll", t.onScroll),
    r.updateOnWindowResize ? t[f](a.ios || a.android ? "resize orientationchange observerUpdate" : "resize observerUpdate", hP, !0) : t[f]("observerUpdate", hP, !0)
}
;
function dxe() {
    const t = this
      , e = Qn()
      , {params: n, support: r} = t;
    t.onTouchStart = sxe.bind(t),
    t.onTouchMove = axe.bind(t),
    t.onTouchEnd = lxe.bind(t),
    n.cssMode && (t.onScroll = uxe.bind(t)),
    t.onClick = cxe.bind(t),
    r.touch && !pP && (e.addEventListener("touchstart", fxe),
    pP = !0),
    g9(t, "on")
}
function hxe() {
    g9(this, "off")
}
const pxe = {
    attachEvents: dxe,
    detachEvents: hxe
}
  , gP = (t, e) => t.grid && e.grid && e.grid.rows > 1;
function gxe() {
    const t = this
      , {activeIndex: e, initialized: n, loopedSlides: r=0, params: i, $el: o} = t
      , s = i.breakpoints;
    if (!s || s && Object.keys(s).length === 0)
        return;
    const a = t.getBreakpoint(s, t.params.breakpointsBase, t.el);
    if (!a || t.currentBreakpoint === a)
        return;
    const c = (a in s ? s[a] : void 0) || t.originalParams
      , u = gP(t, i)
      , f = gP(t, c)
      , d = i.enabled;
    u && !f ? (o.removeClass(`${i.containerModifierClass}grid ${i.containerModifierClass}grid-column`),
    t.emitContainerClasses()) : !u && f && (o.addClass(`${i.containerModifierClass}grid`),
    (c.grid.fill && c.grid.fill === "column" || !c.grid.fill && i.grid.fill === "column") && o.addClass(`${i.containerModifierClass}grid-column`),
    t.emitContainerClasses()),
    ["navigation", "pagination", "scrollbar"].forEach(v => {
        const g = i[v] && i[v].enabled
          , m = c[v] && c[v].enabled;
        g && !m && t[v].disable(),
        !g && m && t[v].enable()
    }
    );
    const h = c.direction && c.direction !== i.direction
      , p = i.loop && (c.slidesPerView !== i.slidesPerView || h);
    h && n && t.changeDirection(),
    $r(t.params, c);
    const y = t.params.enabled;
    Object.assign(t, {
        allowTouchMove: t.params.allowTouchMove,
        allowSlideNext: t.params.allowSlideNext,
        allowSlidePrev: t.params.allowSlidePrev
    }),
    d && !y ? t.disable() : !d && y && t.enable(),
    t.currentBreakpoint = a,
    t.emit("_beforeBreakpoint", c),
    p && n && (t.loopDestroy(),
    t.loopCreate(),
    t.updateSlides(),
    t.slideTo(e - r + t.loopedSlides, 0, !1)),
    t.emit("breakpoint", c)
}
function mxe(t, e="window", n) {
    if (!t || e === "container" && !n)
        return;
    let r = !1;
    const i = kn()
      , o = e === "window" ? i.innerHeight : n.clientHeight
      , s = Object.keys(t).map(a => {
        if (typeof a == "string" && a.indexOf("@") === 0) {
            const l = parseFloat(a.substr(1));
            return {
                value: o * l,
                point: a
            }
        }
        return {
            value: a,
            point: a
        }
    }
    );
    s.sort( (a, l) => parseInt(a.value, 10) - parseInt(l.value, 10));
    for (let a = 0; a < s.length; a += 1) {
        const {point: l, value: c} = s[a];
        e === "window" ? i.matchMedia(`(min-width: ${c}px)`).matches && (r = l) : c <= n.clientWidth && (r = l)
    }
    return r || "max"
}
const vxe = {
    setBreakpoint: gxe,
    getBreakpoint: mxe
};
function yxe(t, e) {
    const n = [];
    return t.forEach(r => {
        typeof r == "object" ? Object.keys(r).forEach(i => {
            r[i] && n.push(e + i)
        }
        ) : typeof r == "string" && n.push(e + r)
    }
    ),
    n
}
function _xe() {
    const t = this
      , {classNames: e, params: n, rtl: r, $el: i, device: o, support: s} = t
      , a = yxe(["initialized", n.direction, {
        "pointer-events": !s.touch
    }, {
        "free-mode": t.params.freeMode && n.freeMode.enabled
    }, {
        autoheight: n.autoHeight
    }, {
        rtl: r
    }, {
        grid: n.grid && n.grid.rows > 1
    }, {
        "grid-column": n.grid && n.grid.rows > 1 && n.grid.fill === "column"
    }, {
        android: o.android
    }, {
        ios: o.ios
    }, {
        "css-mode": n.cssMode
    }, {
        centered: n.cssMode && n.centeredSlides
    }, {
        "watch-progress": n.watchSlidesProgress
    }], n.containerModifierClass);
    e.push(...a),
    i.addClass([...e].join(" ")),
    t.emitContainerClasses()
}
function xxe() {
    const t = this
      , {$el: e, classNames: n} = t;
    e.removeClass(n.join(" ")),
    t.emitContainerClasses()
}
const bxe = {
    addClasses: _xe,
    removeClasses: xxe
};
function wxe(t, e, n, r, i, o) {
    const s = kn();
    let a;
    function l() {
        o && o()
    }
    !Ie(t).parent("picture")[0] && (!t.complete || !i) && e ? (a = new s.Image,
    a.onload = l,
    a.onerror = l,
    r && (a.sizes = r),
    n && (a.srcset = n),
    e && (a.src = e)) : l()
}
function Exe() {
    const t = this;
    t.imagesToLoad = t.$el.find("img");
    function e() {
        typeof t > "u" || t === null || !t || t.destroyed || (t.imagesLoaded !== void 0 && (t.imagesLoaded += 1),
        t.imagesLoaded === t.imagesToLoad.length && (t.params.updateOnImagesReady && t.update(),
        t.emit("imagesReady")))
    }
    for (let n = 0; n < t.imagesToLoad.length; n += 1) {
        const r = t.imagesToLoad[n];
        t.loadImage(r, r.currentSrc || r.getAttribute("src"), r.srcset || r.getAttribute("srcset"), r.sizes || r.getAttribute("sizes"), !0, e)
    }
}
const Sxe = {
    loadImage: wxe,
    preloadImages: Exe
};
function Cxe() {
    const t = this
      , {isLocked: e, params: n} = t
      , {slidesOffsetBefore: r} = n;
    if (r) {
        const i = t.slides.length - 1
          , o = t.slidesGrid[i] + t.slidesSizesGrid[i] + r * 2;
        t.isLocked = t.size > o
    } else
        t.isLocked = t.snapGrid.length === 1;
    n.allowSlideNext === !0 && (t.allowSlideNext = !t.isLocked),
    n.allowSlidePrev === !0 && (t.allowSlidePrev = !t.isLocked),
    e && e !== t.isLocked && (t.isEnd = !1),
    e !== t.isLocked && t.emit(t.isLocked ? "lock" : "unlock")
}
const Axe = {
    checkOverflow: Cxe
}
  , mP = {
    init: !0,
    direction: "horizontal",
    touchEventsTarget: "wrapper",
    initialSlide: 0,
    speed: 300,
    cssMode: !1,
    updateOnWindowResize: !0,
    resizeObserver: !0,
    nested: !1,
    createElements: !1,
    enabled: !0,
    focusableElements: "input, select, option, textarea, button, video, label",
    width: null,
    height: null,
    preventInteractionOnTransition: !1,
    userAgent: null,
    url: null,
    edgeSwipeDetection: !1,
    edgeSwipeThreshold: 20,
    autoHeight: !1,
    setWrapperSize: !1,
    virtualTranslate: !1,
    effect: "slide",
    breakpoints: void 0,
    breakpointsBase: "window",
    spaceBetween: 0,
    slidesPerView: 1,
    slidesPerGroup: 1,
    slidesPerGroupSkip: 0,
    slidesPerGroupAuto: !1,
    centeredSlides: !1,
    centeredSlidesBounds: !1,
    slidesOffsetBefore: 0,
    slidesOffsetAfter: 0,
    normalizeSlideIndex: !0,
    centerInsufficientSlides: !1,
    watchOverflow: !0,
    roundLengths: !1,
    touchRatio: 1,
    touchAngle: 45,
    simulateTouch: !0,
    shortSwipes: !0,
    longSwipes: !0,
    longSwipesRatio: .5,
    longSwipesMs: 300,
    followFinger: !0,
    allowTouchMove: !0,
    threshold: 0,
    touchMoveStopPropagation: !1,
    touchStartPreventDefault: !0,
    touchStartForcePreventDefault: !1,
    touchReleaseOnEdges: !1,
    uniqueNavElements: !0,
    resistance: !0,
    resistanceRatio: .85,
    watchSlidesProgress: !1,
    grabCursor: !1,
    preventClicks: !0,
    preventClicksPropagation: !0,
    slideToClickedSlide: !1,
    preloadImages: !0,
    updateOnImagesReady: !0,
    loop: !1,
    loopAdditionalSlides: 0,
    loopedSlides: null,
    loopedSlidesLimit: !0,
    loopFillGroupWithBlank: !1,
    loopPreventsSlide: !0,
    rewind: !1,
    allowSlidePrev: !0,
    allowSlideNext: !0,
    swipeHandler: null,
    noSwiping: !0,
    noSwipingClass: "swiper-no-swiping",
    noSwipingSelector: null,
    passiveListeners: !0,
    maxBackfaceHiddenSlides: 10,
    containerModifierClass: "swiper-",
    slideClass: "swiper-slide",
    slideBlankClass: "swiper-slide-invisible-blank",
    slideActiveClass: "swiper-slide-active",
    slideDuplicateActiveClass: "swiper-slide-duplicate-active",
    slideVisibleClass: "swiper-slide-visible",
    slideDuplicateClass: "swiper-slide-duplicate",
    slideNextClass: "swiper-slide-next",
    slideDuplicateNextClass: "swiper-slide-duplicate-next",
    slidePrevClass: "swiper-slide-prev",
    slideDuplicatePrevClass: "swiper-slide-duplicate-prev",
    wrapperClass: "swiper-wrapper",
    runCallbacksOnInit: !0,
    _emitClasses: !1
};
function Txe(t, e) {
    return function(r={}) {
        const i = Object.keys(r)[0]
          , o = r[i];
        if (typeof o != "object" || o === null) {
            $r(e, r);
            return
        }
        if (["navigation", "pagination", "scrollbar"].indexOf(i) >= 0 && t[i] === !0 && (t[i] = {
            auto: !0
        }),
        !(i in t && "enabled"in o)) {
            $r(e, r);
            return
        }
        t[i] === !0 && (t[i] = {
            enabled: !0
        }),
        typeof t[i] == "object" && !("enabled"in t[i]) && (t[i].enabled = !0),
        t[i] || (t[i] = {
            enabled: !1
        }),
        $r(e, r)
    }
}
const bv = {
    eventsEmitter: E_e,
    update: D_e,
    translate: $_e,
    transition: V_e,
    slide: Z_e,
    loop: txe,
    grabCursor: ixe,
    events: pxe,
    breakpoints: vxe,
    checkOverflow: Axe,
    classes: bxe,
    images: Sxe
}
  , wv = {};
let ru = class ko {
    constructor(...e) {
        let n, r;
        if (e.length === 1 && e[0].constructor && Object.prototype.toString.call(e[0]).slice(8, -1) === "Object" ? r = e[0] : [n,r] = e,
        r || (r = {}),
        r = $r({}, r),
        n && !r.el && (r.el = n),
        r.el && Ie(r.el).length > 1) {
            const a = [];
            return Ie(r.el).each(l => {
                const c = $r({}, r, {
                    el: l
                });
                a.push(new ko(c))
            }
            ),
            a
        }
        const i = this;
        i.__swiper__ = !0,
        i.support = h9(),
        i.device = y_e({
            userAgent: r.userAgent
        }),
        i.browser = x_e(),
        i.eventsListeners = {},
        i.eventsAnyListeners = [],
        i.modules = [...i.__modules__],
        r.modules && Array.isArray(r.modules) && i.modules.push(...r.modules);
        const o = {};
        i.modules.forEach(a => {
            a({
                swiper: i,
                extendParams: Txe(r, o),
                on: i.on.bind(i),
                once: i.once.bind(i),
                off: i.off.bind(i),
                emit: i.emit.bind(i)
            })
        }
        );
        const s = $r({}, mP, o);
        return i.params = $r({}, s, wv, r),
        i.originalParams = $r({}, i.params),
        i.passedParams = $r({}, r),
        i.params && i.params.on && Object.keys(i.params.on).forEach(a => {
            i.on(a, i.params.on[a])
        }
        ),
        i.params && i.params.onAny && i.onAny(i.params.onAny),
        i.$ = Ie,
        Object.assign(i, {
            enabled: i.params.enabled,
            el: n,
            classNames: [],
            slides: Ie(),
            slidesGrid: [],
            snapGrid: [],
            slidesSizesGrid: [],
            isHorizontal() {
                return i.params.direction === "horizontal"
            },
            isVertical() {
                return i.params.direction === "vertical"
            },
            activeIndex: 0,
            realIndex: 0,
            isBeginning: !0,
            isEnd: !1,
            translate: 0,
            previousTranslate: 0,
            progress: 0,
            velocity: 0,
            animating: !1,
            allowSlideNext: i.params.allowSlideNext,
            allowSlidePrev: i.params.allowSlidePrev,
            touchEvents: function() {
                const l = ["touchstart", "touchmove", "touchend", "touchcancel"]
                  , c = ["pointerdown", "pointermove", "pointerup"];
                return i.touchEventsTouch = {
                    start: l[0],
                    move: l[1],
                    end: l[2],
                    cancel: l[3]
                },
                i.touchEventsDesktop = {
                    start: c[0],
                    move: c[1],
                    end: c[2]
                },
                i.support.touch || !i.params.simulateTouch ? i.touchEventsTouch : i.touchEventsDesktop
            }(),
            touchEventsData: {
                isTouched: void 0,
                isMoved: void 0,
                allowTouchCallbacks: void 0,
                touchStartTime: void 0,
                isScrolling: void 0,
                currentTranslate: void 0,
                startTranslate: void 0,
                allowThresholdMove: void 0,
                focusableElements: i.params.focusableElements,
                lastClickTime: Ed(),
                clickTimeout: void 0,
                velocities: [],
                allowMomentumBounce: void 0,
                isTouchEvent: void 0,
                startMoving: void 0
            },
            allowClick: !0,
            allowTouchMove: i.params.allowTouchMove,
            touches: {
                startX: 0,
                startY: 0,
                currentX: 0,
                currentY: 0,
                diff: 0
            },
            imagesToLoad: [],
            imagesLoaded: 0
        }),
        i.emit("_swiper"),
        i.params.init && i.init(),
        i
    }
    enable() {
        const e = this;
        e.enabled || (e.enabled = !0,
        e.params.grabCursor && e.setGrabCursor(),
        e.emit("enable"))
    }
    disable() {
        const e = this;
        e.enabled && (e.enabled = !1,
        e.params.grabCursor && e.unsetGrabCursor(),
        e.emit("disable"))
    }
    setProgress(e, n) {
        const r = this;
        e = Math.min(Math.max(e, 0), 1);
        const i = r.minTranslate()
          , s = (r.maxTranslate() - i) * e + i;
        r.translateTo(s, typeof n > "u" ? 0 : n),
        r.updateActiveIndex(),
        r.updateSlidesClasses()
    }
    emitContainerClasses() {
        const e = this;
        if (!e.params._emitClasses || !e.el)
            return;
        const n = e.el.className.split(" ").filter(r => r.indexOf("swiper") === 0 || r.indexOf(e.params.containerModifierClass) === 0);
        e.emit("_containerClasses", n.join(" "))
    }
    getSlideClasses(e) {
        const n = this;
        return n.destroyed ? "" : e.className.split(" ").filter(r => r.indexOf("swiper-slide") === 0 || r.indexOf(n.params.slideClass) === 0).join(" ")
    }
    emitSlidesClasses() {
        const e = this;
        if (!e.params._emitClasses || !e.el)
            return;
        const n = [];
        e.slides.each(r => {
            const i = e.getSlideClasses(r);
            n.push({
                slideEl: r,
                classNames: i
            }),
            e.emit("_slideClass", r, i)
        }
        ),
        e.emit("_slideClasses", n)
    }
    slidesPerViewDynamic(e="current", n=!1) {
        const r = this
          , {params: i, slides: o, slidesGrid: s, slidesSizesGrid: a, size: l, activeIndex: c} = r;
        let u = 1;
        if (i.centeredSlides) {
            let f = o[c].swiperSlideSize, d;
            for (let h = c + 1; h < o.length; h += 1)
                o[h] && !d && (f += o[h].swiperSlideSize,
                u += 1,
                f > l && (d = !0));
            for (let h = c - 1; h >= 0; h -= 1)
                o[h] && !d && (f += o[h].swiperSlideSize,
                u += 1,
                f > l && (d = !0))
        } else if (e === "current")
            for (let f = c + 1; f < o.length; f += 1)
                (n ? s[f] + a[f] - s[c] < l : s[f] - s[c] < l) && (u += 1);
        else
            for (let f = c - 1; f >= 0; f -= 1)
                s[c] - s[f] < l && (u += 1);
        return u
    }
    update() {
        const e = this;
        if (!e || e.destroyed)
            return;
        const {snapGrid: n, params: r} = e;
        r.breakpoints && e.setBreakpoint(),
        e.updateSize(),
        e.updateSlides(),
        e.updateProgress(),
        e.updateSlidesClasses();
        function i() {
            const s = e.rtlTranslate ? e.translate * -1 : e.translate
              , a = Math.min(Math.max(s, e.maxTranslate()), e.minTranslate());
            e.setTranslate(a),
            e.updateActiveIndex(),
            e.updateSlidesClasses()
        }
        let o;
        e.params.freeMode && e.params.freeMode.enabled ? (i(),
        e.params.autoHeight && e.updateAutoHeight()) : ((e.params.slidesPerView === "auto" || e.params.slidesPerView > 1) && e.isEnd && !e.params.centeredSlides ? o = e.slideTo(e.slides.length - 1, 0, !1, !0) : o = e.slideTo(e.activeIndex, 0, !1, !0),
        o || i()),
        r.watchOverflow && n !== e.snapGrid && e.checkOverflow(),
        e.emit("update")
    }
    changeDirection(e, n=!0) {
        const r = this
          , i = r.params.direction;
        return e || (e = i === "horizontal" ? "vertical" : "horizontal"),
        e === i || e !== "horizontal" && e !== "vertical" || (r.$el.removeClass(`${r.params.containerModifierClass}${i}`).addClass(`${r.params.containerModifierClass}${e}`),
        r.emitContainerClasses(),
        r.params.direction = e,
        r.slides.each(o => {
            e === "vertical" ? o.style.width = "" : o.style.height = ""
        }
        ),
        r.emit("changeDirection"),
        n && r.update()),
        r
    }
    changeLanguageDirection(e) {
        const n = this;
        n.rtl && e === "rtl" || !n.rtl && e === "ltr" || (n.rtl = e === "rtl",
        n.rtlTranslate = n.params.direction === "horizontal" && n.rtl,
        n.rtl ? (n.$el.addClass(`${n.params.containerModifierClass}rtl`),
        n.el.dir = "rtl") : (n.$el.removeClass(`${n.params.containerModifierClass}rtl`),
        n.el.dir = "ltr"),
        n.update())
    }
    mount(e) {
        const n = this;
        if (n.mounted)
            return !0;
        const r = Ie(e || n.params.el);
        if (e = r[0],
        !e)
            return !1;
        e.swiper = n;
        const i = () => `.${(n.params.wrapperClass || "").trim().split(" ").join(".")}`;
        let s = ( () => {
            if (e && e.shadowRoot && e.shadowRoot.querySelector) {
                const a = Ie(e.shadowRoot.querySelector(i()));
                return a.children = l => r.children(l),
                a
            }
            return r.children ? r.children(i()) : Ie(r).children(i())
        }
        )();
        if (s.length === 0 && n.params.createElements) {
            const l = Qn().createElement("div");
            s = Ie(l),
            l.className = n.params.wrapperClass,
            r.append(l),
            r.children(`.${n.params.slideClass}`).each(c => {
                s.append(c)
            }
            )
        }
        return Object.assign(n, {
            $el: r,
            el: e,
            $wrapperEl: s,
            wrapperEl: s[0],
            mounted: !0,
            rtl: e.dir.toLowerCase() === "rtl" || r.css("direction") === "rtl",
            rtlTranslate: n.params.direction === "horizontal" && (e.dir.toLowerCase() === "rtl" || r.css("direction") === "rtl"),
            wrongRTL: s.css("display") === "-webkit-box"
        }),
        !0
    }
    init(e) {
        const n = this;
        return n.initialized || n.mount(e) === !1 || (n.emit("beforeInit"),
        n.params.breakpoints && n.setBreakpoint(),
        n.addClasses(),
        n.params.loop && n.loopCreate(),
        n.updateSize(),
        n.updateSlides(),
        n.params.watchOverflow && n.checkOverflow(),
        n.params.grabCursor && n.enabled && n.setGrabCursor(),
        n.params.preloadImages && n.preloadImages(),
        n.params.loop ? n.slideTo(n.params.initialSlide + n.loopedSlides, 0, n.params.runCallbacksOnInit, !1, !0) : n.slideTo(n.params.initialSlide, 0, n.params.runCallbacksOnInit, !1, !0),
        n.attachEvents(),
        n.initialized = !0,
        n.emit("init"),
        n.emit("afterInit")),
        n
    }
    destroy(e=!0, n=!0) {
        const r = this
          , {params: i, $el: o, $wrapperEl: s, slides: a} = r;
        return typeof r.params > "u" || r.destroyed || (r.emit("beforeDestroy"),
        r.initialized = !1,
        r.detachEvents(),
        i.loop && r.loopDestroy(),
        n && (r.removeClasses(),
        o.removeAttr("style"),
        s.removeAttr("style"),
        a && a.length && a.removeClass([i.slideVisibleClass, i.slideActiveClass, i.slideNextClass, i.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")),
        r.emit("destroy"),
        Object.keys(r.eventsListeners).forEach(l => {
            r.off(l)
        }
        ),
        e !== !1 && (r.$el[0].swiper = null,
        d_e(r)),
        r.destroyed = !0),
        null
    }
    static extendDefaults(e) {
        $r(wv, e)
    }
    static get extendedDefaults() {
        return wv
    }
    static get defaults() {
        return mP
    }
    static installModule(e) {
        ko.prototype.__modules__ || (ko.prototype.__modules__ = []);
        const n = ko.prototype.__modules__;
        typeof e == "function" && n.indexOf(e) < 0 && n.push(e)
    }
    static use(e) {
        return Array.isArray(e) ? (e.forEach(n => ko.installModule(n)),
        ko) : (ko.installModule(e),
        ko)
    }
}
;
Object.keys(bv).forEach(t => {
    Object.keys(bv[t]).forEach(e => {
        ru.prototype[e] = bv[t][e]
    }
    )
}
);
ru.use([b_e, w_e]);
function $Pe({swiper: t, extendParams: e, on: n, emit: r}) {
    let i;
    t.autoplay = {
        running: !1,
        paused: !1
    },
    e({
        autoplay: {
            enabled: !1,
            delay: 3e3,
            waitForTransition: !0,
            disableOnInteraction: !0,
            stopOnLastSlide: !1,
            reverseDirection: !1,
            pauseOnMouseEnter: !1
        }
    });
    function o() {
        if (!t.size) {
            t.autoplay.running = !1,
            t.autoplay.paused = !1;
            return
        }
        const y = t.slides.eq(t.activeIndex);
        let v = t.params.autoplay.delay;
        y.attr("data-swiper-autoplay") && (v = y.attr("data-swiper-autoplay") || t.params.autoplay.delay),
        clearTimeout(i),
        i = F0( () => {
            let g;
            t.params.autoplay.reverseDirection ? t.params.loop ? (t.loopFix(),
            g = t.slidePrev(t.params.speed, !0, !0),
            r("autoplay")) : t.isBeginning ? t.params.autoplay.stopOnLastSlide ? a() : (g = t.slideTo(t.slides.length - 1, t.params.speed, !0, !0),
            r("autoplay")) : (g = t.slidePrev(t.params.speed, !0, !0),
            r("autoplay")) : t.params.loop ? (t.loopFix(),
            g = t.slideNext(t.params.speed, !0, !0),
            r("autoplay")) : t.isEnd ? t.params.autoplay.stopOnLastSlide ? a() : (g = t.slideTo(0, t.params.speed, !0, !0),
            r("autoplay")) : (g = t.slideNext(t.params.speed, !0, !0),
            r("autoplay")),
            (t.params.cssMode && t.autoplay.running || g === !1) && o()
        }
        , v)
    }
    function s() {
        return typeof i < "u" || t.autoplay.running ? !1 : (t.autoplay.running = !0,
        r("autoplayStart"),
        o(),
        !0)
    }
    function a() {
        return !t.autoplay.running || typeof i > "u" ? !1 : (i && (clearTimeout(i),
        i = void 0),
        t.autoplay.running = !1,
        r("autoplayStop"),
        !0)
    }
    function l(y) {
        t.autoplay.running && (t.autoplay.paused || (i && clearTimeout(i),
        t.autoplay.paused = !0,
        y === 0 || !t.params.autoplay.waitForTransition ? (t.autoplay.paused = !1,
        o()) : ["transitionend", "webkitTransitionEnd"].forEach(v => {
            t.$wrapperEl[0].addEventListener(v, u)
        }
        )))
    }
    function c() {
        const y = Qn();
        y.visibilityState === "hidden" && t.autoplay.running && l(),
        y.visibilityState === "visible" && t.autoplay.paused && (o(),
        t.autoplay.paused = !1)
    }
    function u(y) {
        !t || t.destroyed || !t.$wrapperEl || y.target === t.$wrapperEl[0] && (["transitionend", "webkitTransitionEnd"].forEach(v => {
            t.$wrapperEl[0].removeEventListener(v, u)
        }
        ),
        t.autoplay.paused = !1,
        t.autoplay.running ? o() : a())
    }
    function f() {
        t.params.autoplay.disableOnInteraction ? a() : (r("autoplayPause"),
        l()),
        ["transitionend", "webkitTransitionEnd"].forEach(y => {
            t.$wrapperEl[0].removeEventListener(y, u)
        }
        )
    }
    function d() {
        t.params.autoplay.disableOnInteraction || (t.autoplay.paused = !1,
        r("autoplayResume"),
        o())
    }
    function h() {
        t.params.autoplay.pauseOnMouseEnter && (t.$el.on("mouseenter", f),
        t.$el.on("mouseleave", d))
    }
    function p() {
        t.$el.off("mouseenter", f),
        t.$el.off("mouseleave", d)
    }
    n("init", () => {
        t.params.autoplay.enabled && (s(),
        Qn().addEventListener("visibilitychange", c),
        h())
    }
    ),
    n("beforeTransitionStart", (y, v, g) => {
        t.autoplay.running && (g || !t.params.autoplay.disableOnInteraction ? t.autoplay.pause(v) : a())
    }
    ),
    n("sliderFirstMove", () => {
        t.autoplay.running && (t.params.autoplay.disableOnInteraction ? a() : l())
    }
    ),
    n("touchEnd", () => {
        t.params.cssMode && t.autoplay.paused && !t.params.autoplay.disableOnInteraction && o()
    }
    ),
    n("destroy", () => {
        p(),
        t.autoplay.running && a(),
        Qn().removeEventListener("visibilitychange", c)
    }
    ),
    Object.assign(t.autoplay, {
        pause: l,
        run: o,
        start: s,
        stop: a
    })
}
function Sl(t) {
    return typeof t == "object" && t !== null && t.constructor && Object.prototype.toString.call(t).slice(8, -1) === "Object"
}
function $s(t, e) {
    const n = ["__proto__", "constructor", "prototype"];
    Object.keys(e).filter(r => n.indexOf(r) < 0).forEach(r => {
        typeof t[r] > "u" ? t[r] = e[r] : Sl(e[r]) && Sl(t[r]) && Object.keys(e[r]).length > 0 ? e[r].__swiper__ ? t[r] = e[r] : $s(t[r], e[r]) : t[r] = e[r]
    }
    )
}
function m9(t={}) {
    return t.navigation && typeof t.navigation.nextEl > "u" && typeof t.navigation.prevEl > "u"
}
function v9(t={}) {
    return t.pagination && typeof t.pagination.el > "u"
}
function y9(t={}) {
    return t.scrollbar && typeof t.scrollbar.el > "u"
}
function _9(t="") {
    const e = t.split(" ").map(r => r.trim()).filter(r => !!r)
      , n = [];
    return e.forEach(r => {
        n.indexOf(r) < 0 && n.push(r)
    }
    ),
    n.join(" ")
}
const x9 = ["modules", "init", "_direction", "touchEventsTarget", "initialSlide", "_speed", "cssMode", "updateOnWindowResize", "resizeObserver", "nested", "focusableElements", "_enabled", "_width", "_height", "preventInteractionOnTransition", "userAgent", "url", "_edgeSwipeDetection", "_edgeSwipeThreshold", "_freeMode", "_autoHeight", "setWrapperSize", "virtualTranslate", "_effect", "breakpoints", "_spaceBetween", "_slidesPerView", "maxBackfaceHiddenSlides", "_grid", "_slidesPerGroup", "_slidesPerGroupSkip", "_slidesPerGroupAuto", "_centeredSlides", "_centeredSlidesBounds", "_slidesOffsetBefore", "_slidesOffsetAfter", "normalizeSlideIndex", "_centerInsufficientSlides", "_watchOverflow", "roundLengths", "touchRatio", "touchAngle", "simulateTouch", "_shortSwipes", "_longSwipes", "longSwipesRatio", "longSwipesMs", "_followFinger", "allowTouchMove", "_threshold", "touchMoveStopPropagation", "touchStartPreventDefault", "touchStartForcePreventDefault", "touchReleaseOnEdges", "uniqueNavElements", "_resistance", "_resistanceRatio", "_watchSlidesProgress", "_grabCursor", "preventClicks", "preventClicksPropagation", "_slideToClickedSlide", "_preloadImages", "updateOnImagesReady", "_loop", "_loopAdditionalSlides", "_loopedSlides", "_loopedSlidesLimit", "_loopFillGroupWithBlank", "loopPreventsSlide", "_rewind", "_allowSlidePrev", "_allowSlideNext", "_swipeHandler", "_noSwiping", "noSwipingClass", "noSwipingSelector", "passiveListeners", "containerModifierClass", "slideClass", "slideBlankClass", "slideActiveClass", "slideDuplicateActiveClass", "slideVisibleClass", "slideDuplicateClass", "slideNextClass", "slideDuplicateNextClass", "slidePrevClass", "slideDuplicatePrevClass", "wrapperClass", "runCallbacksOnInit", "observer", "observeParents", "observeSlideChildren", "a11y", "_autoplay", "_controller", "coverflowEffect", "cubeEffect", "fadeEffect", "flipEffect", "creativeEffect", "cardsEffect", "hashNavigation", "history", "keyboard", "lazy", "mousewheel", "_navigation", "_pagination", "parallax", "_scrollbar", "_thumbs", "virtual", "zoom"];
function vP(t={}, e=!0) {
    const n = {
        on: {}
    }
      , r = {}
      , i = {};
    $s(n, ru.defaults),
    $s(n, ru.extendedDefaults),
    n._emitClasses = !0,
    n.init = !1;
    const o = {}
      , s = x9.map(l => l.replace(/_/, ""))
      , a = Object.assign({}, t);
    return Object.keys(a).forEach(l => {
        typeof t[l] > "u" || (s.indexOf(l) >= 0 ? Sl(t[l]) ? (n[l] = {},
        i[l] = {},
        $s(n[l], t[l]),
        $s(i[l], t[l])) : (n[l] = t[l],
        i[l] = t[l]) : l.search(/on[A-Z]/) === 0 && typeof t[l] == "function" ? e ? r[`${l[2].toLowerCase()}${l.substr(3)}`] = t[l] : n.on[`${l[2].toLowerCase()}${l.substr(3)}`] = t[l] : o[l] = t[l])
    }
    ),
    ["navigation", "pagination", "scrollbar"].forEach(l => {
        n[l] === !0 && (n[l] = {}),
        n[l] === !1 && delete n[l]
    }
    ),
    {
        params: n,
        passedParams: i,
        rest: o,
        events: r
    }
}
function Pxe({el: t, nextEl: e, prevEl: n, paginationEl: r, scrollbarEl: i, swiper: o}, s) {
    m9(s) && e && n && (o.params.navigation.nextEl = e,
    o.originalParams.navigation.nextEl = e,
    o.params.navigation.prevEl = n,
    o.originalParams.navigation.prevEl = n),
    v9(s) && r && (o.params.pagination.el = r,
    o.originalParams.pagination.el = r),
    y9(s) && i && (o.params.scrollbar.el = i,
    o.originalParams.scrollbar.el = i),
    o.init(t)
}
const b9 = (t, e) => {
    let n = e.slidesPerView;
    if (e.breakpoints) {
        const i = ru.prototype.getBreakpoint(e.breakpoints)
          , o = i in e.breakpoints ? e.breakpoints[i] : void 0;
        o && o.slidesPerView && (n = o.slidesPerView)
    }
    let r = Math.ceil(parseFloat(e.loopedSlides || n, 10));
    return r += e.loopAdditionalSlides,
    r > t.length && e.loopedSlidesLimit && (r = t.length),
    r
}
;
function Ixe(t, e, n) {
    const r = e.map( (l, c) => (l.props || (l.props = {}),
    l.props.swiperRef = t,
    l.props["data-swiper-slide-index"] = c,
    l));
    function i(l, c, u) {
        return l.props || (l.props = {}),
        Mn(l.type, {
            ...l.props,
            key: `${l.key}-duplicate-${c}-${u}`,
            class: `${l.props.className || ""} ${n.slideDuplicateClass} ${l.props.class || ""}`
        }, l.children)
    }
    if (n.loopFillGroupWithBlank) {
        const l = n.slidesPerGroup - r.length % n.slidesPerGroup;
        if (l !== n.slidesPerGroup)
            for (let c = 0; c < l; c += 1) {
                const u = Mn("div", {
                    class: `${n.slideClass} ${n.slideBlankClass}`
                });
                r.push(u)
            }
    }
    n.slidesPerView === "auto" && !n.loopedSlides && (n.loopedSlides = r.length);
    const o = b9(r, n)
      , s = []
      , a = [];
    for (let l = 0; l < o; l += 1) {
        const c = l - Math.floor(l / r.length) * r.length;
        a.push(i(r[c], l, "append")),
        s.unshift(i(r[r.length - c - 1], l, "prepend"))
    }
    return t.value && (t.value.loopedSlides = o),
    [...s, ...r, ...a]
}
function Oxe(t, e, n, r, i) {
    const o = [];
    if (!e)
        return o;
    const s = l => {
        o.indexOf(l) < 0 && o.push(l)
    }
    ;
    if (n && r) {
        const l = r.map(i)
          , c = n.map(i);
        l.join("") !== c.join("") && s("children"),
        r.length !== n.length && s("children")
    }
    return x9.filter(l => l[0] === "_").map(l => l.replace(/_/, "")).forEach(l => {
        if (l in t && l in e)
            if (Sl(t[l]) && Sl(e[l])) {
                const c = Object.keys(t[l])
                  , u = Object.keys(e[l]);
                c.length !== u.length ? s(l) : (c.forEach(f => {
                    t[l][f] !== e[l][f] && s(l)
                }
                ),
                u.forEach(f => {
                    t[l][f] !== e[l][f] && s(l)
                }
                ))
            } else
                t[l] !== e[l] && s(l)
    }
    ),
    o
}
function Ev(t, e, n) {
    t === void 0 && (t = {});
    const r = []
      , i = {
        "container-start": [],
        "container-end": [],
        "wrapper-start": [],
        "wrapper-end": []
    }
      , o = (s, a) => {
        Array.isArray(s) && s.forEach(l => {
            const c = typeof l.type == "symbol";
            a === "default" && (a = "container-end"),
            c && l.children ? o(l.children, "default") : l.type && (l.type.name === "SwiperSlide" || l.type.name === "AsyncComponentWrapper") ? r.push(l) : i[a] && i[a].push(l)
        }
        )
    }
    ;
    return Object.keys(t).forEach(s => {
        if (typeof t[s] != "function")
            return;
        const a = t[s]();
        o(a, s)
    }
    ),
    n.value = e.value,
    e.value = r,
    {
        slides: r,
        slots: i
    }
}
function Rxe({swiper: t, slides: e, passedParams: n, changedParams: r, nextEl: i, prevEl: o, scrollbarEl: s, paginationEl: a}) {
    const l = r.filter(b => b !== "children" && b !== "direction")
      , {params: c, pagination: u, navigation: f, scrollbar: d, virtual: h, thumbs: p} = t;
    let y, v, g, m, _;
    r.includes("thumbs") && n.thumbs && n.thumbs.swiper && c.thumbs && !c.thumbs.swiper && (y = !0),
    r.includes("controller") && n.controller && n.controller.control && c.controller && !c.controller.control && (v = !0),
    r.includes("pagination") && n.pagination && (n.pagination.el || a) && (c.pagination || c.pagination === !1) && u && !u.el && (g = !0),
    r.includes("scrollbar") && n.scrollbar && (n.scrollbar.el || s) && (c.scrollbar || c.scrollbar === !1) && d && !d.el && (m = !0),
    r.includes("navigation") && n.navigation && (n.navigation.prevEl || o) && (n.navigation.nextEl || i) && (c.navigation || c.navigation === !1) && f && !f.prevEl && !f.nextEl && (_ = !0);
    const x = b => {
        t[b] && (t[b].destroy(),
        b === "navigation" ? (c[b].prevEl = void 0,
        c[b].nextEl = void 0,
        t[b].prevEl = void 0,
        t[b].nextEl = void 0) : (c[b].el = void 0,
        t[b].el = void 0))
    }
    ;
    l.forEach(b => {
        if (Sl(c[b]) && Sl(n[b]))
            $s(c[b], n[b]);
        else {
            const w = n[b];
            (w === !0 || w === !1) && (b === "navigation" || b === "pagination" || b === "scrollbar") ? w === !1 && x(b) : c[b] = n[b]
        }
    }
    ),
    l.includes("controller") && !v && t.controller && t.controller.control && c.controller && c.controller.control && (t.controller.control = c.controller.control),
    r.includes("children") && e && h && c.virtual.enabled ? (h.slides = e,
    h.update(!0)) : r.includes("children") && t.lazy && t.params.lazy.enabled && t.lazy.load(),
    y && p.init() && p.update(!0),
    v && (t.controller.control = c.controller.control),
    g && (a && (c.pagination.el = a),
    u.init(),
    u.render(),
    u.update()),
    m && (s && (c.scrollbar.el = s),
    d.init(),
    d.updateSize(),
    d.setTranslate()),
    _ && (i && (c.navigation.nextEl = i),
    o && (c.navigation.prevEl = o),
    f.init(),
    f.update()),
    r.includes("allowSlideNext") && (t.allowSlideNext = n.allowSlideNext),
    r.includes("allowSlidePrev") && (t.allowSlidePrev = n.allowSlidePrev),
    r.includes("direction") && t.changeDirection(n.direction, !1),
    t.update()
}
function Mxe(t, e, n) {
    if (!n)
        return null;
    const r = t.value.isHorizontal() ? {
        [t.value.rtlTranslate ? "right" : "left"]: `${n.offset}px`
    } : {
        top: `${n.offset}px`
    };
    return e.filter( (i, o) => o >= n.from && o <= n.to).map(i => (i.props || (i.props = {}),
    i.props.style || (i.props.style = {}),
    i.props.swiperRef = t,
    i.props.style = r,
    Mn(i.type, {
        ...i.props
    }, i.children)))
}
const Dxe = t => {
    !t || t.destroyed || !t.params.virtual || t.params.virtual && !t.params.virtual.enabled || (t.updateSlides(),
    t.updateProgress(),
    t.updateSlidesClasses(),
    t.lazy && t.params.lazy.enabled && t.lazy.load(),
    t.parallax && t.params.parallax && t.params.parallax.enabled && t.parallax.setTranslate())
}
  , UPe = {
    name: "Swiper",
    props: {
        tag: {
            type: String,
            default: "div"
        },
        wrapperTag: {
            type: String,
            default: "div"
        },
        modules: {
            type: Array,
            default: void 0
        },
        init: {
            type: Boolean,
            default: void 0
        },
        direction: {
            type: String,
            default: void 0
        },
        touchEventsTarget: {
            type: String,
            default: void 0
        },
        initialSlide: {
            type: Number,
            default: void 0
        },
        speed: {
            type: Number,
            default: void 0
        },
        cssMode: {
            type: Boolean,
            default: void 0
        },
        updateOnWindowResize: {
            type: Boolean,
            default: void 0
        },
        resizeObserver: {
            type: Boolean,
            default: void 0
        },
        nested: {
            type: Boolean,
            default: void 0
        },
        focusableElements: {
            type: String,
            default: void 0
        },
        width: {
            type: Number,
            default: void 0
        },
        height: {
            type: Number,
            default: void 0
        },
        preventInteractionOnTransition: {
            type: Boolean,
            default: void 0
        },
        userAgent: {
            type: String,
            default: void 0
        },
        url: {
            type: String,
            default: void 0
        },
        edgeSwipeDetection: {
            type: [Boolean, String],
            default: void 0
        },
        edgeSwipeThreshold: {
            type: Number,
            default: void 0
        },
        autoHeight: {
            type: Boolean,
            default: void 0
        },
        setWrapperSize: {
            type: Boolean,
            default: void 0
        },
        virtualTranslate: {
            type: Boolean,
            default: void 0
        },
        effect: {
            type: String,
            default: void 0
        },
        breakpoints: {
            type: Object,
            default: void 0
        },
        spaceBetween: {
            type: Number,
            default: void 0
        },
        slidesPerView: {
            type: [Number, String],
            default: void 0
        },
        maxBackfaceHiddenSlides: {
            type: Number,
            default: void 0
        },
        slidesPerGroup: {
            type: Number,
            default: void 0
        },
        slidesPerGroupSkip: {
            type: Number,
            default: void 0
        },
        slidesPerGroupAuto: {
            type: Boolean,
            default: void 0
        },
        centeredSlides: {
            type: Boolean,
            default: void 0
        },
        centeredSlidesBounds: {
            type: Boolean,
            default: void 0
        },
        slidesOffsetBefore: {
            type: Number,
            default: void 0
        },
        slidesOffsetAfter: {
            type: Number,
            default: void 0
        },
        normalizeSlideIndex: {
            type: Boolean,
            default: void 0
        },
        centerInsufficientSlides: {
            type: Boolean,
            default: void 0
        },
        watchOverflow: {
            type: Boolean,
            default: void 0
        },
        roundLengths: {
            type: Boolean,
            default: void 0
        },
        touchRatio: {
            type: Number,
            default: void 0
        },
        touchAngle: {
            type: Number,
            default: void 0
        },
        simulateTouch: {
            type: Boolean,
            default: void 0
        },
        shortSwipes: {
            type: Boolean,
            default: void 0
        },
        longSwipes: {
            type: Boolean,
            default: void 0
        },
        longSwipesRatio: {
            type: Number,
            default: void 0
        },
        longSwipesMs: {
            type: Number,
            default: void 0
        },
        followFinger: {
            type: Boolean,
            default: void 0
        },
        allowTouchMove: {
            type: Boolean,
            default: void 0
        },
        threshold: {
            type: Number,
            default: void 0
        },
        touchMoveStopPropagation: {
            type: Boolean,
            default: void 0
        },
        touchStartPreventDefault: {
            type: Boolean,
            default: void 0
        },
        touchStartForcePreventDefault: {
            type: Boolean,
            default: void 0
        },
        touchReleaseOnEdges: {
            type: Boolean,
            default: void 0
        },
        uniqueNavElements: {
            type: Boolean,
            default: void 0
        },
        resistance: {
            type: Boolean,
            default: void 0
        },
        resistanceRatio: {
            type: Number,
            default: void 0
        },
        watchSlidesProgress: {
            type: Boolean,
            default: void 0
        },
        grabCursor: {
            type: Boolean,
            default: void 0
        },
        preventClicks: {
            type: Boolean,
            default: void 0
        },
        preventClicksPropagation: {
            type: Boolean,
            default: void 0
        },
        slideToClickedSlide: {
            type: Boolean,
            default: void 0
        },
        preloadImages: {
            type: Boolean,
            default: void 0
        },
        updateOnImagesReady: {
            type: Boolean,
            default: void 0
        },
        loop: {
            type: Boolean,
            default: void 0
        },
        loopAdditionalSlides: {
            type: Number,
            default: void 0
        },
        loopedSlides: {
            type: Number,
            default: void 0
        },
        loopedSlidesLimit: {
            type: Boolean,
            default: !0
        },
        loopFillGroupWithBlank: {
            type: Boolean,
            default: void 0
        },
        loopPreventsSlide: {
            type: Boolean,
            default: void 0
        },
        rewind: {
            type: Boolean,
            default: void 0
        },
        allowSlidePrev: {
            type: Boolean,
            default: void 0
        },
        allowSlideNext: {
            type: Boolean,
            default: void 0
        },
        swipeHandler: {
            type: Boolean,
            default: void 0
        },
        noSwiping: {
            type: Boolean,
            default: void 0
        },
        noSwipingClass: {
            type: String,
            default: void 0
        },
        noSwipingSelector: {
            type: String,
            default: void 0
        },
        passiveListeners: {
            type: Boolean,
            default: void 0
        },
        containerModifierClass: {
            type: String,
            default: void 0
        },
        slideClass: {
            type: String,
            default: void 0
        },
        slideBlankClass: {
            type: String,
            default: void 0
        },
        slideActiveClass: {
            type: String,
            default: void 0
        },
        slideDuplicateActiveClass: {
            type: String,
            default: void 0
        },
        slideVisibleClass: {
            type: String,
            default: void 0
        },
        slideDuplicateClass: {
            type: String,
            default: void 0
        },
        slideNextClass: {
            type: String,
            default: void 0
        },
        slideDuplicateNextClass: {
            type: String,
            default: void 0
        },
        slidePrevClass: {
            type: String,
            default: void 0
        },
        slideDuplicatePrevClass: {
            type: String,
            default: void 0
        },
        wrapperClass: {
            type: String,
            default: void 0
        },
        runCallbacksOnInit: {
            type: Boolean,
            default: void 0
        },
        observer: {
            type: Boolean,
            default: void 0
        },
        observeParents: {
            type: Boolean,
            default: void 0
        },
        observeSlideChildren: {
            type: Boolean,
            default: void 0
        },
        a11y: {
            type: [Boolean, Object],
            default: void 0
        },
        autoplay: {
            type: [Boolean, Object],
            default: void 0
        },
        controller: {
            type: Object,
            default: void 0
        },
        coverflowEffect: {
            type: Object,
            default: void 0
        },
        cubeEffect: {
            type: Object,
            default: void 0
        },
        fadeEffect: {
            type: Object,
            default: void 0
        },
        flipEffect: {
            type: Object,
            default: void 0
        },
        creativeEffect: {
            type: Object,
            default: void 0
        },
        cardsEffect: {
            type: Object,
            default: void 0
        },
        hashNavigation: {
            type: [Boolean, Object],
            default: void 0
        },
        history: {
            type: [Boolean, Object],
            default: void 0
        },
        keyboard: {
            type: [Boolean, Object],
            default: void 0
        },
        lazy: {
            type: [Boolean, Object],
            default: void 0
        },
        mousewheel: {
            type: [Boolean, Object],
            default: void 0
        },
        navigation: {
            type: [Boolean, Object],
            default: void 0
        },
        pagination: {
            type: [Boolean, Object],
            default: void 0
        },
        parallax: {
            type: [Boolean, Object],
            default: void 0
        },
        scrollbar: {
            type: [Boolean, Object],
            default: void 0
        },
        thumbs: {
            type: Object,
            default: void 0
        },
        virtual: {
            type: [Boolean, Object],
            default: void 0
        },
        zoom: {
            type: [Boolean, Object],
            default: void 0
        },
        grid: {
            type: [Object],
            default: void 0
        },
        freeMode: {
            type: [Boolean, Object],
            default: void 0
        },
        enabled: {
            type: Boolean,
            default: void 0
        }
    },
    emits: ["_beforeBreakpoint", "_containerClasses", "_slideClass", "_slideClasses", "_swiper", "_freeModeNoMomentumRelease", "activeIndexChange", "afterInit", "autoplay", "autoplayStart", "autoplayStop", "autoplayPause", "autoplayResume", "beforeDestroy", "beforeInit", "beforeLoopFix", "beforeResize", "beforeSlideChangeStart", "beforeTransitionStart", "breakpoint", "changeDirection", "click", "disable", "doubleTap", "doubleClick", "destroy", "enable", "fromEdge", "hashChange", "hashSet", "imagesReady", "init", "keyPress", "lazyImageLoad", "lazyImageReady", "lock", "loopFix", "momentumBounce", "navigationHide", "navigationShow", "navigationPrev", "navigationNext", "observerUpdate", "orientationchange", "paginationHide", "paginationRender", "paginationShow", "paginationUpdate", "progress", "reachBeginning", "reachEnd", "realIndexChange", "resize", "scroll", "scrollbarDragEnd", "scrollbarDragMove", "scrollbarDragStart", "setTransition", "setTranslate", "slideChange", "slideChangeTransitionEnd", "slideChangeTransitionStart", "slideNextTransitionEnd", "slideNextTransitionStart", "slidePrevTransitionEnd", "slidePrevTransitionStart", "slideResetTransitionStart", "slideResetTransitionEnd", "sliderMove", "sliderFirstMove", "slidesLengthChange", "slidesGridLengthChange", "snapGridLengthChange", "snapIndexChange", "swiper", "tap", "toEdge", "touchEnd", "touchMove", "touchMoveOpposite", "touchStart", "transitionEnd", "transitionStart", "unlock", "update", "virtualUpdate", "zoomChange"],
    setup(t, e) {
        let {slots: n, emit: r} = e;
        const {tag: i, wrapperTag: o} = t
          , s = Z("swiper")
          , a = Z(null)
          , l = Z(!1)
          , c = Z(!1)
          , u = Z(null)
          , f = Z(null)
          , d = Z(null)
          , h = {
            value: []
        }
          , p = {
            value: []
        }
          , y = Z(null)
          , v = Z(null)
          , g = Z(null)
          , m = Z(null)
          , {params: _, passedParams: x} = vP(t, !1);
        Ev(n, h, p),
        d.value = x,
        p.value = h.value;
        const b = () => {
            Ev(n, h, p),
            l.value = !0
        }
        ;
        if (_.onAny = function(E) {
            for (var S = arguments.length, P = new Array(S > 1 ? S - 1 : 0), C = 1; C < S; C++)
                P[C - 1] = arguments[C];
            r(E, ...P)
        }
        ,
        Object.assign(_.on, {
            _beforeBreakpoint: b,
            _containerClasses(E, S) {
                s.value = S
            }
        }),
        f.value = new ru(_),
        f.value.loopCreate = () => {}
        ,
        f.value.loopDestroy = () => {}
        ,
        _.loop && (f.value.loopedSlides = b9(h.value, _)),
        f.value.virtual && f.value.params.virtual.enabled) {
            f.value.virtual.slides = h.value;
            const E = {
                cache: !1,
                slides: h.value,
                renderExternal: S => {
                    a.value = S
                }
                ,
                renderExternalUpdate: !1
            };
            $s(f.value.params.virtual, E),
            $s(f.value.originalParams.virtual, E)
        }
        Rl( () => {
            !c.value && f.value && (f.value.emitSlidesClasses(),
            c.value = !0);
            const {passedParams: E} = vP(t, !1)
              , S = Oxe(E, d.value, h.value, p.value, P => P.props && P.props.key);
            d.value = E,
            (S.length || l.value) && f.value && !f.value.destroyed && Rxe({
                swiper: f.value,
                slides: h.value,
                passedParams: E,
                changedParams: S,
                nextEl: y.value,
                prevEl: v.value,
                scrollbarEl: m.value,
                paginationEl: g.value
            }),
            l.value = !1
        }
        ),
        hi("swiper", f),
        ve(a, () => {
            Xe( () => {
                Dxe(f.value)
            }
            )
        }
        ),
        Ht( () => {
            u.value && (Pxe({
                el: u.value,
                nextEl: y.value,
                prevEl: v.value,
                paginationEl: g.value,
                scrollbarEl: m.value,
                swiper: f.value
            }, _),
            r("swiper", f.value))
        }
        ),
        qr( () => {
            f.value && !f.value.destroyed && f.value.destroy(!0, !1)
        }
        );
        function w(E) {
            return _.virtual ? Mxe(f, E, a.value) : !_.loop || f.value && f.value.destroyed ? (E.forEach(S => {
                S.props || (S.props = {}),
                S.props.swiperRef = f
            }
            ),
            E) : Ixe(f, E, _)
        }
        return () => {
            const {slides: E, slots: S} = Ev(n, h, p);
            return Mn(i, {
                ref: u,
                class: _9(s.value)
            }, [S["container-start"], Mn(o, {
                class: "swiper-wrapper"
            }, [S["wrapper-start"], w(E), S["wrapper-end"]]), m9(t) && [Mn("div", {
                ref: v,
                class: "swiper-button-prev"
            }), Mn("div", {
                ref: y,
                class: "swiper-button-next"
            })], y9(t) && Mn("div", {
                ref: m,
                class: "swiper-scrollbar"
            }), v9(t) && Mn("div", {
                ref: g,
                class: "swiper-pagination"
            }), S["container-end"]])
        }
    }
}
  , GPe = {
    name: "SwiperSlide",
    props: {
        tag: {
            type: String,
            default: "div"
        },
        swiperRef: {
            type: Object,
            required: !1
        },
        zoom: {
            type: Boolean,
            default: void 0
        },
        virtualIndex: {
            type: [String, Number],
            default: void 0
        }
    },
    setup(t, e) {
        let {slots: n} = e
          , r = !1;
        const {swiperRef: i} = t
          , o = Z(null)
          , s = Z("swiper-slide");
        function a(c, u, f) {
            u === o.value && (s.value = f)
        }
        Ht( () => {
            !i || !i.value || (i.value.on("_slideClass", a),
            r = !0)
        }
        ),
        dg( () => {
            r || !i || !i.value || (i.value.on("_slideClass", a),
            r = !0)
        }
        ),
        Rl( () => {
            !o.value || !i || !i.value || i.value.destroyed && s.value !== "swiper-slide" && (s.value = "swiper-slide")
        }
        ),
        qr( () => {
            !i || !i.value || i.value.off("_slideClass", a)
        }
        );
        const l = re( () => ({
            isActive: s.value.indexOf("swiper-slide-active") >= 0 || s.value.indexOf("swiper-slide-duplicate-active") >= 0,
            isVisible: s.value.indexOf("swiper-slide-visible") >= 0,
            isDuplicate: s.value.indexOf("swiper-slide-duplicate") >= 0,
            isPrev: s.value.indexOf("swiper-slide-prev") >= 0 || s.value.indexOf("swiper-slide-duplicate-prev") >= 0,
            isNext: s.value.indexOf("swiper-slide-next") >= 0 || s.value.indexOf("swiper-slide-duplicate-next") >= 0
        }));
        return hi("swiperSlide", l),
        () => Mn(t.tag, {
            class: _9(`${s.value}`),
            ref: o,
            "data-swiper-slide-index": t.virtualIndex
        }, t.zoom ? Mn("div", {
            class: "swiper-zoom-container",
            "data-swiper-zoom": typeof t.zoom == "number" ? t.zoom : void 0
        }, n.default && n.default(l.value)) : n.default && n.default(l.value))
    }
};
var be = {
    pullStartY: null,
    pullMoveY: null,
    handlers: [],
    styleEl: null,
    events: null,
    dist: 0,
    state: "pending",
    timeout: null,
    distResisted: 0,
    supportsPassive: !1,
    supportsPointerEvents: typeof window < "u" && !!window.PointerEvent
};
try {
    window.addEventListener("test", null, {
        get passive() {
            be.supportsPassive = !0
        }
    })
} catch {}
function Bxe(t) {
    if (!t.ptrElement) {
        var e = document.createElement("div");
        t.mainElement !== document.body ? t.mainElement.parentNode.insertBefore(e, t.mainElement) : document.body.insertBefore(e, document.body.firstChild),
        e.classList.add(t.classPrefix + "ptr"),
        e.innerHTML = t.getMarkup().replace(/__PREFIX__/g, t.classPrefix),
        t.ptrElement = e,
        typeof t.onInit == "function" && t.onInit(t),
        be.styleEl || (be.styleEl = document.createElement("style"),
        be.styleEl.setAttribute("id", "pull-to-refresh-js-style"),
        document.head.appendChild(be.styleEl)),
        be.styleEl.textContent = t.getStyles().replace(/__PREFIX__/g, t.classPrefix).replace(/\s+/g, " ")
    }
    return t
}
function kxe(t) {
    t.ptrElement && (t.ptrElement.classList.remove(t.classPrefix + "refresh"),
    t.ptrElement.style[t.cssProp] = "0px",
    setTimeout(function() {
        t.ptrElement && t.ptrElement.parentNode && (t.ptrElement.parentNode.removeChild(t.ptrElement),
        t.ptrElement = null),
        be.state = "pending"
    }, t.refreshTimeout))
}
function Nxe(t) {
    var e = t.ptrElement.querySelector("." + t.classPrefix + "icon")
      , n = t.ptrElement.querySelector("." + t.classPrefix + "text");
    e && (be.state === "refreshing" ? e.innerHTML = t.iconRefreshing : e.innerHTML = t.iconArrow),
    n && (be.state === "releasing" && (n.innerHTML = t.instructionsReleaseToRefresh),
    (be.state === "pulling" || be.state === "pending") && (n.innerHTML = t.instructionsPullToRefresh),
    be.state === "refreshing" && (n.innerHTML = t.instructionsRefreshing))
}
var Fr = {
    setupDOM: Bxe,
    onReset: kxe,
    update: Nxe
}, yP, Sv = function(e) {
    return be.pointerEventsEnabled && be.supportsPointerEvents ? e.screenY : e.touches[0].screenY
}, w9 = function() {
    var t;
    function e(s) {
        var a = be.handlers.filter(function(l) {
            return l.contains(s.target)
        })[0];
        be.enable = !!a,
        a && be.state === "pending" && (t = Fr.setupDOM(a),
        a.shouldPullToRefresh() && (be.pullStartY = Sv(s)),
        clearTimeout(be.timeout),
        Fr.update(a))
    }
    function n(s) {
        if (t && t.ptrElement && be.enable) {
            if (be.pullStartY ? be.pullMoveY = Sv(s) : t.shouldPullToRefresh() && (be.pullStartY = Sv(s)),
            be.state === "refreshing") {
                s.cancelable && t.shouldPullToRefresh() && be.pullStartY < be.pullMoveY && s.preventDefault();
                return
            }
            be.state === "pending" && (t.ptrElement.classList.add(t.classPrefix + "pull"),
            be.state = "pulling",
            Fr.update(t)),
            be.pullStartY && be.pullMoveY && (be.dist = be.pullMoveY - be.pullStartY),
            be.distExtra = be.dist - t.distIgnore,
            be.distExtra > 0 && (s.cancelable && s.preventDefault(),
            t.ptrElement.style[t.cssProp] = be.distResisted + "px",
            be.distResisted = t.resistanceFunction(be.distExtra / t.distThreshold) * Math.min(t.distMax, be.distExtra),
            be.state === "pulling" && be.distResisted > t.distThreshold && (t.ptrElement.classList.add(t.classPrefix + "release"),
            be.state = "releasing",
            Fr.update(t)),
            be.state === "releasing" && be.distResisted < t.distThreshold && (t.ptrElement.classList.remove(t.classPrefix + "release"),
            be.state = "pulling",
            Fr.update(t)))
        }
    }
    function r() {
        if (t && t.ptrElement && be.enable) {
            if (clearTimeout(yP),
            yP = setTimeout(function() {
                t && t.ptrElement && be.state === "pending" && Fr.onReset(t)
            }, 500),
            be.state === "releasing" && be.distResisted > t.distThreshold)
                be.state = "refreshing",
                t.ptrElement.style[t.cssProp] = t.distReload + "px",
                t.ptrElement.classList.add(t.classPrefix + "refresh"),
                be.timeout = setTimeout(function() {
                    var s = t.onRefresh(function() {
                        return Fr.onReset(t)
                    });
                    s && typeof s.then == "function" && s.then(function() {
                        return Fr.onReset(t)
                    }),
                    !s && !t.onRefresh.length && Fr.onReset(t)
                }, t.refreshTimeout);
            else {
                if (be.state === "refreshing")
                    return;
                t.ptrElement.style[t.cssProp] = "0px",
                be.state = "pending"
            }
            Fr.update(t),
            t.ptrElement.classList.remove(t.classPrefix + "release"),
            t.ptrElement.classList.remove(t.classPrefix + "pull"),
            be.pullStartY = be.pullMoveY = null,
            be.dist = be.distResisted = 0
        }
    }
    function i() {
        t && t.mainElement.classList.toggle(t.classPrefix + "top", t.shouldPullToRefresh())
    }
    var o = be.supportsPassive ? {
        passive: be.passive || !1
    } : void 0;
    return be.pointerEventsEnabled && be.supportsPointerEvents ? (window.addEventListener("pointerup", r),
    window.addEventListener("pointerdown", e),
    window.addEventListener("pointermove", n, o)) : (window.addEventListener("touchend", r),
    window.addEventListener("touchstart", e),
    window.addEventListener("touchmove", n, o)),
    window.addEventListener("scroll", i),
    {
        onTouchEnd: r,
        onTouchStart: e,
        onTouchMove: n,
        onScroll: i,
        destroy: function() {
            be.pointerEventsEnabled && be.supportsPointerEvents ? (window.removeEventListener("pointerdown", e),
            window.removeEventListener("pointerup", r),
            window.removeEventListener("pointermove", n, o)) : (window.removeEventListener("touchstart", e),
            window.removeEventListener("touchend", r),
            window.removeEventListener("touchmove", n, o)),
            window.removeEventListener("scroll", i)
        }
    }
}, Fxe = `
<div class="__PREFIX__box">
  <div class="__PREFIX__content">
    <div class="__PREFIX__icon"></div>
    <div class="__PREFIX__text"></div>
  </div>
</div>
`, Lxe = `
.__PREFIX__ptr {
  box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  font-size: 0.85em;
  font-weight: bold;
  top: 0;
  height: 0;
  transition: height 0.3s, min-height 0.3s;
  text-align: center;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  align-content: stretch;
}

.__PREFIX__box {
  padding: 10px;
  flex-basis: 100%;
}

.__PREFIX__pull {
  transition: none;
}

.__PREFIX__text {
  margin-top: .33em;
  color: rgba(0, 0, 0, 0.3);
}

.__PREFIX__icon {
  color: rgba(0, 0, 0, 0.3);
  transition: transform .3s;
}

/*
When at the top of the page, disable vertical overscroll so passive touch
listeners can take over.
*/
.__PREFIX__top {
  touch-action: pan-x pan-down pinch-zoom;
}

.__PREFIX__release .__PREFIX__icon {
  transform: rotate(180deg);
}
`, Cv = {
    distThreshold: 60,
    distMax: 80,
    distReload: 50,
    distIgnore: 0,
    mainElement: "body",
    triggerElement: "body",
    ptrElement: ".ptr",
    classPrefix: "ptr--",
    cssProp: "min-height",
    iconArrow: "&#8675;",
    iconRefreshing: "&hellip;",
    instructionsPullToRefresh: "Pull down to refresh",
    instructionsReleaseToRefresh: "Release to refresh",
    instructionsRefreshing: "Refreshing",
    refreshTimeout: 500,
    getMarkup: function() {
        return Fxe
    },
    getStyles: function() {
        return Lxe
    },
    onInit: function() {},
    onRefresh: function() {
        return location.reload()
    },
    resistanceFunction: function(t) {
        return Math.min(1, t / 2.5)
    },
    shouldPullToRefresh: function() {
        return !window.scrollY
    }
}, $xe = ["mainElement", "ptrElement", "triggerElement"], _P = function(t) {
    var e = {};
    return Object.keys(Cv).forEach(function(n) {
        e[n] = t[n] || Cv[n]
    }),
    e.refreshTimeout = typeof t.refreshTimeout == "number" ? t.refreshTimeout : Cv.refreshTimeout,
    $xe.forEach(function(n) {
        typeof e[n] == "string" && (e[n] = document.querySelector(e[n]))
    }),
    be.events || (be.events = w9()),
    e.contains = function(n) {
        return e.triggerElement.contains(n)
    }
    ,
    e.destroy = function() {
        clearTimeout(be.timeout);
        var n = be.handlers.indexOf(e);
        be.handlers.splice(n, 1)
    }
    ,
    e
}, Uxe = {
    setPassiveMode: function(e) {
        be.passive = e
    },
    setPointerEventsMode: function(e) {
        be.pointerEventsEnabled = e
    },
    destroyAll: function() {
        be.events && (be.events.destroy(),
        be.events = null),
        be.handlers.forEach(function(e) {
            e.destroy()
        })
    },
    init: function(e) {
        e === void 0 && (e = {});
        var n = _P(e);
        return be.handlers.push(n),
        n
    },
    _: {
        setupHandler: _P,
        setupEvents: w9,
        setupDOM: Fr.setupDOM,
        onReset: Fr.onReset,
        update: Fr.update
    }
};
const HPe = Uxe;
var E9 = !1;
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var Er = function() {
    return Er = Object.assign || function(t) {
        for (var e, n = 1, r = arguments.length; n < r; n++)
            for (var i in e = arguments[n])
                Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
        return t
    }
    ,
    Er.apply(this, arguments)
};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var xx = function(t, e) {
    return xx = Object.setPrototypeOf || {
        __proto__: []
    }instanceof Array && function(n, r) {
        n.__proto__ = r
    }
    || function(n, r) {
        for (var i in r)
            Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i])
    }
    ,
    xx(t, e)
};
function tE(t, e) {
    if (typeof e != "function" && e !== null)
        throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
    function n() {
        this.constructor = t
    }
    xx(t, e),
    t.prototype = e === null ? Object.create(e) : (n.prototype = e.prototype,
    new n)
}
var Jo = function() {
    return Jo = Object.assign || function(t) {
        for (var e, n = 1, r = arguments.length; n < r; n++)
            for (var i in e = arguments[n])
                Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
        return t
    }
    ,
    Jo.apply(this, arguments)
};
function Qo(t, e, n, r) {
    return new (n || (n = Promise))(function(i, o) {
        function s(c) {
            try {
                l(r.next(c))
            } catch (u) {
                o(u)
            }
        }
        function a(c) {
            try {
                l(r.throw(c))
            } catch (u) {
                o(u)
            }
        }
        function l(c) {
            var u;
            c.done ? i(c.value) : (u = c.value,
            u instanceof n ? u : new n(function(f) {
                f(u)
            }
            )).then(s, a)
        }
        l((r = r.apply(t, e || [])).next())
    }
    )
}
function es(t, e) {
    var n, r, i, o, s = {
        label: 0,
        sent: function() {
            if (1 & i[0])
                throw i[1];
            return i[1]
        },
        trys: [],
        ops: []
    };
    return o = {
        next: a(0),
        throw: a(1),
        return: a(2)
    },
    typeof Symbol == "function" && (o[Symbol.iterator] = function() {
        return this
    }
    ),
    o;
    function a(l) {
        return function(c) {
            return function(u) {
                if (n)
                    throw new TypeError("Generator is already executing.");
                for (; s; )
                    try {
                        if (n = 1,
                        r && (i = 2 & u[0] ? r.return : u[0] ? r.throw || ((i = r.return) && i.call(r),
                        0) : r.next) && !(i = i.call(r, u[1])).done)
                            return i;
                        switch (r = 0,
                        i && (u = [2 & u[0], i.value]),
                        u[0]) {
                        case 0:
                        case 1:
                            i = u;
                            break;
                        case 4:
                            return s.label++,
                            {
                                value: u[1],
                                done: !1
                            };
                        case 5:
                            s.label++,
                            r = u[1],
                            u = [0];
                            continue;
                        case 7:
                            u = s.ops.pop(),
                            s.trys.pop();
                            continue;
                        default:
                            if (!((i = (i = s.trys).length > 0 && i[i.length - 1]) || u[0] !== 6 && u[0] !== 2)) {
                                s = 0;
                                continue
                            }
                            if (u[0] === 3 && (!i || u[1] > i[0] && u[1] < i[3])) {
                                s.label = u[1];
                                break
                            }
                            if (u[0] === 6 && s.label < i[1]) {
                                s.label = i[1],
                                i = u;
                                break
                            }
                            if (i && s.label < i[2]) {
                                s.label = i[2],
                                s.ops.push(u);
                                break
                            }
                            i[2] && s.ops.pop(),
                            s.trys.pop();
                            continue
                        }
                        u = e.call(t, s)
                    } catch (f) {
                        u = [6, f],
                        r = 0
                    } finally {
                        n = i = 0
                    }
                if (5 & u[0])
                    throw u[1];
                return {
                    value: u[0] ? u[1] : void 0,
                    done: !0
                }
            }([l, c])
        }
    }
}
function yc(t, e) {
    for (var n = 0, r = e.length, i = t.length; n < r; n++,
    i++)
        t[i] = e[n];
    return t
}
Array.prototype.includes || Object.defineProperty(Array.prototype, "includes", {
    value: function(t, e) {
        if (this == null)
            throw new TypeError('"this" is null or not defined');
        var n = Object(this)
          , r = n.length >>> 0;
        if (r === 0)
            return !1;
        for (var i, o, s = 0 | e, a = Math.max(s >= 0 ? s : r - Math.abs(s), 0); a < r; ) {
            if ((i = n[a]) === (o = t) || typeof i == "number" && typeof o == "number" && isNaN(i) && isNaN(o))
                return !0;
            a++
        }
        return !1
    }
}),
String.prototype.includes || (String.prototype.includes = function(t, e) {
    return typeof e != "number" && (e = 0),
    !(e + t.length > this.length) && this.indexOf(t, e) !== -1
}
),
Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
    value: function(t) {
        if (this == null)
            throw new TypeError('"this" is null or not defined');
        var e = Object(this)
          , n = e.length >>> 0;
        if (typeof t != "function")
            throw new TypeError("predicate must be a function");
        for (var r = arguments[1], i = 0; i < n; ) {
            var o = e[i];
            if (t.call(r, o, i, e))
                return o;
            i++
        }
    }
});
var Sd = function(t) {
    for (var e = [], n = 1; n < arguments.length; n++)
        e[n - 1] = arguments[n];
    return e.some(function(r) {
        return Object.prototype.toString.call(t).slice(8, -1).toLowerCase() === r
    })
}
  , iu = function(t, e) {
    return Object.prototype.hasOwnProperty.call(t, e)
}
  , nE = function(t) {
    return [].filter.call(t, function(e) {
        return e !== `
`
    }).join("")
}
  , Us = function(t) {
    if (typeof t != "string" || (t = t.toLocaleLowerCase().trim()) === "transparent")
        return !1;
    var e;
    return !(/^rgba/.test(t) && ((e = /([^\s,]+)\)$/.exec(t)) === null ? 0 : typeof e == "object" ? NaN : typeof e == "number" ? e : typeof e == "string" ? e[e.length - 1] === "%" ? Number(e.slice(0, -1)) / 100 : Number(e) : NaN) === 0)
}
  , S9 = function(t, e) {
    var n, r = ((n = t.padding) === null || n === void 0 ? void 0 : n.split(" ").map(function(u) {
        return e(u)
    })) || [0], i = 0, o = 0, s = 0, a = 0;
    switch (r.length) {
    case 1:
        i = o = s = a = r[0];
        break;
    case 2:
        i = o = r[0],
        s = a = r[1];
        break;
    case 3:
        i = r[0],
        s = a = r[1],
        o = r[2];
        break;
    default:
        i = r[0],
        o = r[1],
        s = r[2],
        a = r[3]
    }
    var l = {
        paddingTop: i,
        paddingBottom: o,
        paddingLeft: s,
        paddingRight: a
    };
    for (var c in l)
        l[c] = iu(t, c) && Sd(t[c], "string", "number") ? e(t[c]) : l[c];
    return [i, o, s, a]
}
  , C9 = function(t) {
    var e = []
      , n = t.map(function(i) {
        return Number(i)
    }).reduce(function(i, o) {
        if (o > 0) {
            var s = i + o;
            return e.push(s),
            s
        }
        return e.push(NaN),
        i
    }, 0)
      , r = Math.random() * n;
    return e.findIndex(function(i) {
        return r <= i
    })
}
  , rE = function(t, e, n, r) {
    r === void 0 && (r = 1 / 0),
    r <= 0 && (r = 1 / 0);
    for (var i = "", o = [], s = t.measureText("...").width, a = 0; a < e.length; a++) {
        i += e[a];
        var l = t.measureText(i).width
          , c = n(o);
        if (r === o.length + 1 && (l += s),
        c < 0)
            return o;
        if (l > c && (o.push(i.slice(0, -1)),
        i = e[a]),
        r === o.length)
            return o[o.length - 1] += "...",
            o
    }
    return i && o.push(i),
    o.length || o.push(e),
    o
}
  , Ya = function() {
    function t() {
        this.subs = []
    }
    return t.prototype.addSub = function(e) {
        this.subs.includes(e) || this.subs.push(e)
    }
    ,
    t.prototype.notify = function() {
        this.subs.forEach(function(e) {
            e.update()
        })
    }
    ,
    t
}()
  , Gxe = "__proto__"in {};
function xP(t, e, n, r) {
    Object.defineProperty(t, e, {
        value: n,
        enumerable: !!r,
        writable: !0,
        configurable: !0
    })
}
var A9 = Array.prototype
  , Vp = Object.create(A9);
["push", "pop", "shift", "unshift", "sort", "splice", "reverse"].forEach(function(t) {
    Vp[t] = function() {
        for (var e = [], n = 0; n < arguments.length; n++)
            e[n] = arguments[n];
        var r = A9[t].apply(this, e)
          , i = this.__luckyOb__;
        return ["push", "unshift", "splice"].includes(t) && i.walk(this),
        i.dep.notify(),
        r
    }
});
var Hxe = function() {
    function t(e) {
        this.dep = new Ya,
        xP(e, "__luckyOb__", this),
        Array.isArray(e) && (Gxe ? e.__proto__ = Vp : Object.getOwnPropertyNames(Vp).forEach(function(n) {
            xP(e, n, Vp[n])
        })),
        this.walk(e)
    }
    return t.prototype.walk = function(e) {
        Object.keys(e).forEach(function(n) {
            T9(e, n, e[n])
        })
    }
    ,
    t
}();
function bP(t) {
    if (t && typeof t == "object")
        return "__luckyOb__"in t ? t.__luckyOb__ : new Hxe(t)
}
function T9(t, e, n) {
    var r = new Ya
      , i = Object.getOwnPropertyDescriptor(t, e);
    if (!i || i.configurable !== !1) {
        var o = i && i.get
          , s = i && i.set;
        o && !s || arguments.length !== 2 || (n = t[e]);
        var a = bP(n);
        Object.defineProperty(t, e, {
            get: function() {
                var l = o ? o.call(t) : n;
                return Ya.target && (r.addSub(Ya.target),
                a && a.dep.addSub(Ya.target)),
                l
            },
            set: function(l) {
                l !== n && (n = l,
                o && !s || (s ? s.call(t, l) : n = l,
                a = bP(l),
                r.notify()))
            }
        })
    }
}
var Vxe = 0
  , zxe = function() {
    function t(e, n, r, i) {
        i === void 0 && (i = {}),
        this.id = Vxe++,
        this.$lucky = e,
        this.expr = n,
        this.deep = !!i.deep,
        this.getter = typeof n == "function" ? n : function(o) {
            o += ".";
            for (var s = [], a = "", l = 0; l < o.length; l++) {
                var c = o[l];
                if (/\[|\./.test(c))
                    s.push(a),
                    a = "";
                else {
                    if (/\W/.test(c))
                        continue;
                    a += c
                }
            }
            return function(u) {
                return s.reduce(function(f, d) {
                    return f[d]
                }, u)
            }
        }(n),
        this.cb = r,
        this.value = this.get()
    }
    return t.prototype.get = function() {
        Ya.target = this;
        var e = this.getter.call(this.$lucky, this.$lucky);
        return this.deep && function(n) {
            var r = function(i) {
                Sd(i, "array", "object") && Object.keys(i).forEach(function(o) {
                    var s = i[o];
                    r(s)
                })
            };
            r(n)
        }(e),
        Ya.target = null,
        e
    }
    ,
    t.prototype.update = function() {
        var e = this.get()
          , n = this.value;
        this.value = e,
        this.cb.call(this.$lucky, e, n)
    }
    ,
    t
}()
  , iE = function() {
    function t(e, n) {
        var r = this;
        this.version = "1.7.21",
        this.htmlFontSize = 16,
        this.rAF = function() {}
        ,
        this.boxWidth = 0,
        this.boxHeight = 0,
        typeof e == "string" ? e = {
            el: e
        } : e.nodeType === 1 && (e = {
            el: "",
            divElement: e
        }),
        e = e,
        this.config = e,
        this.data = n,
        e.flag || (e.flag = "WEB"),
        e.el && (e.divElement = document.querySelector(e.el)),
        e.divElement && (e.canvasElement = document.createElement("canvas"),
        e.divElement.appendChild(e.canvasElement)),
        e.canvasElement && (e.ctx = e.canvasElement.getContext("2d"),
        e.canvasElement.setAttribute("package", "lucky-canvas@1.7.21"),
        e.canvasElement.addEventListener("click", function(i) {
            return r.handleClick(i)
        })),
        this.ctx = e.ctx,
        this.initWindowFunction(),
        this.config.ctx || console.error("无法获取到 CanvasContext2D"),
        window && typeof window.addEventListener == "function" && window.addEventListener("resize", function(i, o) {
            o === void 0 && (o = 300);
            var s = null;
            return function() {
                for (var a = this, l = [], c = 0; c < arguments.length; c++)
                    l[c] = arguments[c];
                s || (s = setTimeout(function() {
                    i.apply(a, l),
                    clearTimeout(s),
                    s = null
                }, o))
            }
        }(function() {
            return r.resize()
        }, 300)),
        window && typeof window.MutationObserver == "function" && new window.MutationObserver(function() {
            r.resize()
        }
        ).observe(document.documentElement, {
            attributes: !0
        })
    }
    return t.prototype.resize = function() {
        var e, n;
        (n = (e = this.config).beforeResize) === null || n === void 0 || n.call(e),
        this.setHTMLFontSize(),
        this.setDpr(),
        this.resetWidthAndHeight(),
        this.zoomCanvas()
    }
    ,
    t.prototype.initLucky = function() {
        if (this.resize(),
        !this.boxWidth || !this.boxHeight)
            return console.error("无法获取到宽度或高度")
    }
    ,
    t.prototype.handleClick = function(e) {}
    ,
    t.prototype.setHTMLFontSize = function() {
        window && (this.htmlFontSize = +window.getComputedStyle(document.documentElement).fontSize.slice(0, -2))
    }
    ,
    t.prototype.clearCanvas = function() {
        var e = [this.boxWidth, this.boxHeight]
          , n = e[0]
          , r = e[1];
        this.ctx.clearRect(-n, -r, 2 * n, 2 * r)
    }
    ,
    t.prototype.setDpr = function() {
        var e = this.config;
        e.dpr || (window ? window.dpr = e.dpr = window.devicePixelRatio || 1 : e.dpr || console.error(e, "未传入 dpr 可能会导致绘制异常"))
    }
    ,
    t.prototype.resetWidthAndHeight = function() {
        var e = this.config
          , n = this.data
          , r = 0
          , i = 0;
        e.divElement && (r = e.divElement.offsetWidth,
        i = e.divElement.offsetHeight),
        this.boxWidth = this.getLength(n.width || e.width) || r,
        this.boxHeight = this.getLength(n.height || e.height) || i,
        e.divElement && (e.divElement.style.overflow = "hidden",
        e.divElement.style.width = this.boxWidth + "px",
        e.divElement.style.height = this.boxHeight + "px")
    }
    ,
    t.prototype.zoomCanvas = function() {
        var e = this.config
          , n = this.ctx
          , r = e.canvasElement
          , i = e.dpr
          , o = [this.boxWidth * i, this.boxHeight * i]
          , s = o[0]
          , a = o[1];
        r && (r.width = s,
        r.height = a,
        r.style.width = s + "px",
        r.style.height = a + "px",
        r.style["transform-origin"] = "left top",
        r.style.transform = "scale(" + 1 / i + ")",
        n.scale(i, i))
    }
    ,
    t.prototype.initWindowFunction = function() {
        var e = this.config;
        if (window)
            return this.rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(r) {
                window.setTimeout(r, 1e3 / 60)
            }
            ,
            e.setTimeout = window.setTimeout,
            e.setInterval = window.setInterval,
            e.clearTimeout = window.clearTimeout,
            void (e.clearInterval = window.clearInterval);
        if (e.rAF)
            this.rAF = e.rAF;
        else if (e.setTimeout) {
            var n = e.setTimeout;
            this.rAF = function(r) {
                return n(r, 16.7)
            }
        } else
            this.rAF = function(r) {
                return setTimeout(r, 16.7)
            }
    }
    ,
    t.prototype.loadImg = function(e, n, r) {
        var i = this;
        return r === void 0 && (r = "$resolve"),
        new Promise(function(o, s) {
            if (e || s("=> '" + n.src + "' 不能为空或不合法"),
            i.config.flag !== "WEB")
                return n[r] = o,
                void (n.$reject = s);
            var a = new Image;
            a.onload = function() {
                return o(a)
            }
            ,
            a.onerror = function() {
                return s("=> '" + n.src + "' 图片加载失败")
            }
            ,
            a.src = e
        }
        )
    }
    ,
    t.prototype.drawImage = function(e, n) {
        for (var r, i = [], o = 2; o < arguments.length; o++)
            i[o - 2] = arguments[o];
        var s = this.config
          , a = s.flag
          , l = s.dpr;
        if (["WEB", "MP-WX"].includes(a))
            r = n;
        else {
            if (!["UNI-H5", "UNI-MP", "TARO-H5", "TARO-MP"].includes(a))
                return console.error("意料之外的 flag, 该平台尚未兼容!");
            r = n.path
        }
        if (!r.canvas)
            return i.length === 8 && (i = i.map(function(f, d) {
                return d < 4 ? f * l : f
            })),
            e.drawImage.apply(e, yc([r], i));
        var c = r.canvas.getContext("2d");
        i = i.map(function(f) {
            return f * l
        });
        var u = c.getImageData.apply(c, i.slice(0, 4));
        e.putImageData.apply(e, yc([u], i.slice(4, 6)))
    }
    ,
    t.prototype.computedWidthAndHeight = function(e, n, r, i) {
        if (!n.width && !n.height)
            return [e.width, e.height];
        if (n.width && !n.height) {
            var o = this.getLength(n.width, r);
            return [o, e.height * (o / e.width)]
        }
        if (!n.width && n.height) {
            var s = this.getLength(n.height, i);
            return [e.width * (s / e.height), s]
        }
        return [this.getLength(n.width, r), this.getLength(n.height, i)]
    }
    ,
    t.prototype.changeUnits = function(e, n) {
        var r = this;
        n === void 0 && (n = 1);
        var i = this.config;
        return Number(e.replace(/^([-]*[0-9.]*)([a-z%]*)$/, function(o, s, a) {
            var l = {
                "%": function(u) {
                    return u * (n / 100)
                },
                px: function(u) {
                    return 1 * u
                },
                rem: function(u) {
                    return u * r.htmlFontSize
                },
                vw: function(u) {
                    return u / 100 * window.innerWidth
                }
            }[a];
            if (l)
                return l(s);
            var c = i.handleCssUnit || i.unitFunc;
            return c ? c(s, a) : s
        }))
    }
    ,
    t.prototype.getLength = function(e, n) {
        return Sd(e, "number") ? e : Sd(e, "string") ? this.changeUnits(e, n) : 0
    }
    ,
    t.prototype.getOffsetX = function(e, n) {
        return n === void 0 && (n = 0),
        (n - e) / 2
    }
    ,
    t.prototype.getOffscreenCanvas = function(e, n) {
        if (!iu(this, "_offscreenCanvas") && (window && window.document && this.config.flag === "WEB" ? this._offscreenCanvas = document.createElement("canvas") : this._offscreenCanvas = this.config.offscreenCanvas,
        !this._offscreenCanvas))
            return console.error("离屏 Canvas 无法渲染!");
        var r = this.config.dpr
          , i = this._offscreenCanvas;
        i.width = (e || 300) * r,
        i.height = (n || 150) * r;
        var o = i.getContext("2d");
        return o.clearRect(0, 0, e, n),
        o.scale(r, r),
        o.dpr = r,
        {
            _offscreenCanvas: i,
            _ctx: o
        }
    }
    ,
    t.prototype.$set = function(e, n, r) {
        e && typeof e == "object" && T9(e, n, r)
    }
    ,
    t.prototype.$computed = function(e, n, r) {
        var i = this;
        Object.defineProperty(e, n, {
            get: function() {
                return r.call(i)
            }
        })
    }
    ,
    t.prototype.$watch = function(e, n, r) {
        r === void 0 && (r = {}),
        typeof n == "object" && (n = (r = n).handler);
        var i = new zxe(this,e,n,r);
        return r.immediate && n.call(this, i.value),
        function() {}
    }
    ,
    t.version = "1.7.21",
    t
}()
  , Ca = function(t) {
    return Math.PI / 180 * t
}
  , L0 = function(t) {
    for (var e = [], n = 1; n < arguments.length; n++)
        e[n - 1] = arguments[n];
    var r = e[0]
      , i = e[1]
      , o = e[2]
      , s = e[3]
      , a = e[4]
      , l = Math.min(o, s)
      , c = Math.PI;
    a > l / 2 && (a = l / 2),
    t.beginPath(),
    t.moveTo(r + a, i),
    t.lineTo(r + a, i),
    t.lineTo(r + o - a, i),
    t.arc(r + o - a, i + a, a, -c / 2, 0),
    t.lineTo(r + o, i + s - a),
    t.arc(r + o - a, i + s - a, a, 0, c / 2),
    t.lineTo(r + a, i + s),
    t.arc(r + a, i + s - a, a, c / 2, c),
    t.lineTo(r, i + a),
    t.arc(r + a, i + a, a, c, -c / 2),
    t.closePath()
}
  , oE = function(t, e, n, r) {
    return t >= r && (t = r),
    n * (t /= r) * t + e
}
  , ou = function(t, e, n, r) {
    return t >= r && (t = r),
    -n * (t /= r) * (t - 2) + e
}
  , jxe = function(t) {
    function e(n, r) {
        var i, o = t.call(this, n, {
            width: r.width,
            height: r.height
        }) || this;
        return o.blocks = [],
        o.prizes = [],
        o.buttons = [],
        o.defaultConfig = {},
        o.defaultStyle = {},
        o._defaultConfig = {},
        o._defaultStyle = {},
        o.Radius = 0,
        o.prizeRadius = 0,
        o.prizeDeg = 0,
        o.prizeAng = 0,
        o.rotateDeg = 0,
        o.maxBtnRadius = 0,
        o.startTime = 0,
        o.endTime = 0,
        o.stopDeg = 0,
        o.endDeg = 0,
        o.FPS = 16.6,
        o.step = 0,
        o.ImageCache = new Map,
        o.initData(r),
        o.initWatch(),
        o.initComputed(),
        (i = n.beforeCreate) === null || i === void 0 || i.call(o),
        o.init(),
        o
    }
    return tE(e, t),
    e.prototype.resize = function() {
        var n, r;
        t.prototype.resize.call(this),
        this.Radius = Math.min(this.boxWidth, this.boxHeight) / 2,
        this.ctx.translate(this.Radius, this.Radius),
        this.draw(),
        (r = (n = this.config).afterResize) === null || r === void 0 || r.call(n)
    }
    ,
    e.prototype.initLucky = function() {
        this.Radius = 0,
        this.prizeRadius = 0,
        this.prizeDeg = 0,
        this.prizeAng = 0,
        this.rotateDeg = 0,
        this.maxBtnRadius = 0,
        this.startTime = 0,
        this.endTime = 0,
        this.stopDeg = 0,
        this.endDeg = 0,
        this.FPS = 16.6,
        this.prizeFlag = -1,
        this.step = 0,
        t.prototype.initLucky.call(this)
    }
    ,
    e.prototype.initData = function(n) {
        this.$set(this, "width", n.width || "300px"),
        this.$set(this, "height", n.height || "300px"),
        this.$set(this, "blocks", n.blocks || []),
        this.$set(this, "prizes", n.prizes || []),
        this.$set(this, "buttons", n.buttons || []),
        this.$set(this, "defaultConfig", n.defaultConfig || {}),
        this.$set(this, "defaultStyle", n.defaultStyle || {}),
        this.$set(this, "startCallback", n.start),
        this.$set(this, "endCallback", n.end)
    }
    ,
    e.prototype.initComputed = function() {
        var n = this;
        this.$computed(this, "_defaultConfig", function() {
            return Jo({
                gutter: "0px",
                offsetDegree: 0,
                speed: 20,
                speedFunction: "quad",
                accelerationTime: 2500,
                decelerationTime: 2500,
                stopRange: 0
            }, n.defaultConfig)
        }),
        this.$computed(this, "_defaultStyle", function() {
            return Jo({
                fontSize: "18px",
                fontColor: "#000",
                fontStyle: "sans-serif",
                fontWeight: "400",
                background: "rgba(0,0,0,0)",
                wordWrap: !0,
                lengthLimit: "90%"
            }, n.defaultStyle)
        })
    }
    ,
    e.prototype.initWatch = function() {
        var n = this;
        this.$watch("width", function(r) {
            n.data.width = r,
            n.resize()
        }),
        this.$watch("height", function(r) {
            n.data.height = r,
            n.resize()
        }),
        this.$watch("blocks", function(r) {
            n.initImageCache()
        }, {
            deep: !0
        }),
        this.$watch("prizes", function(r) {
            n.initImageCache()
        }, {
            deep: !0
        }),
        this.$watch("buttons", function(r) {
            n.initImageCache()
        }, {
            deep: !0
        }),
        this.$watch("defaultConfig", function() {
            return n.draw()
        }, {
            deep: !0
        }),
        this.$watch("defaultStyle", function() {
            return n.draw()
        }, {
            deep: !0
        }),
        this.$watch("startCallback", function() {
            return n.init()
        }),
        this.$watch("endCallback", function() {
            return n.init()
        })
    }
    ,
    e.prototype.init = function() {
        var n, r;
        return Qo(this, void 0, void 0, function() {
            var i;
            return es(this, function(o) {
                switch (o.label) {
                case 0:
                    return this.initLucky(),
                    i = this.config,
                    (n = i.beforeInit) === null || n === void 0 || n.call(this),
                    this.draw(),
                    this.draw(),
                    [4, this.initImageCache()];
                case 1:
                    return o.sent(),
                    (r = i.afterInit) === null || r === void 0 || r.call(this),
                    [2]
                }
            })
        })
    }
    ,
    e.prototype.initImageCache = function() {
        var n = this;
        return new Promise(function(r) {
            var i = {
                blocks: n.blocks.map(function(o) {
                    return o.imgs
                }),
                prizes: n.prizes.map(function(o) {
                    return o.imgs
                }),
                buttons: n.buttons.map(function(o) {
                    return o.imgs
                })
            };
            Object.keys(i).forEach(function(o) {
                var s = i[o]
                  , a = [];
                s && s.forEach(function(l, c) {
                    l && l.forEach(function(u, f) {
                        a.push(n.loadAndCacheImg(o, c, f))
                    })
                }),
                Promise.all(a).then(function() {
                    n.draw(),
                    r()
                })
            })
        }
        )
    }
    ,
    e.prototype.handleClick = function(n) {
        var r, i = this.ctx;
        i.beginPath(),
        i.arc(0, 0, this.maxBtnRadius, 0, 2 * Math.PI, !1),
        i.isPointInPath(n.offsetX, n.offsetY) && this.step === 0 && ((r = this.startCallback) === null || r === void 0 || r.call(this, n))
    }
    ,
    e.prototype.loadAndCacheImg = function(n, r, i) {
        return Qo(this, void 0, void 0, function() {
            var o = this;
            return es(this, function(s) {
                return [2, new Promise(function(a, l) {
                    var c = o[n][r];
                    if (c && c.imgs) {
                        var u = c.imgs[i];
                        u && o.loadImg(u.src, u).then(function(f) {
                            return Qo(o, void 0, void 0, function() {
                                return es(this, function(d) {
                                    switch (d.label) {
                                    case 0:
                                        return typeof u.formatter != "function" ? [3, 2] : [4, Promise.resolve(u.formatter.call(this, f))];
                                    case 1:
                                        f = d.sent(),
                                        d.label = 2;
                                    case 2:
                                        return this.ImageCache.set(u.src, f),
                                        a(),
                                        [2]
                                    }
                                })
                            })
                        }).catch(function(f) {
                            console.error(n + "[" + r + "].imgs[" + i + "] " + f),
                            l()
                        })
                    }
                }
                )]
            })
        })
    }
    ,
    e.prototype.drawBlock = function(n, r, i) {
        var o = this
          , s = this.ctx;
        Us(r.background) && (s.beginPath(),
        s.fillStyle = r.background,
        s.arc(0, 0, n, 0, 2 * Math.PI, !1),
        s.fill()),
        r.imgs && r.imgs.forEach(function(a, l) {
            var c = o.ImageCache.get(a.src);
            if (c) {
                var u = o.computedWidthAndHeight(c, a, 2 * n, 2 * n)
                  , f = u[0]
                  , d = u[1]
                  , h = [o.getOffsetX(f) + o.getLength(a.left, 2 * n), o.getLength(a.top, 2 * n) - n]
                  , p = h[0]
                  , y = h[1];
                s.save(),
                a.rotate && s.rotate(Ca(o.rotateDeg)),
                o.drawImage(s, c, p, y, f, d),
                s.restore()
            }
        })
    }
    ,
    e.prototype.draw = function() {
        var n, r, i = this, o = this, s = o.config, a = o.ctx, l = o._defaultConfig, c = o._defaultStyle;
        (n = s.beforeDraw) === null || n === void 0 || n.call(this, a),
        a.clearRect(-this.Radius, -this.Radius, 2 * this.Radius, 2 * this.Radius),
        this.prizeRadius = this.blocks.reduce(function(p, y, v) {
            return i.drawBlock(p, y, v),
            p - i.getLength(y.padding && y.padding.split(" ")[0])
        }, this.Radius),
        this.prizeDeg = 360 / this.prizes.length,
        this.prizeAng = Ca(this.prizeDeg);
        var u = this.prizeRadius * Math.sin(this.prizeAng / 2) * 2
          , f = Ca(this.rotateDeg - 90 + this.prizeDeg / 2 + l.offsetDegree)
          , d = function(p, y) {
            return i.getOffsetX(a.measureText(y).width) + i.getLength(p.left, u)
        }
          , h = function(p, y, v) {
            var g = p.lineHeight || c.lineHeight || p.fontSize || c.fontSize;
            return i.getLength(p.top, y) + (v + 1) * i.getLength(g)
        };
        a.save(),
        this.prizes.forEach(function(p, y) {
            var v = f + y * i.prizeAng
              , g = i.prizeRadius - i.maxBtnRadius
              , m = p.background || c.background;
            Us(m) && (a.fillStyle = m,
            function(b, w, E, S, P, C) {
                b.beginPath();
                var A, T, I = Ca(90 / Math.PI / E * C), B = S + I, G = P - I;
                b.arc(0, 0, E, B, G, !1),
                b.lineTo.apply(b, (A = (S + P) / 2,
                T = C / 2 / Math.abs(Math.sin((S - P) / 2)),
                [+(Math.cos(A) * T).toFixed(8), +(Math.sin(A) * T).toFixed(8)])),
                b.closePath()
            }(a, i.maxBtnRadius, i.prizeRadius, v - i.prizeAng / 2, v + i.prizeAng / 2, i.getLength(l.gutter)),
            a.fill());
            var _ = Math.cos(v) * i.prizeRadius
              , x = Math.sin(v) * i.prizeRadius;
            a.translate(_, x),
            a.rotate(v + Ca(90)),
            p.imgs && p.imgs.forEach(function(b, w) {
                var E = i.ImageCache.get(b.src);
                if (E) {
                    var S = i.computedWidthAndHeight(E, b, i.prizeAng * i.prizeRadius, g)
                      , P = S[0]
                      , C = S[1]
                      , A = [i.getOffsetX(P) + i.getLength(b.left, u), i.getLength(b.top, g)]
                      , T = A[0]
                      , I = A[1];
                    i.drawImage(a, E, T, I, P, C)
                }
            }),
            p.fonts && p.fonts.forEach(function(b) {
                var w = b.fontColor || c.fontColor
                  , E = b.fontWeight || c.fontWeight
                  , S = i.getLength(b.fontSize || c.fontSize)
                  , P = b.fontStyle || c.fontStyle
                  , C = iu(b, "wordWrap") ? b.wordWrap : c.wordWrap
                  , A = b.lengthLimit || c.lengthLimit
                  , T = b.lineClamp || c.lineClamp;
                a.fillStyle = w,
                a.font = E + " " + (S >> 0) + "px " + P;
                var I = String(b.text);
                (C ? rE(a, nE(I), function(B) {
                    var G = (i.prizeRadius - h(b, g, B.length)) * Math.tan(i.prizeAng / 2) * 2 - i.getLength(l.gutter);
                    return i.getLength(A, G)
                }, T) : I.split(`
`)).filter(function(B) {
                    return !!B
                }).forEach(function(B, G) {
                    a.fillText(B, d(b, B), h(b, g, G))
                })
            }),
            a.rotate(Ca(360) - v - Ca(90)),
            a.translate(-_, -x)
        }),
        a.restore(),
        this.buttons.forEach(function(p, y) {
            var v = i.getLength(p.radius, i.prizeRadius);
            i.maxBtnRadius = Math.max(i.maxBtnRadius, v),
            Us(p.background) && (a.beginPath(),
            a.fillStyle = p.background,
            a.arc(0, 0, v, 0, 2 * Math.PI, !1),
            a.fill()),
            p.pointer && Us(p.background) && (a.beginPath(),
            a.fillStyle = p.background,
            a.moveTo(-v, 0),
            a.lineTo(v, 0),
            a.lineTo(0, 2 * -v),
            a.closePath(),
            a.fill()),
            p.imgs && p.imgs.forEach(function(g, m) {
                var _ = i.ImageCache.get(g.src);
                if (_) {
                    var x = i.computedWidthAndHeight(_, g, 2 * v, 2 * v)
                      , b = x[0]
                      , w = x[1]
                      , E = [i.getOffsetX(b) + i.getLength(g.left, v), i.getLength(g.top, v)]
                      , S = E[0]
                      , P = E[1];
                    i.drawImage(a, _, S, P, b, w)
                }
            }),
            p.fonts && p.fonts.forEach(function(g) {
                var m = g.fontColor || c.fontColor
                  , _ = g.fontWeight || c.fontWeight
                  , x = i.getLength(g.fontSize || c.fontSize)
                  , b = g.fontStyle || c.fontStyle;
                a.fillStyle = m,
                a.font = _ + " " + (x >> 0) + "px " + b,
                String(g.text).split(`
`).forEach(function(w, E) {
                    a.fillText(w, d(g, w), h(g, v, E))
                })
            })
        }),
        (r = s.afterDraw) === null || r === void 0 || r.call(this, a)
    }
    ,
    e.prototype.carveOnGunwaleOfAMovingBoat = function() {
        var n = this
          , r = n._defaultConfig
          , i = n.prizeFlag
          , o = n.prizeDeg
          , s = n.rotateDeg;
        this.endTime = Date.now();
        for (var a = this.stopDeg = s, l = r.speed, c = (Math.random() * o - o / 2) * this.getLength(r.stopRange), u = 0, f = 0, d = 0; ++u; ) {
            var h = 360 * u - i * o - s - r.offsetDegree + c - o / 2
              , p = ou(this.FPS, a, h, r.decelerationTime) - a;
            if (p > l) {
                this.endDeg = l - f > p - l ? h : d;
                break
            }
            d = h,
            f = p
        }
    }
    ,
    e.prototype.play = function() {
        var n, r;
        this.step === 0 && (this.startTime = Date.now(),
        this.prizeFlag = void 0,
        this.step = 1,
        (r = (n = this.config).afterStart) === null || r === void 0 || r.call(n),
        this.run())
    }
    ,
    e.prototype.stop = function(n) {
        if (this.step !== 0 && this.step !== 3) {
            if (!n && n !== 0) {
                var r = this.prizes.map(function(i) {
                    return i.range
                });
                n = C9(r)
            }
            n < 0 ? (this.step = 0,
            this.prizeFlag = -1) : (this.step = 2,
            this.prizeFlag = n % this.prizes.length)
        }
    }
    ,
    e.prototype.run = function(n) {
        var r;
        n === void 0 && (n = 0);
        var i = this
          , o = i.rAF
          , s = i.step
          , a = i.prizeFlag
          , l = i._defaultConfig
          , c = l.accelerationTime
          , u = l.decelerationTime
          , f = l.speed;
        if (s !== 0) {
            if (a !== -1) {
                s !== 3 || this.endDeg || this.carveOnGunwaleOfAMovingBoat();
                var d = Date.now() - this.startTime
                  , h = Date.now() - this.endTime
                  , p = this.rotateDeg;
                if (s === 1 || d < c) {
                    this.FPS = d / n;
                    var y = oE(d, 0, f, c);
                    y === f && (this.step = 2),
                    p += y % 360
                } else
                    s === 2 ? (p += f % 360,
                    a !== void 0 && a >= 0 && (this.step = 3,
                    this.stopDeg = 0,
                    this.endDeg = 0)) : s === 3 ? (p = ou(h, this.stopDeg, this.endDeg, u),
                    h >= u && (this.step = 0)) : this.stop(-1);
                this.rotateDeg = p,
                this.draw(),
                o(this.run.bind(this, n + 1))
            }
        } else
            (r = this.endCallback) === null || r === void 0 || r.call(this, this.prizes.find(function(v, g) {
                return g === a
            }) || {})
    }
    ,
    e.prototype.conversionAxis = function(n, r) {
        var i = this.config;
        return [n / i.dpr - this.Radius, r / i.dpr - this.Radius]
    }
    ,
    e
}(iE)
  , Wxe = function(t) {
    function e(n, r) {
        var i, o = t.call(this, n, {
            width: r.width,
            height: r.height
        }) || this;
        return o.rows = 3,
        o.cols = 3,
        o.blocks = [],
        o.prizes = [],
        o.buttons = [],
        o.defaultConfig = {},
        o.defaultStyle = {},
        o.activeStyle = {},
        o._defaultConfig = {},
        o._defaultStyle = {},
        o._activeStyle = {},
        o.cellWidth = 0,
        o.cellHeight = 0,
        o.startTime = 0,
        o.endTime = 0,
        o.currIndex = 0,
        o.stopIndex = 0,
        o.endIndex = 0,
        o.demo = !1,
        o.timer = 0,
        o.FPS = 16.6,
        o.step = 0,
        o.prizeFlag = -1,
        o.cells = [],
        o.ImageCache = new Map,
        o.initData(r),
        o.initWatch(),
        o.initComputed(),
        (i = n.beforeCreate) === null || i === void 0 || i.call(o),
        o.init(),
        o
    }
    return tE(e, t),
    e.prototype.resize = function() {
        var n, r;
        t.prototype.resize.call(this),
        this.draw(),
        (r = (n = this.config).afterResize) === null || r === void 0 || r.call(n)
    }
    ,
    e.prototype.initLucky = function() {
        this.cellWidth = 0,
        this.cellHeight = 0,
        this.startTime = 0,
        this.endTime = 0,
        this.currIndex = 0,
        this.stopIndex = 0,
        this.endIndex = 0,
        this.demo = !1,
        this.timer = 0,
        this.FPS = 16.6,
        this.prizeFlag = -1,
        this.step = 0,
        t.prototype.initLucky.call(this)
    }
    ,
    e.prototype.initData = function(n) {
        this.$set(this, "width", n.width || "300px"),
        this.$set(this, "height", n.height || "300px"),
        this.$set(this, "rows", Number(n.rows) || 3),
        this.$set(this, "cols", Number(n.cols) || 3),
        this.$set(this, "blocks", n.blocks || []),
        this.$set(this, "prizes", n.prizes || []),
        this.$set(this, "buttons", n.buttons || []),
        this.$set(this, "button", n.button),
        this.$set(this, "defaultConfig", n.defaultConfig || {}),
        this.$set(this, "defaultStyle", n.defaultStyle || {}),
        this.$set(this, "activeStyle", n.activeStyle || {}),
        this.$set(this, "startCallback", n.start),
        this.$set(this, "endCallback", n.end)
    }
    ,
    e.prototype.initComputed = function() {
        var n = this;
        this.$computed(this, "_defaultConfig", function() {
            var r = Jo({
                gutter: 5,
                speed: 20,
                accelerationTime: 2500,
                decelerationTime: 2500
            }, n.defaultConfig);
            return r.gutter = n.getLength(r.gutter),
            r.speed = r.speed / 40,
            r
        }),
        this.$computed(this, "_defaultStyle", function() {
            return Jo({
                borderRadius: 20,
                fontColor: "#000",
                fontSize: "18px",
                fontStyle: "sans-serif",
                fontWeight: "400",
                background: "rgba(0,0,0,0)",
                shadow: "",
                wordWrap: !0,
                lengthLimit: "90%"
            }, n.defaultStyle)
        }),
        this.$computed(this, "_activeStyle", function() {
            return Jo({
                background: "#ffce98",
                shadow: ""
            }, n.activeStyle)
        })
    }
    ,
    e.prototype.initWatch = function() {
        var n = this;
        this.$watch("width", function(r) {
            n.data.width = r,
            n.resize()
        }),
        this.$watch("height", function(r) {
            n.data.height = r,
            n.resize()
        }),
        this.$watch("blocks", function(r) {
            n.initImageCache()
        }, {
            deep: !0
        }),
        this.$watch("prizes", function(r) {
            n.initImageCache()
        }, {
            deep: !0
        }),
        this.$watch("buttons", function(r) {
            n.initImageCache()
        }, {
            deep: !0
        }),
        this.$watch("rows", function() {
            return n.init()
        }),
        this.$watch("cols", function() {
            return n.init()
        }),
        this.$watch("defaultConfig", function() {
            return n.draw()
        }, {
            deep: !0
        }),
        this.$watch("defaultStyle", function() {
            return n.draw()
        }, {
            deep: !0
        }),
        this.$watch("activeStyle", function() {
            return n.draw()
        }, {
            deep: !0
        }),
        this.$watch("startCallback", function() {
            return n.init()
        }),
        this.$watch("endCallback", function() {
            return n.init()
        })
    }
    ,
    e.prototype.init = function() {
        var n, r;
        return Qo(this, void 0, void 0, function() {
            var i;
            return es(this, function(o) {
                switch (o.label) {
                case 0:
                    return this.initLucky(),
                    i = this.config,
                    (n = i.beforeInit) === null || n === void 0 || n.call(this),
                    this.draw(),
                    [4, this.initImageCache()];
                case 1:
                    return o.sent(),
                    (r = i.afterInit) === null || r === void 0 || r.call(this),
                    [2]
                }
            })
        })
    }
    ,
    e.prototype.initImageCache = function() {
        var n = this;
        return new Promise(function(r) {
            var i = n.buttons.map(function(s) {
                return s.imgs
            });
            n.button && i.push(n.button.imgs);
            var o = {
                blocks: n.blocks.map(function(s) {
                    return s.imgs
                }),
                prizes: n.prizes.map(function(s) {
                    return s.imgs
                }),
                buttons: i
            };
            Object.keys(o).forEach(function(s) {
                var a = o[s]
                  , l = [];
                a && a.forEach(function(c, u) {
                    c && c.forEach(function(f, d) {
                        l.push(n.loadAndCacheImg(s, u, d))
                    })
                }),
                Promise.all(l).then(function() {
                    n.draw(),
                    r()
                })
            })
        }
        )
    }
    ,
    e.prototype.handleClick = function(n) {
        var r = this
          , i = this.ctx;
        yc(yc([], this.buttons), [this.button]).forEach(function(o) {
            var s;
            if (o) {
                var a = r.getGeometricProperty([o.x, o.y, o.col || 1, o.row || 1])
                  , l = a[0]
                  , c = a[1]
                  , u = a[2]
                  , f = a[3];
                i.beginPath(),
                i.rect(l, c, u, f),
                i.isPointInPath(n.offsetX, n.offsetY) && r.step === 0 && (typeof o.callback == "function" && o.callback.call(r, o),
                (s = r.startCallback) === null || s === void 0 || s.call(r, n, o))
            }
        })
    }
    ,
    e.prototype.loadAndCacheImg = function(n, r, i) {
        return Qo(this, void 0, void 0, function() {
            var o = this;
            return es(this, function(s) {
                return [2, new Promise(function(a, l) {
                    var c = o[n][r];
                    if (n === "buttons" && !o.buttons.length && o.button && (c = o.button),
                    c && c.imgs) {
                        var u = c.imgs[i];
                        if (u) {
                            var f = [o.loadImg(u.src, u), u.activeSrc && o.loadImg(u.activeSrc, u, "$activeResolve")];
                            Promise.all(f).then(function(d) {
                                var h = d[0]
                                  , p = d[1];
                                return Qo(o, void 0, void 0, function() {
                                    var y;
                                    return es(this, function(v) {
                                        switch (v.label) {
                                        case 0:
                                            return typeof (y = u.formatter) != "function" ? [3, 3] : [4, Promise.resolve(y.call(this, h))];
                                        case 1:
                                            return h = v.sent(),
                                            p ? [4, Promise.resolve(y.call(this, p))] : [3, 3];
                                        case 2:
                                            p = v.sent(),
                                            v.label = 3;
                                        case 3:
                                            return this.ImageCache.set(u.src, h),
                                            p && this.ImageCache.set(u.activeSrc, p),
                                            a(),
                                            [2]
                                        }
                                    })
                                })
                            }).catch(function(d) {
                                console.error(n + "[" + r + "].imgs[" + i + "] " + d),
                                l()
                            })
                        }
                    }
                }
                )]
            })
        })
    }
    ,
    e.prototype.draw = function() {
        var n, r, i = this, o = this, s = o.config, a = o.ctx, l = o._defaultConfig, c = o._defaultStyle, u = o._activeStyle;
        (n = s.beforeDraw) === null || n === void 0 || n.call(this, a),
        a.clearRect(0, 0, this.boxWidth, this.boxHeight),
        this.cells = yc(yc([], this.prizes), this.buttons),
        this.button && this.cells.push(this.button),
        this.cells.forEach(function(f) {
            f.col = f.col || 1,
            f.row = f.row || 1
        }),
        this.prizeArea = this.blocks.reduce(function(f, d, h) {
            var p = f.x
              , y = f.y
              , v = f.w
              , g = f.h
              , m = S9(d, i.getLength.bind(i))
              , _ = m[0]
              , x = m[1]
              , b = m[2]
              , w = m[3]
              , E = d.borderRadius ? i.getLength(d.borderRadius) : 0
              , S = d.background;
            return Us(S) && (a.fillStyle = i.handleBackground(p, y, v, g, S),
            L0(a, p, y, v, g, E),
            a.fill()),
            d.imgs && d.imgs.forEach(function(P, C) {
                var A = i.ImageCache.get(P.src);
                if (A) {
                    var T = i.computedWidthAndHeight(A, P, v, g)
                      , I = T[0]
                      , B = T[1]
                      , G = [i.getOffsetX(I, v) + i.getLength(P.left, v), i.getLength(P.top, g)]
                      , N = G[0]
                      , U = G[1];
                    i.drawImage(a, A, p + N, y + U, I, B)
                }
            }),
            {
                x: p + b,
                y: y + _,
                w: v - b - w,
                h: g - _ - x
            }
        }, {
            x: 0,
            y: 0,
            w: this.boxWidth,
            h: this.boxHeight
        }),
        this.cellWidth = (this.prizeArea.w - l.gutter * (this.cols - 1)) / this.cols,
        this.cellHeight = (this.prizeArea.h - l.gutter * (this.rows - 1)) / this.rows,
        this.cells.forEach(function(f, d) {
            var h = i.getGeometricProperty([f.x, f.y, f.col, f.row])
              , p = h[0]
              , y = h[1]
              , v = h[2]
              , g = h[3]
              , m = !1;
            (i.prizeFlag === void 0 || i.prizeFlag > -1) && (m = d === i.currIndex % i.prizes.length >> 0);
            var _ = m ? u.background : f.background || c.background;
            if (Us(_)) {
                var x = (m ? u.shadow : f.shadow || c.shadow).replace(/px/g, "").split(",")[0].split(" ").map(function(w, E) {
                    return E < 3 ? Number(w) : w
                });
                x.length === 4 && (a.shadowColor = x[3],
                a.shadowOffsetX = x[0] * s.dpr,
                a.shadowOffsetY = x[1] * s.dpr,
                a.shadowBlur = x[2],
                x[0] > 0 ? v -= x[0] : (v += x[0],
                p -= x[0]),
                x[1] > 0 ? g -= x[1] : (g += x[1],
                y -= x[1])),
                a.fillStyle = i.handleBackground(p, y, v, g, _);
                var b = i.getLength(f.borderRadius ? f.borderRadius : c.borderRadius);
                L0(a, p, y, v, g, b),
                a.fill(),
                a.shadowColor = "rgba(0, 0, 0, 0)",
                a.shadowOffsetX = 0,
                a.shadowOffsetY = 0,
                a.shadowBlur = 0
            }
            d >= i.prizes.length && (d -= i.prizes.length),
            f.imgs && f.imgs.forEach(function(w, E) {
                var S = i.ImageCache.get(w.src)
                  , P = i.ImageCache.get(w.activeSrc);
                if (S) {
                    var C = m && P || S;
                    if (C) {
                        var A = i.computedWidthAndHeight(C, w, v, g)
                          , T = A[0]
                          , I = A[1]
                          , B = [p + i.getOffsetX(T, v) + i.getLength(w.left, v), y + i.getLength(w.top, g)]
                          , G = B[0]
                          , N = B[1];
                        i.drawImage(a, C, G, N, T, I)
                    }
                }
            }),
            f.fonts && f.fonts.forEach(function(w) {
                var E = m && u.fontStyle ? u.fontStyle : w.fontStyle || c.fontStyle
                  , S = m && u.fontWeight ? u.fontWeight : w.fontWeight || c.fontWeight
                  , P = m && u.fontSize ? i.getLength(u.fontSize) : i.getLength(w.fontSize || c.fontSize)
                  , C = m && u.lineHeight ? u.lineHeight : w.lineHeight || c.lineHeight || w.fontSize || c.fontSize
                  , A = iu(w, "wordWrap") ? w.wordWrap : c.wordWrap
                  , T = w.lengthLimit || c.lengthLimit
                  , I = w.lineClamp || c.lineClamp;
                a.font = S + " " + (P >> 0) + "px " + E,
                a.fillStyle = m && u.fontColor ? u.fontColor : w.fontColor || c.fontColor;
                var B = []
                  , G = String(w.text);
                if (A) {
                    var N = i.getLength(T, v);
                    B = rE(a, nE(G), function() {
                        return N
                    }, I)
                } else
                    B = G.split(`
`);
                B.forEach(function(U, W) {
                    a.fillText(U, p + i.getOffsetX(a.measureText(U).width, v) + i.getLength(w.left, v), y + i.getLength(w.top, g) + (W + 1) * i.getLength(C))
                })
            })
        }),
        (r = s.afterDraw) === null || r === void 0 || r.call(this, a)
    }
    ,
    e.prototype.handleBackground = function(n, r, i, o, s) {
        var a = this.ctx;
        return s.includes("linear-gradient") && (s = function(l, c, u, f, d, h) {
            var p = /linear-gradient\((.+)\)/.exec(h)[1].split(",").map(function(_) {
                return _.trim()
            })
              , y = p.shift()
              , v = [0, 0, 0, 0];
            if (y.includes("deg")) {
                var g = function(_) {
                    return Math.tan(_ / 180 * Math.PI)
                };
                (y = y.slice(0, -3) % 360) >= 0 && y < 45 ? v = [c, u + d, c + f, u + d - f * g(y - 0)] : y >= 45 && y < 90 ? v = [c, u + d, c + f - d * g(y - 45), u] : y >= 90 && y < 135 ? v = [c + f, u + d, c + f - d * g(y - 90), u] : y >= 135 && y < 180 ? v = [c + f, u + d, c, u + f * g(y - 135)] : y >= 180 && y < 225 ? v = [c + f, u, c, u + f * g(y - 180)] : y >= 225 && y < 270 ? v = [c + f, u, c + d * g(y - 225), u + d] : y >= 270 && y < 315 ? v = [c, u, c + d * g(y - 270), u + d] : y >= 315 && y < 360 && (v = [c, u, c + f, u + d - f * g(y - 315)])
            } else
                y.includes("top") ? v = [c, u + d, c, u] : y.includes("bottom") ? v = [c, u, c, u + d] : y.includes("left") ? v = [c + f, u, c, u] : y.includes("right") && (v = [c, u, c + f, u]);
            var m = l.createLinearGradient.apply(l, v.map(function(_) {
                return _ >> 0
            }));
            return p.reduce(function(_, x, b) {
                var w = x.split(" ");
                return w.length === 1 ? _.addColorStop(b, w[0]) : w.length === 2 && _.addColorStop.apply(_, w),
                _
            }, m)
        }(a, n, r, i, o, s)),
        s
    }
    ,
    e.prototype.carveOnGunwaleOfAMovingBoat = function() {
        var n = this
          , r = n._defaultConfig
          , i = n.prizeFlag
          , o = n.currIndex;
        this.endTime = Date.now();
        for (var s = this.stopIndex = o, a = r.speed, l = 0, c = 0, u = 0; ++l; ) {
            var f = this.prizes.length * l + i - s
              , d = ou(this.FPS, s, f, r.decelerationTime) - s;
            if (d > a) {
                this.endIndex = a - c > d - a ? f : u;
                break
            }
            u = f,
            c = d
        }
    }
    ,
    e.prototype.play = function() {
        var n, r;
        this.step === 0 && (this.startTime = Date.now(),
        this.prizeFlag = void 0,
        this.step = 1,
        (r = (n = this.config).afterStart) === null || r === void 0 || r.call(n),
        this.run())
    }
    ,
    e.prototype.stop = function(n) {
        if (this.step !== 0 && this.step !== 3) {
            if (!n && n !== 0) {
                var r = this.prizes.map(function(i) {
                    return i.range
                });
                n = C9(r)
            }
            n < 0 ? (this.step = 0,
            this.prizeFlag = -1) : (this.step = 2,
            this.prizeFlag = n % this.prizes.length)
        }
    }
    ,
    e.prototype.run = function(n) {
        var r;
        n === void 0 && (n = 0);
        var i = this
          , o = i.rAF
          , s = i.step
          , a = i.prizes
          , l = i.prizeFlag
          , c = i._defaultConfig
          , u = c.accelerationTime
          , f = c.decelerationTime
          , d = c.speed;
        if (s !== 0) {
            if (l !== -1) {
                s !== 3 || this.endIndex || this.carveOnGunwaleOfAMovingBoat();
                var h = Date.now() - this.startTime
                  , p = Date.now() - this.endTime
                  , y = this.currIndex;
                if (s === 1 || h < u) {
                    this.FPS = h / n;
                    var v = oE(h, .1, d - .1, u);
                    v === d && (this.step = 2),
                    y += v % a.length
                } else
                    s === 2 ? (y += d % a.length,
                    l !== void 0 && l >= 0 && (this.step = 3,
                    this.stopIndex = 0,
                    this.endIndex = 0)) : s === 3 ? (y = ou(p, this.stopIndex, this.endIndex, f),
                    p >= f && (this.step = 0)) : this.stop(-1);
                this.currIndex = y,
                this.draw(),
                o(this.run.bind(this, n + 1))
            }
        } else
            (r = this.endCallback) === null || r === void 0 || r.call(this, this.prizes.find(function(g, m) {
                return m === l
            }) || {})
    }
    ,
    e.prototype.getGeometricProperty = function(n) {
        var r = n[0]
          , i = n[1]
          , o = n[2]
          , s = o === void 0 ? 1 : o
          , a = n[3]
          , l = a === void 0 ? 1 : a
          , c = this.cellWidth
          , u = this.cellHeight
          , f = this._defaultConfig.gutter
          , d = [this.prizeArea.x + (c + f) * r, this.prizeArea.y + (u + f) * i];
        return s && l && d.push(c * s + f * (s - 1), u * l + f * (l - 1)),
        d
    }
    ,
    e.prototype.conversionAxis = function(n, r) {
        var i = this.config;
        return [n / i.dpr, r / i.dpr]
    }
    ,
    e
}(iE)
  , Yxe = function(t) {
    function e(n, r) {
        var i, o = t.call(this, n, {
            width: r.width,
            height: r.height
        }) || this;
        return o.blocks = [],
        o.prizes = [],
        o.slots = [],
        o.defaultConfig = {},
        o._defaultConfig = {},
        o.defaultStyle = {},
        o._defaultStyle = {},
        o.endCallback = function() {}
        ,
        o.cellWidth = 0,
        o.cellHeight = 0,
        o.cellAndSpacing = 0,
        o.widthAndSpacing = 0,
        o.heightAndSpacing = 0,
        o.FPS = 16.6,
        o.scroll = [],
        o.stopScroll = [],
        o.endScroll = [],
        o.startTime = 0,
        o.endTime = 0,
        o.step = 0,
        o.prizeFlag = void 0,
        o.ImageCache = new Map,
        o.initData(r),
        o.initWatch(),
        o.initComputed(),
        (i = n.beforeCreate) === null || i === void 0 || i.call(o),
        o.init(),
        o
    }
    return tE(e, t),
    e.prototype.resize = function() {
        var n, r;
        t.prototype.resize.call(this),
        this.draw(),
        (r = (n = this.config).afterResize) === null || r === void 0 || r.call(n)
    }
    ,
    e.prototype.initLucky = function() {
        this.cellWidth = 0,
        this.cellHeight = 0,
        this.cellAndSpacing = 0,
        this.widthAndSpacing = 0,
        this.heightAndSpacing = 0,
        this.FPS = 16.6,
        this.scroll = [],
        this.stopScroll = [],
        this.endScroll = [],
        this.startTime = 0,
        this.endTime = 0,
        this.prizeFlag = void 0,
        this.step = 0,
        t.prototype.initLucky.call(this)
    }
    ,
    e.prototype.initData = function(n) {
        this.$set(this, "width", n.width || "300px"),
        this.$set(this, "height", n.height || "300px"),
        this.$set(this, "blocks", n.blocks || []),
        this.$set(this, "prizes", n.prizes || []),
        this.$set(this, "slots", n.slots || []),
        this.$set(this, "defaultConfig", n.defaultConfig || {}),
        this.$set(this, "defaultStyle", n.defaultStyle || {}),
        this.$set(this, "endCallback", n.end)
    }
    ,
    e.prototype.initComputed = function() {
        var n = this;
        this.$computed(this, "_defaultConfig", function() {
            var r = Jo({
                mode: "vertical",
                rowSpacing: 0,
                colSpacing: 5,
                speed: 20,
                direction: 1,
                accelerationTime: 2500,
                decelerationTime: 2500
            }, n.defaultConfig);
            return r.rowSpacing = n.getLength(r.rowSpacing),
            r.colSpacing = n.getLength(r.colSpacing),
            r
        }),
        this.$computed(this, "_defaultStyle", function() {
            return Jo({
                borderRadius: 0,
                fontColor: "#000",
                fontSize: "18px",
                fontStyle: "sans-serif",
                fontWeight: "400",
                background: "rgba(0,0,0,0)",
                wordWrap: !0,
                lengthLimit: "90%"
            }, n.defaultStyle)
        })
    }
    ,
    e.prototype.initWatch = function() {
        var n = this;
        this.$watch("width", function(r) {
            n.data.width = r,
            n.resize()
        }),
        this.$watch("height", function(r) {
            n.data.height = r,
            n.resize()
        }),
        this.$watch("blocks", function(r) {
            n.initImageCache()
        }, {
            deep: !0
        }),
        this.$watch("prizes", function(r) {
            n.initImageCache()
        }, {
            deep: !0
        }),
        this.$watch("slots", function(r) {
            n.drawOffscreenCanvas(),
            n.draw()
        }, {
            deep: !0
        }),
        this.$watch("defaultConfig", function() {
            return n.draw()
        }, {
            deep: !0
        }),
        this.$watch("defaultStyle", function() {
            return n.draw()
        }, {
            deep: !0
        }),
        this.$watch("endCallback", function() {
            return n.init()
        })
    }
    ,
    e.prototype.init = function() {
        var n, r;
        return Qo(this, void 0, void 0, function() {
            var i;
            return es(this, function(o) {
                switch (o.label) {
                case 0:
                    return this.initLucky(),
                    i = this.config,
                    (n = i.beforeInit) === null || n === void 0 || n.call(this),
                    this.drawOffscreenCanvas(),
                    this.draw(),
                    [4, this.initImageCache()];
                case 1:
                    return o.sent(),
                    (r = i.afterInit) === null || r === void 0 || r.call(this),
                    [2]
                }
            })
        })
    }
    ,
    e.prototype.initImageCache = function() {
        var n = this;
        return new Promise(function(r) {
            var i = {
                blocks: n.blocks.map(function(o) {
                    return o.imgs
                }),
                prizes: n.prizes.map(function(o) {
                    return o.imgs
                })
            };
            Object.keys(i).forEach(function(o) {
                var s = i[o]
                  , a = [];
                s && s.forEach(function(l, c) {
                    l && l.forEach(function(u, f) {
                        a.push(n.loadAndCacheImg(o, c, f))
                    })
                }),
                Promise.all(a).then(function() {
                    n.drawOffscreenCanvas(),
                    n.draw(),
                    r()
                })
            })
        }
        )
    }
    ,
    e.prototype.loadAndCacheImg = function(n, r, i) {
        return Qo(this, void 0, void 0, function() {
            var o = this;
            return es(this, function(s) {
                return [2, new Promise(function(a, l) {
                    var c = o[n][r];
                    if (c && c.imgs) {
                        var u = c.imgs[i];
                        u && o.loadImg(u.src, u).then(function(f) {
                            return Qo(o, void 0, void 0, function() {
                                return es(this, function(d) {
                                    switch (d.label) {
                                    case 0:
                                        return typeof u.formatter != "function" ? [3, 2] : [4, Promise.resolve(u.formatter.call(this, f))];
                                    case 1:
                                        f = d.sent(),
                                        d.label = 2;
                                    case 2:
                                        return this.ImageCache.set(u.src, f),
                                        a(),
                                        [2]
                                    }
                                })
                            })
                        }).catch(function(f) {
                            console.error(n + "[" + r + "].imgs[" + i + "] " + f),
                            l()
                        })
                    }
                }
                )]
            })
        })
    }
    ,
    e.prototype.drawOffscreenCanvas = function() {
        var n = this
          , r = this._defaultConfig
          , i = this._defaultStyle
          , o = this.drawBlocks()
          , s = o.w
          , a = o.h
          , l = this.prizes.length
          , c = this.displacementWidthOrHeight()
          , u = c.cellWidth
          , f = c.cellHeight
          , d = c.widthAndSpacing
          , h = c.heightAndSpacing
          , p = new Array(l).fill(void 0).map(function(x, b) {
            return b
        })
          , y = 0
          , v = 0;
        this.slots.forEach(function(x, b) {
            n.scroll[b] === void 0 && (n.scroll[b] = 0),
            x.order = x.order || p;
            var w = x.order.length;
            y = Math.max(y, s + d * w),
            v = Math.max(v, a + h * w)
        });
        var g = this.getOffscreenCanvas(y, v)
          , m = g._offscreenCanvas
          , _ = g._ctx;
        this._offscreenCanvas = m,
        this.slots.forEach(function(x, b) {
            var w = u * b
              , E = f * b
              , S = 0
              , P = function(K, fe) {
                for (var ue = {}, X = [], ie = 0; ie < K.length; ie++)
                    ue[ie] = K[ie];
                for (ie = 0; ie < fe.length; ie++) {
                    var ge = ue[fe[ie]];
                    ge && (X[ie] = ge)
                }
                return X
            }(n.prizes, x.order);
            if (P.length) {
                P.forEach(function(K, fe) {
                    if (K) {
                        x.order[fe];
                        var ue = d * fe + r.colSpacing / 2
                          , X = h * fe + r.rowSpacing / 2
                          , ie = n.displacement([w, X, h], [ue, E, d])
                          , ge = ie[0]
                          , F = ie[1]
                          , q = ie[2];
                        S += q;
                        var L = K.background || i.background;
                        if (Us(L)) {
                            var ee = n.getLength(iu(K, "borderRadius") ? K.borderRadius : i.borderRadius);
                            L0(_, ge, F, u, u, ee),
                            _.fillStyle = L,
                            _.fill()
                        }
                        K.imgs && K.imgs.forEach(function(J, de) {
                            var pe = n.ImageCache.get(J.src);
                            if (pe) {
                                var xe = n.computedWidthAndHeight(pe, J, u, f)
                                  , O = xe[0]
                                  , $ = xe[1]
                                  , j = [ge + n.getOffsetX(O, u) + n.getLength(J.left, u), F + n.getLength(J.top, f)]
                                  , ae = j[0]
                                  , ce = j[1];
                                n.drawImage(_, pe, ae, ce, O, $)
                            }
                        }),
                        K.fonts && K.fonts.forEach(function(J) {
                            var de = J.fontStyle || i.fontStyle
                              , pe = J.fontWeight || i.fontWeight
                              , xe = n.getLength(J.fontSize || i.fontSize)
                              , O = J.lineHeight || i.lineHeight || J.fontSize || i.fontSize
                              , $ = iu(J, "wordWrap") ? J.wordWrap : i.wordWrap
                              , j = J.lengthLimit || i.lengthLimit
                              , ae = J.lineClamp || i.lineClamp;
                            _.font = pe + " " + (xe >> 0) + "px " + de,
                            _.fillStyle = J.fontColor || i.fontColor;
                            var ce = []
                              , M = String(J.text);
                            if ($) {
                                var k = n.getLength(j, u);
                                ce = rE(_, nE(M), function() {
                                    return k
                                }, ae)
                            } else
                                ce = M.split(`
`);
                            ce.forEach(function(H, Q) {
                                _.fillText(H, ge + n.getOffsetX(_.measureText(H).width, u) + n.getLength(J.left, u), F + n.getLength(J.top, f) + (Q + 1) * n.getLength(O))
                            })
                        })
                    }
                });
                for (var C = n.displacement([w, 0, u, S], [0, E, S, f]), A = C[0], T = C[1], I = C[2], B = C[3], G = S; G < v + S; ) {
                    var N = n.displacement([A, G], [G, T])
                      , U = N[0]
                      , W = N[1];
                    n.drawImage(_, m, A, T, I, B, U, W, I, B),
                    G += S
                }
            }
        })
    }
    ,
    e.prototype.drawBlocks = function() {
        var n = this
          , r = this;
        r.config;
        var i = r.ctx;
        r._defaultConfig;
        var o = r._defaultStyle;
        return this.prizeArea = this.blocks.reduce(function(s, a, l) {
            var c = s.x
              , u = s.y
              , f = s.w
              , d = s.h
              , h = S9(a, n.getLength.bind(n))
              , p = h[0]
              , y = h[1]
              , v = h[2]
              , g = h[3]
              , m = a.borderRadius ? n.getLength(a.borderRadius) : 0
              , _ = a.background || o.background;
            return Us(_) && (L0(i, c, u, f, d, m),
            i.fillStyle = _,
            i.fill()),
            a.imgs && a.imgs.forEach(function(x, b) {
                var w = n.ImageCache.get(x.src);
                if (w) {
                    var E = n.computedWidthAndHeight(w, x, f, d)
                      , S = E[0]
                      , P = E[1]
                      , C = [n.getOffsetX(S, f) + n.getLength(x.left, f), n.getLength(x.top, d)]
                      , A = C[0]
                      , T = C[1];
                    n.drawImage(i, w, c + A, u + T, S, P)
                }
            }),
            {
                x: c + v,
                y: u + p,
                w: f - v - g,
                h: d - p - y
            }
        }, {
            x: 0,
            y: 0,
            w: this.boxWidth,
            h: this.boxHeight
        })
    }
    ,
    e.prototype.draw = function() {
        var n, r = this, i = this, o = i.config, s = i.ctx;
        i._defaultConfig,
        i._defaultStyle,
        (n = o.beforeDraw) === null || n === void 0 || n.call(this, s),
        s.clearRect(0, 0, this.boxWidth, this.boxHeight);
        var a = this.drawBlocks()
          , l = a.x
          , c = a.y
          , u = a.w
          , f = a.h;
        if (this._offscreenCanvas) {
            var d = this
              , h = d.cellWidth
              , p = d.cellHeight
              , y = d.cellAndSpacing
              , v = d.widthAndSpacing
              , g = d.heightAndSpacing;
            this.slots.forEach(function(m, _) {
                var x = y * m.order.length
                  , b = r.displacement(-(f - g) / 2, -(u - v) / 2)
                  , w = r.scroll[_] + b;
                w < 0 && (w = w % x + x),
                w > x && (w %= x);
                var E = r.displacement([h * _, w, h, f], [w, p * _, u, p])
                  , S = E[0]
                  , P = E[1]
                  , C = E[2]
                  , A = E[3]
                  , T = r.displacement([l + v * _, c, h, f], [l, c + g * _, u, p])
                  , I = T[0]
                  , B = T[1]
                  , G = T[2]
                  , N = T[3];
                r.drawImage(s, r._offscreenCanvas, S, P, C, A, I, B, G, N)
            })
        }
    }
    ,
    e.prototype.carveOnGunwaleOfAMovingBoat = function() {
        var n = this
          , r = this
          , i = r._defaultConfig
          , o = r.prizeFlag
          , s = r.cellAndSpacing;
        this.endTime = Date.now(),
        this.slots.forEach(function(a, l) {
            var c = a.order;
            if (c.length)
                for (var u = a.speed || i.speed, f = a.direction || i.direction, d = c.findIndex(function(m) {
                    return m === o[l]
                }), h = s * c.length, p = n.stopScroll[l] = n.scroll[l], y = 0; ++y; ) {
                    var v = s * d + h * y * f - p
                      , g = ou(n.FPS, p, v, i.decelerationTime) - p;
                    if (Math.abs(g) > u) {
                        n.endScroll[l] = v;
                        break
                    }
                }
        })
    }
    ,
    e.prototype.play = function() {
        var n, r;
        this.step === 0 && (this.startTime = Date.now(),
        this.prizeFlag = void 0,
        this.step = 1,
        (r = (n = this.config).afterStart) === null || r === void 0 || r.call(n),
        this.run())
    }
    ,
    e.prototype.stop = function(n) {
        var r;
        if (this.step !== 0 && this.step !== 3) {
            if (typeof n == "number")
                this.prizeFlag = new Array(this.slots.length).fill(n);
            else {
                if (!Sd(n, "array"))
                    return this.stop(-1),
                    console.error("stop() 无法识别的参数类型 " + typeof n);
                if (n.length !== this.slots.length)
                    return this.stop(-1),
                    console.error("stop([" + n + "]) 参数长度的不正确");
                this.prizeFlag = n
            }
            !((r = this.prizeFlag) === null || r === void 0) && r.includes(-1) ? (this.prizeFlag = [],
            this.step = 0) : this.step = 2
        }
    }
    ,
    e.prototype.run = function(n) {
        var r, i, o = this;
        n === void 0 && (n = 0);
        var s = this
          , a = s.rAF
          , l = s.step
          , c = s.prizeFlag
          , u = s._defaultConfig
          , f = s.cellAndSpacing
          , d = s.slots
          , h = u.accelerationTime
          , p = u.decelerationTime;
        if (this.step !== 0 || (c == null ? void 0 : c.length) !== d.length) {
            if (c === void 0 || c.length) {
                this.step !== 3 || this.endScroll.length || this.carveOnGunwaleOfAMovingBoat();
                var y = Date.now() - this.startTime
                  , v = Date.now() - this.endTime;
                d.forEach(function(b, w) {
                    var E = b.order;
                    if (E && E.length) {
                        var S = f * E.length
                          , P = Math.abs(b.speed || u.speed)
                          , C = b.direction || u.direction
                          , A = 0
                          , T = o.scroll[w];
                        if (l === 1 || y < h) {
                            o.FPS = y / n;
                            var I = oE(y, 0, P, h);
                            I === P && (o.step = 2),
                            A = (T + I * C) % S
                        } else if (l === 2)
                            A = (T + P * C) % S,
                            (c == null ? void 0 : c.length) === d.length && (o.step = 3,
                            o.stopScroll = [],
                            o.endScroll = []);
                        else if (l === 3 && v) {
                            var B = o.stopScroll[w]
                              , G = o.endScroll[w];
                            A = ou(v, B, G, p),
                            v >= p && (o.step = 0)
                        }
                        o.scroll[w] = A
                    }
                }),
                this.draw(),
                a(this.run.bind(this, n + 1))
            }
        } else {
            for (var g = c[0], m = 0; m < d.length; m++) {
                var _ = d[m]
                  , x = c[m];
                if (!(!((r = _.order) === null || r === void 0) && r.includes(x)) || g !== x) {
                    g = -1;
                    break
                }
            }
            (i = this.endCallback) === null || i === void 0 || i.call(this, this.prizes.find(function(b, w) {
                return w === g
            }) || void 0)
        }
    }
    ,
    e.prototype.displacement = function(n, r) {
        return this._defaultConfig.mode === "horizontal" ? r : n
    }
    ,
    e.prototype.displacementWidthOrHeight = function() {
        var n = this._defaultConfig.mode
          , r = this.slots.length
          , i = this._defaultConfig
          , o = i.colSpacing
          , s = i.rowSpacing
          , a = this.prizeArea || this.drawBlocks();
        a.x,
        a.y;
        var l, c, u = a.w, f = a.h, d = 0, h = 0;
        return n === "horizontal" ? (h = this.cellHeight = (f - s * (r - 1)) / r,
        d = this.cellWidth = h) : (d = this.cellWidth = (u - o * (r - 1)) / r,
        h = this.cellHeight = d),
        l = this.widthAndSpacing = this.cellWidth + o,
        c = this.heightAndSpacing = this.cellHeight + s,
        this.cellAndSpacing = n === "horizontal" ? l : c,
        {
            cellWidth: d,
            cellHeight: h,
            widthAndSpacing: l,
            heightAndSpacing: c
        }
    }
    ,
    e
}(iE)
  , sE = function(t, e, n) {
    e === void 0 && (e = {});
    var r = e.props
      , i = e.domProps
      , o = e.on
      , s = function(c, u) {
        var f = {};
        for (var d in c)
            Object.prototype.hasOwnProperty.call(c, d) && u.indexOf(d) < 0 && (f[d] = c[d]);
        if (c != null && typeof Object.getOwnPropertySymbols == "function") {
            var h = 0;
            for (d = Object.getOwnPropertySymbols(c); h < d.length; h++)
                u.indexOf(d[h]) < 0 && Object.prototype.propertyIsEnumerable.call(c, d[h]) && (f[d[h]] = c[d[h]])
        }
        return f
    }(e, ["props", "domProps", "on"])
      , a = function(c) {
        return c ? Object.entries(c).reduce(function(u, f) {
            var d, h = f[0], p = f[1];
            return h = "on" + (h = h.charAt(0).toUpperCase() + h.slice(1)),
            Er(Er({}, u), ((d = {})[h] = p,
            d))
        }, {}) : null
    }(o)
      , l = Er(Er(Er(Er({}, s), r), i), a);
    return Mn(t, l, n)
}
  , aE = "@lucky-canvas/vue"
  , Xxe = we({
    name: "LuckyWheel",
    props: {
        width: {
            type: [String, Number]
        },
        height: {
            type: [String, Number]
        },
        blocks: {
            type: Array,
            default: function() {
                return []
            }
        },
        prizes: {
            type: Array,
            default: function() {
                return []
            }
        },
        buttons: {
            type: Array,
            default: function() {
                return []
            }
        },
        defaultStyle: {
            type: Object,
            default: function() {
                return {}
            }
        },
        defaultConfig: {
            type: Object,
            default: function() {
                return {}
            }
        }
    },
    emits: ["start", "end", "success", "error", "finally"],
    watch: {
        blocks: function(t, e) {
            this.lucky && (this.lucky.blocks = t)
        },
        prizes: function(t, e) {
            this.lucky && (this.lucky.prizes = t)
        },
        buttons: function(t, e) {
            this.lucky && (this.lucky.buttons = t)
        }
    },
    data: function() {
        return {
            lucky: null
        }
    },
    mounted: function() {
        this.$refs.myLucky && this.$refs.myLucky.setAttribute("package", aE + "@0.1.11");
        try {
            this.initLucky(),
            this.$emit("success")
        } catch (t) {
            this.$emit("error", t)
        } finally {
            this.$emit("finally")
        }
    },
    methods: {
        initLucky: function() {
            var t = this;
            this.lucky = new jxe({
                flag: "WEB",
                width: String(this.width),
                height: String(this.height),
                divElement: this.$refs.myLucky,
                rAF: window.requestAnimationFrame,
                setTimeout: window.setTimeout,
                setInterval: window.setInterval,
                clearTimeout: window.clearTimeout,
                clearInterval: window.clearInterval
            },Er(Er({}, this.$props), {
                start: function(e) {
                    t.$emit("start", e)
                },
                end: function(e) {
                    t.$emit("end", e)
                }
            }))
        },
        init: function() {
            this.lucky && this.lucky.init()
        },
        play: function() {
            var t;
            (t = this.lucky) === null || t === void 0 || t.play()
        },
        stop: function(t) {
            var e;
            (e = this.lucky) === null || e === void 0 || e.stop(t)
        }
    },
    render: function() {
        return sE("div", {
            ref: "myLucky"
        })
    }
})
  , Kxe = we({
    name: "LuckyGrid",
    props: {
        width: {
            type: [String, Number]
        },
        height: {
            type: [String, Number]
        },
        cols: {
            type: [String, Number],
            default: 3
        },
        rows: {
            type: [String, Number],
            default: 3
        },
        blocks: {
            type: Array,
            default: function() {
                return []
            }
        },
        prizes: {
            type: Array,
            default: function() {
                return []
            }
        },
        buttons: {
            type: Array,
            default: function() {
                return []
            }
        },
        button: {
            type: Object
        },
        defaultStyle: {
            type: Object,
            default: function() {
                return {}
            }
        },
        activeStyle: {
            type: Object,
            default: function() {
                return {}
            }
        },
        defaultConfig: {
            type: Object,
            default: function() {
                return {}
            }
        }
    },
    emits: ["start", "end", "success", "error", "finally"],
    watch: {
        cols: function(t, e) {
            this.lucky && (this.lucky.cols = t)
        },
        rows: function(t, e) {
            this.lucky && (this.lucky.rows = t)
        },
        blocks: function(t, e) {
            this.lucky && (this.lucky.blocks = t)
        },
        prizes: function(t, e) {
            this.lucky && (this.lucky.prizes = t)
        },
        buttons: function(t, e) {
            this.lucky && (this.lucky.buttons = t)
        },
        button: function(t, e) {
            this.lucky && (this.lucky.button = t)
        }
    },
    data: function() {
        return {
            lucky: null
        }
    },
    mounted: function() {
        this.$refs.myLucky && this.$refs.myLucky.setAttribute("package", aE + "@0.1.11");
        try {
            this.initLucky(),
            this.$emit("success")
        } catch (t) {
            this.$emit("error", t)
        } finally {
            this.$emit("finally")
        }
    },
    methods: {
        initLucky: function() {
            var t = this;
            this.lucky = new Wxe({
                flag: "WEB",
                width: String(this.width),
                height: String(this.height),
                divElement: this.$refs.myLucky,
                rAF: window.requestAnimationFrame,
                setTimeout: window.setTimeout,
                setInterval: window.setInterval,
                clearTimeout: window.clearTimeout,
                clearInterval: window.clearInterval
            },Er(Er({}, this.$props), {
                start: function(e, n) {
                    t.$emit("start", e, n)
                },
                end: function(e) {
                    t.$emit("end", e)
                }
            }))
        },
        init: function() {
            this.lucky && this.lucky.init()
        },
        play: function() {
            var t;
            (t = this.lucky) === null || t === void 0 || t.play()
        },
        stop: function(t) {
            var e;
            (e = this.lucky) === null || e === void 0 || e.stop(t)
        }
    },
    render: function() {
        return sE("div", {
            ref: "myLucky"
        })
    }
})
  , qxe = we({
    name: "SlotMachine",
    props: {
        width: {
            type: [String, Number]
        },
        height: {
            type: [String, Number]
        },
        blocks: {
            type: Array,
            default: function() {
                return []
            }
        },
        prizes: {
            type: Array,
            default: function() {
                return []
            }
        },
        slots: {
            type: Array,
            default: function() {
                return []
            }
        },
        defaultStyle: {
            type: Object,
            default: function() {
                return {}
            }
        },
        defaultConfig: {
            type: Object,
            default: function() {
                return {}
            }
        }
    },
    watch: {
        blocks: function(t, e) {
            this.lucky && (this.lucky.blocks = t)
        },
        slots: function(t, e) {
            this.lucky && (this.lucky.slots = t)
        },
        prizes: function(t, e) {
            this.lucky && (this.lucky.prizes = t)
        }
    },
    data: function() {
        return {
            lucky: null
        }
    },
    mounted: function() {
        this.$refs.myLucky && this.$refs.myLucky.setAttribute("package", aE + "@0.1.11");
        try {
            this.initLucky(),
            this.$emit("success")
        } catch (t) {
            this.$emit("error", t)
        } finally {
            this.$emit("finally")
        }
    },
    methods: {
        initLucky: function() {
            var t = this;
            this.lucky = new Yxe({
                flag: "WEB",
                width: String(this.width),
                height: String(this.height),
                divElement: this.$refs.myLucky,
                rAF: window.requestAnimationFrame,
                setTimeout: window.setTimeout,
                setInterval: window.setInterval,
                clearTimeout: window.clearTimeout,
                clearInterval: window.clearInterval
            },Er(Er({}, this.$props), {
                start: function(e) {
                    t.$emit("start", e)
                },
                end: function(e) {
                    t.$emit("end", e)
                }
            }))
        },
        init: function() {
            this.lucky && this.lucky.init()
        },
        play: function() {
            var t;
            (t = this.lucky) === null || t === void 0 || t.play()
        },
        stop: function(t) {
            var e;
            (e = this.lucky) === null || e === void 0 || e.stop(t)
        }
    },
    render: function() {
        return sE("div", {
            ref: "myLucky"
        })
    }
})
  , Zxe = function(t) {
    t.component("LuckyWheel", Xxe),
    t.component("LuckyGrid", Kxe),
    t.component("SlotMachine", qxe)
};
typeof window < "u" && window.Vue && E9 && Zxe(window.Vue);
function Jxe(t, e) {
    var n = Object.setPrototypeOf;
    n ? n(t, e) : t.__proto__ = e
}
function Qxe(t, e) {
    e === void 0 && (e = t.constructor);
    var n = Error.captureStackTrace;
    n && n(t, e)
}
var ebe = function() {
    var t = function(n, r) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(i, o) {
            i.__proto__ = o
        }
        || function(i, o) {
            for (var s in o)
                Object.prototype.hasOwnProperty.call(o, s) && (i[s] = o[s])
        }
        ,
        t(n, r)
    };
    return function(e, n) {
        if (typeof n != "function" && n !== null)
            throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), tbe = function(t) {
    ebe(e, t);
    function e(n, r) {
        var i = this.constructor
          , o = t.call(this, n, r) || this;
        return Object.defineProperty(o, "name", {
            value: i.name,
            enumerable: !1,
            configurable: !0
        }),
        Jxe(o, i.prototype),
        Qxe(o),
        o
    }
    return e
}(Error), nbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), Br = function(t) {
    nbe(e, t);
    function e(n) {
        n === void 0 && (n = void 0);
        var r = t.call(this, n) || this;
        return r.message = n,
        r
    }
    return e.prototype.getKind = function() {
        var n = this.constructor;
        return n.kind
    }
    ,
    e.kind = "Exception",
    e
}(tbe), rbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), rn = function(t) {
    rbe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.kind = "ArgumentException",
    e
}(Br), ibe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), ke = function(t) {
    ibe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.kind = "IllegalArgumentException",
    e
}(Br), P9 = function() {
    function t(e) {
        if (this.binarizer = e,
        e === null)
            throw new ke("Binarizer must be non-null.")
    }
    return t.prototype.getWidth = function() {
        return this.binarizer.getWidth()
    }
    ,
    t.prototype.getHeight = function() {
        return this.binarizer.getHeight()
    }
    ,
    t.prototype.getBlackRow = function(e, n) {
        return this.binarizer.getBlackRow(e, n)
    }
    ,
    t.prototype.getBlackMatrix = function() {
        return (this.matrix === null || this.matrix === void 0) && (this.matrix = this.binarizer.getBlackMatrix()),
        this.matrix
    }
    ,
    t.prototype.isCropSupported = function() {
        return this.binarizer.getLuminanceSource().isCropSupported()
    }
    ,
    t.prototype.crop = function(e, n, r, i) {
        var o = this.binarizer.getLuminanceSource().crop(e, n, r, i);
        return new t(this.binarizer.createBinarizer(o))
    }
    ,
    t.prototype.isRotateSupported = function() {
        return this.binarizer.getLuminanceSource().isRotateSupported()
    }
    ,
    t.prototype.rotateCounterClockwise = function() {
        var e = this.binarizer.getLuminanceSource().rotateCounterClockwise();
        return new t(this.binarizer.createBinarizer(e))
    }
    ,
    t.prototype.rotateCounterClockwise45 = function() {
        var e = this.binarizer.getLuminanceSource().rotateCounterClockwise45();
        return new t(this.binarizer.createBinarizer(e))
    }
    ,
    t.prototype.toString = function() {
        try {
            return this.getBlackMatrix().toString()
        } catch {
            return ""
        }
    }
    ,
    t
}(), obe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), fn = function(t) {
    obe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.getChecksumInstance = function() {
        return new e
    }
    ,
    e.kind = "ChecksumException",
    e
}(Br), sbe = function() {
    function t(e) {
        this.source = e
    }
    return t.prototype.getLuminanceSource = function() {
        return this.source
    }
    ,
    t.prototype.getWidth = function() {
        return this.source.getWidth()
    }
    ,
    t.prototype.getHeight = function() {
        return this.source.getHeight()
    }
    ,
    t
}(), It = function() {
    function t() {}
    return t.arraycopy = function(e, n, r, i, o) {
        for (; o--; )
            r[i++] = e[n++]
    }
    ,
    t.currentTimeMillis = function() {
        return Date.now()
    }
    ,
    t
}(), abe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), lE = function(t) {
    abe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.kind = "IndexOutOfBoundsException",
    e
}(Br), lbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), wP = function(t) {
    lbe(e, t);
    function e(n, r) {
        n === void 0 && (n = void 0),
        r === void 0 && (r = void 0);
        var i = t.call(this, r) || this;
        return i.index = n,
        i.message = r,
        i
    }
    return e.kind = "ArrayIndexOutOfBoundsException",
    e
}(lE), cbe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, bn = function() {
    function t() {}
    return t.fill = function(e, n) {
        for (var r = 0, i = e.length; r < i; r++)
            e[r] = n
    }
    ,
    t.fillWithin = function(e, n, r, i) {
        t.rangeCheck(e.length, n, r);
        for (var o = n; o < r; o++)
            e[o] = i
    }
    ,
    t.rangeCheck = function(e, n, r) {
        if (n > r)
            throw new ke("fromIndex(" + n + ") > toIndex(" + r + ")");
        if (n < 0)
            throw new wP(n);
        if (r > e)
            throw new wP(r)
    }
    ,
    t.asList = function() {
        for (var e = [], n = 0; n < arguments.length; n++)
            e[n] = arguments[n];
        return e
    }
    ,
    t.create = function(e, n, r) {
        var i = Array.from({
            length: e
        });
        return i.map(function(o) {
            return Array.from({
                length: n
            }).fill(r)
        })
    }
    ,
    t.createInt32Array = function(e, n, r) {
        var i = Array.from({
            length: e
        });
        return i.map(function(o) {
            return Int32Array.from({
                length: n
            }).fill(r)
        })
    }
    ,
    t.equals = function(e, n) {
        if (!e || !n || !e.length || !n.length || e.length !== n.length)
            return !1;
        for (var r = 0, i = e.length; r < i; r++)
            if (e[r] !== n[r])
                return !1;
        return !0
    }
    ,
    t.hashCode = function(e) {
        var n, r;
        if (e === null)
            return 0;
        var i = 1;
        try {
            for (var o = cbe(e), s = o.next(); !s.done; s = o.next()) {
                var a = s.value;
                i = 31 * i + a
            }
        } catch (l) {
            n = {
                error: l
            }
        } finally {
            try {
                s && !s.done && (r = o.return) && r.call(o)
            } finally {
                if (n)
                    throw n.error
            }
        }
        return i
    }
    ,
    t.fillUint8Array = function(e, n) {
        for (var r = 0; r !== e.length; r++)
            e[r] = n
    }
    ,
    t.copyOf = function(e, n) {
        return e.slice(0, n)
    }
    ,
    t.copyOfUint8Array = function(e, n) {
        if (e.length <= n) {
            var r = new Uint8Array(n);
            return r.set(e),
            r
        }
        return e.slice(0, n)
    }
    ,
    t.copyOfRange = function(e, n, r) {
        var i = r - n
          , o = new Int32Array(i);
        return It.arraycopy(e, n, o, 0, i),
        o
    }
    ,
    t.binarySearch = function(e, n, r) {
        r === void 0 && (r = t.numberComparator);
        for (var i = 0, o = e.length - 1; i <= o; ) {
            var s = o + i >> 1
              , a = r(n, e[s]);
            if (a > 0)
                i = s + 1;
            else if (a < 0)
                o = s - 1;
            else
                return s
        }
        return -i - 1
    }
    ,
    t.numberComparator = function(e, n) {
        return e - n
    }
    ,
    t
}(), qe = function() {
    function t() {}
    return t.numberOfTrailingZeros = function(e) {
        var n;
        if (e === 0)
            return 32;
        var r = 31;
        return n = e << 16,
        n !== 0 && (r -= 16,
        e = n),
        n = e << 8,
        n !== 0 && (r -= 8,
        e = n),
        n = e << 4,
        n !== 0 && (r -= 4,
        e = n),
        n = e << 2,
        n !== 0 && (r -= 2,
        e = n),
        r - (e << 1 >>> 31)
    }
    ,
    t.numberOfLeadingZeros = function(e) {
        if (e === 0)
            return 32;
        var n = 1;
        return e >>> 16 || (n += 16,
        e <<= 16),
        e >>> 24 || (n += 8,
        e <<= 8),
        e >>> 28 || (n += 4,
        e <<= 4),
        e >>> 30 || (n += 2,
        e <<= 2),
        n -= e >>> 31,
        n
    }
    ,
    t.toHexString = function(e) {
        return e.toString(16)
    }
    ,
    t.toBinaryString = function(e) {
        return String(parseInt(String(e), 2))
    }
    ,
    t.bitCount = function(e) {
        return e = e - (e >>> 1 & 1431655765),
        e = (e & 858993459) + (e >>> 2 & 858993459),
        e = e + (e >>> 4) & 252645135,
        e = e + (e >>> 8),
        e = e + (e >>> 16),
        e & 63
    }
    ,
    t.truncDivision = function(e, n) {
        return Math.trunc(e / n)
    }
    ,
    t.parseInt = function(e, n) {
        return n === void 0 && (n = void 0),
        parseInt(e, n)
    }
    ,
    t.MIN_VALUE_32_BITS = -2147483648,
    t.MAX_VALUE = Number.MAX_SAFE_INTEGER,
    t
}(), Dn = function() {
    function t(e, n) {
        e === void 0 ? (this.size = 0,
        this.bits = new Int32Array(1)) : (this.size = e,
        n == null ? this.bits = t.makeArray(e) : this.bits = n)
    }
    return t.prototype.getSize = function() {
        return this.size
    }
    ,
    t.prototype.getSizeInBytes = function() {
        return Math.floor((this.size + 7) / 8)
    }
    ,
    t.prototype.ensureCapacity = function(e) {
        if (e > this.bits.length * 32) {
            var n = t.makeArray(e);
            It.arraycopy(this.bits, 0, n, 0, this.bits.length),
            this.bits = n
        }
    }
    ,
    t.prototype.get = function(e) {
        return (this.bits[Math.floor(e / 32)] & 1 << (e & 31)) !== 0
    }
    ,
    t.prototype.set = function(e) {
        this.bits[Math.floor(e / 32)] |= 1 << (e & 31)
    }
    ,
    t.prototype.flip = function(e) {
        this.bits[Math.floor(e / 32)] ^= 1 << (e & 31)
    }
    ,
    t.prototype.getNextSet = function(e) {
        var n = this.size;
        if (e >= n)
            return n;
        var r = this.bits
          , i = Math.floor(e / 32)
          , o = r[i];
        o &= ~((1 << (e & 31)) - 1);
        for (var s = r.length; o === 0; ) {
            if (++i === s)
                return n;
            o = r[i]
        }
        var a = i * 32 + qe.numberOfTrailingZeros(o);
        return a > n ? n : a
    }
    ,
    t.prototype.getNextUnset = function(e) {
        var n = this.size;
        if (e >= n)
            return n;
        var r = this.bits
          , i = Math.floor(e / 32)
          , o = ~r[i];
        o &= ~((1 << (e & 31)) - 1);
        for (var s = r.length; o === 0; ) {
            if (++i === s)
                return n;
            o = ~r[i]
        }
        var a = i * 32 + qe.numberOfTrailingZeros(o);
        return a > n ? n : a
    }
    ,
    t.prototype.setBulk = function(e, n) {
        this.bits[Math.floor(e / 32)] = n
    }
    ,
    t.prototype.setRange = function(e, n) {
        if (n < e || e < 0 || n > this.size)
            throw new ke;
        if (n !== e) {
            n--;
            for (var r = Math.floor(e / 32), i = Math.floor(n / 32), o = this.bits, s = r; s <= i; s++) {
                var a = s > r ? 0 : e & 31
                  , l = s < i ? 31 : n & 31
                  , c = (2 << l) - (1 << a);
                o[s] |= c
            }
        }
    }
    ,
    t.prototype.clear = function() {
        for (var e = this.bits.length, n = this.bits, r = 0; r < e; r++)
            n[r] = 0
    }
    ,
    t.prototype.isRange = function(e, n, r) {
        if (n < e || e < 0 || n > this.size)
            throw new ke;
        if (n === e)
            return !0;
        n--;
        for (var i = Math.floor(e / 32), o = Math.floor(n / 32), s = this.bits, a = i; a <= o; a++) {
            var l = a > i ? 0 : e & 31
              , c = a < o ? 31 : n & 31
              , u = (2 << c) - (1 << l) & 4294967295;
            if ((s[a] & u) !== (r ? u : 0))
                return !1
        }
        return !0
    }
    ,
    t.prototype.appendBit = function(e) {
        this.ensureCapacity(this.size + 1),
        e && (this.bits[Math.floor(this.size / 32)] |= 1 << (this.size & 31)),
        this.size++
    }
    ,
    t.prototype.appendBits = function(e, n) {
        if (n < 0 || n > 32)
            throw new ke("Num bits must be between 0 and 32");
        this.ensureCapacity(this.size + n);
        for (var r = n; r > 0; r--)
            this.appendBit((e >> r - 1 & 1) === 1)
    }
    ,
    t.prototype.appendBitArray = function(e) {
        var n = e.size;
        this.ensureCapacity(this.size + n);
        for (var r = 0; r < n; r++)
            this.appendBit(e.get(r))
    }
    ,
    t.prototype.xor = function(e) {
        if (this.size !== e.size)
            throw new ke("Sizes don't match");
        for (var n = this.bits, r = 0, i = n.length; r < i; r++)
            n[r] ^= e.bits[r]
    }
    ,
    t.prototype.toBytes = function(e, n, r, i) {
        for (var o = 0; o < i; o++) {
            for (var s = 0, a = 0; a < 8; a++)
                this.get(e) && (s |= 1 << 7 - a),
                e++;
            n[r + o] = s
        }
    }
    ,
    t.prototype.getBitArray = function() {
        return this.bits
    }
    ,
    t.prototype.reverse = function() {
        for (var e = new Int32Array(this.bits.length), n = Math.floor((this.size - 1) / 32), r = n + 1, i = this.bits, o = 0; o < r; o++) {
            var s = i[o];
            s = s >> 1 & 1431655765 | (s & 1431655765) << 1,
            s = s >> 2 & 858993459 | (s & 858993459) << 2,
            s = s >> 4 & 252645135 | (s & 252645135) << 4,
            s = s >> 8 & 16711935 | (s & 16711935) << 8,
            s = s >> 16 & 65535 | (s & 65535) << 16,
            e[n - o] = s
        }
        if (this.size !== r * 32) {
            for (var a = r * 32 - this.size, l = e[0] >>> a, o = 1; o < r; o++) {
                var c = e[o];
                l |= c << 32 - a,
                e[o - 1] = l,
                l = c >>> a
            }
            e[r - 1] = l
        }
        this.bits = e
    }
    ,
    t.makeArray = function(e) {
        return new Int32Array(Math.floor((e + 31) / 32))
    }
    ,
    t.prototype.equals = function(e) {
        if (!(e instanceof t))
            return !1;
        var n = e;
        return this.size === n.size && bn.equals(this.bits, n.bits)
    }
    ,
    t.prototype.hashCode = function() {
        return 31 * this.size + bn.hashCode(this.bits)
    }
    ,
    t.prototype.toString = function() {
        for (var e = "", n = 0, r = this.size; n < r; n++)
            n & 7 || (e += " "),
            e += this.get(n) ? "X" : ".";
        return e
    }
    ,
    t.prototype.clone = function() {
        return new t(this.size,this.bits.slice())
    }
    ,
    t.prototype.toArray = function() {
        for (var e = [], n = 0, r = this.size; n < r; n++)
            e.push(this.get(n));
        return e
    }
    ,
    t
}(), bx;
(function(t) {
    t[t.OTHER = 0] = "OTHER",
    t[t.PURE_BARCODE = 1] = "PURE_BARCODE",
    t[t.POSSIBLE_FORMATS = 2] = "POSSIBLE_FORMATS",
    t[t.TRY_HARDER = 3] = "TRY_HARDER",
    t[t.CHARACTER_SET = 4] = "CHARACTER_SET",
    t[t.ALLOWED_LENGTHS = 5] = "ALLOWED_LENGTHS",
    t[t.ASSUME_CODE_39_CHECK_DIGIT = 6] = "ASSUME_CODE_39_CHECK_DIGIT",
    t[t.ENABLE_CODE_39_EXTENDED_MODE = 7] = "ENABLE_CODE_39_EXTENDED_MODE",
    t[t.ASSUME_GS1 = 8] = "ASSUME_GS1",
    t[t.RETURN_CODABAR_START_END = 9] = "RETURN_CODABAR_START_END",
    t[t.NEED_RESULT_POINT_CALLBACK = 10] = "NEED_RESULT_POINT_CALLBACK",
    t[t.ALLOWED_EAN_EXTENSIONS = 11] = "ALLOWED_EAN_EXTENSIONS"
}
)(bx || (bx = {}));
const Ot = bx;
var ube = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), me = function(t) {
    ube(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.getFormatInstance = function() {
        return new e
    }
    ,
    e.kind = "FormatException",
    e
}(Br), fbe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, _t;
(function(t) {
    t[t.Cp437 = 0] = "Cp437",
    t[t.ISO8859_1 = 1] = "ISO8859_1",
    t[t.ISO8859_2 = 2] = "ISO8859_2",
    t[t.ISO8859_3 = 3] = "ISO8859_3",
    t[t.ISO8859_4 = 4] = "ISO8859_4",
    t[t.ISO8859_5 = 5] = "ISO8859_5",
    t[t.ISO8859_6 = 6] = "ISO8859_6",
    t[t.ISO8859_7 = 7] = "ISO8859_7",
    t[t.ISO8859_8 = 8] = "ISO8859_8",
    t[t.ISO8859_9 = 9] = "ISO8859_9",
    t[t.ISO8859_10 = 10] = "ISO8859_10",
    t[t.ISO8859_11 = 11] = "ISO8859_11",
    t[t.ISO8859_13 = 12] = "ISO8859_13",
    t[t.ISO8859_14 = 13] = "ISO8859_14",
    t[t.ISO8859_15 = 14] = "ISO8859_15",
    t[t.ISO8859_16 = 15] = "ISO8859_16",
    t[t.SJIS = 16] = "SJIS",
    t[t.Cp1250 = 17] = "Cp1250",
    t[t.Cp1251 = 18] = "Cp1251",
    t[t.Cp1252 = 19] = "Cp1252",
    t[t.Cp1256 = 20] = "Cp1256",
    t[t.UnicodeBigUnmarked = 21] = "UnicodeBigUnmarked",
    t[t.UTF8 = 22] = "UTF8",
    t[t.ASCII = 23] = "ASCII",
    t[t.Big5 = 24] = "Big5",
    t[t.GB18030 = 25] = "GB18030",
    t[t.EUC_KR = 26] = "EUC_KR"
}
)(_t || (_t = {}));
var xn = function() {
    function t(e, n, r) {
        for (var i, o, s = [], a = 3; a < arguments.length; a++)
            s[a - 3] = arguments[a];
        this.valueIdentifier = e,
        this.name = r,
        typeof n == "number" ? this.values = Int32Array.from([n]) : this.values = n,
        this.otherEncodingNames = s,
        t.VALUE_IDENTIFIER_TO_ECI.set(e, this),
        t.NAME_TO_ECI.set(r, this);
        for (var l = this.values, c = 0, u = l.length; c !== u; c++) {
            var f = l[c];
            t.VALUES_TO_ECI.set(f, this)
        }
        try {
            for (var d = fbe(s), h = d.next(); !h.done; h = d.next()) {
                var p = h.value;
                t.NAME_TO_ECI.set(p, this)
            }
        } catch (y) {
            i = {
                error: y
            }
        } finally {
            try {
                h && !h.done && (o = d.return) && o.call(d)
            } finally {
                if (i)
                    throw i.error
            }
        }
    }
    return t.prototype.getValueIdentifier = function() {
        return this.valueIdentifier
    }
    ,
    t.prototype.getName = function() {
        return this.name
    }
    ,
    t.prototype.getValue = function() {
        return this.values[0]
    }
    ,
    t.getCharacterSetECIByValue = function(e) {
        if (e < 0 || e >= 900)
            throw new me("incorect value");
        var n = t.VALUES_TO_ECI.get(e);
        if (n === void 0)
            throw new me("incorect value");
        return n
    }
    ,
    t.getCharacterSetECIByName = function(e) {
        var n = t.NAME_TO_ECI.get(e);
        if (n === void 0)
            throw new me("incorect value");
        return n
    }
    ,
    t.prototype.equals = function(e) {
        if (!(e instanceof t))
            return !1;
        var n = e;
        return this.getName() === n.getName()
    }
    ,
    t.VALUE_IDENTIFIER_TO_ECI = new Map,
    t.VALUES_TO_ECI = new Map,
    t.NAME_TO_ECI = new Map,
    t.Cp437 = new t(_t.Cp437,Int32Array.from([0, 2]),"Cp437"),
    t.ISO8859_1 = new t(_t.ISO8859_1,Int32Array.from([1, 3]),"ISO-8859-1","ISO88591","ISO8859_1"),
    t.ISO8859_2 = new t(_t.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),
    t.ISO8859_3 = new t(_t.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),
    t.ISO8859_4 = new t(_t.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),
    t.ISO8859_5 = new t(_t.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),
    t.ISO8859_6 = new t(_t.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),
    t.ISO8859_7 = new t(_t.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),
    t.ISO8859_8 = new t(_t.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),
    t.ISO8859_9 = new t(_t.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),
    t.ISO8859_10 = new t(_t.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),
    t.ISO8859_11 = new t(_t.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),
    t.ISO8859_13 = new t(_t.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),
    t.ISO8859_14 = new t(_t.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),
    t.ISO8859_15 = new t(_t.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),
    t.ISO8859_16 = new t(_t.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),
    t.SJIS = new t(_t.SJIS,20,"SJIS","Shift_JIS"),
    t.Cp1250 = new t(_t.Cp1250,21,"Cp1250","windows-1250"),
    t.Cp1251 = new t(_t.Cp1251,22,"Cp1251","windows-1251"),
    t.Cp1252 = new t(_t.Cp1252,23,"Cp1252","windows-1252"),
    t.Cp1256 = new t(_t.Cp1256,24,"Cp1256","windows-1256"),
    t.UnicodeBigUnmarked = new t(_t.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),
    t.UTF8 = new t(_t.UTF8,26,"UTF8","UTF-8"),
    t.ASCII = new t(_t.ASCII,Int32Array.from([27, 170]),"ASCII","US-ASCII"),
    t.Big5 = new t(_t.Big5,28,"Big5"),
    t.GB18030 = new t(_t.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),
    t.EUC_KR = new t(_t.EUC_KR,30,"EUC_KR","EUC-KR"),
    t
}(), dbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), zp = function(t) {
    dbe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.kind = "UnsupportedOperationException",
    e
}(Br), mi = function() {
    function t() {}
    return t.decode = function(e, n) {
        var r = this.encodingName(n);
        return this.customDecoder ? this.customDecoder(e, r) : typeof TextDecoder > "u" || this.shouldDecodeOnFallback(r) ? this.decodeFallback(e, r) : new TextDecoder(r).decode(e)
    }
    ,
    t.shouldDecodeOnFallback = function(e) {
        return !t.isBrowser() && e === "ISO-8859-1"
    }
    ,
    t.encode = function(e, n) {
        var r = this.encodingName(n);
        return this.customEncoder ? this.customEncoder(e, r) : typeof TextEncoder > "u" ? this.encodeFallback(e) : new TextEncoder().encode(e)
    }
    ,
    t.isBrowser = function() {
        return typeof window < "u" && {}.toString.call(window) === "[object Window]"
    }
    ,
    t.encodingName = function(e) {
        return typeof e == "string" ? e : e.getName()
    }
    ,
    t.encodingCharacterSet = function(e) {
        return e instanceof xn ? e : xn.getCharacterSetECIByName(e)
    }
    ,
    t.decodeFallback = function(e, n) {
        var r = this.encodingCharacterSet(n);
        if (t.isDecodeFallbackSupported(r)) {
            for (var i = "", o = 0, s = e.length; o < s; o++) {
                var a = e[o].toString(16);
                a.length < 2 && (a = "0" + a),
                i += "%" + a
            }
            return decodeURIComponent(i)
        }
        if (r.equals(xn.UnicodeBigUnmarked))
            return String.fromCharCode.apply(null, new Uint16Array(e.buffer));
        throw new zp("Encoding " + this.encodingName(n) + " not supported by fallback.")
    }
    ,
    t.isDecodeFallbackSupported = function(e) {
        return e.equals(xn.UTF8) || e.equals(xn.ISO8859_1) || e.equals(xn.ASCII)
    }
    ,
    t.encodeFallback = function(e) {
        for (var n = btoa(unescape(encodeURIComponent(e))), r = n.split(""), i = [], o = 0; o < r.length; o++)
            i.push(r[o].charCodeAt(0));
        return new Uint8Array(i)
    }
    ,
    t
}(), nt = function() {
    function t() {}
    return t.castAsNonUtf8Char = function(e, n) {
        n === void 0 && (n = null);
        var r = n ? n.getName() : this.ISO88591;
        return mi.decode(new Uint8Array([e]), r)
    }
    ,
    t.guessEncoding = function(e, n) {
        if (n != null && n.get(Ot.CHARACTER_SET) !== void 0)
            return n.get(Ot.CHARACTER_SET).toString();
        for (var r = e.length, i = !0, o = !0, s = !0, a = 0, l = 0, c = 0, u = 0, f = 0, d = 0, h = 0, p = 0, y = 0, v = 0, g = 0, m = e.length > 3 && e[0] === 239 && e[1] === 187 && e[2] === 191, _ = 0; _ < r && (i || o || s); _++) {
            var x = e[_] & 255;
            s && (a > 0 ? x & 128 ? a-- : s = !1 : x & 128 && (x & 64 ? (a++,
            x & 32 ? (a++,
            x & 16 ? (a++,
            x & 8 ? s = !1 : u++) : c++) : l++) : s = !1)),
            i && (x > 127 && x < 160 ? i = !1 : x > 159 && (x < 192 || x === 215 || x === 247) && g++),
            o && (f > 0 ? x < 64 || x === 127 || x > 252 ? o = !1 : f-- : x === 128 || x === 160 || x > 239 ? o = !1 : x > 160 && x < 224 ? (d++,
            p = 0,
            h++,
            h > y && (y = h)) : x > 127 ? (f++,
            h = 0,
            p++,
            p > v && (v = p)) : (h = 0,
            p = 0))
        }
        return s && a > 0 && (s = !1),
        o && f > 0 && (o = !1),
        s && (m || l + c + u > 0) ? t.UTF8 : o && (t.ASSUME_SHIFT_JIS || y >= 3 || v >= 3) ? t.SHIFT_JIS : i && o ? y === 2 && d === 2 || g * 10 >= r ? t.SHIFT_JIS : t.ISO88591 : i ? t.ISO88591 : o ? t.SHIFT_JIS : s ? t.UTF8 : t.PLATFORM_DEFAULT_ENCODING
    }
    ,
    t.format = function(e) {
        for (var n = [], r = 1; r < arguments.length; r++)
            n[r - 1] = arguments[r];
        var i = -1;
        function o(a, l, c, u, f, d) {
            if (a === "%%")
                return "%";
            if (n[++i] !== void 0) {
                a = u ? parseInt(u.substr(1)) : void 0;
                var h = f ? parseInt(f.substr(1)) : void 0, p;
                switch (d) {
                case "s":
                    p = n[i];
                    break;
                case "c":
                    p = n[i][0];
                    break;
                case "f":
                    p = parseFloat(n[i]).toFixed(a);
                    break;
                case "p":
                    p = parseFloat(n[i]).toPrecision(a);
                    break;
                case "e":
                    p = parseFloat(n[i]).toExponential(a);
                    break;
                case "x":
                    p = parseInt(n[i]).toString(h || 16);
                    break;
                case "d":
                    p = parseFloat(parseInt(n[i], h || 10).toPrecision(a)).toFixed(0);
                    break
                }
                p = typeof p == "object" ? JSON.stringify(p) : (+p).toString(h);
                for (var y = parseInt(c), v = c && c[0] + "" == "0" ? "0" : " "; p.length < y; )
                    p = l !== void 0 ? p + v : v + p;
                return p
            }
        }
        var s = /%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;
        return e.replace(s, o)
    }
    ,
    t.getBytes = function(e, n) {
        return mi.encode(e, n)
    }
    ,
    t.getCharCode = function(e, n) {
        return n === void 0 && (n = 0),
        e.charCodeAt(n)
    }
    ,
    t.getCharAt = function(e) {
        return String.fromCharCode(e)
    }
    ,
    t.SHIFT_JIS = xn.SJIS.getName(),
    t.GB2312 = "GB2312",
    t.ISO88591 = xn.ISO8859_1.getName(),
    t.EUC_JP = "EUC_JP",
    t.UTF8 = xn.UTF8.getName(),
    t.PLATFORM_DEFAULT_ENCODING = t.UTF8,
    t.ASSUME_SHIFT_JIS = !1,
    t
}(), Ke = function() {
    function t(e) {
        e === void 0 && (e = ""),
        this.value = e
    }
    return t.prototype.enableDecoding = function(e) {
        return this.encoding = e,
        this
    }
    ,
    t.prototype.append = function(e) {
        return typeof e == "string" ? this.value += e.toString() : this.encoding ? this.value += nt.castAsNonUtf8Char(e, this.encoding) : this.value += String.fromCharCode(e),
        this
    }
    ,
    t.prototype.appendChars = function(e, n, r) {
        for (var i = n; n < n + r; i++)
            this.append(e[i]);
        return this
    }
    ,
    t.prototype.length = function() {
        return this.value.length
    }
    ,
    t.prototype.charAt = function(e) {
        return this.value.charAt(e)
    }
    ,
    t.prototype.deleteCharAt = function(e) {
        this.value = this.value.substr(0, e) + this.value.substring(e + 1)
    }
    ,
    t.prototype.setCharAt = function(e, n) {
        this.value = this.value.substr(0, e) + n + this.value.substr(e + 1)
    }
    ,
    t.prototype.substring = function(e, n) {
        return this.value.substring(e, n)
    }
    ,
    t.prototype.setLengthToZero = function() {
        this.value = ""
    }
    ,
    t.prototype.toString = function() {
        return this.value
    }
    ,
    t.prototype.insert = function(e, n) {
        this.value = this.value.substring(0, e) + n + this.value.substring(e)
    }
    ,
    t
}(), xo = function() {
    function t(e, n, r, i) {
        if (this.width = e,
        this.height = n,
        this.rowSize = r,
        this.bits = i,
        n == null && (n = e),
        this.height = n,
        e < 1 || n < 1)
            throw new ke("Both dimensions must be greater than 0");
        r == null && (r = Math.floor((e + 31) / 32)),
        this.rowSize = r,
        i == null && (this.bits = new Int32Array(this.rowSize * this.height))
    }
    return t.parseFromBooleanArray = function(e) {
        for (var n = e.length, r = e[0].length, i = new t(r,n), o = 0; o < n; o++)
            for (var s = e[o], a = 0; a < r; a++)
                s[a] && i.set(a, o);
        return i
    }
    ,
    t.parseFromString = function(e, n, r) {
        if (e === null)
            throw new ke("stringRepresentation cannot be null");
        for (var i = new Array(e.length), o = 0, s = 0, a = -1, l = 0, c = 0; c < e.length; )
            if (e.charAt(c) === `
` || e.charAt(c) === "\r") {
                if (o > s) {
                    if (a === -1)
                        a = o - s;
                    else if (o - s !== a)
                        throw new ke("row lengths do not match");
                    s = o,
                    l++
                }
                c++
            } else if (e.substring(c, c + n.length) === n)
                c += n.length,
                i[o] = !0,
                o++;
            else if (e.substring(c, c + r.length) === r)
                c += r.length,
                i[o] = !1,
                o++;
            else
                throw new ke("illegal character encountered: " + e.substring(c));
        if (o > s) {
            if (a === -1)
                a = o - s;
            else if (o - s !== a)
                throw new ke("row lengths do not match");
            l++
        }
        for (var u = new t(a,l), f = 0; f < o; f++)
            i[f] && u.set(Math.floor(f % a), Math.floor(f / a));
        return u
    }
    ,
    t.prototype.get = function(e, n) {
        var r = n * this.rowSize + Math.floor(e / 32);
        return (this.bits[r] >>> (e & 31) & 1) !== 0
    }
    ,
    t.prototype.set = function(e, n) {
        var r = n * this.rowSize + Math.floor(e / 32);
        this.bits[r] |= 1 << (e & 31) & 4294967295
    }
    ,
    t.prototype.unset = function(e, n) {
        var r = n * this.rowSize + Math.floor(e / 32);
        this.bits[r] &= ~(1 << (e & 31) & 4294967295)
    }
    ,
    t.prototype.flip = function(e, n) {
        var r = n * this.rowSize + Math.floor(e / 32);
        this.bits[r] ^= 1 << (e & 31) & 4294967295
    }
    ,
    t.prototype.xor = function(e) {
        if (this.width !== e.getWidth() || this.height !== e.getHeight() || this.rowSize !== e.getRowSize())
            throw new ke("input matrix dimensions do not match");
        for (var n = new Dn(Math.floor(this.width / 32) + 1), r = this.rowSize, i = this.bits, o = 0, s = this.height; o < s; o++)
            for (var a = o * r, l = e.getRow(o, n).getBitArray(), c = 0; c < r; c++)
                i[a + c] ^= l[c]
    }
    ,
    t.prototype.clear = function() {
        for (var e = this.bits, n = e.length, r = 0; r < n; r++)
            e[r] = 0
    }
    ,
    t.prototype.setRegion = function(e, n, r, i) {
        if (n < 0 || e < 0)
            throw new ke("Left and top must be nonnegative");
        if (i < 1 || r < 1)
            throw new ke("Height and width must be at least 1");
        var o = e + r
          , s = n + i;
        if (s > this.height || o > this.width)
            throw new ke("The region must fit inside the matrix");
        for (var a = this.rowSize, l = this.bits, c = n; c < s; c++)
            for (var u = c * a, f = e; f < o; f++)
                l[u + Math.floor(f / 32)] |= 1 << (f & 31) & 4294967295
    }
    ,
    t.prototype.getRow = function(e, n) {
        n == null || n.getSize() < this.width ? n = new Dn(this.width) : n.clear();
        for (var r = this.rowSize, i = this.bits, o = e * r, s = 0; s < r; s++)
            n.setBulk(s * 32, i[o + s]);
        return n
    }
    ,
    t.prototype.setRow = function(e, n) {
        It.arraycopy(n.getBitArray(), 0, this.bits, e * this.rowSize, this.rowSize)
    }
    ,
    t.prototype.rotate180 = function() {
        for (var e = this.getWidth(), n = this.getHeight(), r = new Dn(e), i = new Dn(e), o = 0, s = Math.floor((n + 1) / 2); o < s; o++)
            r = this.getRow(o, r),
            i = this.getRow(n - 1 - o, i),
            r.reverse(),
            i.reverse(),
            this.setRow(o, i),
            this.setRow(n - 1 - o, r)
    }
    ,
    t.prototype.getEnclosingRectangle = function() {
        for (var e = this.width, n = this.height, r = this.rowSize, i = this.bits, o = e, s = n, a = -1, l = -1, c = 0; c < n; c++)
            for (var u = 0; u < r; u++) {
                var f = i[c * r + u];
                if (f !== 0) {
                    if (c < s && (s = c),
                    c > l && (l = c),
                    u * 32 < o) {
                        for (var d = 0; !(f << 31 - d & 4294967295); )
                            d++;
                        u * 32 + d < o && (o = u * 32 + d)
                    }
                    if (u * 32 + 31 > a) {
                        for (var d = 31; !(f >>> d); )
                            d--;
                        u * 32 + d > a && (a = u * 32 + d)
                    }
                }
            }
        return a < o || l < s ? null : Int32Array.from([o, s, a - o + 1, l - s + 1])
    }
    ,
    t.prototype.getTopLeftOnBit = function() {
        for (var e = this.rowSize, n = this.bits, r = 0; r < n.length && n[r] === 0; )
            r++;
        if (r === n.length)
            return null;
        for (var i = r / e, o = r % e * 32, s = n[r], a = 0; !(s << 31 - a & 4294967295); )
            a++;
        return o += a,
        Int32Array.from([o, i])
    }
    ,
    t.prototype.getBottomRightOnBit = function() {
        for (var e = this.rowSize, n = this.bits, r = n.length - 1; r >= 0 && n[r] === 0; )
            r--;
        if (r < 0)
            return null;
        for (var i = Math.floor(r / e), o = Math.floor(r % e) * 32, s = n[r], a = 31; !(s >>> a); )
            a--;
        return o += a,
        Int32Array.from([o, i])
    }
    ,
    t.prototype.getWidth = function() {
        return this.width
    }
    ,
    t.prototype.getHeight = function() {
        return this.height
    }
    ,
    t.prototype.getRowSize = function() {
        return this.rowSize
    }
    ,
    t.prototype.equals = function(e) {
        if (!(e instanceof t))
            return !1;
        var n = e;
        return this.width === n.width && this.height === n.height && this.rowSize === n.rowSize && bn.equals(this.bits, n.bits)
    }
    ,
    t.prototype.hashCode = function() {
        var e = this.width;
        return e = 31 * e + this.width,
        e = 31 * e + this.height,
        e = 31 * e + this.rowSize,
        e = 31 * e + bn.hashCode(this.bits),
        e
    }
    ,
    t.prototype.toString = function(e, n, r) {
        return e === void 0 && (e = "X "),
        n === void 0 && (n = "  "),
        r === void 0 && (r = `
`),
        this.buildToString(e, n, r)
    }
    ,
    t.prototype.buildToString = function(e, n, r) {
        for (var i = new Ke, o = 0, s = this.height; o < s; o++) {
            for (var a = 0, l = this.width; a < l; a++)
                i.append(this.get(a, o) ? e : n);
            i.append(r)
        }
        return i.toString()
    }
    ,
    t.prototype.clone = function() {
        return new t(this.width,this.height,this.rowSize,this.bits.slice())
    }
    ,
    t
}(), hbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), oe = function(t) {
    hbe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.getNotFoundInstance = function() {
        return new e
    }
    ,
    e.kind = "NotFoundException",
    e
}(Br), pbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), gbe = function(t) {
    pbe(e, t);
    function e(n) {
        var r = t.call(this, n) || this;
        return r.luminances = e.EMPTY,
        r.buckets = new Int32Array(e.LUMINANCE_BUCKETS),
        r
    }
    return e.prototype.getBlackRow = function(n, r) {
        var i = this.getLuminanceSource()
          , o = i.getWidth();
        r == null || r.getSize() < o ? r = new Dn(o) : r.clear(),
        this.initArrays(o);
        for (var s = i.getRow(n, this.luminances), a = this.buckets, l = 0; l < o; l++)
            a[(s[l] & 255) >> e.LUMINANCE_SHIFT]++;
        var c = e.estimateBlackPoint(a);
        if (o < 3)
            for (var l = 0; l < o; l++)
                (s[l] & 255) < c && r.set(l);
        else
            for (var u = s[0] & 255, f = s[1] & 255, l = 1; l < o - 1; l++) {
                var d = s[l + 1] & 255;
                (f * 4 - u - d) / 2 < c && r.set(l),
                u = f,
                f = d
            }
        return r
    }
    ,
    e.prototype.getBlackMatrix = function() {
        var n = this.getLuminanceSource()
          , r = n.getWidth()
          , i = n.getHeight()
          , o = new xo(r,i);
        this.initArrays(r);
        for (var s = this.buckets, a = 1; a < 5; a++)
            for (var l = Math.floor(i * a / 5), c = n.getRow(l, this.luminances), u = Math.floor(r * 4 / 5), f = Math.floor(r / 5); f < u; f++) {
                var d = c[f] & 255;
                s[d >> e.LUMINANCE_SHIFT]++
            }
        for (var h = e.estimateBlackPoint(s), p = n.getMatrix(), a = 0; a < i; a++)
            for (var y = a * r, f = 0; f < r; f++) {
                var d = p[y + f] & 255;
                d < h && o.set(f, a)
            }
        return o
    }
    ,
    e.prototype.createBinarizer = function(n) {
        return new e(n)
    }
    ,
    e.prototype.initArrays = function(n) {
        this.luminances.length < n && (this.luminances = new Uint8ClampedArray(n));
        for (var r = this.buckets, i = 0; i < e.LUMINANCE_BUCKETS; i++)
            r[i] = 0
    }
    ,
    e.estimateBlackPoint = function(n) {
        for (var r = n.length, i = 0, o = 0, s = 0, a = 0; a < r; a++)
            n[a] > s && (o = a,
            s = n[a]),
            n[a] > i && (i = n[a]);
        for (var l = 0, c = 0, a = 0; a < r; a++) {
            var u = a - o
              , f = n[a] * u * u;
            f > c && (l = a,
            c = f)
        }
        if (o > l) {
            var d = o;
            o = l,
            l = d
        }
        if (l - o <= r / 16)
            throw new oe;
        for (var h = l - 1, p = -1, a = l - 1; a > o; a--) {
            var y = a - o
              , f = y * y * (l - a) * (i - n[a]);
            f > p && (h = a,
            p = f)
        }
        return h << e.LUMINANCE_SHIFT
    }
    ,
    e.LUMINANCE_BITS = 5,
    e.LUMINANCE_SHIFT = 8 - e.LUMINANCE_BITS,
    e.LUMINANCE_BUCKETS = 1 << e.LUMINANCE_BITS,
    e.EMPTY = Uint8ClampedArray.from([0]),
    e
}(sbe), mbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), I9 = function(t) {
    mbe(e, t);
    function e(n) {
        var r = t.call(this, n) || this;
        return r.matrix = null,
        r
    }
    return e.prototype.getBlackMatrix = function() {
        if (this.matrix !== null)
            return this.matrix;
        var n = this.getLuminanceSource()
          , r = n.getWidth()
          , i = n.getHeight();
        if (r >= e.MINIMUM_DIMENSION && i >= e.MINIMUM_DIMENSION) {
            var o = n.getMatrix()
              , s = r >> e.BLOCK_SIZE_POWER;
            r & e.BLOCK_SIZE_MASK && s++;
            var a = i >> e.BLOCK_SIZE_POWER;
            i & e.BLOCK_SIZE_MASK && a++;
            var l = e.calculateBlackPoints(o, s, a, r, i)
              , c = new xo(r,i);
            e.calculateThresholdForBlock(o, s, a, r, i, l, c),
            this.matrix = c
        } else
            this.matrix = t.prototype.getBlackMatrix.call(this);
        return this.matrix
    }
    ,
    e.prototype.createBinarizer = function(n) {
        return new e(n)
    }
    ,
    e.calculateThresholdForBlock = function(n, r, i, o, s, a, l) {
        for (var c = s - e.BLOCK_SIZE, u = o - e.BLOCK_SIZE, f = 0; f < i; f++) {
            var d = f << e.BLOCK_SIZE_POWER;
            d > c && (d = c);
            for (var h = e.cap(f, 2, i - 3), p = 0; p < r; p++) {
                var y = p << e.BLOCK_SIZE_POWER;
                y > u && (y = u);
                for (var v = e.cap(p, 2, r - 3), g = 0, m = -2; m <= 2; m++) {
                    var _ = a[h + m];
                    g += _[v - 2] + _[v - 1] + _[v] + _[v + 1] + _[v + 2]
                }
                var x = g / 25;
                e.thresholdBlock(n, y, d, x, o, l)
            }
        }
    }
    ,
    e.cap = function(n, r, i) {
        return n < r ? r : n > i ? i : n
    }
    ,
    e.thresholdBlock = function(n, r, i, o, s, a) {
        for (var l = 0, c = i * s + r; l < e.BLOCK_SIZE; l++,
        c += s)
            for (var u = 0; u < e.BLOCK_SIZE; u++)
                (n[c + u] & 255) <= o && a.set(r + u, i + l)
    }
    ,
    e.calculateBlackPoints = function(n, r, i, o, s) {
        for (var a = s - e.BLOCK_SIZE, l = o - e.BLOCK_SIZE, c = new Array(i), u = 0; u < i; u++) {
            c[u] = new Int32Array(r);
            var f = u << e.BLOCK_SIZE_POWER;
            f > a && (f = a);
            for (var d = 0; d < r; d++) {
                var h = d << e.BLOCK_SIZE_POWER;
                h > l && (h = l);
                for (var p = 0, y = 255, v = 0, g = 0, m = f * o + h; g < e.BLOCK_SIZE; g++,
                m += o) {
                    for (var _ = 0; _ < e.BLOCK_SIZE; _++) {
                        var x = n[m + _] & 255;
                        p += x,
                        x < y && (y = x),
                        x > v && (v = x)
                    }
                    if (v - y > e.MIN_DYNAMIC_RANGE)
                        for (g++,
                        m += o; g < e.BLOCK_SIZE; g++,
                        m += o)
                            for (var _ = 0; _ < e.BLOCK_SIZE; _++)
                                p += n[m + _] & 255
                }
                var b = p >> e.BLOCK_SIZE_POWER * 2;
                if (v - y <= e.MIN_DYNAMIC_RANGE && (b = y / 2,
                u > 0 && d > 0)) {
                    var w = (c[u - 1][d] + 2 * c[u][d - 1] + c[u - 1][d - 1]) / 4;
                    y < w && (b = w)
                }
                c[u][d] = b
            }
        }
        return c
    }
    ,
    e.BLOCK_SIZE_POWER = 3,
    e.BLOCK_SIZE = 1 << e.BLOCK_SIZE_POWER,
    e.BLOCK_SIZE_MASK = e.BLOCK_SIZE - 1,
    e.MINIMUM_DIMENSION = e.BLOCK_SIZE * 5,
    e.MIN_DYNAMIC_RANGE = 24,
    e
}(gbe), uh = function() {
    function t(e, n) {
        this.width = e,
        this.height = n
    }
    return t.prototype.getWidth = function() {
        return this.width
    }
    ,
    t.prototype.getHeight = function() {
        return this.height
    }
    ,
    t.prototype.isCropSupported = function() {
        return !1
    }
    ,
    t.prototype.crop = function(e, n, r, i) {
        throw new zp("This luminance source does not support cropping.")
    }
    ,
    t.prototype.isRotateSupported = function() {
        return !1
    }
    ,
    t.prototype.rotateCounterClockwise = function() {
        throw new zp("This luminance source does not support rotation by 90 degrees.")
    }
    ,
    t.prototype.rotateCounterClockwise45 = function() {
        throw new zp("This luminance source does not support rotation by 45 degrees.")
    }
    ,
    t.prototype.toString = function() {
        for (var e = new Uint8ClampedArray(this.width), n = new Ke, r = 0; r < this.height; r++) {
            for (var i = this.getRow(r, e), o = 0; o < this.width; o++) {
                var s = i[o] & 255
                  , a = void 0;
                s < 64 ? a = "#" : s < 128 ? a = "+" : s < 192 ? a = "." : a = " ",
                n.append(a)
            }
            n.append(`
`)
        }
        return n.toString()
    }
    ,
    t
}(), vbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), vm = function(t) {
    vbe(e, t);
    function e(n) {
        var r = t.call(this, n.getWidth(), n.getHeight()) || this;
        return r.delegate = n,
        r
    }
    return e.prototype.getRow = function(n, r) {
        for (var i = this.delegate.getRow(n, r), o = this.getWidth(), s = 0; s < o; s++)
            i[s] = 255 - (i[s] & 255);
        return i
    }
    ,
    e.prototype.getMatrix = function() {
        for (var n = this.delegate.getMatrix(), r = this.getWidth() * this.getHeight(), i = new Uint8ClampedArray(r), o = 0; o < r; o++)
            i[o] = 255 - (n[o] & 255);
        return i
    }
    ,
    e.prototype.isCropSupported = function() {
        return this.delegate.isCropSupported()
    }
    ,
    e.prototype.crop = function(n, r, i, o) {
        return new e(this.delegate.crop(n, r, i, o))
    }
    ,
    e.prototype.isRotateSupported = function() {
        return this.delegate.isRotateSupported()
    }
    ,
    e.prototype.invert = function() {
        return this.delegate
    }
    ,
    e.prototype.rotateCounterClockwise = function() {
        return new e(this.delegate.rotateCounterClockwise())
    }
    ,
    e.prototype.rotateCounterClockwise45 = function() {
        return new e(this.delegate.rotateCounterClockwise45())
    }
    ,
    e
}(uh), ybe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), _be = function(t) {
    ybe(e, t);
    function e(n, r) {
        r === void 0 && (r = !1);
        var i = t.call(this, n.width, n.height) || this;
        return i.canvas = n,
        i.tempCanvasElement = null,
        i.buffer = e.makeBufferFromCanvasImageData(n, r),
        i
    }
    return e.makeBufferFromCanvasImageData = function(n, r) {
        r === void 0 && (r = !1);
        var i = n.getContext("2d").getImageData(0, 0, n.width, n.height);
        return e.toGrayscaleBuffer(i.data, n.width, n.height, r)
    }
    ,
    e.toGrayscaleBuffer = function(n, r, i, o) {
        o === void 0 && (o = !1);
        var s = new Uint8ClampedArray(r * i);
        if (e.FRAME_INDEX = !e.FRAME_INDEX,
        e.FRAME_INDEX || !o)
            for (var a = 0, l = 0, c = n.length; a < c; a += 4,
            l++) {
                var u = void 0
                  , f = n[a + 3];
                if (f === 0)
                    u = 255;
                else {
                    var d = n[a]
                      , h = n[a + 1]
                      , p = n[a + 2];
                    u = 306 * d + 601 * h + 117 * p + 512 >> 10
                }
                s[l] = u
            }
        else
            for (var a = 0, l = 0, y = n.length; a < y; a += 4,
            l++) {
                var u = void 0
                  , f = n[a + 3];
                if (f === 0)
                    u = 255;
                else {
                    var d = n[a]
                      , h = n[a + 1]
                      , p = n[a + 2];
                    u = 306 * d + 601 * h + 117 * p + 512 >> 10
                }
                s[l] = 255 - u
            }
        return s
    }
    ,
    e.prototype.getRow = function(n, r) {
        if (n < 0 || n >= this.getHeight())
            throw new ke("Requested row is outside the image: " + n);
        var i = this.getWidth()
          , o = n * i;
        return r === null ? r = this.buffer.slice(o, o + i) : (r.length < i && (r = new Uint8ClampedArray(i)),
        r.set(this.buffer.slice(o, o + i))),
        r
    }
    ,
    e.prototype.getMatrix = function() {
        return this.buffer
    }
    ,
    e.prototype.isCropSupported = function() {
        return !0
    }
    ,
    e.prototype.crop = function(n, r, i, o) {
        return t.prototype.crop.call(this, n, r, i, o),
        this
    }
    ,
    e.prototype.isRotateSupported = function() {
        return !0
    }
    ,
    e.prototype.rotateCounterClockwise = function() {
        return this.rotate(-90),
        this
    }
    ,
    e.prototype.rotateCounterClockwise45 = function() {
        return this.rotate(-45),
        this
    }
    ,
    e.prototype.getTempCanvasElement = function() {
        if (this.tempCanvasElement === null) {
            var n = this.canvas.ownerDocument.createElement("canvas");
            n.width = this.canvas.width,
            n.height = this.canvas.height,
            this.tempCanvasElement = n
        }
        return this.tempCanvasElement
    }
    ,
    e.prototype.rotate = function(n) {
        var r = this.getTempCanvasElement()
          , i = r.getContext("2d")
          , o = n * e.DEGREE_TO_RADIANS
          , s = this.canvas.width
          , a = this.canvas.height
          , l = Math.ceil(Math.abs(Math.cos(o)) * s + Math.abs(Math.sin(o)) * a)
          , c = Math.ceil(Math.abs(Math.sin(o)) * s + Math.abs(Math.cos(o)) * a);
        return r.width = l,
        r.height = c,
        i.translate(l / 2, c / 2),
        i.rotate(o),
        i.drawImage(this.canvas, s / -2, a / -2),
        this.buffer = e.makeBufferFromCanvasImageData(r),
        this
    }
    ,
    e.prototype.invert = function() {
        return new vm(this)
    }
    ,
    e.DEGREE_TO_RADIANS = Math.PI / 180,
    e.FRAME_INDEX = !0,
    e
}(uh), xbe = function() {
    function t(e, n, r) {
        this.deviceId = e,
        this.label = n,
        this.kind = "videoinput",
        this.groupId = r || void 0
    }
    return t.prototype.toJSON = function() {
        return {
            kind: this.kind,
            groupId: this.groupId,
            deviceId: this.deviceId,
            label: this.label
        }
    }
    ,
    t
}(), rr = globalThis && globalThis.__awaiter || function(t, e, n, r) {
    function i(o) {
        return o instanceof n ? o : new n(function(s) {
            s(o)
        }
        )
    }
    return new (n || (n = Promise))(function(o, s) {
        function a(u) {
            try {
                c(r.next(u))
            } catch (f) {
                s(f)
            }
        }
        function l(u) {
            try {
                c(r.throw(u))
            } catch (f) {
                s(f)
            }
        }
        function c(u) {
            u.done ? o(u.value) : i(u.value).then(a, l)
        }
        c((r = r.apply(t, e || [])).next())
    }
    )
}
, ir = globalThis && globalThis.__generator || function(t, e) {
    var n = {
        label: 0,
        sent: function() {
            if (o[0] & 1)
                throw o[1];
            return o[1]
        },
        trys: [],
        ops: []
    }, r, i, o, s;
    return s = {
        next: a(0),
        throw: a(1),
        return: a(2)
    },
    typeof Symbol == "function" && (s[Symbol.iterator] = function() {
        return this
    }
    ),
    s;
    function a(c) {
        return function(u) {
            return l([c, u])
        }
    }
    function l(c) {
        if (r)
            throw new TypeError("Generator is already executing.");
        for (; n; )
            try {
                if (r = 1,
                i && (o = c[0] & 2 ? i.return : c[0] ? i.throw || ((o = i.return) && o.call(i),
                0) : i.next) && !(o = o.call(i, c[1])).done)
                    return o;
                switch (i = 0,
                o && (c = [c[0] & 2, o.value]),
                c[0]) {
                case 0:
                case 1:
                    o = c;
                    break;
                case 4:
                    return n.label++,
                    {
                        value: c[1],
                        done: !1
                    };
                case 5:
                    n.label++,
                    i = c[1],
                    c = [0];
                    continue;
                case 7:
                    c = n.ops.pop(),
                    n.trys.pop();
                    continue;
                default:
                    if (o = n.trys,
                    !(o = o.length > 0 && o[o.length - 1]) && (c[0] === 6 || c[0] === 2)) {
                        n = 0;
                        continue
                    }
                    if (c[0] === 3 && (!o || c[1] > o[0] && c[1] < o[3])) {
                        n.label = c[1];
                        break
                    }
                    if (c[0] === 6 && n.label < o[1]) {
                        n.label = o[1],
                        o = c;
                        break
                    }
                    if (o && n.label < o[2]) {
                        n.label = o[2],
                        n.ops.push(c);
                        break
                    }
                    o[2] && n.ops.pop(),
                    n.trys.pop();
                    continue
                }
                c = e.call(t, n)
            } catch (u) {
                c = [6, u],
                i = 0
            } finally {
                r = o = 0
            }
        if (c[0] & 5)
            throw c[1];
        return {
            value: c[0] ? c[1] : void 0,
            done: !0
        }
    }
}
, bbe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, Eu = function() {
    function t(e, n, r) {
        n === void 0 && (n = 500),
        this.reader = e,
        this.timeBetweenScansMillis = n,
        this._hints = r,
        this._stopContinuousDecode = !1,
        this._stopAsyncDecode = !1,
        this._timeBetweenDecodingAttempts = 0
    }
    return Object.defineProperty(t.prototype, "hasNavigator", {
        get: function() {
            return typeof navigator < "u"
        },
        enumerable: !1,
        configurable: !0
    }),
    Object.defineProperty(t.prototype, "isMediaDevicesSuported", {
        get: function() {
            return this.hasNavigator && !!navigator.mediaDevices
        },
        enumerable: !1,
        configurable: !0
    }),
    Object.defineProperty(t.prototype, "canEnumerateDevices", {
        get: function() {
            return !!(this.isMediaDevicesSuported && navigator.mediaDevices.enumerateDevices)
        },
        enumerable: !1,
        configurable: !0
    }),
    Object.defineProperty(t.prototype, "timeBetweenDecodingAttempts", {
        get: function() {
            return this._timeBetweenDecodingAttempts
        },
        set: function(e) {
            this._timeBetweenDecodingAttempts = e < 0 ? 0 : e
        },
        enumerable: !1,
        configurable: !0
    }),
    Object.defineProperty(t.prototype, "hints", {
        get: function() {
            return this._hints
        },
        set: function(e) {
            this._hints = e || null
        },
        enumerable: !1,
        configurable: !0
    }),
    t.prototype.listVideoInputDevices = function() {
        return rr(this, void 0, void 0, function() {
            var e, n, r, i, o, s, a, l, c, u, f, d;
            return ir(this, function(h) {
                switch (h.label) {
                case 0:
                    if (!this.hasNavigator)
                        throw new Error("Can't enumerate devices, navigator is not present.");
                    if (!this.canEnumerateDevices)
                        throw new Error("Can't enumerate devices, method not supported.");
                    return [4, navigator.mediaDevices.enumerateDevices()];
                case 1:
                    e = h.sent(),
                    n = [];
                    try {
                        for (r = bbe(e),
                        i = r.next(); !i.done; i = r.next())
                            o = i.value,
                            s = o.kind === "video" ? "videoinput" : o.kind,
                            s === "videoinput" && (a = o.deviceId || o.id,
                            l = o.label || "Video device " + (n.length + 1),
                            c = o.groupId,
                            u = {
                                deviceId: a,
                                label: l,
                                kind: s,
                                groupId: c
                            },
                            n.push(u))
                    } catch (p) {
                        f = {
                            error: p
                        }
                    } finally {
                        try {
                            i && !i.done && (d = r.return) && d.call(r)
                        } finally {
                            if (f)
                                throw f.error
                        }
                    }
                    return [2, n]
                }
            })
        })
    }
    ,
    t.prototype.getVideoInputDevices = function() {
        return rr(this, void 0, void 0, function() {
            var e;
            return ir(this, function(n) {
                switch (n.label) {
                case 0:
                    return [4, this.listVideoInputDevices()];
                case 1:
                    return e = n.sent(),
                    [2, e.map(function(r) {
                        return new xbe(r.deviceId,r.label)
                    })]
                }
            })
        })
    }
    ,
    t.prototype.findDeviceById = function(e) {
        return rr(this, void 0, void 0, function() {
            var n;
            return ir(this, function(r) {
                switch (r.label) {
                case 0:
                    return [4, this.listVideoInputDevices()];
                case 1:
                    return n = r.sent(),
                    n ? [2, n.find(function(i) {
                        return i.deviceId === e
                    })] : [2, null]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromInputVideoDevice = function(e, n) {
        return rr(this, void 0, void 0, function() {
            return ir(this, function(r) {
                switch (r.label) {
                case 0:
                    return [4, this.decodeOnceFromVideoDevice(e, n)];
                case 1:
                    return [2, r.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeOnceFromVideoDevice = function(e, n) {
        return rr(this, void 0, void 0, function() {
            var r, i;
            return ir(this, function(o) {
                switch (o.label) {
                case 0:
                    return this.reset(),
                    e ? r = {
                        deviceId: {
                            exact: e
                        }
                    } : r = {
                        facingMode: "environment"
                    },
                    i = {
                        video: r
                    },
                    [4, this.decodeOnceFromConstraints(i, n)];
                case 1:
                    return [2, o.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeOnceFromConstraints = function(e, n) {
        return rr(this, void 0, void 0, function() {
            var r;
            return ir(this, function(i) {
                switch (i.label) {
                case 0:
                    return [4, navigator.mediaDevices.getUserMedia(e)];
                case 1:
                    return r = i.sent(),
                    [4, this.decodeOnceFromStream(r, n)];
                case 2:
                    return [2, i.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeOnceFromStream = function(e, n) {
        return rr(this, void 0, void 0, function() {
            var r, i;
            return ir(this, function(o) {
                switch (o.label) {
                case 0:
                    return this.reset(),
                    [4, this.attachStreamToVideo(e, n)];
                case 1:
                    return r = o.sent(),
                    [4, this.decodeOnce(r)];
                case 2:
                    return i = o.sent(),
                    [2, i]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromInputVideoDeviceContinuously = function(e, n, r) {
        return rr(this, void 0, void 0, function() {
            return ir(this, function(i) {
                switch (i.label) {
                case 0:
                    return [4, this.decodeFromVideoDevice(e, n, r)];
                case 1:
                    return [2, i.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromVideoDevice = function(e, n, r) {
        return rr(this, void 0, void 0, function() {
            var i, o;
            return ir(this, function(s) {
                switch (s.label) {
                case 0:
                    return e ? i = {
                        deviceId: {
                            exact: e
                        }
                    } : i = {
                        facingMode: "environment"
                    },
                    o = {
                        video: i
                    },
                    [4, this.decodeFromConstraints(o, n, r)];
                case 1:
                    return [2, s.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromConstraints = function(e, n, r) {
        return rr(this, void 0, void 0, function() {
            var i;
            return ir(this, function(o) {
                switch (o.label) {
                case 0:
                    return [4, navigator.mediaDevices.getUserMedia(e)];
                case 1:
                    return i = o.sent(),
                    [4, this.decodeFromStream(i, n, r)];
                case 2:
                    return [2, o.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromStream = function(e, n, r) {
        return rr(this, void 0, void 0, function() {
            var i;
            return ir(this, function(o) {
                switch (o.label) {
                case 0:
                    return this.reset(),
                    [4, this.attachStreamToVideo(e, n)];
                case 1:
                    return i = o.sent(),
                    [4, this.decodeContinuously(i, r)];
                case 2:
                    return [2, o.sent()]
                }
            })
        })
    }
    ,
    t.prototype.stopAsyncDecode = function() {
        this._stopAsyncDecode = !0
    }
    ,
    t.prototype.stopContinuousDecode = function() {
        this._stopContinuousDecode = !0
    }
    ,
    t.prototype.attachStreamToVideo = function(e, n) {
        return rr(this, void 0, void 0, function() {
            var r;
            return ir(this, function(i) {
                switch (i.label) {
                case 0:
                    return r = this.prepareVideoElement(n),
                    this.addVideoSource(r, e),
                    this.videoElement = r,
                    this.stream = e,
                    [4, this.playVideoOnLoadAsync(r)];
                case 1:
                    return i.sent(),
                    [2, r]
                }
            })
        })
    }
    ,
    t.prototype.playVideoOnLoadAsync = function(e) {
        var n = this;
        return new Promise(function(r, i) {
            return n.playVideoOnLoad(e, function() {
                return r()
            })
        }
        )
    }
    ,
    t.prototype.playVideoOnLoad = function(e, n) {
        var r = this;
        this.videoEndedListener = function() {
            return r.stopStreams()
        }
        ,
        this.videoCanPlayListener = function() {
            return r.tryPlayVideo(e)
        }
        ,
        e.addEventListener("ended", this.videoEndedListener),
        e.addEventListener("canplay", this.videoCanPlayListener),
        e.addEventListener("playing", n),
        this.tryPlayVideo(e)
    }
    ,
    t.prototype.isVideoPlaying = function(e) {
        return e.currentTime > 0 && !e.paused && !e.ended && e.readyState > 2
    }
    ,
    t.prototype.tryPlayVideo = function(e) {
        return rr(this, void 0, void 0, function() {
            return ir(this, function(n) {
                switch (n.label) {
                case 0:
                    if (this.isVideoPlaying(e))
                        return console.warn("Trying to play video that is already playing."),
                        [2];
                    n.label = 1;
                case 1:
                    return n.trys.push([1, 3, , 4]),
                    [4, e.play()];
                case 2:
                    return n.sent(),
                    [3, 4];
                case 3:
                    return n.sent(),
                    console.warn("It was not possible to play the video."),
                    [3, 4];
                case 4:
                    return [2]
                }
            })
        })
    }
    ,
    t.prototype.getMediaElement = function(e, n) {
        var r = document.getElementById(e);
        if (!r)
            throw new rn("element with id '" + e + "' not found");
        if (r.nodeName.toLowerCase() !== n.toLowerCase())
            throw new rn("element with id '" + e + "' must be an " + n + " element");
        return r
    }
    ,
    t.prototype.decodeFromImage = function(e, n) {
        if (!e && !n)
            throw new rn("either imageElement with a src set or an url must be provided");
        return n && !e ? this.decodeFromImageUrl(n) : this.decodeFromImageElement(e)
    }
    ,
    t.prototype.decodeFromVideo = function(e, n) {
        if (!e && !n)
            throw new rn("Either an element with a src set or an URL must be provided");
        return n && !e ? this.decodeFromVideoUrl(n) : this.decodeFromVideoElement(e)
    }
    ,
    t.prototype.decodeFromVideoContinuously = function(e, n, r) {
        if (e === void 0 && n === void 0)
            throw new rn("Either an element with a src set or an URL must be provided");
        return n && !e ? this.decodeFromVideoUrlContinuously(n, r) : this.decodeFromVideoElementContinuously(e, r)
    }
    ,
    t.prototype.decodeFromImageElement = function(e) {
        if (!e)
            throw new rn("An image element must be provided.");
        this.reset();
        var n = this.prepareImageElement(e);
        this.imageElement = n;
        var r;
        return this.isImageLoaded(n) ? r = this.decodeOnce(n, !1, !0) : r = this._decodeOnLoadImage(n),
        r
    }
    ,
    t.prototype.decodeFromVideoElement = function(e) {
        var n = this._decodeFromVideoElementSetup(e);
        return this._decodeOnLoadVideo(n)
    }
    ,
    t.prototype.decodeFromVideoElementContinuously = function(e, n) {
        var r = this._decodeFromVideoElementSetup(e);
        return this._decodeOnLoadVideoContinuously(r, n)
    }
    ,
    t.prototype._decodeFromVideoElementSetup = function(e) {
        if (!e)
            throw new rn("A video element must be provided.");
        this.reset();
        var n = this.prepareVideoElement(e);
        return this.videoElement = n,
        n
    }
    ,
    t.prototype.decodeFromImageUrl = function(e) {
        if (!e)
            throw new rn("An URL must be provided.");
        this.reset();
        var n = this.prepareImageElement();
        this.imageElement = n;
        var r = this._decodeOnLoadImage(n);
        return n.src = e,
        r
    }
    ,
    t.prototype.decodeFromVideoUrl = function(e) {
        if (!e)
            throw new rn("An URL must be provided.");
        this.reset();
        var n = this.prepareVideoElement()
          , r = this.decodeFromVideoElement(n);
        return n.src = e,
        r
    }
    ,
    t.prototype.decodeFromVideoUrlContinuously = function(e, n) {
        if (!e)
            throw new rn("An URL must be provided.");
        this.reset();
        var r = this.prepareVideoElement()
          , i = this.decodeFromVideoElementContinuously(r, n);
        return r.src = e,
        i
    }
    ,
    t.prototype._decodeOnLoadImage = function(e) {
        var n = this;
        return new Promise(function(r, i) {
            n.imageLoadedListener = function() {
                return n.decodeOnce(e, !1, !0).then(r, i)
            }
            ,
            e.addEventListener("load", n.imageLoadedListener)
        }
        )
    }
    ,
    t.prototype._decodeOnLoadVideo = function(e) {
        return rr(this, void 0, void 0, function() {
            return ir(this, function(n) {
                switch (n.label) {
                case 0:
                    return [4, this.playVideoOnLoadAsync(e)];
                case 1:
                    return n.sent(),
                    [4, this.decodeOnce(e)];
                case 2:
                    return [2, n.sent()]
                }
            })
        })
    }
    ,
    t.prototype._decodeOnLoadVideoContinuously = function(e, n) {
        return rr(this, void 0, void 0, function() {
            return ir(this, function(r) {
                switch (r.label) {
                case 0:
                    return [4, this.playVideoOnLoadAsync(e)];
                case 1:
                    return r.sent(),
                    this.decodeContinuously(e, n),
                    [2]
                }
            })
        })
    }
    ,
    t.prototype.isImageLoaded = function(e) {
        return !(!e.complete || e.naturalWidth === 0)
    }
    ,
    t.prototype.prepareImageElement = function(e) {
        var n;
        return typeof e > "u" && (n = document.createElement("img"),
        n.width = 200,
        n.height = 200),
        typeof e == "string" && (n = this.getMediaElement(e, "img")),
        e instanceof HTMLImageElement && (n = e),
        n
    }
    ,
    t.prototype.prepareVideoElement = function(e) {
        var n;
        return !e && typeof document < "u" && (n = document.createElement("video"),
        n.width = 200,
        n.height = 200),
        typeof e == "string" && (n = this.getMediaElement(e, "video")),
        e instanceof HTMLVideoElement && (n = e),
        n.setAttribute("autoplay", "true"),
        n.setAttribute("muted", "true"),
        n.setAttribute("playsinline", "true"),
        n
    }
    ,
    t.prototype.decodeOnce = function(e, n, r) {
        var i = this;
        n === void 0 && (n = !0),
        r === void 0 && (r = !0),
        this._stopAsyncDecode = !1;
        var o = function(s, a) {
            if (i._stopAsyncDecode) {
                a(new oe("Video stream has ended before any code could be detected.")),
                i._stopAsyncDecode = void 0;
                return
            }
            try {
                var l = i.decode(e);
                s(l)
            } catch (d) {
                var c = n && d instanceof oe
                  , u = d instanceof fn || d instanceof me
                  , f = u && r;
                if (c || f)
                    return setTimeout(o, i._timeBetweenDecodingAttempts, s, a);
                a(d)
            }
        };
        return new Promise(function(s, a) {
            return o(s, a)
        }
        )
    }
    ,
    t.prototype.decodeContinuously = function(e, n) {
        var r = this;
        this._stopContinuousDecode = !1;
        var i = function() {
            if (r._stopContinuousDecode) {
                r._stopContinuousDecode = void 0;
                return
            }
            try {
                var o = r.decode(e);
                n(o, null),
                setTimeout(i, r.timeBetweenScansMillis)
            } catch (l) {
                n(null, l);
                var s = l instanceof fn || l instanceof me
                  , a = l instanceof oe;
                (s || a) && setTimeout(i, r._timeBetweenDecodingAttempts)
            }
        };
        i()
    }
    ,
    t.prototype.decode = function(e) {
        var n = this.createBinaryBitmap(e);
        return this.decodeBitmap(n)
    }
    ,
    t.prototype.createBinaryBitmap = function(e) {
        this.getCaptureCanvasContext(e);
        var n = !1;
        e instanceof HTMLVideoElement ? (this.drawFrameOnCanvas(e),
        n = !0) : this.drawImageOnCanvas(e);
        var r = this.getCaptureCanvas(e)
          , i = new _be(r,n)
          , o = new I9(i);
        return new P9(o)
    }
    ,
    t.prototype.getCaptureCanvasContext = function(e) {
        if (!this.captureCanvasContext) {
            var n = this.getCaptureCanvas(e)
              , r = void 0;
            try {
                r = n.getContext("2d", {
                    willReadFrequently: !0
                })
            } catch {
                r = n.getContext("2d")
            }
            this.captureCanvasContext = r
        }
        return this.captureCanvasContext
    }
    ,
    t.prototype.getCaptureCanvas = function(e) {
        if (!this.captureCanvas) {
            var n = this.createCaptureCanvas(e);
            this.captureCanvas = n
        }
        return this.captureCanvas
    }
    ,
    t.prototype.drawFrameOnCanvas = function(e, n, r) {
        n === void 0 && (n = {
            sx: 0,
            sy: 0,
            sWidth: e.videoWidth,
            sHeight: e.videoHeight,
            dx: 0,
            dy: 0,
            dWidth: e.videoWidth,
            dHeight: e.videoHeight
        }),
        r === void 0 && (r = this.captureCanvasContext),
        r.drawImage(e, n.sx, n.sy, n.sWidth, n.sHeight, n.dx, n.dy, n.dWidth, n.dHeight)
    }
    ,
    t.prototype.drawImageOnCanvas = function(e, n, r) {
        n === void 0 && (n = {
            sx: 0,
            sy: 0,
            sWidth: e.naturalWidth,
            sHeight: e.naturalHeight,
            dx: 0,
            dy: 0,
            dWidth: e.naturalWidth,
            dHeight: e.naturalHeight
        }),
        r === void 0 && (r = this.captureCanvasContext),
        r.drawImage(e, n.sx, n.sy, n.sWidth, n.sHeight, n.dx, n.dy, n.dWidth, n.dHeight)
    }
    ,
    t.prototype.decodeBitmap = function(e) {
        return this.reader.decode(e, this._hints)
    }
    ,
    t.prototype.createCaptureCanvas = function(e) {
        if (typeof document > "u")
            return this._destroyCaptureCanvas(),
            null;
        var n = document.createElement("canvas"), r, i;
        return typeof e < "u" && (e instanceof HTMLVideoElement ? (r = e.videoWidth,
        i = e.videoHeight) : e instanceof HTMLImageElement && (r = e.naturalWidth || e.width,
        i = e.naturalHeight || e.height)),
        n.style.width = r + "px",
        n.style.height = i + "px",
        n.width = r,
        n.height = i,
        n
    }
    ,
    t.prototype.stopStreams = function() {
        this.stream && (this.stream.getVideoTracks().forEach(function(e) {
            return e.stop()
        }),
        this.stream = void 0),
        this._stopAsyncDecode === !1 && this.stopAsyncDecode(),
        this._stopContinuousDecode === !1 && this.stopContinuousDecode()
    }
    ,
    t.prototype.reset = function() {
        this.stopStreams(),
        this._destroyVideoElement(),
        this._destroyImageElement(),
        this._destroyCaptureCanvas()
    }
    ,
    t.prototype._destroyVideoElement = function() {
        this.videoElement && (typeof this.videoEndedListener < "u" && this.videoElement.removeEventListener("ended", this.videoEndedListener),
        typeof this.videoPlayingEventListener < "u" && this.videoElement.removeEventListener("playing", this.videoPlayingEventListener),
        typeof this.videoCanPlayListener < "u" && this.videoElement.removeEventListener("loadedmetadata", this.videoCanPlayListener),
        this.cleanVideoSource(this.videoElement),
        this.videoElement = void 0)
    }
    ,
    t.prototype._destroyImageElement = function() {
        this.imageElement && (this.imageLoadedListener !== void 0 && this.imageElement.removeEventListener("load", this.imageLoadedListener),
        this.imageElement.src = void 0,
        this.imageElement.removeAttribute("src"),
        this.imageElement = void 0)
    }
    ,
    t.prototype._destroyCaptureCanvas = function() {
        this.captureCanvasContext = void 0,
        this.captureCanvas = void 0
    }
    ,
    t.prototype.addVideoSource = function(e, n) {
        try {
            e.srcObject = n
        } catch {
            e.src = URL.createObjectURL(n)
        }
    }
    ,
    t.prototype.cleanVideoSource = function(e) {
        try {
            e.srcObject = null
        } catch {
            e.src = ""
        }
        this.videoElement.removeAttribute("src")
    }
    ,
    t
}(), tr = function() {
    function t(e, n, r, i, o, s) {
        r === void 0 && (r = n == null ? 0 : 8 * n.length),
        s === void 0 && (s = It.currentTimeMillis()),
        this.text = e,
        this.rawBytes = n,
        this.numBits = r,
        this.resultPoints = i,
        this.format = o,
        this.timestamp = s,
        this.text = e,
        this.rawBytes = n,
        r == null ? this.numBits = n == null ? 0 : 8 * n.length : this.numBits = r,
        this.resultPoints = i,
        this.format = o,
        this.resultMetadata = null,
        s == null ? this.timestamp = It.currentTimeMillis() : this.timestamp = s
    }
    return t.prototype.getText = function() {
        return this.text
    }
    ,
    t.prototype.getRawBytes = function() {
        return this.rawBytes
    }
    ,
    t.prototype.getNumBits = function() {
        return this.numBits
    }
    ,
    t.prototype.getResultPoints = function() {
        return this.resultPoints
    }
    ,
    t.prototype.getBarcodeFormat = function() {
        return this.format
    }
    ,
    t.prototype.getResultMetadata = function() {
        return this.resultMetadata
    }
    ,
    t.prototype.putMetadata = function(e, n) {
        this.resultMetadata === null && (this.resultMetadata = new Map),
        this.resultMetadata.set(e, n)
    }
    ,
    t.prototype.putAllMetadata = function(e) {
        e !== null && (this.resultMetadata === null ? this.resultMetadata = e : this.resultMetadata = new Map(e))
    }
    ,
    t.prototype.addResultPoints = function(e) {
        var n = this.resultPoints;
        if (n === null)
            this.resultPoints = e;
        else if (e !== null && e.length > 0) {
            var r = new Array(n.length + e.length);
            It.arraycopy(n, 0, r, 0, n.length),
            It.arraycopy(e, 0, r, n.length, e.length),
            this.resultPoints = r
        }
    }
    ,
    t.prototype.getTimestamp = function() {
        return this.timestamp
    }
    ,
    t.prototype.toString = function() {
        return this.text
    }
    ,
    t
}(), wx;
(function(t) {
    t[t.AZTEC = 0] = "AZTEC",
    t[t.CODABAR = 1] = "CODABAR",
    t[t.CODE_39 = 2] = "CODE_39",
    t[t.CODE_93 = 3] = "CODE_93",
    t[t.CODE_128 = 4] = "CODE_128",
    t[t.DATA_MATRIX = 5] = "DATA_MATRIX",
    t[t.EAN_8 = 6] = "EAN_8",
    t[t.EAN_13 = 7] = "EAN_13",
    t[t.ITF = 8] = "ITF",
    t[t.MAXICODE = 9] = "MAXICODE",
    t[t.PDF_417 = 10] = "PDF_417",
    t[t.QR_CODE = 11] = "QR_CODE",
    t[t.RSS_14 = 12] = "RSS_14",
    t[t.RSS_EXPANDED = 13] = "RSS_EXPANDED",
    t[t.UPC_A = 14] = "UPC_A",
    t[t.UPC_E = 15] = "UPC_E",
    t[t.UPC_EAN_EXTENSION = 16] = "UPC_EAN_EXTENSION"
}
)(wx || (wx = {}));
const Be = wx;
var Ex;
(function(t) {
    t[t.OTHER = 0] = "OTHER",
    t[t.ORIENTATION = 1] = "ORIENTATION",
    t[t.BYTE_SEGMENTS = 2] = "BYTE_SEGMENTS",
    t[t.ERROR_CORRECTION_LEVEL = 3] = "ERROR_CORRECTION_LEVEL",
    t[t.ISSUE_NUMBER = 4] = "ISSUE_NUMBER",
    t[t.SUGGESTED_PRICE = 5] = "SUGGESTED_PRICE",
    t[t.POSSIBLE_COUNTRY = 6] = "POSSIBLE_COUNTRY",
    t[t.UPC_EAN_EXTENSION = 7] = "UPC_EAN_EXTENSION",
    t[t.PDF417_EXTRA_METADATA = 8] = "PDF417_EXTRA_METADATA",
    t[t.STRUCTURED_APPEND_SEQUENCE = 9] = "STRUCTURED_APPEND_SEQUENCE",
    t[t.STRUCTURED_APPEND_PARITY = 10] = "STRUCTURED_APPEND_PARITY"
}
)(Ex || (Ex = {}));
const Gn = Ex;
var ym = function() {
    function t(e, n, r, i, o, s) {
        o === void 0 && (o = -1),
        s === void 0 && (s = -1),
        this.rawBytes = e,
        this.text = n,
        this.byteSegments = r,
        this.ecLevel = i,
        this.structuredAppendSequenceNumber = o,
        this.structuredAppendParity = s,
        this.numBits = e == null ? 0 : 8 * e.length
    }
    return t.prototype.getRawBytes = function() {
        return this.rawBytes
    }
    ,
    t.prototype.getNumBits = function() {
        return this.numBits
    }
    ,
    t.prototype.setNumBits = function(e) {
        this.numBits = e
    }
    ,
    t.prototype.getText = function() {
        return this.text
    }
    ,
    t.prototype.getByteSegments = function() {
        return this.byteSegments
    }
    ,
    t.prototype.getECLevel = function() {
        return this.ecLevel
    }
    ,
    t.prototype.getErrorsCorrected = function() {
        return this.errorsCorrected
    }
    ,
    t.prototype.setErrorsCorrected = function(e) {
        this.errorsCorrected = e
    }
    ,
    t.prototype.getErasures = function() {
        return this.erasures
    }
    ,
    t.prototype.setErasures = function(e) {
        this.erasures = e
    }
    ,
    t.prototype.getOther = function() {
        return this.other
    }
    ,
    t.prototype.setOther = function(e) {
        this.other = e
    }
    ,
    t.prototype.hasStructuredAppend = function() {
        return this.structuredAppendParity >= 0 && this.structuredAppendSequenceNumber >= 0
    }
    ,
    t.prototype.getStructuredAppendParity = function() {
        return this.structuredAppendParity
    }
    ,
    t.prototype.getStructuredAppendSequenceNumber = function() {
        return this.structuredAppendSequenceNumber
    }
    ,
    t
}(), af = function() {
    function t() {}
    return t.prototype.exp = function(e) {
        return this.expTable[e]
    }
    ,
    t.prototype.log = function(e) {
        if (e === 0)
            throw new ke;
        return this.logTable[e]
    }
    ,
    t.addOrSubtract = function(e, n) {
        return e ^ n
    }
    ,
    t
}(), Ks = function() {
    function t(e, n) {
        if (n.length === 0)
            throw new ke;
        this.field = e;
        var r = n.length;
        if (r > 1 && n[0] === 0) {
            for (var i = 1; i < r && n[i] === 0; )
                i++;
            i === r ? this.coefficients = Int32Array.from([0]) : (this.coefficients = new Int32Array(r - i),
            It.arraycopy(n, i, this.coefficients, 0, this.coefficients.length))
        } else
            this.coefficients = n
    }
    return t.prototype.getCoefficients = function() {
        return this.coefficients
    }
    ,
    t.prototype.getDegree = function() {
        return this.coefficients.length - 1
    }
    ,
    t.prototype.isZero = function() {
        return this.coefficients[0] === 0
    }
    ,
    t.prototype.getCoefficient = function(e) {
        return this.coefficients[this.coefficients.length - 1 - e]
    }
    ,
    t.prototype.evaluateAt = function(e) {
        if (e === 0)
            return this.getCoefficient(0);
        var n = this.coefficients, r;
        if (e === 1) {
            r = 0;
            for (var i = 0, o = n.length; i !== o; i++) {
                var s = n[i];
                r = af.addOrSubtract(r, s)
            }
            return r
        }
        r = n[0];
        for (var a = n.length, l = this.field, i = 1; i < a; i++)
            r = af.addOrSubtract(l.multiply(e, r), n[i]);
        return r
    }
    ,
    t.prototype.addOrSubtract = function(e) {
        if (!this.field.equals(e.field))
            throw new ke("GenericGFPolys do not have same GenericGF field");
        if (this.isZero())
            return e;
        if (e.isZero())
            return this;
        var n = this.coefficients
          , r = e.coefficients;
        if (n.length > r.length) {
            var i = n;
            n = r,
            r = i
        }
        var o = new Int32Array(r.length)
          , s = r.length - n.length;
        It.arraycopy(r, 0, o, 0, s);
        for (var a = s; a < r.length; a++)
            o[a] = af.addOrSubtract(n[a - s], r[a]);
        return new t(this.field,o)
    }
    ,
    t.prototype.multiply = function(e) {
        if (!this.field.equals(e.field))
            throw new ke("GenericGFPolys do not have same GenericGF field");
        if (this.isZero() || e.isZero())
            return this.field.getZero();
        for (var n = this.coefficients, r = n.length, i = e.coefficients, o = i.length, s = new Int32Array(r + o - 1), a = this.field, l = 0; l < r; l++)
            for (var c = n[l], u = 0; u < o; u++)
                s[l + u] = af.addOrSubtract(s[l + u], a.multiply(c, i[u]));
        return new t(a,s)
    }
    ,
    t.prototype.multiplyScalar = function(e) {
        if (e === 0)
            return this.field.getZero();
        if (e === 1)
            return this;
        for (var n = this.coefficients.length, r = this.field, i = new Int32Array(n), o = this.coefficients, s = 0; s < n; s++)
            i[s] = r.multiply(o[s], e);
        return new t(r,i)
    }
    ,
    t.prototype.multiplyByMonomial = function(e, n) {
        if (e < 0)
            throw new ke;
        if (n === 0)
            return this.field.getZero();
        for (var r = this.coefficients, i = r.length, o = new Int32Array(i + e), s = this.field, a = 0; a < i; a++)
            o[a] = s.multiply(r[a], n);
        return new t(s,o)
    }
    ,
    t.prototype.divide = function(e) {
        if (!this.field.equals(e.field))
            throw new ke("GenericGFPolys do not have same GenericGF field");
        if (e.isZero())
            throw new ke("Divide by 0");
        for (var n = this.field, r = n.getZero(), i = this, o = e.getCoefficient(e.getDegree()), s = n.inverse(o); i.getDegree() >= e.getDegree() && !i.isZero(); ) {
            var a = i.getDegree() - e.getDegree()
              , l = n.multiply(i.getCoefficient(i.getDegree()), s)
              , c = e.multiplyByMonomial(a, l)
              , u = n.buildMonomial(a, l);
            r = r.addOrSubtract(u),
            i = i.addOrSubtract(c)
        }
        return [r, i]
    }
    ,
    t.prototype.toString = function() {
        for (var e = "", n = this.getDegree(); n >= 0; n--) {
            var r = this.getCoefficient(n);
            if (r !== 0) {
                if (r < 0 ? (e += " - ",
                r = -r) : e.length > 0 && (e += " + "),
                n === 0 || r !== 1) {
                    var i = this.field.log(r);
                    i === 0 ? e += "1" : i === 1 ? e += "a" : (e += "a^",
                    e += i)
                }
                n !== 0 && (n === 1 ? e += "x" : (e += "x^",
                e += n))
            }
        }
        return e
    }
    ,
    t
}(), wbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), O9 = function(t) {
    wbe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.kind = "ArithmeticException",
    e
}(Br), Ebe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), Sr = function(t) {
    Ebe(e, t);
    function e(n, r, i) {
        var o = t.call(this) || this;
        o.primitive = n,
        o.size = r,
        o.generatorBase = i;
        for (var s = new Int32Array(r), a = 1, l = 0; l < r; l++)
            s[l] = a,
            a *= 2,
            a >= r && (a ^= n,
            a &= r - 1);
        o.expTable = s;
        for (var c = new Int32Array(r), l = 0; l < r - 1; l++)
            c[s[l]] = l;
        return o.logTable = c,
        o.zero = new Ks(o,Int32Array.from([0])),
        o.one = new Ks(o,Int32Array.from([1])),
        o
    }
    return e.prototype.getZero = function() {
        return this.zero
    }
    ,
    e.prototype.getOne = function() {
        return this.one
    }
    ,
    e.prototype.buildMonomial = function(n, r) {
        if (n < 0)
            throw new ke;
        if (r === 0)
            return this.zero;
        var i = new Int32Array(n + 1);
        return i[0] = r,
        new Ks(this,i)
    }
    ,
    e.prototype.inverse = function(n) {
        if (n === 0)
            throw new O9;
        return this.expTable[this.size - this.logTable[n] - 1]
    }
    ,
    e.prototype.multiply = function(n, r) {
        return n === 0 || r === 0 ? 0 : this.expTable[(this.logTable[n] + this.logTable[r]) % (this.size - 1)]
    }
    ,
    e.prototype.getSize = function() {
        return this.size
    }
    ,
    e.prototype.getGeneratorBase = function() {
        return this.generatorBase
    }
    ,
    e.prototype.toString = function() {
        return "GF(0x" + qe.toHexString(this.primitive) + "," + this.size + ")"
    }
    ,
    e.prototype.equals = function(n) {
        return n === this
    }
    ,
    e.AZTEC_DATA_12 = new e(4201,4096,1),
    e.AZTEC_DATA_10 = new e(1033,1024,1),
    e.AZTEC_DATA_6 = new e(67,64,1),
    e.AZTEC_PARAM = new e(19,16,1),
    e.QR_CODE_FIELD_256 = new e(285,256,0),
    e.DATA_MATRIX_FIELD_256 = new e(301,256,1),
    e.AZTEC_DATA_8 = e.DATA_MATRIX_FIELD_256,
    e.MAXICODE_FIELD_64 = e.AZTEC_DATA_6,
    e
}(af), Sbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), mp = function(t) {
    Sbe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.kind = "ReedSolomonException",
    e
}(Br), Cbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), fh = function(t) {
    Cbe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.kind = "IllegalStateException",
    e
}(Br), _m = function() {
    function t(e) {
        this.field = e
    }
    return t.prototype.decode = function(e, n) {
        for (var r = this.field, i = new Ks(r,e), o = new Int32Array(n), s = !0, a = 0; a < n; a++) {
            var l = i.evaluateAt(r.exp(a + r.getGeneratorBase()));
            o[o.length - 1 - a] = l,
            l !== 0 && (s = !1)
        }
        if (!s)
            for (var c = new Ks(r,o), u = this.runEuclideanAlgorithm(r.buildMonomial(n, 1), c, n), f = u[0], d = u[1], h = this.findErrorLocations(f), p = this.findErrorMagnitudes(d, h), a = 0; a < h.length; a++) {
                var y = e.length - 1 - r.log(h[a]);
                if (y < 0)
                    throw new mp("Bad error location");
                e[y] = Sr.addOrSubtract(e[y], p[a])
            }
    }
    ,
    t.prototype.runEuclideanAlgorithm = function(e, n, r) {
        if (e.getDegree() < n.getDegree()) {
            var i = e;
            e = n,
            n = i
        }
        for (var o = this.field, s = e, a = n, l = o.getZero(), c = o.getOne(); a.getDegree() >= (r / 2 | 0); ) {
            var u = s
              , f = l;
            if (s = a,
            l = c,
            s.isZero())
                throw new mp("r_{i-1} was zero");
            a = u;
            for (var d = o.getZero(), h = s.getCoefficient(s.getDegree()), p = o.inverse(h); a.getDegree() >= s.getDegree() && !a.isZero(); ) {
                var y = a.getDegree() - s.getDegree()
                  , v = o.multiply(a.getCoefficient(a.getDegree()), p);
                d = d.addOrSubtract(o.buildMonomial(y, v)),
                a = a.addOrSubtract(s.multiplyByMonomial(y, v))
            }
            if (c = d.multiply(l).addOrSubtract(f),
            a.getDegree() >= s.getDegree())
                throw new fh("Division algorithm failed to reduce polynomial?")
        }
        var g = c.getCoefficient(0);
        if (g === 0)
            throw new mp("sigmaTilde(0) was zero");
        var m = o.inverse(g)
          , _ = c.multiplyScalar(m)
          , x = a.multiplyScalar(m);
        return [_, x]
    }
    ,
    t.prototype.findErrorLocations = function(e) {
        var n = e.getDegree();
        if (n === 1)
            return Int32Array.from([e.getCoefficient(1)]);
        for (var r = new Int32Array(n), i = 0, o = this.field, s = 1; s < o.getSize() && i < n; s++)
            e.evaluateAt(s) === 0 && (r[i] = o.inverse(s),
            i++);
        if (i !== n)
            throw new mp("Error locator degree does not match number of roots");
        return r
    }
    ,
    t.prototype.findErrorMagnitudes = function(e, n) {
        for (var r = n.length, i = new Int32Array(r), o = this.field, s = 0; s < r; s++) {
            for (var a = o.inverse(n[s]), l = 1, c = 0; c < r; c++)
                if (s !== c) {
                    var u = o.multiply(n[c], a)
                      , f = u & 1 ? u & -2 : u | 1;
                    l = o.multiply(l, f)
                }
            i[s] = o.multiply(e.evaluateAt(a), o.inverse(l)),
            o.getGeneratorBase() !== 0 && (i[s] = o.multiply(i[s], a))
        }
        return i
    }
    ,
    t
}(), Nn;
(function(t) {
    t[t.UPPER = 0] = "UPPER",
    t[t.LOWER = 1] = "LOWER",
    t[t.MIXED = 2] = "MIXED",
    t[t.DIGIT = 3] = "DIGIT",
    t[t.PUNCT = 4] = "PUNCT",
    t[t.BINARY = 5] = "BINARY"
}
)(Nn || (Nn = {}));
var EP = function() {
    function t() {}
    return t.prototype.decode = function(e) {
        this.ddata = e;
        var n = e.getBits()
          , r = this.extractBits(n)
          , i = this.correctBits(r)
          , o = t.convertBoolArrayToByteArray(i)
          , s = t.getEncodedData(i)
          , a = new ym(o,s,null,null);
        return a.setNumBits(i.length),
        a
    }
    ,
    t.highLevelDecode = function(e) {
        return this.getEncodedData(e)
    }
    ,
    t.getEncodedData = function(e) {
        for (var n = e.length, r = Nn.UPPER, i = Nn.UPPER, o = "", s = 0; s < n; )
            if (i === Nn.BINARY) {
                if (n - s < 5)
                    break;
                var a = t.readCode(e, s, 5);
                if (s += 5,
                a === 0) {
                    if (n - s < 11)
                        break;
                    a = t.readCode(e, s, 11) + 31,
                    s += 11
                }
                for (var l = 0; l < a; l++) {
                    if (n - s < 8) {
                        s = n;
                        break
                    }
                    var c = t.readCode(e, s, 8);
                    o += nt.castAsNonUtf8Char(c),
                    s += 8
                }
                i = r
            } else {
                var u = i === Nn.DIGIT ? 4 : 5;
                if (n - s < u)
                    break;
                var c = t.readCode(e, s, u);
                s += u;
                var f = t.getCharacter(i, c);
                f.startsWith("CTRL_") ? (r = i,
                i = t.getTable(f.charAt(5)),
                f.charAt(6) === "L" && (r = i)) : (o += f,
                i = r)
            }
        return o
    }
    ,
    t.getTable = function(e) {
        switch (e) {
        case "L":
            return Nn.LOWER;
        case "P":
            return Nn.PUNCT;
        case "M":
            return Nn.MIXED;
        case "D":
            return Nn.DIGIT;
        case "B":
            return Nn.BINARY;
        case "U":
        default:
            return Nn.UPPER
        }
    }
    ,
    t.getCharacter = function(e, n) {
        switch (e) {
        case Nn.UPPER:
            return t.UPPER_TABLE[n];
        case Nn.LOWER:
            return t.LOWER_TABLE[n];
        case Nn.MIXED:
            return t.MIXED_TABLE[n];
        case Nn.PUNCT:
            return t.PUNCT_TABLE[n];
        case Nn.DIGIT:
            return t.DIGIT_TABLE[n];
        default:
            throw new fh("Bad table")
        }
    }
    ,
    t.prototype.correctBits = function(e) {
        var n, r;
        this.ddata.getNbLayers() <= 2 ? (r = 6,
        n = Sr.AZTEC_DATA_6) : this.ddata.getNbLayers() <= 8 ? (r = 8,
        n = Sr.AZTEC_DATA_8) : this.ddata.getNbLayers() <= 22 ? (r = 10,
        n = Sr.AZTEC_DATA_10) : (r = 12,
        n = Sr.AZTEC_DATA_12);
        var i = this.ddata.getNbDatablocks()
          , o = e.length / r;
        if (o < i)
            throw new me;
        for (var s = e.length % r, a = new Int32Array(o), l = 0; l < o; l++,
        s += r)
            a[l] = t.readCode(e, s, r);
        try {
            var c = new _m(n);
            c.decode(a, o - i)
        } catch (v) {
            throw new me(v)
        }
        for (var u = (1 << r) - 1, f = 0, l = 0; l < i; l++) {
            var d = a[l];
            if (d === 0 || d === u)
                throw new me;
            (d === 1 || d === u - 1) && f++
        }
        for (var h = new Array(i * r - f), p = 0, l = 0; l < i; l++) {
            var d = a[l];
            if (d === 1 || d === u - 1)
                h.fill(d > 1, p, p + r - 1),
                p += r - 1;
            else
                for (var y = r - 1; y >= 0; --y)
                    h[p++] = (d & 1 << y) !== 0
        }
        return h
    }
    ,
    t.prototype.extractBits = function(e) {
        var n = this.ddata.isCompact()
          , r = this.ddata.getNbLayers()
          , i = (n ? 11 : 14) + r * 4
          , o = new Int32Array(i)
          , s = new Array(this.totalBitsInLayer(r, n));
        if (n)
            for (var a = 0; a < o.length; a++)
                o[a] = a;
        else
            for (var l = i + 1 + 2 * qe.truncDivision(qe.truncDivision(i, 2) - 1, 15), c = i / 2, u = qe.truncDivision(l, 2), a = 0; a < c; a++) {
                var f = a + qe.truncDivision(a, 15);
                o[c - a - 1] = u - f - 1,
                o[c + a] = u + f + 1
            }
        for (var a = 0, d = 0; a < r; a++) {
            for (var h = (r - a) * 4 + (n ? 9 : 12), p = a * 2, y = i - 1 - p, v = 0; v < h; v++)
                for (var g = v * 2, m = 0; m < 2; m++)
                    s[d + g + m] = e.get(o[p + m], o[p + v]),
                    s[d + 2 * h + g + m] = e.get(o[p + v], o[y - m]),
                    s[d + 4 * h + g + m] = e.get(o[y - m], o[y - v]),
                    s[d + 6 * h + g + m] = e.get(o[y - v], o[p + m]);
            d += h * 8
        }
        return s
    }
    ,
    t.readCode = function(e, n, r) {
        for (var i = 0, o = n; o < n + r; o++)
            i <<= 1,
            e[o] && (i |= 1);
        return i
    }
    ,
    t.readByte = function(e, n) {
        var r = e.length - n;
        return r >= 8 ? t.readCode(e, n, 8) : t.readCode(e, n, r) << 8 - r
    }
    ,
    t.convertBoolArrayToByteArray = function(e) {
        for (var n = new Uint8Array((e.length + 7) / 8), r = 0; r < n.length; r++)
            n[r] = t.readByte(e, 8 * r);
        return n
    }
    ,
    t.prototype.totalBitsInLayer = function(e, n) {
        return ((n ? 88 : 112) + 16 * e) * e
    }
    ,
    t.UPPER_TABLE = ["CTRL_PS", " ", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "CTRL_LL", "CTRL_ML", "CTRL_DL", "CTRL_BS"],
    t.LOWER_TABLE = ["CTRL_PS", " ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "CTRL_US", "CTRL_ML", "CTRL_DL", "CTRL_BS"],
    t.MIXED_TABLE = ["CTRL_PS", " ", "", "", "", "", "", "", "\x07", "\b", "	", `
`, "\v", "\f", "\r", "\x1B", "", "", "", "", "@", "\\", "^", "_", "`", "|", "~", "", "CTRL_LL", "CTRL_UL", "CTRL_PL", "CTRL_BS"],
    t.PUNCT_TABLE = ["", "\r", `\r
`, ". ", ", ", ": ", "!", '"', "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", ":", ";", "<", "=", ">", "?", "[", "]", "{", "}", "CTRL_UL"],
    t.DIGIT_TABLE = ["CTRL_PS", " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ",", ".", "CTRL_UL", "CTRL_US"],
    t
}()
  , ft = function() {
    function t() {}
    return t.round = function(e) {
        return isNaN(e) ? 0 : e <= Number.MIN_SAFE_INTEGER ? Number.MIN_SAFE_INTEGER : e >= Number.MAX_SAFE_INTEGER ? Number.MAX_SAFE_INTEGER : e + (e < 0 ? -.5 : .5) | 0
    }
    ,
    t.distance = function(e, n, r, i) {
        var o = e - r
          , s = n - i;
        return Math.sqrt(o * o + s * s)
    }
    ,
    t.sum = function(e) {
        for (var n = 0, r = 0, i = e.length; r !== i; r++) {
            var o = e[r];
            n += o
        }
        return n
    }
    ,
    t
}()
  , Sx = function() {
    function t() {}
    return t.floatToIntBits = function(e) {
        return e
    }
    ,
    t.MAX_VALUE = Number.MAX_SAFE_INTEGER,
    t
}()
  , Pe = function() {
    function t(e, n) {
        this.x = e,
        this.y = n
    }
    return t.prototype.getX = function() {
        return this.x
    }
    ,
    t.prototype.getY = function() {
        return this.y
    }
    ,
    t.prototype.equals = function(e) {
        if (e instanceof t) {
            var n = e;
            return this.x === n.x && this.y === n.y
        }
        return !1
    }
    ,
    t.prototype.hashCode = function() {
        return 31 * Sx.floatToIntBits(this.x) + Sx.floatToIntBits(this.y)
    }
    ,
    t.prototype.toString = function() {
        return "(" + this.x + "," + this.y + ")"
    }
    ,
    t.orderBestPatterns = function(e) {
        var n = this.distance(e[0], e[1]), r = this.distance(e[1], e[2]), i = this.distance(e[0], e[2]), o, s, a;
        if (r >= n && r >= i ? (s = e[0],
        o = e[1],
        a = e[2]) : i >= r && i >= n ? (s = e[1],
        o = e[0],
        a = e[2]) : (s = e[2],
        o = e[0],
        a = e[1]),
        this.crossProductZ(o, s, a) < 0) {
            var l = o;
            o = a,
            a = l
        }
        e[0] = o,
        e[1] = s,
        e[2] = a
    }
    ,
    t.distance = function(e, n) {
        return ft.distance(e.x, e.y, n.x, n.y)
    }
    ,
    t.crossProductZ = function(e, n, r) {
        var i = n.x
          , o = n.y;
        return (r.x - i) * (e.y - o) - (r.y - o) * (e.x - i)
    }
    ,
    t
}()
  , cE = function() {
    function t(e, n) {
        this.bits = e,
        this.points = n
    }
    return t.prototype.getBits = function() {
        return this.bits
    }
    ,
    t.prototype.getPoints = function() {
        return this.points
    }
    ,
    t
}()
  , Abe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Tbe = function(t) {
    Abe(e, t);
    function e(n, r, i, o, s) {
        var a = t.call(this, n, r) || this;
        return a.compact = i,
        a.nbDatablocks = o,
        a.nbLayers = s,
        a
    }
    return e.prototype.getNbLayers = function() {
        return this.nbLayers
    }
    ,
    e.prototype.getNbDatablocks = function() {
        return this.nbDatablocks
    }
    ,
    e.prototype.isCompact = function() {
        return this.compact
    }
    ,
    e
}(cE)
  , Cx = function() {
    function t(e, n, r, i) {
        this.image = e,
        this.height = e.getHeight(),
        this.width = e.getWidth(),
        n == null && (n = t.INIT_SIZE),
        r == null && (r = e.getWidth() / 2 | 0),
        i == null && (i = e.getHeight() / 2 | 0);
        var o = n / 2 | 0;
        if (this.leftInit = r - o,
        this.rightInit = r + o,
        this.upInit = i - o,
        this.downInit = i + o,
        this.upInit < 0 || this.leftInit < 0 || this.downInit >= this.height || this.rightInit >= this.width)
            throw new oe
    }
    return t.prototype.detect = function() {
        for (var e = this.leftInit, n = this.rightInit, r = this.upInit, i = this.downInit, o = !1, s = !0, a = !1, l = !1, c = !1, u = !1, f = !1, d = this.width, h = this.height; s; ) {
            s = !1;
            for (var p = !0; (p || !l) && n < d; )
                p = this.containsBlackPoint(r, i, n, !1),
                p ? (n++,
                s = !0,
                l = !0) : l || n++;
            if (n >= d) {
                o = !0;
                break
            }
            for (var y = !0; (y || !c) && i < h; )
                y = this.containsBlackPoint(e, n, i, !0),
                y ? (i++,
                s = !0,
                c = !0) : c || i++;
            if (i >= h) {
                o = !0;
                break
            }
            for (var v = !0; (v || !u) && e >= 0; )
                v = this.containsBlackPoint(r, i, e, !1),
                v ? (e--,
                s = !0,
                u = !0) : u || e--;
            if (e < 0) {
                o = !0;
                break
            }
            for (var g = !0; (g || !f) && r >= 0; )
                g = this.containsBlackPoint(e, n, r, !0),
                g ? (r--,
                s = !0,
                f = !0) : f || r--;
            if (r < 0) {
                o = !0;
                break
            }
            s && (a = !0)
        }
        if (!o && a) {
            for (var m = n - e, _ = null, x = 1; _ === null && x < m; x++)
                _ = this.getBlackPointOnSegment(e, i - x, e + x, i);
            if (_ == null)
                throw new oe;
            for (var b = null, x = 1; b === null && x < m; x++)
                b = this.getBlackPointOnSegment(e, r + x, e + x, r);
            if (b == null)
                throw new oe;
            for (var w = null, x = 1; w === null && x < m; x++)
                w = this.getBlackPointOnSegment(n, r + x, n - x, r);
            if (w == null)
                throw new oe;
            for (var E = null, x = 1; E === null && x < m; x++)
                E = this.getBlackPointOnSegment(n, i - x, n - x, i);
            if (E == null)
                throw new oe;
            return this.centerEdges(E, _, w, b)
        } else
            throw new oe
    }
    ,
    t.prototype.getBlackPointOnSegment = function(e, n, r, i) {
        for (var o = ft.round(ft.distance(e, n, r, i)), s = (r - e) / o, a = (i - n) / o, l = this.image, c = 0; c < o; c++) {
            var u = ft.round(e + c * s)
              , f = ft.round(n + c * a);
            if (l.get(u, f))
                return new Pe(u,f)
        }
        return null
    }
    ,
    t.prototype.centerEdges = function(e, n, r, i) {
        var o = e.getX()
          , s = e.getY()
          , a = n.getX()
          , l = n.getY()
          , c = r.getX()
          , u = r.getY()
          , f = i.getX()
          , d = i.getY()
          , h = t.CORR;
        return o < this.width / 2 ? [new Pe(f - h,d + h), new Pe(a + h,l + h), new Pe(c - h,u - h), new Pe(o + h,s - h)] : [new Pe(f + h,d + h), new Pe(a + h,l - h), new Pe(c - h,u + h), new Pe(o - h,s - h)]
    }
    ,
    t.prototype.containsBlackPoint = function(e, n, r, i) {
        var o = this.image;
        if (i) {
            for (var s = e; s <= n; s++)
                if (o.get(s, r))
                    return !0
        } else
            for (var a = e; a <= n; a++)
                if (o.get(r, a))
                    return !0;
        return !1
    }
    ,
    t.INIT_SIZE = 10,
    t.CORR = 1,
    t
}()
  , SP = function() {
    function t() {}
    return t.checkAndNudgePoints = function(e, n) {
        for (var r = e.getWidth(), i = e.getHeight(), o = !0, s = 0; s < n.length && o; s += 2) {
            var a = Math.floor(n[s])
              , l = Math.floor(n[s + 1]);
            if (a < -1 || a > r || l < -1 || l > i)
                throw new oe;
            o = !1,
            a === -1 ? (n[s] = 0,
            o = !0) : a === r && (n[s] = r - 1,
            o = !0),
            l === -1 ? (n[s + 1] = 0,
            o = !0) : l === i && (n[s + 1] = i - 1,
            o = !0)
        }
        o = !0;
        for (var s = n.length - 2; s >= 0 && o; s -= 2) {
            var a = Math.floor(n[s])
              , l = Math.floor(n[s + 1]);
            if (a < -1 || a > r || l < -1 || l > i)
                throw new oe;
            o = !1,
            a === -1 ? (n[s] = 0,
            o = !0) : a === r && (n[s] = r - 1,
            o = !0),
            l === -1 ? (n[s + 1] = 0,
            o = !0) : l === i && (n[s + 1] = i - 1,
            o = !0)
        }
    }
    ,
    t
}()
  , R9 = function() {
    function t(e, n, r, i, o, s, a, l, c) {
        this.a11 = e,
        this.a21 = n,
        this.a31 = r,
        this.a12 = i,
        this.a22 = o,
        this.a32 = s,
        this.a13 = a,
        this.a23 = l,
        this.a33 = c
    }
    return t.quadrilateralToQuadrilateral = function(e, n, r, i, o, s, a, l, c, u, f, d, h, p, y, v) {
        var g = t.quadrilateralToSquare(e, n, r, i, o, s, a, l)
          , m = t.squareToQuadrilateral(c, u, f, d, h, p, y, v);
        return m.times(g)
    }
    ,
    t.prototype.transformPoints = function(e) {
        for (var n = e.length, r = this.a11, i = this.a12, o = this.a13, s = this.a21, a = this.a22, l = this.a23, c = this.a31, u = this.a32, f = this.a33, d = 0; d < n; d += 2) {
            var h = e[d]
              , p = e[d + 1]
              , y = o * h + l * p + f;
            e[d] = (r * h + s * p + c) / y,
            e[d + 1] = (i * h + a * p + u) / y
        }
    }
    ,
    t.prototype.transformPointsWithValues = function(e, n) {
        for (var r = this.a11, i = this.a12, o = this.a13, s = this.a21, a = this.a22, l = this.a23, c = this.a31, u = this.a32, f = this.a33, d = e.length, h = 0; h < d; h++) {
            var p = e[h]
              , y = n[h]
              , v = o * p + l * y + f;
            e[h] = (r * p + s * y + c) / v,
            n[h] = (i * p + a * y + u) / v
        }
    }
    ,
    t.squareToQuadrilateral = function(e, n, r, i, o, s, a, l) {
        var c = e - r + o - a
          , u = n - i + s - l;
        if (c === 0 && u === 0)
            return new t(r - e,o - r,e,i - n,s - i,n,0,0,1);
        var f = r - o
          , d = a - o
          , h = i - s
          , p = l - s
          , y = f * p - d * h
          , v = (c * p - d * u) / y
          , g = (f * u - c * h) / y;
        return new t(r - e + v * r,a - e + g * a,e,i - n + v * i,l - n + g * l,n,v,g,1)
    }
    ,
    t.quadrilateralToSquare = function(e, n, r, i, o, s, a, l) {
        return t.squareToQuadrilateral(e, n, r, i, o, s, a, l).buildAdjoint()
    }
    ,
    t.prototype.buildAdjoint = function() {
        return new t(this.a22 * this.a33 - this.a23 * this.a32,this.a23 * this.a31 - this.a21 * this.a33,this.a21 * this.a32 - this.a22 * this.a31,this.a13 * this.a32 - this.a12 * this.a33,this.a11 * this.a33 - this.a13 * this.a31,this.a12 * this.a31 - this.a11 * this.a32,this.a12 * this.a23 - this.a13 * this.a22,this.a13 * this.a21 - this.a11 * this.a23,this.a11 * this.a22 - this.a12 * this.a21)
    }
    ,
    t.prototype.times = function(e) {
        return new t(this.a11 * e.a11 + this.a21 * e.a12 + this.a31 * e.a13,this.a11 * e.a21 + this.a21 * e.a22 + this.a31 * e.a23,this.a11 * e.a31 + this.a21 * e.a32 + this.a31 * e.a33,this.a12 * e.a11 + this.a22 * e.a12 + this.a32 * e.a13,this.a12 * e.a21 + this.a22 * e.a22 + this.a32 * e.a23,this.a12 * e.a31 + this.a22 * e.a32 + this.a32 * e.a33,this.a13 * e.a11 + this.a23 * e.a12 + this.a33 * e.a13,this.a13 * e.a21 + this.a23 * e.a22 + this.a33 * e.a23,this.a13 * e.a31 + this.a23 * e.a32 + this.a33 * e.a33)
    }
    ,
    t
}()
  , Pbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Ibe = function(t) {
    Pbe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.prototype.sampleGrid = function(n, r, i, o, s, a, l, c, u, f, d, h, p, y, v, g, m, _, x) {
        var b = R9.quadrilateralToQuadrilateral(o, s, a, l, c, u, f, d, h, p, y, v, g, m, _, x);
        return this.sampleGridWithTransform(n, r, i, b)
    }
    ,
    e.prototype.sampleGridWithTransform = function(n, r, i, o) {
        if (r <= 0 || i <= 0)
            throw new oe;
        for (var s = new xo(r,i), a = new Float32Array(2 * r), l = 0; l < i; l++) {
            for (var c = a.length, u = l + .5, f = 0; f < c; f += 2)
                a[f] = f / 2 + .5,
                a[f + 1] = u;
            o.transformPoints(a),
            SP.checkAndNudgePoints(n, a);
            try {
                for (var f = 0; f < c; f += 2)
                    n.get(Math.floor(a[f]), Math.floor(a[f + 1])) && s.set(f / 2, l)
            } catch {
                throw new oe
            }
        }
        return s
    }
    ,
    e
}(SP)
  , uE = function() {
    function t() {}
    return t.setGridSampler = function(e) {
        t.gridSampler = e
    }
    ,
    t.getInstance = function() {
        return t.gridSampler
    }
    ,
    t.gridSampler = new Ibe,
    t
}()
  , yr = function() {
    function t(e, n) {
        this.x = e,
        this.y = n
    }
    return t.prototype.toResultPoint = function() {
        return new Pe(this.getX(),this.getY())
    }
    ,
    t.prototype.getX = function() {
        return this.x
    }
    ,
    t.prototype.getY = function() {
        return this.y
    }
    ,
    t
}()
  , Obe = function() {
    function t(e) {
        this.EXPECTED_CORNER_BITS = new Int32Array([3808, 476, 2107, 1799]),
        this.image = e
    }
    return t.prototype.detect = function() {
        return this.detectMirror(!1)
    }
    ,
    t.prototype.detectMirror = function(e) {
        var n = this.getMatrixCenter()
          , r = this.getBullsEyeCorners(n);
        if (e) {
            var i = r[0];
            r[0] = r[2],
            r[2] = i
        }
        this.extractParameters(r);
        var o = this.sampleGrid(this.image, r[this.shift % 4], r[(this.shift + 1) % 4], r[(this.shift + 2) % 4], r[(this.shift + 3) % 4])
          , s = this.getMatrixCornerPoints(r);
        return new Tbe(o,s,this.compact,this.nbDataBlocks,this.nbLayers)
    }
    ,
    t.prototype.extractParameters = function(e) {
        if (!this.isValidPoint(e[0]) || !this.isValidPoint(e[1]) || !this.isValidPoint(e[2]) || !this.isValidPoint(e[3]))
            throw new oe;
        var n = 2 * this.nbCenterLayers
          , r = new Int32Array([this.sampleLine(e[0], e[1], n), this.sampleLine(e[1], e[2], n), this.sampleLine(e[2], e[3], n), this.sampleLine(e[3], e[0], n)]);
        this.shift = this.getRotation(r, n);
        for (var i = 0, o = 0; o < 4; o++) {
            var s = r[(this.shift + o) % 4];
            this.compact ? (i <<= 7,
            i += s >> 1 & 127) : (i <<= 10,
            i += (s >> 2 & 992) + (s >> 1 & 31))
        }
        var a = this.getCorrectedParameterData(i, this.compact);
        this.compact ? (this.nbLayers = (a >> 6) + 1,
        this.nbDataBlocks = (a & 63) + 1) : (this.nbLayers = (a >> 11) + 1,
        this.nbDataBlocks = (a & 2047) + 1)
    }
    ,
    t.prototype.getRotation = function(e, n) {
        var r = 0;
        e.forEach(function(o, s, a) {
            var l = (o >> n - 2 << 1) + (o & 1);
            r = (r << 3) + l
        }),
        r = ((r & 1) << 11) + (r >> 1);
        for (var i = 0; i < 4; i++)
            if (qe.bitCount(r ^ this.EXPECTED_CORNER_BITS[i]) <= 2)
                return i;
        throw new oe
    }
    ,
    t.prototype.getCorrectedParameterData = function(e, n) {
        var r, i;
        n ? (r = 7,
        i = 2) : (r = 10,
        i = 4);
        for (var o = r - i, s = new Int32Array(r), a = r - 1; a >= 0; --a)
            s[a] = e & 15,
            e >>= 4;
        try {
            var l = new _m(Sr.AZTEC_PARAM);
            l.decode(s, o)
        } catch {
            throw new oe
        }
        for (var c = 0, a = 0; a < i; a++)
            c = (c << 4) + s[a];
        return c
    }
    ,
    t.prototype.getBullsEyeCorners = function(e) {
        var n = e
          , r = e
          , i = e
          , o = e
          , s = !0;
        for (this.nbCenterLayers = 1; this.nbCenterLayers < 9; this.nbCenterLayers++) {
            var a = this.getFirstDifferent(n, s, 1, -1)
              , l = this.getFirstDifferent(r, s, 1, 1)
              , c = this.getFirstDifferent(i, s, -1, 1)
              , u = this.getFirstDifferent(o, s, -1, -1);
            if (this.nbCenterLayers > 2) {
                var f = this.distancePoint(u, a) * this.nbCenterLayers / (this.distancePoint(o, n) * (this.nbCenterLayers + 2));
                if (f < .75 || f > 1.25 || !this.isWhiteOrBlackRectangle(a, l, c, u))
                    break
            }
            n = a,
            r = l,
            i = c,
            o = u,
            s = !s
        }
        if (this.nbCenterLayers !== 5 && this.nbCenterLayers !== 7)
            throw new oe;
        this.compact = this.nbCenterLayers === 5;
        var d = new Pe(n.getX() + .5,n.getY() - .5)
          , h = new Pe(r.getX() + .5,r.getY() + .5)
          , p = new Pe(i.getX() - .5,i.getY() + .5)
          , y = new Pe(o.getX() - .5,o.getY() - .5);
        return this.expandSquare([d, h, p, y], 2 * this.nbCenterLayers - 3, 2 * this.nbCenterLayers)
    }
    ,
    t.prototype.getMatrixCenter = function() {
        var e, n, r, i;
        try {
            var o = new Cx(this.image).detect();
            e = o[0],
            n = o[1],
            r = o[2],
            i = o[3]
        } catch {
            var s = this.image.getWidth() / 2
              , a = this.image.getHeight() / 2;
            e = this.getFirstDifferent(new yr(s + 7,a - 7), !1, 1, -1).toResultPoint(),
            n = this.getFirstDifferent(new yr(s + 7,a + 7), !1, 1, 1).toResultPoint(),
            r = this.getFirstDifferent(new yr(s - 7,a + 7), !1, -1, 1).toResultPoint(),
            i = this.getFirstDifferent(new yr(s - 7,a - 7), !1, -1, -1).toResultPoint()
        }
        var l = ft.round((e.getX() + i.getX() + n.getX() + r.getX()) / 4)
          , c = ft.round((e.getY() + i.getY() + n.getY() + r.getY()) / 4);
        try {
            var o = new Cx(this.image,15,l,c).detect();
            e = o[0],
            n = o[1],
            r = o[2],
            i = o[3]
        } catch {
            e = this.getFirstDifferent(new yr(l + 7,c - 7), !1, 1, -1).toResultPoint(),
            n = this.getFirstDifferent(new yr(l + 7,c + 7), !1, 1, 1).toResultPoint(),
            r = this.getFirstDifferent(new yr(l - 7,c + 7), !1, -1, 1).toResultPoint(),
            i = this.getFirstDifferent(new yr(l - 7,c - 7), !1, -1, -1).toResultPoint()
        }
        return l = ft.round((e.getX() + i.getX() + n.getX() + r.getX()) / 4),
        c = ft.round((e.getY() + i.getY() + n.getY() + r.getY()) / 4),
        new yr(l,c)
    }
    ,
    t.prototype.getMatrixCornerPoints = function(e) {
        return this.expandSquare(e, 2 * this.nbCenterLayers, this.getDimension())
    }
    ,
    t.prototype.sampleGrid = function(e, n, r, i, o) {
        var s = uE.getInstance()
          , a = this.getDimension()
          , l = a / 2 - this.nbCenterLayers
          , c = a / 2 + this.nbCenterLayers;
        return s.sampleGrid(e, a, a, l, l, c, l, c, c, l, c, n.getX(), n.getY(), r.getX(), r.getY(), i.getX(), i.getY(), o.getX(), o.getY())
    }
    ,
    t.prototype.sampleLine = function(e, n, r) {
        for (var i = 0, o = this.distanceResultPoint(e, n), s = o / r, a = e.getX(), l = e.getY(), c = s * (n.getX() - e.getX()) / o, u = s * (n.getY() - e.getY()) / o, f = 0; f < r; f++)
            this.image.get(ft.round(a + f * c), ft.round(l + f * u)) && (i |= 1 << r - f - 1);
        return i
    }
    ,
    t.prototype.isWhiteOrBlackRectangle = function(e, n, r, i) {
        var o = 3;
        e = new yr(e.getX() - o,e.getY() + o),
        n = new yr(n.getX() - o,n.getY() - o),
        r = new yr(r.getX() + o,r.getY() - o),
        i = new yr(i.getX() + o,i.getY() + o);
        var s = this.getColor(i, e);
        if (s === 0)
            return !1;
        var a = this.getColor(e, n);
        return a !== s || (a = this.getColor(n, r),
        a !== s) ? !1 : (a = this.getColor(r, i),
        a === s)
    }
    ,
    t.prototype.getColor = function(e, n) {
        for (var r = this.distancePoint(e, n), i = (n.getX() - e.getX()) / r, o = (n.getY() - e.getY()) / r, s = 0, a = e.getX(), l = e.getY(), c = this.image.get(e.getX(), e.getY()), u = Math.ceil(r), f = 0; f < u; f++)
            a += i,
            l += o,
            this.image.get(ft.round(a), ft.round(l)) !== c && s++;
        var d = s / r;
        return d > .1 && d < .9 ? 0 : d <= .1 === c ? 1 : -1
    }
    ,
    t.prototype.getFirstDifferent = function(e, n, r, i) {
        for (var o = e.getX() + r, s = e.getY() + i; this.isValid(o, s) && this.image.get(o, s) === n; )
            o += r,
            s += i;
        for (o -= r,
        s -= i; this.isValid(o, s) && this.image.get(o, s) === n; )
            o += r;
        for (o -= r; this.isValid(o, s) && this.image.get(o, s) === n; )
            s += i;
        return s -= i,
        new yr(o,s)
    }
    ,
    t.prototype.expandSquare = function(e, n, r) {
        var i = r / (2 * n)
          , o = e[0].getX() - e[2].getX()
          , s = e[0].getY() - e[2].getY()
          , a = (e[0].getX() + e[2].getX()) / 2
          , l = (e[0].getY() + e[2].getY()) / 2
          , c = new Pe(a + i * o,l + i * s)
          , u = new Pe(a - i * o,l - i * s);
        o = e[1].getX() - e[3].getX(),
        s = e[1].getY() - e[3].getY(),
        a = (e[1].getX() + e[3].getX()) / 2,
        l = (e[1].getY() + e[3].getY()) / 2;
        var f = new Pe(a + i * o,l + i * s)
          , d = new Pe(a - i * o,l - i * s)
          , h = [c, f, u, d];
        return h
    }
    ,
    t.prototype.isValid = function(e, n) {
        return e >= 0 && e < this.image.getWidth() && n > 0 && n < this.image.getHeight()
    }
    ,
    t.prototype.isValidPoint = function(e) {
        var n = ft.round(e.getX())
          , r = ft.round(e.getY());
        return this.isValid(n, r)
    }
    ,
    t.prototype.distancePoint = function(e, n) {
        return ft.distance(e.getX(), e.getY(), n.getX(), n.getY())
    }
    ,
    t.prototype.distanceResultPoint = function(e, n) {
        return ft.distance(e.getX(), e.getY(), n.getX(), n.getY())
    }
    ,
    t.prototype.getDimension = function() {
        return this.compact ? 4 * this.nbLayers + 11 : this.nbLayers <= 4 ? 4 * this.nbLayers + 15 : 4 * this.nbLayers + 2 * (qe.truncDivision(this.nbLayers - 4, 8) + 1) + 15
    }
    ,
    t
}()
  , $0 = function() {
    function t() {}
    return t.prototype.decode = function(e, n) {
        n === void 0 && (n = null);
        var r = null
          , i = new Obe(e.getBlackMatrix())
          , o = null
          , s = null;
        try {
            var a = i.detectMirror(!1);
            o = a.getPoints(),
            this.reportFoundResultPoints(n, o),
            s = new EP().decode(a)
        } catch (f) {
            r = f
        }
        if (s == null)
            try {
                var a = i.detectMirror(!0);
                o = a.getPoints(),
                this.reportFoundResultPoints(n, o),
                s = new EP().decode(a)
            } catch (f) {
                throw r ?? f
            }
        var l = new tr(s.getText(),s.getRawBytes(),s.getNumBits(),o,Be.AZTEC,It.currentTimeMillis())
          , c = s.getByteSegments();
        c != null && l.putMetadata(Gn.BYTE_SEGMENTS, c);
        var u = s.getECLevel();
        return u != null && l.putMetadata(Gn.ERROR_CORRECTION_LEVEL, u),
        l
    }
    ,
    t.prototype.reportFoundResultPoints = function(e, n) {
        if (e != null) {
            var r = e.get(Ot.NEED_RESULT_POINT_CALLBACK);
            r != null && n.forEach(function(i, o, s) {
                r.foundPossibleResultPoint(i)
            })
        }
    }
    ,
    t.prototype.reset = function() {}
    ,
    t
}()
  , Rbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    Rbe(e, t);
    function e(n) {
        return n === void 0 && (n = 500),
        t.call(this, new $0, n) || this
    }
    return e
}
)(Eu);
var En = function() {
    function t() {}
    return t.prototype.decode = function(e, n) {
        try {
            return this.doDecode(e, n)
        } catch {
            var r = n && n.get(Ot.TRY_HARDER) === !0;
            if (r && e.isRotateSupported()) {
                var i = e.rotateCounterClockwise()
                  , o = this.doDecode(i, n)
                  , s = o.getResultMetadata()
                  , a = 270;
                s !== null && s.get(Gn.ORIENTATION) === !0 && (a = a + s.get(Gn.ORIENTATION) % 360),
                o.putMetadata(Gn.ORIENTATION, a);
                var l = o.getResultPoints();
                if (l !== null)
                    for (var c = i.getHeight(), u = 0; u < l.length; u++)
                        l[u] = new Pe(c - l[u].getY() - 1,l[u].getX());
                return o
            } else
                throw new oe
        }
    }
    ,
    t.prototype.reset = function() {}
    ,
    t.prototype.doDecode = function(e, n) {
        var r = e.getWidth(), i = e.getHeight(), o = new Dn(r), s = n && n.get(Ot.TRY_HARDER) === !0, a = Math.max(1, i >> (s ? 8 : 5)), l;
        s ? l = i : l = 15;
        for (var c = Math.trunc(i / 2), u = 0; u < l; u++) {
            var f = Math.trunc((u + 1) / 2)
              , d = (u & 1) === 0
              , h = c + a * (d ? f : -f);
            if (h < 0 || h >= i)
                break;
            try {
                o = e.getBlackRow(h, o)
            } catch {
                continue
            }
            for (var p = function(m) {
                if (m === 1 && (o.reverse(),
                n && n.get(Ot.NEED_RESULT_POINT_CALLBACK) === !0)) {
                    var _ = new Map;
                    n.forEach(function(w, E) {
                        return _.set(E, w)
                    }),
                    _.delete(Ot.NEED_RESULT_POINT_CALLBACK),
                    n = _
                }
                try {
                    var x = y.decodeRow(h, o, n);
                    if (m === 1) {
                        x.putMetadata(Gn.ORIENTATION, 180);
                        var b = x.getResultPoints();
                        b !== null && (b[0] = new Pe(r - b[0].getX() - 1,b[0].getY()),
                        b[1] = new Pe(r - b[1].getX() - 1,b[1].getY()))
                    }
                    return {
                        value: x
                    }
                } catch {}
            }, y = this, v = 0; v < 2; v++) {
                var g = p(v);
                if (typeof g == "object")
                    return g.value
            }
        }
        throw new oe
    }
    ,
    t.recordPattern = function(e, n, r) {
        for (var i = r.length, o = 0; o < i; o++)
            r[o] = 0;
        var s = e.getSize();
        if (n >= s)
            throw new oe;
        for (var a = !e.get(n), l = 0, c = n; c < s; ) {
            if (e.get(c) !== a)
                r[l]++;
            else {
                if (++l === i)
                    break;
                r[l] = 1,
                a = !a
            }
            c++
        }
        if (!(l === i || l === i - 1 && c === s))
            throw new oe
    }
    ,
    t.recordPatternInReverse = function(e, n, r) {
        for (var i = r.length, o = e.get(n); n > 0 && i >= 0; )
            e.get(--n) !== o && (i--,
            o = !o);
        if (i >= 0)
            throw new oe;
        t.recordPattern(e, n + 1, r)
    }
    ,
    t.patternMatchVariance = function(e, n, r) {
        for (var i = e.length, o = 0, s = 0, a = 0; a < i; a++)
            o += e[a],
            s += n[a];
        if (o < s)
            return Number.POSITIVE_INFINITY;
        var l = o / s;
        r *= l;
        for (var c = 0, u = 0; u < i; u++) {
            var f = e[u]
              , d = n[u] * l
              , h = f > d ? f - d : d - f;
            if (h > r)
                return Number.POSITIVE_INFINITY;
            c += h
        }
        return c / o
    }
    ,
    t
}()
  , Mbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , CP = function(t) {
    Mbe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.findStartPattern = function(n) {
        for (var r = n.getSize(), i = n.getNextSet(0), o = 0, s = Int32Array.from([0, 0, 0, 0, 0, 0]), a = i, l = !1, c = 6, u = i; u < r; u++)
            if (n.get(u) !== l)
                s[o]++;
            else {
                if (o === c - 1) {
                    for (var f = e.MAX_AVG_VARIANCE, d = -1, h = e.CODE_START_A; h <= e.CODE_START_C; h++) {
                        var p = En.patternMatchVariance(s, e.CODE_PATTERNS[h], e.MAX_INDIVIDUAL_VARIANCE);
                        p < f && (f = p,
                        d = h)
                    }
                    if (d >= 0 && n.isRange(Math.max(0, a - (u - a) / 2), a, !1))
                        return Int32Array.from([a, u, d]);
                    a += s[0] + s[1],
                    s = s.slice(2, s.length),
                    s[o - 1] = 0,
                    s[o] = 0,
                    o--
                } else
                    o++;
                s[o] = 1,
                l = !l
            }
        throw new oe
    }
    ,
    e.decodeCode = function(n, r, i) {
        En.recordPattern(n, i, r);
        for (var o = e.MAX_AVG_VARIANCE, s = -1, a = 0; a < e.CODE_PATTERNS.length; a++) {
            var l = e.CODE_PATTERNS[a]
              , c = this.patternMatchVariance(r, l, e.MAX_INDIVIDUAL_VARIANCE);
            c < o && (o = c,
            s = a)
        }
        if (s >= 0)
            return s;
        throw new oe
    }
    ,
    e.prototype.decodeRow = function(n, r, i) {
        var o = i && i.get(Ot.ASSUME_GS1) === !0
          , s = e.findStartPattern(r)
          , a = s[2]
          , l = 0
          , c = new Uint8Array(20);
        c[l++] = a;
        var u;
        switch (a) {
        case e.CODE_START_A:
            u = e.CODE_CODE_A;
            break;
        case e.CODE_START_B:
            u = e.CODE_CODE_B;
            break;
        case e.CODE_START_C:
            u = e.CODE_CODE_C;
            break;
        default:
            throw new me
        }
        for (var f = !1, d = !1, h = "", p = s[0], y = s[1], v = Int32Array.from([0, 0, 0, 0, 0, 0]), g = 0, m = 0, _ = a, x = 0, b = !0, w = !1, E = !1; !f; ) {
            var S = d;
            switch (d = !1,
            g = m,
            m = e.decodeCode(r, v, y),
            c[l++] = m,
            m !== e.CODE_STOP && (b = !0),
            m !== e.CODE_STOP && (x++,
            _ += x * m),
            p = y,
            y += v.reduce(function(U, W) {
                return U + W
            }, 0),
            m) {
            case e.CODE_START_A:
            case e.CODE_START_B:
            case e.CODE_START_C:
                throw new me
            }
            switch (u) {
            case e.CODE_CODE_A:
                if (m < 64)
                    E === w ? h += String.fromCharCode(" ".charCodeAt(0) + m) : h += String.fromCharCode(" ".charCodeAt(0) + m + 128),
                    E = !1;
                else if (m < 96)
                    E === w ? h += String.fromCharCode(m - 64) : h += String.fromCharCode(m + 64),
                    E = !1;
                else
                    switch (m !== e.CODE_STOP && (b = !1),
                    m) {
                    case e.CODE_FNC_1:
                        o && (h.length === 0 ? h += "]C1" : h += String.fromCharCode(29));
                        break;
                    case e.CODE_FNC_2:
                    case e.CODE_FNC_3:
                        break;
                    case e.CODE_FNC_4_A:
                        !w && E ? (w = !0,
                        E = !1) : w && E ? (w = !1,
                        E = !1) : E = !0;
                        break;
                    case e.CODE_SHIFT:
                        d = !0,
                        u = e.CODE_CODE_B;
                        break;
                    case e.CODE_CODE_B:
                        u = e.CODE_CODE_B;
                        break;
                    case e.CODE_CODE_C:
                        u = e.CODE_CODE_C;
                        break;
                    case e.CODE_STOP:
                        f = !0;
                        break
                    }
                break;
            case e.CODE_CODE_B:
                if (m < 96)
                    E === w ? h += String.fromCharCode(" ".charCodeAt(0) + m) : h += String.fromCharCode(" ".charCodeAt(0) + m + 128),
                    E = !1;
                else
                    switch (m !== e.CODE_STOP && (b = !1),
                    m) {
                    case e.CODE_FNC_1:
                        o && (h.length === 0 ? h += "]C1" : h += String.fromCharCode(29));
                        break;
                    case e.CODE_FNC_2:
                    case e.CODE_FNC_3:
                        break;
                    case e.CODE_FNC_4_B:
                        !w && E ? (w = !0,
                        E = !1) : w && E ? (w = !1,
                        E = !1) : E = !0;
                        break;
                    case e.CODE_SHIFT:
                        d = !0,
                        u = e.CODE_CODE_A;
                        break;
                    case e.CODE_CODE_A:
                        u = e.CODE_CODE_A;
                        break;
                    case e.CODE_CODE_C:
                        u = e.CODE_CODE_C;
                        break;
                    case e.CODE_STOP:
                        f = !0;
                        break
                    }
                break;
            case e.CODE_CODE_C:
                if (m < 100)
                    m < 10 && (h += "0"),
                    h += m;
                else
                    switch (m !== e.CODE_STOP && (b = !1),
                    m) {
                    case e.CODE_FNC_1:
                        o && (h.length === 0 ? h += "]C1" : h += String.fromCharCode(29));
                        break;
                    case e.CODE_CODE_A:
                        u = e.CODE_CODE_A;
                        break;
                    case e.CODE_CODE_B:
                        u = e.CODE_CODE_B;
                        break;
                    case e.CODE_STOP:
                        f = !0;
                        break
                    }
                break
            }
            S && (u = u === e.CODE_CODE_A ? e.CODE_CODE_B : e.CODE_CODE_A)
        }
        var P = y - p;
        if (y = r.getNextUnset(y),
        !r.isRange(y, Math.min(r.getSize(), y + (y - p) / 2), !1))
            throw new oe;
        if (_ -= x * g,
        _ % 103 !== g)
            throw new fn;
        var C = h.length;
        if (C === 0)
            throw new oe;
        C > 0 && b && (u === e.CODE_CODE_C ? h = h.substring(0, C - 2) : h = h.substring(0, C - 1));
        for (var A = (s[1] + s[0]) / 2, T = p + P / 2, I = c.length, B = new Uint8Array(I), G = 0; G < I; G++)
            B[G] = c[G];
        var N = [new Pe(A,n), new Pe(T,n)];
        return new tr(h,B,0,N,Be.CODE_128,new Date().getTime())
    }
    ,
    e.CODE_PATTERNS = [Int32Array.from([2, 1, 2, 2, 2, 2]), Int32Array.from([2, 2, 2, 1, 2, 2]), Int32Array.from([2, 2, 2, 2, 2, 1]), Int32Array.from([1, 2, 1, 2, 2, 3]), Int32Array.from([1, 2, 1, 3, 2, 2]), Int32Array.from([1, 3, 1, 2, 2, 2]), Int32Array.from([1, 2, 2, 2, 1, 3]), Int32Array.from([1, 2, 2, 3, 1, 2]), Int32Array.from([1, 3, 2, 2, 1, 2]), Int32Array.from([2, 2, 1, 2, 1, 3]), Int32Array.from([2, 2, 1, 3, 1, 2]), Int32Array.from([2, 3, 1, 2, 1, 2]), Int32Array.from([1, 1, 2, 2, 3, 2]), Int32Array.from([1, 2, 2, 1, 3, 2]), Int32Array.from([1, 2, 2, 2, 3, 1]), Int32Array.from([1, 1, 3, 2, 2, 2]), Int32Array.from([1, 2, 3, 1, 2, 2]), Int32Array.from([1, 2, 3, 2, 2, 1]), Int32Array.from([2, 2, 3, 2, 1, 1]), Int32Array.from([2, 2, 1, 1, 3, 2]), Int32Array.from([2, 2, 1, 2, 3, 1]), Int32Array.from([2, 1, 3, 2, 1, 2]), Int32Array.from([2, 2, 3, 1, 1, 2]), Int32Array.from([3, 1, 2, 1, 3, 1]), Int32Array.from([3, 1, 1, 2, 2, 2]), Int32Array.from([3, 2, 1, 1, 2, 2]), Int32Array.from([3, 2, 1, 2, 2, 1]), Int32Array.from([3, 1, 2, 2, 1, 2]), Int32Array.from([3, 2, 2, 1, 1, 2]), Int32Array.from([3, 2, 2, 2, 1, 1]), Int32Array.from([2, 1, 2, 1, 2, 3]), Int32Array.from([2, 1, 2, 3, 2, 1]), Int32Array.from([2, 3, 2, 1, 2, 1]), Int32Array.from([1, 1, 1, 3, 2, 3]), Int32Array.from([1, 3, 1, 1, 2, 3]), Int32Array.from([1, 3, 1, 3, 2, 1]), Int32Array.from([1, 1, 2, 3, 1, 3]), Int32Array.from([1, 3, 2, 1, 1, 3]), Int32Array.from([1, 3, 2, 3, 1, 1]), Int32Array.from([2, 1, 1, 3, 1, 3]), Int32Array.from([2, 3, 1, 1, 1, 3]), Int32Array.from([2, 3, 1, 3, 1, 1]), Int32Array.from([1, 1, 2, 1, 3, 3]), Int32Array.from([1, 1, 2, 3, 3, 1]), Int32Array.from([1, 3, 2, 1, 3, 1]), Int32Array.from([1, 1, 3, 1, 2, 3]), Int32Array.from([1, 1, 3, 3, 2, 1]), Int32Array.from([1, 3, 3, 1, 2, 1]), Int32Array.from([3, 1, 3, 1, 2, 1]), Int32Array.from([2, 1, 1, 3, 3, 1]), Int32Array.from([2, 3, 1, 1, 3, 1]), Int32Array.from([2, 1, 3, 1, 1, 3]), Int32Array.from([2, 1, 3, 3, 1, 1]), Int32Array.from([2, 1, 3, 1, 3, 1]), Int32Array.from([3, 1, 1, 1, 2, 3]), Int32Array.from([3, 1, 1, 3, 2, 1]), Int32Array.from([3, 3, 1, 1, 2, 1]), Int32Array.from([3, 1, 2, 1, 1, 3]), Int32Array.from([3, 1, 2, 3, 1, 1]), Int32Array.from([3, 3, 2, 1, 1, 1]), Int32Array.from([3, 1, 4, 1, 1, 1]), Int32Array.from([2, 2, 1, 4, 1, 1]), Int32Array.from([4, 3, 1, 1, 1, 1]), Int32Array.from([1, 1, 1, 2, 2, 4]), Int32Array.from([1, 1, 1, 4, 2, 2]), Int32Array.from([1, 2, 1, 1, 2, 4]), Int32Array.from([1, 2, 1, 4, 2, 1]), Int32Array.from([1, 4, 1, 1, 2, 2]), Int32Array.from([1, 4, 1, 2, 2, 1]), Int32Array.from([1, 1, 2, 2, 1, 4]), Int32Array.from([1, 1, 2, 4, 1, 2]), Int32Array.from([1, 2, 2, 1, 1, 4]), Int32Array.from([1, 2, 2, 4, 1, 1]), Int32Array.from([1, 4, 2, 1, 1, 2]), Int32Array.from([1, 4, 2, 2, 1, 1]), Int32Array.from([2, 4, 1, 2, 1, 1]), Int32Array.from([2, 2, 1, 1, 1, 4]), Int32Array.from([4, 1, 3, 1, 1, 1]), Int32Array.from([2, 4, 1, 1, 1, 2]), Int32Array.from([1, 3, 4, 1, 1, 1]), Int32Array.from([1, 1, 1, 2, 4, 2]), Int32Array.from([1, 2, 1, 1, 4, 2]), Int32Array.from([1, 2, 1, 2, 4, 1]), Int32Array.from([1, 1, 4, 2, 1, 2]), Int32Array.from([1, 2, 4, 1, 1, 2]), Int32Array.from([1, 2, 4, 2, 1, 1]), Int32Array.from([4, 1, 1, 2, 1, 2]), Int32Array.from([4, 2, 1, 1, 1, 2]), Int32Array.from([4, 2, 1, 2, 1, 1]), Int32Array.from([2, 1, 2, 1, 4, 1]), Int32Array.from([2, 1, 4, 1, 2, 1]), Int32Array.from([4, 1, 2, 1, 2, 1]), Int32Array.from([1, 1, 1, 1, 4, 3]), Int32Array.from([1, 1, 1, 3, 4, 1]), Int32Array.from([1, 3, 1, 1, 4, 1]), Int32Array.from([1, 1, 4, 1, 1, 3]), Int32Array.from([1, 1, 4, 3, 1, 1]), Int32Array.from([4, 1, 1, 1, 1, 3]), Int32Array.from([4, 1, 1, 3, 1, 1]), Int32Array.from([1, 1, 3, 1, 4, 1]), Int32Array.from([1, 1, 4, 1, 3, 1]), Int32Array.from([3, 1, 1, 1, 4, 1]), Int32Array.from([4, 1, 1, 1, 3, 1]), Int32Array.from([2, 1, 1, 4, 1, 2]), Int32Array.from([2, 1, 1, 2, 1, 4]), Int32Array.from([2, 1, 1, 2, 3, 2]), Int32Array.from([2, 3, 3, 1, 1, 1, 2])],
    e.MAX_AVG_VARIANCE = .25,
    e.MAX_INDIVIDUAL_VARIANCE = .7,
    e.CODE_SHIFT = 98,
    e.CODE_CODE_C = 99,
    e.CODE_CODE_B = 100,
    e.CODE_CODE_A = 101,
    e.CODE_FNC_1 = 102,
    e.CODE_FNC_2 = 97,
    e.CODE_FNC_3 = 96,
    e.CODE_FNC_4_A = 101,
    e.CODE_FNC_4_B = 100,
    e.CODE_START_A = 103,
    e.CODE_START_B = 104,
    e.CODE_START_C = 105,
    e.CODE_STOP = 106,
    e
}(En)
  , Dbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Av = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , AP = function(t) {
    Dbe(e, t);
    function e(n, r) {
        n === void 0 && (n = !1),
        r === void 0 && (r = !1);
        var i = t.call(this) || this;
        return i.usingCheckDigit = n,
        i.extendedMode = r,
        i.decodeRowResult = "",
        i.counters = new Int32Array(9),
        i
    }
    return e.prototype.decodeRow = function(n, r, i) {
        var o, s, a, l, c = this.counters;
        c.fill(0),
        this.decodeRowResult = "";
        var u = e.findAsteriskPattern(r, c), f = r.getNextSet(u[1]), d = r.getSize(), h, p;
        do {
            e.recordPattern(r, f, c);
            var y = e.toNarrowWidePattern(c);
            if (y < 0)
                throw new oe;
            h = e.patternToChar(y),
            this.decodeRowResult += h,
            p = f;
            try {
                for (var v = (o = void 0,
                Av(c)), g = v.next(); !g.done; g = v.next()) {
                    var m = g.value;
                    f += m
                }
            } catch (I) {
                o = {
                    error: I
                }
            } finally {
                try {
                    g && !g.done && (s = v.return) && s.call(v)
                } finally {
                    if (o)
                        throw o.error
                }
            }
            f = r.getNextSet(f)
        } while (h !== "*");
        this.decodeRowResult = this.decodeRowResult.substring(0, this.decodeRowResult.length - 1);
        var _ = 0;
        try {
            for (var x = Av(c), b = x.next(); !b.done; b = x.next()) {
                var m = b.value;
                _ += m
            }
        } catch (I) {
            a = {
                error: I
            }
        } finally {
            try {
                b && !b.done && (l = x.return) && l.call(x)
            } finally {
                if (a)
                    throw a.error
            }
        }
        var w = f - p - _;
        if (f !== d && w * 2 < _)
            throw new oe;
        if (this.usingCheckDigit) {
            for (var E = this.decodeRowResult.length - 1, S = 0, P = 0; P < E; P++)
                S += e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(P));
            if (this.decodeRowResult.charAt(E) !== e.ALPHABET_STRING.charAt(S % 43))
                throw new fn;
            this.decodeRowResult = this.decodeRowResult.substring(0, E)
        }
        if (this.decodeRowResult.length === 0)
            throw new oe;
        var C;
        this.extendedMode ? C = e.decodeExtended(this.decodeRowResult) : C = this.decodeRowResult;
        var A = (u[1] + u[0]) / 2
          , T = p + _ / 2;
        return new tr(C,null,0,[new Pe(A,n), new Pe(T,n)],Be.CODE_39,new Date().getTime())
    }
    ,
    e.findAsteriskPattern = function(n, r) {
        for (var i = n.getSize(), o = n.getNextSet(0), s = 0, a = o, l = !1, c = r.length, u = o; u < i; u++)
            if (n.get(u) !== l)
                r[s]++;
            else {
                if (s === c - 1) {
                    if (this.toNarrowWidePattern(r) === e.ASTERISK_ENCODING && n.isRange(Math.max(0, a - Math.floor((u - a) / 2)), a, !1))
                        return [a, u];
                    a += r[0] + r[1],
                    r.copyWithin(0, 2, 2 + s - 1),
                    r[s - 1] = 0,
                    r[s] = 0,
                    s--
                } else
                    s++;
                r[s] = 1,
                l = !l
            }
        throw new oe
    }
    ,
    e.toNarrowWidePattern = function(n) {
        var r, i, o = n.length, s = 0, a;
        do {
            var l = 2147483647;
            try {
                for (var c = (r = void 0,
                Av(n)), u = c.next(); !u.done; u = c.next()) {
                    var f = u.value;
                    f < l && f > s && (l = f)
                }
            } catch (y) {
                r = {
                    error: y
                }
            } finally {
                try {
                    u && !u.done && (i = c.return) && i.call(c)
                } finally {
                    if (r)
                        throw r.error
                }
            }
            s = l,
            a = 0;
            for (var d = 0, h = 0, p = 0; p < o; p++) {
                var f = n[p];
                f > s && (h |= 1 << o - 1 - p,
                a++,
                d += f)
            }
            if (a === 3) {
                for (var p = 0; p < o && a > 0; p++) {
                    var f = n[p];
                    if (f > s && (a--,
                    f * 2 >= d))
                        return -1
                }
                return h
            }
        } while (a > 3);
        return -1
    }
    ,
    e.patternToChar = function(n) {
        for (var r = 0; r < e.CHARACTER_ENCODINGS.length; r++)
            if (e.CHARACTER_ENCODINGS[r] === n)
                return e.ALPHABET_STRING.charAt(r);
        if (n === e.ASTERISK_ENCODING)
            return "*";
        throw new oe
    }
    ,
    e.decodeExtended = function(n) {
        for (var r = n.length, i = "", o = 0; o < r; o++) {
            var s = n.charAt(o);
            if (s === "+" || s === "$" || s === "%" || s === "/") {
                var a = n.charAt(o + 1)
                  , l = "\0";
                switch (s) {
                case "+":
                    if (a >= "A" && a <= "Z")
                        l = String.fromCharCode(a.charCodeAt(0) + 32);
                    else
                        throw new me;
                    break;
                case "$":
                    if (a >= "A" && a <= "Z")
                        l = String.fromCharCode(a.charCodeAt(0) - 64);
                    else
                        throw new me;
                    break;
                case "%":
                    if (a >= "A" && a <= "E")
                        l = String.fromCharCode(a.charCodeAt(0) - 38);
                    else if (a >= "F" && a <= "J")
                        l = String.fromCharCode(a.charCodeAt(0) - 11);
                    else if (a >= "K" && a <= "O")
                        l = String.fromCharCode(a.charCodeAt(0) + 16);
                    else if (a >= "P" && a <= "T")
                        l = String.fromCharCode(a.charCodeAt(0) + 43);
                    else if (a === "U")
                        l = "\0";
                    else if (a === "V")
                        l = "@";
                    else if (a === "W")
                        l = "`";
                    else if (a === "X" || a === "Y" || a === "Z")
                        l = "";
                    else
                        throw new me;
                    break;
                case "/":
                    if (a >= "A" && a <= "O")
                        l = String.fromCharCode(a.charCodeAt(0) - 32);
                    else if (a === "Z")
                        l = ":";
                    else
                        throw new me;
                    break
                }
                i += l,
                o++
            } else
                i += s
        }
        return i
    }
    ,
    e.ALPHABET_STRING = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",
    e.CHARACTER_ENCODINGS = [52, 289, 97, 352, 49, 304, 112, 37, 292, 100, 265, 73, 328, 25, 280, 88, 13, 268, 76, 28, 259, 67, 322, 19, 274, 82, 7, 262, 70, 22, 385, 193, 448, 145, 400, 208, 133, 388, 196, 168, 162, 138, 42],
    e.ASTERISK_ENCODING = 148,
    e
}(En)
  , Bbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Tv = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , TP = function(t) {
    Bbe(e, t);
    function e() {
        var n = t.call(this) || this;
        return n.decodeRowResult = "",
        n.counters = new Int32Array(6),
        n
    }
    return e.prototype.decodeRow = function(n, r, i) {
        var o, s, a, l, c = this.findAsteriskPattern(r), u = r.getNextSet(c[1]), f = r.getSize(), d = this.counters;
        d.fill(0),
        this.decodeRowResult = "";
        var h, p;
        do {
            e.recordPattern(r, u, d);
            var y = this.toPattern(d);
            if (y < 0)
                throw new oe;
            h = this.patternToChar(y),
            this.decodeRowResult += h,
            p = u;
            try {
                for (var v = (o = void 0,
                Tv(d)), g = v.next(); !g.done; g = v.next()) {
                    var m = g.value;
                    u += m
                }
            } catch (P) {
                o = {
                    error: P
                }
            } finally {
                try {
                    g && !g.done && (s = v.return) && s.call(v)
                } finally {
                    if (o)
                        throw o.error
                }
            }
            u = r.getNextSet(u)
        } while (h !== "*");
        this.decodeRowResult = this.decodeRowResult.substring(0, this.decodeRowResult.length - 1);
        var _ = 0;
        try {
            for (var x = Tv(d), b = x.next(); !b.done; b = x.next()) {
                var m = b.value;
                _ += m
            }
        } catch (P) {
            a = {
                error: P
            }
        } finally {
            try {
                b && !b.done && (l = x.return) && l.call(x)
            } finally {
                if (a)
                    throw a.error
            }
        }
        if (u === f || !r.get(u))
            throw new oe;
        if (this.decodeRowResult.length < 2)
            throw new oe;
        this.checkChecksums(this.decodeRowResult),
        this.decodeRowResult = this.decodeRowResult.substring(0, this.decodeRowResult.length - 2);
        var w = this.decodeExtended(this.decodeRowResult)
          , E = (c[1] + c[0]) / 2
          , S = p + _ / 2;
        return new tr(w,null,0,[new Pe(E,n), new Pe(S,n)],Be.CODE_93,new Date().getTime())
    }
    ,
    e.prototype.findAsteriskPattern = function(n) {
        var r = n.getSize()
          , i = n.getNextSet(0);
        this.counters.fill(0);
        for (var o = this.counters, s = i, a = !1, l = o.length, c = 0, u = i; u < r; u++)
            if (n.get(u) !== a)
                o[c]++;
            else {
                if (c === l - 1) {
                    if (this.toPattern(o) === e.ASTERISK_ENCODING)
                        return new Int32Array([s, u]);
                    s += o[0] + o[1],
                    o.copyWithin(0, 2, 2 + c - 1),
                    o[c - 1] = 0,
                    o[c] = 0,
                    c--
                } else
                    c++;
                o[c] = 1,
                a = !a
            }
        throw new oe
    }
    ,
    e.prototype.toPattern = function(n) {
        var r, i, o = 0;
        try {
            for (var s = Tv(n), a = s.next(); !a.done; a = s.next()) {
                var l = a.value;
                o += l
            }
        } catch (p) {
            r = {
                error: p
            }
        } finally {
            try {
                a && !a.done && (i = s.return) && i.call(s)
            } finally {
                if (r)
                    throw r.error
            }
        }
        for (var c = 0, u = n.length, f = 0; f < u; f++) {
            var d = Math.round(n[f] * 9 / o);
            if (d < 1 || d > 4)
                return -1;
            if (f & 1)
                c <<= d;
            else
                for (var h = 0; h < d; h++)
                    c = c << 1 | 1
        }
        return c
    }
    ,
    e.prototype.patternToChar = function(n) {
        for (var r = 0; r < e.CHARACTER_ENCODINGS.length; r++)
            if (e.CHARACTER_ENCODINGS[r] === n)
                return e.ALPHABET_STRING.charAt(r);
        throw new oe
    }
    ,
    e.prototype.decodeExtended = function(n) {
        for (var r = n.length, i = "", o = 0; o < r; o++) {
            var s = n.charAt(o);
            if (s >= "a" && s <= "d") {
                if (o >= r - 1)
                    throw new me;
                var a = n.charAt(o + 1)
                  , l = "\0";
                switch (s) {
                case "d":
                    if (a >= "A" && a <= "Z")
                        l = String.fromCharCode(a.charCodeAt(0) + 32);
                    else
                        throw new me;
                    break;
                case "a":
                    if (a >= "A" && a <= "Z")
                        l = String.fromCharCode(a.charCodeAt(0) - 64);
                    else
                        throw new me;
                    break;
                case "b":
                    if (a >= "A" && a <= "E")
                        l = String.fromCharCode(a.charCodeAt(0) - 38);
                    else if (a >= "F" && a <= "J")
                        l = String.fromCharCode(a.charCodeAt(0) - 11);
                    else if (a >= "K" && a <= "O")
                        l = String.fromCharCode(a.charCodeAt(0) + 16);
                    else if (a >= "P" && a <= "T")
                        l = String.fromCharCode(a.charCodeAt(0) + 43);
                    else if (a === "U")
                        l = "\0";
                    else if (a === "V")
                        l = "@";
                    else if (a === "W")
                        l = "`";
                    else if (a >= "X" && a <= "Z")
                        l = String.fromCharCode(127);
                    else
                        throw new me;
                    break;
                case "c":
                    if (a >= "A" && a <= "O")
                        l = String.fromCharCode(a.charCodeAt(0) - 32);
                    else if (a === "Z")
                        l = ":";
                    else
                        throw new me;
                    break
                }
                i += l,
                o++
            } else
                i += s
        }
        return i
    }
    ,
    e.prototype.checkChecksums = function(n) {
        var r = n.length;
        this.checkOneChecksum(n, r - 2, 20),
        this.checkOneChecksum(n, r - 1, 15)
    }
    ,
    e.prototype.checkOneChecksum = function(n, r, i) {
        for (var o = 1, s = 0, a = r - 1; a >= 0; a--)
            s += o * e.ALPHABET_STRING.indexOf(n.charAt(a)),
            ++o > i && (o = 1);
        if (n.charAt(r) !== e.ALPHABET_STRING[s % 47])
            throw new fn
    }
    ,
    e.ALPHABET_STRING = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",
    e.CHARACTER_ENCODINGS = [276, 328, 324, 322, 296, 292, 290, 336, 274, 266, 424, 420, 418, 404, 402, 394, 360, 356, 354, 308, 282, 344, 332, 326, 300, 278, 436, 434, 428, 422, 406, 410, 364, 358, 310, 314, 302, 468, 466, 458, 366, 374, 430, 294, 474, 470, 306, 350],
    e.ASTERISK_ENCODING = e.CHARACTER_ENCODINGS[47],
    e
}(En)
  , kbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Nbe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , PP = function(t) {
    kbe(e, t);
    function e() {
        var n = t !== null && t.apply(this, arguments) || this;
        return n.narrowLineWidth = -1,
        n
    }
    return e.prototype.decodeRow = function(n, r, i) {
        var o, s, a = this.decodeStart(r), l = this.decodeEnd(r), c = new Ke;
        e.decodeMiddle(r, a[1], l[0], c);
        var u = c.toString()
          , f = null;
        i != null && (f = i.get(Ot.ALLOWED_LENGTHS)),
        f == null && (f = e.DEFAULT_ALLOWED_LENGTHS);
        var d = u.length
          , h = !1
          , p = 0;
        try {
            for (var y = Nbe(f), v = y.next(); !v.done; v = y.next()) {
                var g = v.value;
                if (d === g) {
                    h = !0;
                    break
                }
                g > p && (p = g)
            }
        } catch (x) {
            o = {
                error: x
            }
        } finally {
            try {
                v && !v.done && (s = y.return) && s.call(y)
            } finally {
                if (o)
                    throw o.error
            }
        }
        if (!h && d > p && (h = !0),
        !h)
            throw new me;
        var m = [new Pe(a[1],n), new Pe(l[0],n)]
          , _ = new tr(u,null,0,m,Be.ITF,new Date().getTime());
        return _
    }
    ,
    e.decodeMiddle = function(n, r, i, o) {
        var s = new Int32Array(10)
          , a = new Int32Array(5)
          , l = new Int32Array(5);
        for (s.fill(0),
        a.fill(0),
        l.fill(0); r < i; ) {
            En.recordPattern(n, r, s);
            for (var c = 0; c < 5; c++) {
                var u = 2 * c;
                a[c] = s[u],
                l[c] = s[u + 1]
            }
            var f = e.decodeDigit(a);
            o.append(f.toString()),
            f = this.decodeDigit(l),
            o.append(f.toString()),
            s.forEach(function(d) {
                r += d
            })
        }
    }
    ,
    e.prototype.decodeStart = function(n) {
        var r = e.skipWhiteSpace(n)
          , i = e.findGuardPattern(n, r, e.START_PATTERN);
        return this.narrowLineWidth = (i[1] - i[0]) / 4,
        this.validateQuietZone(n, i[0]),
        i
    }
    ,
    e.prototype.validateQuietZone = function(n, r) {
        var i = this.narrowLineWidth * 10;
        i = i < r ? i : r;
        for (var o = r - 1; i > 0 && o >= 0 && !n.get(o); o--)
            i--;
        if (i !== 0)
            throw new oe
    }
    ,
    e.skipWhiteSpace = function(n) {
        var r = n.getSize()
          , i = n.getNextSet(0);
        if (i === r)
            throw new oe;
        return i
    }
    ,
    e.prototype.decodeEnd = function(n) {
        n.reverse();
        try {
            var r = e.skipWhiteSpace(n)
              , i = void 0;
            try {
                i = e.findGuardPattern(n, r, e.END_PATTERN_REVERSED[0])
            } catch (s) {
                s instanceof oe && (i = e.findGuardPattern(n, r, e.END_PATTERN_REVERSED[1]))
            }
            this.validateQuietZone(n, i[0]);
            var o = i[0];
            return i[0] = n.getSize() - i[1],
            i[1] = n.getSize() - o,
            i
        } finally {
            n.reverse()
        }
    }
    ,
    e.findGuardPattern = function(n, r, i) {
        var o = i.length
          , s = new Int32Array(o)
          , a = n.getSize()
          , l = !1
          , c = 0
          , u = r;
        s.fill(0);
        for (var f = r; f < a; f++)
            if (n.get(f) !== l)
                s[c]++;
            else {
                if (c === o - 1) {
                    if (En.patternMatchVariance(s, i, e.MAX_INDIVIDUAL_VARIANCE) < e.MAX_AVG_VARIANCE)
                        return [u, f];
                    u += s[0] + s[1],
                    It.arraycopy(s, 2, s, 0, c - 1),
                    s[c - 1] = 0,
                    s[c] = 0,
                    c--
                } else
                    c++;
                s[c] = 1,
                l = !l
            }
        throw new oe
    }
    ,
    e.decodeDigit = function(n) {
        for (var r = e.MAX_AVG_VARIANCE, i = -1, o = e.PATTERNS.length, s = 0; s < o; s++) {
            var a = e.PATTERNS[s]
              , l = En.patternMatchVariance(n, a, e.MAX_INDIVIDUAL_VARIANCE);
            l < r ? (r = l,
            i = s) : l === r && (i = -1)
        }
        if (i >= 0)
            return i % 10;
        throw new oe
    }
    ,
    e.PATTERNS = [Int32Array.from([1, 1, 2, 2, 1]), Int32Array.from([2, 1, 1, 1, 2]), Int32Array.from([1, 2, 1, 1, 2]), Int32Array.from([2, 2, 1, 1, 1]), Int32Array.from([1, 1, 2, 1, 2]), Int32Array.from([2, 1, 2, 1, 1]), Int32Array.from([1, 2, 2, 1, 1]), Int32Array.from([1, 1, 1, 2, 2]), Int32Array.from([2, 1, 1, 2, 1]), Int32Array.from([1, 2, 1, 2, 1]), Int32Array.from([1, 1, 3, 3, 1]), Int32Array.from([3, 1, 1, 1, 3]), Int32Array.from([1, 3, 1, 1, 3]), Int32Array.from([3, 3, 1, 1, 1]), Int32Array.from([1, 1, 3, 1, 3]), Int32Array.from([3, 1, 3, 1, 1]), Int32Array.from([1, 3, 3, 1, 1]), Int32Array.from([1, 1, 1, 3, 3]), Int32Array.from([3, 1, 1, 3, 1]), Int32Array.from([1, 3, 1, 3, 1])],
    e.MAX_AVG_VARIANCE = .38,
    e.MAX_INDIVIDUAL_VARIANCE = .5,
    e.DEFAULT_ALLOWED_LENGTHS = [6, 8, 10, 12, 14],
    e.START_PATTERN = Int32Array.from([1, 1, 1, 1]),
    e.END_PATTERN_REVERSED = [Int32Array.from([1, 1, 2]), Int32Array.from([1, 1, 3])],
    e
}(En)
  , Fbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , su = function(t) {
    Fbe(e, t);
    function e() {
        var n = t !== null && t.apply(this, arguments) || this;
        return n.decodeRowStringBuffer = "",
        n
    }
    return e.findStartGuardPattern = function(n) {
        for (var r = !1, i, o = 0, s = Int32Array.from([0, 0, 0]); !r; ) {
            s = Int32Array.from([0, 0, 0]),
            i = e.findGuardPattern(n, o, !1, this.START_END_PATTERN, s);
            var a = i[0];
            o = i[1];
            var l = a - (o - a);
            l >= 0 && (r = n.isRange(l, a, !1))
        }
        return i
    }
    ,
    e.checkChecksum = function(n) {
        return e.checkStandardUPCEANChecksum(n)
    }
    ,
    e.checkStandardUPCEANChecksum = function(n) {
        var r = n.length;
        if (r === 0)
            return !1;
        var i = parseInt(n.charAt(r - 1), 10);
        return e.getStandardUPCEANChecksum(n.substring(0, r - 1)) === i
    }
    ,
    e.getStandardUPCEANChecksum = function(n) {
        for (var r = n.length, i = 0, o = r - 1; o >= 0; o -= 2) {
            var s = n.charAt(o).charCodeAt(0) - "0".charCodeAt(0);
            if (s < 0 || s > 9)
                throw new me;
            i += s
        }
        i *= 3;
        for (var o = r - 2; o >= 0; o -= 2) {
            var s = n.charAt(o).charCodeAt(0) - "0".charCodeAt(0);
            if (s < 0 || s > 9)
                throw new me;
            i += s
        }
        return (1e3 - i) % 10
    }
    ,
    e.decodeEnd = function(n, r) {
        return e.findGuardPattern(n, r, !1, e.START_END_PATTERN, new Int32Array(e.START_END_PATTERN.length).fill(0))
    }
    ,
    e.findGuardPatternWithoutCounters = function(n, r, i, o) {
        return this.findGuardPattern(n, r, i, o, new Int32Array(o.length))
    }
    ,
    e.findGuardPattern = function(n, r, i, o, s) {
        var a = n.getSize();
        r = i ? n.getNextUnset(r) : n.getNextSet(r);
        for (var l = 0, c = r, u = o.length, f = i, d = r; d < a; d++)
            if (n.get(d) !== f)
                s[l]++;
            else {
                if (l === u - 1) {
                    if (En.patternMatchVariance(s, o, e.MAX_INDIVIDUAL_VARIANCE) < e.MAX_AVG_VARIANCE)
                        return Int32Array.from([c, d]);
                    c += s[0] + s[1];
                    for (var h = s.slice(2, s.length), p = 0; p < l - 1; p++)
                        s[p] = h[p];
                    s[l - 1] = 0,
                    s[l] = 0,
                    l--
                } else
                    l++;
                s[l] = 1,
                f = !f
            }
        throw new oe
    }
    ,
    e.decodeDigit = function(n, r, i, o) {
        this.recordPattern(n, i, r);
        for (var s = this.MAX_AVG_VARIANCE, a = -1, l = o.length, c = 0; c < l; c++) {
            var u = o[c]
              , f = En.patternMatchVariance(r, u, e.MAX_INDIVIDUAL_VARIANCE);
            f < s && (s = f,
            a = c)
        }
        if (a >= 0)
            return a;
        throw new oe
    }
    ,
    e.MAX_AVG_VARIANCE = .48,
    e.MAX_INDIVIDUAL_VARIANCE = .7,
    e.START_END_PATTERN = Int32Array.from([1, 1, 1]),
    e.MIDDLE_PATTERN = Int32Array.from([1, 1, 1, 1, 1]),
    e.END_PATTERN = Int32Array.from([1, 1, 1, 1, 1, 1]),
    e.L_PATTERNS = [Int32Array.from([3, 2, 1, 1]), Int32Array.from([2, 2, 2, 1]), Int32Array.from([2, 1, 2, 2]), Int32Array.from([1, 4, 1, 1]), Int32Array.from([1, 1, 3, 2]), Int32Array.from([1, 2, 3, 1]), Int32Array.from([1, 1, 1, 4]), Int32Array.from([1, 3, 1, 2]), Int32Array.from([1, 2, 1, 3]), Int32Array.from([3, 1, 1, 2])],
    e
}(En)
  , Lbe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , $be = function() {
    function t() {
        this.CHECK_DIGIT_ENCODINGS = [24, 20, 18, 17, 12, 6, 3, 10, 9, 5],
        this.decodeMiddleCounters = Int32Array.from([0, 0, 0, 0]),
        this.decodeRowStringBuffer = ""
    }
    return t.prototype.decodeRow = function(e, n, r) {
        var i = this.decodeRowStringBuffer
          , o = this.decodeMiddle(n, r, i)
          , s = i.toString()
          , a = t.parseExtensionString(s)
          , l = [new Pe((r[0] + r[1]) / 2,e), new Pe(o,e)]
          , c = new tr(s,null,0,l,Be.UPC_EAN_EXTENSION,new Date().getTime());
        return a != null && c.putAllMetadata(a),
        c
    }
    ,
    t.prototype.decodeMiddle = function(e, n, r) {
        var i, o, s = this.decodeMiddleCounters;
        s[0] = 0,
        s[1] = 0,
        s[2] = 0,
        s[3] = 0;
        for (var a = e.getSize(), l = n[1], c = 0, u = 0; u < 5 && l < a; u++) {
            var f = su.decodeDigit(e, s, l, su.L_AND_G_PATTERNS);
            r += String.fromCharCode("0".charCodeAt(0) + f % 10);
            try {
                for (var d = (i = void 0,
                Lbe(s)), h = d.next(); !h.done; h = d.next()) {
                    var p = h.value;
                    l += p
                }
            } catch (v) {
                i = {
                    error: v
                }
            } finally {
                try {
                    h && !h.done && (o = d.return) && o.call(d)
                } finally {
                    if (i)
                        throw i.error
                }
            }
            f >= 10 && (c |= 1 << 4 - u),
            u !== 4 && (l = e.getNextSet(l),
            l = e.getNextUnset(l))
        }
        if (r.length !== 5)
            throw new oe;
        var y = this.determineCheckDigit(c);
        if (t.extensionChecksum(r.toString()) !== y)
            throw new oe;
        return l
    }
    ,
    t.extensionChecksum = function(e) {
        for (var n = e.length, r = 0, i = n - 2; i >= 0; i -= 2)
            r += e.charAt(i).charCodeAt(0) - "0".charCodeAt(0);
        r *= 3;
        for (var i = n - 1; i >= 0; i -= 2)
            r += e.charAt(i).charCodeAt(0) - "0".charCodeAt(0);
        return r *= 3,
        r % 10
    }
    ,
    t.prototype.determineCheckDigit = function(e) {
        for (var n = 0; n < 10; n++)
            if (e === this.CHECK_DIGIT_ENCODINGS[n])
                return n;
        throw new oe
    }
    ,
    t.parseExtensionString = function(e) {
        if (e.length !== 5)
            return null;
        var n = t.parseExtension5String(e);
        return n == null ? null : new Map([[Gn.SUGGESTED_PRICE, n]])
    }
    ,
    t.parseExtension5String = function(e) {
        var n;
        switch (e.charAt(0)) {
        case "0":
            n = "£";
            break;
        case "5":
            n = "$";
            break;
        case "9":
            switch (e) {
            case "90000":
                return null;
            case "99991":
                return "0.00";
            case "99990":
                return "Used"
            }
            n = "";
            break;
        default:
            n = "";
            break
        }
        var r = parseInt(e.substring(1))
          , i = (r / 100).toString()
          , o = r % 100
          , s = o < 10 ? "0" + o : o.toString();
        return n + i + "." + s
    }
    ,
    t
}()
  , Ube = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , Gbe = function() {
    function t() {
        this.decodeMiddleCounters = Int32Array.from([0, 0, 0, 0]),
        this.decodeRowStringBuffer = ""
    }
    return t.prototype.decodeRow = function(e, n, r) {
        var i = this.decodeRowStringBuffer
          , o = this.decodeMiddle(n, r, i)
          , s = i.toString()
          , a = t.parseExtensionString(s)
          , l = [new Pe((r[0] + r[1]) / 2,e), new Pe(o,e)]
          , c = new tr(s,null,0,l,Be.UPC_EAN_EXTENSION,new Date().getTime());
        return a != null && c.putAllMetadata(a),
        c
    }
    ,
    t.prototype.decodeMiddle = function(e, n, r) {
        var i, o, s = this.decodeMiddleCounters;
        s[0] = 0,
        s[1] = 0,
        s[2] = 0,
        s[3] = 0;
        for (var a = e.getSize(), l = n[1], c = 0, u = 0; u < 2 && l < a; u++) {
            var f = su.decodeDigit(e, s, l, su.L_AND_G_PATTERNS);
            r += String.fromCharCode("0".charCodeAt(0) + f % 10);
            try {
                for (var d = (i = void 0,
                Ube(s)), h = d.next(); !h.done; h = d.next()) {
                    var p = h.value;
                    l += p
                }
            } catch (y) {
                i = {
                    error: y
                }
            } finally {
                try {
                    h && !h.done && (o = d.return) && o.call(d)
                } finally {
                    if (i)
                        throw i.error
                }
            }
            f >= 10 && (c |= 1 << 1 - u),
            u !== 1 && (l = e.getNextSet(l),
            l = e.getNextUnset(l))
        }
        if (r.length !== 2)
            throw new oe;
        if (parseInt(r.toString()) % 4 !== c)
            throw new oe;
        return l
    }
    ,
    t.parseExtensionString = function(e) {
        return e.length !== 2 ? null : new Map([[Gn.ISSUE_NUMBER, parseInt(e)]])
    }
    ,
    t
}()
  , Hbe = function() {
    function t() {}
    return t.decodeRow = function(e, n, r) {
        var i = su.findGuardPattern(n, r, !1, this.EXTENSION_START_PATTERN, new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));
        try {
            var o = new $be;
            return o.decodeRow(e, n, i)
        } catch {
            var s = new Gbe;
            return s.decodeRow(e, n, i)
        }
    }
    ,
    t.EXTENSION_START_PATTERN = Int32Array.from([1, 1, 2]),
    t
}()
  , Vbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , _n = function(t) {
    Vbe(e, t);
    function e() {
        var n = t.call(this) || this;
        n.decodeRowStringBuffer = "",
        e.L_AND_G_PATTERNS = e.L_PATTERNS.map(function(a) {
            return Int32Array.from(a)
        });
        for (var r = 10; r < 20; r++) {
            for (var i = e.L_PATTERNS[r - 10], o = new Int32Array(i.length), s = 0; s < i.length; s++)
                o[s] = i[i.length - s - 1];
            e.L_AND_G_PATTERNS[r] = o
        }
        return n
    }
    return e.prototype.decodeRow = function(n, r, i) {
        var o = e.findStartGuardPattern(r)
          , s = i == null ? null : i.get(Ot.NEED_RESULT_POINT_CALLBACK);
        if (s != null) {
            var a = new Pe((o[0] + o[1]) / 2,n);
            s.foundPossibleResultPoint(a)
        }
        var l = this.decodeMiddle(r, o, this.decodeRowStringBuffer)
          , c = l.rowOffset
          , u = l.resultString;
        if (s != null) {
            var f = new Pe(c,n);
            s.foundPossibleResultPoint(f)
        }
        var d = e.decodeEnd(r, c);
        if (s != null) {
            var h = new Pe((d[0] + d[1]) / 2,n);
            s.foundPossibleResultPoint(h)
        }
        var p = d[1]
          , y = p + (p - d[0]);
        if (y >= r.getSize() || !r.isRange(p, y, !1))
            throw new oe;
        var v = u.toString();
        if (v.length < 8)
            throw new me;
        if (!e.checkChecksum(v))
            throw new fn;
        var g = (o[1] + o[0]) / 2
          , m = (d[1] + d[0]) / 2
          , _ = this.getBarcodeFormat()
          , x = [new Pe(g,n), new Pe(m,n)]
          , b = new tr(v,null,0,x,_,new Date().getTime())
          , w = 0;
        try {
            var E = Hbe.decodeRow(n, r, d[1]);
            b.putMetadata(Gn.UPC_EAN_EXTENSION, E.getText()),
            b.putAllMetadata(E.getResultMetadata()),
            b.addResultPoints(E.getResultPoints()),
            w = E.getText().length
        } catch {}
        var S = i == null ? null : i.get(Ot.ALLOWED_EAN_EXTENSIONS);
        if (S != null) {
            var P = !1;
            for (var C in S)
                if (w.toString() === C) {
                    P = !0;
                    break
                }
            if (!P)
                throw new oe
        }
        return _ === Be.EAN_13 || Be.UPC_A,
        b
    }
    ,
    e.checkChecksum = function(n) {
        return e.checkStandardUPCEANChecksum(n)
    }
    ,
    e.checkStandardUPCEANChecksum = function(n) {
        var r = n.length;
        if (r === 0)
            return !1;
        var i = parseInt(n.charAt(r - 1), 10);
        return e.getStandardUPCEANChecksum(n.substring(0, r - 1)) === i
    }
    ,
    e.getStandardUPCEANChecksum = function(n) {
        for (var r = n.length, i = 0, o = r - 1; o >= 0; o -= 2) {
            var s = n.charAt(o).charCodeAt(0) - "0".charCodeAt(0);
            if (s < 0 || s > 9)
                throw new me;
            i += s
        }
        i *= 3;
        for (var o = r - 2; o >= 0; o -= 2) {
            var s = n.charAt(o).charCodeAt(0) - "0".charCodeAt(0);
            if (s < 0 || s > 9)
                throw new me;
            i += s
        }
        return (1e3 - i) % 10
    }
    ,
    e.decodeEnd = function(n, r) {
        return e.findGuardPattern(n, r, !1, e.START_END_PATTERN, new Int32Array(e.START_END_PATTERN.length).fill(0))
    }
    ,
    e
}(su)
  , zbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , IP = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , Ax = function(t) {
    zbe(e, t);
    function e() {
        var n = t.call(this) || this;
        return n.decodeMiddleCounters = Int32Array.from([0, 0, 0, 0]),
        n
    }
    return e.prototype.decodeMiddle = function(n, r, i) {
        var o, s, a, l, c = this.decodeMiddleCounters;
        c[0] = 0,
        c[1] = 0,
        c[2] = 0,
        c[3] = 0;
        for (var u = n.getSize(), f = r[1], d = 0, h = 0; h < 6 && f < u; h++) {
            var p = _n.decodeDigit(n, c, f, _n.L_AND_G_PATTERNS);
            i += String.fromCharCode("0".charCodeAt(0) + p % 10);
            try {
                for (var y = (o = void 0,
                IP(c)), v = y.next(); !v.done; v = y.next()) {
                    var g = v.value;
                    f += g
                }
            } catch (b) {
                o = {
                    error: b
                }
            } finally {
                try {
                    v && !v.done && (s = y.return) && s.call(y)
                } finally {
                    if (o)
                        throw o.error
                }
            }
            p >= 10 && (d |= 1 << 5 - h)
        }
        i = e.determineFirstDigit(i, d);
        var m = _n.findGuardPattern(n, f, !0, _n.MIDDLE_PATTERN, new Int32Array(_n.MIDDLE_PATTERN.length).fill(0));
        f = m[1];
        for (var h = 0; h < 6 && f < u; h++) {
            var p = _n.decodeDigit(n, c, f, _n.L_PATTERNS);
            i += String.fromCharCode("0".charCodeAt(0) + p);
            try {
                for (var _ = (a = void 0,
                IP(c)), x = _.next(); !x.done; x = _.next()) {
                    var g = x.value;
                    f += g
                }
            } catch (E) {
                a = {
                    error: E
                }
            } finally {
                try {
                    x && !x.done && (l = _.return) && l.call(_)
                } finally {
                    if (a)
                        throw a.error
                }
            }
        }
        return {
            rowOffset: f,
            resultString: i
        }
    }
    ,
    e.prototype.getBarcodeFormat = function() {
        return Be.EAN_13
    }
    ,
    e.determineFirstDigit = function(n, r) {
        for (var i = 0; i < 10; i++)
            if (r === this.FIRST_DIGIT_ENCODINGS[i])
                return n = String.fromCharCode("0".charCodeAt(0) + i) + n,
                n;
        throw new oe
    }
    ,
    e.FIRST_DIGIT_ENCODINGS = [0, 11, 13, 14, 19, 25, 28, 21, 22, 26],
    e
}(_n)
  , jbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , OP = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , RP = function(t) {
    jbe(e, t);
    function e() {
        var n = t.call(this) || this;
        return n.decodeMiddleCounters = Int32Array.from([0, 0, 0, 0]),
        n
    }
    return e.prototype.decodeMiddle = function(n, r, i) {
        var o, s, a, l, c = this.decodeMiddleCounters;
        c[0] = 0,
        c[1] = 0,
        c[2] = 0,
        c[3] = 0;
        for (var u = n.getSize(), f = r[1], d = 0; d < 4 && f < u; d++) {
            var h = _n.decodeDigit(n, c, f, _n.L_PATTERNS);
            i += String.fromCharCode("0".charCodeAt(0) + h);
            try {
                for (var p = (o = void 0,
                OP(c)), y = p.next(); !y.done; y = p.next()) {
                    var v = y.value;
                    f += v
                }
            } catch (x) {
                o = {
                    error: x
                }
            } finally {
                try {
                    y && !y.done && (s = p.return) && s.call(p)
                } finally {
                    if (o)
                        throw o.error
                }
            }
        }
        var g = _n.findGuardPattern(n, f, !0, _n.MIDDLE_PATTERN, new Int32Array(_n.MIDDLE_PATTERN.length).fill(0));
        f = g[1];
        for (var d = 0; d < 4 && f < u; d++) {
            var h = _n.decodeDigit(n, c, f, _n.L_PATTERNS);
            i += String.fromCharCode("0".charCodeAt(0) + h);
            try {
                for (var m = (a = void 0,
                OP(c)), _ = m.next(); !_.done; _ = m.next()) {
                    var v = _.value;
                    f += v
                }
            } catch (w) {
                a = {
                    error: w
                }
            } finally {
                try {
                    _ && !_.done && (l = m.return) && l.call(m)
                } finally {
                    if (a)
                        throw a.error
                }
            }
        }
        return {
            rowOffset: f,
            resultString: i
        }
    }
    ,
    e.prototype.getBarcodeFormat = function() {
        return Be.EAN_8
    }
    ,
    e
}(_n)
  , Wbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , MP = function(t) {
    Wbe(e, t);
    function e() {
        var n = t !== null && t.apply(this, arguments) || this;
        return n.ean13Reader = new Ax,
        n
    }
    return e.prototype.getBarcodeFormat = function() {
        return Be.UPC_A
    }
    ,
    e.prototype.decode = function(n, r) {
        return this.maybeReturnResult(this.ean13Reader.decode(n))
    }
    ,
    e.prototype.decodeRow = function(n, r, i) {
        return this.maybeReturnResult(this.ean13Reader.decodeRow(n, r, i))
    }
    ,
    e.prototype.decodeMiddle = function(n, r, i) {
        return this.ean13Reader.decodeMiddle(n, r, i)
    }
    ,
    e.prototype.maybeReturnResult = function(n) {
        var r = n.getText();
        if (r.charAt(0) === "0") {
            var i = new tr(r.substring(1),null,null,n.getResultPoints(),Be.UPC_A);
            return n.getResultMetadata() != null && i.putAllMetadata(n.getResultMetadata()),
            i
        } else
            throw new oe
    }
    ,
    e.prototype.reset = function() {
        this.ean13Reader.reset()
    }
    ,
    e
}(_n)
  , Ybe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Xbe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , DP = function(t) {
    Ybe(e, t);
    function e() {
        var n = t.call(this) || this;
        return n.decodeMiddleCounters = new Int32Array(4),
        n
    }
    return e.prototype.decodeMiddle = function(n, r, i) {
        var o, s, a = this.decodeMiddleCounters.map(function(v) {
            return v
        });
        a[0] = 0,
        a[1] = 0,
        a[2] = 0,
        a[3] = 0;
        for (var l = n.getSize(), c = r[1], u = 0, f = 0; f < 6 && c < l; f++) {
            var d = e.decodeDigit(n, a, c, e.L_AND_G_PATTERNS);
            i += String.fromCharCode("0".charCodeAt(0) + d % 10);
            try {
                for (var h = (o = void 0,
                Xbe(a)), p = h.next(); !p.done; p = h.next()) {
                    var y = p.value;
                    c += y
                }
            } catch (v) {
                o = {
                    error: v
                }
            } finally {
                try {
                    p && !p.done && (s = h.return) && s.call(h)
                } finally {
                    if (o)
                        throw o.error
                }
            }
            d >= 10 && (u |= 1 << 5 - f)
        }
        return e.determineNumSysAndCheckDigit(new Ke(i), u),
        c
    }
    ,
    e.prototype.decodeEnd = function(n, r) {
        return e.findGuardPatternWithoutCounters(n, r, !0, e.MIDDLE_END_PATTERN)
    }
    ,
    e.prototype.checkChecksum = function(n) {
        return _n.checkChecksum(e.convertUPCEtoUPCA(n))
    }
    ,
    e.determineNumSysAndCheckDigit = function(n, r) {
        for (var i = 0; i <= 1; i++)
            for (var o = 0; o < 10; o++)
                if (r === this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[i][o]) {
                    n.insert(0, "0" + i),
                    n.append("0" + o);
                    return
                }
        throw oe.getNotFoundInstance()
    }
    ,
    e.prototype.getBarcodeFormat = function() {
        return Be.UPC_E
    }
    ,
    e.convertUPCEtoUPCA = function(n) {
        var r = n.slice(1, 7).split("").map(function(s) {
            return s.charCodeAt(0)
        })
          , i = new Ke;
        i.append(n.charAt(0));
        var o = r[5];
        switch (o) {
        case 0:
        case 1:
        case 2:
            i.appendChars(r, 0, 2),
            i.append(o),
            i.append("0000"),
            i.appendChars(r, 2, 3);
            break;
        case 3:
            i.appendChars(r, 0, 3),
            i.append("00000"),
            i.appendChars(r, 3, 2);
            break;
        case 4:
            i.appendChars(r, 0, 4),
            i.append("00000"),
            i.append(r[4]);
            break;
        default:
            i.appendChars(r, 0, 5),
            i.append("0000"),
            i.append(o);
            break
        }
        return n.length >= 8 && i.append(n.charAt(7)),
        i.toString()
    }
    ,
    e.MIDDLE_END_PATTERN = Int32Array.from([1, 1, 1, 1, 1, 1]),
    e.NUMSYS_AND_CHECK_DIGIT_PATTERNS = [Int32Array.from([56, 52, 50, 49, 44, 38, 35, 42, 41, 37]), Int32Array.from([7, 11, 13, 14, 19, 25, 28, 21, 22, 1])],
    e
}(_n)
  , Kbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , BP = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , Pv = function(t) {
    Kbe(e, t);
    function e(n) {
        var r = t.call(this) || this
          , i = n == null ? null : n.get(Ot.POSSIBLE_FORMATS)
          , o = [];
        return i != null && (i.indexOf(Be.EAN_13) > -1 && o.push(new Ax),
        i.indexOf(Be.UPC_A) > -1 && o.push(new MP),
        i.indexOf(Be.EAN_8) > -1 && o.push(new RP),
        i.indexOf(Be.UPC_E) > -1 && o.push(new DP)),
        o.length === 0 && (o.push(new Ax),
        o.push(new MP),
        o.push(new RP),
        o.push(new DP)),
        r.readers = o,
        r
    }
    return e.prototype.decodeRow = function(n, r, i) {
        var o, s;
        try {
            for (var a = BP(this.readers), l = a.next(); !l.done; l = a.next()) {
                var c = l.value;
                try {
                    var u = c.decodeRow(n, r, i)
                      , f = u.getBarcodeFormat() === Be.EAN_13 && u.getText().charAt(0) === "0"
                      , d = i == null ? null : i.get(Ot.POSSIBLE_FORMATS)
                      , h = d == null || d.includes(Be.UPC_A);
                    if (f && h) {
                        var p = u.getRawBytes()
                          , y = new tr(u.getText().substring(1),p,p ? p.length : null,u.getResultPoints(),Be.UPC_A);
                        return y.putAllMetadata(u.getResultMetadata()),
                        y
                    }
                    return u
                } catch {}
            }
        } catch (v) {
            o = {
                error: v
            }
        } finally {
            try {
                l && !l.done && (s = a.return) && s.call(a)
            } finally {
                if (o)
                    throw o.error
            }
        }
        throw new oe
    }
    ,
    e.prototype.reset = function() {
        var n, r;
        try {
            for (var i = BP(this.readers), o = i.next(); !o.done; o = i.next()) {
                var s = o.value;
                s.reset()
            }
        } catch (a) {
            n = {
                error: a
            }
        } finally {
            try {
                o && !o.done && (r = i.return) && r.call(i)
            } finally {
                if (n)
                    throw n.error
            }
        }
    }
    ,
    e
}(En)
  , qbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Zbe = function(t) {
    qbe(e, t);
    function e() {
        var n = t !== null && t.apply(this, arguments) || this;
        return n.CODA_BAR_CHAR_SET = {
            nnnnnww: "0",
            nnnnwwn: "1",
            nnnwnnw: "2",
            wwnnnnn: "3",
            nnwnnwn: "4",
            wnnnnwn: "5",
            nwnnnnw: "6",
            nwnnwnn: "7",
            nwwnnnn: "8",
            wnnwnnn: "9",
            nnnwwnn: "-",
            nnwwnnn: "$",
            wnnnwnw: ":",
            wnwnnnw: "/",
            wnwnwnn: ".",
            nnwwwww: "+",
            nnwwnwn: "A",
            nwnwnnw: "B",
            nnnwnww: "C",
            nnnwwwn: "D"
        },
        n
    }
    return e.prototype.decodeRow = function(n, r, i) {
        var o = this.getValidRowData(r);
        if (!o)
            throw new oe;
        var s = this.codaBarDecodeRow(o.row);
        if (!s)
            throw new oe;
        return new tr(s,null,0,[new Pe(o.left,n), new Pe(o.right,n)],Be.CODABAR,new Date().getTime())
    }
    ,
    e.prototype.getValidRowData = function(n) {
        var r = n.toArray()
          , i = r.indexOf(!0);
        if (i === -1)
            return null;
        var o = r.lastIndexOf(!0);
        if (o <= i)
            return null;
        r = r.slice(i, o + 1);
        for (var s = [], a = r[0], l = 1, c = 1; c < r.length; c++)
            r[c] === a ? l++ : (a = r[c],
            s.push(l),
            l = 1);
        return s.push(l),
        s.length < 23 && (s.length + 1) % 8 !== 0 ? null : {
            row: s,
            left: i,
            right: o
        }
    }
    ,
    e.prototype.codaBarDecodeRow = function(n) {
        for (var r = [], i = Math.ceil(n.reduce(function(l, c) {
            return (l + c) / 2
        }, 0)); n.length > 0; ) {
            var o = n.splice(0, 8).splice(0, 7)
              , s = o.map(function(l) {
                return l < i ? "n" : "w"
            }).join("");
            if (this.CODA_BAR_CHAR_SET[s] === void 0)
                return null;
            r.push(this.CODA_BAR_CHAR_SET[s])
        }
        var a = r.join("");
        return this.validCodaBarString(a) ? a : null
    }
    ,
    e.prototype.validCodaBarString = function(n) {
        var r = /^[A-D].{1,}[A-D]$/;
        return r.test(n)
    }
    ,
    e
}(En)
  , Jbe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Qbe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , Ba = function(t) {
    Jbe(e, t);
    function e() {
        var n = t.call(this) || this;
        return n.decodeFinderCounters = new Int32Array(4),
        n.dataCharacterCounters = new Int32Array(8),
        n.oddRoundingErrors = new Array(4),
        n.evenRoundingErrors = new Array(4),
        n.oddCounts = new Array(n.dataCharacterCounters.length / 2),
        n.evenCounts = new Array(n.dataCharacterCounters.length / 2),
        n
    }
    return e.prototype.getDecodeFinderCounters = function() {
        return this.decodeFinderCounters
    }
    ,
    e.prototype.getDataCharacterCounters = function() {
        return this.dataCharacterCounters
    }
    ,
    e.prototype.getOddRoundingErrors = function() {
        return this.oddRoundingErrors
    }
    ,
    e.prototype.getEvenRoundingErrors = function() {
        return this.evenRoundingErrors
    }
    ,
    e.prototype.getOddCounts = function() {
        return this.oddCounts
    }
    ,
    e.prototype.getEvenCounts = function() {
        return this.evenCounts
    }
    ,
    e.prototype.parseFinderValue = function(n, r) {
        for (var i = 0; i < r.length; i++)
            if (En.patternMatchVariance(n, r[i], e.MAX_INDIVIDUAL_VARIANCE) < e.MAX_AVG_VARIANCE)
                return i;
        throw new oe
    }
    ,
    e.count = function(n) {
        return ft.sum(new Int32Array(n))
    }
    ,
    e.increment = function(n, r) {
        for (var i = 0, o = r[0], s = 1; s < n.length; s++)
            r[s] > o && (o = r[s],
            i = s);
        n[i]++
    }
    ,
    e.decrement = function(n, r) {
        for (var i = 0, o = r[0], s = 1; s < n.length; s++)
            r[s] < o && (o = r[s],
            i = s);
        n[i]--
    }
    ,
    e.isFinderPattern = function(n) {
        var r, i, o = n[0] + n[1], s = o + n[2] + n[3], a = o / s;
        if (a >= e.MIN_FINDER_PATTERN_RATIO && a <= e.MAX_FINDER_PATTERN_RATIO) {
            var l = Number.MAX_SAFE_INTEGER
              , c = Number.MIN_SAFE_INTEGER;
            try {
                for (var u = Qbe(n), f = u.next(); !f.done; f = u.next()) {
                    var d = f.value;
                    d > c && (c = d),
                    d < l && (l = d)
                }
            } catch (h) {
                r = {
                    error: h
                }
            } finally {
                try {
                    f && !f.done && (i = u.return) && i.call(u)
                } finally {
                    if (r)
                        throw r.error
                }
            }
            return c < 10 * l
        }
        return !1
    }
    ,
    e.MAX_AVG_VARIANCE = .2,
    e.MAX_INDIVIDUAL_VARIANCE = .45,
    e.MIN_FINDER_PATTERN_RATIO = 9.5 / 12,
    e.MAX_FINDER_PATTERN_RATIO = 12.5 / 14,
    e
}(En)
  , U0 = function() {
    function t(e, n) {
        this.value = e,
        this.checksumPortion = n
    }
    return t.prototype.getValue = function() {
        return this.value
    }
    ,
    t.prototype.getChecksumPortion = function() {
        return this.checksumPortion
    }
    ,
    t.prototype.toString = function() {
        return this.value + "(" + this.checksumPortion + ")"
    }
    ,
    t.prototype.equals = function(e) {
        if (!(e instanceof t))
            return !1;
        var n = e;
        return this.value === n.value && this.checksumPortion === n.checksumPortion
    }
    ,
    t.prototype.hashCode = function() {
        return this.value ^ this.checksumPortion
    }
    ,
    t
}()
  , M9 = function() {
    function t(e, n, r, i, o) {
        this.value = e,
        this.startEnd = n,
        this.value = e,
        this.startEnd = n,
        this.resultPoints = new Array,
        this.resultPoints.push(new Pe(r,o)),
        this.resultPoints.push(new Pe(i,o))
    }
    return t.prototype.getValue = function() {
        return this.value
    }
    ,
    t.prototype.getStartEnd = function() {
        return this.startEnd
    }
    ,
    t.prototype.getResultPoints = function() {
        return this.resultPoints
    }
    ,
    t.prototype.equals = function(e) {
        if (!(e instanceof t))
            return !1;
        var n = e;
        return this.value === n.value
    }
    ,
    t.prototype.hashCode = function() {
        return this.value
    }
    ,
    t
}()
  , ewe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , _c = function() {
    function t() {}
    return t.getRSSvalue = function(e, n, r) {
        var i, o, s = 0;
        try {
            for (var a = ewe(e), l = a.next(); !l.done; l = a.next()) {
                var c = l.value;
                s += c
            }
        } catch (m) {
            i = {
                error: m
            }
        } finally {
            try {
                l && !l.done && (o = a.return) && o.call(a)
            } finally {
                if (i)
                    throw i.error
            }
        }
        for (var u = 0, f = 0, d = e.length, h = 0; h < d - 1; h++) {
            var p = void 0;
            for (p = 1,
            f |= 1 << h; p < e[h]; p++,
            f &= ~(1 << h)) {
                var y = t.combins(s - p - 1, d - h - 2);
                if (r && f === 0 && s - p - (d - h - 1) >= d - h - 1 && (y -= t.combins(s - p - (d - h), d - h - 2)),
                d - h - 1 > 1) {
                    for (var v = 0, g = s - p - (d - h - 2); g > n; g--)
                        v += t.combins(s - p - g - 1, d - h - 3);
                    y -= v * (d - 1 - h)
                } else
                    s - p > n && y--;
                u += y
            }
            s -= p
        }
        return u
    }
    ,
    t.combins = function(e, n) {
        var r, i;
        e - n > n ? (i = n,
        r = e - n) : (i = e - n,
        r = n);
        for (var o = 1, s = 1, a = e; a > r; a--)
            o *= a,
            s <= i && (o /= s,
            s++);
        for (; s <= i; )
            o /= s,
            s++;
        return o
    }
    ,
    t
}()
  , twe = function() {
    function t() {}
    return t.buildBitArray = function(e) {
        var n = e.length * 2 - 1;
        e[e.length - 1].getRightChar() == null && (n -= 1);
        for (var r = 12 * n, i = new Dn(r), o = 0, s = e[0], a = s.getRightChar().getValue(), l = 11; l >= 0; --l)
            a & 1 << l && i.set(o),
            o++;
        for (var l = 1; l < e.length; ++l) {
            for (var c = e[l], u = c.getLeftChar().getValue(), f = 11; f >= 0; --f)
                u & 1 << f && i.set(o),
                o++;
            if (c.getRightChar() !== null)
                for (var d = c.getRightChar().getValue(), f = 11; f >= 0; --f)
                    d & 1 << f && i.set(o),
                    o++
        }
        return i
    }
    ,
    t
}()
  , Aa = function() {
    function t(e, n) {
        n ? this.decodedInformation = null : (this.finished = e,
        this.decodedInformation = n)
    }
    return t.prototype.getDecodedInformation = function() {
        return this.decodedInformation
    }
    ,
    t.prototype.isFinished = function() {
        return this.finished
    }
    ,
    t
}()
  , fE = function() {
    function t(e) {
        this.newPosition = e
    }
    return t.prototype.getNewPosition = function() {
        return this.newPosition
    }
    ,
    t
}()
  , nwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , wi = function(t) {
    nwe(e, t);
    function e(n, r) {
        var i = t.call(this, n) || this;
        return i.value = r,
        i
    }
    return e.prototype.getValue = function() {
        return this.value
    }
    ,
    e.prototype.isFNC1 = function() {
        return this.value === e.FNC1
    }
    ,
    e.FNC1 = "$",
    e
}(fE)
  , rwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Ta = function(t) {
    rwe(e, t);
    function e(n, r, i) {
        var o = t.call(this, n) || this;
        return i ? (o.remaining = !0,
        o.remainingValue = o.remainingValue) : (o.remaining = !1,
        o.remainingValue = 0),
        o.newString = r,
        o
    }
    return e.prototype.getNewString = function() {
        return this.newString
    }
    ,
    e.prototype.isRemaining = function() {
        return this.remaining
    }
    ,
    e.prototype.getRemainingValue = function() {
        return this.remainingValue
    }
    ,
    e
}(fE)
  , iwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , oc = function(t) {
    iwe(e, t);
    function e(n, r, i) {
        var o = t.call(this, n) || this;
        if (r < 0 || r > 10 || i < 0 || i > 10)
            throw new me;
        return o.firstDigit = r,
        o.secondDigit = i,
        o
    }
    return e.prototype.getFirstDigit = function() {
        return this.firstDigit
    }
    ,
    e.prototype.getSecondDigit = function() {
        return this.secondDigit
    }
    ,
    e.prototype.getValue = function() {
        return this.firstDigit * 10 + this.secondDigit
    }
    ,
    e.prototype.isFirstDigitFNC1 = function() {
        return this.firstDigit === e.FNC1
    }
    ,
    e.prototype.isSecondDigitFNC1 = function() {
        return this.secondDigit === e.FNC1
    }
    ,
    e.prototype.isAnyFNC1 = function() {
        return this.firstDigit === e.FNC1 || this.secondDigit === e.FNC1
    }
    ,
    e.FNC1 = 10,
    e
}(fE)
  , vp = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , owe = function() {
    function t() {}
    return t.parseFieldsInGeneralPurpose = function(e) {
        var n, r, i, o, s, a, l, c;
        if (!e)
            return null;
        if (e.length < 2)
            throw new oe;
        var u = e.substring(0, 2);
        try {
            for (var f = vp(t.TWO_DIGIT_DATA_LENGTH), d = f.next(); !d.done; d = f.next()) {
                var h = d.value;
                if (h[0] === u)
                    return h[1] === t.VARIABLE_LENGTH ? t.processVariableAI(2, h[2], e) : t.processFixedAI(2, h[1], e)
            }
        } catch (w) {
            n = {
                error: w
            }
        } finally {
            try {
                d && !d.done && (r = f.return) && r.call(f)
            } finally {
                if (n)
                    throw n.error
            }
        }
        if (e.length < 3)
            throw new oe;
        var p = e.substring(0, 3);
        try {
            for (var y = vp(t.THREE_DIGIT_DATA_LENGTH), v = y.next(); !v.done; v = y.next()) {
                var h = v.value;
                if (h[0] === p)
                    return h[1] === t.VARIABLE_LENGTH ? t.processVariableAI(3, h[2], e) : t.processFixedAI(3, h[1], e)
            }
        } catch (w) {
            i = {
                error: w
            }
        } finally {
            try {
                v && !v.done && (o = y.return) && o.call(y)
            } finally {
                if (i)
                    throw i.error
            }
        }
        try {
            for (var g = vp(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH), m = g.next(); !m.done; m = g.next()) {
                var h = m.value;
                if (h[0] === p)
                    return h[1] === t.VARIABLE_LENGTH ? t.processVariableAI(4, h[2], e) : t.processFixedAI(4, h[1], e)
            }
        } catch (w) {
            s = {
                error: w
            }
        } finally {
            try {
                m && !m.done && (a = g.return) && a.call(g)
            } finally {
                if (s)
                    throw s.error
            }
        }
        if (e.length < 4)
            throw new oe;
        var _ = e.substring(0, 4);
        try {
            for (var x = vp(t.FOUR_DIGIT_DATA_LENGTH), b = x.next(); !b.done; b = x.next()) {
                var h = b.value;
                if (h[0] === _)
                    return h[1] === t.VARIABLE_LENGTH ? t.processVariableAI(4, h[2], e) : t.processFixedAI(4, h[1], e)
            }
        } catch (w) {
            l = {
                error: w
            }
        } finally {
            try {
                b && !b.done && (c = x.return) && c.call(x)
            } finally {
                if (l)
                    throw l.error
            }
        }
        throw new oe
    }
    ,
    t.processFixedAI = function(e, n, r) {
        if (r.length < e)
            throw new oe;
        var i = r.substring(0, e);
        if (r.length < e + n)
            throw new oe;
        var o = r.substring(e, e + n)
          , s = r.substring(e + n)
          , a = "(" + i + ")" + o
          , l = t.parseFieldsInGeneralPurpose(s);
        return l == null ? a : a + l
    }
    ,
    t.processVariableAI = function(e, n, r) {
        var i = r.substring(0, e), o;
        r.length < e + n ? o = r.length : o = e + n;
        var s = r.substring(e, o)
          , a = r.substring(o)
          , l = "(" + i + ")" + s
          , c = t.parseFieldsInGeneralPurpose(a);
        return c == null ? l : l + c
    }
    ,
    t.VARIABLE_LENGTH = [],
    t.TWO_DIGIT_DATA_LENGTH = [["00", 18], ["01", 14], ["02", 14], ["10", t.VARIABLE_LENGTH, 20], ["11", 6], ["12", 6], ["13", 6], ["15", 6], ["17", 6], ["20", 2], ["21", t.VARIABLE_LENGTH, 20], ["22", t.VARIABLE_LENGTH, 29], ["30", t.VARIABLE_LENGTH, 8], ["37", t.VARIABLE_LENGTH, 8], ["90", t.VARIABLE_LENGTH, 30], ["91", t.VARIABLE_LENGTH, 30], ["92", t.VARIABLE_LENGTH, 30], ["93", t.VARIABLE_LENGTH, 30], ["94", t.VARIABLE_LENGTH, 30], ["95", t.VARIABLE_LENGTH, 30], ["96", t.VARIABLE_LENGTH, 30], ["97", t.VARIABLE_LENGTH, 3], ["98", t.VARIABLE_LENGTH, 30], ["99", t.VARIABLE_LENGTH, 30]],
    t.THREE_DIGIT_DATA_LENGTH = [["240", t.VARIABLE_LENGTH, 30], ["241", t.VARIABLE_LENGTH, 30], ["242", t.VARIABLE_LENGTH, 6], ["250", t.VARIABLE_LENGTH, 30], ["251", t.VARIABLE_LENGTH, 30], ["253", t.VARIABLE_LENGTH, 17], ["254", t.VARIABLE_LENGTH, 20], ["400", t.VARIABLE_LENGTH, 30], ["401", t.VARIABLE_LENGTH, 30], ["402", 17], ["403", t.VARIABLE_LENGTH, 30], ["410", 13], ["411", 13], ["412", 13], ["413", 13], ["414", 13], ["420", t.VARIABLE_LENGTH, 20], ["421", t.VARIABLE_LENGTH, 15], ["422", 3], ["423", t.VARIABLE_LENGTH, 15], ["424", 3], ["425", 3], ["426", 3]],
    t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH = [["310", 6], ["311", 6], ["312", 6], ["313", 6], ["314", 6], ["315", 6], ["316", 6], ["320", 6], ["321", 6], ["322", 6], ["323", 6], ["324", 6], ["325", 6], ["326", 6], ["327", 6], ["328", 6], ["329", 6], ["330", 6], ["331", 6], ["332", 6], ["333", 6], ["334", 6], ["335", 6], ["336", 6], ["340", 6], ["341", 6], ["342", 6], ["343", 6], ["344", 6], ["345", 6], ["346", 6], ["347", 6], ["348", 6], ["349", 6], ["350", 6], ["351", 6], ["352", 6], ["353", 6], ["354", 6], ["355", 6], ["356", 6], ["357", 6], ["360", 6], ["361", 6], ["362", 6], ["363", 6], ["364", 6], ["365", 6], ["366", 6], ["367", 6], ["368", 6], ["369", 6], ["390", t.VARIABLE_LENGTH, 15], ["391", t.VARIABLE_LENGTH, 18], ["392", t.VARIABLE_LENGTH, 15], ["393", t.VARIABLE_LENGTH, 18], ["703", t.VARIABLE_LENGTH, 30]],
    t.FOUR_DIGIT_DATA_LENGTH = [["7001", 13], ["7002", t.VARIABLE_LENGTH, 30], ["7003", 10], ["8001", 14], ["8002", t.VARIABLE_LENGTH, 20], ["8003", t.VARIABLE_LENGTH, 30], ["8004", t.VARIABLE_LENGTH, 30], ["8005", 6], ["8006", 18], ["8007", t.VARIABLE_LENGTH, 30], ["8008", t.VARIABLE_LENGTH, 12], ["8018", 18], ["8020", t.VARIABLE_LENGTH, 25], ["8100", 6], ["8101", 10], ["8102", 2], ["8110", t.VARIABLE_LENGTH, 70], ["8200", t.VARIABLE_LENGTH, 70]],
    t
}()
  , jp = function() {
    function t(e) {
        this.buffer = new Ke,
        this.information = e
    }
    return t.prototype.decodeAllCodes = function(e, n) {
        var r = n
          , i = null;
        do {
            var o = this.decodeGeneralPurposeField(r, i)
              , s = owe.parseFieldsInGeneralPurpose(o.getNewString());
            if (s != null && e.append(s),
            o.isRemaining() ? i = "" + o.getRemainingValue() : i = null,
            r === o.getNewPosition())
                break;
            r = o.getNewPosition()
        } while (!0);
        return e.toString()
    }
    ,
    t.prototype.isStillNumeric = function(e) {
        if (e + 7 > this.information.getSize())
            return e + 4 <= this.information.getSize();
        for (var n = e; n < e + 3; ++n)
            if (this.information.get(n))
                return !0;
        return this.information.get(e + 3)
    }
    ,
    t.prototype.decodeNumeric = function(e) {
        if (e + 7 > this.information.getSize()) {
            var n = this.extractNumericValueFromBitArray(e, 4);
            return n === 0 ? new oc(this.information.getSize(),oc.FNC1,oc.FNC1) : new oc(this.information.getSize(),n - 1,oc.FNC1)
        }
        var r = this.extractNumericValueFromBitArray(e, 7)
          , i = (r - 8) / 11
          , o = (r - 8) % 11;
        return new oc(e + 7,i,o)
    }
    ,
    t.prototype.extractNumericValueFromBitArray = function(e, n) {
        return t.extractNumericValueFromBitArray(this.information, e, n)
    }
    ,
    t.extractNumericValueFromBitArray = function(e, n, r) {
        for (var i = 0, o = 0; o < r; ++o)
            e.get(n + o) && (i |= 1 << r - o - 1);
        return i
    }
    ,
    t.prototype.decodeGeneralPurposeField = function(e, n) {
        this.buffer.setLengthToZero(),
        n != null && this.buffer.append(n),
        this.current.setPosition(e);
        var r = this.parseBlocks();
        return r != null && r.isRemaining() ? new Ta(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()) : new Ta(this.current.getPosition(),this.buffer.toString())
    }
    ,
    t.prototype.parseBlocks = function() {
        var e, n;
        do {
            var r = this.current.getPosition();
            this.current.isAlpha() ? (n = this.parseAlphaBlock(),
            e = n.isFinished()) : this.current.isIsoIec646() ? (n = this.parseIsoIec646Block(),
            e = n.isFinished()) : (n = this.parseNumericBlock(),
            e = n.isFinished());
            var i = r !== this.current.getPosition();
            if (!i && !e)
                break
        } while (!e);
        return n.getDecodedInformation()
    }
    ,
    t.prototype.parseNumericBlock = function() {
        for (; this.isStillNumeric(this.current.getPosition()); ) {
            var e = this.decodeNumeric(this.current.getPosition());
            if (this.current.setPosition(e.getNewPosition()),
            e.isFirstDigitFNC1()) {
                var n = void 0;
                return e.isSecondDigitFNC1() ? n = new Ta(this.current.getPosition(),this.buffer.toString()) : n = new Ta(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),
                new Aa(!0,n)
            }
            if (this.buffer.append(e.getFirstDigit()),
            e.isSecondDigitFNC1()) {
                var n = new Ta(this.current.getPosition(),this.buffer.toString());
                return new Aa(!0,n)
            }
            this.buffer.append(e.getSecondDigit())
        }
        return this.isNumericToAlphaNumericLatch(this.current.getPosition()) && (this.current.setAlpha(),
        this.current.incrementPosition(4)),
        new Aa(!1)
    }
    ,
    t.prototype.parseIsoIec646Block = function() {
        for (; this.isStillIsoIec646(this.current.getPosition()); ) {
            var e = this.decodeIsoIec646(this.current.getPosition());
            if (this.current.setPosition(e.getNewPosition()),
            e.isFNC1()) {
                var n = new Ta(this.current.getPosition(),this.buffer.toString());
                return new Aa(!0,n)
            }
            this.buffer.append(e.getValue())
        }
        return this.isAlphaOr646ToNumericLatch(this.current.getPosition()) ? (this.current.incrementPosition(3),
        this.current.setNumeric()) : this.isAlphaTo646ToAlphaLatch(this.current.getPosition()) && (this.current.getPosition() + 5 < this.information.getSize() ? this.current.incrementPosition(5) : this.current.setPosition(this.information.getSize()),
        this.current.setAlpha()),
        new Aa(!1)
    }
    ,
    t.prototype.parseAlphaBlock = function() {
        for (; this.isStillAlpha(this.current.getPosition()); ) {
            var e = this.decodeAlphanumeric(this.current.getPosition());
            if (this.current.setPosition(e.getNewPosition()),
            e.isFNC1()) {
                var n = new Ta(this.current.getPosition(),this.buffer.toString());
                return new Aa(!0,n)
            }
            this.buffer.append(e.getValue())
        }
        return this.isAlphaOr646ToNumericLatch(this.current.getPosition()) ? (this.current.incrementPosition(3),
        this.current.setNumeric()) : this.isAlphaTo646ToAlphaLatch(this.current.getPosition()) && (this.current.getPosition() + 5 < this.information.getSize() ? this.current.incrementPosition(5) : this.current.setPosition(this.information.getSize()),
        this.current.setIsoIec646()),
        new Aa(!1)
    }
    ,
    t.prototype.isStillIsoIec646 = function(e) {
        if (e + 5 > this.information.getSize())
            return !1;
        var n = this.extractNumericValueFromBitArray(e, 5);
        if (n >= 5 && n < 16)
            return !0;
        if (e + 7 > this.information.getSize())
            return !1;
        var r = this.extractNumericValueFromBitArray(e, 7);
        if (r >= 64 && r < 116)
            return !0;
        if (e + 8 > this.information.getSize())
            return !1;
        var i = this.extractNumericValueFromBitArray(e, 8);
        return i >= 232 && i < 253
    }
    ,
    t.prototype.decodeIsoIec646 = function(e) {
        var n = this.extractNumericValueFromBitArray(e, 5);
        if (n === 15)
            return new wi(e + 5,wi.FNC1);
        if (n >= 5 && n < 15)
            return new wi(e + 5,"0" + (n - 5));
        var r = this.extractNumericValueFromBitArray(e, 7);
        if (r >= 64 && r < 90)
            return new wi(e + 7,"" + (r + 1));
        if (r >= 90 && r < 116)
            return new wi(e + 7,"" + (r + 7));
        var i = this.extractNumericValueFromBitArray(e, 8), o;
        switch (i) {
        case 232:
            o = "!";
            break;
        case 233:
            o = '"';
            break;
        case 234:
            o = "%";
            break;
        case 235:
            o = "&";
            break;
        case 236:
            o = "'";
            break;
        case 237:
            o = "(";
            break;
        case 238:
            o = ")";
            break;
        case 239:
            o = "*";
            break;
        case 240:
            o = "+";
            break;
        case 241:
            o = ",";
            break;
        case 242:
            o = "-";
            break;
        case 243:
            o = ".";
            break;
        case 244:
            o = "/";
            break;
        case 245:
            o = ":";
            break;
        case 246:
            o = ";";
            break;
        case 247:
            o = "<";
            break;
        case 248:
            o = "=";
            break;
        case 249:
            o = ">";
            break;
        case 250:
            o = "?";
            break;
        case 251:
            o = "_";
            break;
        case 252:
            o = " ";
            break;
        default:
            throw new me
        }
        return new wi(e + 8,o)
    }
    ,
    t.prototype.isStillAlpha = function(e) {
        if (e + 5 > this.information.getSize())
            return !1;
        var n = this.extractNumericValueFromBitArray(e, 5);
        if (n >= 5 && n < 16)
            return !0;
        if (e + 6 > this.information.getSize())
            return !1;
        var r = this.extractNumericValueFromBitArray(e, 6);
        return r >= 16 && r < 63
    }
    ,
    t.prototype.decodeAlphanumeric = function(e) {
        var n = this.extractNumericValueFromBitArray(e, 5);
        if (n === 15)
            return new wi(e + 5,wi.FNC1);
        if (n >= 5 && n < 15)
            return new wi(e + 5,"0" + (n - 5));
        var r = this.extractNumericValueFromBitArray(e, 6);
        if (r >= 32 && r < 58)
            return new wi(e + 6,"" + (r + 33));
        var i;
        switch (r) {
        case 58:
            i = "*";
            break;
        case 59:
            i = ",";
            break;
        case 60:
            i = "-";
            break;
        case 61:
            i = ".";
            break;
        case 62:
            i = "/";
            break;
        default:
            throw new fh("Decoding invalid alphanumeric value: " + r)
        }
        return new wi(e + 6,i)
    }
    ,
    t.prototype.isAlphaTo646ToAlphaLatch = function(e) {
        if (e + 1 > this.information.getSize())
            return !1;
        for (var n = 0; n < 5 && n + e < this.information.getSize(); ++n)
            if (n === 2) {
                if (!this.information.get(e + 2))
                    return !1
            } else if (this.information.get(e + n))
                return !1;
        return !0
    }
    ,
    t.prototype.isAlphaOr646ToNumericLatch = function(e) {
        if (e + 3 > this.information.getSize())
            return !1;
        for (var n = e; n < e + 3; ++n)
            if (this.information.get(n))
                return !1;
        return !0
    }
    ,
    t.prototype.isNumericToAlphaNumericLatch = function(e) {
        if (e + 1 > this.information.getSize())
            return !1;
        for (var n = 0; n < 4 && n + e < this.information.getSize(); ++n)
            if (this.information.get(e + n))
                return !1;
        return !0
    }
    ,
    t
}()
  , D9 = function() {
    function t(e) {
        this.information = e,
        this.generalDecoder = new jp(e)
    }
    return t.prototype.getInformation = function() {
        return this.information
    }
    ,
    t.prototype.getGeneralDecoder = function() {
        return this.generalDecoder
    }
    ,
    t
}()
  , swe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Oi = function(t) {
    swe(e, t);
    function e(n) {
        return t.call(this, n) || this
    }
    return e.prototype.encodeCompressedGtin = function(n, r) {
        n.append("(01)");
        var i = n.length();
        n.append("9"),
        this.encodeCompressedGtinWithoutAI(n, r, i)
    }
    ,
    e.prototype.encodeCompressedGtinWithoutAI = function(n, r, i) {
        for (var o = 0; o < 4; ++o) {
            var s = this.getGeneralDecoder().extractNumericValueFromBitArray(r + 10 * o, 10);
            s / 100 === 0 && n.append("0"),
            s / 10 === 0 && n.append("0"),
            n.append(s)
        }
        e.appendCheckDigit(n, i)
    }
    ,
    e.appendCheckDigit = function(n, r) {
        for (var i = 0, o = 0; o < 13; o++) {
            var s = n.charAt(o + r).charCodeAt(0) - "0".charCodeAt(0);
            i += o & 1 ? s : 3 * s
        }
        i = 10 - i % 10,
        i === 10 && (i = 0),
        n.append(i)
    }
    ,
    e.GTIN_SIZE = 40,
    e
}(D9)
  , awe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , lwe = function(t) {
    awe(e, t);
    function e(n) {
        return t.call(this, n) || this
    }
    return e.prototype.parseInformation = function() {
        var n = new Ke;
        n.append("(01)");
        var r = n.length()
          , i = this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE, 4);
        return n.append(i),
        this.encodeCompressedGtinWithoutAI(n, e.HEADER_SIZE + 4, r),
        this.getGeneralDecoder().decodeAllCodes(n, e.HEADER_SIZE + 44)
    }
    ,
    e.HEADER_SIZE = 1 + 1 + 2,
    e
}(Oi)
  , cwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , uwe = function(t) {
    cwe(e, t);
    function e(n) {
        return t.call(this, n) || this
    }
    return e.prototype.parseInformation = function() {
        var n = new Ke;
        return this.getGeneralDecoder().decodeAllCodes(n, e.HEADER_SIZE)
    }
    ,
    e.HEADER_SIZE = 2 + 1 + 2,
    e
}(D9)
  , fwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Wp = function(t) {
    fwe(e, t);
    function e(n) {
        return t.call(this, n) || this
    }
    return e.prototype.encodeCompressedWeight = function(n, r, i) {
        var o = this.getGeneralDecoder().extractNumericValueFromBitArray(r, i);
        this.addWeightCode(n, o);
        for (var s = this.checkWeight(o), a = 1e5, l = 0; l < 5; ++l)
            s / a === 0 && n.append("0"),
            a /= 10;
        n.append(s)
    }
    ,
    e
}(Oi)
  , dwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , B9 = function(t) {
    dwe(e, t);
    function e(n) {
        return t.call(this, n) || this
    }
    return e.prototype.parseInformation = function() {
        if (this.getInformation().getSize() !== e.HEADER_SIZE + Wp.GTIN_SIZE + e.WEIGHT_SIZE)
            throw new oe;
        var n = new Ke;
        return this.encodeCompressedGtin(n, e.HEADER_SIZE),
        this.encodeCompressedWeight(n, e.HEADER_SIZE + Wp.GTIN_SIZE, e.WEIGHT_SIZE),
        n.toString()
    }
    ,
    e.HEADER_SIZE = 4 + 1,
    e.WEIGHT_SIZE = 15,
    e
}(Wp)
  , hwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , pwe = function(t) {
    hwe(e, t);
    function e(n) {
        return t.call(this, n) || this
    }
    return e.prototype.addWeightCode = function(n, r) {
        n.append("(3103)")
    }
    ,
    e.prototype.checkWeight = function(n) {
        return n
    }
    ,
    e
}(B9)
  , gwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , mwe = function(t) {
    gwe(e, t);
    function e(n) {
        return t.call(this, n) || this
    }
    return e.prototype.addWeightCode = function(n, r) {
        r < 1e4 ? n.append("(3202)") : n.append("(3203)")
    }
    ,
    e.prototype.checkWeight = function(n) {
        return n < 1e4 ? n : n - 1e4
    }
    ,
    e
}(B9)
  , vwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , ywe = function(t) {
    vwe(e, t);
    function e(n) {
        return t.call(this, n) || this
    }
    return e.prototype.parseInformation = function() {
        if (this.getInformation().getSize() < e.HEADER_SIZE + Oi.GTIN_SIZE)
            throw new oe;
        var n = new Ke;
        this.encodeCompressedGtin(n, e.HEADER_SIZE);
        var r = this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE + Oi.GTIN_SIZE, e.LAST_DIGIT_SIZE);
        n.append("(392"),
        n.append(r),
        n.append(")");
        var i = this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE + Oi.GTIN_SIZE + e.LAST_DIGIT_SIZE, null);
        return n.append(i.getNewString()),
        n.toString()
    }
    ,
    e.HEADER_SIZE = 5 + 1 + 2,
    e.LAST_DIGIT_SIZE = 2,
    e
}(Oi)
  , _we = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , xwe = function(t) {
    _we(e, t);
    function e(n) {
        return t.call(this, n) || this
    }
    return e.prototype.parseInformation = function() {
        if (this.getInformation().getSize() < e.HEADER_SIZE + Oi.GTIN_SIZE)
            throw new oe;
        var n = new Ke;
        this.encodeCompressedGtin(n, e.HEADER_SIZE);
        var r = this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE + Oi.GTIN_SIZE, e.LAST_DIGIT_SIZE);
        n.append("(393"),
        n.append(r),
        n.append(")");
        var i = this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE + Oi.GTIN_SIZE + e.LAST_DIGIT_SIZE, e.FIRST_THREE_DIGITS_SIZE);
        i / 100 === 0 && n.append("0"),
        i / 10 === 0 && n.append("0"),
        n.append(i);
        var o = this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE + Oi.GTIN_SIZE + e.LAST_DIGIT_SIZE + e.FIRST_THREE_DIGITS_SIZE, null);
        return n.append(o.getNewString()),
        n.toString()
    }
    ,
    e.HEADER_SIZE = 5 + 1 + 2,
    e.LAST_DIGIT_SIZE = 2,
    e.FIRST_THREE_DIGITS_SIZE = 10,
    e
}(Oi)
  , bwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Es = function(t) {
    bwe(e, t);
    function e(n, r, i) {
        var o = t.call(this, n) || this;
        return o.dateCode = i,
        o.firstAIdigits = r,
        o
    }
    return e.prototype.parseInformation = function() {
        if (this.getInformation().getSize() !== e.HEADER_SIZE + e.GTIN_SIZE + e.WEIGHT_SIZE + e.DATE_SIZE)
            throw new oe;
        var n = new Ke;
        return this.encodeCompressedGtin(n, e.HEADER_SIZE),
        this.encodeCompressedWeight(n, e.HEADER_SIZE + e.GTIN_SIZE, e.WEIGHT_SIZE),
        this.encodeCompressedDate(n, e.HEADER_SIZE + e.GTIN_SIZE + e.WEIGHT_SIZE),
        n.toString()
    }
    ,
    e.prototype.encodeCompressedDate = function(n, r) {
        var i = this.getGeneralDecoder().extractNumericValueFromBitArray(r, e.DATE_SIZE);
        if (i !== 38400) {
            n.append("("),
            n.append(this.dateCode),
            n.append(")");
            var o = i % 32;
            i /= 32;
            var s = i % 12 + 1;
            i /= 12;
            var a = i;
            a / 10 === 0 && n.append("0"),
            n.append(a),
            s / 10 === 0 && n.append("0"),
            n.append(s),
            o / 10 === 0 && n.append("0"),
            n.append(o)
        }
    }
    ,
    e.prototype.addWeightCode = function(n, r) {
        n.append("("),
        n.append(this.firstAIdigits),
        n.append(r / 1e5),
        n.append(")")
    }
    ,
    e.prototype.checkWeight = function(n) {
        return n % 1e5
    }
    ,
    e.HEADER_SIZE = 7 + 1,
    e.WEIGHT_SIZE = 20,
    e.DATE_SIZE = 16,
    e
}(Wp);
function wwe(t) {
    try {
        if (t.get(1))
            return new lwe(t);
        if (!t.get(2))
            return new uwe(t);
        var e = jp.extractNumericValueFromBitArray(t, 1, 4);
        switch (e) {
        case 4:
            return new pwe(t);
        case 5:
            return new mwe(t)
        }
        var n = jp.extractNumericValueFromBitArray(t, 1, 5);
        switch (n) {
        case 12:
            return new ywe(t);
        case 13:
            return new xwe(t)
        }
        var r = jp.extractNumericValueFromBitArray(t, 1, 7);
        switch (r) {
        case 56:
            return new Es(t,"310","11");
        case 57:
            return new Es(t,"320","11");
        case 58:
            return new Es(t,"310","13");
        case 59:
            return new Es(t,"320","13");
        case 60:
            return new Es(t,"310","15");
        case 61:
            return new Es(t,"320","15");
        case 62:
            return new Es(t,"310","17");
        case 63:
            return new Es(t,"320","17")
        }
    } catch (i) {
        throw console.log(i),
        new fh("unknown decoder: " + t)
    }
}
var kP = function() {
    function t(e, n, r, i) {
        this.leftchar = e,
        this.rightchar = n,
        this.finderpattern = r,
        this.maybeLast = i
    }
    return t.prototype.mayBeLast = function() {
        return this.maybeLast
    }
    ,
    t.prototype.getLeftChar = function() {
        return this.leftchar
    }
    ,
    t.prototype.getRightChar = function() {
        return this.rightchar
    }
    ,
    t.prototype.getFinderPattern = function() {
        return this.finderpattern
    }
    ,
    t.prototype.mustBeLast = function() {
        return this.rightchar == null
    }
    ,
    t.prototype.toString = function() {
        return "[ " + this.leftchar + ", " + this.rightchar + " : " + (this.finderpattern == null ? "null" : this.finderpattern.getValue()) + " ]"
    }
    ,
    t.equals = function(e, n) {
        return e instanceof t ? t.equalsOrNull(e.leftchar, n.leftchar) && t.equalsOrNull(e.rightchar, n.rightchar) && t.equalsOrNull(e.finderpattern, n.finderpattern) : !1
    }
    ,
    t.equalsOrNull = function(e, n) {
        return e === null ? n === null : t.equals(e, n)
    }
    ,
    t.prototype.hashCode = function() {
        var e = this.leftchar.getValue() ^ this.rightchar.getValue() ^ this.finderpattern.getValue();
        return e
    }
    ,
    t
}()
  , Ewe = function() {
    function t(e, n, r) {
        this.pairs = e,
        this.rowNumber = n,
        this.wasReversed = r
    }
    return t.prototype.getPairs = function() {
        return this.pairs
    }
    ,
    t.prototype.getRowNumber = function() {
        return this.rowNumber
    }
    ,
    t.prototype.isReversed = function() {
        return this.wasReversed
    }
    ,
    t.prototype.isEquivalent = function(e) {
        return this.checkEqualitity(this, e)
    }
    ,
    t.prototype.toString = function() {
        return "{ " + this.pairs + " }"
    }
    ,
    t.prototype.equals = function(e, n) {
        return e instanceof t ? this.checkEqualitity(e, n) && e.wasReversed === n.wasReversed : !1
    }
    ,
    t.prototype.checkEqualitity = function(e, n) {
        if (!(!e || !n)) {
            var r;
            return e.forEach(function(i, o) {
                n.forEach(function(s) {
                    i.getLeftChar().getValue() === s.getLeftChar().getValue() && i.getRightChar().getValue() === s.getRightChar().getValue() && i.getFinderPatter().getValue() === s.getFinderPatter().getValue() && (r = !0)
                })
            }),
            r
        }
    }
    ,
    t
}()
  , Swe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Ss = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , Cwe = function(t) {
    Swe(e, t);
    function e() {
        var n = t !== null && t.apply(this, arguments) || this;
        return n.pairs = new Array(e.MAX_PAIRS),
        n.rows = new Array,
        n.startEnd = [2],
        n
    }
    return e.prototype.decodeRow = function(n, r, i) {
        this.pairs.length = 0,
        this.startFromEven = !1;
        try {
            return e.constructResult(this.decodeRow2pairs(n, r))
        } catch {}
        return this.pairs.length = 0,
        this.startFromEven = !0,
        e.constructResult(this.decodeRow2pairs(n, r))
    }
    ,
    e.prototype.reset = function() {
        this.pairs.length = 0,
        this.rows.length = 0
    }
    ,
    e.prototype.decodeRow2pairs = function(n, r) {
        for (var i = !1; !i; )
            try {
                this.pairs.push(this.retrieveNextPair(r, this.pairs, n))
            } catch (a) {
                if (a instanceof oe) {
                    if (!this.pairs.length)
                        throw new oe;
                    i = !0
                }
            }
        if (this.checkChecksum())
            return this.pairs;
        var o;
        if (this.rows.length ? o = !0 : o = !1,
        this.storeRow(n, !1),
        o) {
            var s = this.checkRowsBoolean(!1);
            if (s != null || (s = this.checkRowsBoolean(!0),
            s != null))
                return s
        }
        throw new oe
    }
    ,
    e.prototype.checkRowsBoolean = function(n) {
        if (this.rows.length > 25)
            return this.rows.length = 0,
            null;
        this.pairs.length = 0,
        n && (this.rows = this.rows.reverse());
        var r = null;
        try {
            r = this.checkRows(new Array, 0)
        } catch (i) {
            console.log(i)
        }
        return n && (this.rows = this.rows.reverse()),
        r
    }
    ,
    e.prototype.checkRows = function(n, r) {
        for (var i, o, s = r; s < this.rows.length; s++) {
            var a = this.rows[s];
            this.pairs.length = 0;
            try {
                for (var l = (i = void 0,
                Ss(n)), c = l.next(); !c.done; c = l.next()) {
                    var u = c.value;
                    this.pairs.push(u.getPairs())
                }
            } catch (d) {
                i = {
                    error: d
                }
            } finally {
                try {
                    c && !c.done && (o = l.return) && o.call(l)
                } finally {
                    if (i)
                        throw i.error
                }
            }
            if (this.pairs.push(a.getPairs()),
            !!e.isValidSequence(this.pairs)) {
                if (this.checkChecksum())
                    return this.pairs;
                var f = new Array(n);
                f.push(a);
                try {
                    return this.checkRows(f, s + 1)
                } catch (d) {
                    console.log(d)
                }
            }
        }
        throw new oe
    }
    ,
    e.isValidSequence = function(n) {
        var r, i;
        try {
            for (var o = Ss(e.FINDER_PATTERN_SEQUENCES), s = o.next(); !s.done; s = o.next()) {
                var a = s.value;
                if (!(n.length > a.length)) {
                    for (var l = !0, c = 0; c < n.length; c++)
                        if (n[c].getFinderPattern().getValue() !== a[c]) {
                            l = !1;
                            break
                        }
                    if (l)
                        return !0
                }
            }
        } catch (u) {
            r = {
                error: u
            }
        } finally {
            try {
                s && !s.done && (i = o.return) && i.call(o)
            } finally {
                if (r)
                    throw r.error
            }
        }
        return !1
    }
    ,
    e.prototype.storeRow = function(n, r) {
        for (var i = 0, o = !1, s = !1; i < this.rows.length; ) {
            var a = this.rows[i];
            if (a.getRowNumber() > n) {
                s = a.isEquivalent(this.pairs);
                break
            }
            o = a.isEquivalent(this.pairs),
            i++
        }
        s || o || e.isPartialRow(this.pairs, this.rows) || (this.rows.push(i, new Ewe(this.pairs,n,r)),
        this.removePartialRows(this.pairs, this.rows))
    }
    ,
    e.prototype.removePartialRows = function(n, r) {
        var i, o, s, a, l, c;
        try {
            for (var u = Ss(r), f = u.next(); !f.done; f = u.next()) {
                var d = f.value;
                if (d.getPairs().length !== n.length) {
                    var h = !0;
                    try {
                        for (var p = (s = void 0,
                        Ss(d.getPairs())), y = p.next(); !y.done; y = p.next()) {
                            var v = y.value
                              , g = !1;
                            try {
                                for (var m = (l = void 0,
                                Ss(n)), _ = m.next(); !_.done; _ = m.next()) {
                                    var x = _.value;
                                    if (kP.equals(v, x)) {
                                        g = !0;
                                        break
                                    }
                                }
                            } catch (b) {
                                l = {
                                    error: b
                                }
                            } finally {
                                try {
                                    _ && !_.done && (c = m.return) && c.call(m)
                                } finally {
                                    if (l)
                                        throw l.error
                                }
                            }
                            g || (h = !1)
                        }
                    } catch (b) {
                        s = {
                            error: b
                        }
                    } finally {
                        try {
                            y && !y.done && (a = p.return) && a.call(p)
                        } finally {
                            if (s)
                                throw s.error
                        }
                    }
                }
            }
        } catch (b) {
            i = {
                error: b
            }
        } finally {
            try {
                f && !f.done && (o = u.return) && o.call(u)
            } finally {
                if (i)
                    throw i.error
            }
        }
    }
    ,
    e.isPartialRow = function(n, r) {
        var i, o, s, a, l, c;
        try {
            for (var u = Ss(r), f = u.next(); !f.done; f = u.next()) {
                var d = f.value
                  , h = !0;
                try {
                    for (var p = (s = void 0,
                    Ss(n)), y = p.next(); !y.done; y = p.next()) {
                        var v = y.value
                          , g = !1;
                        try {
                            for (var m = (l = void 0,
                            Ss(d.getPairs())), _ = m.next(); !_.done; _ = m.next()) {
                                var x = _.value;
                                if (v.equals(x)) {
                                    g = !0;
                                    break
                                }
                            }
                        } catch (b) {
                            l = {
                                error: b
                            }
                        } finally {
                            try {
                                _ && !_.done && (c = m.return) && c.call(m)
                            } finally {
                                if (l)
                                    throw l.error
                            }
                        }
                        if (!g) {
                            h = !1;
                            break
                        }
                    }
                } catch (b) {
                    s = {
                        error: b
                    }
                } finally {
                    try {
                        y && !y.done && (a = p.return) && a.call(p)
                    } finally {
                        if (s)
                            throw s.error
                    }
                }
                if (h)
                    return !0
            }
        } catch (b) {
            i = {
                error: b
            }
        } finally {
            try {
                f && !f.done && (o = u.return) && o.call(u)
            } finally {
                if (i)
                    throw i.error
            }
        }
        return !1
    }
    ,
    e.prototype.getRows = function() {
        return this.rows
    }
    ,
    e.constructResult = function(n) {
        var r = twe.buildBitArray(n)
          , i = wwe(r)
          , o = i.parseInformation()
          , s = n[0].getFinderPattern().getResultPoints()
          , a = n[n.length - 1].getFinderPattern().getResultPoints()
          , l = [s[0], s[1], a[0], a[1]];
        return new tr(o,null,null,l,Be.RSS_EXPANDED,null)
    }
    ,
    e.prototype.checkChecksum = function() {
        var n = this.pairs.get(0)
          , r = n.getLeftChar()
          , i = n.getRightChar();
        if (i === null)
            return !1;
        for (var o = i.getChecksumPortion(), s = 2, a = 1; a < this.pairs.size(); ++a) {
            var l = this.pairs.get(a);
            o += l.getLeftChar().getChecksumPortion(),
            s++;
            var c = l.getRightChar();
            c != null && (o += c.getChecksumPortion(),
            s++)
        }
        o %= 211;
        var u = 211 * (s - 4) + o;
        return u === r.getValue()
    }
    ,
    e.getNextSecondBar = function(n, r) {
        var i;
        return n.get(r) ? (i = n.getNextUnset(r),
        i = n.getNextSet(i)) : (i = n.getNextSet(r),
        i = n.getNextUnset(i)),
        i
    }
    ,
    e.prototype.retrieveNextPair = function(n, r, i) {
        var o = r.length % 2 === 0;
        this.startFromEven && (o = !o);
        var s, a = !0, l = -1;
        do
            this.findNextPair(n, r, l),
            s = this.parseFoundFinderPattern(n, i, o),
            s === null ? l = e.getNextSecondBar(n, this.startEnd[0]) : a = !1;
        while (a);
        var c = this.decodeDataCharacter(n, s, o, !0);
        if (!this.isEmptyPair(r) && r[r.length - 1].mustBeLast())
            throw new oe;
        var u;
        try {
            u = this.decodeDataCharacter(n, s, o, !1)
        } catch (f) {
            u = null,
            console.log(f)
        }
        return new kP(c,u,s,!0)
    }
    ,
    e.prototype.isEmptyPair = function(n) {
        return n.length === 0
    }
    ,
    e.prototype.findNextPair = function(n, r, i) {
        var o = this.getDecodeFinderCounters();
        o[0] = 0,
        o[1] = 0,
        o[2] = 0,
        o[3] = 0;
        var s = n.getSize(), a;
        if (i >= 0)
            a = i;
        else if (this.isEmptyPair(r))
            a = 0;
        else {
            var l = r[r.length - 1];
            a = l.getFinderPattern().getStartEnd()[1]
        }
        var c = r.length % 2 !== 0;
        this.startFromEven && (c = !c);
        for (var u = !1; a < s && (u = !n.get(a),
        !!u); )
            a++;
        for (var f = 0, d = a, h = a; h < s; h++)
            if (n.get(h) !== u)
                o[f]++;
            else {
                if (f === 3) {
                    if (c && e.reverseCounters(o),
                    e.isFinderPattern(o)) {
                        this.startEnd[0] = d,
                        this.startEnd[1] = h;
                        return
                    }
                    c && e.reverseCounters(o),
                    d += o[0] + o[1],
                    o[0] = o[2],
                    o[1] = o[3],
                    o[2] = 0,
                    o[3] = 0,
                    f--
                } else
                    f++;
                o[f] = 1,
                u = !u
            }
        throw new oe
    }
    ,
    e.reverseCounters = function(n) {
        for (var r = n.length, i = 0; i < r / 2; ++i) {
            var o = n[i];
            n[i] = n[r - i - 1],
            n[r - i - 1] = o
        }
    }
    ,
    e.prototype.parseFoundFinderPattern = function(n, r, i) {
        var o, s, a;
        if (i) {
            for (var l = this.startEnd[0] - 1; l >= 0 && !n.get(l); )
                l--;
            l++,
            o = this.startEnd[0] - l,
            s = l,
            a = this.startEnd[1]
        } else
            s = this.startEnd[0],
            a = n.getNextUnset(this.startEnd[1] + 1),
            o = a - this.startEnd[1];
        var c = this.getDecodeFinderCounters();
        It.arraycopy(c, 0, c, 1, c.length - 1),
        c[0] = o;
        var u;
        try {
            u = this.parseFinderValue(c, e.FINDER_PATTERNS)
        } catch {
            return null
        }
        return new M9(u,[s, a],s,a,r)
    }
    ,
    e.prototype.decodeDataCharacter = function(n, r, i, o) {
        for (var s = this.getDataCharacterCounters(), a = 0; a < s.length; a++)
            s[a] = 0;
        if (o)
            e.recordPatternInReverse(n, r.getStartEnd()[0], s);
        else {
            e.recordPattern(n, r.getStartEnd()[1], s);
            for (var l = 0, c = s.length - 1; l < c; l++,
            c--) {
                var u = s[l];
                s[l] = s[c],
                s[c] = u
            }
        }
        var f = 17
          , d = ft.sum(new Int32Array(s)) / f
          , h = (r.getStartEnd()[1] - r.getStartEnd()[0]) / 15;
        if (Math.abs(d - h) / h > .3)
            throw new oe;
        for (var p = this.getOddCounts(), y = this.getEvenCounts(), v = this.getOddRoundingErrors(), g = this.getEvenRoundingErrors(), l = 0; l < s.length; l++) {
            var m = 1 * s[l] / d
              , _ = m + .5;
            if (_ < 1) {
                if (m < .3)
                    throw new oe;
                _ = 1
            } else if (_ > 8) {
                if (m > 8.7)
                    throw new oe;
                _ = 8
            }
            var x = l / 2;
            l & 1 ? (y[x] = _,
            g[x] = m - _) : (p[x] = _,
            v[x] = m - _)
        }
        this.adjustOddEvenCounts(f);
        for (var b = 4 * r.getValue() + (i ? 0 : 2) + (o ? 0 : 1) - 1, w = 0, E = 0, l = p.length - 1; l >= 0; l--) {
            if (e.isNotA1left(r, i, o)) {
                var S = e.WEIGHTS[b][2 * l];
                E += p[l] * S
            }
            w += p[l]
        }
        for (var P = 0, l = y.length - 1; l >= 0; l--)
            if (e.isNotA1left(r, i, o)) {
                var S = e.WEIGHTS[b][2 * l + 1];
                P += y[l] * S
            }
        var C = E + P;
        if (w & 1 || w > 13 || w < 4)
            throw new oe;
        var A = (13 - w) / 2
          , T = e.SYMBOL_WIDEST[A]
          , I = 9 - T
          , B = _c.getRSSvalue(p, T, !0)
          , G = _c.getRSSvalue(y, I, !1)
          , N = e.EVEN_TOTAL_SUBSET[A]
          , U = e.GSUM[A]
          , W = B * N + G + U;
        return new U0(W,C)
    }
    ,
    e.isNotA1left = function(n, r, i) {
        return !(n.getValue() === 0 && r && i)
    }
    ,
    e.prototype.adjustOddEvenCounts = function(n) {
        var r = ft.sum(new Int32Array(this.getOddCounts()))
          , i = ft.sum(new Int32Array(this.getEvenCounts()))
          , o = !1
          , s = !1;
        r > 13 ? s = !0 : r < 4 && (o = !0);
        var a = !1
          , l = !1;
        i > 13 ? l = !0 : i < 4 && (a = !0);
        var c = r + i - n
          , u = (r & 1) === 1
          , f = (i & 1) === 0;
        if (c === 1)
            if (u) {
                if (f)
                    throw new oe;
                s = !0
            } else {
                if (!f)
                    throw new oe;
                l = !0
            }
        else if (c === -1)
            if (u) {
                if (f)
                    throw new oe;
                o = !0
            } else {
                if (!f)
                    throw new oe;
                a = !0
            }
        else if (c === 0) {
            if (u) {
                if (!f)
                    throw new oe;
                r < i ? (o = !0,
                l = !0) : (s = !0,
                a = !0)
            } else if (f)
                throw new oe
        } else
            throw new oe;
        if (o) {
            if (s)
                throw new oe;
            e.increment(this.getOddCounts(), this.getOddRoundingErrors())
        }
        if (s && e.decrement(this.getOddCounts(), this.getOddRoundingErrors()),
        a) {
            if (l)
                throw new oe;
            e.increment(this.getEvenCounts(), this.getOddRoundingErrors())
        }
        l && e.decrement(this.getEvenCounts(), this.getEvenRoundingErrors())
    }
    ,
    e.SYMBOL_WIDEST = [7, 5, 4, 3, 1],
    e.EVEN_TOTAL_SUBSET = [4, 20, 52, 104, 204],
    e.GSUM = [0, 348, 1388, 2948, 3988],
    e.FINDER_PATTERNS = [Int32Array.from([1, 8, 4, 1]), Int32Array.from([3, 6, 4, 1]), Int32Array.from([3, 4, 6, 1]), Int32Array.from([3, 2, 8, 1]), Int32Array.from([2, 6, 5, 1]), Int32Array.from([2, 2, 9, 1])],
    e.WEIGHTS = [[1, 3, 9, 27, 81, 32, 96, 77], [20, 60, 180, 118, 143, 7, 21, 63], [189, 145, 13, 39, 117, 140, 209, 205], [193, 157, 49, 147, 19, 57, 171, 91], [62, 186, 136, 197, 169, 85, 44, 132], [185, 133, 188, 142, 4, 12, 36, 108], [113, 128, 173, 97, 80, 29, 87, 50], [150, 28, 84, 41, 123, 158, 52, 156], [46, 138, 203, 187, 139, 206, 196, 166], [76, 17, 51, 153, 37, 111, 122, 155], [43, 129, 176, 106, 107, 110, 119, 146], [16, 48, 144, 10, 30, 90, 59, 177], [109, 116, 137, 200, 178, 112, 125, 164], [70, 210, 208, 202, 184, 130, 179, 115], [134, 191, 151, 31, 93, 68, 204, 190], [148, 22, 66, 198, 172, 94, 71, 2], [6, 18, 54, 162, 64, 192, 154, 40], [120, 149, 25, 75, 14, 42, 126, 167], [79, 26, 78, 23, 69, 207, 199, 175], [103, 98, 83, 38, 114, 131, 182, 124], [161, 61, 183, 127, 170, 88, 53, 159], [55, 165, 73, 8, 24, 72, 5, 15], [45, 135, 194, 160, 58, 174, 100, 89]],
    e.FINDER_PAT_A = 0,
    e.FINDER_PAT_B = 1,
    e.FINDER_PAT_C = 2,
    e.FINDER_PAT_D = 3,
    e.FINDER_PAT_E = 4,
    e.FINDER_PAT_F = 5,
    e.FINDER_PATTERN_SEQUENCES = [[e.FINDER_PAT_A, e.FINDER_PAT_A], [e.FINDER_PAT_A, e.FINDER_PAT_B, e.FINDER_PAT_B], [e.FINDER_PAT_A, e.FINDER_PAT_C, e.FINDER_PAT_B, e.FINDER_PAT_D], [e.FINDER_PAT_A, e.FINDER_PAT_E, e.FINDER_PAT_B, e.FINDER_PAT_D, e.FINDER_PAT_C], [e.FINDER_PAT_A, e.FINDER_PAT_E, e.FINDER_PAT_B, e.FINDER_PAT_D, e.FINDER_PAT_D, e.FINDER_PAT_F], [e.FINDER_PAT_A, e.FINDER_PAT_E, e.FINDER_PAT_B, e.FINDER_PAT_D, e.FINDER_PAT_E, e.FINDER_PAT_F, e.FINDER_PAT_F], [e.FINDER_PAT_A, e.FINDER_PAT_A, e.FINDER_PAT_B, e.FINDER_PAT_B, e.FINDER_PAT_C, e.FINDER_PAT_C, e.FINDER_PAT_D, e.FINDER_PAT_D], [e.FINDER_PAT_A, e.FINDER_PAT_A, e.FINDER_PAT_B, e.FINDER_PAT_B, e.FINDER_PAT_C, e.FINDER_PAT_C, e.FINDER_PAT_D, e.FINDER_PAT_E, e.FINDER_PAT_E], [e.FINDER_PAT_A, e.FINDER_PAT_A, e.FINDER_PAT_B, e.FINDER_PAT_B, e.FINDER_PAT_C, e.FINDER_PAT_C, e.FINDER_PAT_D, e.FINDER_PAT_E, e.FINDER_PAT_F, e.FINDER_PAT_F], [e.FINDER_PAT_A, e.FINDER_PAT_A, e.FINDER_PAT_B, e.FINDER_PAT_B, e.FINDER_PAT_C, e.FINDER_PAT_D, e.FINDER_PAT_D, e.FINDER_PAT_E, e.FINDER_PAT_E, e.FINDER_PAT_F, e.FINDER_PAT_F]],
    e.MAX_PAIRS = 11,
    e
}(Ba)
  , Awe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Twe = function(t) {
    Awe(e, t);
    function e(n, r, i) {
        var o = t.call(this, n, r) || this;
        return o.count = 0,
        o.finderPattern = i,
        o
    }
    return e.prototype.getFinderPattern = function() {
        return this.finderPattern
    }
    ,
    e.prototype.getCount = function() {
        return this.count
    }
    ,
    e.prototype.incrementCount = function() {
        this.count++
    }
    ,
    e
}(U0)
  , Pwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Iv = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , NP = function(t) {
    Pwe(e, t);
    function e() {
        var n = t !== null && t.apply(this, arguments) || this;
        return n.possibleLeftPairs = [],
        n.possibleRightPairs = [],
        n
    }
    return e.prototype.decodeRow = function(n, r, i) {
        var o, s, a, l, c = this.decodePair(r, !1, n, i);
        e.addOrTally(this.possibleLeftPairs, c),
        r.reverse();
        var u = this.decodePair(r, !0, n, i);
        e.addOrTally(this.possibleRightPairs, u),
        r.reverse();
        try {
            for (var f = Iv(this.possibleLeftPairs), d = f.next(); !d.done; d = f.next()) {
                var h = d.value;
                if (h.getCount() > 1)
                    try {
                        for (var p = (a = void 0,
                        Iv(this.possibleRightPairs)), y = p.next(); !y.done; y = p.next()) {
                            var v = y.value;
                            if (v.getCount() > 1 && e.checkChecksum(h, v))
                                return e.constructResult(h, v)
                        }
                    } catch (g) {
                        a = {
                            error: g
                        }
                    } finally {
                        try {
                            y && !y.done && (l = p.return) && l.call(p)
                        } finally {
                            if (a)
                                throw a.error
                        }
                    }
            }
        } catch (g) {
            o = {
                error: g
            }
        } finally {
            try {
                d && !d.done && (s = f.return) && s.call(f)
            } finally {
                if (o)
                    throw o.error
            }
        }
        throw new oe
    }
    ,
    e.addOrTally = function(n, r) {
        var i, o;
        if (r != null) {
            var s = !1;
            try {
                for (var a = Iv(n), l = a.next(); !l.done; l = a.next()) {
                    var c = l.value;
                    if (c.getValue() === r.getValue()) {
                        c.incrementCount(),
                        s = !0;
                        break
                    }
                }
            } catch (u) {
                i = {
                    error: u
                }
            } finally {
                try {
                    l && !l.done && (o = a.return) && o.call(a)
                } finally {
                    if (i)
                        throw i.error
                }
            }
            s || n.push(r)
        }
    }
    ,
    e.prototype.reset = function() {
        this.possibleLeftPairs.length = 0,
        this.possibleRightPairs.length = 0
    }
    ,
    e.constructResult = function(n, r) {
        for (var i = 4537077 * n.getValue() + r.getValue(), o = new String(i).toString(), s = new Ke, a = 13 - o.length; a > 0; a--)
            s.append("0");
        s.append(o);
        for (var l = 0, a = 0; a < 13; a++) {
            var c = s.charAt(a).charCodeAt(0) - "0".charCodeAt(0);
            l += a & 1 ? c : 3 * c
        }
        l = 10 - l % 10,
        l === 10 && (l = 0),
        s.append(l.toString());
        var u = n.getFinderPattern().getResultPoints()
          , f = r.getFinderPattern().getResultPoints();
        return new tr(s.toString(),null,0,[u[0], u[1], f[0], f[1]],Be.RSS_14,new Date().getTime())
    }
    ,
    e.checkChecksum = function(n, r) {
        var i = (n.getChecksumPortion() + 16 * r.getChecksumPortion()) % 79
          , o = 9 * n.getFinderPattern().getValue() + r.getFinderPattern().getValue();
        return o > 72 && o--,
        o > 8 && o--,
        i === o
    }
    ,
    e.prototype.decodePair = function(n, r, i, o) {
        try {
            var s = this.findFinderPattern(n, r)
              , a = this.parseFoundFinderPattern(n, i, r, s)
              , l = o == null ? null : o.get(Ot.NEED_RESULT_POINT_CALLBACK);
            if (l != null) {
                var c = (s[0] + s[1]) / 2;
                r && (c = n.getSize() - 1 - c),
                l.foundPossibleResultPoint(new Pe(c,i))
            }
            var u = this.decodeDataCharacter(n, a, !0)
              , f = this.decodeDataCharacter(n, a, !1);
            return new Twe(1597 * u.getValue() + f.getValue(),u.getChecksumPortion() + 4 * f.getChecksumPortion(),a)
        } catch {
            return null
        }
    }
    ,
    e.prototype.decodeDataCharacter = function(n, r, i) {
        for (var o = this.getDataCharacterCounters(), s = 0; s < o.length; s++)
            o[s] = 0;
        if (i)
            En.recordPatternInReverse(n, r.getStartEnd()[0], o);
        else {
            En.recordPattern(n, r.getStartEnd()[1] + 1, o);
            for (var a = 0, l = o.length - 1; a < l; a++,
            l--) {
                var c = o[a];
                o[a] = o[l],
                o[l] = c
            }
        }
        for (var u = i ? 16 : 15, f = ft.sum(new Int32Array(o)) / u, d = this.getOddCounts(), h = this.getEvenCounts(), p = this.getOddRoundingErrors(), y = this.getEvenRoundingErrors(), a = 0; a < o.length; a++) {
            var v = o[a] / f
              , g = Math.floor(v + .5);
            g < 1 ? g = 1 : g > 8 && (g = 8);
            var m = Math.floor(a / 2);
            a & 1 ? (h[m] = g,
            y[m] = v - g) : (d[m] = g,
            p[m] = v - g)
        }
        this.adjustOddEvenCounts(i, u);
        for (var _ = 0, x = 0, a = d.length - 1; a >= 0; a--)
            x *= 9,
            x += d[a],
            _ += d[a];
        for (var b = 0, w = 0, a = h.length - 1; a >= 0; a--)
            b *= 9,
            b += h[a],
            w += h[a];
        var E = x + 3 * b;
        if (i) {
            if (_ & 1 || _ > 12 || _ < 4)
                throw new oe;
            var S = (12 - _) / 2
              , P = e.OUTSIDE_ODD_WIDEST[S]
              , C = 9 - P
              , A = _c.getRSSvalue(d, P, !1)
              , T = _c.getRSSvalue(h, C, !0)
              , I = e.OUTSIDE_EVEN_TOTAL_SUBSET[S]
              , B = e.OUTSIDE_GSUM[S];
            return new U0(A * I + T + B,E)
        } else {
            if (w & 1 || w > 10 || w < 4)
                throw new oe;
            var S = (10 - w) / 2
              , P = e.INSIDE_ODD_WIDEST[S]
              , C = 9 - P
              , A = _c.getRSSvalue(d, P, !0)
              , T = _c.getRSSvalue(h, C, !1)
              , G = e.INSIDE_ODD_TOTAL_SUBSET[S]
              , B = e.INSIDE_GSUM[S];
            return new U0(T * G + A + B,E)
        }
    }
    ,
    e.prototype.findFinderPattern = function(n, r) {
        var i = this.getDecodeFinderCounters();
        i[0] = 0,
        i[1] = 0,
        i[2] = 0,
        i[3] = 0;
        for (var o = n.getSize(), s = !1, a = 0; a < o && (s = !n.get(a),
        r !== s); )
            a++;
        for (var l = 0, c = a, u = a; u < o; u++)
            if (n.get(u) !== s)
                i[l]++;
            else {
                if (l === 3) {
                    if (Ba.isFinderPattern(i))
                        return [c, u];
                    c += i[0] + i[1],
                    i[0] = i[2],
                    i[1] = i[3],
                    i[2] = 0,
                    i[3] = 0,
                    l--
                } else
                    l++;
                i[l] = 1,
                s = !s
            }
        throw new oe
    }
    ,
    e.prototype.parseFoundFinderPattern = function(n, r, i, o) {
        for (var s = n.get(o[0]), a = o[0] - 1; a >= 0 && s !== n.get(a); )
            a--;
        a++;
        var l = o[0] - a
          , c = this.getDecodeFinderCounters()
          , u = new Int32Array(c.length);
        It.arraycopy(c, 0, u, 1, c.length - 1),
        u[0] = l;
        var f = this.parseFinderValue(u, e.FINDER_PATTERNS)
          , d = a
          , h = o[1];
        return i && (d = n.getSize() - 1 - d,
        h = n.getSize() - 1 - h),
        new M9(f,[a, o[1]],d,h,r)
    }
    ,
    e.prototype.adjustOddEvenCounts = function(n, r) {
        var i = ft.sum(new Int32Array(this.getOddCounts()))
          , o = ft.sum(new Int32Array(this.getEvenCounts()))
          , s = !1
          , a = !1
          , l = !1
          , c = !1;
        n ? (i > 12 ? a = !0 : i < 4 && (s = !0),
        o > 12 ? c = !0 : o < 4 && (l = !0)) : (i > 11 ? a = !0 : i < 5 && (s = !0),
        o > 10 ? c = !0 : o < 4 && (l = !0));
        var u = i + o - r
          , f = (i & 1) === (n ? 1 : 0)
          , d = (o & 1) === 1;
        if (u === 1)
            if (f) {
                if (d)
                    throw new oe;
                a = !0
            } else {
                if (!d)
                    throw new oe;
                c = !0
            }
        else if (u === -1)
            if (f) {
                if (d)
                    throw new oe;
                s = !0
            } else {
                if (!d)
                    throw new oe;
                l = !0
            }
        else if (u === 0) {
            if (f) {
                if (!d)
                    throw new oe;
                i < o ? (s = !0,
                c = !0) : (a = !0,
                l = !0)
            } else if (d)
                throw new oe
        } else
            throw new oe;
        if (s) {
            if (a)
                throw new oe;
            Ba.increment(this.getOddCounts(), this.getOddRoundingErrors())
        }
        if (a && Ba.decrement(this.getOddCounts(), this.getOddRoundingErrors()),
        l) {
            if (c)
                throw new oe;
            Ba.increment(this.getEvenCounts(), this.getOddRoundingErrors())
        }
        c && Ba.decrement(this.getEvenCounts(), this.getEvenRoundingErrors())
    }
    ,
    e.OUTSIDE_EVEN_TOTAL_SUBSET = [1, 10, 34, 70, 126],
    e.INSIDE_ODD_TOTAL_SUBSET = [4, 20, 48, 81],
    e.OUTSIDE_GSUM = [0, 161, 961, 2015, 2715],
    e.INSIDE_GSUM = [0, 336, 1036, 1516],
    e.OUTSIDE_ODD_WIDEST = [8, 6, 4, 3, 1],
    e.INSIDE_ODD_WIDEST = [2, 4, 6, 8],
    e.FINDER_PATTERNS = [Int32Array.from([3, 8, 2, 1]), Int32Array.from([3, 5, 5, 1]), Int32Array.from([3, 3, 7, 1]), Int32Array.from([3, 1, 9, 1]), Int32Array.from([2, 7, 4, 1]), Int32Array.from([2, 5, 6, 1]), Int32Array.from([2, 3, 8, 1]), Int32Array.from([1, 5, 7, 1]), Int32Array.from([1, 3, 9, 1])],
    e
}(Ba)
  , Iwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , xc = function(t) {
    Iwe(e, t);
    function e(n) {
        var r = t.call(this) || this;
        r.readers = [];
        var i = n ? n.get(Ot.POSSIBLE_FORMATS) : null
          , o = n && n.get(Ot.ASSUME_CODE_39_CHECK_DIGIT) !== void 0
          , s = n && n.get(Ot.ENABLE_CODE_39_EXTENDED_MODE) !== void 0;
        return i && ((i.includes(Be.EAN_13) || i.includes(Be.UPC_A) || i.includes(Be.EAN_8) || i.includes(Be.UPC_E)) && r.readers.push(new Pv(n)),
        i.includes(Be.CODE_39) && r.readers.push(new AP(o,s)),
        i.includes(Be.CODE_93) && r.readers.push(new TP),
        i.includes(Be.CODE_128) && r.readers.push(new CP),
        i.includes(Be.ITF) && r.readers.push(new PP),
        i.includes(Be.CODABAR) && r.readers.push(new Zbe),
        i.includes(Be.RSS_14) && r.readers.push(new NP),
        i.includes(Be.RSS_EXPANDED) && (console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),
        r.readers.push(new Cwe))),
        r.readers.length === 0 && (r.readers.push(new Pv(n)),
        r.readers.push(new AP),
        r.readers.push(new TP),
        r.readers.push(new Pv(n)),
        r.readers.push(new CP),
        r.readers.push(new PP),
        r.readers.push(new NP)),
        r
    }
    return e.prototype.decodeRow = function(n, r, i) {
        for (var o = 0; o < this.readers.length; o++)
            try {
                return this.readers[o].decodeRow(n, r, i)
            } catch {}
        throw new oe
    }
    ,
    e.prototype.reset = function() {
        this.readers.forEach(function(n) {
            return n.reset()
        })
    }
    ,
    e
}(En)
  , Owe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    Owe(e, t);
    function e(n, r) {
        return n === void 0 && (n = 500),
        t.call(this, new xc(r), n, r) || this
    }
    return e
}
)(Eu);
var FP = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, gt = function() {
    function t(e, n, r) {
        this.ecCodewords = e,
        this.ecBlocks = [n],
        r && this.ecBlocks.push(r)
    }
    return t.prototype.getECCodewords = function() {
        return this.ecCodewords
    }
    ,
    t.prototype.getECBlocks = function() {
        return this.ecBlocks
    }
    ,
    t
}(), dt = function() {
    function t(e, n) {
        this.count = e,
        this.dataCodewords = n
    }
    return t.prototype.getCount = function() {
        return this.count
    }
    ,
    t.prototype.getDataCodewords = function() {
        return this.dataCodewords
    }
    ,
    t
}(), Rwe = function() {
    function t(e, n, r, i, o, s) {
        var a, l;
        this.versionNumber = e,
        this.symbolSizeRows = n,
        this.symbolSizeColumns = r,
        this.dataRegionSizeRows = i,
        this.dataRegionSizeColumns = o,
        this.ecBlocks = s;
        var c = 0
          , u = s.getECCodewords()
          , f = s.getECBlocks();
        try {
            for (var d = FP(f), h = d.next(); !h.done; h = d.next()) {
                var p = h.value;
                c += p.getCount() * (p.getDataCodewords() + u)
            }
        } catch (y) {
            a = {
                error: y
            }
        } finally {
            try {
                h && !h.done && (l = d.return) && l.call(d)
            } finally {
                if (a)
                    throw a.error
            }
        }
        this.totalCodewords = c
    }
    return t.prototype.getVersionNumber = function() {
        return this.versionNumber
    }
    ,
    t.prototype.getSymbolSizeRows = function() {
        return this.symbolSizeRows
    }
    ,
    t.prototype.getSymbolSizeColumns = function() {
        return this.symbolSizeColumns
    }
    ,
    t.prototype.getDataRegionSizeRows = function() {
        return this.dataRegionSizeRows
    }
    ,
    t.prototype.getDataRegionSizeColumns = function() {
        return this.dataRegionSizeColumns
    }
    ,
    t.prototype.getTotalCodewords = function() {
        return this.totalCodewords
    }
    ,
    t.prototype.getECBlocks = function() {
        return this.ecBlocks
    }
    ,
    t.getVersionForDimensions = function(e, n) {
        var r, i;
        if (e & 1 || n & 1)
            throw new me;
        try {
            for (var o = FP(t.VERSIONS), s = o.next(); !s.done; s = o.next()) {
                var a = s.value;
                if (a.symbolSizeRows === e && a.symbolSizeColumns === n)
                    return a
            }
        } catch (l) {
            r = {
                error: l
            }
        } finally {
            try {
                s && !s.done && (i = o.return) && i.call(o)
            } finally {
                if (r)
                    throw r.error
            }
        }
        throw new me
    }
    ,
    t.prototype.toString = function() {
        return "" + this.versionNumber
    }
    ,
    t.buildVersions = function() {
        return [new t(1,10,10,8,8,new gt(5,new dt(1,3))), new t(2,12,12,10,10,new gt(7,new dt(1,5))), new t(3,14,14,12,12,new gt(10,new dt(1,8))), new t(4,16,16,14,14,new gt(12,new dt(1,12))), new t(5,18,18,16,16,new gt(14,new dt(1,18))), new t(6,20,20,18,18,new gt(18,new dt(1,22))), new t(7,22,22,20,20,new gt(20,new dt(1,30))), new t(8,24,24,22,22,new gt(24,new dt(1,36))), new t(9,26,26,24,24,new gt(28,new dt(1,44))), new t(10,32,32,14,14,new gt(36,new dt(1,62))), new t(11,36,36,16,16,new gt(42,new dt(1,86))), new t(12,40,40,18,18,new gt(48,new dt(1,114))), new t(13,44,44,20,20,new gt(56,new dt(1,144))), new t(14,48,48,22,22,new gt(68,new dt(1,174))), new t(15,52,52,24,24,new gt(42,new dt(2,102))), new t(16,64,64,14,14,new gt(56,new dt(2,140))), new t(17,72,72,16,16,new gt(36,new dt(4,92))), new t(18,80,80,18,18,new gt(48,new dt(4,114))), new t(19,88,88,20,20,new gt(56,new dt(4,144))), new t(20,96,96,22,22,new gt(68,new dt(4,174))), new t(21,104,104,24,24,new gt(56,new dt(6,136))), new t(22,120,120,18,18,new gt(68,new dt(6,175))), new t(23,132,132,20,20,new gt(62,new dt(8,163))), new t(24,144,144,22,22,new gt(62,new dt(8,156),new dt(2,155))), new t(25,8,18,6,16,new gt(7,new dt(1,5))), new t(26,8,32,6,14,new gt(11,new dt(1,10))), new t(27,12,26,10,24,new gt(14,new dt(1,16))), new t(28,12,36,10,16,new gt(18,new dt(1,22))), new t(29,16,36,14,16,new gt(24,new dt(1,32))), new t(30,16,48,14,22,new gt(28,new dt(1,49)))]
    }
    ,
    t.VERSIONS = t.buildVersions(),
    t
}(), Mwe = function() {
    function t(e) {
        var n = e.getHeight();
        if (n < 8 || n > 144 || n & 1)
            throw new me;
        this.version = t.readVersion(e),
        this.mappingBitMatrix = this.extractDataRegion(e),
        this.readMappingMatrix = new xo(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())
    }
    return t.prototype.getVersion = function() {
        return this.version
    }
    ,
    t.readVersion = function(e) {
        var n = e.getHeight()
          , r = e.getWidth();
        return Rwe.getVersionForDimensions(n, r)
    }
    ,
    t.prototype.readCodewords = function() {
        var e = new Int8Array(this.version.getTotalCodewords())
          , n = 0
          , r = 4
          , i = 0
          , o = this.mappingBitMatrix.getHeight()
          , s = this.mappingBitMatrix.getWidth()
          , a = !1
          , l = !1
          , c = !1
          , u = !1;
        do
            if (r === o && i === 0 && !a)
                e[n++] = this.readCorner1(o, s) & 255,
                r -= 2,
                i += 2,
                a = !0;
            else if (r === o - 2 && i === 0 && s & 3 && !l)
                e[n++] = this.readCorner2(o, s) & 255,
                r -= 2,
                i += 2,
                l = !0;
            else if (r === o + 4 && i === 2 && !(s & 7) && !c)
                e[n++] = this.readCorner3(o, s) & 255,
                r -= 2,
                i += 2,
                c = !0;
            else if (r === o - 2 && i === 0 && (s & 7) === 4 && !u)
                e[n++] = this.readCorner4(o, s) & 255,
                r -= 2,
                i += 2,
                u = !0;
            else {
                do
                    r < o && i >= 0 && !this.readMappingMatrix.get(i, r) && (e[n++] = this.readUtah(r, i, o, s) & 255),
                    r -= 2,
                    i += 2;
                while (r >= 0 && i < s);
                r += 1,
                i += 3;
                do
                    r >= 0 && i < s && !this.readMappingMatrix.get(i, r) && (e[n++] = this.readUtah(r, i, o, s) & 255),
                    r += 2,
                    i -= 2;
                while (r < o && i >= 0);
                r += 3,
                i += 1
            }
        while (r < o || i < s);
        if (n !== this.version.getTotalCodewords())
            throw new me;
        return e
    }
    ,
    t.prototype.readModule = function(e, n, r, i) {
        return e < 0 && (e += r,
        n += 4 - (r + 4 & 7)),
        n < 0 && (n += i,
        e += 4 - (i + 4 & 7)),
        this.readMappingMatrix.set(n, e),
        this.mappingBitMatrix.get(n, e)
    }
    ,
    t.prototype.readUtah = function(e, n, r, i) {
        var o = 0;
        return this.readModule(e - 2, n - 2, r, i) && (o |= 1),
        o <<= 1,
        this.readModule(e - 2, n - 1, r, i) && (o |= 1),
        o <<= 1,
        this.readModule(e - 1, n - 2, r, i) && (o |= 1),
        o <<= 1,
        this.readModule(e - 1, n - 1, r, i) && (o |= 1),
        o <<= 1,
        this.readModule(e - 1, n, r, i) && (o |= 1),
        o <<= 1,
        this.readModule(e, n - 2, r, i) && (o |= 1),
        o <<= 1,
        this.readModule(e, n - 1, r, i) && (o |= 1),
        o <<= 1,
        this.readModule(e, n, r, i) && (o |= 1),
        o
    }
    ,
    t.prototype.readCorner1 = function(e, n) {
        var r = 0;
        return this.readModule(e - 1, 0, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(e - 1, 1, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(e - 1, 2, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 2, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 1, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(1, n - 1, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(2, n - 1, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(3, n - 1, e, n) && (r |= 1),
        r
    }
    ,
    t.prototype.readCorner2 = function(e, n) {
        var r = 0;
        return this.readModule(e - 3, 0, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(e - 2, 0, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(e - 1, 0, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 4, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 3, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 2, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 1, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(1, n - 1, e, n) && (r |= 1),
        r
    }
    ,
    t.prototype.readCorner3 = function(e, n) {
        var r = 0;
        return this.readModule(e - 1, 0, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(e - 1, n - 1, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 3, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 2, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 1, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(1, n - 3, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(1, n - 2, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(1, n - 1, e, n) && (r |= 1),
        r
    }
    ,
    t.prototype.readCorner4 = function(e, n) {
        var r = 0;
        return this.readModule(e - 3, 0, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(e - 2, 0, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(e - 1, 0, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 2, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(0, n - 1, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(1, n - 1, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(2, n - 1, e, n) && (r |= 1),
        r <<= 1,
        this.readModule(3, n - 1, e, n) && (r |= 1),
        r
    }
    ,
    t.prototype.extractDataRegion = function(e) {
        var n = this.version.getSymbolSizeRows()
          , r = this.version.getSymbolSizeColumns();
        if (e.getHeight() !== n)
            throw new ke("Dimension of bitMatrix must match the version size");
        for (var i = this.version.getDataRegionSizeRows(), o = this.version.getDataRegionSizeColumns(), s = n / i | 0, a = r / o | 0, l = s * i, c = a * o, u = new xo(c,l), f = 0; f < s; ++f)
            for (var d = f * i, h = 0; h < a; ++h)
                for (var p = h * o, y = 0; y < i; ++y)
                    for (var v = f * (i + 2) + 1 + y, g = d + y, m = 0; m < o; ++m) {
                        var _ = h * (o + 2) + 1 + m;
                        if (e.get(_, v)) {
                            var x = p + m;
                            u.set(x, g)
                        }
                    }
        return u
    }
    ,
    t
}(), LP = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, Dwe = function() {
    function t(e, n) {
        this.numDataCodewords = e,
        this.codewords = n
    }
    return t.getDataBlocks = function(e, n) {
        var r, i, o, s, a = n.getECBlocks(), l = 0, c = a.getECBlocks();
        try {
            for (var u = LP(c), f = u.next(); !f.done; f = u.next()) {
                var d = f.value;
                l += d.getCount()
            }
        } catch (B) {
            r = {
                error: B
            }
        } finally {
            try {
                f && !f.done && (i = u.return) && i.call(u)
            } finally {
                if (r)
                    throw r.error
            }
        }
        var h = new Array(l)
          , p = 0;
        try {
            for (var y = LP(c), v = y.next(); !v.done; v = y.next())
                for (var d = v.value, g = 0; g < d.getCount(); g++) {
                    var m = d.getDataCodewords()
                      , _ = a.getECCodewords() + m;
                    h[p++] = new t(m,new Uint8Array(_))
                }
        } catch (B) {
            o = {
                error: B
            }
        } finally {
            try {
                v && !v.done && (s = y.return) && s.call(y)
            } finally {
                if (o)
                    throw o.error
            }
        }
        for (var x = h[0].codewords.length, b = x - a.getECCodewords(), w = b - 1, E = 0, g = 0; g < w; g++)
            for (var S = 0; S < p; S++)
                h[S].codewords[g] = e[E++];
        for (var P = n.getVersionNumber() === 24, C = P ? 8 : p, S = 0; S < C; S++)
            h[S].codewords[b - 1] = e[E++];
        for (var A = h[0].codewords.length, g = b; g < A; g++)
            for (var S = 0; S < p; S++) {
                var T = P ? (S + 8) % p : S
                  , I = P && T > 7 ? g - 1 : g;
                h[T].codewords[I] = e[E++]
            }
        if (E !== e.length)
            throw new ke;
        return h
    }
    ,
    t.prototype.getNumDataCodewords = function() {
        return this.numDataCodewords
    }
    ,
    t.prototype.getCodewords = function() {
        return this.codewords
    }
    ,
    t
}(), k9 = function() {
    function t(e) {
        this.bytes = e,
        this.byteOffset = 0,
        this.bitOffset = 0
    }
    return t.prototype.getBitOffset = function() {
        return this.bitOffset
    }
    ,
    t.prototype.getByteOffset = function() {
        return this.byteOffset
    }
    ,
    t.prototype.readBits = function(e) {
        if (e < 1 || e > 32 || e > this.available())
            throw new ke("" + e);
        var n = 0
          , r = this.bitOffset
          , i = this.byteOffset
          , o = this.bytes;
        if (r > 0) {
            var s = 8 - r
              , a = e < s ? e : s
              , l = s - a
              , c = 255 >> 8 - a << l;
            n = (o[i] & c) >> l,
            e -= a,
            r += a,
            r === 8 && (r = 0,
            i++)
        }
        if (e > 0) {
            for (; e >= 8; )
                n = n << 8 | o[i] & 255,
                i++,
                e -= 8;
            if (e > 0) {
                var l = 8 - e
                  , c = 255 >> l << l;
                n = n << e | (o[i] & c) >> l,
                r += e
            }
        }
        return this.bitOffset = r,
        this.byteOffset = i,
        n
    }
    ,
    t.prototype.available = function() {
        return 8 * (this.bytes.length - this.byteOffset) - this.bitOffset
    }
    ,
    t
}(), gn;
(function(t) {
    t[t.PAD_ENCODE = 0] = "PAD_ENCODE",
    t[t.ASCII_ENCODE = 1] = "ASCII_ENCODE",
    t[t.C40_ENCODE = 2] = "C40_ENCODE",
    t[t.TEXT_ENCODE = 3] = "TEXT_ENCODE",
    t[t.ANSIX12_ENCODE = 4] = "ANSIX12_ENCODE",
    t[t.EDIFACT_ENCODE = 5] = "EDIFACT_ENCODE",
    t[t.BASE256_ENCODE = 6] = "BASE256_ENCODE"
}
)(gn || (gn = {}));
var Bwe = function() {
    function t() {}
    return t.decode = function(e) {
        var n = new k9(e)
          , r = new Ke
          , i = new Ke
          , o = new Array
          , s = gn.ASCII_ENCODE;
        do
            if (s === gn.ASCII_ENCODE)
                s = this.decodeAsciiSegment(n, r, i);
            else {
                switch (s) {
                case gn.C40_ENCODE:
                    this.decodeC40Segment(n, r);
                    break;
                case gn.TEXT_ENCODE:
                    this.decodeTextSegment(n, r);
                    break;
                case gn.ANSIX12_ENCODE:
                    this.decodeAnsiX12Segment(n, r);
                    break;
                case gn.EDIFACT_ENCODE:
                    this.decodeEdifactSegment(n, r);
                    break;
                case gn.BASE256_ENCODE:
                    this.decodeBase256Segment(n, r, o);
                    break;
                default:
                    throw new me
                }
                s = gn.ASCII_ENCODE
            }
        while (s !== gn.PAD_ENCODE && n.available() > 0);
        return i.length() > 0 && r.append(i.toString()),
        new ym(e,r.toString(),o.length === 0 ? null : o,null)
    }
    ,
    t.decodeAsciiSegment = function(e, n, r) {
        var i = !1;
        do {
            var o = e.readBits(8);
            if (o === 0)
                throw new me;
            if (o <= 128)
                return i && (o += 128),
                n.append(String.fromCharCode(o - 1)),
                gn.ASCII_ENCODE;
            if (o === 129)
                return gn.PAD_ENCODE;
            if (o <= 229) {
                var s = o - 130;
                s < 10 && n.append("0"),
                n.append("" + s)
            } else
                switch (o) {
                case 230:
                    return gn.C40_ENCODE;
                case 231:
                    return gn.BASE256_ENCODE;
                case 232:
                    n.append(String.fromCharCode(29));
                    break;
                case 233:
                case 234:
                    break;
                case 235:
                    i = !0;
                    break;
                case 236:
                    n.append("[)>05"),
                    r.insert(0, "");
                    break;
                case 237:
                    n.append("[)>06"),
                    r.insert(0, "");
                    break;
                case 238:
                    return gn.ANSIX12_ENCODE;
                case 239:
                    return gn.TEXT_ENCODE;
                case 240:
                    return gn.EDIFACT_ENCODE;
                case 241:
                    break;
                default:
                    if (o !== 254 || e.available() !== 0)
                        throw new me;
                    break
                }
        } while (e.available() > 0);
        return gn.ASCII_ENCODE
    }
    ,
    t.decodeC40Segment = function(e, n) {
        var r = !1
          , i = []
          , o = 0;
        do {
            if (e.available() === 8)
                return;
            var s = e.readBits(8);
            if (s === 254)
                return;
            this.parseTwoBytes(s, e.readBits(8), i);
            for (var a = 0; a < 3; a++) {
                var l = i[a];
                switch (o) {
                case 0:
                    if (l < 3)
                        o = l + 1;
                    else if (l < this.C40_BASIC_SET_CHARS.length) {
                        var c = this.C40_BASIC_SET_CHARS[l];
                        r ? (n.append(String.fromCharCode(c.charCodeAt(0) + 128)),
                        r = !1) : n.append(c)
                    } else
                        throw new me;
                    break;
                case 1:
                    r ? (n.append(String.fromCharCode(l + 128)),
                    r = !1) : n.append(String.fromCharCode(l)),
                    o = 0;
                    break;
                case 2:
                    if (l < this.C40_SHIFT2_SET_CHARS.length) {
                        var c = this.C40_SHIFT2_SET_CHARS[l];
                        r ? (n.append(String.fromCharCode(c.charCodeAt(0) + 128)),
                        r = !1) : n.append(c)
                    } else
                        switch (l) {
                        case 27:
                            n.append(String.fromCharCode(29));
                            break;
                        case 30:
                            r = !0;
                            break;
                        default:
                            throw new me
                        }
                    o = 0;
                    break;
                case 3:
                    r ? (n.append(String.fromCharCode(l + 224)),
                    r = !1) : n.append(String.fromCharCode(l + 96)),
                    o = 0;
                    break;
                default:
                    throw new me
                }
            }
        } while (e.available() > 0)
    }
    ,
    t.decodeTextSegment = function(e, n) {
        var r = !1
          , i = []
          , o = 0;
        do {
            if (e.available() === 8)
                return;
            var s = e.readBits(8);
            if (s === 254)
                return;
            this.parseTwoBytes(s, e.readBits(8), i);
            for (var a = 0; a < 3; a++) {
                var l = i[a];
                switch (o) {
                case 0:
                    if (l < 3)
                        o = l + 1;
                    else if (l < this.TEXT_BASIC_SET_CHARS.length) {
                        var c = this.TEXT_BASIC_SET_CHARS[l];
                        r ? (n.append(String.fromCharCode(c.charCodeAt(0) + 128)),
                        r = !1) : n.append(c)
                    } else
                        throw new me;
                    break;
                case 1:
                    r ? (n.append(String.fromCharCode(l + 128)),
                    r = !1) : n.append(String.fromCharCode(l)),
                    o = 0;
                    break;
                case 2:
                    if (l < this.TEXT_SHIFT2_SET_CHARS.length) {
                        var c = this.TEXT_SHIFT2_SET_CHARS[l];
                        r ? (n.append(String.fromCharCode(c.charCodeAt(0) + 128)),
                        r = !1) : n.append(c)
                    } else
                        switch (l) {
                        case 27:
                            n.append(String.fromCharCode(29));
                            break;
                        case 30:
                            r = !0;
                            break;
                        default:
                            throw new me
                        }
                    o = 0;
                    break;
                case 3:
                    if (l < this.TEXT_SHIFT3_SET_CHARS.length) {
                        var c = this.TEXT_SHIFT3_SET_CHARS[l];
                        r ? (n.append(String.fromCharCode(c.charCodeAt(0) + 128)),
                        r = !1) : n.append(c),
                        o = 0
                    } else
                        throw new me;
                    break;
                default:
                    throw new me
                }
            }
        } while (e.available() > 0)
    }
    ,
    t.decodeAnsiX12Segment = function(e, n) {
        var r = [];
        do {
            if (e.available() === 8)
                return;
            var i = e.readBits(8);
            if (i === 254)
                return;
            this.parseTwoBytes(i, e.readBits(8), r);
            for (var o = 0; o < 3; o++) {
                var s = r[o];
                switch (s) {
                case 0:
                    n.append("\r");
                    break;
                case 1:
                    n.append("*");
                    break;
                case 2:
                    n.append(">");
                    break;
                case 3:
                    n.append(" ");
                    break;
                default:
                    if (s < 14)
                        n.append(String.fromCharCode(s + 44));
                    else if (s < 40)
                        n.append(String.fromCharCode(s + 51));
                    else
                        throw new me;
                    break
                }
            }
        } while (e.available() > 0)
    }
    ,
    t.parseTwoBytes = function(e, n, r) {
        var i = (e << 8) + n - 1
          , o = Math.floor(i / 1600);
        r[0] = o,
        i -= o * 1600,
        o = Math.floor(i / 40),
        r[1] = o,
        r[2] = i - o * 40
    }
    ,
    t.decodeEdifactSegment = function(e, n) {
        do {
            if (e.available() <= 16)
                return;
            for (var r = 0; r < 4; r++) {
                var i = e.readBits(6);
                if (i === 31) {
                    var o = 8 - e.getBitOffset();
                    o !== 8 && e.readBits(o);
                    return
                }
                i & 32 || (i |= 64),
                n.append(String.fromCharCode(i))
            }
        } while (e.available() > 0)
    }
    ,
    t.decodeBase256Segment = function(e, n, r) {
        var i = 1 + e.getByteOffset(), o = this.unrandomize255State(e.readBits(8), i++), s;
        if (o === 0 ? s = e.available() / 8 | 0 : o < 250 ? s = o : s = 250 * (o - 249) + this.unrandomize255State(e.readBits(8), i++),
        s < 0)
            throw new me;
        for (var a = new Uint8Array(s), l = 0; l < s; l++) {
            if (e.available() < 8)
                throw new me;
            a[l] = this.unrandomize255State(e.readBits(8), i++)
        }
        r.push(a);
        try {
            n.append(mi.decode(a, nt.ISO88591))
        } catch (c) {
            throw new fh("Platform does not support required encoding: " + c.message)
        }
    }
    ,
    t.unrandomize255State = function(e, n) {
        var r = 149 * n % 255 + 1
          , i = e - r;
        return i >= 0 ? i : i + 256
    }
    ,
    t.C40_BASIC_SET_CHARS = ["*", "*", "*", " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"],
    t.C40_SHIFT2_SET_CHARS = ["!", '"', "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", ":", ";", "<", "=", ">", "?", "@", "[", "\\", "]", "^", "_"],
    t.TEXT_BASIC_SET_CHARS = ["*", "*", "*", " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"],
    t.TEXT_SHIFT2_SET_CHARS = t.C40_SHIFT2_SET_CHARS,
    t.TEXT_SHIFT3_SET_CHARS = ["`", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "{", "|", "}", "~", String.fromCharCode(127)],
    t
}()
  , kwe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , Nwe = function() {
    function t() {
        this.rsDecoder = new _m(Sr.DATA_MATRIX_FIELD_256)
    }
    return t.prototype.decode = function(e) {
        var n, r, i = new Mwe(e), o = i.getVersion(), s = i.readCodewords(), a = Dwe.getDataBlocks(s, o), l = 0;
        try {
            for (var c = kwe(a), u = c.next(); !u.done; u = c.next()) {
                var f = u.value;
                l += f.getNumDataCodewords()
            }
        } catch (_) {
            n = {
                error: _
            }
        } finally {
            try {
                u && !u.done && (r = c.return) && r.call(c)
            } finally {
                if (n)
                    throw n.error
            }
        }
        for (var d = new Uint8Array(l), h = a.length, p = 0; p < h; p++) {
            var y = a[p]
              , v = y.getCodewords()
              , g = y.getNumDataCodewords();
            this.correctErrors(v, g);
            for (var m = 0; m < g; m++)
                d[m * h + p] = v[m]
        }
        return Bwe.decode(d)
    }
    ,
    t.prototype.correctErrors = function(e, n) {
        var r = new Int32Array(e);
        try {
            this.rsDecoder.decode(r, e.length - n)
        } catch {
            throw new fn
        }
        for (var i = 0; i < n; i++)
            e[i] = r[i]
    }
    ,
    t
}()
  , Fwe = function() {
    function t(e) {
        this.image = e,
        this.rectangleDetector = new Cx(this.image)
    }
    return t.prototype.detect = function() {
        var e = this.rectangleDetector.detect()
          , n = this.detectSolid1(e);
        if (n = this.detectSolid2(n),
        n[3] = this.correctTopRight(n),
        !n[3])
            throw new oe;
        n = this.shiftToModuleCenter(n);
        var r = n[0]
          , i = n[1]
          , o = n[2]
          , s = n[3]
          , a = this.transitionsBetween(r, s) + 1
          , l = this.transitionsBetween(o, s) + 1;
        (a & 1) === 1 && (a += 1),
        (l & 1) === 1 && (l += 1),
        4 * a < 7 * l && 4 * l < 7 * a && (a = l = Math.max(a, l));
        var c = t.sampleGrid(this.image, r, i, o, s, a, l);
        return new cE(c,[r, i, o, s])
    }
    ,
    t.shiftPoint = function(e, n, r) {
        var i = (n.getX() - e.getX()) / (r + 1)
          , o = (n.getY() - e.getY()) / (r + 1);
        return new Pe(e.getX() + i,e.getY() + o)
    }
    ,
    t.moveAway = function(e, n, r) {
        var i = e.getX()
          , o = e.getY();
        return i < n ? i -= 1 : i += 1,
        o < r ? o -= 1 : o += 1,
        new Pe(i,o)
    }
    ,
    t.prototype.detectSolid1 = function(e) {
        var n = e[0]
          , r = e[1]
          , i = e[3]
          , o = e[2]
          , s = this.transitionsBetween(n, r)
          , a = this.transitionsBetween(r, i)
          , l = this.transitionsBetween(i, o)
          , c = this.transitionsBetween(o, n)
          , u = s
          , f = [o, n, r, i];
        return u > a && (u = a,
        f[0] = n,
        f[1] = r,
        f[2] = i,
        f[3] = o),
        u > l && (u = l,
        f[0] = r,
        f[1] = i,
        f[2] = o,
        f[3] = n),
        u > c && (f[0] = i,
        f[1] = o,
        f[2] = n,
        f[3] = r),
        f
    }
    ,
    t.prototype.detectSolid2 = function(e) {
        var n = e[0]
          , r = e[1]
          , i = e[2]
          , o = e[3]
          , s = this.transitionsBetween(n, o)
          , a = t.shiftPoint(r, i, (s + 1) * 4)
          , l = t.shiftPoint(i, r, (s + 1) * 4)
          , c = this.transitionsBetween(a, n)
          , u = this.transitionsBetween(l, o);
        return c < u ? (e[0] = n,
        e[1] = r,
        e[2] = i,
        e[3] = o) : (e[0] = r,
        e[1] = i,
        e[2] = o,
        e[3] = n),
        e
    }
    ,
    t.prototype.correctTopRight = function(e) {
        var n = e[0]
          , r = e[1]
          , i = e[2]
          , o = e[3]
          , s = this.transitionsBetween(n, o)
          , a = this.transitionsBetween(r, o)
          , l = t.shiftPoint(n, r, (a + 1) * 4)
          , c = t.shiftPoint(i, r, (s + 1) * 4);
        s = this.transitionsBetween(l, o),
        a = this.transitionsBetween(c, o);
        var u = new Pe(o.getX() + (i.getX() - r.getX()) / (s + 1),o.getY() + (i.getY() - r.getY()) / (s + 1))
          , f = new Pe(o.getX() + (n.getX() - r.getX()) / (a + 1),o.getY() + (n.getY() - r.getY()) / (a + 1));
        if (!this.isValid(u))
            return this.isValid(f) ? f : null;
        if (!this.isValid(f))
            return u;
        var d = this.transitionsBetween(l, u) + this.transitionsBetween(c, u)
          , h = this.transitionsBetween(l, f) + this.transitionsBetween(c, f);
        return d > h ? u : f
    }
    ,
    t.prototype.shiftToModuleCenter = function(e) {
        var n = e[0]
          , r = e[1]
          , i = e[2]
          , o = e[3]
          , s = this.transitionsBetween(n, o) + 1
          , a = this.transitionsBetween(i, o) + 1
          , l = t.shiftPoint(n, r, a * 4)
          , c = t.shiftPoint(i, r, s * 4);
        s = this.transitionsBetween(l, o) + 1,
        a = this.transitionsBetween(c, o) + 1,
        (s & 1) === 1 && (s += 1),
        (a & 1) === 1 && (a += 1);
        var u = (n.getX() + r.getX() + i.getX() + o.getX()) / 4
          , f = (n.getY() + r.getY() + i.getY() + o.getY()) / 4;
        n = t.moveAway(n, u, f),
        r = t.moveAway(r, u, f),
        i = t.moveAway(i, u, f),
        o = t.moveAway(o, u, f);
        var d, h;
        return l = t.shiftPoint(n, r, a * 4),
        l = t.shiftPoint(l, o, s * 4),
        d = t.shiftPoint(r, n, a * 4),
        d = t.shiftPoint(d, i, s * 4),
        c = t.shiftPoint(i, o, a * 4),
        c = t.shiftPoint(c, r, s * 4),
        h = t.shiftPoint(o, i, a * 4),
        h = t.shiftPoint(h, n, s * 4),
        [l, d, c, h]
    }
    ,
    t.prototype.isValid = function(e) {
        return e.getX() >= 0 && e.getX() < this.image.getWidth() && e.getY() > 0 && e.getY() < this.image.getHeight()
    }
    ,
    t.sampleGrid = function(e, n, r, i, o, s, a) {
        var l = uE.getInstance();
        return l.sampleGrid(e, s, a, .5, .5, s - .5, .5, s - .5, a - .5, .5, a - .5, n.getX(), n.getY(), o.getX(), o.getY(), i.getX(), i.getY(), r.getX(), r.getY())
    }
    ,
    t.prototype.transitionsBetween = function(e, n) {
        var r = Math.trunc(e.getX())
          , i = Math.trunc(e.getY())
          , o = Math.trunc(n.getX())
          , s = Math.trunc(n.getY())
          , a = Math.abs(s - i) > Math.abs(o - r);
        if (a) {
            var l = r;
            r = i,
            i = l,
            l = o,
            o = s,
            s = l
        }
        for (var c = Math.abs(o - r), u = Math.abs(s - i), f = -c / 2, d = i < s ? 1 : -1, h = r < o ? 1 : -1, p = 0, y = this.image.get(a ? i : r, a ? r : i), v = r, g = i; v !== o; v += h) {
            var m = this.image.get(a ? g : v, a ? v : g);
            if (m !== y && (p++,
            y = m),
            f += u,
            f > 0) {
                if (g === s)
                    break;
                g += d,
                f -= c
            }
        }
        return p
    }
    ,
    t
}()
  , G0 = function() {
    function t() {
        this.decoder = new Nwe
    }
    return t.prototype.decode = function(e, n) {
        n === void 0 && (n = null);
        var r, i;
        if (n != null && n.has(Ot.PURE_BARCODE)) {
            var o = t.extractPureBits(e.getBlackMatrix());
            r = this.decoder.decode(o),
            i = t.NO_POINTS
        } else {
            var s = new Fwe(e.getBlackMatrix()).detect();
            r = this.decoder.decode(s.getBits()),
            i = s.getPoints()
        }
        var a = r.getRawBytes()
          , l = new tr(r.getText(),a,8 * a.length,i,Be.DATA_MATRIX,It.currentTimeMillis())
          , c = r.getByteSegments();
        c != null && l.putMetadata(Gn.BYTE_SEGMENTS, c);
        var u = r.getECLevel();
        return u != null && l.putMetadata(Gn.ERROR_CORRECTION_LEVEL, u),
        l
    }
    ,
    t.prototype.reset = function() {}
    ,
    t.extractPureBits = function(e) {
        var n = e.getTopLeftOnBit()
          , r = e.getBottomRightOnBit();
        if (n == null || r == null)
            throw new oe;
        var i = this.moduleSize(n, e)
          , o = n[1]
          , s = r[1]
          , a = n[0]
          , l = r[0]
          , c = (l - a + 1) / i
          , u = (s - o + 1) / i;
        if (c <= 0 || u <= 0)
            throw new oe;
        var f = i / 2;
        o += f,
        a += f;
        for (var d = new xo(c,u), h = 0; h < u; h++)
            for (var p = o + h * i, y = 0; y < c; y++)
                e.get(a + y * i, p) && d.set(y, h);
        return d
    }
    ,
    t.moduleSize = function(e, n) {
        for (var r = n.getWidth(), i = e[0], o = e[1]; i < r && n.get(i, o); )
            i++;
        if (i === r)
            throw new oe;
        var s = i - e[0];
        if (s === 0)
            throw new oe;
        return s
    }
    ,
    t.NO_POINTS = [],
    t
}()
  , Lwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    Lwe(e, t);
    function e(n) {
        return n === void 0 && (n = 500),
        t.call(this, new G0, n) || this
    }
    return e
}
)(Eu);
var bc;
(function(t) {
    t[t.L = 0] = "L",
    t[t.M = 1] = "M",
    t[t.Q = 2] = "Q",
    t[t.H = 3] = "H"
}
)(bc || (bc = {}));
var $we = function() {
    function t(e, n, r) {
        this.value = e,
        this.stringValue = n,
        this.bits = r,
        t.FOR_BITS.set(r, this),
        t.FOR_VALUE.set(e, this)
    }
    return t.prototype.getValue = function() {
        return this.value
    }
    ,
    t.prototype.getBits = function() {
        return this.bits
    }
    ,
    t.fromString = function(e) {
        switch (e) {
        case "L":
            return t.L;
        case "M":
            return t.M;
        case "Q":
            return t.Q;
        case "H":
            return t.H;
        default:
            throw new rn(e + "not available")
        }
    }
    ,
    t.prototype.toString = function() {
        return this.stringValue
    }
    ,
    t.prototype.equals = function(e) {
        if (!(e instanceof t))
            return !1;
        var n = e;
        return this.value === n.value
    }
    ,
    t.forBits = function(e) {
        if (e < 0 || e >= t.FOR_BITS.size)
            throw new ke;
        return t.FOR_BITS.get(e)
    }
    ,
    t.FOR_BITS = new Map,
    t.FOR_VALUE = new Map,
    t.L = new t(bc.L,"L",1),
    t.M = new t(bc.M,"M",0),
    t.Q = new t(bc.Q,"Q",3),
    t.H = new t(bc.H,"H",2),
    t
}(), Uwe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, N9 = function() {
    function t(e) {
        this.errorCorrectionLevel = $we.forBits(e >> 3 & 3),
        this.dataMask = e & 7
    }
    return t.numBitsDiffering = function(e, n) {
        return qe.bitCount(e ^ n)
    }
    ,
    t.decodeFormatInformation = function(e, n) {
        var r = t.doDecodeFormatInformation(e, n);
        return r !== null ? r : t.doDecodeFormatInformation(e ^ t.FORMAT_INFO_MASK_QR, n ^ t.FORMAT_INFO_MASK_QR)
    }
    ,
    t.doDecodeFormatInformation = function(e, n) {
        var r, i, o = Number.MAX_SAFE_INTEGER, s = 0;
        try {
            for (var a = Uwe(t.FORMAT_INFO_DECODE_LOOKUP), l = a.next(); !l.done; l = a.next()) {
                var c = l.value
                  , u = c[0];
                if (u === e || u === n)
                    return new t(c[1]);
                var f = t.numBitsDiffering(e, u);
                f < o && (s = c[1],
                o = f),
                e !== n && (f = t.numBitsDiffering(n, u),
                f < o && (s = c[1],
                o = f))
            }
        } catch (d) {
            r = {
                error: d
            }
        } finally {
            try {
                l && !l.done && (i = a.return) && i.call(a)
            } finally {
                if (r)
                    throw r.error
            }
        }
        return o <= 3 ? new t(s) : null
    }
    ,
    t.prototype.getErrorCorrectionLevel = function() {
        return this.errorCorrectionLevel
    }
    ,
    t.prototype.getDataMask = function() {
        return this.dataMask
    }
    ,
    t.prototype.hashCode = function() {
        return this.errorCorrectionLevel.getBits() << 3 | this.dataMask
    }
    ,
    t.prototype.equals = function(e) {
        if (!(e instanceof t))
            return !1;
        var n = e;
        return this.errorCorrectionLevel === n.errorCorrectionLevel && this.dataMask === n.dataMask
    }
    ,
    t.FORMAT_INFO_MASK_QR = 21522,
    t.FORMAT_INFO_DECODE_LOOKUP = [Int32Array.from([21522, 0]), Int32Array.from([20773, 1]), Int32Array.from([24188, 2]), Int32Array.from([23371, 3]), Int32Array.from([17913, 4]), Int32Array.from([16590, 5]), Int32Array.from([20375, 6]), Int32Array.from([19104, 7]), Int32Array.from([30660, 8]), Int32Array.from([29427, 9]), Int32Array.from([32170, 10]), Int32Array.from([30877, 11]), Int32Array.from([26159, 12]), Int32Array.from([25368, 13]), Int32Array.from([27713, 14]), Int32Array.from([26998, 15]), Int32Array.from([5769, 16]), Int32Array.from([5054, 17]), Int32Array.from([7399, 18]), Int32Array.from([6608, 19]), Int32Array.from([1890, 20]), Int32Array.from([597, 21]), Int32Array.from([3340, 22]), Int32Array.from([2107, 23]), Int32Array.from([13663, 24]), Int32Array.from([12392, 25]), Int32Array.from([16177, 26]), Int32Array.from([14854, 27]), Int32Array.from([9396, 28]), Int32Array.from([8579, 29]), Int32Array.from([11994, 30]), Int32Array.from([11245, 31])],
    t
}(), Gwe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, Y = function() {
    function t(e) {
        for (var n = [], r = 1; r < arguments.length; r++)
            n[r - 1] = arguments[r];
        this.ecCodewordsPerBlock = e,
        this.ecBlocks = n
    }
    return t.prototype.getECCodewordsPerBlock = function() {
        return this.ecCodewordsPerBlock
    }
    ,
    t.prototype.getNumBlocks = function() {
        var e, n, r = 0, i = this.ecBlocks;
        try {
            for (var o = Gwe(i), s = o.next(); !s.done; s = o.next()) {
                var a = s.value;
                r += a.getCount()
            }
        } catch (l) {
            e = {
                error: l
            }
        } finally {
            try {
                s && !s.done && (n = o.return) && n.call(o)
            } finally {
                if (e)
                    throw e.error
            }
        }
        return r
    }
    ,
    t.prototype.getTotalECCodewords = function() {
        return this.ecCodewordsPerBlock * this.getNumBlocks()
    }
    ,
    t.prototype.getECBlocks = function() {
        return this.ecBlocks
    }
    ,
    t
}(), D = function() {
    function t(e, n) {
        this.count = e,
        this.dataCodewords = n
    }
    return t.prototype.getCount = function() {
        return this.count
    }
    ,
    t.prototype.getDataCodewords = function() {
        return this.dataCodewords
    }
    ,
    t
}(), Hwe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, ol = function() {
    function t(e, n) {
        for (var r, i, o = [], s = 2; s < arguments.length; s++)
            o[s - 2] = arguments[s];
        this.versionNumber = e,
        this.alignmentPatternCenters = n,
        this.ecBlocks = o;
        var a = 0
          , l = o[0].getECCodewordsPerBlock()
          , c = o[0].getECBlocks();
        try {
            for (var u = Hwe(c), f = u.next(); !f.done; f = u.next()) {
                var d = f.value;
                a += d.getCount() * (d.getDataCodewords() + l)
            }
        } catch (h) {
            r = {
                error: h
            }
        } finally {
            try {
                f && !f.done && (i = u.return) && i.call(u)
            } finally {
                if (r)
                    throw r.error
            }
        }
        this.totalCodewords = a
    }
    return t.prototype.getVersionNumber = function() {
        return this.versionNumber
    }
    ,
    t.prototype.getAlignmentPatternCenters = function() {
        return this.alignmentPatternCenters
    }
    ,
    t.prototype.getTotalCodewords = function() {
        return this.totalCodewords
    }
    ,
    t.prototype.getDimensionForVersion = function() {
        return 17 + 4 * this.versionNumber
    }
    ,
    t.prototype.getECBlocksForLevel = function(e) {
        return this.ecBlocks[e.getValue()]
    }
    ,
    t.getProvisionalVersionForDimension = function(e) {
        if (e % 4 !== 1)
            throw new me;
        try {
            return this.getVersionForNumber((e - 17) / 4)
        } catch {
            throw new me
        }
    }
    ,
    t.getVersionForNumber = function(e) {
        if (e < 1 || e > 40)
            throw new ke;
        return t.VERSIONS[e - 1]
    }
    ,
    t.decodeVersionInformation = function(e) {
        for (var n = Number.MAX_SAFE_INTEGER, r = 0, i = 0; i < t.VERSION_DECODE_INFO.length; i++) {
            var o = t.VERSION_DECODE_INFO[i];
            if (o === e)
                return t.getVersionForNumber(i + 7);
            var s = N9.numBitsDiffering(e, o);
            s < n && (r = i + 7,
            n = s)
        }
        return n <= 3 ? t.getVersionForNumber(r) : null
    }
    ,
    t.prototype.buildFunctionPattern = function() {
        var e = this.getDimensionForVersion()
          , n = new xo(e);
        n.setRegion(0, 0, 9, 9),
        n.setRegion(e - 8, 0, 8, 9),
        n.setRegion(0, e - 8, 9, 8);
        for (var r = this.alignmentPatternCenters.length, i = 0; i < r; i++)
            for (var o = this.alignmentPatternCenters[i] - 2, s = 0; s < r; s++)
                i === 0 && (s === 0 || s === r - 1) || i === r - 1 && s === 0 || n.setRegion(this.alignmentPatternCenters[s] - 2, o, 5, 5);
        return n.setRegion(6, 9, 1, e - 17),
        n.setRegion(9, 6, e - 17, 1),
        this.versionNumber > 6 && (n.setRegion(e - 11, 0, 3, 6),
        n.setRegion(0, e - 11, 6, 3)),
        n
    }
    ,
    t.prototype.toString = function() {
        return "" + this.versionNumber
    }
    ,
    t.VERSION_DECODE_INFO = Int32Array.from([31892, 34236, 39577, 42195, 48118, 51042, 55367, 58893, 63784, 68472, 70749, 76311, 79154, 84390, 87683, 92361, 96236, 102084, 102881, 110507, 110734, 117786, 119615, 126325, 127568, 133589, 136944, 141498, 145311, 150283, 152622, 158308, 161089, 167017]),
    t.VERSIONS = [new t(1,new Int32Array(0),new Y(7,new D(1,19)),new Y(10,new D(1,16)),new Y(13,new D(1,13)),new Y(17,new D(1,9))), new t(2,Int32Array.from([6, 18]),new Y(10,new D(1,34)),new Y(16,new D(1,28)),new Y(22,new D(1,22)),new Y(28,new D(1,16))), new t(3,Int32Array.from([6, 22]),new Y(15,new D(1,55)),new Y(26,new D(1,44)),new Y(18,new D(2,17)),new Y(22,new D(2,13))), new t(4,Int32Array.from([6, 26]),new Y(20,new D(1,80)),new Y(18,new D(2,32)),new Y(26,new D(2,24)),new Y(16,new D(4,9))), new t(5,Int32Array.from([6, 30]),new Y(26,new D(1,108)),new Y(24,new D(2,43)),new Y(18,new D(2,15),new D(2,16)),new Y(22,new D(2,11),new D(2,12))), new t(6,Int32Array.from([6, 34]),new Y(18,new D(2,68)),new Y(16,new D(4,27)),new Y(24,new D(4,19)),new Y(28,new D(4,15))), new t(7,Int32Array.from([6, 22, 38]),new Y(20,new D(2,78)),new Y(18,new D(4,31)),new Y(18,new D(2,14),new D(4,15)),new Y(26,new D(4,13),new D(1,14))), new t(8,Int32Array.from([6, 24, 42]),new Y(24,new D(2,97)),new Y(22,new D(2,38),new D(2,39)),new Y(22,new D(4,18),new D(2,19)),new Y(26,new D(4,14),new D(2,15))), new t(9,Int32Array.from([6, 26, 46]),new Y(30,new D(2,116)),new Y(22,new D(3,36),new D(2,37)),new Y(20,new D(4,16),new D(4,17)),new Y(24,new D(4,12),new D(4,13))), new t(10,Int32Array.from([6, 28, 50]),new Y(18,new D(2,68),new D(2,69)),new Y(26,new D(4,43),new D(1,44)),new Y(24,new D(6,19),new D(2,20)),new Y(28,new D(6,15),new D(2,16))), new t(11,Int32Array.from([6, 30, 54]),new Y(20,new D(4,81)),new Y(30,new D(1,50),new D(4,51)),new Y(28,new D(4,22),new D(4,23)),new Y(24,new D(3,12),new D(8,13))), new t(12,Int32Array.from([6, 32, 58]),new Y(24,new D(2,92),new D(2,93)),new Y(22,new D(6,36),new D(2,37)),new Y(26,new D(4,20),new D(6,21)),new Y(28,new D(7,14),new D(4,15))), new t(13,Int32Array.from([6, 34, 62]),new Y(26,new D(4,107)),new Y(22,new D(8,37),new D(1,38)),new Y(24,new D(8,20),new D(4,21)),new Y(22,new D(12,11),new D(4,12))), new t(14,Int32Array.from([6, 26, 46, 66]),new Y(30,new D(3,115),new D(1,116)),new Y(24,new D(4,40),new D(5,41)),new Y(20,new D(11,16),new D(5,17)),new Y(24,new D(11,12),new D(5,13))), new t(15,Int32Array.from([6, 26, 48, 70]),new Y(22,new D(5,87),new D(1,88)),new Y(24,new D(5,41),new D(5,42)),new Y(30,new D(5,24),new D(7,25)),new Y(24,new D(11,12),new D(7,13))), new t(16,Int32Array.from([6, 26, 50, 74]),new Y(24,new D(5,98),new D(1,99)),new Y(28,new D(7,45),new D(3,46)),new Y(24,new D(15,19),new D(2,20)),new Y(30,new D(3,15),new D(13,16))), new t(17,Int32Array.from([6, 30, 54, 78]),new Y(28,new D(1,107),new D(5,108)),new Y(28,new D(10,46),new D(1,47)),new Y(28,new D(1,22),new D(15,23)),new Y(28,new D(2,14),new D(17,15))), new t(18,Int32Array.from([6, 30, 56, 82]),new Y(30,new D(5,120),new D(1,121)),new Y(26,new D(9,43),new D(4,44)),new Y(28,new D(17,22),new D(1,23)),new Y(28,new D(2,14),new D(19,15))), new t(19,Int32Array.from([6, 30, 58, 86]),new Y(28,new D(3,113),new D(4,114)),new Y(26,new D(3,44),new D(11,45)),new Y(26,new D(17,21),new D(4,22)),new Y(26,new D(9,13),new D(16,14))), new t(20,Int32Array.from([6, 34, 62, 90]),new Y(28,new D(3,107),new D(5,108)),new Y(26,new D(3,41),new D(13,42)),new Y(30,new D(15,24),new D(5,25)),new Y(28,new D(15,15),new D(10,16))), new t(21,Int32Array.from([6, 28, 50, 72, 94]),new Y(28,new D(4,116),new D(4,117)),new Y(26,new D(17,42)),new Y(28,new D(17,22),new D(6,23)),new Y(30,new D(19,16),new D(6,17))), new t(22,Int32Array.from([6, 26, 50, 74, 98]),new Y(28,new D(2,111),new D(7,112)),new Y(28,new D(17,46)),new Y(30,new D(7,24),new D(16,25)),new Y(24,new D(34,13))), new t(23,Int32Array.from([6, 30, 54, 78, 102]),new Y(30,new D(4,121),new D(5,122)),new Y(28,new D(4,47),new D(14,48)),new Y(30,new D(11,24),new D(14,25)),new Y(30,new D(16,15),new D(14,16))), new t(24,Int32Array.from([6, 28, 54, 80, 106]),new Y(30,new D(6,117),new D(4,118)),new Y(28,new D(6,45),new D(14,46)),new Y(30,new D(11,24),new D(16,25)),new Y(30,new D(30,16),new D(2,17))), new t(25,Int32Array.from([6, 32, 58, 84, 110]),new Y(26,new D(8,106),new D(4,107)),new Y(28,new D(8,47),new D(13,48)),new Y(30,new D(7,24),new D(22,25)),new Y(30,new D(22,15),new D(13,16))), new t(26,Int32Array.from([6, 30, 58, 86, 114]),new Y(28,new D(10,114),new D(2,115)),new Y(28,new D(19,46),new D(4,47)),new Y(28,new D(28,22),new D(6,23)),new Y(30,new D(33,16),new D(4,17))), new t(27,Int32Array.from([6, 34, 62, 90, 118]),new Y(30,new D(8,122),new D(4,123)),new Y(28,new D(22,45),new D(3,46)),new Y(30,new D(8,23),new D(26,24)),new Y(30,new D(12,15),new D(28,16))), new t(28,Int32Array.from([6, 26, 50, 74, 98, 122]),new Y(30,new D(3,117),new D(10,118)),new Y(28,new D(3,45),new D(23,46)),new Y(30,new D(4,24),new D(31,25)),new Y(30,new D(11,15),new D(31,16))), new t(29,Int32Array.from([6, 30, 54, 78, 102, 126]),new Y(30,new D(7,116),new D(7,117)),new Y(28,new D(21,45),new D(7,46)),new Y(30,new D(1,23),new D(37,24)),new Y(30,new D(19,15),new D(26,16))), new t(30,Int32Array.from([6, 26, 52, 78, 104, 130]),new Y(30,new D(5,115),new D(10,116)),new Y(28,new D(19,47),new D(10,48)),new Y(30,new D(15,24),new D(25,25)),new Y(30,new D(23,15),new D(25,16))), new t(31,Int32Array.from([6, 30, 56, 82, 108, 134]),new Y(30,new D(13,115),new D(3,116)),new Y(28,new D(2,46),new D(29,47)),new Y(30,new D(42,24),new D(1,25)),new Y(30,new D(23,15),new D(28,16))), new t(32,Int32Array.from([6, 34, 60, 86, 112, 138]),new Y(30,new D(17,115)),new Y(28,new D(10,46),new D(23,47)),new Y(30,new D(10,24),new D(35,25)),new Y(30,new D(19,15),new D(35,16))), new t(33,Int32Array.from([6, 30, 58, 86, 114, 142]),new Y(30,new D(17,115),new D(1,116)),new Y(28,new D(14,46),new D(21,47)),new Y(30,new D(29,24),new D(19,25)),new Y(30,new D(11,15),new D(46,16))), new t(34,Int32Array.from([6, 34, 62, 90, 118, 146]),new Y(30,new D(13,115),new D(6,116)),new Y(28,new D(14,46),new D(23,47)),new Y(30,new D(44,24),new D(7,25)),new Y(30,new D(59,16),new D(1,17))), new t(35,Int32Array.from([6, 30, 54, 78, 102, 126, 150]),new Y(30,new D(12,121),new D(7,122)),new Y(28,new D(12,47),new D(26,48)),new Y(30,new D(39,24),new D(14,25)),new Y(30,new D(22,15),new D(41,16))), new t(36,Int32Array.from([6, 24, 50, 76, 102, 128, 154]),new Y(30,new D(6,121),new D(14,122)),new Y(28,new D(6,47),new D(34,48)),new Y(30,new D(46,24),new D(10,25)),new Y(30,new D(2,15),new D(64,16))), new t(37,Int32Array.from([6, 28, 54, 80, 106, 132, 158]),new Y(30,new D(17,122),new D(4,123)),new Y(28,new D(29,46),new D(14,47)),new Y(30,new D(49,24),new D(10,25)),new Y(30,new D(24,15),new D(46,16))), new t(38,Int32Array.from([6, 32, 58, 84, 110, 136, 162]),new Y(30,new D(4,122),new D(18,123)),new Y(28,new D(13,46),new D(32,47)),new Y(30,new D(48,24),new D(14,25)),new Y(30,new D(42,15),new D(32,16))), new t(39,Int32Array.from([6, 26, 54, 82, 110, 138, 166]),new Y(30,new D(20,117),new D(4,118)),new Y(28,new D(40,47),new D(7,48)),new Y(30,new D(43,24),new D(22,25)),new Y(30,new D(10,15),new D(67,16))), new t(40,Int32Array.from([6, 30, 58, 86, 114, 142, 170]),new Y(30,new D(19,118),new D(6,119)),new Y(28,new D(18,47),new D(31,48)),new Y(30,new D(34,24),new D(34,25)),new Y(30,new D(20,15),new D(61,16)))],
    t
}(), Tn;
(function(t) {
    t[t.DATA_MASK_000 = 0] = "DATA_MASK_000",
    t[t.DATA_MASK_001 = 1] = "DATA_MASK_001",
    t[t.DATA_MASK_010 = 2] = "DATA_MASK_010",
    t[t.DATA_MASK_011 = 3] = "DATA_MASK_011",
    t[t.DATA_MASK_100 = 4] = "DATA_MASK_100",
    t[t.DATA_MASK_101 = 5] = "DATA_MASK_101",
    t[t.DATA_MASK_110 = 6] = "DATA_MASK_110",
    t[t.DATA_MASK_111 = 7] = "DATA_MASK_111"
}
)(Tn || (Tn = {}));
var $P = function() {
    function t(e, n) {
        this.value = e,
        this.isMasked = n
    }
    return t.prototype.unmaskBitMatrix = function(e, n) {
        for (var r = 0; r < n; r++)
            for (var i = 0; i < n; i++)
                this.isMasked(r, i) && e.flip(i, r)
    }
    ,
    t.values = new Map([[Tn.DATA_MASK_000, new t(Tn.DATA_MASK_000,function(e, n) {
        return (e + n & 1) === 0
    }
    )], [Tn.DATA_MASK_001, new t(Tn.DATA_MASK_001,function(e, n) {
        return (e & 1) === 0
    }
    )], [Tn.DATA_MASK_010, new t(Tn.DATA_MASK_010,function(e, n) {
        return n % 3 === 0
    }
    )], [Tn.DATA_MASK_011, new t(Tn.DATA_MASK_011,function(e, n) {
        return (e + n) % 3 === 0
    }
    )], [Tn.DATA_MASK_100, new t(Tn.DATA_MASK_100,function(e, n) {
        return (Math.floor(e / 2) + Math.floor(n / 3) & 1) === 0
    }
    )], [Tn.DATA_MASK_101, new t(Tn.DATA_MASK_101,function(e, n) {
        return e * n % 6 === 0
    }
    )], [Tn.DATA_MASK_110, new t(Tn.DATA_MASK_110,function(e, n) {
        return e * n % 6 < 3
    }
    )], [Tn.DATA_MASK_111, new t(Tn.DATA_MASK_111,function(e, n) {
        return (e + n + e * n % 3 & 1) === 0
    }
    )]]),
    t
}(), Vwe = function() {
    function t(e) {
        var n = e.getHeight();
        if (n < 21 || (n & 3) !== 1)
            throw new me;
        this.bitMatrix = e
    }
    return t.prototype.readFormatInformation = function() {
        if (this.parsedFormatInfo !== null && this.parsedFormatInfo !== void 0)
            return this.parsedFormatInfo;
        for (var e = 0, n = 0; n < 6; n++)
            e = this.copyBit(n, 8, e);
        e = this.copyBit(7, 8, e),
        e = this.copyBit(8, 8, e),
        e = this.copyBit(8, 7, e);
        for (var r = 5; r >= 0; r--)
            e = this.copyBit(8, r, e);
        for (var i = this.bitMatrix.getHeight(), o = 0, s = i - 7, r = i - 1; r >= s; r--)
            o = this.copyBit(8, r, o);
        for (var n = i - 8; n < i; n++)
            o = this.copyBit(n, 8, o);
        if (this.parsedFormatInfo = N9.decodeFormatInformation(e, o),
        this.parsedFormatInfo !== null)
            return this.parsedFormatInfo;
        throw new me
    }
    ,
    t.prototype.readVersion = function() {
        if (this.parsedVersion !== null && this.parsedVersion !== void 0)
            return this.parsedVersion;
        var e = this.bitMatrix.getHeight()
          , n = Math.floor((e - 17) / 4);
        if (n <= 6)
            return ol.getVersionForNumber(n);
        for (var r = 0, i = e - 11, o = 5; o >= 0; o--)
            for (var s = e - 9; s >= i; s--)
                r = this.copyBit(s, o, r);
        var a = ol.decodeVersionInformation(r);
        if (a !== null && a.getDimensionForVersion() === e)
            return this.parsedVersion = a,
            a;
        r = 0;
        for (var s = 5; s >= 0; s--)
            for (var o = e - 9; o >= i; o--)
                r = this.copyBit(s, o, r);
        if (a = ol.decodeVersionInformation(r),
        a !== null && a.getDimensionForVersion() === e)
            return this.parsedVersion = a,
            a;
        throw new me
    }
    ,
    t.prototype.copyBit = function(e, n, r) {
        var i = this.isMirror ? this.bitMatrix.get(n, e) : this.bitMatrix.get(e, n);
        return i ? r << 1 | 1 : r << 1
    }
    ,
    t.prototype.readCodewords = function() {
        var e = this.readFormatInformation()
          , n = this.readVersion()
          , r = $P.values.get(e.getDataMask())
          , i = this.bitMatrix.getHeight();
        r.unmaskBitMatrix(this.bitMatrix, i);
        for (var o = n.buildFunctionPattern(), s = !0, a = new Uint8Array(n.getTotalCodewords()), l = 0, c = 0, u = 0, f = i - 1; f > 0; f -= 2) {
            f === 6 && f--;
            for (var d = 0; d < i; d++)
                for (var h = s ? i - 1 - d : d, p = 0; p < 2; p++)
                    o.get(f - p, h) || (u++,
                    c <<= 1,
                    this.bitMatrix.get(f - p, h) && (c |= 1),
                    u === 8 && (a[l++] = c,
                    u = 0,
                    c = 0));
            s = !s
        }
        if (l !== n.getTotalCodewords())
            throw new me;
        return a
    }
    ,
    t.prototype.remask = function() {
        if (this.parsedFormatInfo !== null) {
            var e = $P.values.get(this.parsedFormatInfo.getDataMask())
              , n = this.bitMatrix.getHeight();
            e.unmaskBitMatrix(this.bitMatrix, n)
        }
    }
    ,
    t.prototype.setMirror = function(e) {
        this.parsedVersion = null,
        this.parsedFormatInfo = null,
        this.isMirror = e
    }
    ,
    t.prototype.mirror = function() {
        for (var e = this.bitMatrix, n = 0, r = e.getWidth(); n < r; n++)
            for (var i = n + 1, o = e.getHeight(); i < o; i++)
                e.get(n, i) !== e.get(i, n) && (e.flip(i, n),
                e.flip(n, i))
    }
    ,
    t
}(), UP = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, zwe = function() {
    function t(e, n) {
        this.numDataCodewords = e,
        this.codewords = n
    }
    return t.getDataBlocks = function(e, n, r) {
        var i, o, s, a;
        if (e.length !== n.getTotalCodewords())
            throw new ke;
        var l = n.getECBlocksForLevel(r)
          , c = 0
          , u = l.getECBlocks();
        try {
            for (var f = UP(u), d = f.next(); !d.done; d = f.next()) {
                var h = d.value;
                c += h.getCount()
            }
        } catch (I) {
            i = {
                error: I
            }
        } finally {
            try {
                d && !d.done && (o = f.return) && o.call(f)
            } finally {
                if (i)
                    throw i.error
            }
        }
        var p = new Array(c)
          , y = 0;
        try {
            for (var v = UP(u), g = v.next(); !g.done; g = v.next())
                for (var h = g.value, m = 0; m < h.getCount(); m++) {
                    var _ = h.getDataCodewords()
                      , x = l.getECCodewordsPerBlock() + _;
                    p[y++] = new t(_,new Uint8Array(x))
                }
        } catch (I) {
            s = {
                error: I
            }
        } finally {
            try {
                g && !g.done && (a = v.return) && a.call(v)
            } finally {
                if (s)
                    throw s.error
            }
        }
        for (var b = p[0].codewords.length, w = p.length - 1; w >= 0; ) {
            var E = p[w].codewords.length;
            if (E === b)
                break;
            w--
        }
        w++;
        for (var S = b - l.getECCodewordsPerBlock(), P = 0, m = 0; m < S; m++)
            for (var C = 0; C < y; C++)
                p[C].codewords[m] = e[P++];
        for (var C = w; C < y; C++)
            p[C].codewords[S] = e[P++];
        for (var A = p[0].codewords.length, m = S; m < A; m++)
            for (var C = 0; C < y; C++) {
                var T = C < w ? m : m + 1;
                p[C].codewords[T] = e[P++]
            }
        return p
    }
    ,
    t.prototype.getNumDataCodewords = function() {
        return this.numDataCodewords
    }
    ,
    t.prototype.getCodewords = function() {
        return this.codewords
    }
    ,
    t
}(), oi;
(function(t) {
    t[t.TERMINATOR = 0] = "TERMINATOR",
    t[t.NUMERIC = 1] = "NUMERIC",
    t[t.ALPHANUMERIC = 2] = "ALPHANUMERIC",
    t[t.STRUCTURED_APPEND = 3] = "STRUCTURED_APPEND",
    t[t.BYTE = 4] = "BYTE",
    t[t.ECI = 5] = "ECI",
    t[t.KANJI = 6] = "KANJI",
    t[t.FNC1_FIRST_POSITION = 7] = "FNC1_FIRST_POSITION",
    t[t.FNC1_SECOND_POSITION = 8] = "FNC1_SECOND_POSITION",
    t[t.HANZI = 9] = "HANZI"
}
)(oi || (oi = {}));
var kt = function() {
    function t(e, n, r, i) {
        this.value = e,
        this.stringValue = n,
        this.characterCountBitsForVersions = r,
        this.bits = i,
        t.FOR_BITS.set(i, this),
        t.FOR_VALUE.set(e, this)
    }
    return t.forBits = function(e) {
        var n = t.FOR_BITS.get(e);
        if (n === void 0)
            throw new ke;
        return n
    }
    ,
    t.prototype.getCharacterCountBits = function(e) {
        var n = e.getVersionNumber(), r;
        return n <= 9 ? r = 0 : n <= 26 ? r = 1 : r = 2,
        this.characterCountBitsForVersions[r]
    }
    ,
    t.prototype.getValue = function() {
        return this.value
    }
    ,
    t.prototype.getBits = function() {
        return this.bits
    }
    ,
    t.prototype.equals = function(e) {
        if (!(e instanceof t))
            return !1;
        var n = e;
        return this.value === n.value
    }
    ,
    t.prototype.toString = function() {
        return this.stringValue
    }
    ,
    t.FOR_BITS = new Map,
    t.FOR_VALUE = new Map,
    t.TERMINATOR = new t(oi.TERMINATOR,"TERMINATOR",Int32Array.from([0, 0, 0]),0),
    t.NUMERIC = new t(oi.NUMERIC,"NUMERIC",Int32Array.from([10, 12, 14]),1),
    t.ALPHANUMERIC = new t(oi.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9, 11, 13]),2),
    t.STRUCTURED_APPEND = new t(oi.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0, 0, 0]),3),
    t.BYTE = new t(oi.BYTE,"BYTE",Int32Array.from([8, 16, 16]),4),
    t.ECI = new t(oi.ECI,"ECI",Int32Array.from([0, 0, 0]),7),
    t.KANJI = new t(oi.KANJI,"KANJI",Int32Array.from([8, 10, 12]),8),
    t.FNC1_FIRST_POSITION = new t(oi.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0, 0, 0]),5),
    t.FNC1_SECOND_POSITION = new t(oi.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0, 0, 0]),9),
    t.HANZI = new t(oi.HANZI,"HANZI",Int32Array.from([8, 10, 12]),13),
    t
}()
  , jwe = function() {
    function t() {}
    return t.decode = function(e, n, r, i) {
        var o = new k9(e)
          , s = new Ke
          , a = new Array
          , l = -1
          , c = -1;
        try {
            var u = null
              , f = !1
              , d = void 0;
            do {
                if (o.available() < 4)
                    d = kt.TERMINATOR;
                else {
                    var h = o.readBits(4);
                    d = kt.forBits(h)
                }
                switch (d) {
                case kt.TERMINATOR:
                    break;
                case kt.FNC1_FIRST_POSITION:
                case kt.FNC1_SECOND_POSITION:
                    f = !0;
                    break;
                case kt.STRUCTURED_APPEND:
                    if (o.available() < 16)
                        throw new me;
                    l = o.readBits(8),
                    c = o.readBits(8);
                    break;
                case kt.ECI:
                    var p = t.parseECIValue(o);
                    if (u = xn.getCharacterSetECIByValue(p),
                    u === null)
                        throw new me;
                    break;
                case kt.HANZI:
                    var y = o.readBits(4)
                      , v = o.readBits(d.getCharacterCountBits(n));
                    y === t.GB2312_SUBSET && t.decodeHanziSegment(o, s, v);
                    break;
                default:
                    var g = o.readBits(d.getCharacterCountBits(n));
                    switch (d) {
                    case kt.NUMERIC:
                        t.decodeNumericSegment(o, s, g);
                        break;
                    case kt.ALPHANUMERIC:
                        t.decodeAlphanumericSegment(o, s, g, f);
                        break;
                    case kt.BYTE:
                        t.decodeByteSegment(o, s, g, u, a, i);
                        break;
                    case kt.KANJI:
                        t.decodeKanjiSegment(o, s, g);
                        break;
                    default:
                        throw new me
                    }
                    break
                }
            } while (d !== kt.TERMINATOR)
        } catch {
            throw new me
        }
        return new ym(e,s.toString(),a.length === 0 ? null : a,r === null ? null : r.toString(),l,c)
    }
    ,
    t.decodeHanziSegment = function(e, n, r) {
        if (r * 13 > e.available())
            throw new me;
        for (var i = new Uint8Array(2 * r), o = 0; r > 0; ) {
            var s = e.readBits(13)
              , a = s / 96 << 8 & 4294967295 | s % 96;
            a < 959 ? a += 41377 : a += 42657,
            i[o] = a >> 8 & 255,
            i[o + 1] = a & 255,
            o += 2,
            r--
        }
        try {
            n.append(mi.decode(i, nt.GB2312))
        } catch (l) {
            throw new me(l)
        }
    }
    ,
    t.decodeKanjiSegment = function(e, n, r) {
        if (r * 13 > e.available())
            throw new me;
        for (var i = new Uint8Array(2 * r), o = 0; r > 0; ) {
            var s = e.readBits(13)
              , a = s / 192 << 8 & 4294967295 | s % 192;
            a < 7936 ? a += 33088 : a += 49472,
            i[o] = a >> 8,
            i[o + 1] = a,
            o += 2,
            r--
        }
        try {
            n.append(mi.decode(i, nt.SHIFT_JIS))
        } catch (l) {
            throw new me(l)
        }
    }
    ,
    t.decodeByteSegment = function(e, n, r, i, o, s) {
        if (8 * r > e.available())
            throw new me;
        for (var a = new Uint8Array(r), l = 0; l < r; l++)
            a[l] = e.readBits(8);
        var c;
        i === null ? c = nt.guessEncoding(a, s) : c = i.getName();
        try {
            n.append(mi.decode(a, c))
        } catch (u) {
            throw new me(u)
        }
        o.push(a)
    }
    ,
    t.toAlphaNumericChar = function(e) {
        if (e >= t.ALPHANUMERIC_CHARS.length)
            throw new me;
        return t.ALPHANUMERIC_CHARS[e]
    }
    ,
    t.decodeAlphanumericSegment = function(e, n, r, i) {
        for (var o = n.length(); r > 1; ) {
            if (e.available() < 11)
                throw new me;
            var s = e.readBits(11);
            n.append(t.toAlphaNumericChar(Math.floor(s / 45))),
            n.append(t.toAlphaNumericChar(s % 45)),
            r -= 2
        }
        if (r === 1) {
            if (e.available() < 6)
                throw new me;
            n.append(t.toAlphaNumericChar(e.readBits(6)))
        }
        if (i)
            for (var a = o; a < n.length(); a++)
                n.charAt(a) === "%" && (a < n.length() - 1 && n.charAt(a + 1) === "%" ? n.deleteCharAt(a + 1) : n.setCharAt(a, String.fromCharCode(29)))
    }
    ,
    t.decodeNumericSegment = function(e, n, r) {
        for (; r >= 3; ) {
            if (e.available() < 10)
                throw new me;
            var i = e.readBits(10);
            if (i >= 1e3)
                throw new me;
            n.append(t.toAlphaNumericChar(Math.floor(i / 100))),
            n.append(t.toAlphaNumericChar(Math.floor(i / 10) % 10)),
            n.append(t.toAlphaNumericChar(i % 10)),
            r -= 3
        }
        if (r === 2) {
            if (e.available() < 7)
                throw new me;
            var o = e.readBits(7);
            if (o >= 100)
                throw new me;
            n.append(t.toAlphaNumericChar(Math.floor(o / 10))),
            n.append(t.toAlphaNumericChar(o % 10))
        } else if (r === 1) {
            if (e.available() < 4)
                throw new me;
            var s = e.readBits(4);
            if (s >= 10)
                throw new me;
            n.append(t.toAlphaNumericChar(s))
        }
    }
    ,
    t.parseECIValue = function(e) {
        var n = e.readBits(8);
        if (!(n & 128))
            return n & 127;
        if ((n & 192) === 128) {
            var r = e.readBits(8);
            return (n & 63) << 8 & 4294967295 | r
        }
        if ((n & 224) === 192) {
            var i = e.readBits(16);
            return (n & 31) << 16 & 4294967295 | i
        }
        throw new me
    }
    ,
    t.ALPHANUMERIC_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",
    t.GB2312_SUBSET = 1,
    t
}()
  , F9 = function() {
    function t(e) {
        this.mirrored = e
    }
    return t.prototype.isMirrored = function() {
        return this.mirrored
    }
    ,
    t.prototype.applyMirroredCorrection = function(e) {
        if (!(!this.mirrored || e === null || e.length < 3)) {
            var n = e[0];
            e[0] = e[2],
            e[2] = n
        }
    }
    ,
    t
}()
  , GP = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , Wwe = function() {
    function t() {
        this.rsDecoder = new _m(Sr.QR_CODE_FIELD_256)
    }
    return t.prototype.decodeBooleanArray = function(e, n) {
        return this.decodeBitMatrix(xo.parseFromBooleanArray(e), n)
    }
    ,
    t.prototype.decodeBitMatrix = function(e, n) {
        var r = new Vwe(e)
          , i = null;
        try {
            return this.decodeBitMatrixParser(r, n)
        } catch (s) {
            i = s
        }
        try {
            r.remask(),
            r.setMirror(!0),
            r.readVersion(),
            r.readFormatInformation(),
            r.mirror();
            var o = this.decodeBitMatrixParser(r, n);
            return o.setOther(new F9(!0)),
            o
        } catch (s) {
            throw i !== null ? i : s
        }
    }
    ,
    t.prototype.decodeBitMatrixParser = function(e, n) {
        var r, i, o, s, a = e.readVersion(), l = e.readFormatInformation().getErrorCorrectionLevel(), c = e.readCodewords(), u = zwe.getDataBlocks(c, a, l), f = 0;
        try {
            for (var d = GP(u), h = d.next(); !h.done; h = d.next()) {
                var p = h.value;
                f += p.getNumDataCodewords()
            }
        } catch (w) {
            r = {
                error: w
            }
        } finally {
            try {
                h && !h.done && (i = d.return) && i.call(d)
            } finally {
                if (r)
                    throw r.error
            }
        }
        var y = new Uint8Array(f)
          , v = 0;
        try {
            for (var g = GP(u), m = g.next(); !m.done; m = g.next()) {
                var p = m.value
                  , _ = p.getCodewords()
                  , x = p.getNumDataCodewords();
                this.correctErrors(_, x);
                for (var b = 0; b < x; b++)
                    y[v++] = _[b]
            }
        } catch (w) {
            o = {
                error: w
            }
        } finally {
            try {
                m && !m.done && (s = g.return) && s.call(g)
            } finally {
                if (o)
                    throw o.error
            }
        }
        return jwe.decode(y, a, l, n)
    }
    ,
    t.prototype.correctErrors = function(e, n) {
        var r = new Int32Array(e);
        try {
            this.rsDecoder.decode(r, e.length - n)
        } catch {
            throw new fn
        }
        for (var i = 0; i < n; i++)
            e[i] = r[i]
    }
    ,
    t
}()
  , Ywe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Xwe = function(t) {
    Ywe(e, t);
    function e(n, r, i) {
        var o = t.call(this, n, r) || this;
        return o.estimatedModuleSize = i,
        o
    }
    return e.prototype.aboutEquals = function(n, r, i) {
        if (Math.abs(r - this.getY()) <= n && Math.abs(i - this.getX()) <= n) {
            var o = Math.abs(n - this.estimatedModuleSize);
            return o <= 1 || o <= this.estimatedModuleSize
        }
        return !1
    }
    ,
    e.prototype.combineEstimate = function(n, r, i) {
        var o = (this.getX() + r) / 2
          , s = (this.getY() + n) / 2
          , a = (this.estimatedModuleSize + i) / 2;
        return new e(o,s,a)
    }
    ,
    e
}(Pe)
  , Kwe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , qwe = function() {
    function t(e, n, r, i, o, s, a) {
        this.image = e,
        this.startX = n,
        this.startY = r,
        this.width = i,
        this.height = o,
        this.moduleSize = s,
        this.resultPointCallback = a,
        this.possibleCenters = [],
        this.crossCheckStateCount = new Int32Array(3)
    }
    return t.prototype.find = function() {
        for (var e = this.startX, n = this.height, r = this.width, i = e + r, o = this.startY + n / 2, s = new Int32Array(3), a = this.image, l = 0; l < n; l++) {
            var c = o + (l & 1 ? -Math.floor((l + 1) / 2) : Math.floor((l + 1) / 2));
            s[0] = 0,
            s[1] = 0,
            s[2] = 0;
            for (var u = e; u < i && !a.get(u, c); )
                u++;
            for (var f = 0; u < i; ) {
                if (a.get(u, c))
                    if (f === 1)
                        s[1]++;
                    else if (f === 2) {
                        if (this.foundPatternCross(s)) {
                            var d = this.handlePossibleCenter(s, c, u);
                            if (d !== null)
                                return d
                        }
                        s[0] = s[2],
                        s[1] = 1,
                        s[2] = 0,
                        f = 1
                    } else
                        s[++f]++;
                else
                    f === 1 && f++,
                    s[f]++;
                u++
            }
            if (this.foundPatternCross(s)) {
                var d = this.handlePossibleCenter(s, c, i);
                if (d !== null)
                    return d
            }
        }
        if (this.possibleCenters.length !== 0)
            return this.possibleCenters[0];
        throw new oe
    }
    ,
    t.centerFromEnd = function(e, n) {
        return n - e[2] - e[1] / 2
    }
    ,
    t.prototype.foundPatternCross = function(e) {
        for (var n = this.moduleSize, r = n / 2, i = 0; i < 3; i++)
            if (Math.abs(n - e[i]) >= r)
                return !1;
        return !0
    }
    ,
    t.prototype.crossCheckVertical = function(e, n, r, i) {
        var o = this.image
          , s = o.getHeight()
          , a = this.crossCheckStateCount;
        a[0] = 0,
        a[1] = 0,
        a[2] = 0;
        for (var l = e; l >= 0 && o.get(n, l) && a[1] <= r; )
            a[1]++,
            l--;
        if (l < 0 || a[1] > r)
            return NaN;
        for (; l >= 0 && !o.get(n, l) && a[0] <= r; )
            a[0]++,
            l--;
        if (a[0] > r)
            return NaN;
        for (l = e + 1; l < s && o.get(n, l) && a[1] <= r; )
            a[1]++,
            l++;
        if (l === s || a[1] > r)
            return NaN;
        for (; l < s && !o.get(n, l) && a[2] <= r; )
            a[2]++,
            l++;
        if (a[2] > r)
            return NaN;
        var c = a[0] + a[1] + a[2];
        return 5 * Math.abs(c - i) >= 2 * i ? NaN : this.foundPatternCross(a) ? t.centerFromEnd(a, l) : NaN
    }
    ,
    t.prototype.handlePossibleCenter = function(e, n, r) {
        var i, o, s = e[0] + e[1] + e[2], a = t.centerFromEnd(e, r), l = this.crossCheckVertical(n, a, 2 * e[1], s);
        if (!isNaN(l)) {
            var c = (e[0] + e[1] + e[2]) / 3;
            try {
                for (var u = Kwe(this.possibleCenters), f = u.next(); !f.done; f = u.next()) {
                    var d = f.value;
                    if (d.aboutEquals(c, l, a))
                        return d.combineEstimate(l, a, c)
                }
            } catch (p) {
                i = {
                    error: p
                }
            } finally {
                try {
                    f && !f.done && (o = u.return) && o.call(u)
                } finally {
                    if (i)
                        throw i.error
                }
            }
            var h = new Xwe(a,l,c);
            this.possibleCenters.push(h),
            this.resultPointCallback !== null && this.resultPointCallback !== void 0 && this.resultPointCallback.foundPossibleResultPoint(h)
        }
        return null
    }
    ,
    t
}()
  , Zwe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Jwe = function(t) {
    Zwe(e, t);
    function e(n, r, i, o) {
        var s = t.call(this, n, r) || this;
        return s.estimatedModuleSize = i,
        s.count = o,
        o === void 0 && (s.count = 1),
        s
    }
    return e.prototype.getEstimatedModuleSize = function() {
        return this.estimatedModuleSize
    }
    ,
    e.prototype.getCount = function() {
        return this.count
    }
    ,
    e.prototype.aboutEquals = function(n, r, i) {
        if (Math.abs(r - this.getY()) <= n && Math.abs(i - this.getX()) <= n) {
            var o = Math.abs(n - this.estimatedModuleSize);
            return o <= 1 || o <= this.estimatedModuleSize
        }
        return !1
    }
    ,
    e.prototype.combineEstimate = function(n, r, i) {
        var o = this.count + 1
          , s = (this.count * this.getX() + r) / o
          , a = (this.count * this.getY() + n) / o
          , l = (this.count * this.estimatedModuleSize + i) / o;
        return new e(s,a,l,o)
    }
    ,
    e
}(Pe)
  , Qwe = function() {
    function t(e) {
        this.bottomLeft = e[0],
        this.topLeft = e[1],
        this.topRight = e[2]
    }
    return t.prototype.getBottomLeft = function() {
        return this.bottomLeft
    }
    ,
    t.prototype.getTopLeft = function() {
        return this.topLeft
    }
    ,
    t.prototype.getTopRight = function() {
        return this.topRight
    }
    ,
    t
}()
  , Xu = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , e2e = function() {
    function t(e, n) {
        this.image = e,
        this.resultPointCallback = n,
        this.possibleCenters = [],
        this.crossCheckStateCount = new Int32Array(5),
        this.resultPointCallback = n
    }
    return t.prototype.getImage = function() {
        return this.image
    }
    ,
    t.prototype.getPossibleCenters = function() {
        return this.possibleCenters
    }
    ,
    t.prototype.find = function(e) {
        var n = e != null && e.get(Ot.TRY_HARDER) !== void 0
          , r = e != null && e.get(Ot.PURE_BARCODE) !== void 0
          , i = this.image
          , o = i.getHeight()
          , s = i.getWidth()
          , a = Math.floor(3 * o / (4 * t.MAX_MODULES));
        (a < t.MIN_SKIP || n) && (a = t.MIN_SKIP);
        for (var l = !1, c = new Int32Array(5), u = a - 1; u < o && !l; u += a) {
            c[0] = 0,
            c[1] = 0,
            c[2] = 0,
            c[3] = 0,
            c[4] = 0;
            for (var f = 0, d = 0; d < s; d++)
                if (i.get(d, u))
                    (f & 1) === 1 && f++,
                    c[f]++;
                else if (f & 1)
                    c[f]++;
                else if (f === 4)
                    if (t.foundPatternCross(c)) {
                        var h = this.handlePossibleCenter(c, u, d, r);
                        if (h === !0)
                            if (a = 2,
                            this.hasSkipped === !0)
                                l = this.haveMultiplyConfirmedCenters();
                            else {
                                var p = this.findRowSkip();
                                p > c[2] && (u += p - c[2] - a,
                                d = s - 1)
                            }
                        else {
                            c[0] = c[2],
                            c[1] = c[3],
                            c[2] = c[4],
                            c[3] = 1,
                            c[4] = 0,
                            f = 3;
                            continue
                        }
                        f = 0,
                        c[0] = 0,
                        c[1] = 0,
                        c[2] = 0,
                        c[3] = 0,
                        c[4] = 0
                    } else
                        c[0] = c[2],
                        c[1] = c[3],
                        c[2] = c[4],
                        c[3] = 1,
                        c[4] = 0,
                        f = 3;
                else
                    c[++f]++;
            if (t.foundPatternCross(c)) {
                var h = this.handlePossibleCenter(c, u, s, r);
                h === !0 && (a = c[0],
                this.hasSkipped && (l = this.haveMultiplyConfirmedCenters()))
            }
        }
        var y = this.selectBestPatterns();
        return Pe.orderBestPatterns(y),
        new Qwe(y)
    }
    ,
    t.centerFromEnd = function(e, n) {
        return n - e[4] - e[3] - e[2] / 2
    }
    ,
    t.foundPatternCross = function(e) {
        for (var n = 0, r = 0; r < 5; r++) {
            var i = e[r];
            if (i === 0)
                return !1;
            n += i
        }
        if (n < 7)
            return !1;
        var o = n / 7
          , s = o / 2;
        return Math.abs(o - e[0]) < s && Math.abs(o - e[1]) < s && Math.abs(3 * o - e[2]) < 3 * s && Math.abs(o - e[3]) < s && Math.abs(o - e[4]) < s
    }
    ,
    t.prototype.getCrossCheckStateCount = function() {
        var e = this.crossCheckStateCount;
        return e[0] = 0,
        e[1] = 0,
        e[2] = 0,
        e[3] = 0,
        e[4] = 0,
        e
    }
    ,
    t.prototype.crossCheckDiagonal = function(e, n, r, i) {
        for (var o = this.getCrossCheckStateCount(), s = 0, a = this.image; e >= s && n >= s && a.get(n - s, e - s); )
            o[2]++,
            s++;
        if (e < s || n < s)
            return !1;
        for (; e >= s && n >= s && !a.get(n - s, e - s) && o[1] <= r; )
            o[1]++,
            s++;
        if (e < s || n < s || o[1] > r)
            return !1;
        for (; e >= s && n >= s && a.get(n - s, e - s) && o[0] <= r; )
            o[0]++,
            s++;
        if (o[0] > r)
            return !1;
        var l = a.getHeight()
          , c = a.getWidth();
        for (s = 1; e + s < l && n + s < c && a.get(n + s, e + s); )
            o[2]++,
            s++;
        if (e + s >= l || n + s >= c)
            return !1;
        for (; e + s < l && n + s < c && !a.get(n + s, e + s) && o[3] < r; )
            o[3]++,
            s++;
        if (e + s >= l || n + s >= c || o[3] >= r)
            return !1;
        for (; e + s < l && n + s < c && a.get(n + s, e + s) && o[4] < r; )
            o[4]++,
            s++;
        if (o[4] >= r)
            return !1;
        var u = o[0] + o[1] + o[2] + o[3] + o[4];
        return Math.abs(u - i) < 2 * i && t.foundPatternCross(o)
    }
    ,
    t.prototype.crossCheckVertical = function(e, n, r, i) {
        for (var o = this.image, s = o.getHeight(), a = this.getCrossCheckStateCount(), l = e; l >= 0 && o.get(n, l); )
            a[2]++,
            l--;
        if (l < 0)
            return NaN;
        for (; l >= 0 && !o.get(n, l) && a[1] <= r; )
            a[1]++,
            l--;
        if (l < 0 || a[1] > r)
            return NaN;
        for (; l >= 0 && o.get(n, l) && a[0] <= r; )
            a[0]++,
            l--;
        if (a[0] > r)
            return NaN;
        for (l = e + 1; l < s && o.get(n, l); )
            a[2]++,
            l++;
        if (l === s)
            return NaN;
        for (; l < s && !o.get(n, l) && a[3] < r; )
            a[3]++,
            l++;
        if (l === s || a[3] >= r)
            return NaN;
        for (; l < s && o.get(n, l) && a[4] < r; )
            a[4]++,
            l++;
        if (a[4] >= r)
            return NaN;
        var c = a[0] + a[1] + a[2] + a[3] + a[4];
        return 5 * Math.abs(c - i) >= 2 * i ? NaN : t.foundPatternCross(a) ? t.centerFromEnd(a, l) : NaN
    }
    ,
    t.prototype.crossCheckHorizontal = function(e, n, r, i) {
        for (var o = this.image, s = o.getWidth(), a = this.getCrossCheckStateCount(), l = e; l >= 0 && o.get(l, n); )
            a[2]++,
            l--;
        if (l < 0)
            return NaN;
        for (; l >= 0 && !o.get(l, n) && a[1] <= r; )
            a[1]++,
            l--;
        if (l < 0 || a[1] > r)
            return NaN;
        for (; l >= 0 && o.get(l, n) && a[0] <= r; )
            a[0]++,
            l--;
        if (a[0] > r)
            return NaN;
        for (l = e + 1; l < s && o.get(l, n); )
            a[2]++,
            l++;
        if (l === s)
            return NaN;
        for (; l < s && !o.get(l, n) && a[3] < r; )
            a[3]++,
            l++;
        if (l === s || a[3] >= r)
            return NaN;
        for (; l < s && o.get(l, n) && a[4] < r; )
            a[4]++,
            l++;
        if (a[4] >= r)
            return NaN;
        var c = a[0] + a[1] + a[2] + a[3] + a[4];
        return 5 * Math.abs(c - i) >= i ? NaN : t.foundPatternCross(a) ? t.centerFromEnd(a, l) : NaN
    }
    ,
    t.prototype.handlePossibleCenter = function(e, n, r, i) {
        var o = e[0] + e[1] + e[2] + e[3] + e[4]
          , s = t.centerFromEnd(e, r)
          , a = this.crossCheckVertical(n, Math.floor(s), e[2], o);
        if (!isNaN(a) && (s = this.crossCheckHorizontal(Math.floor(s), Math.floor(a), e[2], o),
        !isNaN(s) && (!i || this.crossCheckDiagonal(Math.floor(a), Math.floor(s), e[2], o)))) {
            for (var l = o / 7, c = !1, u = this.possibleCenters, f = 0, d = u.length; f < d; f++) {
                var h = u[f];
                if (h.aboutEquals(l, a, s)) {
                    u[f] = h.combineEstimate(a, s, l),
                    c = !0;
                    break
                }
            }
            if (!c) {
                var p = new Jwe(s,a,l);
                u.push(p),
                this.resultPointCallback !== null && this.resultPointCallback !== void 0 && this.resultPointCallback.foundPossibleResultPoint(p)
            }
            return !0
        }
        return !1
    }
    ,
    t.prototype.findRowSkip = function() {
        var e, n, r = this.possibleCenters.length;
        if (r <= 1)
            return 0;
        var i = null;
        try {
            for (var o = Xu(this.possibleCenters), s = o.next(); !s.done; s = o.next()) {
                var a = s.value;
                if (a.getCount() >= t.CENTER_QUORUM)
                    if (i == null)
                        i = a;
                    else
                        return this.hasSkipped = !0,
                        Math.floor((Math.abs(i.getX() - a.getX()) - Math.abs(i.getY() - a.getY())) / 2)
            }
        } catch (l) {
            e = {
                error: l
            }
        } finally {
            try {
                s && !s.done && (n = o.return) && n.call(o)
            } finally {
                if (e)
                    throw e.error
            }
        }
        return 0
    }
    ,
    t.prototype.haveMultiplyConfirmedCenters = function() {
        var e, n, r, i, o = 0, s = 0, a = this.possibleCenters.length;
        try {
            for (var l = Xu(this.possibleCenters), c = l.next(); !c.done; c = l.next()) {
                var u = c.value;
                u.getCount() >= t.CENTER_QUORUM && (o++,
                s += u.getEstimatedModuleSize())
            }
        } catch (y) {
            e = {
                error: y
            }
        } finally {
            try {
                c && !c.done && (n = l.return) && n.call(l)
            } finally {
                if (e)
                    throw e.error
            }
        }
        if (o < 3)
            return !1;
        var f = s / a
          , d = 0;
        try {
            for (var h = Xu(this.possibleCenters), p = h.next(); !p.done; p = h.next()) {
                var u = p.value;
                d += Math.abs(u.getEstimatedModuleSize() - f)
            }
        } catch (y) {
            r = {
                error: y
            }
        } finally {
            try {
                p && !p.done && (i = h.return) && i.call(h)
            } finally {
                if (r)
                    throw r.error
            }
        }
        return d <= .05 * s
    }
    ,
    t.prototype.selectBestPatterns = function() {
        var e, n, r, i, o = this.possibleCenters.length;
        if (o < 3)
            throw new oe;
        var s = this.possibleCenters, a;
        if (o > 3) {
            var l = 0
              , c = 0;
            try {
                for (var u = Xu(this.possibleCenters), f = u.next(); !f.done; f = u.next()) {
                    var d = f.value
                      , h = d.getEstimatedModuleSize();
                    l += h,
                    c += h * h
                }
            } catch (b) {
                e = {
                    error: b
                }
            } finally {
                try {
                    f && !f.done && (n = u.return) && n.call(u)
                } finally {
                    if (e)
                        throw e.error
                }
            }
            a = l / o;
            var p = Math.sqrt(c / o - a * a);
            s.sort(function(b, w) {
                var E = Math.abs(w.getEstimatedModuleSize() - a)
                  , S = Math.abs(b.getEstimatedModuleSize() - a);
                return E < S ? -1 : E > S ? 1 : 0
            });
            for (var y = Math.max(.2 * a, p), v = 0; v < s.length && s.length > 3; v++) {
                var g = s[v];
                Math.abs(g.getEstimatedModuleSize() - a) > y && (s.splice(v, 1),
                v--)
            }
        }
        if (s.length > 3) {
            var l = 0;
            try {
                for (var m = Xu(s), _ = m.next(); !_.done; _ = m.next()) {
                    var x = _.value;
                    l += x.getEstimatedModuleSize()
                }
            } catch (w) {
                r = {
                    error: w
                }
            } finally {
                try {
                    _ && !_.done && (i = m.return) && i.call(m)
                } finally {
                    if (r)
                        throw r.error
                }
            }
            a = l / s.length,
            s.sort(function(w, E) {
                if (E.getCount() === w.getCount()) {
                    var S = Math.abs(E.getEstimatedModuleSize() - a)
                      , P = Math.abs(w.getEstimatedModuleSize() - a);
                    return S < P ? 1 : S > P ? -1 : 0
                } else
                    return E.getCount() - w.getCount()
            }),
            s.splice(3)
        }
        return [s[0], s[1], s[2]]
    }
    ,
    t.CENTER_QUORUM = 2,
    t.MIN_SKIP = 3,
    t.MAX_MODULES = 57,
    t
}()
  , t2e = function() {
    function t(e) {
        this.image = e
    }
    return t.prototype.getImage = function() {
        return this.image
    }
    ,
    t.prototype.getResultPointCallback = function() {
        return this.resultPointCallback
    }
    ,
    t.prototype.detect = function(e) {
        this.resultPointCallback = e == null ? null : e.get(Ot.NEED_RESULT_POINT_CALLBACK);
        var n = new e2e(this.image,this.resultPointCallback)
          , r = n.find(e);
        return this.processFinderPatternInfo(r)
    }
    ,
    t.prototype.processFinderPatternInfo = function(e) {
        var n = e.getTopLeft()
          , r = e.getTopRight()
          , i = e.getBottomLeft()
          , o = this.calculateModuleSize(n, r, i);
        if (o < 1)
            throw new oe("No pattern found in proccess finder.");
        var s = t.computeDimension(n, r, i, o)
          , a = ol.getProvisionalVersionForDimension(s)
          , l = a.getDimensionForVersion() - 7
          , c = null;
        if (a.getAlignmentPatternCenters().length > 0)
            for (var u = r.getX() - n.getX() + i.getX(), f = r.getY() - n.getY() + i.getY(), d = 1 - 3 / l, h = Math.floor(n.getX() + d * (u - n.getX())), p = Math.floor(n.getY() + d * (f - n.getY())), y = 4; y <= 16; y <<= 1)
                try {
                    c = this.findAlignmentInRegion(o, h, p, y);
                    break
                } catch (_) {
                    if (!(_ instanceof oe))
                        throw _
                }
        var v = t.createTransform(n, r, i, c, s), g = t.sampleGrid(this.image, v, s), m;
        return c === null ? m = [i, n, r] : m = [i, n, r, c],
        new cE(g,m)
    }
    ,
    t.createTransform = function(e, n, r, i, o) {
        var s = o - 3.5, a, l, c, u;
        return i !== null ? (a = i.getX(),
        l = i.getY(),
        c = s - 3,
        u = c) : (a = n.getX() - e.getX() + r.getX(),
        l = n.getY() - e.getY() + r.getY(),
        c = s,
        u = s),
        R9.quadrilateralToQuadrilateral(3.5, 3.5, s, 3.5, c, u, 3.5, s, e.getX(), e.getY(), n.getX(), n.getY(), a, l, r.getX(), r.getY())
    }
    ,
    t.sampleGrid = function(e, n, r) {
        var i = uE.getInstance();
        return i.sampleGridWithTransform(e, r, r, n)
    }
    ,
    t.computeDimension = function(e, n, r, i) {
        var o = ft.round(Pe.distance(e, n) / i)
          , s = ft.round(Pe.distance(e, r) / i)
          , a = Math.floor((o + s) / 2) + 7;
        switch (a & 3) {
        case 0:
            a++;
            break;
        case 2:
            a--;
            break;
        case 3:
            throw new oe("Dimensions could be not found.")
        }
        return a
    }
    ,
    t.prototype.calculateModuleSize = function(e, n, r) {
        return (this.calculateModuleSizeOneWay(e, n) + this.calculateModuleSizeOneWay(e, r)) / 2
    }
    ,
    t.prototype.calculateModuleSizeOneWay = function(e, n) {
        var r = this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()), Math.floor(e.getY()), Math.floor(n.getX()), Math.floor(n.getY()))
          , i = this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()), Math.floor(n.getY()), Math.floor(e.getX()), Math.floor(e.getY()));
        return isNaN(r) ? i / 7 : isNaN(i) ? r / 7 : (r + i) / 14
    }
    ,
    t.prototype.sizeOfBlackWhiteBlackRunBothWays = function(e, n, r, i) {
        var o = this.sizeOfBlackWhiteBlackRun(e, n, r, i)
          , s = 1
          , a = e - (r - e);
        a < 0 ? (s = e / (e - a),
        a = 0) : a >= this.image.getWidth() && (s = (this.image.getWidth() - 1 - e) / (a - e),
        a = this.image.getWidth() - 1);
        var l = Math.floor(n - (i - n) * s);
        return s = 1,
        l < 0 ? (s = n / (n - l),
        l = 0) : l >= this.image.getHeight() && (s = (this.image.getHeight() - 1 - n) / (l - n),
        l = this.image.getHeight() - 1),
        a = Math.floor(e + (a - e) * s),
        o += this.sizeOfBlackWhiteBlackRun(e, n, a, l),
        o - 1
    }
    ,
    t.prototype.sizeOfBlackWhiteBlackRun = function(e, n, r, i) {
        var o = Math.abs(i - n) > Math.abs(r - e);
        if (o) {
            var s = e;
            e = n,
            n = s,
            s = r,
            r = i,
            i = s
        }
        for (var a = Math.abs(r - e), l = Math.abs(i - n), c = -a / 2, u = e < r ? 1 : -1, f = n < i ? 1 : -1, d = 0, h = r + u, p = e, y = n; p !== h; p += u) {
            var v = o ? y : p
              , g = o ? p : y;
            if (d === 1 === this.image.get(v, g)) {
                if (d === 2)
                    return ft.distance(p, y, e, n);
                d++
            }
            if (c += l,
            c > 0) {
                if (y === i)
                    break;
                y += f,
                c -= a
            }
        }
        return d === 2 ? ft.distance(r + u, i, e, n) : NaN
    }
    ,
    t.prototype.findAlignmentInRegion = function(e, n, r, i) {
        var o = Math.floor(i * e)
          , s = Math.max(0, n - o)
          , a = Math.min(this.image.getWidth() - 1, n + o);
        if (a - s < e * 3)
            throw new oe("Alignment top exceeds estimated module size.");
        var l = Math.max(0, r - o)
          , c = Math.min(this.image.getHeight() - 1, r + o);
        if (c - l < e * 3)
            throw new oe("Alignment bottom exceeds estimated module size.");
        var u = new qwe(this.image,s,l,a - s,c - l,e,this.resultPointCallback);
        return u.find()
    }
    ,
    t
}()
  , n2e = function() {
    function t() {
        this.decoder = new Wwe
    }
    return t.prototype.getDecoder = function() {
        return this.decoder
    }
    ,
    t.prototype.decode = function(e, n) {
        var r, i;
        if (n != null && n.get(Ot.PURE_BARCODE) !== void 0) {
            var o = t.extractPureBits(e.getBlackMatrix());
            r = this.decoder.decodeBitMatrix(o, n),
            i = t.NO_POINTS
        } else {
            var s = new t2e(e.getBlackMatrix()).detect(n);
            r = this.decoder.decodeBitMatrix(s.getBits(), n),
            i = s.getPoints()
        }
        r.getOther()instanceof F9 && r.getOther().applyMirroredCorrection(i);
        var a = new tr(r.getText(),r.getRawBytes(),void 0,i,Be.QR_CODE,void 0)
          , l = r.getByteSegments();
        l !== null && a.putMetadata(Gn.BYTE_SEGMENTS, l);
        var c = r.getECLevel();
        return c !== null && a.putMetadata(Gn.ERROR_CORRECTION_LEVEL, c),
        r.hasStructuredAppend() && (a.putMetadata(Gn.STRUCTURED_APPEND_SEQUENCE, r.getStructuredAppendSequenceNumber()),
        a.putMetadata(Gn.STRUCTURED_APPEND_PARITY, r.getStructuredAppendParity())),
        a
    }
    ,
    t.prototype.reset = function() {}
    ,
    t.extractPureBits = function(e) {
        var n = e.getTopLeftOnBit()
          , r = e.getBottomRightOnBit();
        if (n === null || r === null)
            throw new oe;
        var i = this.moduleSize(n, e)
          , o = n[1]
          , s = r[1]
          , a = n[0]
          , l = r[0];
        if (a >= l || o >= s)
            throw new oe;
        if (s - o !== l - a && (l = a + (s - o),
        l >= e.getWidth()))
            throw new oe;
        var c = Math.round((l - a + 1) / i)
          , u = Math.round((s - o + 1) / i);
        if (c <= 0 || u <= 0)
            throw new oe;
        if (u !== c)
            throw new oe;
        var f = Math.floor(i / 2);
        o += f,
        a += f;
        var d = a + Math.floor((c - 1) * i) - l;
        if (d > 0) {
            if (d > f)
                throw new oe;
            a -= d
        }
        var h = o + Math.floor((u - 1) * i) - s;
        if (h > 0) {
            if (h > f)
                throw new oe;
            o -= h
        }
        for (var p = new xo(c,u), y = 0; y < u; y++)
            for (var v = o + Math.floor(y * i), g = 0; g < c; g++)
                e.get(a + Math.floor(g * i), v) && p.set(g, y);
        return p
    }
    ,
    t.moduleSize = function(e, n) {
        for (var r = n.getHeight(), i = n.getWidth(), o = e[0], s = e[1], a = !0, l = 0; o < i && s < r; ) {
            if (a !== n.get(o, s)) {
                if (++l === 5)
                    break;
                a = !a
            }
            o++,
            s++
        }
        if (o === i || s === r)
            throw new oe;
        return (o - e[0]) / 7
    }
    ,
    t.NO_POINTS = new Array,
    t
}();
const H0 = n2e;
var r2e = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, at = function() {
    function t() {}
    return t.prototype.PDF417Common = function() {}
    ,
    t.getBitCountSum = function(e) {
        return ft.sum(e)
    }
    ,
    t.toIntArray = function(e) {
        var n, r;
        if (e == null || !e.length)
            return t.EMPTY_INT_ARRAY;
        var i = new Int32Array(e.length)
          , o = 0;
        try {
            for (var s = r2e(e), a = s.next(); !a.done; a = s.next()) {
                var l = a.value;
                i[o++] = l
            }
        } catch (c) {
            n = {
                error: c
            }
        } finally {
            try {
                a && !a.done && (r = s.return) && r.call(s)
            } finally {
                if (n)
                    throw n.error
            }
        }
        return i
    }
    ,
    t.getCodeword = function(e) {
        var n = bn.binarySearch(t.SYMBOL_TABLE, e & 262143);
        return n < 0 ? -1 : (t.CODEWORD_TABLE[n] - 1) % t.NUMBER_OF_CODEWORDS
    }
    ,
    t.NUMBER_OF_CODEWORDS = 929,
    t.MAX_CODEWORDS_IN_BARCODE = t.NUMBER_OF_CODEWORDS - 1,
    t.MIN_ROWS_IN_BARCODE = 3,
    t.MAX_ROWS_IN_BARCODE = 90,
    t.MODULES_IN_CODEWORD = 17,
    t.MODULES_IN_STOP_PATTERN = 18,
    t.BARS_IN_MODULE = 8,
    t.EMPTY_INT_ARRAY = new Int32Array([]),
    t.SYMBOL_TABLE = Int32Array.from([66142, 66170, 66206, 66236, 66290, 66292, 66350, 66382, 66396, 66454, 66470, 66476, 66594, 66600, 66614, 66626, 66628, 66632, 66640, 66654, 66662, 66668, 66682, 66690, 66718, 66720, 66748, 66758, 66776, 66798, 66802, 66804, 66820, 66824, 66832, 66846, 66848, 66876, 66880, 66936, 66950, 66956, 66968, 66992, 67006, 67022, 67036, 67042, 67044, 67048, 67062, 67118, 67150, 67164, 67214, 67228, 67256, 67294, 67322, 67350, 67366, 67372, 67398, 67404, 67416, 67438, 67474, 67476, 67490, 67492, 67496, 67510, 67618, 67624, 67650, 67656, 67664, 67678, 67686, 67692, 67706, 67714, 67716, 67728, 67742, 67744, 67772, 67782, 67788, 67800, 67822, 67826, 67828, 67842, 67848, 67870, 67872, 67900, 67904, 67960, 67974, 67992, 68016, 68030, 68046, 68060, 68066, 68068, 68072, 68086, 68104, 68112, 68126, 68128, 68156, 68160, 68216, 68336, 68358, 68364, 68376, 68400, 68414, 68448, 68476, 68494, 68508, 68536, 68546, 68548, 68552, 68560, 68574, 68582, 68588, 68654, 68686, 68700, 68706, 68708, 68712, 68726, 68750, 68764, 68792, 68802, 68804, 68808, 68816, 68830, 68838, 68844, 68858, 68878, 68892, 68920, 68976, 68990, 68994, 68996, 69e3, 69008, 69022, 69024, 69052, 69062, 69068, 69080, 69102, 69106, 69108, 69142, 69158, 69164, 69190, 69208, 69230, 69254, 69260, 69272, 69296, 69310, 69326, 69340, 69386, 69394, 69396, 69410, 69416, 69430, 69442, 69444, 69448, 69456, 69470, 69478, 69484, 69554, 69556, 69666, 69672, 69698, 69704, 69712, 69726, 69754, 69762, 69764, 69776, 69790, 69792, 69820, 69830, 69836, 69848, 69870, 69874, 69876, 69890, 69918, 69920, 69948, 69952, 70008, 70022, 70040, 70064, 70078, 70094, 70108, 70114, 70116, 70120, 70134, 70152, 70174, 70176, 70264, 70384, 70412, 70448, 70462, 70496, 70524, 70542, 70556, 70584, 70594, 70600, 70608, 70622, 70630, 70636, 70664, 70672, 70686, 70688, 70716, 70720, 70776, 70896, 71136, 71180, 71192, 71216, 71230, 71264, 71292, 71360, 71416, 71452, 71480, 71536, 71550, 71554, 71556, 71560, 71568, 71582, 71584, 71612, 71622, 71628, 71640, 71662, 71726, 71732, 71758, 71772, 71778, 71780, 71784, 71798, 71822, 71836, 71864, 71874, 71880, 71888, 71902, 71910, 71916, 71930, 71950, 71964, 71992, 72048, 72062, 72066, 72068, 72080, 72094, 72096, 72124, 72134, 72140, 72152, 72174, 72178, 72180, 72206, 72220, 72248, 72304, 72318, 72416, 72444, 72456, 72464, 72478, 72480, 72508, 72512, 72568, 72588, 72600, 72624, 72638, 72654, 72668, 72674, 72676, 72680, 72694, 72726, 72742, 72748, 72774, 72780, 72792, 72814, 72838, 72856, 72880, 72894, 72910, 72924, 72930, 72932, 72936, 72950, 72966, 72972, 72984, 73008, 73022, 73056, 73084, 73102, 73116, 73144, 73156, 73160, 73168, 73182, 73190, 73196, 73210, 73226, 73234, 73236, 73250, 73252, 73256, 73270, 73282, 73284, 73296, 73310, 73318, 73324, 73346, 73348, 73352, 73360, 73374, 73376, 73404, 73414, 73420, 73432, 73454, 73498, 73518, 73522, 73524, 73550, 73564, 73570, 73572, 73576, 73590, 73800, 73822, 73858, 73860, 73872, 73886, 73888, 73916, 73944, 73970, 73972, 73992, 74014, 74016, 74044, 74048, 74104, 74118, 74136, 74160, 74174, 74210, 74212, 74216, 74230, 74244, 74256, 74270, 74272, 74360, 74480, 74502, 74508, 74544, 74558, 74592, 74620, 74638, 74652, 74680, 74690, 74696, 74704, 74726, 74732, 74782, 74784, 74812, 74992, 75232, 75288, 75326, 75360, 75388, 75456, 75512, 75576, 75632, 75646, 75650, 75652, 75664, 75678, 75680, 75708, 75718, 75724, 75736, 75758, 75808, 75836, 75840, 75896, 76016, 76256, 76736, 76824, 76848, 76862, 76896, 76924, 76992, 77048, 77296, 77340, 77368, 77424, 77438, 77536, 77564, 77572, 77576, 77584, 77600, 77628, 77632, 77688, 77702, 77708, 77720, 77744, 77758, 77774, 77788, 77870, 77902, 77916, 77922, 77928, 77966, 77980, 78008, 78018, 78024, 78032, 78046, 78060, 78074, 78094, 78136, 78192, 78206, 78210, 78212, 78224, 78238, 78240, 78268, 78278, 78284, 78296, 78322, 78324, 78350, 78364, 78448, 78462, 78560, 78588, 78600, 78622, 78624, 78652, 78656, 78712, 78726, 78744, 78768, 78782, 78798, 78812, 78818, 78820, 78824, 78838, 78862, 78876, 78904, 78960, 78974, 79072, 79100, 79296, 79352, 79368, 79376, 79390, 79392, 79420, 79424, 79480, 79600, 79628, 79640, 79664, 79678, 79712, 79740, 79772, 79800, 79810, 79812, 79816, 79824, 79838, 79846, 79852, 79894, 79910, 79916, 79942, 79948, 79960, 79982, 79988, 80006, 80024, 80048, 80062, 80078, 80092, 80098, 80100, 80104, 80134, 80140, 80176, 80190, 80224, 80252, 80270, 80284, 80312, 80328, 80336, 80350, 80358, 80364, 80378, 80390, 80396, 80408, 80432, 80446, 80480, 80508, 80576, 80632, 80654, 80668, 80696, 80752, 80766, 80776, 80784, 80798, 80800, 80828, 80844, 80856, 80878, 80882, 80884, 80914, 80916, 80930, 80932, 80936, 80950, 80962, 80968, 80976, 80990, 80998, 81004, 81026, 81028, 81040, 81054, 81056, 81084, 81094, 81100, 81112, 81134, 81154, 81156, 81160, 81168, 81182, 81184, 81212, 81216, 81272, 81286, 81292, 81304, 81328, 81342, 81358, 81372, 81380, 81384, 81398, 81434, 81454, 81458, 81460, 81486, 81500, 81506, 81508, 81512, 81526, 81550, 81564, 81592, 81602, 81604, 81608, 81616, 81630, 81638, 81644, 81702, 81708, 81722, 81734, 81740, 81752, 81774, 81778, 81780, 82050, 82078, 82080, 82108, 82180, 82184, 82192, 82206, 82208, 82236, 82240, 82296, 82316, 82328, 82352, 82366, 82402, 82404, 82408, 82440, 82448, 82462, 82464, 82492, 82496, 82552, 82672, 82694, 82700, 82712, 82736, 82750, 82784, 82812, 82830, 82882, 82884, 82888, 82896, 82918, 82924, 82952, 82960, 82974, 82976, 83004, 83008, 83064, 83184, 83424, 83468, 83480, 83504, 83518, 83552, 83580, 83648, 83704, 83740, 83768, 83824, 83838, 83842, 83844, 83848, 83856, 83872, 83900, 83910, 83916, 83928, 83950, 83984, 84e3, 84028, 84032, 84088, 84208, 84448, 84928, 85040, 85054, 85088, 85116, 85184, 85240, 85488, 85560, 85616, 85630, 85728, 85756, 85764, 85768, 85776, 85790, 85792, 85820, 85824, 85880, 85894, 85900, 85912, 85936, 85966, 85980, 86048, 86080, 86136, 86256, 86496, 86976, 88160, 88188, 88256, 88312, 88560, 89056, 89200, 89214, 89312, 89340, 89536, 89592, 89608, 89616, 89632, 89664, 89720, 89840, 89868, 89880, 89904, 89952, 89980, 89998, 90012, 90040, 90190, 90204, 90254, 90268, 90296, 90306, 90308, 90312, 90334, 90382, 90396, 90424, 90480, 90494, 90500, 90504, 90512, 90526, 90528, 90556, 90566, 90572, 90584, 90610, 90612, 90638, 90652, 90680, 90736, 90750, 90848, 90876, 90884, 90888, 90896, 90910, 90912, 90940, 90944, 91e3, 91014, 91020, 91032, 91056, 91070, 91086, 91100, 91106, 91108, 91112, 91126, 91150, 91164, 91192, 91248, 91262, 91360, 91388, 91584, 91640, 91664, 91678, 91680, 91708, 91712, 91768, 91888, 91928, 91952, 91966, 92e3, 92028, 92046, 92060, 92088, 92098, 92100, 92104, 92112, 92126, 92134, 92140, 92188, 92216, 92272, 92384, 92412, 92608, 92664, 93168, 93200, 93214, 93216, 93244, 93248, 93304, 93424, 93664, 93720, 93744, 93758, 93792, 93820, 93888, 93944, 93980, 94008, 94064, 94078, 94084, 94088, 94096, 94110, 94112, 94140, 94150, 94156, 94168, 94246, 94252, 94278, 94284, 94296, 94318, 94342, 94348, 94360, 94384, 94398, 94414, 94428, 94440, 94470, 94476, 94488, 94512, 94526, 94560, 94588, 94606, 94620, 94648, 94658, 94660, 94664, 94672, 94686, 94694, 94700, 94714, 94726, 94732, 94744, 94768, 94782, 94816, 94844, 94912, 94968, 94990, 95004, 95032, 95088, 95102, 95112, 95120, 95134, 95136, 95164, 95180, 95192, 95214, 95218, 95220, 95244, 95256, 95280, 95294, 95328, 95356, 95424, 95480, 95728, 95758, 95772, 95800, 95856, 95870, 95968, 95996, 96008, 96016, 96030, 96032, 96060, 96064, 96120, 96152, 96176, 96190, 96220, 96226, 96228, 96232, 96290, 96292, 96296, 96310, 96322, 96324, 96328, 96336, 96350, 96358, 96364, 96386, 96388, 96392, 96400, 96414, 96416, 96444, 96454, 96460, 96472, 96494, 96498, 96500, 96514, 96516, 96520, 96528, 96542, 96544, 96572, 96576, 96632, 96646, 96652, 96664, 96688, 96702, 96718, 96732, 96738, 96740, 96744, 96758, 96772, 96776, 96784, 96798, 96800, 96828, 96832, 96888, 97008, 97030, 97036, 97048, 97072, 97086, 97120, 97148, 97166, 97180, 97208, 97220, 97224, 97232, 97246, 97254, 97260, 97326, 97330, 97332, 97358, 97372, 97378, 97380, 97384, 97398, 97422, 97436, 97464, 97474, 97476, 97480, 97488, 97502, 97510, 97516, 97550, 97564, 97592, 97648, 97666, 97668, 97672, 97680, 97694, 97696, 97724, 97734, 97740, 97752, 97774, 97830, 97836, 97850, 97862, 97868, 97880, 97902, 97906, 97908, 97926, 97932, 97944, 97968, 97998, 98012, 98018, 98020, 98024, 98038, 98618, 98674, 98676, 98838, 98854, 98874, 98892, 98904, 98926, 98930, 98932, 98968, 99006, 99042, 99044, 99048, 99062, 99166, 99194, 99246, 99286, 99350, 99366, 99372, 99386, 99398, 99416, 99438, 99442, 99444, 99462, 99504, 99518, 99534, 99548, 99554, 99556, 99560, 99574, 99590, 99596, 99608, 99632, 99646, 99680, 99708, 99726, 99740, 99768, 99778, 99780, 99784, 99792, 99806, 99814, 99820, 99834, 99858, 99860, 99874, 99880, 99894, 99906, 99920, 99934, 99962, 99970, 99972, 99976, 99984, 99998, 1e5, 100028, 100038, 100044, 100056, 100078, 100082, 100084, 100142, 100174, 100188, 100246, 100262, 100268, 100306, 100308, 100390, 100396, 100410, 100422, 100428, 100440, 100462, 100466, 100468, 100486, 100504, 100528, 100542, 100558, 100572, 100578, 100580, 100584, 100598, 100620, 100656, 100670, 100704, 100732, 100750, 100792, 100802, 100808, 100816, 100830, 100838, 100844, 100858, 100888, 100912, 100926, 100960, 100988, 101056, 101112, 101148, 101176, 101232, 101246, 101250, 101252, 101256, 101264, 101278, 101280, 101308, 101318, 101324, 101336, 101358, 101362, 101364, 101410, 101412, 101416, 101430, 101442, 101448, 101456, 101470, 101478, 101498, 101506, 101508, 101520, 101534, 101536, 101564, 101580, 101618, 101620, 101636, 101640, 101648, 101662, 101664, 101692, 101696, 101752, 101766, 101784, 101838, 101858, 101860, 101864, 101934, 101938, 101940, 101966, 101980, 101986, 101988, 101992, 102030, 102044, 102072, 102082, 102084, 102088, 102096, 102138, 102166, 102182, 102188, 102214, 102220, 102232, 102254, 102282, 102290, 102292, 102306, 102308, 102312, 102326, 102444, 102458, 102470, 102476, 102488, 102514, 102516, 102534, 102552, 102576, 102590, 102606, 102620, 102626, 102632, 102646, 102662, 102668, 102704, 102718, 102752, 102780, 102798, 102812, 102840, 102850, 102856, 102864, 102878, 102886, 102892, 102906, 102936, 102974, 103008, 103036, 103104, 103160, 103224, 103280, 103294, 103298, 103300, 103312, 103326, 103328, 103356, 103366, 103372, 103384, 103406, 103410, 103412, 103472, 103486, 103520, 103548, 103616, 103672, 103920, 103992, 104048, 104062, 104160, 104188, 104194, 104196, 104200, 104208, 104224, 104252, 104256, 104312, 104326, 104332, 104344, 104368, 104382, 104398, 104412, 104418, 104420, 104424, 104482, 104484, 104514, 104520, 104528, 104542, 104550, 104570, 104578, 104580, 104592, 104606, 104608, 104636, 104652, 104690, 104692, 104706, 104712, 104734, 104736, 104764, 104768, 104824, 104838, 104856, 104910, 104930, 104932, 104936, 104968, 104976, 104990, 104992, 105020, 105024, 105080, 105200, 105240, 105278, 105312, 105372, 105410, 105412, 105416, 105424, 105446, 105518, 105524, 105550, 105564, 105570, 105572, 105576, 105614, 105628, 105656, 105666, 105672, 105680, 105702, 105722, 105742, 105756, 105784, 105840, 105854, 105858, 105860, 105864, 105872, 105888, 105932, 105970, 105972, 106006, 106022, 106028, 106054, 106060, 106072, 106100, 106118, 106124, 106136, 106160, 106174, 106190, 106210, 106212, 106216, 106250, 106258, 106260, 106274, 106276, 106280, 106306, 106308, 106312, 106320, 106334, 106348, 106394, 106414, 106418, 106420, 106566, 106572, 106610, 106612, 106630, 106636, 106648, 106672, 106686, 106722, 106724, 106728, 106742, 106758, 106764, 106776, 106800, 106814, 106848, 106876, 106894, 106908, 106936, 106946, 106948, 106952, 106960, 106974, 106982, 106988, 107032, 107056, 107070, 107104, 107132, 107200, 107256, 107292, 107320, 107376, 107390, 107394, 107396, 107400, 107408, 107422, 107424, 107452, 107462, 107468, 107480, 107502, 107506, 107508, 107544, 107568, 107582, 107616, 107644, 107712, 107768, 108016, 108060, 108088, 108144, 108158, 108256, 108284, 108290, 108292, 108296, 108304, 108318, 108320, 108348, 108352, 108408, 108422, 108428, 108440, 108464, 108478, 108494, 108508, 108514, 108516, 108520, 108592, 108640, 108668, 108736, 108792, 109040, 109536, 109680, 109694, 109792, 109820, 110016, 110072, 110084, 110088, 110096, 110112, 110140, 110144, 110200, 110320, 110342, 110348, 110360, 110384, 110398, 110432, 110460, 110478, 110492, 110520, 110532, 110536, 110544, 110558, 110658, 110686, 110714, 110722, 110724, 110728, 110736, 110750, 110752, 110780, 110796, 110834, 110836, 110850, 110852, 110856, 110864, 110878, 110880, 110908, 110912, 110968, 110982, 111e3, 111054, 111074, 111076, 111080, 111108, 111112, 111120, 111134, 111136, 111164, 111168, 111224, 111344, 111372, 111422, 111456, 111516, 111554, 111556, 111560, 111568, 111590, 111632, 111646, 111648, 111676, 111680, 111736, 111856, 112096, 112152, 112224, 112252, 112320, 112440, 112514, 112516, 112520, 112528, 112542, 112544, 112588, 112686, 112718, 112732, 112782, 112796, 112824, 112834, 112836, 112840, 112848, 112870, 112890, 112910, 112924, 112952, 113008, 113022, 113026, 113028, 113032, 113040, 113054, 113056, 113100, 113138, 113140, 113166, 113180, 113208, 113264, 113278, 113376, 113404, 113416, 113424, 113440, 113468, 113472, 113560, 113614, 113634, 113636, 113640, 113686, 113702, 113708, 113734, 113740, 113752, 113778, 113780, 113798, 113804, 113816, 113840, 113854, 113870, 113890, 113892, 113896, 113926, 113932, 113944, 113968, 113982, 114016, 114044, 114076, 114114, 114116, 114120, 114128, 114150, 114170, 114194, 114196, 114210, 114212, 114216, 114242, 114244, 114248, 114256, 114270, 114278, 114306, 114308, 114312, 114320, 114334, 114336, 114364, 114380, 114420, 114458, 114478, 114482, 114484, 114510, 114524, 114530, 114532, 114536, 114842, 114866, 114868, 114970, 114994, 114996, 115042, 115044, 115048, 115062, 115130, 115226, 115250, 115252, 115278, 115292, 115298, 115300, 115304, 115318, 115342, 115394, 115396, 115400, 115408, 115422, 115430, 115436, 115450, 115478, 115494, 115514, 115526, 115532, 115570, 115572, 115738, 115758, 115762, 115764, 115790, 115804, 115810, 115812, 115816, 115830, 115854, 115868, 115896, 115906, 115912, 115920, 115934, 115942, 115948, 115962, 115996, 116024, 116080, 116094, 116098, 116100, 116104, 116112, 116126, 116128, 116156, 116166, 116172, 116184, 116206, 116210, 116212, 116246, 116262, 116268, 116282, 116294, 116300, 116312, 116334, 116338, 116340, 116358, 116364, 116376, 116400, 116414, 116430, 116444, 116450, 116452, 116456, 116498, 116500, 116514, 116520, 116534, 116546, 116548, 116552, 116560, 116574, 116582, 116588, 116602, 116654, 116694, 116714, 116762, 116782, 116786, 116788, 116814, 116828, 116834, 116836, 116840, 116854, 116878, 116892, 116920, 116930, 116936, 116944, 116958, 116966, 116972, 116986, 117006, 117048, 117104, 117118, 117122, 117124, 117136, 117150, 117152, 117180, 117190, 117196, 117208, 117230, 117234, 117236, 117304, 117360, 117374, 117472, 117500, 117506, 117508, 117512, 117520, 117536, 117564, 117568, 117624, 117638, 117644, 117656, 117680, 117694, 117710, 117724, 117730, 117732, 117736, 117750, 117782, 117798, 117804, 117818, 117830, 117848, 117874, 117876, 117894, 117936, 117950, 117966, 117986, 117988, 117992, 118022, 118028, 118040, 118064, 118078, 118112, 118140, 118172, 118210, 118212, 118216, 118224, 118238, 118246, 118266, 118306, 118312, 118338, 118352, 118366, 118374, 118394, 118402, 118404, 118408, 118416, 118430, 118432, 118460, 118476, 118514, 118516, 118574, 118578, 118580, 118606, 118620, 118626, 118628, 118632, 118678, 118694, 118700, 118730, 118738, 118740, 118830, 118834, 118836, 118862, 118876, 118882, 118884, 118888, 118902, 118926, 118940, 118968, 118978, 118980, 118984, 118992, 119006, 119014, 119020, 119034, 119068, 119096, 119152, 119166, 119170, 119172, 119176, 119184, 119198, 119200, 119228, 119238, 119244, 119256, 119278, 119282, 119284, 119324, 119352, 119408, 119422, 119520, 119548, 119554, 119556, 119560, 119568, 119582, 119584, 119612, 119616, 119672, 119686, 119692, 119704, 119728, 119742, 119758, 119772, 119778, 119780, 119784, 119798, 119920, 119934, 120032, 120060, 120256, 120312, 120324, 120328, 120336, 120352, 120384, 120440, 120560, 120582, 120588, 120600, 120624, 120638, 120672, 120700, 120718, 120732, 120760, 120770, 120772, 120776, 120784, 120798, 120806, 120812, 120870, 120876, 120890, 120902, 120908, 120920, 120946, 120948, 120966, 120972, 120984, 121008, 121022, 121038, 121058, 121060, 121064, 121078, 121100, 121112, 121136, 121150, 121184, 121212, 121244, 121282, 121284, 121288, 121296, 121318, 121338, 121356, 121368, 121392, 121406, 121440, 121468, 121536, 121592, 121656, 121730, 121732, 121736, 121744, 121758, 121760, 121804, 121842, 121844, 121890, 121922, 121924, 121928, 121936, 121950, 121958, 121978, 121986, 121988, 121992, 122e3, 122014, 122016, 122044, 122060, 122098, 122100, 122116, 122120, 122128, 122142, 122144, 122172, 122176, 122232, 122246, 122264, 122318, 122338, 122340, 122344, 122414, 122418, 122420, 122446, 122460, 122466, 122468, 122472, 122510, 122524, 122552, 122562, 122564, 122568, 122576, 122598, 122618, 122646, 122662, 122668, 122694, 122700, 122712, 122738, 122740, 122762, 122770, 122772, 122786, 122788, 122792, 123018, 123026, 123028, 123042, 123044, 123048, 123062, 123098, 123146, 123154, 123156, 123170, 123172, 123176, 123190, 123202, 123204, 123208, 123216, 123238, 123244, 123258, 123290, 123314, 123316, 123402, 123410, 123412, 123426, 123428, 123432, 123446, 123458, 123464, 123472, 123486, 123494, 123500, 123514, 123522, 123524, 123528, 123536, 123552, 123580, 123590, 123596, 123608, 123630, 123634, 123636, 123674, 123698, 123700, 123740, 123746, 123748, 123752, 123834, 123914, 123922, 123924, 123938, 123944, 123958, 123970, 123976, 123984, 123998, 124006, 124012, 124026, 124034, 124036, 124048, 124062, 124064, 124092, 124102, 124108, 124120, 124142, 124146, 124148, 124162, 124164, 124168, 124176, 124190, 124192, 124220, 124224, 124280, 124294, 124300, 124312, 124336, 124350, 124366, 124380, 124386, 124388, 124392, 124406, 124442, 124462, 124466, 124468, 124494, 124508, 124514, 124520, 124558, 124572, 124600, 124610, 124612, 124616, 124624, 124646, 124666, 124694, 124710, 124716, 124730, 124742, 124748, 124760, 124786, 124788, 124818, 124820, 124834, 124836, 124840, 124854, 124946, 124948, 124962, 124964, 124968, 124982, 124994, 124996, 125e3, 125008, 125022, 125030, 125036, 125050, 125058, 125060, 125064, 125072, 125086, 125088, 125116, 125126, 125132, 125144, 125166, 125170, 125172, 125186, 125188, 125192, 125200, 125216, 125244, 125248, 125304, 125318, 125324, 125336, 125360, 125374, 125390, 125404, 125410, 125412, 125416, 125430, 125444, 125448, 125456, 125472, 125504, 125560, 125680, 125702, 125708, 125720, 125744, 125758, 125792, 125820, 125838, 125852, 125880, 125890, 125892, 125896, 125904, 125918, 125926, 125932, 125978, 125998, 126002, 126004, 126030, 126044, 126050, 126052, 126056, 126094, 126108, 126136, 126146, 126148, 126152, 126160, 126182, 126202, 126222, 126236, 126264, 126320, 126334, 126338, 126340, 126344, 126352, 126366, 126368, 126412, 126450, 126452, 126486, 126502, 126508, 126522, 126534, 126540, 126552, 126574, 126578, 126580, 126598, 126604, 126616, 126640, 126654, 126670, 126684, 126690, 126692, 126696, 126738, 126754, 126756, 126760, 126774, 126786, 126788, 126792, 126800, 126814, 126822, 126828, 126842, 126894, 126898, 126900, 126934, 127126, 127142, 127148, 127162, 127178, 127186, 127188, 127254, 127270, 127276, 127290, 127302, 127308, 127320, 127342, 127346, 127348, 127370, 127378, 127380, 127394, 127396, 127400, 127450, 127510, 127526, 127532, 127546, 127558, 127576, 127598, 127602, 127604, 127622, 127628, 127640, 127664, 127678, 127694, 127708, 127714, 127716, 127720, 127734, 127754, 127762, 127764, 127778, 127784, 127810, 127812, 127816, 127824, 127838, 127846, 127866, 127898, 127918, 127922, 127924, 128022, 128038, 128044, 128058, 128070, 128076, 128088, 128110, 128114, 128116, 128134, 128140, 128152, 128176, 128190, 128206, 128220, 128226, 128228, 128232, 128246, 128262, 128268, 128280, 128304, 128318, 128352, 128380, 128398, 128412, 128440, 128450, 128452, 128456, 128464, 128478, 128486, 128492, 128506, 128522, 128530, 128532, 128546, 128548, 128552, 128566, 128578, 128580, 128584, 128592, 128606, 128614, 128634, 128642, 128644, 128648, 128656, 128670, 128672, 128700, 128716, 128754, 128756, 128794, 128814, 128818, 128820, 128846, 128860, 128866, 128868, 128872, 128886, 128918, 128934, 128940, 128954, 128978, 128980, 129178, 129198, 129202, 129204, 129238, 129258, 129306, 129326, 129330, 129332, 129358, 129372, 129378, 129380, 129384, 129398, 129430, 129446, 129452, 129466, 129482, 129490, 129492, 129562, 129582, 129586, 129588, 129614, 129628, 129634, 129636, 129640, 129654, 129678, 129692, 129720, 129730, 129732, 129736, 129744, 129758, 129766, 129772, 129814, 129830, 129836, 129850, 129862, 129868, 129880, 129902, 129906, 129908, 129930, 129938, 129940, 129954, 129956, 129960, 129974, 130010]),
    t.CODEWORD_TABLE = Int32Array.from([2627, 1819, 2622, 2621, 1813, 1812, 2729, 2724, 2723, 2779, 2774, 2773, 902, 896, 908, 868, 865, 861, 859, 2511, 873, 871, 1780, 835, 2493, 825, 2491, 842, 837, 844, 1764, 1762, 811, 810, 809, 2483, 807, 2482, 806, 2480, 815, 814, 813, 812, 2484, 817, 816, 1745, 1744, 1742, 1746, 2655, 2637, 2635, 2626, 2625, 2623, 2628, 1820, 2752, 2739, 2737, 2728, 2727, 2725, 2730, 2785, 2783, 2778, 2777, 2775, 2780, 787, 781, 747, 739, 736, 2413, 754, 752, 1719, 692, 689, 681, 2371, 678, 2369, 700, 697, 694, 703, 1688, 1686, 642, 638, 2343, 631, 2341, 627, 2338, 651, 646, 643, 2345, 654, 652, 1652, 1650, 1647, 1654, 601, 599, 2322, 596, 2321, 594, 2319, 2317, 611, 610, 608, 606, 2324, 603, 2323, 615, 614, 612, 1617, 1616, 1614, 1612, 616, 1619, 1618, 2575, 2538, 2536, 905, 901, 898, 909, 2509, 2507, 2504, 870, 867, 864, 860, 2512, 875, 872, 1781, 2490, 2489, 2487, 2485, 1748, 836, 834, 832, 830, 2494, 827, 2492, 843, 841, 839, 845, 1765, 1763, 2701, 2676, 2674, 2653, 2648, 2656, 2634, 2633, 2631, 2629, 1821, 2638, 2636, 2770, 2763, 2761, 2750, 2745, 2753, 2736, 2735, 2733, 2731, 1848, 2740, 2738, 2786, 2784, 591, 588, 576, 569, 566, 2296, 1590, 537, 534, 526, 2276, 522, 2274, 545, 542, 539, 548, 1572, 1570, 481, 2245, 466, 2242, 462, 2239, 492, 485, 482, 2249, 496, 494, 1534, 1531, 1528, 1538, 413, 2196, 406, 2191, 2188, 425, 419, 2202, 415, 2199, 432, 430, 427, 1472, 1467, 1464, 433, 1476, 1474, 368, 367, 2160, 365, 2159, 362, 2157, 2155, 2152, 378, 377, 375, 2166, 372, 2165, 369, 2162, 383, 381, 379, 2168, 1419, 1418, 1416, 1414, 385, 1411, 384, 1423, 1422, 1420, 1424, 2461, 802, 2441, 2439, 790, 786, 783, 794, 2409, 2406, 2403, 750, 742, 738, 2414, 756, 753, 1720, 2367, 2365, 2362, 2359, 1663, 693, 691, 684, 2373, 680, 2370, 702, 699, 696, 704, 1690, 1687, 2337, 2336, 2334, 2332, 1624, 2329, 1622, 640, 637, 2344, 634, 2342, 630, 2340, 650, 648, 645, 2346, 655, 653, 1653, 1651, 1649, 1655, 2612, 2597, 2595, 2571, 2568, 2565, 2576, 2534, 2529, 2526, 1787, 2540, 2537, 907, 904, 900, 910, 2503, 2502, 2500, 2498, 1768, 2495, 1767, 2510, 2508, 2506, 869, 866, 863, 2513, 876, 874, 1782, 2720, 2713, 2711, 2697, 2694, 2691, 2702, 2672, 2670, 2664, 1828, 2678, 2675, 2647, 2646, 2644, 2642, 1823, 2639, 1822, 2654, 2652, 2650, 2657, 2771, 1855, 2765, 2762, 1850, 1849, 2751, 2749, 2747, 2754, 353, 2148, 344, 342, 336, 2142, 332, 2140, 345, 1375, 1373, 306, 2130, 299, 2128, 295, 2125, 319, 314, 311, 2132, 1354, 1352, 1349, 1356, 262, 257, 2101, 253, 2096, 2093, 274, 273, 267, 2107, 263, 2104, 280, 278, 275, 1316, 1311, 1308, 1320, 1318, 2052, 202, 2050, 2044, 2040, 219, 2063, 212, 2060, 208, 2055, 224, 221, 2066, 1260, 1258, 1252, 231, 1248, 229, 1266, 1264, 1261, 1268, 155, 1998, 153, 1996, 1994, 1991, 1988, 165, 164, 2007, 162, 2006, 159, 2003, 2e3, 172, 171, 169, 2012, 166, 2010, 1186, 1184, 1182, 1179, 175, 1176, 173, 1192, 1191, 1189, 1187, 176, 1194, 1193, 2313, 2307, 2305, 592, 589, 2294, 2292, 2289, 578, 572, 568, 2297, 580, 1591, 2272, 2267, 2264, 1547, 538, 536, 529, 2278, 525, 2275, 547, 544, 541, 1574, 1571, 2237, 2235, 2229, 1493, 2225, 1489, 478, 2247, 470, 2244, 465, 2241, 493, 488, 484, 2250, 498, 495, 1536, 1533, 1530, 1539, 2187, 2186, 2184, 2182, 1432, 2179, 1430, 2176, 1427, 414, 412, 2197, 409, 2195, 405, 2193, 2190, 426, 424, 421, 2203, 418, 2201, 431, 429, 1473, 1471, 1469, 1466, 434, 1477, 1475, 2478, 2472, 2470, 2459, 2457, 2454, 2462, 803, 2437, 2432, 2429, 1726, 2443, 2440, 792, 789, 785, 2401, 2399, 2393, 1702, 2389, 1699, 2411, 2408, 2405, 745, 741, 2415, 758, 755, 1721, 2358, 2357, 2355, 2353, 1661, 2350, 1660, 2347, 1657, 2368, 2366, 2364, 2361, 1666, 690, 687, 2374, 683, 2372, 701, 698, 705, 1691, 1689, 2619, 2617, 2610, 2608, 2605, 2613, 2593, 2588, 2585, 1803, 2599, 2596, 2563, 2561, 2555, 1797, 2551, 1795, 2573, 2570, 2567, 2577, 2525, 2524, 2522, 2520, 1786, 2517, 1785, 2514, 1783, 2535, 2533, 2531, 2528, 1788, 2541, 2539, 906, 903, 911, 2721, 1844, 2715, 2712, 1838, 1836, 2699, 2696, 2693, 2703, 1827, 1826, 1824, 2673, 2671, 2669, 2666, 1829, 2679, 2677, 1858, 1857, 2772, 1854, 1853, 1851, 1856, 2766, 2764, 143, 1987, 139, 1986, 135, 133, 131, 1984, 128, 1983, 125, 1981, 138, 137, 136, 1985, 1133, 1132, 1130, 112, 110, 1974, 107, 1973, 104, 1971, 1969, 122, 121, 119, 117, 1977, 114, 1976, 124, 1115, 1114, 1112, 1110, 1117, 1116, 84, 83, 1953, 81, 1952, 78, 1950, 1948, 1945, 94, 93, 91, 1959, 88, 1958, 85, 1955, 99, 97, 95, 1961, 1086, 1085, 1083, 1081, 1078, 100, 1090, 1089, 1087, 1091, 49, 47, 1917, 44, 1915, 1913, 1910, 1907, 59, 1926, 56, 1925, 53, 1922, 1919, 66, 64, 1931, 61, 1929, 1042, 1040, 1038, 71, 1035, 70, 1032, 68, 1048, 1047, 1045, 1043, 1050, 1049, 12, 10, 1869, 1867, 1864, 1861, 21, 1880, 19, 1877, 1874, 1871, 28, 1888, 25, 1886, 22, 1883, 982, 980, 977, 974, 32, 30, 991, 989, 987, 984, 34, 995, 994, 992, 2151, 2150, 2147, 2146, 2144, 356, 355, 354, 2149, 2139, 2138, 2136, 2134, 1359, 343, 341, 338, 2143, 335, 2141, 348, 347, 346, 1376, 1374, 2124, 2123, 2121, 2119, 1326, 2116, 1324, 310, 308, 305, 2131, 302, 2129, 298, 2127, 320, 318, 316, 313, 2133, 322, 321, 1355, 1353, 1351, 1357, 2092, 2091, 2089, 2087, 1276, 2084, 1274, 2081, 1271, 259, 2102, 256, 2100, 252, 2098, 2095, 272, 269, 2108, 266, 2106, 281, 279, 277, 1317, 1315, 1313, 1310, 282, 1321, 1319, 2039, 2037, 2035, 2032, 1203, 2029, 1200, 1197, 207, 2053, 205, 2051, 201, 2049, 2046, 2043, 220, 218, 2064, 215, 2062, 211, 2059, 228, 226, 223, 2069, 1259, 1257, 1254, 232, 1251, 230, 1267, 1265, 1263, 2316, 2315, 2312, 2311, 2309, 2314, 2304, 2303, 2301, 2299, 1593, 2308, 2306, 590, 2288, 2287, 2285, 2283, 1578, 2280, 1577, 2295, 2293, 2291, 579, 577, 574, 571, 2298, 582, 581, 1592, 2263, 2262, 2260, 2258, 1545, 2255, 1544, 2252, 1541, 2273, 2271, 2269, 2266, 1550, 535, 532, 2279, 528, 2277, 546, 543, 549, 1575, 1573, 2224, 2222, 2220, 1486, 2217, 1485, 2214, 1482, 1479, 2238, 2236, 2234, 2231, 1496, 2228, 1492, 480, 477, 2248, 473, 2246, 469, 2243, 490, 487, 2251, 497, 1537, 1535, 1532, 2477, 2476, 2474, 2479, 2469, 2468, 2466, 2464, 1730, 2473, 2471, 2453, 2452, 2450, 2448, 1729, 2445, 1728, 2460, 2458, 2456, 2463, 805, 804, 2428, 2427, 2425, 2423, 1725, 2420, 1724, 2417, 1722, 2438, 2436, 2434, 2431, 1727, 2444, 2442, 793, 791, 788, 795, 2388, 2386, 2384, 1697, 2381, 1696, 2378, 1694, 1692, 2402, 2400, 2398, 2395, 1703, 2392, 1701, 2412, 2410, 2407, 751, 748, 744, 2416, 759, 757, 1807, 2620, 2618, 1806, 1805, 2611, 2609, 2607, 2614, 1802, 1801, 1799, 2594, 2592, 2590, 2587, 1804, 2600, 2598, 1794, 1793, 1791, 1789, 2564, 2562, 2560, 2557, 1798, 2554, 1796, 2574, 2572, 2569, 2578, 1847, 1846, 2722, 1843, 1842, 1840, 1845, 2716, 2714, 1835, 1834, 1832, 1830, 1839, 1837, 2700, 2698, 2695, 2704, 1817, 1811, 1810, 897, 862, 1777, 829, 826, 838, 1760, 1758, 808, 2481, 1741, 1740, 1738, 1743, 2624, 1818, 2726, 2776, 782, 740, 737, 1715, 686, 679, 695, 1682, 1680, 639, 628, 2339, 647, 644, 1645, 1643, 1640, 1648, 602, 600, 597, 595, 2320, 593, 2318, 609, 607, 604, 1611, 1610, 1608, 1606, 613, 1615, 1613, 2328, 926, 924, 892, 886, 899, 857, 850, 2505, 1778, 824, 823, 821, 819, 2488, 818, 2486, 833, 831, 828, 840, 1761, 1759, 2649, 2632, 2630, 2746, 2734, 2732, 2782, 2781, 570, 567, 1587, 531, 527, 523, 540, 1566, 1564, 476, 467, 463, 2240, 486, 483, 1524, 1521, 1518, 1529, 411, 403, 2192, 399, 2189, 423, 416, 1462, 1457, 1454, 428, 1468, 1465, 2210, 366, 363, 2158, 360, 2156, 357, 2153, 376, 373, 370, 2163, 1410, 1409, 1407, 1405, 382, 1402, 380, 1417, 1415, 1412, 1421, 2175, 2174, 777, 774, 771, 784, 732, 725, 722, 2404, 743, 1716, 676, 674, 668, 2363, 665, 2360, 685, 1684, 1681, 626, 624, 622, 2335, 620, 2333, 617, 2330, 641, 635, 649, 1646, 1644, 1642, 2566, 928, 925, 2530, 2527, 894, 891, 888, 2501, 2499, 2496, 858, 856, 854, 851, 1779, 2692, 2668, 2665, 2645, 2643, 2640, 2651, 2768, 2759, 2757, 2744, 2743, 2741, 2748, 352, 1382, 340, 337, 333, 1371, 1369, 307, 300, 296, 2126, 315, 312, 1347, 1342, 1350, 261, 258, 250, 2097, 246, 2094, 271, 268, 264, 1306, 1301, 1298, 276, 1312, 1309, 2115, 203, 2048, 195, 2045, 191, 2041, 213, 209, 2056, 1246, 1244, 1238, 225, 1234, 222, 1256, 1253, 1249, 1262, 2080, 2079, 154, 1997, 150, 1995, 147, 1992, 1989, 163, 160, 2004, 156, 2001, 1175, 1174, 1172, 1170, 1167, 170, 1164, 167, 1185, 1183, 1180, 1177, 174, 1190, 1188, 2025, 2024, 2022, 587, 586, 564, 559, 556, 2290, 573, 1588, 520, 518, 512, 2268, 508, 2265, 530, 1568, 1565, 461, 457, 2233, 450, 2230, 446, 2226, 479, 471, 489, 1526, 1523, 1520, 397, 395, 2185, 392, 2183, 389, 2180, 2177, 410, 2194, 402, 422, 1463, 1461, 1459, 1456, 1470, 2455, 799, 2433, 2430, 779, 776, 773, 2397, 2394, 2390, 734, 728, 724, 746, 1717, 2356, 2354, 2351, 2348, 1658, 677, 675, 673, 670, 667, 688, 1685, 1683, 2606, 2589, 2586, 2559, 2556, 2552, 927, 2523, 2521, 2518, 2515, 1784, 2532, 895, 893, 890, 2718, 2709, 2707, 2689, 2687, 2684, 2663, 2662, 2660, 2658, 1825, 2667, 2769, 1852, 2760, 2758, 142, 141, 1139, 1138, 134, 132, 129, 126, 1982, 1129, 1128, 1126, 1131, 113, 111, 108, 105, 1972, 101, 1970, 120, 118, 115, 1109, 1108, 1106, 1104, 123, 1113, 1111, 82, 79, 1951, 75, 1949, 72, 1946, 92, 89, 86, 1956, 1077, 1076, 1074, 1072, 98, 1069, 96, 1084, 1082, 1079, 1088, 1968, 1967, 48, 45, 1916, 42, 1914, 39, 1911, 1908, 60, 57, 54, 1923, 50, 1920, 1031, 1030, 1028, 1026, 67, 1023, 65, 1020, 62, 1041, 1039, 1036, 1033, 69, 1046, 1044, 1944, 1943, 1941, 11, 9, 1868, 7, 1865, 1862, 1859, 20, 1878, 16, 1875, 13, 1872, 970, 968, 966, 963, 29, 960, 26, 23, 983, 981, 978, 975, 33, 971, 31, 990, 988, 985, 1906, 1904, 1902, 993, 351, 2145, 1383, 331, 330, 328, 326, 2137, 323, 2135, 339, 1372, 1370, 294, 293, 291, 289, 2122, 286, 2120, 283, 2117, 309, 303, 317, 1348, 1346, 1344, 245, 244, 242, 2090, 239, 2088, 236, 2085, 2082, 260, 2099, 249, 270, 1307, 1305, 1303, 1300, 1314, 189, 2038, 186, 2036, 183, 2033, 2030, 2026, 206, 198, 2047, 194, 216, 1247, 1245, 1243, 1240, 227, 1237, 1255, 2310, 2302, 2300, 2286, 2284, 2281, 565, 563, 561, 558, 575, 1589, 2261, 2259, 2256, 2253, 1542, 521, 519, 517, 514, 2270, 511, 533, 1569, 1567, 2223, 2221, 2218, 2215, 1483, 2211, 1480, 459, 456, 453, 2232, 449, 474, 491, 1527, 1525, 1522, 2475, 2467, 2465, 2451, 2449, 2446, 801, 800, 2426, 2424, 2421, 2418, 1723, 2435, 780, 778, 775, 2387, 2385, 2382, 2379, 1695, 2375, 1693, 2396, 735, 733, 730, 727, 749, 1718, 2616, 2615, 2604, 2603, 2601, 2584, 2583, 2581, 2579, 1800, 2591, 2550, 2549, 2547, 2545, 1792, 2542, 1790, 2558, 929, 2719, 1841, 2710, 2708, 1833, 1831, 2690, 2688, 2686, 1815, 1809, 1808, 1774, 1756, 1754, 1737, 1736, 1734, 1739, 1816, 1711, 1676, 1674, 633, 629, 1638, 1636, 1633, 1641, 598, 1605, 1604, 1602, 1600, 605, 1609, 1607, 2327, 887, 853, 1775, 822, 820, 1757, 1755, 1584, 524, 1560, 1558, 468, 464, 1514, 1511, 1508, 1519, 408, 404, 400, 1452, 1447, 1444, 417, 1458, 1455, 2208, 364, 361, 358, 2154, 1401, 1400, 1398, 1396, 374, 1393, 371, 1408, 1406, 1403, 1413, 2173, 2172, 772, 726, 723, 1712, 672, 669, 666, 682, 1678, 1675, 625, 623, 621, 618, 2331, 636, 632, 1639, 1637, 1635, 920, 918, 884, 880, 889, 849, 848, 847, 846, 2497, 855, 852, 1776, 2641, 2742, 2787, 1380, 334, 1367, 1365, 301, 297, 1340, 1338, 1335, 1343, 255, 251, 247, 1296, 1291, 1288, 265, 1302, 1299, 2113, 204, 196, 192, 2042, 1232, 1230, 1224, 214, 1220, 210, 1242, 1239, 1235, 1250, 2077, 2075, 151, 148, 1993, 144, 1990, 1163, 1162, 1160, 1158, 1155, 161, 1152, 157, 1173, 1171, 1168, 1165, 168, 1181, 1178, 2021, 2020, 2018, 2023, 585, 560, 557, 1585, 516, 509, 1562, 1559, 458, 447, 2227, 472, 1516, 1513, 1510, 398, 396, 393, 390, 2181, 386, 2178, 407, 1453, 1451, 1449, 1446, 420, 1460, 2209, 769, 764, 720, 712, 2391, 729, 1713, 664, 663, 661, 659, 2352, 656, 2349, 671, 1679, 1677, 2553, 922, 919, 2519, 2516, 885, 883, 881, 2685, 2661, 2659, 2767, 2756, 2755, 140, 1137, 1136, 130, 127, 1125, 1124, 1122, 1127, 109, 106, 102, 1103, 1102, 1100, 1098, 116, 1107, 1105, 1980, 80, 76, 73, 1947, 1068, 1067, 1065, 1063, 90, 1060, 87, 1075, 1073, 1070, 1080, 1966, 1965, 46, 43, 40, 1912, 36, 1909, 1019, 1018, 1016, 1014, 58, 1011, 55, 1008, 51, 1029, 1027, 1024, 1021, 63, 1037, 1034, 1940, 1939, 1937, 1942, 8, 1866, 4, 1863, 1, 1860, 956, 954, 952, 949, 946, 17, 14, 969, 967, 964, 961, 27, 957, 24, 979, 976, 972, 1901, 1900, 1898, 1896, 986, 1905, 1903, 350, 349, 1381, 329, 327, 324, 1368, 1366, 292, 290, 287, 284, 2118, 304, 1341, 1339, 1337, 1345, 243, 240, 237, 2086, 233, 2083, 254, 1297, 1295, 1293, 1290, 1304, 2114, 190, 187, 184, 2034, 180, 2031, 177, 2027, 199, 1233, 1231, 1229, 1226, 217, 1223, 1241, 2078, 2076, 584, 555, 554, 552, 550, 2282, 562, 1586, 507, 506, 504, 502, 2257, 499, 2254, 515, 1563, 1561, 445, 443, 441, 2219, 438, 2216, 435, 2212, 460, 454, 475, 1517, 1515, 1512, 2447, 798, 797, 2422, 2419, 770, 768, 766, 2383, 2380, 2376, 721, 719, 717, 714, 731, 1714, 2602, 2582, 2580, 2548, 2546, 2543, 923, 921, 2717, 2706, 2705, 2683, 2682, 2680, 1771, 1752, 1750, 1733, 1732, 1731, 1735, 1814, 1707, 1670, 1668, 1631, 1629, 1626, 1634, 1599, 1598, 1596, 1594, 1603, 1601, 2326, 1772, 1753, 1751, 1581, 1554, 1552, 1504, 1501, 1498, 1509, 1442, 1437, 1434, 401, 1448, 1445, 2206, 1392, 1391, 1389, 1387, 1384, 359, 1399, 1397, 1394, 1404, 2171, 2170, 1708, 1672, 1669, 619, 1632, 1630, 1628, 1773, 1378, 1363, 1361, 1333, 1328, 1336, 1286, 1281, 1278, 248, 1292, 1289, 2111, 1218, 1216, 1210, 197, 1206, 193, 1228, 1225, 1221, 1236, 2073, 2071, 1151, 1150, 1148, 1146, 152, 1143, 149, 1140, 145, 1161, 1159, 1156, 1153, 158, 1169, 1166, 2017, 2016, 2014, 2019, 1582, 510, 1556, 1553, 452, 448, 1506, 1500, 394, 391, 387, 1443, 1441, 1439, 1436, 1450, 2207, 765, 716, 713, 1709, 662, 660, 657, 1673, 1671, 916, 914, 879, 878, 877, 882, 1135, 1134, 1121, 1120, 1118, 1123, 1097, 1096, 1094, 1092, 103, 1101, 1099, 1979, 1059, 1058, 1056, 1054, 77, 1051, 74, 1066, 1064, 1061, 1071, 1964, 1963, 1007, 1006, 1004, 1002, 999, 41, 996, 37, 1017, 1015, 1012, 1009, 52, 1025, 1022, 1936, 1935, 1933, 1938, 942, 940, 938, 935, 932, 5, 2, 955, 953, 950, 947, 18, 943, 15, 965, 962, 958, 1895, 1894, 1892, 1890, 973, 1899, 1897, 1379, 325, 1364, 1362, 288, 285, 1334, 1332, 1330, 241, 238, 234, 1287, 1285, 1283, 1280, 1294, 2112, 188, 185, 181, 178, 2028, 1219, 1217, 1215, 1212, 200, 1209, 1227, 2074, 2072, 583, 553, 551, 1583, 505, 503, 500, 513, 1557, 1555, 444, 442, 439, 436, 2213, 455, 451, 1507, 1505, 1502, 796, 763, 762, 760, 767, 711, 710, 708, 706, 2377, 718, 715, 1710, 2544, 917, 915, 2681, 1627, 1597, 1595, 2325, 1769, 1749, 1747, 1499, 1438, 1435, 2204, 1390, 1388, 1385, 1395, 2169, 2167, 1704, 1665, 1662, 1625, 1623, 1620, 1770, 1329, 1282, 1279, 2109, 1214, 1207, 1222, 2068, 2065, 1149, 1147, 1144, 1141, 146, 1157, 1154, 2013, 2011, 2008, 2015, 1579, 1549, 1546, 1495, 1487, 1433, 1431, 1428, 1425, 388, 1440, 2205, 1705, 658, 1667, 1664, 1119, 1095, 1093, 1978, 1057, 1055, 1052, 1062, 1962, 1960, 1005, 1003, 1e3, 997, 38, 1013, 1010, 1932, 1930, 1927, 1934, 941, 939, 936, 933, 6, 930, 3, 951, 948, 944, 1889, 1887, 1884, 1881, 959, 1893, 1891, 35, 1377, 1360, 1358, 1327, 1325, 1322, 1331, 1277, 1275, 1272, 1269, 235, 1284, 2110, 1205, 1204, 1201, 1198, 182, 1195, 179, 1213, 2070, 2067, 1580, 501, 1551, 1548, 440, 437, 1497, 1494, 1490, 1503, 761, 709, 707, 1706, 913, 912, 2198, 1386, 2164, 2161, 1621, 1766, 2103, 1208, 2058, 2054, 1145, 1142, 2005, 2002, 1999, 2009, 1488, 1429, 1426, 2200, 1698, 1659, 1656, 1975, 1053, 1957, 1954, 1001, 998, 1924, 1921, 1918, 1928, 937, 934, 931, 1879, 1876, 1873, 1870, 945, 1885, 1882, 1323, 1273, 1270, 2105, 1202, 1199, 1196, 1211, 2061, 2057, 1576, 1543, 1540, 1484, 1481, 1478, 1491, 1700]),
    t
}(), i2e = function() {
    function t(e, n) {
        this.bits = e,
        this.points = n
    }
    return t.prototype.getBits = function() {
        return this.bits
    }
    ,
    t.prototype.getPoints = function() {
        return this.points
    }
    ,
    t
}(), o2e = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, s2e = function() {
    function t() {}
    return t.detectMultiple = function(e, n, r) {
        var i = e.getBlackMatrix()
          , o = t.detect(r, i);
        return o.length || (i = i.clone(),
        i.rotate180(),
        o = t.detect(r, i)),
        new i2e(i,o)
    }
    ,
    t.detect = function(e, n) {
        for (var r, i, o = new Array, s = 0, a = 0, l = !1; s < n.getHeight(); ) {
            var c = t.findVertices(n, s, a);
            if (c[0] == null && c[3] == null) {
                if (!l)
                    break;
                l = !1,
                a = 0;
                try {
                    for (var u = (r = void 0,
                    o2e(o)), f = u.next(); !f.done; f = u.next()) {
                        var d = f.value;
                        d[1] != null && (s = Math.trunc(Math.max(s, d[1].getY()))),
                        d[3] != null && (s = Math.max(s, Math.trunc(d[3].getY())))
                    }
                } catch (h) {
                    r = {
                        error: h
                    }
                } finally {
                    try {
                        f && !f.done && (i = u.return) && i.call(u)
                    } finally {
                        if (r)
                            throw r.error
                    }
                }
                s += t.ROW_STEP;
                continue
            }
            if (l = !0,
            o.push(c),
            !e)
                break;
            c[2] != null ? (a = Math.trunc(c[2].getX()),
            s = Math.trunc(c[2].getY())) : (a = Math.trunc(c[4].getX()),
            s = Math.trunc(c[4].getY()))
        }
        return o
    }
    ,
    t.findVertices = function(e, n, r) {
        var i = e.getHeight()
          , o = e.getWidth()
          , s = new Array(8);
        return t.copyToResult(s, t.findRowsWithPattern(e, i, o, n, r, t.START_PATTERN), t.INDEXES_START_PATTERN),
        s[4] != null && (r = Math.trunc(s[4].getX()),
        n = Math.trunc(s[4].getY())),
        t.copyToResult(s, t.findRowsWithPattern(e, i, o, n, r, t.STOP_PATTERN), t.INDEXES_STOP_PATTERN),
        s
    }
    ,
    t.copyToResult = function(e, n, r) {
        for (var i = 0; i < r.length; i++)
            e[r[i]] = n[i]
    }
    ,
    t.findRowsWithPattern = function(e, n, r, i, o, s) {
        for (var a = new Array(4), l = !1, c = new Int32Array(s.length); i < n; i += t.ROW_STEP) {
            var u = t.findGuardPattern(e, o, i, r, !1, s, c);
            if (u != null) {
                for (; i > 0; ) {
                    var f = t.findGuardPattern(e, o, --i, r, !1, s, c);
                    if (f != null)
                        u = f;
                    else {
                        i++;
                        break
                    }
                }
                a[0] = new Pe(u[0],i),
                a[1] = new Pe(u[1],i),
                l = !0;
                break
            }
        }
        var d = i + 1;
        if (l) {
            for (var h = 0, f = Int32Array.from([Math.trunc(a[0].getX()), Math.trunc(a[1].getX())]); d < n; d++) {
                var u = t.findGuardPattern(e, f[0], d, r, !1, s, c);
                if (u != null && Math.abs(f[0] - u[0]) < t.MAX_PATTERN_DRIFT && Math.abs(f[1] - u[1]) < t.MAX_PATTERN_DRIFT)
                    f = u,
                    h = 0;
                else {
                    if (h > t.SKIPPED_ROW_COUNT_MAX)
                        break;
                    h++
                }
            }
            d -= h + 1,
            a[2] = new Pe(f[0],d),
            a[3] = new Pe(f[1],d)
        }
        return d - i < t.BARCODE_MIN_HEIGHT && bn.fill(a, null),
        a
    }
    ,
    t.findGuardPattern = function(e, n, r, i, o, s, a) {
        bn.fillWithin(a, 0, a.length, 0);
        for (var l = n, c = 0; e.get(l, r) && l > 0 && c++ < t.MAX_PIXEL_DRIFT; )
            l--;
        for (var u = l, f = 0, d = s.length, h = o; u < i; u++) {
            var p = e.get(u, r);
            if (p !== h)
                a[f]++;
            else {
                if (f === d - 1) {
                    if (t.patternMatchVariance(a, s, t.MAX_INDIVIDUAL_VARIANCE) < t.MAX_AVG_VARIANCE)
                        return new Int32Array([l, u]);
                    l += a[0] + a[1],
                    It.arraycopy(a, 2, a, 0, f - 1),
                    a[f - 1] = 0,
                    a[f] = 0,
                    f--
                } else
                    f++;
                a[f] = 1,
                h = !h
            }
        }
        return f === d - 1 && t.patternMatchVariance(a, s, t.MAX_INDIVIDUAL_VARIANCE) < t.MAX_AVG_VARIANCE ? new Int32Array([l, u - 1]) : null
    }
    ,
    t.patternMatchVariance = function(e, n, r) {
        for (var i = e.length, o = 0, s = 0, a = 0; a < i; a++)
            o += e[a],
            s += n[a];
        if (o < s)
            return 1 / 0;
        var l = o / s;
        r *= l;
        for (var c = 0, u = 0; u < i; u++) {
            var f = e[u]
              , d = n[u] * l
              , h = f > d ? f - d : d - f;
            if (h > r)
                return 1 / 0;
            c += h
        }
        return c / o
    }
    ,
    t.INDEXES_START_PATTERN = Int32Array.from([0, 4, 1, 5]),
    t.INDEXES_STOP_PATTERN = Int32Array.from([6, 2, 7, 3]),
    t.MAX_AVG_VARIANCE = .42,
    t.MAX_INDIVIDUAL_VARIANCE = .8,
    t.START_PATTERN = Int32Array.from([8, 1, 1, 1, 1, 1, 1, 3]),
    t.STOP_PATTERN = Int32Array.from([7, 1, 1, 3, 1, 1, 1, 2, 1]),
    t.MAX_PIXEL_DRIFT = 3,
    t.MAX_PATTERN_DRIFT = 5,
    t.SKIPPED_ROW_COUNT_MAX = 25,
    t.ROW_STEP = 5,
    t.BARCODE_MIN_HEIGHT = 10,
    t
}(), a2e = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, Xa = function() {
    function t(e, n) {
        if (n.length === 0)
            throw new ke;
        this.field = e;
        var r = n.length;
        if (r > 1 && n[0] === 0) {
            for (var i = 1; i < r && n[i] === 0; )
                i++;
            i === r ? this.coefficients = new Int32Array([0]) : (this.coefficients = new Int32Array(r - i),
            It.arraycopy(n, i, this.coefficients, 0, this.coefficients.length))
        } else
            this.coefficients = n
    }
    return t.prototype.getCoefficients = function() {
        return this.coefficients
    }
    ,
    t.prototype.getDegree = function() {
        return this.coefficients.length - 1
    }
    ,
    t.prototype.isZero = function() {
        return this.coefficients[0] === 0
    }
    ,
    t.prototype.getCoefficient = function(e) {
        return this.coefficients[this.coefficients.length - 1 - e]
    }
    ,
    t.prototype.evaluateAt = function(e) {
        var n, r;
        if (e === 0)
            return this.getCoefficient(0);
        if (e === 1) {
            var i = 0;
            try {
                for (var o = a2e(this.coefficients), s = o.next(); !s.done; s = o.next()) {
                    var a = s.value;
                    i = this.field.add(i, a)
                }
            } catch (f) {
                n = {
                    error: f
                }
            } finally {
                try {
                    s && !s.done && (r = o.return) && r.call(o)
                } finally {
                    if (n)
                        throw n.error
                }
            }
            return i
        }
        for (var l = this.coefficients[0], c = this.coefficients.length, u = 1; u < c; u++)
            l = this.field.add(this.field.multiply(e, l), this.coefficients[u]);
        return l
    }
    ,
    t.prototype.add = function(e) {
        if (!this.field.equals(e.field))
            throw new ke("ModulusPolys do not have same ModulusGF field");
        if (this.isZero())
            return e;
        if (e.isZero())
            return this;
        var n = this.coefficients
          , r = e.coefficients;
        if (n.length > r.length) {
            var i = n;
            n = r,
            r = i
        }
        var o = new Int32Array(r.length)
          , s = r.length - n.length;
        It.arraycopy(r, 0, o, 0, s);
        for (var a = s; a < r.length; a++)
            o[a] = this.field.add(n[a - s], r[a]);
        return new t(this.field,o)
    }
    ,
    t.prototype.subtract = function(e) {
        if (!this.field.equals(e.field))
            throw new ke("ModulusPolys do not have same ModulusGF field");
        return e.isZero() ? this : this.add(e.negative())
    }
    ,
    t.prototype.multiply = function(e) {
        return e instanceof t ? this.multiplyOther(e) : this.multiplyScalar(e)
    }
    ,
    t.prototype.multiplyOther = function(e) {
        if (!this.field.equals(e.field))
            throw new ke("ModulusPolys do not have same ModulusGF field");
        if (this.isZero() || e.isZero())
            return new t(this.field,new Int32Array([0]));
        for (var n = this.coefficients, r = n.length, i = e.coefficients, o = i.length, s = new Int32Array(r + o - 1), a = 0; a < r; a++)
            for (var l = n[a], c = 0; c < o; c++)
                s[a + c] = this.field.add(s[a + c], this.field.multiply(l, i[c]));
        return new t(this.field,s)
    }
    ,
    t.prototype.negative = function() {
        for (var e = this.coefficients.length, n = new Int32Array(e), r = 0; r < e; r++)
            n[r] = this.field.subtract(0, this.coefficients[r]);
        return new t(this.field,n)
    }
    ,
    t.prototype.multiplyScalar = function(e) {
        if (e === 0)
            return new t(this.field,new Int32Array([0]));
        if (e === 1)
            return this;
        for (var n = this.coefficients.length, r = new Int32Array(n), i = 0; i < n; i++)
            r[i] = this.field.multiply(this.coefficients[i], e);
        return new t(this.field,r)
    }
    ,
    t.prototype.multiplyByMonomial = function(e, n) {
        if (e < 0)
            throw new ke;
        if (n === 0)
            return new t(this.field,new Int32Array([0]));
        for (var r = this.coefficients.length, i = new Int32Array(r + e), o = 0; o < r; o++)
            i[o] = this.field.multiply(this.coefficients[o], n);
        return new t(this.field,i)
    }
    ,
    t.prototype.toString = function() {
        for (var e = new Ke, n = this.getDegree(); n >= 0; n--) {
            var r = this.getCoefficient(n);
            r !== 0 && (r < 0 ? (e.append(" - "),
            r = -r) : e.length() > 0 && e.append(" + "),
            (n === 0 || r !== 1) && e.append(r),
            n !== 0 && (n === 1 ? e.append("x") : (e.append("x^"),
            e.append(n))))
        }
        return e.toString()
    }
    ,
    t
}(), l2e = function() {
    function t() {}
    return t.prototype.add = function(e, n) {
        return (e + n) % this.modulus
    }
    ,
    t.prototype.subtract = function(e, n) {
        return (this.modulus + e - n) % this.modulus
    }
    ,
    t.prototype.exp = function(e) {
        return this.expTable[e]
    }
    ,
    t.prototype.log = function(e) {
        if (e === 0)
            throw new ke;
        return this.logTable[e]
    }
    ,
    t.prototype.inverse = function(e) {
        if (e === 0)
            throw new O9;
        return this.expTable[this.modulus - this.logTable[e] - 1]
    }
    ,
    t.prototype.multiply = function(e, n) {
        return e === 0 || n === 0 ? 0 : this.expTable[(this.logTable[e] + this.logTable[n]) % (this.modulus - 1)]
    }
    ,
    t.prototype.getSize = function() {
        return this.modulus
    }
    ,
    t.prototype.equals = function(e) {
        return e === this
    }
    ,
    t
}(), c2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), u2e = function(t) {
    c2e(e, t);
    function e(n, r) {
        var i = t.call(this) || this;
        i.modulus = n,
        i.expTable = new Int32Array(n),
        i.logTable = new Int32Array(n);
        for (var o = 1, s = 0; s < n; s++)
            i.expTable[s] = o,
            o = o * r % n;
        for (var s = 0; s < n - 1; s++)
            i.logTable[i.expTable[s]] = s;
        return i.zero = new Xa(i,new Int32Array([0])),
        i.one = new Xa(i,new Int32Array([1])),
        i
    }
    return e.prototype.getZero = function() {
        return this.zero
    }
    ,
    e.prototype.getOne = function() {
        return this.one
    }
    ,
    e.prototype.buildMonomial = function(n, r) {
        if (n < 0)
            throw new ke;
        if (r === 0)
            return this.zero;
        var i = new Int32Array(n + 1);
        return i[0] = r,
        new Xa(this,i)
    }
    ,
    e.PDF417_GF = new e(at.NUMBER_OF_CODEWORDS,3),
    e
}(l2e), f2e = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, d2e = function() {
    function t() {
        this.field = u2e.PDF417_GF
    }
    return t.prototype.decode = function(e, n, r) {
        for (var i, o, s = new Xa(this.field,e), a = new Int32Array(n), l = !1, c = n; c > 0; c--) {
            var u = s.evaluateAt(this.field.exp(c));
            a[n - c] = u,
            u !== 0 && (l = !0)
        }
        if (!l)
            return 0;
        var f = this.field.getOne();
        if (r != null)
            try {
                for (var d = f2e(r), h = d.next(); !h.done; h = d.next()) {
                    var p = h.value
                      , y = this.field.exp(e.length - 1 - p)
                      , v = new Xa(this.field,new Int32Array([this.field.subtract(0, y), 1]));
                    f = f.multiply(v)
                }
            } catch (S) {
                i = {
                    error: S
                }
            } finally {
                try {
                    h && !h.done && (o = d.return) && o.call(d)
                } finally {
                    if (i)
                        throw i.error
                }
            }
        for (var g = new Xa(this.field,a), m = this.runEuclideanAlgorithm(this.field.buildMonomial(n, 1), g, n), _ = m[0], x = m[1], b = this.findErrorLocations(_), w = this.findErrorMagnitudes(x, _, b), c = 0; c < b.length; c++) {
            var E = e.length - 1 - this.field.log(b[c]);
            if (E < 0)
                throw fn.getChecksumInstance();
            e[E] = this.field.subtract(e[E], w[c])
        }
        return b.length
    }
    ,
    t.prototype.runEuclideanAlgorithm = function(e, n, r) {
        if (e.getDegree() < n.getDegree()) {
            var i = e;
            e = n,
            n = i
        }
        for (var o = e, s = n, a = this.field.getZero(), l = this.field.getOne(); s.getDegree() >= Math.round(r / 2); ) {
            var c = o
              , u = a;
            if (o = s,
            a = l,
            o.isZero())
                throw fn.getChecksumInstance();
            s = c;
            for (var f = this.field.getZero(), d = o.getCoefficient(o.getDegree()), h = this.field.inverse(d); s.getDegree() >= o.getDegree() && !s.isZero(); ) {
                var p = s.getDegree() - o.getDegree()
                  , y = this.field.multiply(s.getCoefficient(s.getDegree()), h);
                f = f.add(this.field.buildMonomial(p, y)),
                s = s.subtract(o.multiplyByMonomial(p, y))
            }
            l = f.multiply(a).subtract(u).negative()
        }
        var v = l.getCoefficient(0);
        if (v === 0)
            throw fn.getChecksumInstance();
        var g = this.field.inverse(v)
          , m = l.multiply(g)
          , _ = s.multiply(g);
        return [m, _]
    }
    ,
    t.prototype.findErrorLocations = function(e) {
        for (var n = e.getDegree(), r = new Int32Array(n), i = 0, o = 1; o < this.field.getSize() && i < n; o++)
            e.evaluateAt(o) === 0 && (r[i] = this.field.inverse(o),
            i++);
        if (i !== n)
            throw fn.getChecksumInstance();
        return r
    }
    ,
    t.prototype.findErrorMagnitudes = function(e, n, r) {
        for (var i = n.getDegree(), o = new Int32Array(i), s = 1; s <= i; s++)
            o[i - s] = this.field.multiply(s, n.getCoefficient(s));
        for (var a = new Xa(this.field,o), l = r.length, c = new Int32Array(l), s = 0; s < l; s++) {
            var u = this.field.inverse(r[s])
              , f = this.field.subtract(0, e.evaluateAt(u))
              , d = this.field.inverse(a.evaluateAt(u));
            c[s] = this.field.multiply(f, d)
        }
        return c
    }
    ,
    t
}(), Tx = function() {
    function t(e, n, r, i, o) {
        e instanceof t ? this.constructor_2(e) : this.constructor_1(e, n, r, i, o)
    }
    return t.prototype.constructor_1 = function(e, n, r, i, o) {
        var s = n == null || r == null
          , a = i == null || o == null;
        if (s && a)
            throw new oe;
        s ? (n = new Pe(0,i.getY()),
        r = new Pe(0,o.getY())) : a && (i = new Pe(e.getWidth() - 1,n.getY()),
        o = new Pe(e.getWidth() - 1,r.getY())),
        this.image = e,
        this.topLeft = n,
        this.bottomLeft = r,
        this.topRight = i,
        this.bottomRight = o,
        this.minX = Math.trunc(Math.min(n.getX(), r.getX())),
        this.maxX = Math.trunc(Math.max(i.getX(), o.getX())),
        this.minY = Math.trunc(Math.min(n.getY(), i.getY())),
        this.maxY = Math.trunc(Math.max(r.getY(), o.getY()))
    }
    ,
    t.prototype.constructor_2 = function(e) {
        this.image = e.image,
        this.topLeft = e.getTopLeft(),
        this.bottomLeft = e.getBottomLeft(),
        this.topRight = e.getTopRight(),
        this.bottomRight = e.getBottomRight(),
        this.minX = e.getMinX(),
        this.maxX = e.getMaxX(),
        this.minY = e.getMinY(),
        this.maxY = e.getMaxY()
    }
    ,
    t.merge = function(e, n) {
        return e == null ? n : n == null ? e : new t(e.image,e.topLeft,e.bottomLeft,n.topRight,n.bottomRight)
    }
    ,
    t.prototype.addMissingRows = function(e, n, r) {
        var i = this.topLeft
          , o = this.bottomLeft
          , s = this.topRight
          , a = this.bottomRight;
        if (e > 0) {
            var l = r ? this.topLeft : this.topRight
              , c = Math.trunc(l.getY() - e);
            c < 0 && (c = 0);
            var u = new Pe(l.getX(),c);
            r ? i = u : s = u
        }
        if (n > 0) {
            var f = r ? this.bottomLeft : this.bottomRight
              , d = Math.trunc(f.getY() + n);
            d >= this.image.getHeight() && (d = this.image.getHeight() - 1);
            var h = new Pe(f.getX(),d);
            r ? o = h : a = h
        }
        return new t(this.image,i,o,s,a)
    }
    ,
    t.prototype.getMinX = function() {
        return this.minX
    }
    ,
    t.prototype.getMaxX = function() {
        return this.maxX
    }
    ,
    t.prototype.getMinY = function() {
        return this.minY
    }
    ,
    t.prototype.getMaxY = function() {
        return this.maxY
    }
    ,
    t.prototype.getTopLeft = function() {
        return this.topLeft
    }
    ,
    t.prototype.getTopRight = function() {
        return this.topRight
    }
    ,
    t.prototype.getBottomLeft = function() {
        return this.bottomLeft
    }
    ,
    t.prototype.getBottomRight = function() {
        return this.bottomRight
    }
    ,
    t
}(), h2e = function() {
    function t(e, n, r, i) {
        this.columnCount = e,
        this.errorCorrectionLevel = i,
        this.rowCountUpperPart = n,
        this.rowCountLowerPart = r,
        this.rowCount = n + r
    }
    return t.prototype.getColumnCount = function() {
        return this.columnCount
    }
    ,
    t.prototype.getErrorCorrectionLevel = function() {
        return this.errorCorrectionLevel
    }
    ,
    t.prototype.getRowCount = function() {
        return this.rowCount
    }
    ,
    t.prototype.getRowCountUpperPart = function() {
        return this.rowCountUpperPart
    }
    ,
    t.prototype.getRowCountLowerPart = function() {
        return this.rowCountLowerPart
    }
    ,
    t
}(), dE = function() {
    function t() {
        this.buffer = ""
    }
    return t.form = function(e, n) {
        var r = -1;
        function i(s, a, l, c, u, f) {
            if (s === "%%")
                return "%";
            if (n[++r] !== void 0) {
                s = c ? parseInt(c.substr(1)) : void 0;
                var d = u ? parseInt(u.substr(1)) : void 0, h;
                switch (f) {
                case "s":
                    h = n[r];
                    break;
                case "c":
                    h = n[r][0];
                    break;
                case "f":
                    h = parseFloat(n[r]).toFixed(s);
                    break;
                case "p":
                    h = parseFloat(n[r]).toPrecision(s);
                    break;
                case "e":
                    h = parseFloat(n[r]).toExponential(s);
                    break;
                case "x":
                    h = parseInt(n[r]).toString(d || 16);
                    break;
                case "d":
                    h = parseFloat(parseInt(n[r], d || 10).toPrecision(s)).toFixed(0);
                    break
                }
                h = typeof h == "object" ? JSON.stringify(h) : (+h).toString(d);
                for (var p = parseInt(l), y = l && l[0] + "" == "0" ? "0" : " "; h.length < p; )
                    h = a !== void 0 ? h + y : y + h;
                return h
            }
        }
        var o = /%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;
        return e.replace(o, i)
    }
    ,
    t.prototype.format = function(e) {
        for (var n = [], r = 1; r < arguments.length; r++)
            n[r - 1] = arguments[r];
        this.buffer += t.form(e, n)
    }
    ,
    t.prototype.toString = function() {
        return this.buffer
    }
    ,
    t
}(), p2e = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, L9 = function() {
    function t(e) {
        this.boundingBox = new Tx(e),
        this.codewords = new Array(e.getMaxY() - e.getMinY() + 1)
    }
    return t.prototype.getCodewordNearby = function(e) {
        var n = this.getCodeword(e);
        if (n != null)
            return n;
        for (var r = 1; r < t.MAX_NEARBY_DISTANCE; r++) {
            var i = this.imageRowToCodewordIndex(e) - r;
            if (i >= 0 && (n = this.codewords[i],
            n != null) || (i = this.imageRowToCodewordIndex(e) + r,
            i < this.codewords.length && (n = this.codewords[i],
            n != null)))
                return n
        }
        return null
    }
    ,
    t.prototype.imageRowToCodewordIndex = function(e) {
        return e - this.boundingBox.getMinY()
    }
    ,
    t.prototype.setCodeword = function(e, n) {
        this.codewords[this.imageRowToCodewordIndex(e)] = n
    }
    ,
    t.prototype.getCodeword = function(e) {
        return this.codewords[this.imageRowToCodewordIndex(e)]
    }
    ,
    t.prototype.getBoundingBox = function() {
        return this.boundingBox
    }
    ,
    t.prototype.getCodewords = function() {
        return this.codewords
    }
    ,
    t.prototype.toString = function() {
        var e, n, r = new dE, i = 0;
        try {
            for (var o = p2e(this.codewords), s = o.next(); !s.done; s = o.next()) {
                var a = s.value;
                if (a == null) {
                    r.format("%3d:    |   %n", i++);
                    continue
                }
                r.format("%3d: %3d|%3d%n", i++, a.getRowNumber(), a.getValue())
            }
        } catch (l) {
            e = {
                error: l
            }
        } finally {
            try {
                s && !s.done && (n = o.return) && n.call(o)
            } finally {
                if (e)
                    throw e.error
            }
        }
        return r.toString()
    }
    ,
    t.MAX_NEARBY_DISTANCE = 5,
    t
}(), g2e = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, m2e = globalThis && globalThis.__read || function(t, e) {
    var n = typeof Symbol == "function" && t[Symbol.iterator];
    if (!n)
        return t;
    var r = n.call(t), i, o = [], s;
    try {
        for (; (e === void 0 || e-- > 0) && !(i = r.next()).done; )
            o.push(i.value)
    } catch (a) {
        s = {
            error: a
        }
    } finally {
        try {
            i && !i.done && (n = r.return) && n.call(r)
        } finally {
            if (s)
                throw s.error
        }
    }
    return o
}
, lf = function() {
    function t() {
        this.values = new Map
    }
    return t.prototype.setValue = function(e) {
        e = Math.trunc(e);
        var n = this.values.get(e);
        n == null && (n = 0),
        n++,
        this.values.set(e, n)
    }
    ,
    t.prototype.getValue = function() {
        var e, n, r = -1, i = new Array, o = function(f, d) {
            var h = {
                getKey: function() {
                    return f
                },
                getValue: function() {
                    return d
                }
            };
            h.getValue() > r ? (r = h.getValue(),
            i = [],
            i.push(h.getKey())) : h.getValue() === r && i.push(h.getKey())
        };
        try {
            for (var s = g2e(this.values.entries()), a = s.next(); !a.done; a = s.next()) {
                var l = m2e(a.value, 2)
                  , c = l[0]
                  , u = l[1];
                o(c, u)
            }
        } catch (f) {
            e = {
                error: f
            }
        } finally {
            try {
                a && !a.done && (n = s.return) && n.call(s)
            } finally {
                if (e)
                    throw e.error
            }
        }
        return at.toIntArray(i)
    }
    ,
    t.prototype.getConfidence = function(e) {
        return this.values.get(e)
    }
    ,
    t
}(), v2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), Ov = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, HP = function(t) {
    v2e(e, t);
    function e(n, r) {
        var i = t.call(this, n) || this;
        return i._isLeft = r,
        i
    }
    return e.prototype.setRowNumbers = function() {
        var n, r;
        try {
            for (var i = Ov(this.getCodewords()), o = i.next(); !o.done; o = i.next()) {
                var s = o.value;
                s != null && s.setRowNumberAsRowIndicatorColumn()
            }
        } catch (a) {
            n = {
                error: a
            }
        } finally {
            try {
                o && !o.done && (r = i.return) && r.call(i)
            } finally {
                if (n)
                    throw n.error
            }
        }
    }
    ,
    e.prototype.adjustCompleteIndicatorColumnRowNumbers = function(n) {
        var r = this.getCodewords();
        this.setRowNumbers(),
        this.removeIncorrectCodewords(r, n);
        for (var i = this.getBoundingBox(), o = this._isLeft ? i.getTopLeft() : i.getTopRight(), s = this._isLeft ? i.getBottomLeft() : i.getBottomRight(), a = this.imageRowToCodewordIndex(Math.trunc(o.getY())), l = this.imageRowToCodewordIndex(Math.trunc(s.getY())), c = -1, u = 1, f = 0, d = a; d < l; d++)
            if (r[d] != null) {
                var h = r[d]
                  , p = h.getRowNumber() - c;
                if (p === 0)
                    f++;
                else if (p === 1)
                    u = Math.max(u, f),
                    f = 1,
                    c = h.getRowNumber();
                else if (p < 0 || h.getRowNumber() >= n.getRowCount() || p > d)
                    r[d] = null;
                else {
                    var y = void 0;
                    u > 2 ? y = (u - 2) * p : y = p;
                    for (var v = y >= d, g = 1; g <= y && !v; g++)
                        v = r[d - g] != null;
                    v ? r[d] = null : (c = h.getRowNumber(),
                    f = 1)
                }
            }
    }
    ,
    e.prototype.getRowHeights = function() {
        var n, r, i = this.getBarcodeMetadata();
        if (i == null)
            return null;
        this.adjustIncompleteIndicatorColumnRowNumbers(i);
        var o = new Int32Array(i.getRowCount());
        try {
            for (var s = Ov(this.getCodewords()), a = s.next(); !a.done; a = s.next()) {
                var l = a.value;
                if (l != null) {
                    var c = l.getRowNumber();
                    if (c >= o.length)
                        continue;
                    o[c]++
                }
            }
        } catch (u) {
            n = {
                error: u
            }
        } finally {
            try {
                a && !a.done && (r = s.return) && r.call(s)
            } finally {
                if (n)
                    throw n.error
            }
        }
        return o
    }
    ,
    e.prototype.adjustIncompleteIndicatorColumnRowNumbers = function(n) {
        for (var r = this.getBoundingBox(), i = this._isLeft ? r.getTopLeft() : r.getTopRight(), o = this._isLeft ? r.getBottomLeft() : r.getBottomRight(), s = this.imageRowToCodewordIndex(Math.trunc(i.getY())), a = this.imageRowToCodewordIndex(Math.trunc(o.getY())), l = this.getCodewords(), c = -1, u = s; u < a; u++)
            if (l[u] != null) {
                var f = l[u];
                f.setRowNumberAsRowIndicatorColumn();
                var d = f.getRowNumber() - c;
                d === 0 || (d === 1 ? c = f.getRowNumber() : f.getRowNumber() >= n.getRowCount() ? l[u] = null : c = f.getRowNumber())
            }
    }
    ,
    e.prototype.getBarcodeMetadata = function() {
        var n, r, i = this.getCodewords(), o = new lf, s = new lf, a = new lf, l = new lf;
        try {
            for (var c = Ov(i), u = c.next(); !u.done; u = c.next()) {
                var f = u.value;
                if (f != null) {
                    f.setRowNumberAsRowIndicatorColumn();
                    var d = f.getValue() % 30
                      , h = f.getRowNumber();
                    switch (this._isLeft || (h += 2),
                    h % 3) {
                    case 0:
                        s.setValue(d * 3 + 1);
                        break;
                    case 1:
                        l.setValue(d / 3),
                        a.setValue(d % 3);
                        break;
                    case 2:
                        o.setValue(d + 1);
                        break
                    }
                }
            }
        } catch (y) {
            n = {
                error: y
            }
        } finally {
            try {
                u && !u.done && (r = c.return) && r.call(c)
            } finally {
                if (n)
                    throw n.error
            }
        }
        if (o.getValue().length === 0 || s.getValue().length === 0 || a.getValue().length === 0 || l.getValue().length === 0 || o.getValue()[0] < 1 || s.getValue()[0] + a.getValue()[0] < at.MIN_ROWS_IN_BARCODE || s.getValue()[0] + a.getValue()[0] > at.MAX_ROWS_IN_BARCODE)
            return null;
        var p = new h2e(o.getValue()[0],s.getValue()[0],a.getValue()[0],l.getValue()[0]);
        return this.removeIncorrectCodewords(i, p),
        p
    }
    ,
    e.prototype.removeIncorrectCodewords = function(n, r) {
        for (var i = 0; i < n.length; i++) {
            var o = n[i];
            if (n[i] != null) {
                var s = o.getValue() % 30
                  , a = o.getRowNumber();
                if (a > r.getRowCount()) {
                    n[i] = null;
                    continue
                }
                switch (this._isLeft || (a += 2),
                a % 3) {
                case 0:
                    s * 3 + 1 !== r.getRowCountUpperPart() && (n[i] = null);
                    break;
                case 1:
                    (Math.trunc(s / 3) !== r.getErrorCorrectionLevel() || s % 3 !== r.getRowCountLowerPart()) && (n[i] = null);
                    break;
                case 2:
                    s + 1 !== r.getColumnCount() && (n[i] = null);
                    break
                }
            }
        }
    }
    ,
    e.prototype.isLeft = function() {
        return this._isLeft
    }
    ,
    e.prototype.toString = function() {
        return "IsLeft: " + this._isLeft + `
` + t.prototype.toString.call(this)
    }
    ,
    e
}(L9), y2e = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
, _2e = function() {
    function t(e, n) {
        this.ADJUST_ROW_NUMBER_SKIP = 2,
        this.barcodeMetadata = e,
        this.barcodeColumnCount = e.getColumnCount(),
        this.boundingBox = n,
        this.detectionResultColumns = new Array(this.barcodeColumnCount + 2)
    }
    return t.prototype.getDetectionResultColumns = function() {
        this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),
        this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount + 1]);
        var e = at.MAX_CODEWORDS_IN_BARCODE, n;
        do
            n = e,
            e = this.adjustRowNumbersAndGetCount();
        while (e > 0 && e < n);
        return this.detectionResultColumns
    }
    ,
    t.prototype.adjustIndicatorColumnRowNumbers = function(e) {
        e != null && e.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)
    }
    ,
    t.prototype.adjustRowNumbersAndGetCount = function() {
        var e = this.adjustRowNumbersByRow();
        if (e === 0)
            return 0;
        for (var n = 1; n < this.barcodeColumnCount + 1; n++)
            for (var r = this.detectionResultColumns[n].getCodewords(), i = 0; i < r.length; i++)
                r[i] != null && (r[i].hasValidRowNumber() || this.adjustRowNumbers(n, i, r));
        return e
    }
    ,
    t.prototype.adjustRowNumbersByRow = function() {
        this.adjustRowNumbersFromBothRI();
        var e = this.adjustRowNumbersFromLRI();
        return e + this.adjustRowNumbersFromRRI()
    }
    ,
    t.prototype.adjustRowNumbersFromBothRI = function() {
        if (!(this.detectionResultColumns[0] == null || this.detectionResultColumns[this.barcodeColumnCount + 1] == null)) {
            for (var e = this.detectionResultColumns[0].getCodewords(), n = this.detectionResultColumns[this.barcodeColumnCount + 1].getCodewords(), r = 0; r < e.length; r++)
                if (e[r] != null && n[r] != null && e[r].getRowNumber() === n[r].getRowNumber())
                    for (var i = 1; i <= this.barcodeColumnCount; i++) {
                        var o = this.detectionResultColumns[i].getCodewords()[r];
                        o != null && (o.setRowNumber(e[r].getRowNumber()),
                        o.hasValidRowNumber() || (this.detectionResultColumns[i].getCodewords()[r] = null))
                    }
        }
    }
    ,
    t.prototype.adjustRowNumbersFromRRI = function() {
        if (this.detectionResultColumns[this.barcodeColumnCount + 1] == null)
            return 0;
        for (var e = 0, n = this.detectionResultColumns[this.barcodeColumnCount + 1].getCodewords(), r = 0; r < n.length; r++)
            if (n[r] != null)
                for (var i = n[r].getRowNumber(), o = 0, s = this.barcodeColumnCount + 1; s > 0 && o < this.ADJUST_ROW_NUMBER_SKIP; s--) {
                    var a = this.detectionResultColumns[s].getCodewords()[r];
                    a != null && (o = t.adjustRowNumberIfValid(i, o, a),
                    a.hasValidRowNumber() || e++)
                }
        return e
    }
    ,
    t.prototype.adjustRowNumbersFromLRI = function() {
        if (this.detectionResultColumns[0] == null)
            return 0;
        for (var e = 0, n = this.detectionResultColumns[0].getCodewords(), r = 0; r < n.length; r++)
            if (n[r] != null)
                for (var i = n[r].getRowNumber(), o = 0, s = 1; s < this.barcodeColumnCount + 1 && o < this.ADJUST_ROW_NUMBER_SKIP; s++) {
                    var a = this.detectionResultColumns[s].getCodewords()[r];
                    a != null && (o = t.adjustRowNumberIfValid(i, o, a),
                    a.hasValidRowNumber() || e++)
                }
        return e
    }
    ,
    t.adjustRowNumberIfValid = function(e, n, r) {
        return r == null || r.hasValidRowNumber() || (r.isValidRowNumber(e) ? (r.setRowNumber(e),
        n = 0) : ++n),
        n
    }
    ,
    t.prototype.adjustRowNumbers = function(e, n, r) {
        var i, o;
        if (this.detectionResultColumns[e - 1] != null) {
            var s = r[n]
              , a = this.detectionResultColumns[e - 1].getCodewords()
              , l = a;
            this.detectionResultColumns[e + 1] != null && (l = this.detectionResultColumns[e + 1].getCodewords());
            var c = new Array(14);
            c[2] = a[n],
            c[3] = l[n],
            n > 0 && (c[0] = r[n - 1],
            c[4] = a[n - 1],
            c[5] = l[n - 1]),
            n > 1 && (c[8] = r[n - 2],
            c[10] = a[n - 2],
            c[11] = l[n - 2]),
            n < r.length - 1 && (c[1] = r[n + 1],
            c[6] = a[n + 1],
            c[7] = l[n + 1]),
            n < r.length - 2 && (c[9] = r[n + 2],
            c[12] = a[n + 2],
            c[13] = l[n + 2]);
            try {
                for (var u = y2e(c), f = u.next(); !f.done; f = u.next()) {
                    var d = f.value;
                    if (t.adjustRowNumber(s, d))
                        return
                }
            } catch (h) {
                i = {
                    error: h
                }
            } finally {
                try {
                    f && !f.done && (o = u.return) && o.call(u)
                } finally {
                    if (i)
                        throw i.error
                }
            }
        }
    }
    ,
    t.adjustRowNumber = function(e, n) {
        return n == null ? !1 : n.hasValidRowNumber() && n.getBucket() === e.getBucket() ? (e.setRowNumber(n.getRowNumber()),
        !0) : !1
    }
    ,
    t.prototype.getBarcodeColumnCount = function() {
        return this.barcodeColumnCount
    }
    ,
    t.prototype.getBarcodeRowCount = function() {
        return this.barcodeMetadata.getRowCount()
    }
    ,
    t.prototype.getBarcodeECLevel = function() {
        return this.barcodeMetadata.getErrorCorrectionLevel()
    }
    ,
    t.prototype.setBoundingBox = function(e) {
        this.boundingBox = e
    }
    ,
    t.prototype.getBoundingBox = function() {
        return this.boundingBox
    }
    ,
    t.prototype.setDetectionResultColumn = function(e, n) {
        this.detectionResultColumns[e] = n
    }
    ,
    t.prototype.getDetectionResultColumn = function(e) {
        return this.detectionResultColumns[e]
    }
    ,
    t.prototype.toString = function() {
        var e = this.detectionResultColumns[0];
        e == null && (e = this.detectionResultColumns[this.barcodeColumnCount + 1]);
        for (var n = new dE, r = 0; r < e.getCodewords().length; r++) {
            n.format("CW %3d:", r);
            for (var i = 0; i < this.barcodeColumnCount + 2; i++) {
                if (this.detectionResultColumns[i] == null) {
                    n.format("    |   ");
                    continue
                }
                var o = this.detectionResultColumns[i].getCodewords()[r];
                if (o == null) {
                    n.format("    |   ");
                    continue
                }
                n.format(" %3d|%3d", o.getRowNumber(), o.getValue())
            }
            n.format("%n")
        }
        return n.toString()
    }
    ,
    t
}(), x2e = function() {
    function t(e, n, r, i) {
        this.rowNumber = t.BARCODE_ROW_UNKNOWN,
        this.startX = Math.trunc(e),
        this.endX = Math.trunc(n),
        this.bucket = Math.trunc(r),
        this.value = Math.trunc(i)
    }
    return t.prototype.hasValidRowNumber = function() {
        return this.isValidRowNumber(this.rowNumber)
    }
    ,
    t.prototype.isValidRowNumber = function(e) {
        return e !== t.BARCODE_ROW_UNKNOWN && this.bucket === e % 3 * 3
    }
    ,
    t.prototype.setRowNumberAsRowIndicatorColumn = function() {
        this.rowNumber = Math.trunc(Math.trunc(this.value / 30) * 3 + Math.trunc(this.bucket / 3))
    }
    ,
    t.prototype.getWidth = function() {
        return this.endX - this.startX
    }
    ,
    t.prototype.getStartX = function() {
        return this.startX
    }
    ,
    t.prototype.getEndX = function() {
        return this.endX
    }
    ,
    t.prototype.getBucket = function() {
        return this.bucket
    }
    ,
    t.prototype.getValue = function() {
        return this.value
    }
    ,
    t.prototype.getRowNumber = function() {
        return this.rowNumber
    }
    ,
    t.prototype.setRowNumber = function(e) {
        this.rowNumber = e
    }
    ,
    t.prototype.toString = function() {
        return this.rowNumber + "|" + this.value
    }
    ,
    t.BARCODE_ROW_UNKNOWN = -1,
    t
}(), b2e = function() {
    function t() {}
    return t.initialize = function() {
        for (var e = 0; e < at.SYMBOL_TABLE.length; e++)
            for (var n = at.SYMBOL_TABLE[e], r = n & 1, i = 0; i < at.BARS_IN_MODULE; i++) {
                for (var o = 0; (n & 1) === r; )
                    o += 1,
                    n >>= 1;
                r = n & 1,
                t.RATIOS_TABLE[e] || (t.RATIOS_TABLE[e] = new Array(at.BARS_IN_MODULE)),
                t.RATIOS_TABLE[e][at.BARS_IN_MODULE - i - 1] = Math.fround(o / at.MODULES_IN_CODEWORD)
            }
        this.bSymbolTableReady = !0
    }
    ,
    t.getDecodedValue = function(e) {
        var n = t.getDecodedCodewordValue(t.sampleBitCounts(e));
        return n !== -1 ? n : t.getClosestDecodedValue(e)
    }
    ,
    t.sampleBitCounts = function(e) {
        for (var n = ft.sum(e), r = new Int32Array(at.BARS_IN_MODULE), i = 0, o = 0, s = 0; s < at.MODULES_IN_CODEWORD; s++) {
            var a = n / (2 * at.MODULES_IN_CODEWORD) + s * n / at.MODULES_IN_CODEWORD;
            o + e[i] <= a && (o += e[i],
            i++),
            r[i]++
        }
        return r
    }
    ,
    t.getDecodedCodewordValue = function(e) {
        var n = t.getBitValue(e);
        return at.getCodeword(n) === -1 ? -1 : n
    }
    ,
    t.getBitValue = function(e) {
        for (var n = 0, r = 0; r < e.length; r++)
            for (var i = 0; i < e[r]; i++)
                n = n << 1 | (r % 2 === 0 ? 1 : 0);
        return Math.trunc(n)
    }
    ,
    t.getClosestDecodedValue = function(e) {
        var n = ft.sum(e)
          , r = new Array(at.BARS_IN_MODULE);
        if (n > 1)
            for (var i = 0; i < r.length; i++)
                r[i] = Math.fround(e[i] / n);
        var o = Sx.MAX_VALUE
          , s = -1;
        this.bSymbolTableReady || t.initialize();
        for (var a = 0; a < t.RATIOS_TABLE.length; a++) {
            for (var l = 0, c = t.RATIOS_TABLE[a], u = 0; u < at.BARS_IN_MODULE; u++) {
                var f = Math.fround(c[u] - r[u]);
                if (l += Math.fround(f * f),
                l >= o)
                    break
            }
            l < o && (o = l,
            s = at.SYMBOL_TABLE[a])
        }
        return s
    }
    ,
    t.bSymbolTableReady = !1,
    t.RATIOS_TABLE = new Array(at.SYMBOL_TABLE.length).map(function(e) {
        return new Array(at.BARS_IN_MODULE)
    }),
    t
}(), w2e = function() {
    function t() {
        this.segmentCount = -1,
        this.fileSize = -1,
        this.timestamp = -1,
        this.checksum = -1
    }
    return t.prototype.getSegmentIndex = function() {
        return this.segmentIndex
    }
    ,
    t.prototype.setSegmentIndex = function(e) {
        this.segmentIndex = e
    }
    ,
    t.prototype.getFileId = function() {
        return this.fileId
    }
    ,
    t.prototype.setFileId = function(e) {
        this.fileId = e
    }
    ,
    t.prototype.getOptionalData = function() {
        return this.optionalData
    }
    ,
    t.prototype.setOptionalData = function(e) {
        this.optionalData = e
    }
    ,
    t.prototype.isLastSegment = function() {
        return this.lastSegment
    }
    ,
    t.prototype.setLastSegment = function(e) {
        this.lastSegment = e
    }
    ,
    t.prototype.getSegmentCount = function() {
        return this.segmentCount
    }
    ,
    t.prototype.setSegmentCount = function(e) {
        this.segmentCount = e
    }
    ,
    t.prototype.getSender = function() {
        return this.sender || null
    }
    ,
    t.prototype.setSender = function(e) {
        this.sender = e
    }
    ,
    t.prototype.getAddressee = function() {
        return this.addressee || null
    }
    ,
    t.prototype.setAddressee = function(e) {
        this.addressee = e
    }
    ,
    t.prototype.getFileName = function() {
        return this.fileName
    }
    ,
    t.prototype.setFileName = function(e) {
        this.fileName = e
    }
    ,
    t.prototype.getFileSize = function() {
        return this.fileSize
    }
    ,
    t.prototype.setFileSize = function(e) {
        this.fileSize = e
    }
    ,
    t.prototype.getChecksum = function() {
        return this.checksum
    }
    ,
    t.prototype.setChecksum = function(e) {
        this.checksum = e
    }
    ,
    t.prototype.getTimestamp = function() {
        return this.timestamp
    }
    ,
    t.prototype.setTimestamp = function(e) {
        this.timestamp = e
    }
    ,
    t
}(), VP = function() {
    function t() {}
    return t.parseLong = function(e, n) {
        return n === void 0 && (n = void 0),
        parseInt(e, n)
    }
    ,
    t
}(), E2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), S2e = function(t) {
    E2e(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.kind = "NullPointerException",
    e
}(Br), C2e = function() {
    function t() {}
    return t.prototype.writeBytes = function(e) {
        this.writeBytesOffset(e, 0, e.length)
    }
    ,
    t.prototype.writeBytesOffset = function(e, n, r) {
        if (e == null)
            throw new S2e;
        if (n < 0 || n > e.length || r < 0 || n + r > e.length || n + r < 0)
            throw new lE;
        if (r === 0)
            return;
        for (var i = 0; i < r; i++)
            this.write(e[n + i])
    }
    ,
    t.prototype.flush = function() {}
    ,
    t.prototype.close = function() {}
    ,
    t
}(), A2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), T2e = function(t) {
    A2e(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e
}(Br), P2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), I2e = function(t) {
    P2e(e, t);
    function e(n) {
        n === void 0 && (n = 32);
        var r = t.call(this) || this;
        if (r.count = 0,
        n < 0)
            throw new ke("Negative initial size: " + n);
        return r.buf = new Uint8Array(n),
        r
    }
    return e.prototype.ensureCapacity = function(n) {
        n - this.buf.length > 0 && this.grow(n)
    }
    ,
    e.prototype.grow = function(n) {
        var r = this.buf.length
          , i = r << 1;
        if (i - n < 0 && (i = n),
        i < 0) {
            if (n < 0)
                throw new T2e;
            i = qe.MAX_VALUE
        }
        this.buf = bn.copyOfUint8Array(this.buf, i)
    }
    ,
    e.prototype.write = function(n) {
        this.ensureCapacity(this.count + 1),
        this.buf[this.count] = n,
        this.count += 1
    }
    ,
    e.prototype.writeBytesOffset = function(n, r, i) {
        if (r < 0 || r > n.length || i < 0 || r + i - n.length > 0)
            throw new lE;
        this.ensureCapacity(this.count + i),
        It.arraycopy(n, r, this.buf, this.count, i),
        this.count += i
    }
    ,
    e.prototype.writeTo = function(n) {
        n.writeBytesOffset(this.buf, 0, this.count)
    }
    ,
    e.prototype.reset = function() {
        this.count = 0
    }
    ,
    e.prototype.toByteArray = function() {
        return bn.copyOfUint8Array(this.buf, this.count)
    }
    ,
    e.prototype.size = function() {
        return this.count
    }
    ,
    e.prototype.toString = function(n) {
        return n ? typeof n == "string" ? this.toString_string(n) : this.toString_number(n) : this.toString_void()
    }
    ,
    e.prototype.toString_void = function() {
        return new String(this.buf).toString()
    }
    ,
    e.prototype.toString_string = function(n) {
        return new String(this.buf).toString()
    }
    ,
    e.prototype.toString_number = function(n) {
        return new String(this.buf).toString()
    }
    ,
    e.prototype.close = function() {}
    ,
    e
}(C2e), wt;
(function(t) {
    t[t.ALPHA = 0] = "ALPHA",
    t[t.LOWER = 1] = "LOWER",
    t[t.MIXED = 2] = "MIXED",
    t[t.PUNCT = 3] = "PUNCT",
    t[t.ALPHA_SHIFT = 4] = "ALPHA_SHIFT",
    t[t.PUNCT_SHIFT = 5] = "PUNCT_SHIFT"
}
)(wt || (wt = {}));
function $9() {
    if (typeof window < "u")
        return window.BigInt || null;
    if (typeof global < "u")
        return global.BigInt || null;
    if (typeof self < "u")
        return self.BigInt || null;
    throw new Error("Can't search globals for BigInt!")
}
var yp;
function Is(t) {
    if (typeof yp > "u" && (yp = $9()),
    yp === null)
        throw new Error("BigInt is not supported!");
    return yp(t)
}
function O2e() {
    var t = [];
    t[0] = Is(1);
    var e = Is(900);
    t[1] = e;
    for (var n = 2; n < 16; n++)
        t[n] = t[n - 1] * e;
    return t
}
var R2e = function() {
    function t() {}
    return t.decode = function(e, n) {
        var r = new Ke("")
          , i = xn.ISO8859_1;
        r.enableDecoding(i);
        for (var o = 1, s = e[o++], a = new w2e; o < e[0]; ) {
            switch (s) {
            case t.TEXT_COMPACTION_MODE_LATCH:
                o = t.textCompaction(e, o, r);
                break;
            case t.BYTE_COMPACTION_MODE_LATCH:
            case t.BYTE_COMPACTION_MODE_LATCH_6:
                o = t.byteCompaction(s, e, i, o, r);
                break;
            case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:
                r.append(e[o++]);
                break;
            case t.NUMERIC_COMPACTION_MODE_LATCH:
                o = t.numericCompaction(e, o, r);
                break;
            case t.ECI_CHARSET:
                xn.getCharacterSetECIByValue(e[o++]);
                break;
            case t.ECI_GENERAL_PURPOSE:
                o += 2;
                break;
            case t.ECI_USER_DEFINED:
                o++;
                break;
            case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:
                o = t.decodeMacroBlock(e, o, a);
                break;
            case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:
            case t.MACRO_PDF417_TERMINATOR:
                throw new me;
            default:
                o--,
                o = t.textCompaction(e, o, r);
                break
            }
            if (o < e.length)
                s = e[o++];
            else
                throw me.getFormatInstance()
        }
        if (r.length() === 0)
            throw me.getFormatInstance();
        var l = new ym(null,r.toString(),null,n);
        return l.setOther(a),
        l
    }
    ,
    t.decodeMacroBlock = function(e, n, r) {
        if (n + t.NUMBER_OF_SEQUENCE_CODEWORDS > e[0])
            throw me.getFormatInstance();
        for (var i = new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS), o = 0; o < t.NUMBER_OF_SEQUENCE_CODEWORDS; o++,
        n++)
            i[o] = e[n];
        r.setSegmentIndex(qe.parseInt(t.decodeBase900toBase10(i, t.NUMBER_OF_SEQUENCE_CODEWORDS)));
        var s = new Ke;
        n = t.textCompaction(e, n, s),
        r.setFileId(s.toString());
        var a = -1;
        for (e[n] === t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD && (a = n + 1); n < e[0]; )
            switch (e[n]) {
            case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:
                switch (n++,
                e[n]) {
                case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:
                    var l = new Ke;
                    n = t.textCompaction(e, n + 1, l),
                    r.setFileName(l.toString());
                    break;
                case t.MACRO_PDF417_OPTIONAL_FIELD_SENDER:
                    var c = new Ke;
                    n = t.textCompaction(e, n + 1, c),
                    r.setSender(c.toString());
                    break;
                case t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:
                    var u = new Ke;
                    n = t.textCompaction(e, n + 1, u),
                    r.setAddressee(u.toString());
                    break;
                case t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:
                    var f = new Ke;
                    n = t.numericCompaction(e, n + 1, f),
                    r.setSegmentCount(qe.parseInt(f.toString()));
                    break;
                case t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:
                    var d = new Ke;
                    n = t.numericCompaction(e, n + 1, d),
                    r.setTimestamp(VP.parseLong(d.toString()));
                    break;
                case t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:
                    var h = new Ke;
                    n = t.numericCompaction(e, n + 1, h),
                    r.setChecksum(qe.parseInt(h.toString()));
                    break;
                case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:
                    var p = new Ke;
                    n = t.numericCompaction(e, n + 1, p),
                    r.setFileSize(VP.parseLong(p.toString()));
                    break;
                default:
                    throw me.getFormatInstance()
                }
                break;
            case t.MACRO_PDF417_TERMINATOR:
                n++,
                r.setLastSegment(!0);
                break;
            default:
                throw me.getFormatInstance()
            }
        if (a !== -1) {
            var y = n - a;
            r.isLastSegment() && y--,
            r.setOptionalData(bn.copyOfRange(e, a, a + y))
        }
        return n
    }
    ,
    t.textCompaction = function(e, n, r) {
        for (var i = new Int32Array((e[0] - n) * 2), o = new Int32Array((e[0] - n) * 2), s = 0, a = !1; n < e[0] && !a; ) {
            var l = e[n++];
            if (l < t.TEXT_COMPACTION_MODE_LATCH)
                i[s] = l / 30,
                i[s + 1] = l % 30,
                s += 2;
            else
                switch (l) {
                case t.TEXT_COMPACTION_MODE_LATCH:
                    i[s++] = t.TEXT_COMPACTION_MODE_LATCH;
                    break;
                case t.BYTE_COMPACTION_MODE_LATCH:
                case t.BYTE_COMPACTION_MODE_LATCH_6:
                case t.NUMERIC_COMPACTION_MODE_LATCH:
                case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:
                case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:
                case t.MACRO_PDF417_TERMINATOR:
                    n--,
                    a = !0;
                    break;
                case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:
                    i[s] = t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,
                    l = e[n++],
                    o[s] = l,
                    s++;
                    break
                }
        }
        return t.decodeTextCompaction(i, o, s, r),
        n
    }
    ,
    t.decodeTextCompaction = function(e, n, r, i) {
        for (var o = wt.ALPHA, s = wt.ALPHA, a = 0; a < r; ) {
            var l = e[a]
              , c = "";
            switch (o) {
            case wt.ALPHA:
                if (l < 26)
                    c = String.fromCharCode(65 + l);
                else
                    switch (l) {
                    case 26:
                        c = " ";
                        break;
                    case t.LL:
                        o = wt.LOWER;
                        break;
                    case t.ML:
                        o = wt.MIXED;
                        break;
                    case t.PS:
                        s = o,
                        o = wt.PUNCT_SHIFT;
                        break;
                    case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:
                        i.append(n[a]);
                        break;
                    case t.TEXT_COMPACTION_MODE_LATCH:
                        o = wt.ALPHA;
                        break
                    }
                break;
            case wt.LOWER:
                if (l < 26)
                    c = String.fromCharCode(97 + l);
                else
                    switch (l) {
                    case 26:
                        c = " ";
                        break;
                    case t.AS:
                        s = o,
                        o = wt.ALPHA_SHIFT;
                        break;
                    case t.ML:
                        o = wt.MIXED;
                        break;
                    case t.PS:
                        s = o,
                        o = wt.PUNCT_SHIFT;
                        break;
                    case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:
                        i.append(n[a]);
                        break;
                    case t.TEXT_COMPACTION_MODE_LATCH:
                        o = wt.ALPHA;
                        break
                    }
                break;
            case wt.MIXED:
                if (l < t.PL)
                    c = t.MIXED_CHARS[l];
                else
                    switch (l) {
                    case t.PL:
                        o = wt.PUNCT;
                        break;
                    case 26:
                        c = " ";
                        break;
                    case t.LL:
                        o = wt.LOWER;
                        break;
                    case t.AL:
                        o = wt.ALPHA;
                        break;
                    case t.PS:
                        s = o,
                        o = wt.PUNCT_SHIFT;
                        break;
                    case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:
                        i.append(n[a]);
                        break;
                    case t.TEXT_COMPACTION_MODE_LATCH:
                        o = wt.ALPHA;
                        break
                    }
                break;
            case wt.PUNCT:
                if (l < t.PAL)
                    c = t.PUNCT_CHARS[l];
                else
                    switch (l) {
                    case t.PAL:
                        o = wt.ALPHA;
                        break;
                    case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:
                        i.append(n[a]);
                        break;
                    case t.TEXT_COMPACTION_MODE_LATCH:
                        o = wt.ALPHA;
                        break
                    }
                break;
            case wt.ALPHA_SHIFT:
                if (o = s,
                l < 26)
                    c = String.fromCharCode(65 + l);
                else
                    switch (l) {
                    case 26:
                        c = " ";
                        break;
                    case t.TEXT_COMPACTION_MODE_LATCH:
                        o = wt.ALPHA;
                        break
                    }
                break;
            case wt.PUNCT_SHIFT:
                if (o = s,
                l < t.PAL)
                    c = t.PUNCT_CHARS[l];
                else
                    switch (l) {
                    case t.PAL:
                        o = wt.ALPHA;
                        break;
                    case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:
                        i.append(n[a]);
                        break;
                    case t.TEXT_COMPACTION_MODE_LATCH:
                        o = wt.ALPHA;
                        break
                    }
                break
            }
            c !== "" && i.append(c),
            a++
        }
    }
    ,
    t.byteCompaction = function(e, n, r, i, o) {
        var s = new I2e
          , a = 0
          , l = 0
          , c = !1;
        switch (e) {
        case t.BYTE_COMPACTION_MODE_LATCH:
            for (var u = new Int32Array(6), f = n[i++]; i < n[0] && !c; )
                switch (u[a++] = f,
                l = 900 * l + f,
                f = n[i++],
                f) {
                case t.TEXT_COMPACTION_MODE_LATCH:
                case t.BYTE_COMPACTION_MODE_LATCH:
                case t.NUMERIC_COMPACTION_MODE_LATCH:
                case t.BYTE_COMPACTION_MODE_LATCH_6:
                case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:
                case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:
                case t.MACRO_PDF417_TERMINATOR:
                    i--,
                    c = !0;
                    break;
                default:
                    if (a % 5 === 0 && a > 0) {
                        for (var d = 0; d < 6; ++d)
                            s.write(Number(Is(l) >> Is(8 * (5 - d))));
                        l = 0,
                        a = 0
                    }
                    break
                }
            i === n[0] && f < t.TEXT_COMPACTION_MODE_LATCH && (u[a++] = f);
            for (var h = 0; h < a; h++)
                s.write(u[h]);
            break;
        case t.BYTE_COMPACTION_MODE_LATCH_6:
            for (; i < n[0] && !c; ) {
                var p = n[i++];
                if (p < t.TEXT_COMPACTION_MODE_LATCH)
                    a++,
                    l = 900 * l + p;
                else
                    switch (p) {
                    case t.TEXT_COMPACTION_MODE_LATCH:
                    case t.BYTE_COMPACTION_MODE_LATCH:
                    case t.NUMERIC_COMPACTION_MODE_LATCH:
                    case t.BYTE_COMPACTION_MODE_LATCH_6:
                    case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:
                    case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:
                    case t.MACRO_PDF417_TERMINATOR:
                        i--,
                        c = !0;
                        break
                    }
                if (a % 5 === 0 && a > 0) {
                    for (var d = 0; d < 6; ++d)
                        s.write(Number(Is(l) >> Is(8 * (5 - d))));
                    l = 0,
                    a = 0
                }
            }
            break
        }
        return o.append(mi.decode(s.toByteArray(), r)),
        i
    }
    ,
    t.numericCompaction = function(e, n, r) {
        for (var i = 0, o = !1, s = new Int32Array(t.MAX_NUMERIC_CODEWORDS); n < e[0] && !o; ) {
            var a = e[n++];
            if (n === e[0] && (o = !0),
            a < t.TEXT_COMPACTION_MODE_LATCH)
                s[i] = a,
                i++;
            else
                switch (a) {
                case t.TEXT_COMPACTION_MODE_LATCH:
                case t.BYTE_COMPACTION_MODE_LATCH:
                case t.BYTE_COMPACTION_MODE_LATCH_6:
                case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:
                case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:
                case t.MACRO_PDF417_TERMINATOR:
                    n--,
                    o = !0;
                    break
                }
            (i % t.MAX_NUMERIC_CODEWORDS === 0 || a === t.NUMERIC_COMPACTION_MODE_LATCH || o) && i > 0 && (r.append(t.decodeBase900toBase10(s, i)),
            i = 0)
        }
        return n
    }
    ,
    t.decodeBase900toBase10 = function(e, n) {
        for (var r = Is(0), i = 0; i < n; i++)
            r += t.EXP900[n - i - 1] * Is(e[i]);
        var o = r.toString();
        if (o.charAt(0) !== "1")
            throw new me;
        return o.substring(1)
    }
    ,
    t.TEXT_COMPACTION_MODE_LATCH = 900,
    t.BYTE_COMPACTION_MODE_LATCH = 901,
    t.NUMERIC_COMPACTION_MODE_LATCH = 902,
    t.BYTE_COMPACTION_MODE_LATCH_6 = 924,
    t.ECI_USER_DEFINED = 925,
    t.ECI_GENERAL_PURPOSE = 926,
    t.ECI_CHARSET = 927,
    t.BEGIN_MACRO_PDF417_CONTROL_BLOCK = 928,
    t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD = 923,
    t.MACRO_PDF417_TERMINATOR = 922,
    t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE = 913,
    t.MAX_NUMERIC_CODEWORDS = 15,
    t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME = 0,
    t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT = 1,
    t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP = 2,
    t.MACRO_PDF417_OPTIONAL_FIELD_SENDER = 3,
    t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE = 4,
    t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE = 5,
    t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM = 6,
    t.PL = 25,
    t.LL = 27,
    t.AS = 27,
    t.ML = 28,
    t.AL = 28,
    t.PS = 29,
    t.PAL = 29,
    t.PUNCT_CHARS = `;<>@[\\]_\`~!\r	,:
-.$/"|*()?{}'`,
    t.MIXED_CHARS = "0123456789&\r	,:#-.$/+%*=^",
    t.EXP900 = $9() ? O2e() : [],
    t.NUMBER_OF_SEQUENCE_CODEWORDS = 2,
    t
}()
  , Ku = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , M2e = function() {
    function t() {}
    return t.decode = function(e, n, r, i, o, s, a) {
        for (var l = new Tx(e,n,r,i,o), c = null, u = null, f, d = !0; ; d = !1) {
            if (n != null && (c = t.getRowIndicatorColumn(e, l, n, !0, s, a)),
            i != null && (u = t.getRowIndicatorColumn(e, l, i, !1, s, a)),
            f = t.merge(c, u),
            f == null)
                throw oe.getNotFoundInstance();
            var h = f.getBoundingBox();
            if (d && h != null && (h.getMinY() < l.getMinY() || h.getMaxY() > l.getMaxY()))
                l = h;
            else
                break
        }
        f.setBoundingBox(l);
        var p = f.getBarcodeColumnCount() + 1;
        f.setDetectionResultColumn(0, c),
        f.setDetectionResultColumn(p, u);
        for (var y = c != null, v = 1; v <= p; v++) {
            var g = y ? v : p - v;
            if (f.getDetectionResultColumn(g) === void 0) {
                var m = void 0;
                g === 0 || g === p ? m = new HP(l,g === 0) : m = new L9(l),
                f.setDetectionResultColumn(g, m);
                for (var _ = -1, x = _, b = l.getMinY(); b <= l.getMaxY(); b++) {
                    if (_ = t.getStartColumn(f, g, b, y),
                    _ < 0 || _ > l.getMaxX()) {
                        if (x === -1)
                            continue;
                        _ = x
                    }
                    var w = t.detectCodeword(e, l.getMinX(), l.getMaxX(), y, _, b, s, a);
                    w != null && (m.setCodeword(b, w),
                    x = _,
                    s = Math.min(s, w.getWidth()),
                    a = Math.max(a, w.getWidth()))
                }
            }
        }
        return t.createDecoderResult(f)
    }
    ,
    t.merge = function(e, n) {
        if (e == null && n == null)
            return null;
        var r = t.getBarcodeMetadata(e, n);
        if (r == null)
            return null;
        var i = Tx.merge(t.adjustBoundingBox(e), t.adjustBoundingBox(n));
        return new _2e(r,i)
    }
    ,
    t.adjustBoundingBox = function(e) {
        var n, r;
        if (e == null)
            return null;
        var i = e.getRowHeights();
        if (i == null)
            return null;
        var o = t.getMax(i)
          , s = 0;
        try {
            for (var a = Ku(i), l = a.next(); !l.done; l = a.next()) {
                var c = l.value;
                if (s += o - c,
                c > 0)
                    break
            }
        } catch (h) {
            n = {
                error: h
            }
        } finally {
            try {
                l && !l.done && (r = a.return) && r.call(a)
            } finally {
                if (n)
                    throw n.error
            }
        }
        for (var u = e.getCodewords(), f = 0; s > 0 && u[f] == null; f++)
            s--;
        for (var d = 0, f = i.length - 1; f >= 0 && (d += o - i[f],
        !(i[f] > 0)); f--)
            ;
        for (var f = u.length - 1; d > 0 && u[f] == null; f--)
            d--;
        return e.getBoundingBox().addMissingRows(s, d, e.isLeft())
    }
    ,
    t.getMax = function(e) {
        var n, r, i = -1;
        try {
            for (var o = Ku(e), s = o.next(); !s.done; s = o.next()) {
                var a = s.value;
                i = Math.max(i, a)
            }
        } catch (l) {
            n = {
                error: l
            }
        } finally {
            try {
                s && !s.done && (r = o.return) && r.call(o)
            } finally {
                if (n)
                    throw n.error
            }
        }
        return i
    }
    ,
    t.getBarcodeMetadata = function(e, n) {
        var r;
        if (e == null || (r = e.getBarcodeMetadata()) == null)
            return n == null ? null : n.getBarcodeMetadata();
        var i;
        return n == null || (i = n.getBarcodeMetadata()) == null ? r : r.getColumnCount() !== i.getColumnCount() && r.getErrorCorrectionLevel() !== i.getErrorCorrectionLevel() && r.getRowCount() !== i.getRowCount() ? null : r
    }
    ,
    t.getRowIndicatorColumn = function(e, n, r, i, o, s) {
        for (var a = new HP(n,i), l = 0; l < 2; l++)
            for (var c = l === 0 ? 1 : -1, u = Math.trunc(Math.trunc(r.getX())), f = Math.trunc(Math.trunc(r.getY())); f <= n.getMaxY() && f >= n.getMinY(); f += c) {
                var d = t.detectCodeword(e, 0, e.getWidth(), i, u, f, o, s);
                d != null && (a.setCodeword(f, d),
                i ? u = d.getStartX() : u = d.getEndX())
            }
        return a
    }
    ,
    t.adjustCodewordCount = function(e, n) {
        var r = n[0][1]
          , i = r.getValue()
          , o = e.getBarcodeColumnCount() * e.getBarcodeRowCount() - t.getNumberOfECCodeWords(e.getBarcodeECLevel());
        if (i.length === 0) {
            if (o < 1 || o > at.MAX_CODEWORDS_IN_BARCODE)
                throw oe.getNotFoundInstance();
            r.setValue(o)
        } else
            i[0] !== o && r.setValue(o)
    }
    ,
    t.createDecoderResult = function(e) {
        var n = t.createBarcodeMatrix(e);
        t.adjustCodewordCount(e, n);
        for (var r = new Array, i = new Int32Array(e.getBarcodeRowCount() * e.getBarcodeColumnCount()), o = [], s = new Array, a = 0; a < e.getBarcodeRowCount(); a++)
            for (var l = 0; l < e.getBarcodeColumnCount(); l++) {
                var c = n[a][l + 1].getValue()
                  , u = a * e.getBarcodeColumnCount() + l;
                c.length === 0 ? r.push(u) : c.length === 1 ? i[u] = c[0] : (s.push(u),
                o.push(c))
            }
        for (var f = new Array(o.length), d = 0; d < f.length; d++)
            f[d] = o[d];
        return t.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(), i, at.toIntArray(r), at.toIntArray(s), f)
    }
    ,
    t.createDecoderResultFromAmbiguousValues = function(e, n, r, i, o) {
        for (var s = new Int32Array(i.length), a = 100; a-- > 0; ) {
            for (var l = 0; l < s.length; l++)
                n[i[l]] = o[l][s[l]];
            try {
                return t.decodeCodewords(n, e, r)
            } catch (u) {
                var c = u instanceof fn;
                if (!c)
                    throw u
            }
            if (s.length === 0)
                throw fn.getChecksumInstance();
            for (var l = 0; l < s.length; l++)
                if (s[l] < o[l].length - 1) {
                    s[l]++;
                    break
                } else if (s[l] = 0,
                l === s.length - 1)
                    throw fn.getChecksumInstance()
        }
        throw fn.getChecksumInstance()
    }
    ,
    t.createBarcodeMatrix = function(e) {
        for (var n, r, i, o, s = Array.from({
            length: e.getBarcodeRowCount()
        }, function() {
            return new Array(e.getBarcodeColumnCount() + 2)
        }), a = 0; a < s.length; a++)
            for (var l = 0; l < s[a].length; l++)
                s[a][l] = new lf;
        var c = 0;
        try {
            for (var u = Ku(e.getDetectionResultColumns()), f = u.next(); !f.done; f = u.next()) {
                var d = f.value;
                if (d != null)
                    try {
                        for (var h = (i = void 0,
                        Ku(d.getCodewords())), p = h.next(); !p.done; p = h.next()) {
                            var y = p.value;
                            if (y != null) {
                                var v = y.getRowNumber();
                                if (v >= 0) {
                                    if (v >= s.length)
                                        continue;
                                    s[v][c].setValue(y.getValue())
                                }
                            }
                        }
                    } catch (g) {
                        i = {
                            error: g
                        }
                    } finally {
                        try {
                            p && !p.done && (o = h.return) && o.call(h)
                        } finally {
                            if (i)
                                throw i.error
                        }
                    }
                c++
            }
        } catch (g) {
            n = {
                error: g
            }
        } finally {
            try {
                f && !f.done && (r = u.return) && r.call(u)
            } finally {
                if (n)
                    throw n.error
            }
        }
        return s
    }
    ,
    t.isValidBarcodeColumn = function(e, n) {
        return n >= 0 && n <= e.getBarcodeColumnCount() + 1
    }
    ,
    t.getStartColumn = function(e, n, r, i) {
        var o, s, a = i ? 1 : -1, l = null;
        if (t.isValidBarcodeColumn(e, n - a) && (l = e.getDetectionResultColumn(n - a).getCodeword(r)),
        l != null)
            return i ? l.getEndX() : l.getStartX();
        if (l = e.getDetectionResultColumn(n).getCodewordNearby(r),
        l != null)
            return i ? l.getStartX() : l.getEndX();
        if (t.isValidBarcodeColumn(e, n - a) && (l = e.getDetectionResultColumn(n - a).getCodewordNearby(r)),
        l != null)
            return i ? l.getEndX() : l.getStartX();
        for (var c = 0; t.isValidBarcodeColumn(e, n - a); ) {
            n -= a;
            try {
                for (var u = (o = void 0,
                Ku(e.getDetectionResultColumn(n).getCodewords())), f = u.next(); !f.done; f = u.next()) {
                    var d = f.value;
                    if (d != null)
                        return (i ? d.getEndX() : d.getStartX()) + a * c * (d.getEndX() - d.getStartX())
                }
            } catch (h) {
                o = {
                    error: h
                }
            } finally {
                try {
                    f && !f.done && (s = u.return) && s.call(u)
                } finally {
                    if (o)
                        throw o.error
                }
            }
            c++
        }
        return i ? e.getBoundingBox().getMinX() : e.getBoundingBox().getMaxX()
    }
    ,
    t.detectCodeword = function(e, n, r, i, o, s, a, l) {
        o = t.adjustCodewordStartColumn(e, n, r, i, o, s);
        var c = t.getModuleBitCount(e, n, r, i, o, s);
        if (c == null)
            return null;
        var u, f = ft.sum(c);
        if (i)
            u = o + f;
        else {
            for (var d = 0; d < c.length / 2; d++) {
                var h = c[d];
                c[d] = c[c.length - 1 - d],
                c[c.length - 1 - d] = h
            }
            u = o,
            o = u - f
        }
        if (!t.checkCodewordSkew(f, a, l))
            return null;
        var p = b2e.getDecodedValue(c)
          , y = at.getCodeword(p);
        return y === -1 ? null : new x2e(o,u,t.getCodewordBucketNumber(p),y)
    }
    ,
    t.getModuleBitCount = function(e, n, r, i, o, s) {
        for (var a = o, l = new Int32Array(8), c = 0, u = i ? 1 : -1, f = i; (i ? a < r : a >= n) && c < l.length; )
            e.get(a, s) === f ? (l[c]++,
            a += u) : (c++,
            f = !f);
        return c === l.length || a === (i ? r : n) && c === l.length - 1 ? l : null
    }
    ,
    t.getNumberOfECCodeWords = function(e) {
        return 2 << e
    }
    ,
    t.adjustCodewordStartColumn = function(e, n, r, i, o, s) {
        for (var a = o, l = i ? -1 : 1, c = 0; c < 2; c++) {
            for (; (i ? a >= n : a < r) && i === e.get(a, s); ) {
                if (Math.abs(o - a) > t.CODEWORD_SKEW_SIZE)
                    return o;
                a += l
            }
            l = -l,
            i = !i
        }
        return a
    }
    ,
    t.checkCodewordSkew = function(e, n, r) {
        return n - t.CODEWORD_SKEW_SIZE <= e && e <= r + t.CODEWORD_SKEW_SIZE
    }
    ,
    t.decodeCodewords = function(e, n, r) {
        if (e.length === 0)
            throw me.getFormatInstance();
        var i = 1 << n + 1
          , o = t.correctErrors(e, r, i);
        t.verifyCodewordCount(e, i);
        var s = R2e.decode(e, "" + n);
        return s.setErrorsCorrected(o),
        s.setErasures(r.length),
        s
    }
    ,
    t.correctErrors = function(e, n, r) {
        if (n != null && n.length > r / 2 + t.MAX_ERRORS || r < 0 || r > t.MAX_EC_CODEWORDS)
            throw fn.getChecksumInstance();
        return t.errorCorrection.decode(e, r, n)
    }
    ,
    t.verifyCodewordCount = function(e, n) {
        if (e.length < 4)
            throw me.getFormatInstance();
        var r = e[0];
        if (r > e.length)
            throw me.getFormatInstance();
        if (r === 0)
            if (n < e.length)
                e[0] = e.length - n;
            else
                throw me.getFormatInstance()
    }
    ,
    t.getBitCountForCodeword = function(e) {
        for (var n = new Int32Array(8), r = 0, i = n.length - 1; !((e & 1) !== r && (r = e & 1,
        i--,
        i < 0)); )
            n[i]++,
            e >>= 1;
        return n
    }
    ,
    t.getCodewordBucketNumber = function(e) {
        return e instanceof Int32Array ? this.getCodewordBucketNumber_Int32Array(e) : this.getCodewordBucketNumber_number(e)
    }
    ,
    t.getCodewordBucketNumber_number = function(e) {
        return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))
    }
    ,
    t.getCodewordBucketNumber_Int32Array = function(e) {
        return (e[0] - e[2] + e[4] - e[6] + 9) % 9
    }
    ,
    t.toString = function(e) {
        for (var n = new dE, r = 0; r < e.length; r++) {
            n.format("Row %2d: ", r);
            for (var i = 0; i < e[r].length; i++) {
                var o = e[r][i];
                o.getValue().length === 0 ? n.format("        ", null) : n.format("%4d(%2d)", o.getValue()[0], o.getConfidence(o.getValue()[0]))
            }
            n.format("%n")
        }
        return n.toString()
    }
    ,
    t.CODEWORD_SKEW_SIZE = 2,
    t.MAX_ERRORS = 3,
    t.MAX_EC_CODEWORDS = 512,
    t.errorCorrection = new d2e,
    t
}()
  , D2e = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , V0 = function() {
    function t() {}
    return t.prototype.decode = function(e, n) {
        n === void 0 && (n = null);
        var r = t.decode(e, n, !1);
        if (r == null || r.length === 0 || r[0] == null)
            throw oe.getNotFoundInstance();
        return r[0]
    }
    ,
    t.prototype.decodeMultiple = function(e, n) {
        n === void 0 && (n = null);
        try {
            return t.decode(e, n, !0)
        } catch (r) {
            throw r instanceof me || r instanceof fn ? oe.getNotFoundInstance() : r
        }
    }
    ,
    t.decode = function(e, n, r) {
        var i, o, s = new Array, a = s2e.detectMultiple(e, n, r);
        try {
            for (var l = D2e(a.getPoints()), c = l.next(); !c.done; c = l.next()) {
                var u = c.value
                  , f = M2e.decode(a.getBits(), u[4], u[5], u[6], u[7], t.getMinCodewordWidth(u), t.getMaxCodewordWidth(u))
                  , d = new tr(f.getText(),f.getRawBytes(),void 0,u,Be.PDF_417);
                d.putMetadata(Gn.ERROR_CORRECTION_LEVEL, f.getECLevel());
                var h = f.getOther();
                h != null && d.putMetadata(Gn.PDF417_EXTRA_METADATA, h),
                s.push(d)
            }
        } catch (p) {
            i = {
                error: p
            }
        } finally {
            try {
                c && !c.done && (o = l.return) && o.call(l)
            } finally {
                if (i)
                    throw i.error
            }
        }
        return s.map(function(p) {
            return p
        })
    }
    ,
    t.getMaxWidth = function(e, n) {
        return e == null || n == null ? 0 : Math.trunc(Math.abs(e.getX() - n.getX()))
    }
    ,
    t.getMinWidth = function(e, n) {
        return e == null || n == null ? qe.MAX_VALUE : Math.trunc(Math.abs(e.getX() - n.getX()))
    }
    ,
    t.getMaxCodewordWidth = function(e) {
        return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0], e[4]), t.getMaxWidth(e[6], e[2]) * at.MODULES_IN_CODEWORD / at.MODULES_IN_STOP_PATTERN), Math.max(t.getMaxWidth(e[1], e[5]), t.getMaxWidth(e[7], e[3]) * at.MODULES_IN_CODEWORD / at.MODULES_IN_STOP_PATTERN)))
    }
    ,
    t.getMinCodewordWidth = function(e) {
        return Math.floor(Math.min(Math.min(t.getMinWidth(e[0], e[4]), t.getMinWidth(e[6], e[2]) * at.MODULES_IN_CODEWORD / at.MODULES_IN_STOP_PATTERN), Math.min(t.getMinWidth(e[1], e[5]), t.getMinWidth(e[7], e[3]) * at.MODULES_IN_CODEWORD / at.MODULES_IN_STOP_PATTERN)))
    }
    ,
    t.prototype.reset = function() {}
    ,
    t
}()
  , B2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , zP = function(t) {
    B2e(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.kind = "ReaderException",
    e
}(Br)
  , jP = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , U9 = function() {
    function t() {}
    return t.prototype.decode = function(e, n) {
        return this.setHints(n),
        this.decodeInternal(e)
    }
    ,
    t.prototype.decodeWithState = function(e) {
        return (this.readers === null || this.readers === void 0) && this.setHints(null),
        this.decodeInternal(e)
    }
    ,
    t.prototype.setHints = function(e) {
        this.hints = e;
        var n = e != null && e.get(Ot.TRY_HARDER) !== void 0
          , r = e == null ? null : e.get(Ot.POSSIBLE_FORMATS)
          , i = new Array;
        if (r != null) {
            var o = r.some(function(s) {
                return s === Be.UPC_A || s === Be.UPC_E || s === Be.EAN_13 || s === Be.EAN_8 || s === Be.CODABAR || s === Be.CODE_39 || s === Be.CODE_93 || s === Be.CODE_128 || s === Be.ITF || s === Be.RSS_14 || s === Be.RSS_EXPANDED
            });
            o && !n && i.push(new xc(e)),
            r.includes(Be.QR_CODE) && i.push(new H0),
            r.includes(Be.DATA_MATRIX) && i.push(new G0),
            r.includes(Be.AZTEC) && i.push(new $0),
            r.includes(Be.PDF_417) && i.push(new V0),
            o && n && i.push(new xc(e))
        }
        i.length === 0 && (n || i.push(new xc(e)),
        i.push(new H0),
        i.push(new G0),
        i.push(new $0),
        i.push(new V0),
        n && i.push(new xc(e))),
        this.readers = i
    }
    ,
    t.prototype.reset = function() {
        var e, n;
        if (this.readers !== null)
            try {
                for (var r = jP(this.readers), i = r.next(); !i.done; i = r.next()) {
                    var o = i.value;
                    o.reset()
                }
            } catch (s) {
                e = {
                    error: s
                }
            } finally {
                try {
                    i && !i.done && (n = r.return) && n.call(r)
                } finally {
                    if (e)
                        throw e.error
                }
            }
    }
    ,
    t.prototype.decodeInternal = function(e) {
        var n, r;
        if (this.readers === null)
            throw new zP("No readers where selected, nothing can be read.");
        try {
            for (var i = jP(this.readers), o = i.next(); !o.done; o = i.next()) {
                var s = o.value;
                try {
                    return s.decode(e, this.hints)
                } catch (a) {
                    if (a instanceof zP)
                        continue
                }
            }
        } catch (a) {
            n = {
                error: a
            }
        } finally {
            try {
                o && !o.done && (r = i.return) && r.call(i)
            } finally {
                if (n)
                    throw n.error
            }
        }
        throw new oe("No MultiFormat Readers were able to detect the code.")
    }
    ,
    t
}()
  , k2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    k2e(e, t);
    function e(n, r) {
        n === void 0 && (n = null),
        r === void 0 && (r = 500);
        var i = this
          , o = new U9;
        return o.setHints(n),
        i = t.call(this, o, r) || this,
        i
    }
    return e.prototype.decodeBitmap = function(n) {
        return this.reader.decodeWithState(n)
    }
    ,
    e
}
)(Eu);
var N2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    N2e(e, t);
    function e(n) {
        return n === void 0 && (n = 500),
        t.call(this, new V0, n) || this
    }
    return e
}
)(Eu);
var F2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    F2e(e, t);
    function e(n) {
        return n === void 0 && (n = 500),
        t.call(this, new H0, n) || this
    }
    return e
}
)(Eu);
var Px;
(function(t) {
    t[t.ERROR_CORRECTION = 0] = "ERROR_CORRECTION",
    t[t.CHARACTER_SET = 1] = "CHARACTER_SET",
    t[t.DATA_MATRIX_SHAPE = 2] = "DATA_MATRIX_SHAPE",
    t[t.DATA_MATRIX_COMPACT = 3] = "DATA_MATRIX_COMPACT",
    t[t.MIN_SIZE = 4] = "MIN_SIZE",
    t[t.MAX_SIZE = 5] = "MAX_SIZE",
    t[t.MARGIN = 6] = "MARGIN",
    t[t.PDF417_COMPACT = 7] = "PDF417_COMPACT",
    t[t.PDF417_COMPACTION = 8] = "PDF417_COMPACTION",
    t[t.PDF417_DIMENSIONS = 9] = "PDF417_DIMENSIONS",
    t[t.AZTEC_LAYERS = 10] = "AZTEC_LAYERS",
    t[t.QR_VERSION = 11] = "QR_VERSION",
    t[t.GS1_FORMAT = 12] = "GS1_FORMAT",
    t[t.FORCE_C40 = 13] = "FORCE_C40"
}
)(Px || (Px = {}));
const _p = Px;
var G9 = function() {
    function t(e) {
        this.field = e,
        this.cachedGenerators = [],
        this.cachedGenerators.push(new Ks(e,Int32Array.from([1])))
    }
    return t.prototype.buildGenerator = function(e) {
        var n = this.cachedGenerators;
        if (e >= n.length)
            for (var r = n[n.length - 1], i = this.field, o = n.length; o <= e; o++) {
                var s = r.multiply(new Ks(i,Int32Array.from([1, i.exp(o - 1 + i.getGeneratorBase())])));
                n.push(s),
                r = s
            }
        return n[e]
    }
    ,
    t.prototype.encode = function(e, n) {
        if (n === 0)
            throw new ke("No error correction bytes");
        var r = e.length - n;
        if (r <= 0)
            throw new ke("No data bytes provided");
        var i = this.buildGenerator(n)
          , o = new Int32Array(r);
        It.arraycopy(e, 0, o, 0, r);
        var s = new Ks(this.field,o);
        s = s.multiplyByMonomial(n, 1);
        for (var a = s.divide(i)[1], l = a.getCoefficients(), c = n - l.length, u = 0; u < c; u++)
            e[r + u] = 0;
        It.arraycopy(l, 0, e, r + c, l.length)
    }
    ,
    t
}()
  , cf = function() {
    function t() {}
    return t.applyMaskPenaltyRule1 = function(e) {
        return t.applyMaskPenaltyRule1Internal(e, !0) + t.applyMaskPenaltyRule1Internal(e, !1)
    }
    ,
    t.applyMaskPenaltyRule2 = function(e) {
        for (var n = 0, r = e.getArray(), i = e.getWidth(), o = e.getHeight(), s = 0; s < o - 1; s++)
            for (var a = r[s], l = 0; l < i - 1; l++) {
                var c = a[l];
                c === a[l + 1] && c === r[s + 1][l] && c === r[s + 1][l + 1] && n++
            }
        return t.N2 * n
    }
    ,
    t.applyMaskPenaltyRule3 = function(e) {
        for (var n = 0, r = e.getArray(), i = e.getWidth(), o = e.getHeight(), s = 0; s < o; s++)
            for (var a = 0; a < i; a++) {
                var l = r[s];
                a + 6 < i && l[a] === 1 && l[a + 1] === 0 && l[a + 2] === 1 && l[a + 3] === 1 && l[a + 4] === 1 && l[a + 5] === 0 && l[a + 6] === 1 && (t.isWhiteHorizontal(l, a - 4, a) || t.isWhiteHorizontal(l, a + 7, a + 11)) && n++,
                s + 6 < o && r[s][a] === 1 && r[s + 1][a] === 0 && r[s + 2][a] === 1 && r[s + 3][a] === 1 && r[s + 4][a] === 1 && r[s + 5][a] === 0 && r[s + 6][a] === 1 && (t.isWhiteVertical(r, a, s - 4, s) || t.isWhiteVertical(r, a, s + 7, s + 11)) && n++
            }
        return n * t.N3
    }
    ,
    t.isWhiteHorizontal = function(e, n, r) {
        n = Math.max(n, 0),
        r = Math.min(r, e.length);
        for (var i = n; i < r; i++)
            if (e[i] === 1)
                return !1;
        return !0
    }
    ,
    t.isWhiteVertical = function(e, n, r, i) {
        r = Math.max(r, 0),
        i = Math.min(i, e.length);
        for (var o = r; o < i; o++)
            if (e[o][n] === 1)
                return !1;
        return !0
    }
    ,
    t.applyMaskPenaltyRule4 = function(e) {
        for (var n = 0, r = e.getArray(), i = e.getWidth(), o = e.getHeight(), s = 0; s < o; s++)
            for (var a = r[s], l = 0; l < i; l++)
                a[l] === 1 && n++;
        var c = e.getHeight() * e.getWidth()
          , u = Math.floor(Math.abs(n * 2 - c) * 10 / c);
        return u * t.N4
    }
    ,
    t.getDataMaskBit = function(e, n, r) {
        var i, o;
        switch (e) {
        case 0:
            i = r + n & 1;
            break;
        case 1:
            i = r & 1;
            break;
        case 2:
            i = n % 3;
            break;
        case 3:
            i = (r + n) % 3;
            break;
        case 4:
            i = Math.floor(r / 2) + Math.floor(n / 3) & 1;
            break;
        case 5:
            o = r * n,
            i = (o & 1) + o % 3;
            break;
        case 6:
            o = r * n,
            i = (o & 1) + o % 3 & 1;
            break;
        case 7:
            o = r * n,
            i = o % 3 + (r + n & 1) & 1;
            break;
        default:
            throw new ke("Invalid mask pattern: " + e)
        }
        return i === 0
    }
    ,
    t.applyMaskPenaltyRule1Internal = function(e, n) {
        for (var r = 0, i = n ? e.getHeight() : e.getWidth(), o = n ? e.getWidth() : e.getHeight(), s = e.getArray(), a = 0; a < i; a++) {
            for (var l = 0, c = -1, u = 0; u < o; u++) {
                var f = n ? s[a][u] : s[u][a];
                f === c ? l++ : (l >= 5 && (r += t.N1 + (l - 5)),
                l = 1,
                c = f)
            }
            l >= 5 && (r += t.N1 + (l - 5))
        }
        return r
    }
    ,
    t.N1 = 3,
    t.N2 = 3,
    t.N3 = 40,
    t.N4 = 10,
    t
}()
  , L2e = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , $2e = function() {
    function t(e, n) {
        this.width = e,
        this.height = n;
        for (var r = new Array(n), i = 0; i !== n; i++)
            r[i] = new Uint8Array(e);
        this.bytes = r
    }
    return t.prototype.getHeight = function() {
        return this.height
    }
    ,
    t.prototype.getWidth = function() {
        return this.width
    }
    ,
    t.prototype.get = function(e, n) {
        return this.bytes[n][e]
    }
    ,
    t.prototype.getArray = function() {
        return this.bytes
    }
    ,
    t.prototype.setNumber = function(e, n, r) {
        this.bytes[n][e] = r
    }
    ,
    t.prototype.setBoolean = function(e, n, r) {
        this.bytes[n][e] = r ? 1 : 0
    }
    ,
    t.prototype.clear = function(e) {
        var n, r;
        try {
            for (var i = L2e(this.bytes), o = i.next(); !o.done; o = i.next()) {
                var s = o.value;
                bn.fill(s, e)
            }
        } catch (a) {
            n = {
                error: a
            }
        } finally {
            try {
                o && !o.done && (r = i.return) && r.call(i)
            } finally {
                if (n)
                    throw n.error
            }
        }
    }
    ,
    t.prototype.equals = function(e) {
        if (!(e instanceof t))
            return !1;
        var n = e;
        if (this.width !== n.width || this.height !== n.height)
            return !1;
        for (var r = 0, i = this.height; r < i; ++r)
            for (var o = this.bytes[r], s = n.bytes[r], a = 0, l = this.width; a < l; ++a)
                if (o[a] !== s[a])
                    return !1;
        return !0
    }
    ,
    t.prototype.toString = function() {
        for (var e = new Ke, n = 0, r = this.height; n < r; ++n) {
            for (var i = this.bytes[n], o = 0, s = this.width; o < s; ++o)
                switch (i[o]) {
                case 0:
                    e.append(" 0");
                    break;
                case 1:
                    e.append(" 1");
                    break;
                default:
                    e.append("  ");
                    break
                }
            e.append(`
`)
        }
        return e.toString()
    }
    ,
    t
}()
  , Ix = function() {
    function t() {
        this.maskPattern = -1
    }
    return t.prototype.getMode = function() {
        return this.mode
    }
    ,
    t.prototype.getECLevel = function() {
        return this.ecLevel
    }
    ,
    t.prototype.getVersion = function() {
        return this.version
    }
    ,
    t.prototype.getMaskPattern = function() {
        return this.maskPattern
    }
    ,
    t.prototype.getMatrix = function() {
        return this.matrix
    }
    ,
    t.prototype.toString = function() {
        var e = new Ke;
        return e.append(`<<
`),
        e.append(" mode: "),
        e.append(this.mode ? this.mode.toString() : "null"),
        e.append(`
 ecLevel: `),
        e.append(this.ecLevel ? this.ecLevel.toString() : "null"),
        e.append(`
 version: `),
        e.append(this.version ? this.version.toString() : "null"),
        e.append(`
 maskPattern: `),
        e.append(this.maskPattern.toString()),
        this.matrix ? (e.append(`
 matrix:
`),
        e.append(this.matrix.toString())) : e.append(`
 matrix: null
`),
        e.append(`>>
`),
        e.toString()
    }
    ,
    t.prototype.setMode = function(e) {
        this.mode = e
    }
    ,
    t.prototype.setECLevel = function(e) {
        this.ecLevel = e
    }
    ,
    t.prototype.setVersion = function(e) {
        this.version = e
    }
    ,
    t.prototype.setMaskPattern = function(e) {
        this.maskPattern = e
    }
    ,
    t.prototype.setMatrix = function(e) {
        this.matrix = e
    }
    ,
    t.isValidMaskPattern = function(e) {
        return e >= 0 && e < t.NUM_MASK_PATTERNS
    }
    ,
    t.NUM_MASK_PATTERNS = 8,
    t
}()
  , U2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , Bt = function(t) {
    U2e(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.kind = "WriterException",
    e
}(Br)
  , WP = function() {
    function t() {}
    return t.clearMatrix = function(e) {
        e.clear(255)
    }
    ,
    t.buildMatrix = function(e, n, r, i, o) {
        t.clearMatrix(o),
        t.embedBasicPatterns(r, o),
        t.embedTypeInfo(n, i, o),
        t.maybeEmbedVersionInfo(r, o),
        t.embedDataBits(e, i, o)
    }
    ,
    t.embedBasicPatterns = function(e, n) {
        t.embedPositionDetectionPatternsAndSeparators(n),
        t.embedDarkDotAtLeftBottomCorner(n),
        t.maybeEmbedPositionAdjustmentPatterns(e, n),
        t.embedTimingPatterns(n)
    }
    ,
    t.embedTypeInfo = function(e, n, r) {
        var i = new Dn;
        t.makeTypeInfoBits(e, n, i);
        for (var o = 0, s = i.getSize(); o < s; ++o) {
            var a = i.get(i.getSize() - 1 - o)
              , l = t.TYPE_INFO_COORDINATES[o]
              , c = l[0]
              , u = l[1];
            if (r.setBoolean(c, u, a),
            o < 8) {
                var f = r.getWidth() - o - 1
                  , d = 8;
                r.setBoolean(f, d, a)
            } else {
                var f = 8
                  , d = r.getHeight() - 7 + (o - 8);
                r.setBoolean(f, d, a)
            }
        }
    }
    ,
    t.maybeEmbedVersionInfo = function(e, n) {
        if (!(e.getVersionNumber() < 7)) {
            var r = new Dn;
            t.makeVersionInfoBits(e, r);
            for (var i = 6 * 3 - 1, o = 0; o < 6; ++o)
                for (var s = 0; s < 3; ++s) {
                    var a = r.get(i);
                    i--,
                    n.setBoolean(o, n.getHeight() - 11 + s, a),
                    n.setBoolean(n.getHeight() - 11 + s, o, a)
                }
        }
    }
    ,
    t.embedDataBits = function(e, n, r) {
        for (var i = 0, o = -1, s = r.getWidth() - 1, a = r.getHeight() - 1; s > 0; ) {
            for (s === 6 && (s -= 1); a >= 0 && a < r.getHeight(); ) {
                for (var l = 0; l < 2; ++l) {
                    var c = s - l;
                    if (t.isEmpty(r.get(c, a))) {
                        var u = void 0;
                        i < e.getSize() ? (u = e.get(i),
                        ++i) : u = !1,
                        n !== 255 && cf.getDataMaskBit(n, c, a) && (u = !u),
                        r.setBoolean(c, a, u)
                    }
                }
                a += o
            }
            o = -o,
            a += o,
            s -= 2
        }
        if (i !== e.getSize())
            throw new Bt("Not all bits consumed: " + i + "/" + e.getSize())
    }
    ,
    t.findMSBSet = function(e) {
        return 32 - qe.numberOfLeadingZeros(e)
    }
    ,
    t.calculateBCHCode = function(e, n) {
        if (n === 0)
            throw new ke("0 polynomial");
        var r = t.findMSBSet(n);
        for (e <<= r - 1; t.findMSBSet(e) >= r; )
            e ^= n << t.findMSBSet(e) - r;
        return e
    }
    ,
    t.makeTypeInfoBits = function(e, n, r) {
        if (!Ix.isValidMaskPattern(n))
            throw new Bt("Invalid mask pattern");
        var i = e.getBits() << 3 | n;
        r.appendBits(i, 5);
        var o = t.calculateBCHCode(i, t.TYPE_INFO_POLY);
        r.appendBits(o, 10);
        var s = new Dn;
        if (s.appendBits(t.TYPE_INFO_MASK_PATTERN, 15),
        r.xor(s),
        r.getSize() !== 15)
            throw new Bt("should not happen but we got: " + r.getSize())
    }
    ,
    t.makeVersionInfoBits = function(e, n) {
        n.appendBits(e.getVersionNumber(), 6);
        var r = t.calculateBCHCode(e.getVersionNumber(), t.VERSION_INFO_POLY);
        if (n.appendBits(r, 12),
        n.getSize() !== 18)
            throw new Bt("should not happen but we got: " + n.getSize())
    }
    ,
    t.isEmpty = function(e) {
        return e === 255
    }
    ,
    t.embedTimingPatterns = function(e) {
        for (var n = 8; n < e.getWidth() - 8; ++n) {
            var r = (n + 1) % 2;
            t.isEmpty(e.get(n, 6)) && e.setNumber(n, 6, r),
            t.isEmpty(e.get(6, n)) && e.setNumber(6, n, r)
        }
    }
    ,
    t.embedDarkDotAtLeftBottomCorner = function(e) {
        if (e.get(8, e.getHeight() - 8) === 0)
            throw new Bt;
        e.setNumber(8, e.getHeight() - 8, 1)
    }
    ,
    t.embedHorizontalSeparationPattern = function(e, n, r) {
        for (var i = 0; i < 8; ++i) {
            if (!t.isEmpty(r.get(e + i, n)))
                throw new Bt;
            r.setNumber(e + i, n, 0)
        }
    }
    ,
    t.embedVerticalSeparationPattern = function(e, n, r) {
        for (var i = 0; i < 7; ++i) {
            if (!t.isEmpty(r.get(e, n + i)))
                throw new Bt;
            r.setNumber(e, n + i, 0)
        }
    }
    ,
    t.embedPositionAdjustmentPattern = function(e, n, r) {
        for (var i = 0; i < 5; ++i)
            for (var o = t.POSITION_ADJUSTMENT_PATTERN[i], s = 0; s < 5; ++s)
                r.setNumber(e + s, n + i, o[s])
    }
    ,
    t.embedPositionDetectionPattern = function(e, n, r) {
        for (var i = 0; i < 7; ++i)
            for (var o = t.POSITION_DETECTION_PATTERN[i], s = 0; s < 7; ++s)
                r.setNumber(e + s, n + i, o[s])
    }
    ,
    t.embedPositionDetectionPatternsAndSeparators = function(e) {
        var n = t.POSITION_DETECTION_PATTERN[0].length;
        t.embedPositionDetectionPattern(0, 0, e),
        t.embedPositionDetectionPattern(e.getWidth() - n, 0, e),
        t.embedPositionDetectionPattern(0, e.getWidth() - n, e);
        var r = 8;
        t.embedHorizontalSeparationPattern(0, r - 1, e),
        t.embedHorizontalSeparationPattern(e.getWidth() - r, r - 1, e),
        t.embedHorizontalSeparationPattern(0, e.getWidth() - r, e);
        var i = 7;
        t.embedVerticalSeparationPattern(i, 0, e),
        t.embedVerticalSeparationPattern(e.getHeight() - i - 1, 0, e),
        t.embedVerticalSeparationPattern(i, e.getHeight() - i, e)
    }
    ,
    t.maybeEmbedPositionAdjustmentPatterns = function(e, n) {
        if (!(e.getVersionNumber() < 2))
            for (var r = e.getVersionNumber() - 1, i = t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[r], o = 0, s = i.length; o !== s; o++) {
                var a = i[o];
                if (a >= 0)
                    for (var l = 0; l !== s; l++) {
                        var c = i[l];
                        c >= 0 && t.isEmpty(n.get(c, a)) && t.embedPositionAdjustmentPattern(c - 2, a - 2, n)
                    }
            }
    }
    ,
    t.POSITION_DETECTION_PATTERN = Array.from([Int32Array.from([1, 1, 1, 1, 1, 1, 1]), Int32Array.from([1, 0, 0, 0, 0, 0, 1]), Int32Array.from([1, 0, 1, 1, 1, 0, 1]), Int32Array.from([1, 0, 1, 1, 1, 0, 1]), Int32Array.from([1, 0, 1, 1, 1, 0, 1]), Int32Array.from([1, 0, 0, 0, 0, 0, 1]), Int32Array.from([1, 1, 1, 1, 1, 1, 1])]),
    t.POSITION_ADJUSTMENT_PATTERN = Array.from([Int32Array.from([1, 1, 1, 1, 1]), Int32Array.from([1, 0, 0, 0, 1]), Int32Array.from([1, 0, 1, 0, 1]), Int32Array.from([1, 0, 0, 0, 1]), Int32Array.from([1, 1, 1, 1, 1])]),
    t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE = Array.from([Int32Array.from([-1, -1, -1, -1, -1, -1, -1]), Int32Array.from([6, 18, -1, -1, -1, -1, -1]), Int32Array.from([6, 22, -1, -1, -1, -1, -1]), Int32Array.from([6, 26, -1, -1, -1, -1, -1]), Int32Array.from([6, 30, -1, -1, -1, -1, -1]), Int32Array.from([6, 34, -1, -1, -1, -1, -1]), Int32Array.from([6, 22, 38, -1, -1, -1, -1]), Int32Array.from([6, 24, 42, -1, -1, -1, -1]), Int32Array.from([6, 26, 46, -1, -1, -1, -1]), Int32Array.from([6, 28, 50, -1, -1, -1, -1]), Int32Array.from([6, 30, 54, -1, -1, -1, -1]), Int32Array.from([6, 32, 58, -1, -1, -1, -1]), Int32Array.from([6, 34, 62, -1, -1, -1, -1]), Int32Array.from([6, 26, 46, 66, -1, -1, -1]), Int32Array.from([6, 26, 48, 70, -1, -1, -1]), Int32Array.from([6, 26, 50, 74, -1, -1, -1]), Int32Array.from([6, 30, 54, 78, -1, -1, -1]), Int32Array.from([6, 30, 56, 82, -1, -1, -1]), Int32Array.from([6, 30, 58, 86, -1, -1, -1]), Int32Array.from([6, 34, 62, 90, -1, -1, -1]), Int32Array.from([6, 28, 50, 72, 94, -1, -1]), Int32Array.from([6, 26, 50, 74, 98, -1, -1]), Int32Array.from([6, 30, 54, 78, 102, -1, -1]), Int32Array.from([6, 28, 54, 80, 106, -1, -1]), Int32Array.from([6, 32, 58, 84, 110, -1, -1]), Int32Array.from([6, 30, 58, 86, 114, -1, -1]), Int32Array.from([6, 34, 62, 90, 118, -1, -1]), Int32Array.from([6, 26, 50, 74, 98, 122, -1]), Int32Array.from([6, 30, 54, 78, 102, 126, -1]), Int32Array.from([6, 26, 52, 78, 104, 130, -1]), Int32Array.from([6, 30, 56, 82, 108, 134, -1]), Int32Array.from([6, 34, 60, 86, 112, 138, -1]), Int32Array.from([6, 30, 58, 86, 114, 142, -1]), Int32Array.from([6, 34, 62, 90, 118, 146, -1]), Int32Array.from([6, 30, 54, 78, 102, 126, 150]), Int32Array.from([6, 24, 50, 76, 102, 128, 154]), Int32Array.from([6, 28, 54, 80, 106, 132, 158]), Int32Array.from([6, 32, 58, 84, 110, 136, 162]), Int32Array.from([6, 26, 54, 82, 110, 138, 166]), Int32Array.from([6, 30, 58, 86, 114, 142, 170])]),
    t.TYPE_INFO_COORDINATES = Array.from([Int32Array.from([8, 0]), Int32Array.from([8, 1]), Int32Array.from([8, 2]), Int32Array.from([8, 3]), Int32Array.from([8, 4]), Int32Array.from([8, 5]), Int32Array.from([8, 7]), Int32Array.from([8, 8]), Int32Array.from([7, 8]), Int32Array.from([5, 8]), Int32Array.from([4, 8]), Int32Array.from([3, 8]), Int32Array.from([2, 8]), Int32Array.from([1, 8]), Int32Array.from([0, 8])]),
    t.VERSION_INFO_POLY = 7973,
    t.TYPE_INFO_POLY = 1335,
    t.TYPE_INFO_MASK_PATTERN = 21522,
    t
}()
  , G2e = function() {
    function t(e, n) {
        this.dataBytes = e,
        this.errorCorrectionBytes = n
    }
    return t.prototype.getDataBytes = function() {
        return this.dataBytes
    }
    ,
    t.prototype.getErrorCorrectionBytes = function() {
        return this.errorCorrectionBytes
    }
    ,
    t
}()
  , YP = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
;
(function() {
    function t() {}
    return t.calculateMaskPenalty = function(e) {
        return cf.applyMaskPenaltyRule1(e) + cf.applyMaskPenaltyRule2(e) + cf.applyMaskPenaltyRule3(e) + cf.applyMaskPenaltyRule4(e)
    }
    ,
    t.encode = function(e, n, r) {
        r === void 0 && (r = null);
        var i = t.DEFAULT_BYTE_MODE_ENCODING
          , o = r !== null && r.get(_p.CHARACTER_SET) !== void 0;
        o && (i = r.get(_p.CHARACTER_SET).toString());
        var s = this.chooseMode(e, i)
          , a = new Dn;
        if (s === kt.BYTE && (o || t.DEFAULT_BYTE_MODE_ENCODING !== i)) {
            var l = xn.getCharacterSetECIByName(i);
            l !== void 0 && this.appendECI(l, a)
        }
        this.appendModeInfo(s, a);
        var c = new Dn;
        this.appendBytes(e, s, c, i);
        var u;
        if (r !== null && r.get(_p.QR_VERSION) !== void 0) {
            var f = Number.parseInt(r.get(_p.QR_VERSION).toString(), 10);
            u = ol.getVersionForNumber(f);
            var d = this.calculateBitsNeeded(s, a, c, u);
            if (!this.willFit(d, u, n))
                throw new Bt("Data too big for requested version")
        } else
            u = this.recommendVersion(n, s, a, c);
        var h = new Dn;
        h.appendBitArray(a);
        var p = s === kt.BYTE ? c.getSizeInBytes() : e.length;
        this.appendLengthInfo(p, u, s, h),
        h.appendBitArray(c);
        var y = u.getECBlocksForLevel(n)
          , v = u.getTotalCodewords() - y.getTotalECCodewords();
        this.terminateBits(v, h);
        var g = this.interleaveWithECBytes(h, u.getTotalCodewords(), v, y.getNumBlocks())
          , m = new Ix;
        m.setECLevel(n),
        m.setMode(s),
        m.setVersion(u);
        var _ = u.getDimensionForVersion()
          , x = new $2e(_,_)
          , b = this.chooseMaskPattern(g, n, u, x);
        return m.setMaskPattern(b),
        WP.buildMatrix(g, n, u, b, x),
        m.setMatrix(x),
        m
    }
    ,
    t.recommendVersion = function(e, n, r, i) {
        var o = this.calculateBitsNeeded(n, r, i, ol.getVersionForNumber(1))
          , s = this.chooseVersion(o, e)
          , a = this.calculateBitsNeeded(n, r, i, s);
        return this.chooseVersion(a, e)
    }
    ,
    t.calculateBitsNeeded = function(e, n, r, i) {
        return n.getSize() + e.getCharacterCountBits(i) + r.getSize()
    }
    ,
    t.getAlphanumericCode = function(e) {
        return e < t.ALPHANUMERIC_TABLE.length ? t.ALPHANUMERIC_TABLE[e] : -1
    }
    ,
    t.chooseMode = function(e, n) {
        if (n === void 0 && (n = null),
        xn.SJIS.getName() === n && this.isOnlyDoubleByteKanji(e))
            return kt.KANJI;
        for (var r = !1, i = !1, o = 0, s = e.length; o < s; ++o) {
            var a = e.charAt(o);
            if (t.isDigit(a))
                r = !0;
            else if (this.getAlphanumericCode(a.charCodeAt(0)) !== -1)
                i = !0;
            else
                return kt.BYTE
        }
        return i ? kt.ALPHANUMERIC : r ? kt.NUMERIC : kt.BYTE
    }
    ,
    t.isOnlyDoubleByteKanji = function(e) {
        var n;
        try {
            n = mi.encode(e, xn.SJIS)
        } catch {
            return !1
        }
        var r = n.length;
        if (r % 2 !== 0)
            return !1;
        for (var i = 0; i < r; i += 2) {
            var o = n[i] & 255;
            if ((o < 129 || o > 159) && (o < 224 || o > 235))
                return !1
        }
        return !0
    }
    ,
    t.chooseMaskPattern = function(e, n, r, i) {
        for (var o = Number.MAX_SAFE_INTEGER, s = -1, a = 0; a < Ix.NUM_MASK_PATTERNS; a++) {
            WP.buildMatrix(e, n, r, a, i);
            var l = this.calculateMaskPenalty(i);
            l < o && (o = l,
            s = a)
        }
        return s
    }
    ,
    t.chooseVersion = function(e, n) {
        for (var r = 1; r <= 40; r++) {
            var i = ol.getVersionForNumber(r);
            if (t.willFit(e, i, n))
                return i
        }
        throw new Bt("Data too big")
    }
    ,
    t.willFit = function(e, n, r) {
        var i = n.getTotalCodewords()
          , o = n.getECBlocksForLevel(r)
          , s = o.getTotalECCodewords()
          , a = i - s
          , l = (e + 7) / 8;
        return a >= l
    }
    ,
    t.terminateBits = function(e, n) {
        var r = e * 8;
        if (n.getSize() > r)
            throw new Bt("data bits cannot fit in the QR Code" + n.getSize() + " > " + r);
        for (var i = 0; i < 4 && n.getSize() < r; ++i)
            n.appendBit(!1);
        var o = n.getSize() & 7;
        if (o > 0)
            for (var i = o; i < 8; i++)
                n.appendBit(!1);
        for (var s = e - n.getSizeInBytes(), i = 0; i < s; ++i)
            n.appendBits(i & 1 ? 17 : 236, 8);
        if (n.getSize() !== r)
            throw new Bt("Bits size does not equal capacity")
    }
    ,
    t.getNumDataBytesAndNumECBytesForBlockID = function(e, n, r, i, o, s) {
        if (i >= r)
            throw new Bt("Block ID too large");
        var a = e % r
          , l = r - a
          , c = Math.floor(e / r)
          , u = c + 1
          , f = Math.floor(n / r)
          , d = f + 1
          , h = c - f
          , p = u - d;
        if (h !== p)
            throw new Bt("EC bytes mismatch");
        if (r !== l + a)
            throw new Bt("RS blocks mismatch");
        if (e !== (f + h) * l + (d + p) * a)
            throw new Bt("Total bytes mismatch");
        i < l ? (o[0] = f,
        s[0] = h) : (o[0] = d,
        s[0] = p)
    }
    ,
    t.interleaveWithECBytes = function(e, n, r, i) {
        var o, s, a, l;
        if (e.getSizeInBytes() !== r)
            throw new Bt("Number of bits and data bytes does not match");
        for (var c = 0, u = 0, f = 0, d = new Array, h = 0; h < i; ++h) {
            var p = new Int32Array(1)
              , y = new Int32Array(1);
            t.getNumDataBytesAndNumECBytesForBlockID(n, r, i, h, p, y);
            var v = p[0]
              , g = new Uint8Array(v);
            e.toBytes(8 * c, g, 0, v);
            var m = t.generateECBytes(g, y[0]);
            d.push(new G2e(g,m)),
            u = Math.max(u, v),
            f = Math.max(f, m.length),
            c += p[0]
        }
        if (r !== c)
            throw new Bt("Data bytes does not match offset");
        for (var _ = new Dn, h = 0; h < u; ++h)
            try {
                for (var x = (o = void 0,
                YP(d)), b = x.next(); !b.done; b = x.next()) {
                    var w = b.value
                      , g = w.getDataBytes();
                    h < g.length && _.appendBits(g[h], 8)
                }
            } catch (C) {
                o = {
                    error: C
                }
            } finally {
                try {
                    b && !b.done && (s = x.return) && s.call(x)
                } finally {
                    if (o)
                        throw o.error
                }
            }
        for (var h = 0; h < f; ++h)
            try {
                for (var E = (a = void 0,
                YP(d)), S = E.next(); !S.done; S = E.next()) {
                    var w = S.value
                      , m = w.getErrorCorrectionBytes();
                    h < m.length && _.appendBits(m[h], 8)
                }
            } catch (C) {
                a = {
                    error: C
                }
            } finally {
                try {
                    S && !S.done && (l = E.return) && l.call(E)
                } finally {
                    if (a)
                        throw a.error
                }
            }
        if (n !== _.getSizeInBytes())
            throw new Bt("Interleaving error: " + n + " and " + _.getSizeInBytes() + " differ.");
        return _
    }
    ,
    t.generateECBytes = function(e, n) {
        for (var r = e.length, i = new Int32Array(r + n), o = 0; o < r; o++)
            i[o] = e[o] & 255;
        new G9(Sr.QR_CODE_FIELD_256).encode(i, n);
        for (var s = new Uint8Array(n), o = 0; o < n; o++)
            s[o] = i[r + o];
        return s
    }
    ,
    t.appendModeInfo = function(e, n) {
        n.appendBits(e.getBits(), 4)
    }
    ,
    t.appendLengthInfo = function(e, n, r, i) {
        var o = r.getCharacterCountBits(n);
        if (e >= 1 << o)
            throw new Bt(e + " is bigger than " + ((1 << o) - 1));
        i.appendBits(e, o)
    }
    ,
    t.appendBytes = function(e, n, r, i) {
        switch (n) {
        case kt.NUMERIC:
            t.appendNumericBytes(e, r);
            break;
        case kt.ALPHANUMERIC:
            t.appendAlphanumericBytes(e, r);
            break;
        case kt.BYTE:
            t.append8BitBytes(e, r, i);
            break;
        case kt.KANJI:
            t.appendKanjiBytes(e, r);
            break;
        default:
            throw new Bt("Invalid mode: " + n)
        }
    }
    ,
    t.getDigit = function(e) {
        return e.charCodeAt(0) - 48
    }
    ,
    t.isDigit = function(e) {
        var n = t.getDigit(e);
        return n >= 0 && n <= 9
    }
    ,
    t.appendNumericBytes = function(e, n) {
        for (var r = e.length, i = 0; i < r; ) {
            var o = t.getDigit(e.charAt(i));
            if (i + 2 < r) {
                var s = t.getDigit(e.charAt(i + 1))
                  , a = t.getDigit(e.charAt(i + 2));
                n.appendBits(o * 100 + s * 10 + a, 10),
                i += 3
            } else if (i + 1 < r) {
                var s = t.getDigit(e.charAt(i + 1));
                n.appendBits(o * 10 + s, 7),
                i += 2
            } else
                n.appendBits(o, 4),
                i++
        }
    }
    ,
    t.appendAlphanumericBytes = function(e, n) {
        for (var r = e.length, i = 0; i < r; ) {
            var o = t.getAlphanumericCode(e.charCodeAt(i));
            if (o === -1)
                throw new Bt;
            if (i + 1 < r) {
                var s = t.getAlphanumericCode(e.charCodeAt(i + 1));
                if (s === -1)
                    throw new Bt;
                n.appendBits(o * 45 + s, 11),
                i += 2
            } else
                n.appendBits(o, 6),
                i++
        }
    }
    ,
    t.append8BitBytes = function(e, n, r) {
        var i;
        try {
            i = mi.encode(e, r)
        } catch (l) {
            throw new Bt(l)
        }
        for (var o = 0, s = i.length; o !== s; o++) {
            var a = i[o];
            n.appendBits(a, 8)
        }
    }
    ,
    t.appendKanjiBytes = function(e, n) {
        var r;
        try {
            r = mi.encode(e, xn.SJIS)
        } catch (f) {
            throw new Bt(f)
        }
        for (var i = r.length, o = 0; o < i; o += 2) {
            var s = r[o] & 255
              , a = r[o + 1] & 255
              , l = s << 8 & 4294967295 | a
              , c = -1;
            if (l >= 33088 && l <= 40956 ? c = l - 33088 : l >= 57408 && l <= 60351 && (c = l - 49472),
            c === -1)
                throw new Bt("Invalid byte sequence");
            var u = (c >> 8) * 192 + (c & 255);
            n.appendBits(u, 13)
        }
    }
    ,
    t.appendECI = function(e, n) {
        n.appendBits(kt.ECI.getBits(), 4),
        n.appendBits(e.getValue(), 8)
    }
    ,
    t.ALPHANUMERIC_TABLE = Int32Array.from([-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1]),
    t.DEFAULT_BYTE_MODE_ENCODING = xn.UTF8.getName(),
    t
}
)();
var H2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    H2e(e, t);
    function e(n, r, i, o, s, a, l, c) {
        var u = t.call(this, a, l) || this;
        if (u.yuvData = n,
        u.dataWidth = r,
        u.dataHeight = i,
        u.left = o,
        u.top = s,
        o + a > r || s + l > i)
            throw new ke("Crop rectangle does not fit within image data.");
        return c && u.reverseHorizontal(a, l),
        u
    }
    return e.prototype.getRow = function(n, r) {
        if (n < 0 || n >= this.getHeight())
            throw new ke("Requested row is outside the image: " + n);
        var i = this.getWidth();
        (r == null || r.length < i) && (r = new Uint8ClampedArray(i));
        var o = (n + this.top) * this.dataWidth + this.left;
        return It.arraycopy(this.yuvData, o, r, 0, i),
        r
    }
    ,
    e.prototype.getMatrix = function() {
        var n = this.getWidth()
          , r = this.getHeight();
        if (n === this.dataWidth && r === this.dataHeight)
            return this.yuvData;
        var i = n * r
          , o = new Uint8ClampedArray(i)
          , s = this.top * this.dataWidth + this.left;
        if (n === this.dataWidth)
            return It.arraycopy(this.yuvData, s, o, 0, i),
            o;
        for (var a = 0; a < r; a++) {
            var l = a * n;
            It.arraycopy(this.yuvData, s, o, l, n),
            s += this.dataWidth
        }
        return o
    }
    ,
    e.prototype.isCropSupported = function() {
        return !0
    }
    ,
    e.prototype.crop = function(n, r, i, o) {
        return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left + n,this.top + r,i,o,!1)
    }
    ,
    e.prototype.renderThumbnail = function() {
        for (var n = this.getWidth() / e.THUMBNAIL_SCALE_FACTOR, r = this.getHeight() / e.THUMBNAIL_SCALE_FACTOR, i = new Int32Array(n * r), o = this.yuvData, s = this.top * this.dataWidth + this.left, a = 0; a < r; a++) {
            for (var l = a * n, c = 0; c < n; c++) {
                var u = o[s + c * e.THUMBNAIL_SCALE_FACTOR] & 255;
                i[l + c] = 4278190080 | u * 65793
            }
            s += this.dataWidth * e.THUMBNAIL_SCALE_FACTOR
        }
        return i
    }
    ,
    e.prototype.getThumbnailWidth = function() {
        return this.getWidth() / e.THUMBNAIL_SCALE_FACTOR
    }
    ,
    e.prototype.getThumbnailHeight = function() {
        return this.getHeight() / e.THUMBNAIL_SCALE_FACTOR
    }
    ,
    e.prototype.reverseHorizontal = function(n, r) {
        for (var i = this.yuvData, o = 0, s = this.top * this.dataWidth + this.left; o < r; o++,
        s += this.dataWidth)
            for (var a = s + n / 2, l = s, c = s + n - 1; l < a; l++,
            c--) {
                var u = i[l];
                i[l] = i[c],
                i[c] = u
            }
    }
    ,
    e.prototype.invert = function() {
        return new vm(this)
    }
    ,
    e.THUMBNAIL_SCALE_FACTOR = 2,
    e
}
)(uh);
var V2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    V2e(e, t);
    function e(n, r, i, o, s, a, l) {
        var c = t.call(this, r, i) || this;
        if (c.dataWidth = o,
        c.dataHeight = s,
        c.left = a,
        c.top = l,
        n.BYTES_PER_ELEMENT === 4) {
            for (var u = r * i, f = new Uint8ClampedArray(u), d = 0; d < u; d++) {
                var h = n[d]
                  , p = h >> 16 & 255
                  , y = h >> 7 & 510
                  , v = h & 255;
                f[d] = (p + y + v) / 4 & 255
            }
            c.luminances = f
        } else
            c.luminances = n;
        if (o === void 0 && (c.dataWidth = r),
        s === void 0 && (c.dataHeight = i),
        a === void 0 && (c.left = 0),
        l === void 0 && (c.top = 0),
        c.left + r > c.dataWidth || c.top + i > c.dataHeight)
            throw new ke("Crop rectangle does not fit within image data.");
        return c
    }
    return e.prototype.getRow = function(n, r) {
        if (n < 0 || n >= this.getHeight())
            throw new ke("Requested row is outside the image: " + n);
        var i = this.getWidth();
        (r == null || r.length < i) && (r = new Uint8ClampedArray(i));
        var o = (n + this.top) * this.dataWidth + this.left;
        return It.arraycopy(this.luminances, o, r, 0, i),
        r
    }
    ,
    e.prototype.getMatrix = function() {
        var n = this.getWidth()
          , r = this.getHeight();
        if (n === this.dataWidth && r === this.dataHeight)
            return this.luminances;
        var i = n * r
          , o = new Uint8ClampedArray(i)
          , s = this.top * this.dataWidth + this.left;
        if (n === this.dataWidth)
            return It.arraycopy(this.luminances, s, o, 0, i),
            o;
        for (var a = 0; a < r; a++) {
            var l = a * n;
            It.arraycopy(this.luminances, s, o, l, n),
            s += this.dataWidth
        }
        return o
    }
    ,
    e.prototype.isCropSupported = function() {
        return !0
    }
    ,
    e.prototype.crop = function(n, r, i, o) {
        return new e(this.luminances,i,o,this.dataWidth,this.dataHeight,this.left + n,this.top + r)
    }
    ,
    e.prototype.invert = function() {
        return new vm(this)
    }
    ,
    e
}
)(uh);
var z2e = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}(), j2e = function(t) {
    z2e(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.forName = function(n) {
        return this.getCharacterSetECIByName(n)
    }
    ,
    e
}(xn), W2e = function() {
    function t() {}
    return t.ISO_8859_1 = xn.ISO8859_1,
    t
}(), Ox, Y2e = 301, X2e = function(t, e) {
    for (var n = 1, r = 0; r < 255; r++)
        e[r] = n,
        t[n] = r,
        n *= 2,
        n >= 256 && (n ^= Y2e);
    return {
        LOG: t,
        ALOG: e
    }
};
Ox = X2e([], []),
Ox.LOG;
Ox.ALOG;
var XP;
(function(t) {
    t[t.FORCE_NONE = 0] = "FORCE_NONE",
    t[t.FORCE_SQUARE = 1] = "FORCE_SQUARE",
    t[t.FORCE_RECTANGLE = 2] = "FORCE_RECTANGLE"
}
)(XP || (XP = {}));
var KP = 129
  , H9 = 230
  , K2e = 231
  , q2e = 235
  , Z2e = 236
  , J2e = 237
  , Q2e = 238
  , eEe = 239
  , tEe = 240
  , Rv = 254
  , nEe = 254
  , qP = "[)>05"
  , ZP = "[)>06"
  , JP = ""
  , xt = 0
  , Fn = 1
  , ar = 2
  , mn = 3
  , Pn = 4
  , Wn = 5
  , rEe = function() {
    function t() {}
    return t.prototype.getEncodingMode = function() {
        return xt
    }
    ,
    t.prototype.encode = function(e) {
        var n = Ri.determineConsecutiveDigitCount(e.getMessage(), e.pos);
        if (n >= 2)
            e.writeCodeword(this.encodeASCIIDigits(e.getMessage().charCodeAt(e.pos), e.getMessage().charCodeAt(e.pos + 1))),
            e.pos += 2;
        else {
            var r = e.getCurrentChar()
              , i = Ri.lookAheadTest(e.getMessage(), e.pos, this.getEncodingMode());
            if (i !== this.getEncodingMode())
                switch (i) {
                case Wn:
                    e.writeCodeword(K2e),
                    e.signalEncoderChange(Wn);
                    return;
                case Fn:
                    e.writeCodeword(H9),
                    e.signalEncoderChange(Fn);
                    return;
                case mn:
                    e.writeCodeword(Q2e),
                    e.signalEncoderChange(mn);
                    break;
                case ar:
                    e.writeCodeword(eEe),
                    e.signalEncoderChange(ar);
                    break;
                case Pn:
                    e.writeCodeword(tEe),
                    e.signalEncoderChange(Pn);
                    break;
                default:
                    throw new Error("Illegal mode: " + i)
                }
            else
                Ri.isExtendedASCII(r) ? (e.writeCodeword(q2e),
                e.writeCodeword(r - 128 + 1),
                e.pos++) : (e.writeCodeword(r + 1),
                e.pos++)
        }
    }
    ,
    t.prototype.encodeASCIIDigits = function(e, n) {
        if (Ri.isDigit(e) && Ri.isDigit(n)) {
            var r = (e - 48) * 10 + (n - 48);
            return r + 130
        }
        throw new Error("not digits: " + e + n)
    }
    ,
    t
}()
  , iEe = function() {
    function t() {}
    return t.prototype.getEncodingMode = function() {
        return Wn
    }
    ,
    t.prototype.encode = function(e) {
        var n = new Ke;
        for (n.append(0); e.hasMoreCharacters(); ) {
            var r = e.getCurrentChar();
            n.append(r),
            e.pos++;
            var i = Ri.lookAheadTest(e.getMessage(), e.pos, this.getEncodingMode());
            if (i !== this.getEncodingMode()) {
                e.signalEncoderChange(xt);
                break
            }
        }
        var o = n.length() - 1
          , s = 1
          , a = e.getCodewordCount() + o + s;
        e.updateSymbolInfo(a);
        var l = e.getSymbolInfo().getDataCapacity() - a > 0;
        if (e.hasMoreCharacters() || l)
            if (o <= 249)
                n.setCharAt(0, nt.getCharAt(o));
            else if (o <= 1555)
                n.setCharAt(0, nt.getCharAt(Math.floor(o / 250) + 249)),
                n.insert(1, nt.getCharAt(o % 250));
            else
                throw new Error("Message length not in valid ranges: " + o);
        for (var c = 0, r = n.length(); c < r; c++)
            e.writeCodeword(this.randomize255State(n.charAt(c).charCodeAt(0), e.getCodewordCount() + 1))
    }
    ,
    t.prototype.randomize255State = function(e, n) {
        var r = 149 * n % 255 + 1
          , i = e + r;
        return i <= 255 ? i : i - 256
    }
    ,
    t
}()
  , hE = function() {
    function t() {}
    return t.prototype.getEncodingMode = function() {
        return Fn
    }
    ,
    t.prototype.encodeMaximal = function(e) {
        for (var n = new Ke, r = 0, i = e.pos, o = 0; e.hasMoreCharacters(); ) {
            var s = e.getCurrentChar();
            e.pos++,
            r = this.encodeChar(s, n),
            n.length() % 3 === 0 && (i = e.pos,
            o = n.length())
        }
        if (o !== n.length()) {
            var a = Math.floor(n.length() / 3 * 2)
              , l = Math.floor(e.getCodewordCount() + a + 1);
            e.updateSymbolInfo(l);
            var c = e.getSymbolInfo().getDataCapacity() - l
              , u = Math.floor(n.length() % 3);
            (u === 2 && c !== 2 || u === 1 && (r > 3 || c !== 1)) && (e.pos = i)
        }
        n.length() > 0 && e.writeCodeword(H9),
        this.handleEOD(e, n)
    }
    ,
    t.prototype.encode = function(e) {
        for (var n = new Ke; e.hasMoreCharacters(); ) {
            var r = e.getCurrentChar();
            e.pos++;
            var i = this.encodeChar(r, n)
              , o = Math.floor(n.length() / 3) * 2
              , s = e.getCodewordCount() + o;
            e.updateSymbolInfo(s);
            var a = e.getSymbolInfo().getDataCapacity() - s;
            if (!e.hasMoreCharacters()) {
                var l = new Ke;
                for (n.length() % 3 === 2 && a !== 2 && (i = this.backtrackOneCharacter(e, n, l, i)); n.length() % 3 === 1 && (i > 3 || a !== 1); )
                    i = this.backtrackOneCharacter(e, n, l, i);
                break
            }
            var c = n.length();
            if (c % 3 === 0) {
                var u = Ri.lookAheadTest(e.getMessage(), e.pos, this.getEncodingMode());
                if (u !== this.getEncodingMode()) {
                    e.signalEncoderChange(xt);
                    break
                }
            }
        }
        this.handleEOD(e, n)
    }
    ,
    t.prototype.backtrackOneCharacter = function(e, n, r, i) {
        var o = n.length()
          , s = n.toString().substring(0, o - i);
        n.setLengthToZero(),
        n.append(s),
        e.pos--;
        var a = e.getCurrentChar();
        return i = this.encodeChar(a, r),
        e.resetSymbolInfo(),
        i
    }
    ,
    t.prototype.writeNextTriplet = function(e, n) {
        e.writeCodewords(this.encodeToCodewords(n.toString()));
        var r = n.toString().substring(3);
        n.setLengthToZero(),
        n.append(r)
    }
    ,
    t.prototype.handleEOD = function(e, n) {
        var r = Math.floor(n.length() / 3 * 2)
          , i = n.length() % 3
          , o = e.getCodewordCount() + r;
        e.updateSymbolInfo(o);
        var s = e.getSymbolInfo().getDataCapacity() - o;
        if (i === 2) {
            for (n.append("\0"); n.length() >= 3; )
                this.writeNextTriplet(e, n);
            e.hasMoreCharacters() && e.writeCodeword(Rv)
        } else if (s === 1 && i === 1) {
            for (; n.length() >= 3; )
                this.writeNextTriplet(e, n);
            e.hasMoreCharacters() && e.writeCodeword(Rv),
            e.pos--
        } else if (i === 0) {
            for (; n.length() >= 3; )
                this.writeNextTriplet(e, n);
            (s > 0 || e.hasMoreCharacters()) && e.writeCodeword(Rv)
        } else
            throw new Error("Unexpected case. Please report!");
        e.signalEncoderChange(xt)
    }
    ,
    t.prototype.encodeChar = function(e, n) {
        if (e === " ".charCodeAt(0))
            return n.append(3),
            1;
        if (e >= "0".charCodeAt(0) && e <= "9".charCodeAt(0))
            return n.append(e - 48 + 4),
            1;
        if (e >= "A".charCodeAt(0) && e <= "Z".charCodeAt(0))
            return n.append(e - 65 + 14),
            1;
        if (e < " ".charCodeAt(0))
            return n.append(0),
            n.append(e),
            2;
        if (e <= "/".charCodeAt(0))
            return n.append(1),
            n.append(e - 33),
            2;
        if (e <= "@".charCodeAt(0))
            return n.append(1),
            n.append(e - 58 + 15),
            2;
        if (e <= "_".charCodeAt(0))
            return n.append(1),
            n.append(e - 91 + 22),
            2;
        if (e <= 127)
            return n.append(2),
            n.append(e - 96),
            2;
        n.append("1");
        var r = 2;
        return r += this.encodeChar(e - 128, n),
        r
    }
    ,
    t.prototype.encodeToCodewords = function(e) {
        var n = 1600 * e.charCodeAt(0) + 40 * e.charCodeAt(1) + e.charCodeAt(2) + 1
          , r = n / 256
          , i = n % 256
          , o = new Ke;
        return o.append(r),
        o.append(i),
        o.toString()
    }
    ,
    t
}()
  , oEe = function() {
    function t() {}
    return t.prototype.getEncodingMode = function() {
        return Pn
    }
    ,
    t.prototype.encode = function(e) {
        for (var n = new Ke; e.hasMoreCharacters(); ) {
            var r = e.getCurrentChar();
            this.encodeChar(r, n),
            e.pos++;
            var i = n.length();
            if (i >= 4) {
                e.writeCodewords(this.encodeToCodewords(n.toString()));
                var o = n.toString().substring(4);
                n.setLengthToZero(),
                n.append(o);
                var s = Ri.lookAheadTest(e.getMessage(), e.pos, this.getEncodingMode());
                if (s !== this.getEncodingMode()) {
                    e.signalEncoderChange(xt);
                    break
                }
            }
        }
        n.append(nt.getCharAt(31)),
        this.handleEOD(e, n)
    }
    ,
    t.prototype.handleEOD = function(e, n) {
        try {
            var r = n.length();
            if (r === 0)
                return;
            if (r === 1) {
                e.updateSymbolInfo();
                var i = e.getSymbolInfo().getDataCapacity() - e.getCodewordCount()
                  , o = e.getRemainingCharacters();
                if (o > i && (e.updateSymbolInfo(e.getCodewordCount() + 1),
                i = e.getSymbolInfo().getDataCapacity() - e.getCodewordCount()),
                o <= i && i <= 2)
                    return
            }
            if (r > 4)
                throw new Error("Count must not exceed 4");
            var s = r - 1
              , a = this.encodeToCodewords(n.toString())
              , l = !e.hasMoreCharacters()
              , c = l && s <= 2;
            if (s <= 2) {
                e.updateSymbolInfo(e.getCodewordCount() + s);
                var i = e.getSymbolInfo().getDataCapacity() - e.getCodewordCount();
                i >= 3 && (c = !1,
                e.updateSymbolInfo(e.getCodewordCount() + a.length))
            }
            c ? (e.resetSymbolInfo(),
            e.pos -= s) : e.writeCodewords(a)
        } finally {
            e.signalEncoderChange(xt)
        }
    }
    ,
    t.prototype.encodeChar = function(e, n) {
        e >= " ".charCodeAt(0) && e <= "?".charCodeAt(0) ? n.append(e) : e >= "@".charCodeAt(0) && e <= "^".charCodeAt(0) ? n.append(nt.getCharAt(e - 64)) : Ri.illegalCharacter(nt.getCharAt(e))
    }
    ,
    t.prototype.encodeToCodewords = function(e) {
        var n = e.length;
        if (n === 0)
            throw new Error("StringBuilder must not be empty");
        var r = e.charAt(0).charCodeAt(0)
          , i = n >= 2 ? e.charAt(1).charCodeAt(0) : 0
          , o = n >= 3 ? e.charAt(2).charCodeAt(0) : 0
          , s = n >= 4 ? e.charAt(3).charCodeAt(0) : 0
          , a = (r << 18) + (i << 12) + (o << 6) + s
          , l = a >> 16 & 255
          , c = a >> 8 & 255
          , u = a & 255
          , f = new Ke;
        return f.append(l),
        n >= 2 && f.append(c),
        n >= 3 && f.append(u),
        f.toString()
    }
    ,
    t
}()
  , sEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , aEe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , ht = function() {
    function t(e, n, r, i, o, s, a, l) {
        a === void 0 && (a = 0),
        l === void 0 && (l = 0),
        this.rectangular = e,
        this.dataCapacity = n,
        this.errorCodewords = r,
        this.matrixWidth = i,
        this.matrixHeight = o,
        this.dataRegions = s,
        this.rsBlockData = a,
        this.rsBlockError = l
    }
    return t.lookup = function(e, n, r, i, o) {
        var s, a;
        n === void 0 && (n = 0),
        r === void 0 && (r = null),
        i === void 0 && (i = null),
        o === void 0 && (o = !0);
        try {
            for (var l = aEe(cEe), c = l.next(); !c.done; c = l.next()) {
                var u = c.value;
                if (!(n === 1 && u.rectangular) && !(n === 2 && !u.rectangular) && !(r != null && (u.getSymbolWidth() < r.getWidth() || u.getSymbolHeight() < r.getHeight())) && !(i != null && (u.getSymbolWidth() > i.getWidth() || u.getSymbolHeight() > i.getHeight())) && e <= u.dataCapacity)
                    return u
            }
        } catch (f) {
            s = {
                error: f
            }
        } finally {
            try {
                c && !c.done && (a = l.return) && a.call(l)
            } finally {
                if (s)
                    throw s.error
            }
        }
        if (o)
            throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: " + e);
        return null
    }
    ,
    t.prototype.getHorizontalDataRegions = function() {
        switch (this.dataRegions) {
        case 1:
            return 1;
        case 2:
        case 4:
            return 2;
        case 16:
            return 4;
        case 36:
            return 6;
        default:
            throw new Error("Cannot handle this number of data regions")
        }
    }
    ,
    t.prototype.getVerticalDataRegions = function() {
        switch (this.dataRegions) {
        case 1:
        case 2:
            return 1;
        case 4:
            return 2;
        case 16:
            return 4;
        case 36:
            return 6;
        default:
            throw new Error("Cannot handle this number of data regions")
        }
    }
    ,
    t.prototype.getSymbolDataWidth = function() {
        return this.getHorizontalDataRegions() * this.matrixWidth
    }
    ,
    t.prototype.getSymbolDataHeight = function() {
        return this.getVerticalDataRegions() * this.matrixHeight
    }
    ,
    t.prototype.getSymbolWidth = function() {
        return this.getSymbolDataWidth() + this.getHorizontalDataRegions() * 2
    }
    ,
    t.prototype.getSymbolHeight = function() {
        return this.getSymbolDataHeight() + this.getVerticalDataRegions() * 2
    }
    ,
    t.prototype.getCodewordCount = function() {
        return this.dataCapacity + this.errorCodewords
    }
    ,
    t.prototype.getInterleavedBlockCount = function() {
        return this.rsBlockData ? this.dataCapacity / this.rsBlockData : 1
    }
    ,
    t.prototype.getDataCapacity = function() {
        return this.dataCapacity
    }
    ,
    t.prototype.getErrorCodewords = function() {
        return this.errorCodewords
    }
    ,
    t.prototype.getDataLengthForInterleavedBlock = function(e) {
        return this.rsBlockData
    }
    ,
    t.prototype.getErrorLengthForInterleavedBlock = function(e) {
        return this.rsBlockError
    }
    ,
    t
}()
  , lEe = function(t) {
    sEe(e, t);
    function e() {
        return t.call(this, !1, 1558, 620, 22, 22, 36, -1, 62) || this
    }
    return e.prototype.getInterleavedBlockCount = function() {
        return 10
    }
    ,
    e.prototype.getDataLengthForInterleavedBlock = function(n) {
        return n <= 8 ? 156 : 155
    }
    ,
    e
}(ht)
  , cEe = [new ht(!1,3,5,8,8,1), new ht(!1,5,7,10,10,1), new ht(!0,5,7,16,6,1), new ht(!1,8,10,12,12,1), new ht(!0,10,11,14,6,2), new ht(!1,12,12,14,14,1), new ht(!0,16,14,24,10,1), new ht(!1,18,14,16,16,1), new ht(!1,22,18,18,18,1), new ht(!0,22,18,16,10,2), new ht(!1,30,20,20,20,1), new ht(!0,32,24,16,14,2), new ht(!1,36,24,22,22,1), new ht(!1,44,28,24,24,1), new ht(!0,49,28,22,14,2), new ht(!1,62,36,14,14,4), new ht(!1,86,42,16,16,4), new ht(!1,114,48,18,18,4), new ht(!1,144,56,20,20,4), new ht(!1,174,68,22,22,4), new ht(!1,204,84,24,24,4,102,42), new ht(!1,280,112,14,14,16,140,56), new ht(!1,368,144,16,16,16,92,36), new ht(!1,456,192,18,18,16,114,48), new ht(!1,576,224,20,20,16,144,56), new ht(!1,696,272,22,22,16,174,68), new ht(!1,816,336,24,24,16,136,56), new ht(!1,1050,408,18,18,36,175,68), new ht(!1,1304,496,20,20,36,163,62), new lEe]
  , uEe = function() {
    function t(e) {
        this.msg = e,
        this.pos = 0,
        this.skipAtEnd = 0;
        for (var n = e.split("").map(function(a) {
            return a.charCodeAt(0)
        }), r = new Ke, i = 0, o = n.length; i < o; i++) {
            var s = String.fromCharCode(n[i] & 255);
            if (s === "?" && e.charAt(i) !== "?")
                throw new Error("Message contains characters outside ISO-8859-1 encoding.");
            r.append(s)
        }
        this.msg = r.toString(),
        this.shape = 0,
        this.codewords = new Ke,
        this.newEncoding = -1
    }
    return t.prototype.setSymbolShape = function(e) {
        this.shape = e
    }
    ,
    t.prototype.setSizeConstraints = function(e, n) {
        this.minSize = e,
        this.maxSize = n
    }
    ,
    t.prototype.getMessage = function() {
        return this.msg
    }
    ,
    t.prototype.setSkipAtEnd = function(e) {
        this.skipAtEnd = e
    }
    ,
    t.prototype.getCurrentChar = function() {
        return this.msg.charCodeAt(this.pos)
    }
    ,
    t.prototype.getCurrent = function() {
        return this.msg.charCodeAt(this.pos)
    }
    ,
    t.prototype.getCodewords = function() {
        return this.codewords
    }
    ,
    t.prototype.writeCodewords = function(e) {
        this.codewords.append(e)
    }
    ,
    t.prototype.writeCodeword = function(e) {
        this.codewords.append(e)
    }
    ,
    t.prototype.getCodewordCount = function() {
        return this.codewords.length()
    }
    ,
    t.prototype.getNewEncoding = function() {
        return this.newEncoding
    }
    ,
    t.prototype.signalEncoderChange = function(e) {
        this.newEncoding = e
    }
    ,
    t.prototype.resetEncoderSignal = function() {
        this.newEncoding = -1
    }
    ,
    t.prototype.hasMoreCharacters = function() {
        return this.pos < this.getTotalMessageCharCount()
    }
    ,
    t.prototype.getTotalMessageCharCount = function() {
        return this.msg.length - this.skipAtEnd
    }
    ,
    t.prototype.getRemainingCharacters = function() {
        return this.getTotalMessageCharCount() - this.pos
    }
    ,
    t.prototype.getSymbolInfo = function() {
        return this.symbolInfo
    }
    ,
    t.prototype.updateSymbolInfo = function(e) {
        e === void 0 && (e = this.getCodewordCount()),
        (this.symbolInfo == null || e > this.symbolInfo.getDataCapacity()) && (this.symbolInfo = ht.lookup(e, this.shape, this.minSize, this.maxSize, !0))
    }
    ,
    t.prototype.resetSymbolInfo = function() {
        this.symbolInfo = null
    }
    ,
    t
}()
  , fEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , dEe = function(t) {
    fEe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.prototype.getEncodingMode = function() {
        return mn
    }
    ,
    e.prototype.encode = function(n) {
        for (var r = new Ke; n.hasMoreCharacters(); ) {
            var i = n.getCurrentChar();
            n.pos++,
            this.encodeChar(i, r);
            var o = r.length();
            if (o % 3 === 0) {
                this.writeNextTriplet(n, r);
                var s = Ri.lookAheadTest(n.getMessage(), n.pos, this.getEncodingMode());
                if (s !== this.getEncodingMode()) {
                    n.signalEncoderChange(xt);
                    break
                }
            }
        }
        this.handleEOD(n, r)
    }
    ,
    e.prototype.encodeChar = function(n, r) {
        switch (n) {
        case 13:
            r.append(0);
            break;
        case "*".charCodeAt(0):
            r.append(1);
            break;
        case ">".charCodeAt(0):
            r.append(2);
            break;
        case " ".charCodeAt(0):
            r.append(3);
            break;
        default:
            n >= "0".charCodeAt(0) && n <= "9".charCodeAt(0) ? r.append(n - 48 + 4) : n >= "A".charCodeAt(0) && n <= "Z".charCodeAt(0) ? r.append(n - 65 + 14) : Ri.illegalCharacter(nt.getCharAt(n));
            break
        }
        return 1
    }
    ,
    e.prototype.handleEOD = function(n, r) {
        n.updateSymbolInfo();
        var i = n.getSymbolInfo().getDataCapacity() - n.getCodewordCount()
          , o = r.length();
        n.pos -= o,
        (n.getRemainingCharacters() > 1 || i > 1 || n.getRemainingCharacters() !== i) && n.writeCodeword(nEe),
        n.getNewEncoding() < 0 && n.signalEncoderChange(xt)
    }
    ,
    e
}(hE)
  , hEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , pEe = function(t) {
    hEe(e, t);
    function e() {
        return t !== null && t.apply(this, arguments) || this
    }
    return e.prototype.getEncodingMode = function() {
        return ar
    }
    ,
    e.prototype.encodeChar = function(n, r) {
        if (n === " ".charCodeAt(0))
            return r.append(3),
            1;
        if (n >= "0".charCodeAt(0) && n <= "9".charCodeAt(0))
            return r.append(n - 48 + 4),
            1;
        if (n >= "a".charCodeAt(0) && n <= "z".charCodeAt(0))
            return r.append(n - 97 + 14),
            1;
        if (n < " ".charCodeAt(0))
            return r.append(0),
            r.append(n),
            2;
        if (n <= "/".charCodeAt(0))
            return r.append(1),
            r.append(n - 33),
            2;
        if (n <= "@".charCodeAt(0))
            return r.append(1),
            r.append(n - 58 + 15),
            2;
        if (n >= "[".charCodeAt(0) && n <= "_".charCodeAt(0))
            return r.append(1),
            r.append(n - 91 + 22),
            2;
        if (n === "`".charCodeAt(0))
            return r.append(2),
            r.append(0),
            2;
        if (n <= "Z".charCodeAt(0))
            return r.append(2),
            r.append(n - 65 + 1),
            2;
        if (n <= 127)
            return r.append(2),
            r.append(n - 123 + 27),
            2;
        r.append("1");
        var i = 2;
        return i += this.encodeChar(n - 128, r),
        i
    }
    ,
    e
}(hE)
  , gEe = function() {
    function t() {}
    return t.randomize253State = function(e) {
        var n = 149 * e % 253 + 1
          , r = KP + n;
        return r <= 254 ? r : r - 254
    }
    ,
    t.encodeHighLevel = function(e, n, r, i, o) {
        n === void 0 && (n = 0),
        r === void 0 && (r = null),
        i === void 0 && (i = null),
        o === void 0 && (o = !1);
        var s = new hE
          , a = [new rEe, s, new pEe, new dEe, new oEe, new iEe]
          , l = new uEe(e);
        l.setSymbolShape(n),
        l.setSizeConstraints(r, i),
        e.startsWith(qP) && e.endsWith(JP) ? (l.writeCodeword(Z2e),
        l.setSkipAtEnd(2),
        l.pos += qP.length) : e.startsWith(ZP) && e.endsWith(JP) && (l.writeCodeword(J2e),
        l.setSkipAtEnd(2),
        l.pos += ZP.length);
        var c = xt;
        for (o && (s.encodeMaximal(l),
        c = l.getNewEncoding(),
        l.resetEncoderSignal()); l.hasMoreCharacters(); )
            a[c].encode(l),
            l.getNewEncoding() >= 0 && (c = l.getNewEncoding(),
            l.resetEncoderSignal());
        var u = l.getCodewordCount();
        l.updateSymbolInfo();
        var f = l.getSymbolInfo().getDataCapacity();
        u < f && c !== xt && c !== Wn && c !== Pn && l.writeCodeword("þ");
        var d = l.getCodewords();
        for (d.length() < f && d.append(KP); d.length() < f; )
            d.append(this.randomize253State(d.length() + 1));
        return l.getCodewords().toString()
    }
    ,
    t.lookAheadTest = function(e, n, r) {
        var i = this.lookAheadTestIntern(e, n, r);
        if (r === mn && i === mn) {
            for (var o = Math.min(n + 3, e.length), s = n; s < o; s++)
                if (!this.isNativeX12(e.charCodeAt(s)))
                    return xt
        } else if (r === Pn && i === Pn) {
            for (var o = Math.min(n + 4, e.length), s = n; s < o; s++)
                if (!this.isNativeEDIFACT(e.charCodeAt(s)))
                    return xt
        }
        return i
    }
    ,
    t.lookAheadTestIntern = function(e, n, r) {
        if (n >= e.length)
            return r;
        var i;
        r === xt ? i = [0, 1, 1, 1, 1, 1.25] : (i = [1, 2, 2, 2, 2, 2.25],
        i[r] = 0);
        for (var o = 0, s = new Uint8Array(6), a = []; ; ) {
            if (n + o === e.length) {
                bn.fill(s, 0),
                bn.fill(a, 0);
                var l = this.findMinimums(i, a, qe.MAX_VALUE, s)
                  , c = this.getMinimumCount(s);
                if (a[xt] === l)
                    return xt;
                if (c === 1) {
                    if (s[Wn] > 0)
                        return Wn;
                    if (s[Pn] > 0)
                        return Pn;
                    if (s[ar] > 0)
                        return ar;
                    if (s[mn] > 0)
                        return mn
                }
                return Fn
            }
            var u = e.charCodeAt(n + o);
            if (o++,
            this.isDigit(u) ? i[xt] += .5 : this.isExtendedASCII(u) ? (i[xt] = Math.ceil(i[xt]),
            i[xt] += 2) : (i[xt] = Math.ceil(i[xt]),
            i[xt]++),
            this.isNativeC40(u) ? i[Fn] += 2 / 3 : this.isExtendedASCII(u) ? i[Fn] += 8 / 3 : i[Fn] += 4 / 3,
            this.isNativeText(u) ? i[ar] += 2 / 3 : this.isExtendedASCII(u) ? i[ar] += 8 / 3 : i[ar] += 4 / 3,
            this.isNativeX12(u) ? i[mn] += 2 / 3 : this.isExtendedASCII(u) ? i[mn] += 13 / 3 : i[mn] += 10 / 3,
            this.isNativeEDIFACT(u) ? i[Pn] += 3 / 4 : this.isExtendedASCII(u) ? i[Pn] += 17 / 4 : i[Pn] += 13 / 4,
            this.isSpecialB256(u) ? i[Wn] += 4 : i[Wn]++,
            o >= 4) {
                if (bn.fill(s, 0),
                bn.fill(a, 0),
                this.findMinimums(i, a, qe.MAX_VALUE, s),
                a[xt] < this.min(a[Wn], a[Fn], a[ar], a[mn], a[Pn]))
                    return xt;
                if (a[Wn] < a[xt] || a[Wn] + 1 < this.min(a[Fn], a[ar], a[mn], a[Pn]))
                    return Wn;
                if (a[Pn] + 1 < this.min(a[Wn], a[Fn], a[ar], a[mn], a[xt]))
                    return Pn;
                if (a[ar] + 1 < this.min(a[Wn], a[Fn], a[Pn], a[mn], a[xt]))
                    return ar;
                if (a[mn] + 1 < this.min(a[Wn], a[Fn], a[Pn], a[ar], a[xt]))
                    return mn;
                if (a[Fn] + 1 < this.min(a[xt], a[Wn], a[Pn], a[ar])) {
                    if (a[Fn] < a[mn])
                        return Fn;
                    if (a[Fn] === a[mn]) {
                        for (var f = n + o + 1; f < e.length; ) {
                            var d = e.charCodeAt(f);
                            if (this.isX12TermSep(d))
                                return mn;
                            if (!this.isNativeX12(d))
                                break;
                            f++
                        }
                        return Fn
                    }
                }
            }
        }
    }
    ,
    t.min = function(e, n, r, i, o) {
        var s = Math.min(e, Math.min(n, Math.min(r, i)));
        return o === void 0 ? s : Math.min(s, o)
    }
    ,
    t.findMinimums = function(e, n, r, i) {
        for (var o = 0; o < 6; o++) {
            var s = n[o] = Math.ceil(e[o]);
            r > s && (r = s,
            bn.fill(i, 0)),
            r === s && (i[o] = i[o] + 1)
        }
        return r
    }
    ,
    t.getMinimumCount = function(e) {
        for (var n = 0, r = 0; r < 6; r++)
            n += e[r];
        return n || 0
    }
    ,
    t.isDigit = function(e) {
        return e >= "0".charCodeAt(0) && e <= "9".charCodeAt(0)
    }
    ,
    t.isExtendedASCII = function(e) {
        return e >= 128 && e <= 255
    }
    ,
    t.isNativeC40 = function(e) {
        return e === " ".charCodeAt(0) || e >= "0".charCodeAt(0) && e <= "9".charCodeAt(0) || e >= "A".charCodeAt(0) && e <= "Z".charCodeAt(0)
    }
    ,
    t.isNativeText = function(e) {
        return e === " ".charCodeAt(0) || e >= "0".charCodeAt(0) && e <= "9".charCodeAt(0) || e >= "a".charCodeAt(0) && e <= "z".charCodeAt(0)
    }
    ,
    t.isNativeX12 = function(e) {
        return this.isX12TermSep(e) || e === " ".charCodeAt(0) || e >= "0".charCodeAt(0) && e <= "9".charCodeAt(0) || e >= "A".charCodeAt(0) && e <= "Z".charCodeAt(0)
    }
    ,
    t.isX12TermSep = function(e) {
        return e === 13 || e === "*".charCodeAt(0) || e === ">".charCodeAt(0)
    }
    ,
    t.isNativeEDIFACT = function(e) {
        return e >= " ".charCodeAt(0) && e <= "^".charCodeAt(0)
    }
    ,
    t.isSpecialB256 = function(e) {
        return !1
    }
    ,
    t.determineConsecutiveDigitCount = function(e, n) {
        n === void 0 && (n = 0);
        for (var r = e.length, i = n; i < r && this.isDigit(e.charCodeAt(i)); )
            i++;
        return i - n
    }
    ,
    t.illegalCharacter = function(e) {
        var n = qe.toHexString(e.charCodeAt(0));
        throw n = "0000".substring(0, 4 - n.length) + n,
        new Error("Illegal character: " + e + " (0x" + n + ")")
    }
    ,
    t
}();
const Ri = gEe;
var Mv = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , QP = function() {
    function t(e) {
        this.charset = e,
        this.name = e.name
    }
    return t.prototype.canEncode = function(e) {
        try {
            return mi.encode(e, this.charset) != null
        } catch {
            return !1
        }
    }
    ,
    t
}()
  , mEe = function() {
    function t(e, n, r) {
        var i, o, s, a, l, c;
        this.ENCODERS = ["IBM437", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-10", "ISO-8859-11", "ISO-8859-13", "ISO-8859-14", "ISO-8859-15", "ISO-8859-16", "windows-1250", "windows-1251", "windows-1252", "windows-1256", "Shift_JIS"].map(function(P) {
            return new QP(j2e.forName(P))
        }),
        this.encoders = [];
        var u = [];
        u.push(new QP(W2e.ISO_8859_1));
        for (var f = n != null && n.name.startsWith("UTF"), d = 0; d < e.length; d++) {
            var h = !1;
            try {
                for (var p = (i = void 0,
                Mv(u)), y = p.next(); !y.done; y = p.next()) {
                    var v = y.value
                      , g = e.charAt(d)
                      , m = g.charCodeAt(0);
                    if (m === r || v.canEncode(g)) {
                        h = !0;
                        break
                    }
                }
            } catch (P) {
                i = {
                    error: P
                }
            } finally {
                try {
                    y && !y.done && (o = p.return) && o.call(p)
                } finally {
                    if (i)
                        throw i.error
                }
            }
            if (!h)
                try {
                    for (var _ = (s = void 0,
                    Mv(this.ENCODERS)), x = _.next(); !x.done; x = _.next()) {
                        var v = x.value;
                        if (v.canEncode(e.charAt(d))) {
                            u.push(v),
                            h = !0;
                            break
                        }
                    }
                } catch (P) {
                    s = {
                        error: P
                    }
                } finally {
                    try {
                        x && !x.done && (a = _.return) && a.call(_)
                    } finally {
                        if (s)
                            throw s.error
                    }
                }
            h || (f = !0)
        }
        if (u.length === 1 && !f)
            this.encoders = [u[0]];
        else {
            this.encoders = [];
            var b = 0;
            try {
                for (var w = Mv(u), E = w.next(); !E.done; E = w.next()) {
                    var v = E.value;
                    this.encoders[b++] = v
                }
            } catch (P) {
                l = {
                    error: P
                }
            } finally {
                try {
                    E && !E.done && (c = w.return) && c.call(w)
                } finally {
                    if (l)
                        throw l.error
                }
            }
        }
        var S = -1;
        if (n != null) {
            for (var d = 0; d < this.encoders.length; d++)
                if (this.encoders[d] != null && n.name === this.encoders[d].name) {
                    S = d;
                    break
                }
        }
        this.priorityEncoderIndex = S
    }
    return t.prototype.length = function() {
        return this.encoders.length
    }
    ,
    t.prototype.getCharsetName = function(e) {
        if (!(e < this.length()))
            throw new Error("index must be less than length");
        return this.encoders[e].name
    }
    ,
    t.prototype.getCharset = function(e) {
        if (!(e < this.length()))
            throw new Error("index must be less than length");
        return this.encoders[e].charset
    }
    ,
    t.prototype.getECIValue = function(e) {
        return this.encoders[e].charset.getValueIdentifier()
    }
    ,
    t.prototype.getPriorityEncoderIndex = function() {
        return this.priorityEncoderIndex
    }
    ,
    t.prototype.canEncode = function(e, n) {
        if (!(n < this.length()))
            throw new Error("index must be less than length");
        return !0
    }
    ,
    t.prototype.encode = function(e, n) {
        if (!(n < this.length()))
            throw new Error("index must be less than length");
        return mi.encode(nt.getCharAt(e), this.encoders[n].name)
    }
    ,
    t
}()
  , vEe = 3
  , yEe = function() {
    function t(e, n, r) {
        this.fnc1 = r;
        var i = new mEe(e,n,r);
        if (i.length() === 1)
            for (var o = 0; o < this.bytes.length; o++) {
                var s = e.charAt(o).charCodeAt(0);
                this.bytes[o] = s === r ? 1e3 : s
            }
        else
            this.bytes = this.encodeMinimally(e, i, r)
    }
    return t.prototype.getFNC1Character = function() {
        return this.fnc1
    }
    ,
    t.prototype.length = function() {
        return this.bytes.length
    }
    ,
    t.prototype.haveNCharacters = function(e, n) {
        if (e + n - 1 >= this.bytes.length)
            return !1;
        for (var r = 0; r < n; r++)
            if (this.isECI(e + r))
                return !1;
        return !0
    }
    ,
    t.prototype.charAt = function(e) {
        if (e < 0 || e >= this.length())
            throw new Error("" + e);
        if (this.isECI(e))
            throw new Error("value at " + e + " is not a character but an ECI");
        return this.isFNC1(e) ? this.fnc1 : this.bytes[e]
    }
    ,
    t.prototype.subSequence = function(e, n) {
        if (e < 0 || e > n || n > this.length())
            throw new Error("" + e);
        for (var r = new Ke, i = e; i < n; i++) {
            if (this.isECI(i))
                throw new Error("value at " + i + " is not a character but an ECI");
            r.append(this.charAt(i))
        }
        return r.toString()
    }
    ,
    t.prototype.isECI = function(e) {
        if (e < 0 || e >= this.length())
            throw new Error("" + e);
        return this.bytes[e] > 255 && this.bytes[e] <= 999
    }
    ,
    t.prototype.isFNC1 = function(e) {
        if (e < 0 || e >= this.length())
            throw new Error("" + e);
        return this.bytes[e] === 1e3
    }
    ,
    t.prototype.getECIValue = function(e) {
        if (e < 0 || e >= this.length())
            throw new Error("" + e);
        if (!this.isECI(e))
            throw new Error("value at " + e + " is not an ECI but a character");
        return this.bytes[e] - 256
    }
    ,
    t.prototype.addEdge = function(e, n, r) {
        (e[n][r.encoderIndex] == null || e[n][r.encoderIndex].cachedTotalSize > r.cachedTotalSize) && (e[n][r.encoderIndex] = r)
    }
    ,
    t.prototype.addEdges = function(e, n, r, i, o, s) {
        var a = e.charAt(i).charCodeAt(0)
          , l = 0
          , c = n.length();
        n.getPriorityEncoderIndex() >= 0 && (a === s || n.canEncode(a, n.getPriorityEncoderIndex())) && (l = n.getPriorityEncoderIndex(),
        c = l + 1);
        for (var u = l; u < c; u++)
            (a === s || n.canEncode(a, u)) && this.addEdge(r, i + 1, new eI(a,n,u,o,s))
    }
    ,
    t.prototype.encodeMinimally = function(e, n, r) {
        var i = e.length
          , o = new eI[i + 1][n.length()];
        this.addEdges(e, n, o, 0, null, r);
        for (var s = 1; s <= i; s++) {
            for (var a = 0; a < n.length(); a++)
                o[s][a] != null && s < i && this.addEdges(e, n, o, s, o[s][a], r);
            for (var a = 0; a < n.length(); a++)
                o[s - 1][a] = null
        }
        for (var l = -1, c = qe.MAX_VALUE, a = 0; a < n.length(); a++)
            if (o[i][a] != null) {
                var u = o[i][a];
                u.cachedTotalSize < c && (c = u.cachedTotalSize,
                l = a)
            }
        if (l < 0)
            throw new Error('Failed to encode "' + e + '"');
        for (var f = [], d = o[i][l]; d != null; ) {
            if (d.isFNC1())
                f.unshift(1e3);
            else
                for (var h = n.encode(d.c, d.encoderIndex), s = h.length - 1; s >= 0; s--)
                    f.unshift(h[s] & 255);
            var p = d.previous === null ? 0 : d.previous.encoderIndex;
            p !== d.encoderIndex && f.unshift(256 + n.getECIValue(d.encoderIndex)),
            d = d.previous
        }
        for (var y = [], s = 0; s < y.length; s++)
            y[s] = f[s];
        return y
    }
    ,
    t
}()
  , eI = function() {
    function t(e, n, r, i, o) {
        this.c = e,
        this.encoderSet = n,
        this.encoderIndex = r,
        this.previous = i,
        this.fnc1 = o,
        this.c = e === o ? 1e3 : e;
        var s = this.isFNC1() ? 1 : n.encode(e, r).length
          , a = i === null ? 0 : i.encoderIndex;
        a !== r && (s += vEe),
        i != null && (s += i.cachedTotalSize),
        this.cachedTotalSize = s
    }
    return t.prototype.isFNC1 = function() {
        return this.c === 1e3
    }
    ,
    t
}()
  , _Ee = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
globalThis && globalThis.__values;
var xEe = globalThis && globalThis.__read || function(t, e) {
    var n = typeof Symbol == "function" && t[Symbol.iterator];
    if (!n)
        return t;
    var r = n.call(t), i, o = [], s;
    try {
        for (; (e === void 0 || e-- > 0) && !(i = r.next()).done; )
            o.push(i.value)
    } catch (a) {
        s = {
            error: a
        }
    } finally {
        try {
            i && !i.done && (n = r.return) && n.call(r)
        } finally {
            if (s)
                throw s.error
        }
    }
    return o
}
;
globalThis && globalThis.__spread;
var tI;
(function(t) {
    t[t.ASCII = 0] = "ASCII",
    t[t.C40 = 1] = "C40",
    t[t.TEXT = 2] = "TEXT",
    t[t.X12 = 3] = "X12",
    t[t.EDF = 4] = "EDF",
    t[t.B256 = 5] = "B256"
}
)(tI || (tI = {}));
(function(t) {
    _Ee(e, t);
    function e(n, r, i, o, s) {
        var a = t.call(this, n, r, i) || this;
        return a.shape = o,
        a.macroId = s,
        a
    }
    return e.prototype.getMacroId = function() {
        return this.macroId
    }
    ,
    e.prototype.getShapeHint = function() {
        return this.shape
    }
    ,
    e
}
)(yEe);
var bEe = function() {
    function t() {}
    return t.prototype.isCompact = function() {
        return this.compact
    }
    ,
    t.prototype.setCompact = function(e) {
        this.compact = e
    }
    ,
    t.prototype.getSize = function() {
        return this.size
    }
    ,
    t.prototype.setSize = function(e) {
        this.size = e
    }
    ,
    t.prototype.getLayers = function() {
        return this.layers
    }
    ,
    t.prototype.setLayers = function(e) {
        this.layers = e
    }
    ,
    t.prototype.getCodeWords = function() {
        return this.codeWords
    }
    ,
    t.prototype.setCodeWords = function(e) {
        this.codeWords = e
    }
    ,
    t.prototype.getMatrix = function() {
        return this.matrix
    }
    ,
    t.prototype.setMatrix = function(e) {
        this.matrix = e
    }
    ,
    t
}()
  , nI = function() {
    function t() {}
    return t.singletonList = function(e) {
        return [e]
    }
    ,
    t.min = function(e, n) {
        return e.sort(n)[0]
    }
    ,
    t
}()
  , wEe = function() {
    function t(e) {
        this.previous = e
    }
    return t.prototype.getPrevious = function() {
        return this.previous
    }
    ,
    t
}()
  , EEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , pE = function(t) {
    EEe(e, t);
    function e(n, r, i) {
        var o = t.call(this, n) || this;
        return o.value = r,
        o.bitCount = i,
        o
    }
    return e.prototype.appendTo = function(n, r) {
        n.appendBits(this.value, this.bitCount)
    }
    ,
    e.prototype.add = function(n, r) {
        return new e(this,n,r)
    }
    ,
    e.prototype.addBinaryShift = function(n, r) {
        return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),
        new e(this,n,r)
    }
    ,
    e.prototype.toString = function() {
        var n = this.value & (1 << this.bitCount) - 1;
        return n |= 1 << this.bitCount,
        "<" + qe.toBinaryString(n | 1 << this.bitCount).substring(1) + ">"
    }
    ,
    e
}(wEe)
  , SEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                i.hasOwnProperty(o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , CEe = function(t) {
    SEe(e, t);
    function e(n, r, i) {
        var o = t.call(this, n, 0, 0) || this;
        return o.binaryShiftStart = r,
        o.binaryShiftByteCount = i,
        o
    }
    return e.prototype.appendTo = function(n, r) {
        for (var i = 0; i < this.binaryShiftByteCount; i++)
            (i === 0 || i === 31 && this.binaryShiftByteCount <= 62) && (n.appendBits(31, 5),
            this.binaryShiftByteCount > 62 ? n.appendBits(this.binaryShiftByteCount - 31, 16) : i === 0 ? n.appendBits(Math.min(this.binaryShiftByteCount, 31), 5) : n.appendBits(this.binaryShiftByteCount - 31, 5)),
            n.appendBits(r[this.binaryShiftStart + i], 8)
    }
    ,
    e.prototype.addBinaryShift = function(n, r) {
        return new e(this,n,r)
    }
    ,
    e.prototype.toString = function() {
        return "<" + this.binaryShiftStart + "::" + (this.binaryShiftStart + this.binaryShiftByteCount - 1) + ">"
    }
    ,
    e
}(pE);
function AEe(t, e, n) {
    return new CEe(t,e,n)
}
function qu(t, e, n) {
    return new pE(t,e,n)
}
var TEe = ["UPPER", "LOWER", "DIGIT", "MIXED", "PUNCT"]
  , qs = 0
  , z0 = 1
  , fi = 2
  , V9 = 3
  , oo = 4
  , PEe = new pE(null,0,0)
  , Dv = [Int32Array.from([0, (5 << 16) + 28, (5 << 16) + 30, (5 << 16) + 29, 655360 + 928 + 30]), Int32Array.from([(9 << 16) + 480 + 14, 0, (5 << 16) + 30, (5 << 16) + 29, 655360 + 928 + 30]), Int32Array.from([(4 << 16) + 14, (9 << 16) + 448 + 28, 0, (9 << 16) + 448 + 29, 917504 + 14336 + 928 + 30]), Int32Array.from([(5 << 16) + 29, (5 << 16) + 28, 655360 + 928 + 30, 0, (5 << 16) + 30]), Int32Array.from([(5 << 16) + 31, 655360 + 992 + 28, 655360 + 992 + 30, 655360 + 992 + 29, 0])]
  , IEe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
;
function OEe(t) {
    var e, n;
    try {
        for (var r = IEe(t), i = r.next(); !i.done; i = r.next()) {
            var o = i.value;
            bn.fill(o, -1)
        }
    } catch (s) {
        e = {
            error: s
        }
    } finally {
        try {
            i && !i.done && (n = r.return) && n.call(r)
        } finally {
            if (e)
                throw e.error
        }
    }
    return t[qs][oo] = 0,
    t[z0][oo] = 0,
    t[z0][qs] = 28,
    t[V9][oo] = 0,
    t[fi][oo] = 0,
    t[fi][qs] = 15,
    t
}
var z9 = OEe(bn.createInt32Array(6, 6))
  , REe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , MEe = function() {
    function t(e, n, r, i) {
        this.token = e,
        this.mode = n,
        this.binaryShiftByteCount = r,
        this.bitCount = i
    }
    return t.prototype.getMode = function() {
        return this.mode
    }
    ,
    t.prototype.getToken = function() {
        return this.token
    }
    ,
    t.prototype.getBinaryShiftByteCount = function() {
        return this.binaryShiftByteCount
    }
    ,
    t.prototype.getBitCount = function() {
        return this.bitCount
    }
    ,
    t.prototype.latchAndAppend = function(e, n) {
        var r = this.bitCount
          , i = this.token;
        if (e !== this.mode) {
            var o = Dv[this.mode][e];
            i = qu(i, o & 65535, o >> 16),
            r += o >> 16
        }
        var s = e === fi ? 4 : 5;
        return i = qu(i, n, s),
        new t(i,e,0,r + s)
    }
    ,
    t.prototype.shiftAndAppend = function(e, n) {
        var r = this.token
          , i = this.mode === fi ? 4 : 5;
        return r = qu(r, z9[this.mode][e], i),
        r = qu(r, n, 5),
        new t(r,this.mode,0,this.bitCount + i + 5)
    }
    ,
    t.prototype.addBinaryShiftChar = function(e) {
        var n = this.token
          , r = this.mode
          , i = this.bitCount;
        if (this.mode === oo || this.mode === fi) {
            var o = Dv[r][qs];
            n = qu(n, o & 65535, o >> 16),
            i += o >> 16,
            r = qs
        }
        var s = this.binaryShiftByteCount === 0 || this.binaryShiftByteCount === 31 ? 18 : this.binaryShiftByteCount === 62 ? 9 : 8
          , a = new t(n,r,this.binaryShiftByteCount + 1,i + s);
        return a.binaryShiftByteCount === 2047 + 31 && (a = a.endBinaryShift(e + 1)),
        a
    }
    ,
    t.prototype.endBinaryShift = function(e) {
        if (this.binaryShiftByteCount === 0)
            return this;
        var n = this.token;
        return n = AEe(n, e - this.binaryShiftByteCount, this.binaryShiftByteCount),
        new t(n,this.mode,0,this.bitCount)
    }
    ,
    t.prototype.isBetterThanOrEqualTo = function(e) {
        var n = this.bitCount + (Dv[this.mode][e.mode] >> 16);
        return this.binaryShiftByteCount < e.binaryShiftByteCount ? n += t.calculateBinaryShiftCost(e) - t.calculateBinaryShiftCost(this) : this.binaryShiftByteCount > e.binaryShiftByteCount && e.binaryShiftByteCount > 0 && (n += 10),
        n <= e.bitCount
    }
    ,
    t.prototype.toBitArray = function(e) {
        for (var n, r, i = [], o = this.endBinaryShift(e.length).token; o !== null; o = o.getPrevious())
            i.unshift(o);
        var s = new Dn;
        try {
            for (var a = REe(i), l = a.next(); !l.done; l = a.next()) {
                var c = l.value;
                c.appendTo(s, e)
            }
        } catch (u) {
            n = {
                error: u
            }
        } finally {
            try {
                l && !l.done && (r = a.return) && r.call(a)
            } finally {
                if (n)
                    throw n.error
            }
        }
        return s
    }
    ,
    t.prototype.toString = function() {
        return nt.format("%s bits=%d bytes=%d", TEe[this.mode], this.bitCount, this.binaryShiftByteCount)
    }
    ,
    t.calculateBinaryShiftCost = function(e) {
        return e.binaryShiftByteCount > 62 ? 21 : e.binaryShiftByteCount > 31 ? 20 : e.binaryShiftByteCount > 0 ? 10 : 0
    }
    ,
    t.INITIAL_STATE = new t(PEe,qs,0,0),
    t
}();
function DEe(t) {
    var e = nt.getCharCode(" ")
      , n = nt.getCharCode(".")
      , r = nt.getCharCode(",");
    t[qs][e] = 1;
    for (var i = nt.getCharCode("Z"), o = nt.getCharCode("A"), s = o; s <= i; s++)
        t[qs][s] = s - o + 2;
    t[z0][e] = 1;
    for (var a = nt.getCharCode("z"), l = nt.getCharCode("a"), s = l; s <= a; s++)
        t[z0][s] = s - l + 2;
    t[fi][e] = 1;
    for (var c = nt.getCharCode("9"), u = nt.getCharCode("0"), s = u; s <= c; s++)
        t[fi][s] = s - u + 2;
    t[fi][r] = 12,
    t[fi][n] = 13;
    for (var f = ["\0", " ", "", "", "", "", "", "", "\x07", "\b", "	", `
`, "\v", "\f", "\r", "\x1B", "", "", "", "", "@", "\\", "^", "_", "`", "|", "~", ""], d = 0; d < f.length; d++)
        t[V9][nt.getCharCode(f[d])] = d;
    for (var h = ["\0", "\r", "\0", "\0", "\0", "\0", "!", "'", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", ":", ";", "<", "=", ">", "?", "[", "]", "{", "}"], d = 0; d < h.length; d++)
        nt.getCharCode(h[d]) > 0 && (t[oo][nt.getCharCode(h[d])] = d);
    return t
}
var Bv = DEe(bn.createInt32Array(5, 256))
  , xp = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , BEe = function() {
    function t(e) {
        this.text = e
    }
    return t.prototype.encode = function() {
        for (var e = nt.getCharCode(" "), n = nt.getCharCode(`
`), r = nI.singletonList(MEe.INITIAL_STATE), i = 0; i < this.text.length; i++) {
            var o = void 0
              , s = i + 1 < this.text.length ? this.text[i + 1] : 0;
            switch (this.text[i]) {
            case nt.getCharCode("\r"):
                o = s === n ? 2 : 0;
                break;
            case nt.getCharCode("."):
                o = s === e ? 3 : 0;
                break;
            case nt.getCharCode(","):
                o = s === e ? 4 : 0;
                break;
            case nt.getCharCode(":"):
                o = s === e ? 5 : 0;
                break;
            default:
                o = 0
            }
            o > 0 ? (r = t.updateStateListForPair(r, i, o),
            i++) : r = this.updateStateListForChar(r, i)
        }
        var a = nI.min(r, function(l, c) {
            return l.getBitCount() - c.getBitCount()
        });
        return a.toBitArray(this.text)
    }
    ,
    t.prototype.updateStateListForChar = function(e, n) {
        var r, i, o = [];
        try {
            for (var s = xp(e), a = s.next(); !a.done; a = s.next()) {
                var l = a.value;
                this.updateStateForChar(l, n, o)
            }
        } catch (c) {
            r = {
                error: c
            }
        } finally {
            try {
                a && !a.done && (i = s.return) && i.call(s)
            } finally {
                if (r)
                    throw r.error
            }
        }
        return t.simplifyStates(o)
    }
    ,
    t.prototype.updateStateForChar = function(e, n, r) {
        for (var i = this.text[n] & 255, o = Bv[e.getMode()][i] > 0, s = null, a = 0; a <= oo; a++) {
            var l = Bv[a][i];
            if (l > 0) {
                if (s == null && (s = e.endBinaryShift(n)),
                !o || a === e.getMode() || a === fi) {
                    var c = s.latchAndAppend(a, l);
                    r.push(c)
                }
                if (!o && z9[e.getMode()][a] >= 0) {
                    var u = s.shiftAndAppend(a, l);
                    r.push(u)
                }
            }
        }
        if (e.getBinaryShiftByteCount() > 0 || Bv[e.getMode()][i] === 0) {
            var f = e.addBinaryShiftChar(n);
            r.push(f)
        }
    }
    ,
    t.updateStateListForPair = function(e, n, r) {
        var i, o, s = [];
        try {
            for (var a = xp(e), l = a.next(); !l.done; l = a.next()) {
                var c = l.value;
                this.updateStateForPair(c, n, r, s)
            }
        } catch (u) {
            i = {
                error: u
            }
        } finally {
            try {
                l && !l.done && (o = a.return) && o.call(a)
            } finally {
                if (i)
                    throw i.error
            }
        }
        return this.simplifyStates(s)
    }
    ,
    t.updateStateForPair = function(e, n, r, i) {
        var o = e.endBinaryShift(n);
        if (i.push(o.latchAndAppend(oo, r)),
        e.getMode() !== oo && i.push(o.shiftAndAppend(oo, r)),
        r === 3 || r === 4) {
            var s = o.latchAndAppend(fi, 16 - r).latchAndAppend(fi, 1);
            i.push(s)
        }
        if (e.getBinaryShiftByteCount() > 0) {
            var a = e.addBinaryShiftChar(n).addBinaryShiftChar(n + 1);
            i.push(a)
        }
    }
    ,
    t.simplifyStates = function(e) {
        var n, r, i, o, s = [];
        try {
            for (var a = xp(e), l = a.next(); !l.done; l = a.next()) {
                var c = l.value
                  , u = !0
                  , f = function(v) {
                    if (v.isBetterThanOrEqualTo(c))
                        return u = !1,
                        "break";
                    c.isBetterThanOrEqualTo(v) && (s = s.filter(function(g) {
                        return g !== v
                    }))
                };
                try {
                    for (var d = (i = void 0,
                    xp(s)), h = d.next(); !h.done; h = d.next()) {
                        var p = h.value
                          , y = f(p);
                        if (y === "break")
                            break
                    }
                } catch (v) {
                    i = {
                        error: v
                    }
                } finally {
                    try {
                        h && !h.done && (o = d.return) && o.call(d)
                    } finally {
                        if (i)
                            throw i.error
                    }
                }
                u && s.push(c)
            }
        } catch (v) {
            n = {
                error: v
            }
        } finally {
            try {
                l && !l.done && (r = a.return) && r.call(a)
            } finally {
                if (n)
                    throw n.error
            }
        }
        return s
    }
    ,
    t
}()
  , kEe = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
;
(function() {
    function t() {}
    return t.encodeBytes = function(e) {
        return t.encode(e, t.DEFAULT_EC_PERCENT, t.DEFAULT_AZTEC_LAYERS)
    }
    ,
    t.encode = function(e, n, r) {
        var i = new BEe(e).encode(), o = qe.truncDivision(i.getSize() * n, 100) + 11, s = i.getSize() + o, a, l, c, u, f;
        if (r !== t.DEFAULT_AZTEC_LAYERS) {
            if (a = r < 0,
            l = Math.abs(r),
            l > (a ? t.MAX_NB_BITS_COMPACT : t.MAX_NB_BITS))
                throw new ke(nt.format("Illegal value %s for layers", r));
            c = t.totalBitsInLayer(l, a),
            u = t.WORD_SIZE[l];
            var d = c - c % u;
            if (f = t.stuffBits(i, u),
            f.getSize() + o > d)
                throw new ke("Data to large for user specified layer");
            if (a && f.getSize() > u * 64)
                throw new ke("Data to large for user specified layer")
        } else {
            u = 0,
            f = null;
            for (var h = 0; ; h++) {
                if (h > t.MAX_NB_BITS)
                    throw new ke("Data too large for an Aztec code");
                if (a = h <= 3,
                l = a ? h + 1 : h,
                c = t.totalBitsInLayer(l, a),
                !(s > c)) {
                    (f == null || u !== t.WORD_SIZE[l]) && (u = t.WORD_SIZE[l],
                    f = t.stuffBits(i, u));
                    var d = c - c % u;
                    if (!(a && f.getSize() > u * 64) && f.getSize() + o <= d)
                        break
                }
            }
        }
        var p = t.generateCheckWords(f, c, u), y = f.getSize() / u, v = t.generateModeMessage(a, l, y), g = (a ? 11 : 14) + l * 4, m = new Int32Array(g), _;
        if (a) {
            _ = g;
            for (var h = 0; h < m.length; h++)
                m[h] = h
        } else {
            _ = g + 1 + 2 * qe.truncDivision(qe.truncDivision(g, 2) - 1, 15);
            for (var x = qe.truncDivision(g, 2), b = qe.truncDivision(_, 2), h = 0; h < x; h++) {
                var w = h + qe.truncDivision(h, 15);
                m[x - h - 1] = b - w - 1,
                m[x + h] = b + w + 1
            }
        }
        for (var E = new xo(_), h = 0, S = 0; h < l; h++) {
            for (var P = (l - h) * 4 + (a ? 9 : 12), C = 0; C < P; C++)
                for (var A = C * 2, T = 0; T < 2; T++)
                    p.get(S + A + T) && E.set(m[h * 2 + T], m[h * 2 + C]),
                    p.get(S + P * 2 + A + T) && E.set(m[h * 2 + C], m[g - 1 - h * 2 - T]),
                    p.get(S + P * 4 + A + T) && E.set(m[g - 1 - h * 2 - T], m[g - 1 - h * 2 - C]),
                    p.get(S + P * 6 + A + T) && E.set(m[g - 1 - h * 2 - C], m[h * 2 + T]);
            S += P * 8
        }
        if (t.drawModeMessage(E, a, _, v),
        a)
            t.drawBullsEye(E, qe.truncDivision(_, 2), 5);
        else {
            t.drawBullsEye(E, qe.truncDivision(_, 2), 7);
            for (var h = 0, C = 0; h < qe.truncDivision(g, 2) - 1; h += 15,
            C += 16)
                for (var T = qe.truncDivision(_, 2) & 1; T < _; T += 2)
                    E.set(qe.truncDivision(_, 2) - C, T),
                    E.set(qe.truncDivision(_, 2) + C, T),
                    E.set(T, qe.truncDivision(_, 2) - C),
                    E.set(T, qe.truncDivision(_, 2) + C)
        }
        var I = new bEe;
        return I.setCompact(a),
        I.setSize(_),
        I.setLayers(l),
        I.setCodeWords(y),
        I.setMatrix(E),
        I
    }
    ,
    t.drawBullsEye = function(e, n, r) {
        for (var i = 0; i < r; i += 2)
            for (var o = n - i; o <= n + i; o++)
                e.set(o, n - i),
                e.set(o, n + i),
                e.set(n - i, o),
                e.set(n + i, o);
        e.set(n - r, n - r),
        e.set(n - r + 1, n - r),
        e.set(n - r, n - r + 1),
        e.set(n + r, n - r),
        e.set(n + r, n - r + 1),
        e.set(n + r, n + r - 1)
    }
    ,
    t.generateModeMessage = function(e, n, r) {
        var i = new Dn;
        return e ? (i.appendBits(n - 1, 2),
        i.appendBits(r - 1, 6),
        i = t.generateCheckWords(i, 28, 4)) : (i.appendBits(n - 1, 5),
        i.appendBits(r - 1, 11),
        i = t.generateCheckWords(i, 40, 4)),
        i
    }
    ,
    t.drawModeMessage = function(e, n, r, i) {
        var o = qe.truncDivision(r, 2);
        if (n)
            for (var s = 0; s < 7; s++) {
                var a = o - 3 + s;
                i.get(s) && e.set(a, o - 5),
                i.get(s + 7) && e.set(o + 5, a),
                i.get(20 - s) && e.set(a, o + 5),
                i.get(27 - s) && e.set(o - 5, a)
            }
        else
            for (var s = 0; s < 10; s++) {
                var a = o - 5 + s + qe.truncDivision(s, 5);
                i.get(s) && e.set(a, o - 7),
                i.get(s + 10) && e.set(o + 7, a),
                i.get(29 - s) && e.set(a, o + 7),
                i.get(39 - s) && e.set(o - 7, a)
            }
    }
    ,
    t.generateCheckWords = function(e, n, r) {
        var i, o, s = e.getSize() / r, a = new G9(t.getGF(r)), l = qe.truncDivision(n, r), c = t.bitsToWords(e, r, l);
        a.encode(c, l - s);
        var u = n % r
          , f = new Dn;
        f.appendBits(0, u);
        try {
            for (var d = kEe(Array.from(c)), h = d.next(); !h.done; h = d.next()) {
                var p = h.value;
                f.appendBits(p, r)
            }
        } catch (y) {
            i = {
                error: y
            }
        } finally {
            try {
                h && !h.done && (o = d.return) && o.call(d)
            } finally {
                if (i)
                    throw i.error
            }
        }
        return f
    }
    ,
    t.bitsToWords = function(e, n, r) {
        var i = new Int32Array(r), o, s;
        for (o = 0,
        s = e.getSize() / n; o < s; o++) {
            for (var a = 0, l = 0; l < n; l++)
                a |= e.get(o * n + l) ? 1 << n - l - 1 : 0;
            i[o] = a
        }
        return i
    }
    ,
    t.getGF = function(e) {
        switch (e) {
        case 4:
            return Sr.AZTEC_PARAM;
        case 6:
            return Sr.AZTEC_DATA_6;
        case 8:
            return Sr.AZTEC_DATA_8;
        case 10:
            return Sr.AZTEC_DATA_10;
        case 12:
            return Sr.AZTEC_DATA_12;
        default:
            throw new ke("Unsupported word size " + e)
        }
    }
    ,
    t.stuffBits = function(e, n) {
        for (var r = new Dn, i = e.getSize(), o = (1 << n) - 2, s = 0; s < i; s += n) {
            for (var a = 0, l = 0; l < n; l++)
                (s + l >= i || e.get(s + l)) && (a |= 1 << n - 1 - l);
            (a & o) === o ? (r.appendBits(a & o, n),
            s--) : a & o ? r.appendBits(a, n) : (r.appendBits(a | 1, n),
            s--)
        }
        return r
    }
    ,
    t.totalBitsInLayer = function(e, n) {
        return ((n ? 88 : 112) + 16 * e) * e
    }
    ,
    t.DEFAULT_EC_PERCENT = 33,
    t.DEFAULT_AZTEC_LAYERS = 0,
    t.MAX_NB_BITS = 32,
    t.MAX_NB_BITS_COMPACT = 4,
    t.WORD_SIZE = Int32Array.from([4, 6, 6, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12]),
    t
}
)();
var NEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                Object.prototype.hasOwnProperty.call(i, o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        if (typeof n != "function" && n !== null)
            throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , FEe = function(t) {
    NEe(e, t);
    function e(n) {
        var r = t.call(this, n.width, n.height) || this;
        return r.canvas = n,
        r.tempCanvasElement = null,
        r.buffer = e.makeBufferFromCanvasImageData(n),
        r
    }
    return e.makeBufferFromCanvasImageData = function(n) {
        var r;
        try {
            r = n.getContext("2d", {
                willReadFrequently: !0
            })
        } catch {
            r = n.getContext("2d")
        }
        if (!r)
            throw new Error("Couldn't get canvas context.");
        var i = r.getImageData(0, 0, n.width, n.height);
        return e.toGrayscaleBuffer(i.data, n.width, n.height)
    }
    ,
    e.toGrayscaleBuffer = function(n, r, i) {
        for (var o = new Uint8ClampedArray(r * i), s = 0, a = 0, l = n.length; s < l; s += 4,
        a++) {
            var c = void 0
              , u = n[s + 3];
            if (u === 0)
                c = 255;
            else {
                var f = n[s]
                  , d = n[s + 1]
                  , h = n[s + 2];
                c = 306 * f + 601 * d + 117 * h + 512 >> 10
            }
            o[a] = c
        }
        return o
    }
    ,
    e.prototype.getRow = function(n, r) {
        if (n < 0 || n >= this.getHeight())
            throw new ke("Requested row is outside the image: " + n);
        var i = this.getWidth()
          , o = n * i;
        return r === null ? r = this.buffer.slice(o, o + i) : (r.length < i && (r = new Uint8ClampedArray(i)),
        r.set(this.buffer.slice(o, o + i))),
        r
    }
    ,
    e.prototype.getMatrix = function() {
        return this.buffer
    }
    ,
    e.prototype.isCropSupported = function() {
        return !0
    }
    ,
    e.prototype.crop = function(n, r, i, o) {
        return t.prototype.crop.call(this, n, r, i, o),
        this
    }
    ,
    e.prototype.isRotateSupported = function() {
        return !0
    }
    ,
    e.prototype.rotateCounterClockwise = function() {
        return this.rotate(-90),
        this
    }
    ,
    e.prototype.rotateCounterClockwise45 = function() {
        return this.rotate(-45),
        this
    }
    ,
    e.prototype.invert = function() {
        return new vm(this)
    }
    ,
    e.prototype.getTempCanvasElement = function() {
        if (this.tempCanvasElement === null) {
            var n = this.canvas.ownerDocument.createElement("canvas");
            n.width = this.canvas.width,
            n.height = this.canvas.height,
            this.tempCanvasElement = n
        }
        return this.tempCanvasElement
    }
    ,
    e.prototype.rotate = function(n) {
        var r = this.getTempCanvasElement();
        if (!r)
            throw new Error("Could not create a Canvas element.");
        var i = n * e.DEGREE_TO_RADIANS
          , o = this.canvas.width
          , s = this.canvas.height
          , a = Math.ceil(Math.abs(Math.cos(i)) * o + Math.abs(Math.sin(i)) * s)
          , l = Math.ceil(Math.abs(Math.sin(i)) * o + Math.abs(Math.cos(i)) * s);
        r.width = a,
        r.height = l;
        var c = r.getContext("2d");
        if (!c)
            throw new Error("Could not create a Canvas Context element.");
        return c.translate(a / 2, l / 2),
        c.rotate(i),
        c.drawImage(this.canvas, o / -2, s / -2),
        this.buffer = e.makeBufferFromCanvasImageData(r),
        this
    }
    ,
    e.DEGREE_TO_RADIANS = Math.PI / 180,
    e
}(uh);
function j9() {
    return typeof navigator < "u"
}
function LEe() {
    return j9() && !!navigator.mediaDevices
}
function $Ee() {
    return !!(LEe() && navigator.mediaDevices.enumerateDevices)
}
var wc = globalThis && globalThis.__assign || function() {
    return wc = Object.assign || function(t) {
        for (var e, n = 1, r = arguments.length; n < r; n++) {
            e = arguments[n];
            for (var i in e)
                Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i])
        }
        return t
    }
    ,
    wc.apply(this, arguments)
}
  , zt = globalThis && globalThis.__awaiter || function(t, e, n, r) {
    function i(o) {
        return o instanceof n ? o : new n(function(s) {
            s(o)
        }
        )
    }
    return new (n || (n = Promise))(function(o, s) {
        function a(u) {
            try {
                c(r.next(u))
            } catch (f) {
                s(f)
            }
        }
        function l(u) {
            try {
                c(r.throw(u))
            } catch (f) {
                s(f)
            }
        }
        function c(u) {
            u.done ? o(u.value) : i(u.value).then(a, l)
        }
        c((r = r.apply(t, e || [])).next())
    }
    )
}
  , jt = globalThis && globalThis.__generator || function(t, e) {
    var n = {
        label: 0,
        sent: function() {
            if (o[0] & 1)
                throw o[1];
            return o[1]
        },
        trys: [],
        ops: []
    }, r, i, o, s;
    return s = {
        next: a(0),
        throw: a(1),
        return: a(2)
    },
    typeof Symbol == "function" && (s[Symbol.iterator] = function() {
        return this
    }
    ),
    s;
    function a(c) {
        return function(u) {
            return l([c, u])
        }
    }
    function l(c) {
        if (r)
            throw new TypeError("Generator is already executing.");
        for (; n; )
            try {
                if (r = 1,
                i && (o = c[0] & 2 ? i.return : c[0] ? i.throw || ((o = i.return) && o.call(i),
                0) : i.next) && !(o = o.call(i, c[1])).done)
                    return o;
                switch (i = 0,
                o && (c = [c[0] & 2, o.value]),
                c[0]) {
                case 0:
                case 1:
                    o = c;
                    break;
                case 4:
                    return n.label++,
                    {
                        value: c[1],
                        done: !1
                    };
                case 5:
                    n.label++,
                    i = c[1],
                    c = [0];
                    continue;
                case 7:
                    c = n.ops.pop(),
                    n.trys.pop();
                    continue;
                default:
                    if (o = n.trys,
                    !(o = o.length > 0 && o[o.length - 1]) && (c[0] === 6 || c[0] === 2)) {
                        n = 0;
                        continue
                    }
                    if (c[0] === 3 && (!o || c[1] > o[0] && c[1] < o[3])) {
                        n.label = c[1];
                        break
                    }
                    if (c[0] === 6 && n.label < o[1]) {
                        n.label = o[1],
                        o = c;
                        break
                    }
                    if (o && n.label < o[2]) {
                        n.label = o[2],
                        n.ops.push(c);
                        break
                    }
                    o[2] && n.ops.pop(),
                    n.trys.pop();
                    continue
                }
                c = e.call(t, n)
            } catch (u) {
                c = [6, u],
                i = 0
            } finally {
                r = o = 0
            }
        if (c[0] & 5)
            throw c[1];
        return {
            value: c[0] ? c[1] : void 0,
            done: !0
        }
    }
}
  , kv = globalThis && globalThis.__values || function(t) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , n = e && t[e]
      , r = 0;
    if (n)
        return n.call(t);
    if (t && typeof t.length == "number")
        return {
            next: function() {
                return t && r >= t.length && (t = void 0),
                {
                    value: t && t[r++],
                    done: !t
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
  , UEe = {
    delayBetweenScanAttempts: 500,
    delayBetweenScanSuccess: 500,
    tryPlayVideoTimeout: 5e3
}
  , Su = function() {
    function t(e, n, r) {
        n === void 0 && (n = new Map),
        r === void 0 && (r = {}),
        this.reader = e,
        this.hints = n,
        this.options = wc(wc({}, UEe), r)
    }
    return Object.defineProperty(t.prototype, "possibleFormats", {
        set: function(e) {
            this.hints.set(Ot.POSSIBLE_FORMATS, e)
        },
        enumerable: !1,
        configurable: !0
    }),
    t.addVideoSource = function(e, n) {
        try {
            e.srcObject = n
        } catch {
            console.error("got interrupted by new loading request")
        }
    }
    ,
    t.mediaStreamSetTorch = function(e, n) {
        return zt(this, void 0, void 0, function() {
            return jt(this, function(r) {
                switch (r.label) {
                case 0:
                    return [4, e.applyConstraints({
                        advanced: [{
                            fillLightMode: n ? "flash" : "off",
                            torch: !!n
                        }]
                    })];
                case 1:
                    return r.sent(),
                    [2]
                }
            })
        })
    }
    ,
    t.mediaStreamIsTorchCompatible = function(e) {
        var n, r, i = e.getVideoTracks();
        try {
            for (var o = kv(i), s = o.next(); !s.done; s = o.next()) {
                var a = s.value;
                if (t.mediaStreamIsTorchCompatibleTrack(a))
                    return !0
            }
        } catch (l) {
            n = {
                error: l
            }
        } finally {
            try {
                s && !s.done && (r = o.return) && r.call(o)
            } finally {
                if (n)
                    throw n.error
            }
        }
        return !1
    }
    ,
    t.mediaStreamIsTorchCompatibleTrack = function(e) {
        try {
            var n = e.getCapabilities();
            return "torch"in n
        } catch (r) {
            return console.error(r),
            console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),
            !1
        }
    }
    ,
    t.isVideoPlaying = function(e) {
        return e.currentTime > 0 && !e.paused && e.readyState > 2
    }
    ,
    t.getMediaElement = function(e, n) {
        var r = document.getElementById(e);
        if (!r)
            throw new rn("element with id '".concat(e, "' not found"));
        if (r.nodeName.toLowerCase() !== n.toLowerCase())
            throw new rn("element with id '".concat(e, "' must be an ").concat(n, " element"));
        return r
    }
    ,
    t.createVideoElement = function(e) {
        if (e instanceof HTMLVideoElement)
            return e;
        if (typeof e == "string")
            return t.getMediaElement(e, "video");
        if (!e && typeof document < "u") {
            var n = document.createElement("video");
            return n.width = 200,
            n.height = 200,
            n
        }
        throw new Error("Couldn't get videoElement from videoSource!")
    }
    ,
    t.prepareImageElement = function(e) {
        if (e instanceof HTMLImageElement)
            return e;
        if (typeof e == "string")
            return t.getMediaElement(e, "img");
        if (typeof e > "u") {
            var n = document.createElement("img");
            return n.width = 200,
            n.height = 200,
            n
        }
        throw new Error("Couldn't get imageElement from imageSource!")
    }
    ,
    t.prepareVideoElement = function(e) {
        var n = t.createVideoElement(e);
        return n.setAttribute("autoplay", "true"),
        n.setAttribute("muted", "true"),
        n.setAttribute("playsinline", "true"),
        n
    }
    ,
    t.isImageLoaded = function(e) {
        return !(!e.complete || e.naturalWidth === 0)
    }
    ,
    t.createBinaryBitmapFromCanvas = function(e) {
        var n = new FEe(e)
          , r = new I9(n);
        return new P9(r)
    }
    ,
    t.drawImageOnCanvas = function(e, n) {
        e.drawImage(n, 0, 0)
    }
    ,
    t.getMediaElementDimensions = function(e) {
        if (e instanceof HTMLVideoElement)
            return {
                height: e.videoHeight,
                width: e.videoWidth
            };
        if (e instanceof HTMLImageElement)
            return {
                height: e.naturalHeight || e.height,
                width: e.naturalWidth || e.width
            };
        throw new Error("Couldn't find the Source's dimensions!")
    }
    ,
    t.createCaptureCanvas = function(e) {
        if (!e)
            throw new rn("Cannot create a capture canvas without a media element.");
        if (typeof document > "u")
            throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);
        var n = document.createElement("canvas")
          , r = t.getMediaElementDimensions(e)
          , i = r.width
          , o = r.height;
        return n.style.width = i + "px",
        n.style.height = o + "px",
        n.width = i,
        n.height = o,
        n
    }
    ,
    t.tryPlayVideo = function(e) {
        return zt(this, void 0, void 0, function() {
            var n;
            return jt(this, function(r) {
                switch (r.label) {
                case 0:
                    if (e != null && e.ended)
                        return console.error("Trying to play video that has ended."),
                        [2, !1];
                    if (t.isVideoPlaying(e))
                        return console.warn("Trying to play video that is already playing."),
                        [2, !0];
                    r.label = 1;
                case 1:
                    return r.trys.push([1, 3, , 4]),
                    [4, e.play()];
                case 2:
                    return r.sent(),
                    [2, !0];
                case 3:
                    return n = r.sent(),
                    console.warn("It was not possible to play the video.", n),
                    [2, !1];
                case 4:
                    return [2]
                }
            })
        })
    }
    ,
    t.createCanvasFromMediaElement = function(e) {
        var n = t.createCaptureCanvas(e)
          , r = n.getContext("2d");
        if (!r)
            throw new Error("Couldn't find Canvas 2D Context.");
        return t.drawImageOnCanvas(r, e),
        n
    }
    ,
    t.createBinaryBitmapFromMediaElem = function(e) {
        var n = t.createCanvasFromMediaElement(e);
        return t.createBinaryBitmapFromCanvas(n)
    }
    ,
    t.destroyImageElement = function(e) {
        e.src = "",
        e.removeAttribute("src"),
        e = void 0
    }
    ,
    t.listVideoInputDevices = function() {
        return zt(this, void 0, void 0, function() {
            var e, n, r, i, o, s, a, l, c, u, f, d;
            return jt(this, function(h) {
                switch (h.label) {
                case 0:
                    if (!j9())
                        throw new Error("Can't enumerate devices, navigator is not present.");
                    if (!$Ee())
                        throw new Error("Can't enumerate devices, method not supported.");
                    return [4, navigator.mediaDevices.enumerateDevices()];
                case 1:
                    e = h.sent(),
                    n = [];
                    try {
                        for (r = kv(e),
                        i = r.next(); !i.done; i = r.next())
                            o = i.value,
                            s = o.kind === "video" ? "videoinput" : o.kind,
                            s === "videoinput" && (a = o.deviceId || o.id,
                            l = o.label || "Video device ".concat(n.length + 1),
                            c = o.groupId,
                            u = {
                                deviceId: a,
                                label: l,
                                kind: s,
                                groupId: c
                            },
                            n.push(u))
                    } catch (p) {
                        f = {
                            error: p
                        }
                    } finally {
                        try {
                            i && !i.done && (d = r.return) && d.call(r)
                        } finally {
                            if (f)
                                throw f.error
                        }
                    }
                    return [2, n]
                }
            })
        })
    }
    ,
    t.findDeviceById = function(e) {
        return zt(this, void 0, void 0, function() {
            var n;
            return jt(this, function(r) {
                switch (r.label) {
                case 0:
                    return [4, t.listVideoInputDevices()];
                case 1:
                    return n = r.sent(),
                    n ? [2, n.find(function(i) {
                        return i.deviceId === e
                    })] : [2]
                }
            })
        })
    }
    ,
    t.cleanVideoSource = function(e) {
        if (e) {
            try {
                e.srcObject = null
            } catch {
                e.src = ""
            }
            e && e.removeAttribute("src")
        }
    }
    ,
    t.releaseAllStreams = function() {
        t.streamTracker.length !== 0 && t.streamTracker.forEach(function(e) {
            e.getTracks().forEach(function(n) {
                return n.stop()
            })
        }),
        t.streamTracker = []
    }
    ,
    t.playVideoOnLoadAsync = function(e, n) {
        return zt(this, void 0, void 0, function() {
            var r;
            return jt(this, function(i) {
                switch (i.label) {
                case 0:
                    return [4, t.tryPlayVideo(e)];
                case 1:
                    return r = i.sent(),
                    r ? [2, !0] : [2, new Promise(function(o, s) {
                        var a = setTimeout(function() {
                            t.isVideoPlaying(e) || (s(!1),
                            e.removeEventListener("canplay", l))
                        }, n)
                          , l = function() {
                            t.tryPlayVideo(e).then(function(c) {
                                clearTimeout(a),
                                e.removeEventListener("canplay", l),
                                o(c)
                            })
                        };
                        e.addEventListener("canplay", l)
                    }
                    )]
                }
            })
        })
    }
    ,
    t.attachStreamToVideo = function(e, n, r) {
        return r === void 0 && (r = 5e3),
        zt(this, void 0, void 0, function() {
            var i;
            return jt(this, function(o) {
                switch (o.label) {
                case 0:
                    return i = t.prepareVideoElement(n),
                    t.addVideoSource(i, e),
                    [4, t.playVideoOnLoadAsync(i, r)];
                case 1:
                    return o.sent(),
                    [2, i]
                }
            })
        })
    }
    ,
    t._waitImageLoad = function(e) {
        return new Promise(function(n, r) {
            var i = 1e4
              , o = setTimeout(function() {
                t.isImageLoaded(e) || (e.removeEventListener("load", s),
                r())
            }, i)
              , s = function() {
                clearTimeout(o),
                e.removeEventListener("load", s),
                n()
            };
            e.addEventListener("load", s)
        }
        )
    }
    ,
    t.checkCallbackFnOrThrow = function(e) {
        if (!e)
            throw new rn("`callbackFn` is a required parameter, you cannot capture results without it.")
    }
    ,
    t.disposeMediaStream = function(e) {
        e.getVideoTracks().forEach(function(n) {
            return n.stop()
        }),
        e = void 0
    }
    ,
    t.prototype.decode = function(e) {
        var n = t.createCanvasFromMediaElement(e);
        return this.decodeFromCanvas(n)
    }
    ,
    t.prototype.decodeBitmap = function(e) {
        return this.reader.decode(e, this.hints)
    }
    ,
    t.prototype.decodeFromCanvas = function(e) {
        var n = t.createBinaryBitmapFromCanvas(e);
        return this.decodeBitmap(n)
    }
    ,
    t.prototype.decodeFromImageElement = function(e) {
        return zt(this, void 0, void 0, function() {
            var n;
            return jt(this, function(r) {
                switch (r.label) {
                case 0:
                    if (!e)
                        throw new rn("An image element must be provided.");
                    return n = t.prepareImageElement(e),
                    [4, this._decodeOnLoadImage(n)];
                case 1:
                    return [2, r.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromImageUrl = function(e) {
        return zt(this, void 0, void 0, function() {
            var n;
            return jt(this, function(r) {
                switch (r.label) {
                case 0:
                    if (!e)
                        throw new rn("An URL must be provided.");
                    n = t.prepareImageElement(),
                    n.src = e,
                    r.label = 1;
                case 1:
                    return r.trys.push([1, , 3, 4]),
                    [4, this.decodeFromImageElement(n)];
                case 2:
                    return [2, r.sent()];
                case 3:
                    return t.destroyImageElement(n),
                    [7];
                case 4:
                    return [2]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromConstraints = function(e, n, r) {
        return zt(this, void 0, void 0, function() {
            var i, o;
            return jt(this, function(s) {
                switch (s.label) {
                case 0:
                    return t.checkCallbackFnOrThrow(r),
                    [4, this.getUserMedia(e)];
                case 1:
                    i = s.sent(),
                    s.label = 2;
                case 2:
                    return s.trys.push([2, 4, , 5]),
                    [4, this.decodeFromStream(i, n, r)];
                case 3:
                    return [2, s.sent()];
                case 4:
                    throw o = s.sent(),
                    t.disposeMediaStream(i),
                    o;
                case 5:
                    return [2]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromStream = function(e, n, r) {
        return zt(this, void 0, void 0, function() {
            var i, o, s, a, l, c, u, f, d, h = this;
            return jt(this, function(p) {
                switch (p.label) {
                case 0:
                    return t.checkCallbackFnOrThrow(r),
                    i = this.options.tryPlayVideoTimeout,
                    [4, t.attachStreamToVideo(e, n, i)];
                case 1:
                    return o = p.sent(),
                    s = function() {
                        t.disposeMediaStream(e),
                        t.cleanVideoSource(o)
                    }
                    ,
                    a = this.scan(o, r, s),
                    l = e.getVideoTracks(),
                    c = wc(wc({}, a), {
                        stop: function() {
                            a.stop()
                        },
                        streamVideoConstraintsApply: function(y, v) {
                            return zt(this, void 0, void 0, function() {
                                var g, m, _, x, b, w, E;
                                return jt(this, function(S) {
                                    switch (S.label) {
                                    case 0:
                                        g = v ? l.filter(v) : l,
                                        S.label = 1;
                                    case 1:
                                        S.trys.push([1, 6, 7, 8]),
                                        m = kv(g),
                                        _ = m.next(),
                                        S.label = 2;
                                    case 2:
                                        return _.done ? [3, 5] : (x = _.value,
                                        [4, x.applyConstraints(y)]);
                                    case 3:
                                        S.sent(),
                                        S.label = 4;
                                    case 4:
                                        return _ = m.next(),
                                        [3, 2];
                                    case 5:
                                        return [3, 8];
                                    case 6:
                                        return b = S.sent(),
                                        w = {
                                            error: b
                                        },
                                        [3, 8];
                                    case 7:
                                        try {
                                            _ && !_.done && (E = m.return) && E.call(m)
                                        } finally {
                                            if (w)
                                                throw w.error
                                        }
                                        return [7];
                                    case 8:
                                        return [2]
                                    }
                                })
                            })
                        },
                        streamVideoConstraintsGet: function(y) {
                            return l.find(y).getConstraints()
                        },
                        streamVideoSettingsGet: function(y) {
                            return l.find(y).getSettings()
                        },
                        streamVideoCapabilitiesGet: function(y) {
                            return l.find(y).getCapabilities()
                        }
                    }),
                    u = t.mediaStreamIsTorchCompatible(e),
                    u && (f = l == null ? void 0 : l.find(function(y) {
                        return t.mediaStreamIsTorchCompatibleTrack(y)
                    }),
                    d = function(y) {
                        return zt(h, void 0, void 0, function() {
                            return jt(this, function(v) {
                                switch (v.label) {
                                case 0:
                                    return [4, t.mediaStreamSetTorch(f, y)];
                                case 1:
                                    return v.sent(),
                                    [2]
                                }
                            })
                        })
                    }
                    ,
                    c.switchTorch = d,
                    c.stop = function() {
                        return zt(h, void 0, void 0, function() {
                            return jt(this, function(y) {
                                switch (y.label) {
                                case 0:
                                    return a.stop(),
                                    [4, d(!1)];
                                case 1:
                                    return y.sent(),
                                    [2]
                                }
                            })
                        })
                    }
                    ),
                    [2, c]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromVideoDevice = function(e, n, r) {
        return zt(this, void 0, void 0, function() {
            var i, o;
            return jt(this, function(s) {
                switch (s.label) {
                case 0:
                    return t.checkCallbackFnOrThrow(r),
                    e ? i = {
                        deviceId: {
                            exact: e
                        }
                    } : i = {
                        facingMode: "environment"
                    },
                    o = {
                        video: i
                    },
                    [4, this.decodeFromConstraints(o, n, r)];
                case 1:
                    return [2, s.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromVideoElement = function(e, n) {
        return zt(this, void 0, void 0, function() {
            var r, i;
            return jt(this, function(o) {
                switch (o.label) {
                case 0:
                    if (t.checkCallbackFnOrThrow(n),
                    !e)
                        throw new rn("A video element must be provided.");
                    return r = t.prepareVideoElement(e),
                    i = this.options.tryPlayVideoTimeout,
                    [4, t.playVideoOnLoadAsync(r, i)];
                case 1:
                    return o.sent(),
                    [2, this.scan(r, n)]
                }
            })
        })
    }
    ,
    t.prototype.decodeFromVideoUrl = function(e, n) {
        return zt(this, void 0, void 0, function() {
            var r, i, o, s;
            return jt(this, function(a) {
                switch (a.label) {
                case 0:
                    if (t.checkCallbackFnOrThrow(n),
                    !e)
                        throw new rn("An URL must be provided.");
                    return r = t.prepareVideoElement(),
                    r.src = e,
                    i = function() {
                        t.cleanVideoSource(r)
                    }
                    ,
                    o = this.options.tryPlayVideoTimeout,
                    [4, t.playVideoOnLoadAsync(r, o)];
                case 1:
                    return a.sent(),
                    s = this.scan(r, n, i),
                    [2, s]
                }
            })
        })
    }
    ,
    t.prototype.decodeOnceFromConstraints = function(e, n) {
        return zt(this, void 0, void 0, function() {
            var r;
            return jt(this, function(i) {
                switch (i.label) {
                case 0:
                    return [4, this.getUserMedia(e)];
                case 1:
                    return r = i.sent(),
                    [4, this.decodeOnceFromStream(r, n)];
                case 2:
                    return [2, i.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeOnceFromStream = function(e, n) {
        return zt(this, void 0, void 0, function() {
            var r, i, o;
            return jt(this, function(s) {
                switch (s.label) {
                case 0:
                    return r = !!n,
                    [4, t.attachStreamToVideo(e, n)];
                case 1:
                    i = s.sent(),
                    s.label = 2;
                case 2:
                    return s.trys.push([2, , 4, 5]),
                    [4, this.scanOneResult(i)];
                case 3:
                    return o = s.sent(),
                    [2, o];
                case 4:
                    return r || t.cleanVideoSource(i),
                    [7];
                case 5:
                    return [2]
                }
            })
        })
    }
    ,
    t.prototype.decodeOnceFromVideoDevice = function(e, n) {
        return zt(this, void 0, void 0, function() {
            var r, i;
            return jt(this, function(o) {
                switch (o.label) {
                case 0:
                    return e ? r = {
                        deviceId: {
                            exact: e
                        }
                    } : r = {
                        facingMode: "environment"
                    },
                    i = {
                        video: r
                    },
                    [4, this.decodeOnceFromConstraints(i, n)];
                case 1:
                    return [2, o.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeOnceFromVideoElement = function(e) {
        return zt(this, void 0, void 0, function() {
            var n, r;
            return jt(this, function(i) {
                switch (i.label) {
                case 0:
                    if (!e)
                        throw new rn("A video element must be provided.");
                    return n = t.prepareVideoElement(e),
                    r = this.options.tryPlayVideoTimeout,
                    [4, t.playVideoOnLoadAsync(n, r)];
                case 1:
                    return i.sent(),
                    [4, this.scanOneResult(n)];
                case 2:
                    return [2, i.sent()]
                }
            })
        })
    }
    ,
    t.prototype.decodeOnceFromVideoUrl = function(e) {
        return zt(this, void 0, void 0, function() {
            var n, r;
            return jt(this, function(i) {
                switch (i.label) {
                case 0:
                    if (!e)
                        throw new rn("An URL must be provided.");
                    n = t.prepareVideoElement(),
                    n.src = e,
                    r = this.decodeOnceFromVideoElement(n),
                    i.label = 1;
                case 1:
                    return i.trys.push([1, , 3, 4]),
                    [4, r];
                case 2:
                    return [2, i.sent()];
                case 3:
                    return t.cleanVideoSource(n),
                    [7];
                case 4:
                    return [2]
                }
            })
        })
    }
    ,
    t.prototype.scanOneResult = function(e, n, r, i) {
        var o = this;
        return n === void 0 && (n = !0),
        r === void 0 && (r = !0),
        i === void 0 && (i = !0),
        new Promise(function(s, a) {
            o.scan(e, function(l, c, u) {
                if (l) {
                    s(l),
                    u.stop();
                    return
                }
                if (c) {
                    if (c instanceof oe && n || c instanceof fn && r || c instanceof me && i)
                        return;
                    u.stop(),
                    a(c)
                }
            })
        }
        )
    }
    ,
    t.prototype.scan = function(e, n, r) {
        var i = this;
        t.checkCallbackFnOrThrow(n);
        var o = t.createCaptureCanvas(e), s;
        try {
            s = o.getContext("2d", {
                willReadFrequently: !0
            })
        } catch {
            s = o.getContext("2d")
        }
        if (!s)
            throw new Error("Couldn't create canvas for visual element scan.");
        var a = function() {
            s = void 0,
            o = void 0
        }, l = !1, c, u = function() {
            l = !0,
            clearTimeout(c),
            a(),
            r && r()
        }, f = {
            stop: u
        }, d = function() {
            if (!l)
                try {
                    t.drawImageOnCanvas(s, e);
                    var h = i.decodeFromCanvas(o);
                    n(h, void 0, f),
                    c = setTimeout(d, i.options.delayBetweenScanSuccess)
                } catch (g) {
                    n(void 0, g, f);
                    var p = g instanceof fn
                      , y = g instanceof me
                      , v = g instanceof oe;
                    if (p || y || v) {
                        c = setTimeout(d, i.options.delayBetweenScanAttempts);
                        return
                    }
                    a(),
                    r && r(g)
                }
        };
        return d(),
        f
    }
    ,
    t.prototype._decodeOnLoadImage = function(e) {
        return zt(this, void 0, void 0, function() {
            var n;
            return jt(this, function(r) {
                switch (r.label) {
                case 0:
                    return n = t.isImageLoaded(e),
                    n ? [3, 2] : [4, t._waitImageLoad(e)];
                case 1:
                    r.sent(),
                    r.label = 2;
                case 2:
                    return [2, this.decode(e)]
                }
            })
        })
    }
    ,
    t.prototype.getUserMedia = function(e) {
        return zt(this, void 0, void 0, function() {
            var n;
            return jt(this, function(r) {
                switch (r.label) {
                case 0:
                    return [4, navigator.mediaDevices.getUserMedia(e)];
                case 1:
                    return n = r.sent(),
                    t.streamTracker.push(n),
                    [2, n]
                }
            })
        })
    }
    ,
    t.streamTracker = [],
    t
}()
  , GEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                Object.prototype.hasOwnProperty.call(i, o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        if (typeof n != "function" && n !== null)
            throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    GEe(e, t);
    function e(n, r) {
        return t.call(this, new $0, n, r) || this
    }
    return e
}
)(Su);
var HEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                Object.prototype.hasOwnProperty.call(i, o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        if (typeof n != "function" && n !== null)
            throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    HEe(e, t);
    function e(n, r) {
        return t.call(this, new xc(n), n, r) || this
    }
    return e
}
)(Su);
var VEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                Object.prototype.hasOwnProperty.call(i, o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        if (typeof n != "function" && n !== null)
            throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    VEe(e, t);
    function e(n, r) {
        return t.call(this, new G0, n, r) || this
    }
    return e
}
)(Su);
var zEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                Object.prototype.hasOwnProperty.call(i, o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        if (typeof n != "function" && n !== null)
            throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    zEe(e, t);
    function e(n, r) {
        var i = this
          , o = new U9;
        return o.setHints(n),
        i = t.call(this, o, n, r) || this,
        i.reader = o,
        i
    }
    return Object.defineProperty(e.prototype, "possibleFormats", {
        set: function(n) {
            this.hints.set(Ot.POSSIBLE_FORMATS, n),
            this.reader.setHints(this.hints)
        },
        enumerable: !1,
        configurable: !0
    }),
    e.prototype.decodeBitmap = function(n) {
        return this.reader.decodeWithState(n)
    }
    ,
    e.prototype.setHints = function(n) {
        this.hints = n,
        this.reader.setHints(this.hints)
    }
    ,
    e
}
)(Su);
var jEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                Object.prototype.hasOwnProperty.call(i, o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        if (typeof n != "function" && n !== null)
            throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}();
(function(t) {
    jEe(e, t);
    function e(n, r) {
        return t.call(this, new V0, n, r) || this
    }
    return e
}
)(Su);
var WEe = globalThis && globalThis.__extends || function() {
    var t = function(e, n) {
        return t = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(r, i) {
            r.__proto__ = i
        }
        || function(r, i) {
            for (var o in i)
                Object.prototype.hasOwnProperty.call(i, o) && (r[o] = i[o])
        }
        ,
        t(e, n)
    };
    return function(e, n) {
        if (typeof n != "function" && n !== null)
            throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
        t(e, n);
        function r() {
            this.constructor = e
        }
        e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype,
        new r)
    }
}()
  , VPe = function(t) {
    WEe(e, t);
    function e(n, r) {
        return t.call(this, new H0, n, r) || this
    }
    return e
}(Su);
const W9 = new Set
  , Wr = new WeakMap
  , Mc = new WeakMap
  , Cl = new WeakMap
  , Rx = new WeakMap
  , YEe = new WeakMap
  , au = new WeakMap
  , j0 = new WeakMap;
let aa;
const Ka = "__aa_tgt"
  , Mx = "__aa_del"
  , XEe = t => {
    const e = QEe(t);
    e && e.forEach(n => eSe(n))
}
  , KEe = t => {
    t.forEach(e => {
        e.target === aa && ZEe(),
        Wr.has(e.target) && $l(e.target)
    }
    )
}
;
function qEe(t) {
    const e = Rx.get(t);
    e == null || e.disconnect();
    let n = Wr.get(t)
      , r = 0;
    const i = 5;
    n || (n = lu(t),
    Wr.set(t, n));
    const {offsetWidth: o, offsetHeight: s} = aa
      , l = [n.top - i, o - (n.left + i + n.width), s - (n.top + i + n.height), n.left - i].map(u => `${-1 * Math.floor(u)}px`).join(" ")
      , c = new IntersectionObserver( () => {
        ++r > 1 && $l(t)
    }
    ,{
        root: aa,
        threshold: 1,
        rootMargin: l
    });
    c.observe(t),
    Rx.set(t, c)
}
function $l(t) {
    clearTimeout(j0.get(t));
    const e = xm(t)
      , n = typeof e == "function" ? 500 : e.duration;
    j0.set(t, setTimeout( () => {
        const r = Cl.get(t);
        (!r || r.finished) && (Wr.set(t, lu(t)),
        qEe(t))
    }
    , n))
}
function ZEe() {
    clearTimeout(j0.get(aa)),
    j0.set(aa, setTimeout( () => {
        W9.forEach(t => K9(t, e => Y9( () => $l(e))))
    }
    , 100))
}
function JEe(t) {
    setTimeout( () => {
        YEe.set(t, setInterval( () => Y9($l.bind(null, t)), 2e3))
    }
    , Math.round(2e3 * Math.random()))
}
function Y9(t) {
    typeof requestIdleCallback == "function" ? requestIdleCallback( () => t()) : requestAnimationFrame( () => t())
}
let Dx, Ec;
typeof window < "u" && (aa = document.documentElement,
Dx = new MutationObserver(XEe),
Ec = new ResizeObserver(KEe),
Ec.observe(aa));
function QEe(t) {
    return t.reduce( (e, n) => {
        if (e === !1)
            return !1;
        if (n.target instanceof Element) {
            if (Nv(n.target),
            !e.has(n.target)) {
                e.add(n.target);
                for (let r = 0; r < n.target.children.length; r++) {
                    const i = n.target.children.item(r);
                    if (i) {
                        if (Mx in i)
                            return !1;
                        Nv(n.target, i),
                        e.add(i)
                    }
                }
            }
            if (n.removedNodes.length)
                for (let r = 0; r < n.removedNodes.length; r++) {
                    const i = n.removedNodes[r];
                    if (Mx in i)
                        return !1;
                    i instanceof Element && (e.add(i),
                    Nv(n.target, i),
                    Mc.set(i, [n.previousSibling, n.nextSibling]))
                }
        }
        return e
    }
    , new Set)
}
function Nv(t, e) {
    !e && !(Ka in t) ? Object.defineProperty(t, Ka, {
        value: t
    }) : e && !(Ka in e) && Object.defineProperty(e, Ka, {
        value: t
    })
}
function eSe(t) {
    var e;
    const n = aa.contains(t)
      , r = Wr.has(t);
    n && Mc.has(t) && Mc.delete(t),
    Cl.has(t) && ((e = Cl.get(t)) === null || e === void 0 || e.cancel()),
    r && n ? tSe(t) : r && !n ? rSe(t) : nSe(t)
}
function Zi(t) {
    return Number(t.replace(/[^0-9.\-]/g, ""))
}
function lu(t) {
    const e = t.getBoundingClientRect();
    return {
        top: e.top + window.scrollY,
        left: e.left + window.scrollX,
        width: e.width,
        height: e.height
    }
}
function X9(t, e, n) {
    let r = e.width
      , i = e.height
      , o = n.width
      , s = n.height;
    const a = getComputedStyle(t);
    if (a.getPropertyValue("box-sizing") === "content-box") {
        const c = Zi(a.paddingTop) + Zi(a.paddingBottom) + Zi(a.borderTopWidth) + Zi(a.borderBottomWidth)
          , u = Zi(a.paddingLeft) + Zi(a.paddingRight) + Zi(a.borderRightWidth) + Zi(a.borderLeftWidth);
        r -= u,
        o -= u,
        i -= c,
        s -= c
    }
    return [r, o, i, s].map(Math.round)
}
function xm(t) {
    return Ka in t && au.has(t[Ka]) ? au.get(t[Ka]) : {
        duration: 250,
        easing: "ease-in-out"
    }
}
function K9(t, ...e) {
    e.forEach(n => n(t, au.has(t)));
    for (let n = 0; n < t.children.length; n++) {
        const r = t.children.item(n);
        r && e.forEach(i => i(r, au.has(r)))
    }
}
function tSe(t) {
    const e = Wr.get(t)
      , n = lu(t);
    let r;
    if (!e)
        return;
    const i = xm(t);
    if (typeof i != "function") {
        const o = e.left - n.left
          , s = e.top - n.top
          , [a,l,c,u] = X9(t, e, n)
          , f = {
            transform: `translate(${o}px, ${s}px)`
        }
          , d = {
            transform: "translate(0, 0)"
        };
        a !== l && (f.width = `${a}px`,
        d.width = `${l}px`),
        c !== u && (f.height = `${c}px`,
        d.height = `${u}px`),
        r = t.animate([f, d], i)
    } else
        r = new Animation(i(t, "remain", e, n)),
        r.play();
    Cl.set(t, r),
    Wr.set(t, n),
    r.addEventListener("finish", $l.bind(null, t))
}
function nSe(t) {
    const e = lu(t);
    Wr.set(t, e);
    const n = xm(t);
    let r;
    typeof n != "function" ? r = t.animate([{
        transform: "scale(.98)",
        opacity: 0
    }, {
        transform: "scale(0.98)",
        opacity: 0,
        offset: .5
    }, {
        transform: "scale(1)",
        opacity: 1
    }], {
        duration: n.duration * 1.5,
        easing: "ease-in"
    }) : (r = new Animation(n(t, "add", e)),
    r.play()),
    Cl.set(t, r),
    r.addEventListener("finish", $l.bind(null, t))
}
function rSe(t) {
    if (!Mc.has(t) || !Wr.has(t))
        return;
    const [e,n] = Mc.get(t);
    Object.defineProperty(t, Mx, {
        value: !0
    }),
    n && n.parentNode && n.parentNode instanceof Element ? n.parentNode.insertBefore(t, n) : e && e.parentNode && e.parentNode.appendChild(t);
    const [r,i,o,s] = iSe(t)
      , a = xm(t)
      , l = Wr.get(t);
    let c;
    Object.assign(t.style, {
        position: "absolute",
        top: `${r}px`,
        left: `${i}px`,
        width: `${o}px`,
        height: `${s}px`,
        margin: 0,
        pointerEvents: "none",
        transformOrigin: "center",
        zIndex: 100
    }),
    typeof a != "function" ? c = t.animate([{
        transform: "scale(1)",
        opacity: 1
    }, {
        transform: "scale(.98)",
        opacity: 0
    }], {
        duration: a.duration,
        easing: "ease-out"
    }) : (c = new Animation(a(t, "remove", l)),
    c.play()),
    Cl.set(t, c),
    c.addEventListener("finish", () => {
        var u;
        t.remove(),
        Wr.delete(t),
        Mc.delete(t),
        Cl.delete(t),
        (u = Rx.get(t)) === null || u === void 0 || u.disconnect()
    }
    )
}
function iSe(t) {
    const e = Wr.get(t)
      , [n,,r] = X9(t, e, lu(t));
    let i = t.parentElement;
    for (; i && (getComputedStyle(i).position === "static" || i instanceof HTMLBodyElement); )
        i = i.parentElement;
    i || (i = document.body);
    const o = getComputedStyle(i)
      , s = Wr.get(i) || lu(i)
      , a = Math.round(e.top - s.top) - Zi(o.borderTopWidth)
      , l = Math.round(e.left - s.left) - Zi(o.borderLeftWidth);
    return [a, l, n, r]
}
function zPe(t, e={}) {
    Dx && Ec && (getComputedStyle(t).position === "static" && Object.assign(t.style, {
        position: "relative"
    }),
    K9(t, $l, JEe, n => Ec == null ? void 0 : Ec.observe(n)),
    typeof e == "function" ? au.set(t, e) : au.set(t, {
        duration: 250,
        easing: "ease-in-out",
        ...e
    }),
    Dx.observe(t, {
        childList: !0
    }),
    W9.add(t))
}
var Cu = TypeError;
const oSe = Ab(k0e);
var gE = typeof Map == "function" && Map.prototype
  , Fv = Object.getOwnPropertyDescriptor && gE ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null
  , W0 = gE && Fv && typeof Fv.get == "function" ? Fv.get : null
  , rI = gE && Map.prototype.forEach
  , mE = typeof Set == "function" && Set.prototype
  , Lv = Object.getOwnPropertyDescriptor && mE ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null
  , Y0 = mE && Lv && typeof Lv.get == "function" ? Lv.get : null
  , iI = mE && Set.prototype.forEach
  , sSe = typeof WeakMap == "function" && WeakMap.prototype
  , Nf = sSe ? WeakMap.prototype.has : null
  , aSe = typeof WeakSet == "function" && WeakSet.prototype
  , Ff = aSe ? WeakSet.prototype.has : null
  , lSe = typeof WeakRef == "function" && WeakRef.prototype
  , oI = lSe ? WeakRef.prototype.deref : null
  , cSe = Boolean.prototype.valueOf
  , uSe = Object.prototype.toString
  , fSe = Function.prototype.toString
  , dSe = String.prototype.match
  , vE = String.prototype.slice
  , Gs = String.prototype.replace
  , hSe = String.prototype.toUpperCase
  , sI = String.prototype.toLowerCase
  , q9 = RegExp.prototype.test
  , aI = Array.prototype.concat
  , eo = Array.prototype.join
  , pSe = Array.prototype.slice
  , lI = Math.floor
  , Bx = typeof BigInt == "function" ? BigInt.prototype.valueOf : null
  , $v = Object.getOwnPropertySymbols
  , kx = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null
  , cu = typeof Symbol == "function" && typeof Symbol.iterator == "object"
  , Lf = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === cu || "symbol") ? Symbol.toStringTag : null
  , Z9 = Object.prototype.propertyIsEnumerable
  , cI = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
    return t.__proto__
}
: null);
function uI(t, e) {
    if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || q9.call(/e/, e))
        return e;
    var n = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
    if (typeof t == "number") {
        var r = t < 0 ? -lI(-t) : lI(t);
        if (r !== t) {
            var i = String(r)
              , o = vE.call(e, i.length + 1);
            return Gs.call(i, n, "$&_") + "." + Gs.call(Gs.call(o, /([0-9]{3})/g, "$&_"), /_$/, "")
        }
    }
    return Gs.call(e, n, "$&_")
}
var Nx = oSe
  , fI = Nx.custom
  , dI = eF(fI) ? fI : null
  , J9 = {
    __proto__: null,
    double: '"',
    single: "'"
}
  , gSe = {
    __proto__: null,
    double: /(["\\])/g,
    single: /(['\\])/g
}
  , bm = function t(e, n, r, i) {
    var o = n || {};
    if (Fo(o, "quoteStyle") && !Fo(J9, o.quoteStyle))
        throw new TypeError('option "quoteStyle" must be "single" or "double"');
    if (Fo(o, "maxStringLength") && (typeof o.maxStringLength == "number" ? o.maxStringLength < 0 && o.maxStringLength !== 1 / 0 : o.maxStringLength !== null))
        throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
    var s = Fo(o, "customInspect") ? o.customInspect : !0;
    if (typeof s != "boolean" && s !== "symbol")
        throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
    if (Fo(o, "indent") && o.indent !== null && o.indent !== "	" && !(parseInt(o.indent, 10) === o.indent && o.indent > 0))
        throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
    if (Fo(o, "numericSeparator") && typeof o.numericSeparator != "boolean")
        throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
    var a = o.numericSeparator;
    if (typeof e > "u")
        return "undefined";
    if (e === null)
        return "null";
    if (typeof e == "boolean")
        return e ? "true" : "false";
    if (typeof e == "string")
        return nF(e, o);
    if (typeof e == "number") {
        if (e === 0)
            return 1 / 0 / e > 0 ? "0" : "-0";
        var l = String(e);
        return a ? uI(e, l) : l
    }
    if (typeof e == "bigint") {
        var c = String(e) + "n";
        return a ? uI(e, c) : c
    }
    var u = typeof o.depth > "u" ? 5 : o.depth;
    if (typeof r > "u" && (r = 0),
    r >= u && u > 0 && typeof e == "object")
        return Fx(e) ? "[Array]" : "[Object]";
    var f = DSe(o, r);
    if (typeof i > "u")
        i = [];
    else if (tF(i, e) >= 0)
        return "[Circular]";
    function d(I, B, G) {
        if (B && (i = pSe.call(i),
        i.push(B)),
        G) {
            var N = {
                depth: o.depth
            };
            return Fo(o, "quoteStyle") && (N.quoteStyle = o.quoteStyle),
            t(I, N, r + 1, i)
        }
        return t(I, o, r + 1, i)
    }
    if (typeof e == "function" && !hI(e)) {
        var h = SSe(e)
          , p = bp(e, d);
        return "[Function" + (h ? ": " + h : " (anonymous)") + "]" + (p.length > 0 ? " { " + eo.call(p, ", ") + " }" : "")
    }
    if (eF(e)) {
        var y = cu ? Gs.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : kx.call(e);
        return typeof e == "object" && !cu ? Zu(y) : y
    }
    if (OSe(e)) {
        for (var v = "<" + sI.call(String(e.nodeName)), g = e.attributes || [], m = 0; m < g.length; m++)
            v += " " + g[m].name + "=" + Q9(mSe(g[m].value), "double", o);
        return v += ">",
        e.childNodes && e.childNodes.length && (v += "..."),
        v += "</" + sI.call(String(e.nodeName)) + ">",
        v
    }
    if (Fx(e)) {
        if (e.length === 0)
            return "[]";
        var _ = bp(e, d);
        return f && !MSe(_) ? "[" + Lx(_, f) + "]" : "[ " + eo.call(_, ", ") + " ]"
    }
    if (ySe(e)) {
        var x = bp(e, d);
        return !("cause"in Error.prototype) && "cause"in e && !Z9.call(e, "cause") ? "{ [" + String(e) + "] " + eo.call(aI.call("[cause]: " + d(e.cause), x), ", ") + " }" : x.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + eo.call(x, ", ") + " }"
    }
    if (typeof e == "object" && s) {
        if (dI && typeof e[dI] == "function" && Nx)
            return Nx(e, {
                depth: u - r
            });
        if (s !== "symbol" && typeof e.inspect == "function")
            return e.inspect()
    }
    if (CSe(e)) {
        var b = [];
        return rI && rI.call(e, function(I, B) {
            b.push(d(B, e, !0) + " => " + d(I, e))
        }),
        pI("Map", W0.call(e), b, f)
    }
    if (PSe(e)) {
        var w = [];
        return iI && iI.call(e, function(I) {
            w.push(d(I, e))
        }),
        pI("Set", Y0.call(e), w, f)
    }
    if (ASe(e))
        return Uv("WeakMap");
    if (ISe(e))
        return Uv("WeakSet");
    if (TSe(e))
        return Uv("WeakRef");
    if (xSe(e))
        return Zu(d(Number(e)));
    if (wSe(e))
        return Zu(d(Bx.call(e)));
    if (bSe(e))
        return Zu(cSe.call(e));
    if (_Se(e))
        return Zu(d(String(e)));
    if (typeof window < "u" && e === window)
        return "{ [object Window] }";
    if (typeof globalThis < "u" && e === globalThis || typeof fl < "u" && e === fl)
        return "{ [object globalThis] }";
    if (!vSe(e) && !hI(e)) {
        var E = bp(e, d)
          , S = cI ? cI(e) === Object.prototype : e instanceof Object || e.constructor === Object
          , P = e instanceof Object ? "" : "null prototype"
          , C = !S && Lf && Object(e) === e && Lf in e ? vE.call(va(e), 8, -1) : P ? "Object" : ""
          , A = S || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : ""
          , T = A + (C || P ? "[" + eo.call(aI.call([], C || [], P || []), ": ") + "] " : "");
        return E.length === 0 ? T + "{}" : f ? T + "{" + Lx(E, f) + "}" : T + "{ " + eo.call(E, ", ") + " }"
    }
    return String(e)
};
function Q9(t, e, n) {
    var r = n.quoteStyle || e
      , i = J9[r];
    return i + t + i
}
function mSe(t) {
    return Gs.call(String(t), /"/g, "&quot;")
}
function Ul(t) {
    return !Lf || !(typeof t == "object" && (Lf in t || typeof t[Lf] < "u"))
}
function Fx(t) {
    return va(t) === "[object Array]" && Ul(t)
}
function vSe(t) {
    return va(t) === "[object Date]" && Ul(t)
}
function hI(t) {
    return va(t) === "[object RegExp]" && Ul(t)
}
function ySe(t) {
    return va(t) === "[object Error]" && Ul(t)
}
function _Se(t) {
    return va(t) === "[object String]" && Ul(t)
}
function xSe(t) {
    return va(t) === "[object Number]" && Ul(t)
}
function bSe(t) {
    return va(t) === "[object Boolean]" && Ul(t)
}
function eF(t) {
    if (cu)
        return t && typeof t == "object" && t instanceof Symbol;
    if (typeof t == "symbol")
        return !0;
    if (!t || typeof t != "object" || !kx)
        return !1;
    try {
        return kx.call(t),
        !0
    } catch {}
    return !1
}
function wSe(t) {
    if (!t || typeof t != "object" || !Bx)
        return !1;
    try {
        return Bx.call(t),
        !0
    } catch {}
    return !1
}
var ESe = Object.prototype.hasOwnProperty || function(t) {
    return t in this
}
;
function Fo(t, e) {
    return ESe.call(t, e)
}
function va(t) {
    return uSe.call(t)
}
function SSe(t) {
    if (t.name)
        return t.name;
    var e = dSe.call(fSe.call(t), /^function\s*([\w$]+)/);
    return e ? e[1] : null
}
function tF(t, e) {
    if (t.indexOf)
        return t.indexOf(e);
    for (var n = 0, r = t.length; n < r; n++)
        if (t[n] === e)
            return n;
    return -1
}
function CSe(t) {
    if (!W0 || !t || typeof t != "object")
        return !1;
    try {
        W0.call(t);
        try {
            Y0.call(t)
        } catch {
            return !0
        }
        return t instanceof Map
    } catch {}
    return !1
}
function ASe(t) {
    if (!Nf || !t || typeof t != "object")
        return !1;
    try {
        Nf.call(t, Nf);
        try {
            Ff.call(t, Ff)
        } catch {
            return !0
        }
        return t instanceof WeakMap
    } catch {}
    return !1
}
function TSe(t) {
    if (!oI || !t || typeof t != "object")
        return !1;
    try {
        return oI.call(t),
        !0
    } catch {}
    return !1
}
function PSe(t) {
    if (!Y0 || !t || typeof t != "object")
        return !1;
    try {
        Y0.call(t);
        try {
            W0.call(t)
        } catch {
            return !0
        }
        return t instanceof Set
    } catch {}
    return !1
}
function ISe(t) {
    if (!Ff || !t || typeof t != "object")
        return !1;
    try {
        Ff.call(t, Ff);
        try {
            Nf.call(t, Nf)
        } catch {
            return !0
        }
        return t instanceof WeakSet
    } catch {}
    return !1
}
function OSe(t) {
    return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function"
}
function nF(t, e) {
    if (t.length > e.maxStringLength) {
        var n = t.length - e.maxStringLength
          , r = "... " + n + " more character" + (n > 1 ? "s" : "");
        return nF(vE.call(t, 0, e.maxStringLength), e) + r
    }
    var i = gSe[e.quoteStyle || "single"];
    i.lastIndex = 0;
    var o = Gs.call(Gs.call(t, i, "\\$1"), /[\x00-\x1f]/g, RSe);
    return Q9(o, "single", e)
}
function RSe(t) {
    var e = t.charCodeAt(0)
      , n = {
        8: "b",
        9: "t",
        10: "n",
        12: "f",
        13: "r"
    }[e];
    return n ? "\\" + n : "\\x" + (e < 16 ? "0" : "") + hSe.call(e.toString(16))
}
function Zu(t) {
    return "Object(" + t + ")"
}
function Uv(t) {
    return t + " { ? }"
}
function pI(t, e, n, r) {
    var i = r ? Lx(n, r) : eo.call(n, ", ");
    return t + " (" + e + ") {" + i + "}"
}
function MSe(t) {
    for (var e = 0; e < t.length; e++)
        if (tF(t[e], `
`) >= 0)
            return !1;
    return !0
}
function DSe(t, e) {
    var n;
    if (t.indent === "	")
        n = "	";
    else if (typeof t.indent == "number" && t.indent > 0)
        n = eo.call(Array(t.indent + 1), " ");
    else
        return null;
    return {
        base: n,
        prev: eo.call(Array(e + 1), n)
    }
}
function Lx(t, e) {
    if (t.length === 0)
        return "";
    var n = `
` + e.prev + e.base;
    return n + eo.call(t, "," + n) + `
` + e.prev
}
function bp(t, e) {
    var n = Fx(t)
      , r = [];
    if (n) {
        r.length = t.length;
        for (var i = 0; i < t.length; i++)
            r[i] = Fo(t, i) ? e(t[i], t) : ""
    }
    var o = typeof $v == "function" ? $v(t) : [], s;
    if (cu) {
        s = {};
        for (var a = 0; a < o.length; a++)
            s["$" + o[a]] = o[a]
    }
    for (var l in t)
        Fo(t, l) && (n && String(Number(l)) === l && l < t.length || cu && s["$" + l]instanceof Symbol || (q9.call(/[^\w$]/, l) ? r.push(e(l, t) + ": " + e(t[l], t)) : r.push(l + ": " + e(t[l], t))));
    if (typeof $v == "function")
        for (var c = 0; c < o.length; c++)
            Z9.call(t, o[c]) && r.push("[" + e(o[c]) + "]: " + e(t[o[c]], t));
    return r
}
var BSe = bm
  , kSe = Cu
  , wm = function(t, e, n) {
    for (var r = t, i; (i = r.next) != null; r = i)
        if (i.key === e)
            return r.next = i.next,
            n || (i.next = t.next,
            t.next = i),
            i
}
  , NSe = function(t, e) {
    if (t) {
        var n = wm(t, e);
        return n && n.value
    }
}
  , FSe = function(t, e, n) {
    var r = wm(t, e);
    r ? r.value = n : t.next = {
        key: e,
        next: t.next,
        value: n
    }
}
  , LSe = function(t, e) {
    return t ? !!wm(t, e) : !1
}
  , $Se = function(t, e) {
    if (t)
        return wm(t, e, !0)
}
  , USe = function() {
    var e, n = {
        assert: function(r) {
            if (!n.has(r))
                throw new kSe("Side channel does not contain " + BSe(r))
        },
        delete: function(r) {
            var i = e && e.next
              , o = $Se(e, r);
            return o && i && i === o && (e = void 0),
            !!o
        },
        get: function(r) {
            return NSe(e, r)
        },
        has: function(r) {
            return LSe(e, r)
        },
        set: function(r, i) {
            e || (e = {
                next: void 0
            }),
            FSe(e, r, i)
        }
    };
    return n
}
  , rF = Object
  , GSe = Error
  , HSe = EvalError
  , VSe = RangeError
  , zSe = ReferenceError
  , jSe = SyntaxError
  , WSe = URIError
  , YSe = Math.abs
  , XSe = Math.floor
  , KSe = Math.max
  , qSe = Math.min
  , ZSe = Math.pow
  , JSe = Math.round
  , QSe = Number.isNaN || function(e) {
    return e !== e
}
  , eCe = QSe
  , tCe = function(e) {
    return eCe(e) || e === 0 ? e : e < 0 ? -1 : 1
}
  , nCe = Object.getOwnPropertyDescriptor
  , Yp = nCe;
if (Yp)
    try {
        Yp([], "length")
    } catch {
        Yp = null
    }
var iF = Yp
  , Xp = Object.defineProperty || !1;
if (Xp)
    try {
        Xp({}, "a", {
            value: 1
        })
    } catch {
        Xp = !1
    }
var rCe = Xp, Gv, gI;
function iCe() {
    return gI || (gI = 1,
    Gv = function() {
        if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
            return !1;
        if (typeof Symbol.iterator == "symbol")
            return !0;
        var e = {}
          , n = Symbol("test")
          , r = Object(n);
        if (typeof n == "string" || Object.prototype.toString.call(n) !== "[object Symbol]" || Object.prototype.toString.call(r) !== "[object Symbol]")
            return !1;
        var i = 42;
        e[n] = i;
        for (var o in e)
            return !1;
        if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
            return !1;
        var s = Object.getOwnPropertySymbols(e);
        if (s.length !== 1 || s[0] !== n || !Object.prototype.propertyIsEnumerable.call(e, n))
            return !1;
        if (typeof Object.getOwnPropertyDescriptor == "function") {
            var a = Object.getOwnPropertyDescriptor(e, n);
            if (a.value !== i || a.enumerable !== !0)
                return !1
        }
        return !0
    }
    ),
    Gv
}
var Hv, mI;
function oCe() {
    if (mI)
        return Hv;
    mI = 1;
    var t = typeof Symbol < "u" && Symbol
      , e = iCe();
    return Hv = function() {
        return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e()
    }
    ,
    Hv
}
var Vv, vI;
function oF() {
    return vI || (vI = 1,
    Vv = typeof Reflect < "u" && Reflect.getPrototypeOf || null),
    Vv
}
var zv, yI;
function sF() {
    if (yI)
        return zv;
    yI = 1;
    var t = rF;
    return zv = t.getPrototypeOf || null,
    zv
}
var jv, _I;
function sCe() {
    if (_I)
        return jv;
    _I = 1;
    var t = "Function.prototype.bind called on incompatible "
      , e = Object.prototype.toString
      , n = Math.max
      , r = "[object Function]"
      , i = function(l, c) {
        for (var u = [], f = 0; f < l.length; f += 1)
            u[f] = l[f];
        for (var d = 0; d < c.length; d += 1)
            u[d + l.length] = c[d];
        return u
    }
      , o = function(l, c) {
        for (var u = [], f = c || 0, d = 0; f < l.length; f += 1,
        d += 1)
            u[d] = l[f];
        return u
    }
      , s = function(a, l) {
        for (var c = "", u = 0; u < a.length; u += 1)
            c += a[u],
            u + 1 < a.length && (c += l);
        return c
    };
    return jv = function(l) {
        var c = this;
        if (typeof c != "function" || e.apply(c) !== r)
            throw new TypeError(t + c);
        for (var u = o(arguments, 1), f, d = function() {
            if (this instanceof f) {
                var g = c.apply(this, i(u, arguments));
                return Object(g) === g ? g : this
            }
            return c.apply(l, i(u, arguments))
        }, h = n(0, c.length - u.length), p = [], y = 0; y < h; y++)
            p[y] = "$" + y;
        if (f = Function("binder", "return function (" + s(p, ",") + "){ return binder.apply(this,arguments); }")(d),
        c.prototype) {
            var v = function() {};
            v.prototype = c.prototype,
            f.prototype = new v,
            v.prototype = null
        }
        return f
    }
    ,
    jv
}
var Wv, xI;
function Em() {
    if (xI)
        return Wv;
    xI = 1;
    var t = sCe();
    return Wv = Function.prototype.bind || t,
    Wv
}
var Yv, bI;
function yE() {
    return bI || (bI = 1,
    Yv = Function.prototype.call),
    Yv
}
var Xv, wI;
function aF() {
    return wI || (wI = 1,
    Xv = Function.prototype.apply),
    Xv
}
var aCe = typeof Reflect < "u" && Reflect && Reflect.apply, lCe = Em(), cCe = aF(), uCe = yE(), fCe = aCe, dCe = fCe || lCe.call(uCe, cCe), hCe = Em(), pCe = Cu, gCe = yE(), mCe = dCe, lF = function(e) {
    if (e.length < 1 || typeof e[0] != "function")
        throw new pCe("a function is required");
    return mCe(hCe, gCe, e)
}, Kv, EI;
function vCe() {
    if (EI)
        return Kv;
    EI = 1;
    var t = lF, e = iF, n;
    try {
        n = [].__proto__ === Array.prototype
    } catch (s) {
        if (!s || typeof s != "object" || !("code"in s) || s.code !== "ERR_PROTO_ACCESS")
            throw s
    }
    var r = !!n && e && e(Object.prototype, "__proto__")
      , i = Object
      , o = i.getPrototypeOf;
    return Kv = r && typeof r.get == "function" ? t([r.get]) : typeof o == "function" ? function(a) {
        return o(a == null ? a : i(a))
    }
    : !1,
    Kv
}
var qv, SI;
function yCe() {
    if (SI)
        return qv;
    SI = 1;
    var t = oF()
      , e = sF()
      , n = vCe();
    return qv = t ? function(i) {
        return t(i)
    }
    : e ? function(i) {
        if (!i || typeof i != "object" && typeof i != "function")
            throw new TypeError("getProto: not an object");
        return e(i)
    }
    : n ? function(i) {
        return n(i)
    }
    : null,
    qv
}
var Zv, CI;
function _Ce() {
    if (CI)
        return Zv;
    CI = 1;
    var t = Function.prototype.call
      , e = Object.prototype.hasOwnProperty
      , n = Em();
    return Zv = n.call(t, e),
    Zv
}
var Je, xCe = rF, bCe = GSe, wCe = HSe, ECe = VSe, SCe = zSe, uu = jSe, Dc = Cu, CCe = WSe, ACe = YSe, TCe = XSe, PCe = KSe, ICe = qSe, OCe = ZSe, RCe = JSe, MCe = tCe, cF = Function, Jv = function(t) {
    try {
        return cF('"use strict"; return (' + t + ").constructor;")()
    } catch {}
}, Cd = iF, DCe = rCe, Qv = function() {
    throw new Dc
}, BCe = Cd ? function() {
    try {
        return arguments.callee,
        Qv
    } catch {
        try {
            return Cd(arguments, "callee").get
        } catch {
            return Qv
        }
    }
}() : Qv, sc = oCe()(), In = yCe(), kCe = sF(), NCe = oF(), uF = aF(), dh = yE(), pc = {}, FCe = typeof Uint8Array > "u" || !In ? Je : In(Uint8Array), sl = {
    __proto__: null,
    "%AggregateError%": typeof AggregateError > "u" ? Je : AggregateError,
    "%Array%": Array,
    "%ArrayBuffer%": typeof ArrayBuffer > "u" ? Je : ArrayBuffer,
    "%ArrayIteratorPrototype%": sc && In ? In([][Symbol.iterator]()) : Je,
    "%AsyncFromSyncIteratorPrototype%": Je,
    "%AsyncFunction%": pc,
    "%AsyncGenerator%": pc,
    "%AsyncGeneratorFunction%": pc,
    "%AsyncIteratorPrototype%": pc,
    "%Atomics%": typeof Atomics > "u" ? Je : Atomics,
    "%BigInt%": typeof BigInt > "u" ? Je : BigInt,
    "%BigInt64Array%": typeof BigInt64Array > "u" ? Je : BigInt64Array,
    "%BigUint64Array%": typeof BigUint64Array > "u" ? Je : BigUint64Array,
    "%Boolean%": Boolean,
    "%DataView%": typeof DataView > "u" ? Je : DataView,
    "%Date%": Date,
    "%decodeURI%": decodeURI,
    "%decodeURIComponent%": decodeURIComponent,
    "%encodeURI%": encodeURI,
    "%encodeURIComponent%": encodeURIComponent,
    "%Error%": bCe,
    "%eval%": eval,
    "%EvalError%": wCe,
    "%Float16Array%": typeof Float16Array > "u" ? Je : Float16Array,
    "%Float32Array%": typeof Float32Array > "u" ? Je : Float32Array,
    "%Float64Array%": typeof Float64Array > "u" ? Je : Float64Array,
    "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? Je : FinalizationRegistry,
    "%Function%": cF,
    "%GeneratorFunction%": pc,
    "%Int8Array%": typeof Int8Array > "u" ? Je : Int8Array,
    "%Int16Array%": typeof Int16Array > "u" ? Je : Int16Array,
    "%Int32Array%": typeof Int32Array > "u" ? Je : Int32Array,
    "%isFinite%": isFinite,
    "%isNaN%": isNaN,
    "%IteratorPrototype%": sc && In ? In(In([][Symbol.iterator]())) : Je,
    "%JSON%": typeof JSON == "object" ? JSON : Je,
    "%Map%": typeof Map > "u" ? Je : Map,
    "%MapIteratorPrototype%": typeof Map > "u" || !sc || !In ? Je : In(new Map()[Symbol.iterator]()),
    "%Math%": Math,
    "%Number%": Number,
    "%Object%": xCe,
    "%Object.getOwnPropertyDescriptor%": Cd,
    "%parseFloat%": parseFloat,
    "%parseInt%": parseInt,
    "%Promise%": typeof Promise > "u" ? Je : Promise,
    "%Proxy%": typeof Proxy > "u" ? Je : Proxy,
    "%RangeError%": ECe,
    "%ReferenceError%": SCe,
    "%Reflect%": typeof Reflect > "u" ? Je : Reflect,
    "%RegExp%": RegExp,
    "%Set%": typeof Set > "u" ? Je : Set,
    "%SetIteratorPrototype%": typeof Set > "u" || !sc || !In ? Je : In(new Set()[Symbol.iterator]()),
    "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? Je : SharedArrayBuffer,
    "%String%": String,
    "%StringIteratorPrototype%": sc && In ? In(""[Symbol.iterator]()) : Je,
    "%Symbol%": sc ? Symbol : Je,
    "%SyntaxError%": uu,
    "%ThrowTypeError%": BCe,
    "%TypedArray%": FCe,
    "%TypeError%": Dc,
    "%Uint8Array%": typeof Uint8Array > "u" ? Je : Uint8Array,
    "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? Je : Uint8ClampedArray,
    "%Uint16Array%": typeof Uint16Array > "u" ? Je : Uint16Array,
    "%Uint32Array%": typeof Uint32Array > "u" ? Je : Uint32Array,
    "%URIError%": CCe,
    "%WeakMap%": typeof WeakMap > "u" ? Je : WeakMap,
    "%WeakRef%": typeof WeakRef > "u" ? Je : WeakRef,
    "%WeakSet%": typeof WeakSet > "u" ? Je : WeakSet,
    "%Function.prototype.call%": dh,
    "%Function.prototype.apply%": uF,
    "%Object.defineProperty%": DCe,
    "%Object.getPrototypeOf%": kCe,
    "%Math.abs%": ACe,
    "%Math.floor%": TCe,
    "%Math.max%": PCe,
    "%Math.min%": ICe,
    "%Math.pow%": OCe,
    "%Math.round%": RCe,
    "%Math.sign%": MCe,
    "%Reflect.getPrototypeOf%": NCe
};
if (In)
    try {
        null.error
    } catch (t) {
        var LCe = In(In(t));
        sl["%Error.prototype%"] = LCe
    }
var $Ce = function t(e) {
    var n;
    if (e === "%AsyncFunction%")
        n = Jv("async function () {}");
    else if (e === "%GeneratorFunction%")
        n = Jv("function* () {}");
    else if (e === "%AsyncGeneratorFunction%")
        n = Jv("async function* () {}");
    else if (e === "%AsyncGenerator%") {
        var r = t("%AsyncGeneratorFunction%");
        r && (n = r.prototype)
    } else if (e === "%AsyncIteratorPrototype%") {
        var i = t("%AsyncGenerator%");
        i && In && (n = In(i.prototype))
    }
    return sl[e] = n,
    n
}
  , AI = {
    __proto__: null,
    "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
    "%ArrayPrototype%": ["Array", "prototype"],
    "%ArrayProto_entries%": ["Array", "prototype", "entries"],
    "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
    "%ArrayProto_keys%": ["Array", "prototype", "keys"],
    "%ArrayProto_values%": ["Array", "prototype", "values"],
    "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
    "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
    "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
    "%BooleanPrototype%": ["Boolean", "prototype"],
    "%DataViewPrototype%": ["DataView", "prototype"],
    "%DatePrototype%": ["Date", "prototype"],
    "%ErrorPrototype%": ["Error", "prototype"],
    "%EvalErrorPrototype%": ["EvalError", "prototype"],
    "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
    "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
    "%FunctionPrototype%": ["Function", "prototype"],
    "%Generator%": ["GeneratorFunction", "prototype"],
    "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
    "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
    "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
    "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
    "%JSONParse%": ["JSON", "parse"],
    "%JSONStringify%": ["JSON", "stringify"],
    "%MapPrototype%": ["Map", "prototype"],
    "%NumberPrototype%": ["Number", "prototype"],
    "%ObjectPrototype%": ["Object", "prototype"],
    "%ObjProto_toString%": ["Object", "prototype", "toString"],
    "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
    "%PromisePrototype%": ["Promise", "prototype"],
    "%PromiseProto_then%": ["Promise", "prototype", "then"],
    "%Promise_all%": ["Promise", "all"],
    "%Promise_reject%": ["Promise", "reject"],
    "%Promise_resolve%": ["Promise", "resolve"],
    "%RangeErrorPrototype%": ["RangeError", "prototype"],
    "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
    "%RegExpPrototype%": ["RegExp", "prototype"],
    "%SetPrototype%": ["Set", "prototype"],
    "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
    "%StringPrototype%": ["String", "prototype"],
    "%SymbolPrototype%": ["Symbol", "prototype"],
    "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
    "%TypedArrayPrototype%": ["TypedArray", "prototype"],
    "%TypeErrorPrototype%": ["TypeError", "prototype"],
    "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
    "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
    "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
    "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
    "%URIErrorPrototype%": ["URIError", "prototype"],
    "%WeakMapPrototype%": ["WeakMap", "prototype"],
    "%WeakSetPrototype%": ["WeakSet", "prototype"]
}
  , hh = Em()
  , X0 = _Ce()
  , UCe = hh.call(dh, Array.prototype.concat)
  , GCe = hh.call(uF, Array.prototype.splice)
  , TI = hh.call(dh, String.prototype.replace)
  , K0 = hh.call(dh, String.prototype.slice)
  , HCe = hh.call(dh, RegExp.prototype.exec)
  , VCe = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g
  , zCe = /\\(\\)?/g
  , jCe = function(e) {
    var n = K0(e, 0, 1)
      , r = K0(e, -1);
    if (n === "%" && r !== "%")
        throw new uu("invalid intrinsic syntax, expected closing `%`");
    if (r === "%" && n !== "%")
        throw new uu("invalid intrinsic syntax, expected opening `%`");
    var i = [];
    return TI(e, VCe, function(o, s, a, l) {
        i[i.length] = a ? TI(l, zCe, "$1") : s || o
    }),
    i
}
  , WCe = function(e, n) {
    var r = e, i;
    if (X0(AI, r) && (i = AI[r],
    r = "%" + i[0] + "%"),
    X0(sl, r)) {
        var o = sl[r];
        if (o === pc && (o = $Ce(r)),
        typeof o > "u" && !n)
            throw new Dc("intrinsic " + e + " exists, but is not available. Please file an issue!");
        return {
            alias: i,
            name: r,
            value: o
        }
    }
    throw new uu("intrinsic " + e + " does not exist!")
}
  , _E = function(e, n) {
    if (typeof e != "string" || e.length === 0)
        throw new Dc("intrinsic name must be a non-empty string");
    if (arguments.length > 1 && typeof n != "boolean")
        throw new Dc('"allowMissing" argument must be a boolean');
    if (HCe(/^%?[^%]*%?$/, e) === null)
        throw new uu("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
    var r = jCe(e)
      , i = r.length > 0 ? r[0] : ""
      , o = WCe("%" + i + "%", n)
      , s = o.name
      , a = o.value
      , l = !1
      , c = o.alias;
    c && (i = c[0],
    GCe(r, UCe([0, 1], c)));
    for (var u = 1, f = !0; u < r.length; u += 1) {
        var d = r[u]
          , h = K0(d, 0, 1)
          , p = K0(d, -1);
        if ((h === '"' || h === "'" || h === "`" || p === '"' || p === "'" || p === "`") && h !== p)
            throw new uu("property names with quotes must have matching quotes");
        if ((d === "constructor" || !f) && (l = !0),
        i += "." + d,
        s = "%" + i + "%",
        X0(sl, s))
            a = sl[s];
        else if (a != null) {
            if (!(d in a)) {
                if (!n)
                    throw new Dc("base intrinsic for " + e + " exists, but the property is not available.");
                return
            }
            if (Cd && u + 1 >= r.length) {
                var y = Cd(a, d);
                f = !!y,
                f && "get"in y && !("originalValue"in y.get) ? a = y.get : a = a[d]
            } else
                f = X0(a, d),
                a = a[d];
            f && !l && (sl[s] = a)
        }
    }
    return a
}
  , fF = _E
  , dF = lF
  , YCe = dF([fF("%String.prototype.indexOf%")])
  , hF = function(e, n) {
    var r = fF(e, !!n);
    return typeof r == "function" && YCe(e, ".prototype.") > -1 ? dF([r]) : r
}
  , XCe = _E
  , ph = hF
  , KCe = bm
  , qCe = Cu
  , PI = XCe("%Map%", !0)
  , ZCe = ph("Map.prototype.get", !0)
  , JCe = ph("Map.prototype.set", !0)
  , QCe = ph("Map.prototype.has", !0)
  , eAe = ph("Map.prototype.delete", !0)
  , tAe = ph("Map.prototype.size", !0)
  , pF = !!PI && function() {
    var e, n = {
        assert: function(r) {
            if (!n.has(r))
                throw new qCe("Side channel does not contain " + KCe(r))
        },
        delete: function(r) {
            if (e) {
                var i = eAe(e, r);
                return tAe(e) === 0 && (e = void 0),
                i
            }
            return !1
        },
        get: function(r) {
            if (e)
                return ZCe(e, r)
        },
        has: function(r) {
            return e ? QCe(e, r) : !1
        },
        set: function(r, i) {
            e || (e = new PI),
            JCe(e, r, i)
        }
    };
    return n
}
  , nAe = _E
  , Sm = hF
  , rAe = bm
  , wp = pF
  , iAe = Cu
  , ac = nAe("%WeakMap%", !0)
  , oAe = Sm("WeakMap.prototype.get", !0)
  , sAe = Sm("WeakMap.prototype.set", !0)
  , aAe = Sm("WeakMap.prototype.has", !0)
  , lAe = Sm("WeakMap.prototype.delete", !0)
  , cAe = ac ? function() {
    var e, n, r = {
        assert: function(i) {
            if (!r.has(i))
                throw new iAe("Side channel does not contain " + rAe(i))
        },
        delete: function(i) {
            if (ac && i && (typeof i == "object" || typeof i == "function")) {
                if (e)
                    return lAe(e, i)
            } else if (wp && n)
                return n.delete(i);
            return !1
        },
        get: function(i) {
            return ac && i && (typeof i == "object" || typeof i == "function") && e ? oAe(e, i) : n && n.get(i)
        },
        has: function(i) {
            return ac && i && (typeof i == "object" || typeof i == "function") && e ? aAe(e, i) : !!n && n.has(i)
        },
        set: function(i, o) {
            ac && i && (typeof i == "object" || typeof i == "function") ? (e || (e = new ac),
            sAe(e, i, o)) : wp && (n || (n = wp()),
            n.set(i, o))
        }
    };
    return r
}
: wp
  , uAe = Cu
  , fAe = bm
  , dAe = USe
  , hAe = pF
  , pAe = cAe
  , gAe = pAe || hAe || dAe
  , mAe = function() {
    var e, n = {
        assert: function(r) {
            if (!n.has(r))
                throw new uAe("Side channel does not contain " + fAe(r))
        },
        delete: function(r) {
            return !!e && e.delete(r)
        },
        get: function(r) {
            return e && e.get(r)
        },
        has: function(r) {
            return !!e && e.has(r)
        },
        set: function(r, i) {
            e || (e = gAe()),
            e.set(r, i)
        }
    };
    return n
}
  , vAe = String.prototype.replace
  , yAe = /%20/g
  , ey = {
    RFC1738: "RFC1738",
    RFC3986: "RFC3986"
}
  , xE = {
    default: ey.RFC3986,
    formatters: {
        RFC1738: function(t) {
            return vAe.call(t, yAe, "+")
        },
        RFC3986: function(t) {
            return String(t)
        }
    },
    RFC1738: ey.RFC1738,
    RFC3986: ey.RFC3986
}
  , _Ae = xE
  , ty = Object.prototype.hasOwnProperty
  , La = Array.isArray
  , Yi = function() {
    for (var t = [], e = 0; e < 256; ++e)
        t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
    return t
}()
  , xAe = function(e) {
    for (; e.length > 1; ) {
        var n = e.pop()
          , r = n.obj[n.prop];
        if (La(r)) {
            for (var i = [], o = 0; o < r.length; ++o)
                typeof r[o] < "u" && i.push(r[o]);
            n.obj[n.prop] = i
        }
    }
}
  , gF = function(e, n) {
    for (var r = n && n.plainObjects ? {
        __proto__: null
    } : {}, i = 0; i < e.length; ++i)
        typeof e[i] < "u" && (r[i] = e[i]);
    return r
}
  , bAe = function t(e, n, r) {
    if (!n)
        return e;
    if (typeof n != "object" && typeof n != "function") {
        if (La(e))
            e.push(n);
        else if (e && typeof e == "object")
            (r && (r.plainObjects || r.allowPrototypes) || !ty.call(Object.prototype, n)) && (e[n] = !0);
        else
            return [e, n];
        return e
    }
    if (!e || typeof e != "object")
        return [e].concat(n);
    var i = e;
    return La(e) && !La(n) && (i = gF(e, r)),
    La(e) && La(n) ? (n.forEach(function(o, s) {
        if (ty.call(e, s)) {
            var a = e[s];
            a && typeof a == "object" && o && typeof o == "object" ? e[s] = t(a, o, r) : e.push(o)
        } else
            e[s] = o
    }),
    e) : Object.keys(n).reduce(function(o, s) {
        var a = n[s];
        return ty.call(o, s) ? o[s] = t(o[s], a, r) : o[s] = a,
        o
    }, i)
}
  , wAe = function(e, n) {
    return Object.keys(n).reduce(function(r, i) {
        return r[i] = n[i],
        r
    }, e)
}
  , EAe = function(t, e, n) {
    var r = t.replace(/\+/g, " ");
    if (n === "iso-8859-1")
        return r.replace(/%[0-9a-f]{2}/gi, unescape);
    try {
        return decodeURIComponent(r)
    } catch {
        return r
    }
}
  , ny = 1024
  , SAe = function(e, n, r, i, o) {
    if (e.length === 0)
        return e;
    var s = e;
    if (typeof e == "symbol" ? s = Symbol.prototype.toString.call(e) : typeof e != "string" && (s = String(e)),
    r === "iso-8859-1")
        return escape(s).replace(/%u[0-9a-f]{4}/gi, function(h) {
            return "%26%23" + parseInt(h.slice(2), 16) + "%3B"
        });
    for (var a = "", l = 0; l < s.length; l += ny) {
        for (var c = s.length >= ny ? s.slice(l, l + ny) : s, u = [], f = 0; f < c.length; ++f) {
            var d = c.charCodeAt(f);
            if (d === 45 || d === 46 || d === 95 || d === 126 || d >= 48 && d <= 57 || d >= 65 && d <= 90 || d >= 97 && d <= 122 || o === _Ae.RFC1738 && (d === 40 || d === 41)) {
                u[u.length] = c.charAt(f);
                continue
            }
            if (d < 128) {
                u[u.length] = Yi[d];
                continue
            }
            if (d < 2048) {
                u[u.length] = Yi[192 | d >> 6] + Yi[128 | d & 63];
                continue
            }
            if (d < 55296 || d >= 57344) {
                u[u.length] = Yi[224 | d >> 12] + Yi[128 | d >> 6 & 63] + Yi[128 | d & 63];
                continue
            }
            f += 1,
            d = 65536 + ((d & 1023) << 10 | c.charCodeAt(f) & 1023),
            u[u.length] = Yi[240 | d >> 18] + Yi[128 | d >> 12 & 63] + Yi[128 | d >> 6 & 63] + Yi[128 | d & 63]
        }
        a += u.join("")
    }
    return a
}
  , CAe = function(e) {
    for (var n = [{
        obj: {
            o: e
        },
        prop: "o"
    }], r = [], i = 0; i < n.length; ++i)
        for (var o = n[i], s = o.obj[o.prop], a = Object.keys(s), l = 0; l < a.length; ++l) {
            var c = a[l]
              , u = s[c];
            typeof u == "object" && u !== null && r.indexOf(u) === -1 && (n.push({
                obj: s,
                prop: c
            }),
            r.push(u))
        }
    return xAe(n),
    e
}
  , AAe = function(e) {
    return Object.prototype.toString.call(e) === "[object RegExp]"
}
  , TAe = function(e) {
    return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e))
}
  , PAe = function(e, n) {
    return [].concat(e, n)
}
  , IAe = function(e, n) {
    if (La(e)) {
        for (var r = [], i = 0; i < e.length; i += 1)
            r.push(n(e[i]));
        return r
    }
    return n(e)
}
  , mF = {
    arrayToObject: gF,
    assign: wAe,
    combine: PAe,
    compact: CAe,
    decode: EAe,
    encode: SAe,
    isBuffer: TAe,
    isRegExp: AAe,
    maybeMap: IAe,
    merge: bAe
}
  , vF = mAe
  , Kp = mF
  , $f = xE
  , OAe = Object.prototype.hasOwnProperty
  , yF = {
    brackets: function(e) {
        return e + "[]"
    },
    comma: "comma",
    indices: function(e, n) {
        return e + "[" + n + "]"
    },
    repeat: function(e) {
        return e
    }
}
  , Qi = Array.isArray
  , RAe = Array.prototype.push
  , _F = function(t, e) {
    RAe.apply(t, Qi(e) ? e : [e])
}
  , MAe = Date.prototype.toISOString
  , II = $f.default
  , vn = {
    addQueryPrefix: !1,
    allowDots: !1,
    allowEmptyArrays: !1,
    arrayFormat: "indices",
    charset: "utf-8",
    charsetSentinel: !1,
    commaRoundTrip: !1,
    delimiter: "&",
    encode: !0,
    encodeDotInKeys: !1,
    encoder: Kp.encode,
    encodeValuesOnly: !1,
    filter: void 0,
    format: II,
    formatter: $f.formatters[II],
    indices: !1,
    serializeDate: function(e) {
        return MAe.call(e)
    },
    skipNulls: !1,
    strictNullHandling: !1
}
  , DAe = function(e) {
    return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint"
}
  , ry = {}
  , BAe = function t(e, n, r, i, o, s, a, l, c, u, f, d, h, p, y, v, g, m) {
    for (var _ = e, x = m, b = 0, w = !1; (x = x.get(ry)) !== void 0 && !w; ) {
        var E = x.get(e);
        if (b += 1,
        typeof E < "u") {
            if (E === b)
                throw new RangeError("Cyclic object value");
            w = !0
        }
        typeof x.get(ry) > "u" && (b = 0)
    }
    if (typeof u == "function" ? _ = u(n, _) : _ instanceof Date ? _ = h(_) : r === "comma" && Qi(_) && (_ = Kp.maybeMap(_, function(fe) {
        return fe instanceof Date ? h(fe) : fe
    })),
    _ === null) {
        if (s)
            return c && !v ? c(n, vn.encoder, g, "key", p) : n;
        _ = ""
    }
    if (DAe(_) || Kp.isBuffer(_)) {
        if (c) {
            var S = v ? n : c(n, vn.encoder, g, "key", p);
            return [y(S) + "=" + y(c(_, vn.encoder, g, "value", p))]
        }
        return [y(n) + "=" + y(String(_))]
    }
    var P = [];
    if (typeof _ > "u")
        return P;
    var C;
    if (r === "comma" && Qi(_))
        v && c && (_ = Kp.maybeMap(_, c)),
        C = [{
            value: _.length > 0 ? _.join(",") || null : void 0
        }];
    else if (Qi(u))
        C = u;
    else {
        var A = Object.keys(_);
        C = f ? A.sort(f) : A
    }
    var T = l ? String(n).replace(/\./g, "%2E") : String(n)
      , I = i && Qi(_) && _.length === 1 ? T + "[]" : T;
    if (o && Qi(_) && _.length === 0)
        return I + "[]";
    for (var B = 0; B < C.length; ++B) {
        var G = C[B]
          , N = typeof G == "object" && G && typeof G.value < "u" ? G.value : _[G];
        if (!(a && N === null)) {
            var U = d && l ? String(G).replace(/\./g, "%2E") : String(G)
              , W = Qi(_) ? typeof r == "function" ? r(I, U) : I : I + (d ? "." + U : "[" + U + "]");
            m.set(e, b);
            var K = vF();
            K.set(ry, m),
            _F(P, t(N, W, r, i, o, s, a, l, r === "comma" && v && Qi(_) ? null : c, u, f, d, h, p, y, v, g, K))
        }
    }
    return P
}
  , kAe = function(e) {
    if (!e)
        return vn;
    if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
        throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
    if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean")
        throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
    if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
        throw new TypeError("Encoder has to be a function.");
    var n = e.charset || vn.charset;
    if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
        throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
    var r = $f.default;
    if (typeof e.format < "u") {
        if (!OAe.call($f.formatters, e.format))
            throw new TypeError("Unknown format option provided.");
        r = e.format
    }
    var i = $f.formatters[r]
      , o = vn.filter;
    (typeof e.filter == "function" || Qi(e.filter)) && (o = e.filter);
    var s;
    if (e.arrayFormat in yF ? s = e.arrayFormat : "indices"in e ? s = e.indices ? "indices" : "repeat" : s = vn.arrayFormat,
    "commaRoundTrip"in e && typeof e.commaRoundTrip != "boolean")
        throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
    var a = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : vn.allowDots : !!e.allowDots;
    return {
        addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : vn.addQueryPrefix,
        allowDots: a,
        allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : vn.allowEmptyArrays,
        arrayFormat: s,
        charset: n,
        charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : vn.charsetSentinel,
        commaRoundTrip: !!e.commaRoundTrip,
        delimiter: typeof e.delimiter > "u" ? vn.delimiter : e.delimiter,
        encode: typeof e.encode == "boolean" ? e.encode : vn.encode,
        encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : vn.encodeDotInKeys,
        encoder: typeof e.encoder == "function" ? e.encoder : vn.encoder,
        encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : vn.encodeValuesOnly,
        filter: o,
        format: r,
        formatter: i,
        serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : vn.serializeDate,
        skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : vn.skipNulls,
        sort: typeof e.sort == "function" ? e.sort : null,
        strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : vn.strictNullHandling
    }
}
  , NAe = function(t, e) {
    var n = t, r = kAe(e), i, o;
    typeof r.filter == "function" ? (o = r.filter,
    n = o("", n)) : Qi(r.filter) && (o = r.filter,
    i = o);
    var s = [];
    if (typeof n != "object" || n === null)
        return "";
    var a = yF[r.arrayFormat]
      , l = a === "comma" && r.commaRoundTrip;
    i || (i = Object.keys(n)),
    r.sort && i.sort(r.sort);
    for (var c = vF(), u = 0; u < i.length; ++u) {
        var f = i[u]
          , d = n[f];
        r.skipNulls && d === null || _F(s, BAe(d, f, a, l, r.allowEmptyArrays, r.strictNullHandling, r.skipNulls, r.encodeDotInKeys, r.encode ? r.encoder : null, r.filter, r.sort, r.allowDots, r.serializeDate, r.format, r.formatter, r.encodeValuesOnly, r.charset, c))
    }
    var h = s.join(r.delimiter)
      , p = r.addQueryPrefix === !0 ? "?" : "";
    return r.charsetSentinel && (r.charset === "iso-8859-1" ? p += "utf8=%26%2310003%3B&" : p += "utf8=%E2%9C%93&"),
    h.length > 0 ? p + h : ""
}
  , Al = mF
  , $x = Object.prototype.hasOwnProperty
  , OI = Array.isArray
  , qt = {
    allowDots: !1,
    allowEmptyArrays: !1,
    allowPrototypes: !1,
    allowSparse: !1,
    arrayLimit: 20,
    charset: "utf-8",
    charsetSentinel: !1,
    comma: !1,
    decodeDotInKeys: !1,
    decoder: Al.decode,
    delimiter: "&",
    depth: 5,
    duplicates: "combine",
    ignoreQueryPrefix: !1,
    interpretNumericEntities: !1,
    parameterLimit: 1e3,
    parseArrays: !0,
    plainObjects: !1,
    strictDepth: !1,
    strictNullHandling: !1,
    throwOnLimitExceeded: !1
}
  , FAe = function(t) {
    return t.replace(/&#(\d+);/g, function(e, n) {
        return String.fromCharCode(parseInt(n, 10))
    })
}
  , xF = function(t, e, n) {
    if (t && typeof t == "string" && e.comma && t.indexOf(",") > -1)
        return t.split(",");
    if (e.throwOnLimitExceeded && n >= e.arrayLimit)
        throw new RangeError("Array limit exceeded. Only " + e.arrayLimit + " element" + (e.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
    return t
}
  , LAe = "utf8=%26%2310003%3B"
  , $Ae = "utf8=%E2%9C%93"
  , UAe = function(e, n) {
    var r = {
        __proto__: null
    }
      , i = n.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
    i = i.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
    var o = n.parameterLimit === 1 / 0 ? void 0 : n.parameterLimit
      , s = i.split(n.delimiter, n.throwOnLimitExceeded ? o + 1 : o);
    if (n.throwOnLimitExceeded && s.length > o)
        throw new RangeError("Parameter limit exceeded. Only " + o + " parameter" + (o === 1 ? "" : "s") + " allowed.");
    var a = -1, l, c = n.charset;
    if (n.charsetSentinel)
        for (l = 0; l < s.length; ++l)
            s[l].indexOf("utf8=") === 0 && (s[l] === $Ae ? c = "utf-8" : s[l] === LAe && (c = "iso-8859-1"),
            a = l,
            l = s.length);
    for (l = 0; l < s.length; ++l)
        if (l !== a) {
            var u = s[l], f = u.indexOf("]="), d = f === -1 ? u.indexOf("=") : f + 1, h, p;
            d === -1 ? (h = n.decoder(u, qt.decoder, c, "key"),
            p = n.strictNullHandling ? null : "") : (h = n.decoder(u.slice(0, d), qt.decoder, c, "key"),
            p = Al.maybeMap(xF(u.slice(d + 1), n, OI(r[h]) ? r[h].length : 0), function(v) {
                return n.decoder(v, qt.decoder, c, "value")
            })),
            p && n.interpretNumericEntities && c === "iso-8859-1" && (p = FAe(String(p))),
            u.indexOf("[]=") > -1 && (p = OI(p) ? [p] : p);
            var y = $x.call(r, h);
            y && n.duplicates === "combine" ? r[h] = Al.combine(r[h], p) : (!y || n.duplicates === "last") && (r[h] = p)
        }
    return r
}
  , GAe = function(t, e, n, r) {
    var i = 0;
    if (t.length > 0 && t[t.length - 1] === "[]") {
        var o = t.slice(0, -1).join("");
        i = Array.isArray(e) && e[o] ? e[o].length : 0
    }
    for (var s = r ? e : xF(e, n, i), a = t.length - 1; a >= 0; --a) {
        var l, c = t[a];
        if (c === "[]" && n.parseArrays)
            l = n.allowEmptyArrays && (s === "" || n.strictNullHandling && s === null) ? [] : Al.combine([], s);
        else {
            l = n.plainObjects ? {
                __proto__: null
            } : {};
            var u = c.charAt(0) === "[" && c.charAt(c.length - 1) === "]" ? c.slice(1, -1) : c
              , f = n.decodeDotInKeys ? u.replace(/%2E/g, ".") : u
              , d = parseInt(f, 10);
            !n.parseArrays && f === "" ? l = {
                0: s
            } : !isNaN(d) && c !== f && String(d) === f && d >= 0 && n.parseArrays && d <= n.arrayLimit ? (l = [],
            l[d] = s) : f !== "__proto__" && (l[f] = s)
        }
        s = l
    }
    return s
}
  , HAe = function(e, n, r, i) {
    if (e) {
        var o = r.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e
          , s = /(\[[^[\]]*])/
          , a = /(\[[^[\]]*])/g
          , l = r.depth > 0 && s.exec(o)
          , c = l ? o.slice(0, l.index) : o
          , u = [];
        if (c) {
            if (!r.plainObjects && $x.call(Object.prototype, c) && !r.allowPrototypes)
                return;
            u.push(c)
        }
        for (var f = 0; r.depth > 0 && (l = a.exec(o)) !== null && f < r.depth; ) {
            if (f += 1,
            !r.plainObjects && $x.call(Object.prototype, l[1].slice(1, -1)) && !r.allowPrototypes)
                return;
            u.push(l[1])
        }
        if (l) {
            if (r.strictDepth === !0)
                throw new RangeError("Input depth exceeded depth option of " + r.depth + " and strictDepth is true");
            u.push("[" + o.slice(l.index) + "]")
        }
        return GAe(u, n, r, i)
    }
}
  , VAe = function(e) {
    if (!e)
        return qt;
    if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
        throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
    if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean")
        throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
    if (e.decoder !== null && typeof e.decoder < "u" && typeof e.decoder != "function")
        throw new TypeError("Decoder has to be a function.");
    if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
        throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
    if (typeof e.throwOnLimitExceeded < "u" && typeof e.throwOnLimitExceeded != "boolean")
        throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
    var n = typeof e.charset > "u" ? qt.charset : e.charset
      , r = typeof e.duplicates > "u" ? qt.duplicates : e.duplicates;
    if (r !== "combine" && r !== "first" && r !== "last")
        throw new TypeError("The duplicates option must be either combine, first, or last");
    var i = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : qt.allowDots : !!e.allowDots;
    return {
        allowDots: i,
        allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : qt.allowEmptyArrays,
        allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : qt.allowPrototypes,
        allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : qt.allowSparse,
        arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : qt.arrayLimit,
        charset: n,
        charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : qt.charsetSentinel,
        comma: typeof e.comma == "boolean" ? e.comma : qt.comma,
        decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : qt.decodeDotInKeys,
        decoder: typeof e.decoder == "function" ? e.decoder : qt.decoder,
        delimiter: typeof e.delimiter == "string" || Al.isRegExp(e.delimiter) ? e.delimiter : qt.delimiter,
        depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : qt.depth,
        duplicates: r,
        ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
        interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : qt.interpretNumericEntities,
        parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : qt.parameterLimit,
        parseArrays: e.parseArrays !== !1,
        plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : qt.plainObjects,
        strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : qt.strictDepth,
        strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : qt.strictNullHandling,
        throwOnLimitExceeded: typeof e.throwOnLimitExceeded == "boolean" ? e.throwOnLimitExceeded : !1
    }
}
  , zAe = function(t, e) {
    var n = VAe(e);
    if (t === "" || t === null || typeof t > "u")
        return n.plainObjects ? {
            __proto__: null
        } : {};
    for (var r = typeof t == "string" ? UAe(t, n) : t, i = n.plainObjects ? {
        __proto__: null
    } : {}, o = Object.keys(r), s = 0; s < o.length; ++s) {
        var a = o[s]
          , l = HAe(a, r[a], n, typeof t == "string");
        i = Al.merge(i, l, n)
    }
    return n.allowSparse === !0 ? i : Al.compact(i)
}
  , jAe = NAe
  , WAe = zAe
  , YAe = xE
  , XAe = {
    formats: YAe,
    parse: WAe,
    stringify: jAe
};
const jPe = hu(XAe);
class KAe extends F2 {
    constructor() {
        super(),
        this.handleVisibilityChange = () => {
            const e = {
                isActive: document.hidden !== !0
            };
            this.notifyListeners("appStateChange", e),
            document.hidden ? this.notifyListeners("pause", null) : this.notifyListeners("resume", null)
        }
        ,
        document.addEventListener("visibilitychange", this.handleVisibilityChange, !1)
    }
    exitApp() {
        throw this.unimplemented("Not implemented on web.")
    }
    async getInfo() {
        throw this.unimplemented("Not implemented on web.")
    }
    async getLaunchUrl() {
        return {
            url: ""
        }
    }
    async getState() {
        return {
            isActive: document.hidden !== !0
        }
    }
    async minimizeApp() {
        throw this.unimplemented("Not implemented on web.")
    }
    async toggleBackButtonHandler() {
        throw this.unimplemented("Not implemented on web.")
    }
}
const qAe = Object.freeze(Object.defineProperty({
    __proto__: null,
    AppWeb: KAe
}, Symbol.toStringTag, {
    value: "Module"
}));
var RI = function() {
    return RI = Object.assign || function(e) {
        for (var n, r = 1, i = arguments.length; r < i; r++) {
            n = arguments[r];
            for (var o in n)
                Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o])
        }
        return e
    }
    ,
    RI.apply(this, arguments)
};
function WPe(t, e, n, r) {
    function i(o) {
        return o instanceof n ? o : new n(function(s) {
            s(o)
        }
        )
    }
    return new (n || (n = Promise))(function(o, s) {
        function a(u) {
            try {
                c(r.next(u))
            } catch (f) {
                s(f)
            }
        }
        function l(u) {
            try {
                c(r.throw(u))
            } catch (f) {
                s(f)
            }
        }
        function c(u) {
            u.done ? o(u.value) : i(u.value).then(a, l)
        }
        c((r = r.apply(t, e || [])).next())
    }
    )
}
function YPe(t, e) {
    var n = {
        label: 0,
        sent: function() {
            if (o[0] & 1)
                throw o[1];
            return o[1]
        },
        trys: [],
        ops: []
    }, r, i, o, s = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
    return s.next = a(0),
    s.throw = a(1),
    s.return = a(2),
    typeof Symbol == "function" && (s[Symbol.iterator] = function() {
        return this
    }
    ),
    s;
    function a(c) {
        return function(u) {
            return l([c, u])
        }
    }
    function l(c) {
        if (r)
            throw new TypeError("Generator is already executing.");
        for (; s && (s = 0,
        c[0] && (n = 0)),
        n; )
            try {
                if (r = 1,
                i && (o = c[0] & 2 ? i.return : c[0] ? i.throw || ((o = i.return) && o.call(i),
                0) : i.next) && !(o = o.call(i, c[1])).done)
                    return o;
                switch (i = 0,
                o && (c = [c[0] & 2, o.value]),
                c[0]) {
                case 0:
                case 1:
                    o = c;
                    break;
                case 4:
                    return n.label++,
                    {
                        value: c[1],
                        done: !1
                    };
                case 5:
                    n.label++,
                    i = c[1],
                    c = [0];
                    continue;
                case 7:
                    c = n.ops.pop(),
                    n.trys.pop();
                    continue;
                default:
                    if (o = n.trys,
                    !(o = o.length > 0 && o[o.length - 1]) && (c[0] === 6 || c[0] === 2)) {
                        n = 0;
                        continue
                    }
                    if (c[0] === 3 && (!o || c[1] > o[0] && c[1] < o[3])) {
                        n.label = c[1];
                        break
                    }
                    if (c[0] === 6 && n.label < o[1]) {
                        n.label = o[1],
                        o = c;
                        break
                    }
                    if (o && n.label < o[2]) {
                        n.label = o[2],
                        n.ops.push(c);
                        break
                    }
                    o[2] && n.ops.pop(),
                    n.trys.pop();
                    continue
                }
                c = e.call(t, n)
            } catch (u) {
                c = [6, u],
                i = 0
            } finally {
                r = o = 0
            }
        if (c[0] & 5)
            throw c[1];
        return {
            value: c[0] ? c[1] : void 0,
            done: !0
        }
    }
}
function XPe(t, e, n) {
    if (n || arguments.length === 2)
        for (var r = 0, i = e.length, o; r < i; r++)
            (o || !(r in e)) && (o || (o = Array.prototype.slice.call(e, 0, r)),
            o[r] = e[r]);
    return t.concat(o || Array.prototype.slice.call(e))
}
function ZAe(t, e) {
    if (t.match(/^[a-z]+:\/\//i))
        return t;
    if (t.match(/^\/\//))
        return window.location.protocol + t;
    if (t.match(/^[a-z]+:/i))
        return t;
    const n = document.implementation.createHTMLDocument()
      , r = n.createElement("base")
      , i = n.createElement("a");
    return n.head.appendChild(r),
    n.body.appendChild(i),
    e && (r.href = e),
    i.href = t,
    i.href
}
const JAe = ( () => {
    let t = 0;
    const e = () => `0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4);
    return () => (t += 1,
    `u${e()}${t}`)
}
)();
function Zs(t) {
    const e = [];
    for (let n = 0, r = t.length; n < r; n++)
        e.push(t[n]);
    return e
}
let lc = null;
function bF(t={}) {
    return lc || (t.includeStyleProperties ? (lc = t.includeStyleProperties,
    lc) : (lc = Zs(window.getComputedStyle(document.documentElement)),
    lc))
}
function q0(t, e) {
    const r = (t.ownerDocument.defaultView || window).getComputedStyle(t).getPropertyValue(e);
    return r ? parseFloat(r.replace("px", "")) : 0
}
function QAe(t) {
    const e = q0(t, "border-left-width")
      , n = q0(t, "border-right-width");
    return t.clientWidth + e + n
}
function eTe(t) {
    const e = q0(t, "border-top-width")
      , n = q0(t, "border-bottom-width");
    return t.clientHeight + e + n
}
function bE(t, e={}) {
    const n = e.width || QAe(t)
      , r = e.height || eTe(t);
    return {
        width: n,
        height: r
    }
}
function tTe() {
    let t, e;
    try {
        e = process
    } catch {}
    const n = e && e.env ? e.env.devicePixelRatio : null;
    return n && (t = parseInt(n, 10),
    Number.isNaN(t) && (t = 1)),
    t || window.devicePixelRatio || 1
}
const kr = 16384;
function nTe(t) {
    (t.width > kr || t.height > kr) && (t.width > kr && t.height > kr ? t.width > t.height ? (t.height *= kr / t.width,
    t.width = kr) : (t.width *= kr / t.height,
    t.height = kr) : t.width > kr ? (t.height *= kr / t.width,
    t.width = kr) : (t.width *= kr / t.height,
    t.height = kr))
}
function rTe(t, e={}) {
    return t.toBlob ? new Promise(n => {
        t.toBlob(n, e.type ? e.type : "image/png", e.quality ? e.quality : 1)
    }
    ) : new Promise(n => {
        const r = window.atob(t.toDataURL(e.type ? e.type : void 0, e.quality ? e.quality : void 0).split(",")[1])
          , i = r.length
          , o = new Uint8Array(i);
        for (let s = 0; s < i; s += 1)
            o[s] = r.charCodeAt(s);
        n(new Blob([o],{
            type: e.type ? e.type : "image/png"
        }))
    }
    )
}
function Z0(t) {
    return new Promise( (e, n) => {
        const r = new Image;
        r.onload = () => {
            r.decode().then( () => {
                requestAnimationFrame( () => e(r))
            }
            )
        }
        ,
        r.onerror = n,
        r.crossOrigin = "anonymous",
        r.decoding = "async",
        r.src = t
    }
    )
}
async function iTe(t) {
    return Promise.resolve().then( () => new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e => `data:image/svg+xml;charset=utf-8,${e}`)
}
async function oTe(t, e, n) {
    const r = "http://www.w3.org/2000/svg"
      , i = document.createElementNS(r, "svg")
      , o = document.createElementNS(r, "foreignObject");
    return i.setAttribute("width", `${e}`),
    i.setAttribute("height", `${n}`),
    i.setAttribute("viewBox", `0 0 ${e} ${n}`),
    o.setAttribute("width", "100%"),
    o.setAttribute("height", "100%"),
    o.setAttribute("x", "0"),
    o.setAttribute("y", "0"),
    o.setAttribute("externalResourcesRequired", "true"),
    i.appendChild(o),
    o.appendChild(t),
    iTe(i)
}
const Or = (t, e) => {
    if (t instanceof e)
        return !0;
    const n = Object.getPrototypeOf(t);
    return n === null ? !1 : n.constructor.name === e.name || Or(n, e)
}
;
function sTe(t) {
    const e = t.getPropertyValue("content");
    return `${t.cssText} content: '${e.replace(/'|"/g, "")}';`
}
function aTe(t, e) {
    return bF(e).map(n => {
        const r = t.getPropertyValue(n)
          , i = t.getPropertyPriority(n);
        return `${n}: ${r}${i ? " !important" : ""};`
    }
    ).join(" ")
}
function lTe(t, e, n, r) {
    const i = `.${t}:${e}`
      , o = n.cssText ? sTe(n) : aTe(n, r);
    return document.createTextNode(`${i}{${o}}`)
}
function MI(t, e, n, r) {
    const i = window.getComputedStyle(t, n)
      , o = i.getPropertyValue("content");
    if (o === "" || o === "none")
        return;
    const s = JAe();
    try {
        e.className = `${e.className} ${s}`
    } catch {
        return
    }
    const a = document.createElement("style");
    a.appendChild(lTe(s, n, i, r)),
    e.appendChild(a)
}
function cTe(t, e, n) {
    MI(t, e, ":before", n),
    MI(t, e, ":after", n)
}
const DI = "application/font-woff"
  , BI = "image/jpeg"
  , uTe = {
    woff: DI,
    woff2: DI,
    ttf: "application/font-truetype",
    eot: "application/vnd.ms-fontobject",
    png: "image/png",
    jpg: BI,
    jpeg: BI,
    gif: "image/gif",
    tiff: "image/tiff",
    svg: "image/svg+xml",
    webp: "image/webp"
};
function fTe(t) {
    const e = /\.([^./]*?)$/g.exec(t);
    return e ? e[1] : ""
}
function wE(t) {
    const e = fTe(t).toLowerCase();
    return uTe[e] || ""
}
function dTe(t) {
    return t.split(/,/)[1]
}
function Ux(t) {
    return t.search(/^(data:)/) !== -1
}
function wF(t, e) {
    return `data:${e};base64,${t}`
}
async function EF(t, e, n) {
    const r = await fetch(t, e);
    if (r.status === 404)
        throw new Error(`Resource "${r.url}" not found`);
    const i = await r.blob();
    return new Promise( (o, s) => {
        const a = new FileReader;
        a.onerror = s,
        a.onloadend = () => {
            try {
                o(n({
                    res: r,
                    result: a.result
                }))
            } catch (l) {
                s(l)
            }
        }
        ,
        a.readAsDataURL(i)
    }
    )
}
const iy = {};
function hTe(t, e, n) {
    let r = t.replace(/\?.*/, "");
    return n && (r = t),
    /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")),
    e ? `[${e}]${r}` : r
}
async function EE(t, e, n) {
    const r = hTe(t, e, n.includeQueryParams);
    if (iy[r] != null)
        return iy[r];
    n.cacheBust && (t += (/\?/.test(t) ? "&" : "?") + new Date().getTime());
    let i;
    try {
        const o = await EF(t, n.fetchRequestInit, ({res: s, result: a}) => (e || (e = s.headers.get("Content-Type") || ""),
        dTe(a)));
        i = wF(o, e)
    } catch (o) {
        i = n.imagePlaceholder || "";
        let s = `Failed to fetch resource: ${t}`;
        o && (s = typeof o == "string" ? o : o.message),
        s && console.warn(s)
    }
    return iy[r] = i,
    i
}
async function pTe(t) {
    const e = t.toDataURL();
    return e === "data:," ? t.cloneNode(!1) : Z0(e)
}
async function gTe(t, e) {
    if (t.currentSrc) {
        const o = document.createElement("canvas")
          , s = o.getContext("2d");
        o.width = t.clientWidth,
        o.height = t.clientHeight,
        s == null || s.drawImage(t, 0, 0, o.width, o.height);
        const a = o.toDataURL();
        return Z0(a)
    }
    const n = t.poster
      , r = wE(n)
      , i = await EE(n, r, e);
    return Z0(i)
}
async function mTe(t, e) {
    var n;
    try {
        if (!((n = t == null ? void 0 : t.contentDocument) === null || n === void 0) && n.body)
            return await Cm(t.contentDocument.body, e, !0)
    } catch {}
    return t.cloneNode(!1)
}
async function vTe(t, e) {
    return Or(t, HTMLCanvasElement) ? pTe(t) : Or(t, HTMLVideoElement) ? gTe(t, e) : Or(t, HTMLIFrameElement) ? mTe(t, e) : t.cloneNode(SF(t))
}
const yTe = t => t.tagName != null && t.tagName.toUpperCase() === "SLOT"
  , SF = t => t.tagName != null && t.tagName.toUpperCase() === "SVG";
async function _Te(t, e, n) {
    var r, i;
    if (SF(e))
        return e;
    let o = [];
    return yTe(t) && t.assignedNodes ? o = Zs(t.assignedNodes()) : Or(t, HTMLIFrameElement) && (!((r = t.contentDocument) === null || r === void 0) && r.body) ? o = Zs(t.contentDocument.body.childNodes) : o = Zs(((i = t.shadowRoot) !== null && i !== void 0 ? i : t).childNodes),
    o.length === 0 || Or(t, HTMLVideoElement) || await o.reduce( (s, a) => s.then( () => Cm(a, n)).then(l => {
        l && e.appendChild(l)
    }
    ), Promise.resolve()),
    e
}
function xTe(t, e, n) {
    const r = e.style;
    if (!r)
        return;
    const i = window.getComputedStyle(t);
    i.cssText ? (r.cssText = i.cssText,
    r.transformOrigin = i.transformOrigin) : bF(n).forEach(o => {
        let s = i.getPropertyValue(o);
        o === "font-size" && s.endsWith("px") && (s = `${Math.floor(parseFloat(s.substring(0, s.length - 2))) - .1}px`),
        Or(t, HTMLIFrameElement) && o === "display" && s === "inline" && (s = "block"),
        o === "d" && e.getAttribute("d") && (s = `path(${e.getAttribute("d")})`),
        r.setProperty(o, s, i.getPropertyPriority(o))
    }
    )
}
function bTe(t, e) {
    Or(t, HTMLTextAreaElement) && (e.innerHTML = t.value),
    Or(t, HTMLInputElement) && e.setAttribute("value", t.value)
}
function wTe(t, e) {
    if (Or(t, HTMLSelectElement)) {
        const n = e
          , r = Array.from(n.children).find(i => t.value === i.getAttribute("value"));
        r && r.setAttribute("selected", "")
    }
}
function ETe(t, e, n) {
    return Or(e, Element) && (xTe(t, e, n),
    cTe(t, e, n),
    bTe(t, e),
    wTe(t, e)),
    e
}
async function STe(t, e) {
    const n = t.querySelectorAll ? t.querySelectorAll("use") : [];
    if (n.length === 0)
        return t;
    const r = {};
    for (let o = 0; o < n.length; o++) {
        const a = n[o].getAttribute("xlink:href");
        if (a) {
            const l = t.querySelector(a)
              , c = document.querySelector(a);
            !l && c && !r[a] && (r[a] = await Cm(c, e, !0))
        }
    }
    const i = Object.values(r);
    if (i.length) {
        const o = "http://www.w3.org/1999/xhtml"
          , s = document.createElementNS(o, "svg");
        s.setAttribute("xmlns", o),
        s.style.position = "absolute",
        s.style.width = "0",
        s.style.height = "0",
        s.style.overflow = "hidden",
        s.style.display = "none";
        const a = document.createElementNS(o, "defs");
        s.appendChild(a);
        for (let l = 0; l < i.length; l++)
            a.appendChild(i[l]);
        t.appendChild(s)
    }
    return t
}
async function Cm(t, e, n) {
    return !n && e.filter && !e.filter(t) ? null : Promise.resolve(t).then(r => vTe(r, e)).then(r => _Te(t, r, e)).then(r => ETe(t, r, e)).then(r => STe(r, e))
}
const CF = /url\((['"]?)([^'"]+?)\1\)/g
  , CTe = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g
  , ATe = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
function TTe(t) {
    const e = t.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
    return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")
}
function PTe(t) {
    const e = [];
    return t.replace(CF, (n, r, i) => (e.push(i),
    n)),
    e.filter(n => !Ux(n))
}
async function ITe(t, e, n, r, i) {
    try {
        const o = n ? ZAe(e, n) : e
          , s = wE(e);
        let a;
        if (i) {
            const l = await i(o);
            a = wF(l, s)
        } else
            a = await EE(o, s, r);
        return t.replace(TTe(e), `$1${a}$3`)
    } catch {}
    return t
}
function OTe(t, {preferredFontFormat: e}) {
    return e ? t.replace(ATe, n => {
        for (; ; ) {
            const [r,,i] = CTe.exec(n) || [];
            if (!i)
                return "";
            if (i === e)
                return `src: ${r};`
        }
    }
    ) : t
}
function AF(t) {
    return t.search(CF) !== -1
}
async function TF(t, e, n) {
    if (!AF(t))
        return t;
    const r = OTe(t, n);
    return PTe(r).reduce( (o, s) => o.then(a => ITe(a, s, e, n)), Promise.resolve(r))
}
async function cc(t, e, n) {
    var r;
    const i = (r = e.style) === null || r === void 0 ? void 0 : r.getPropertyValue(t);
    if (i) {
        const o = await TF(i, null, n);
        return e.style.setProperty(t, o, e.style.getPropertyPriority(t)),
        !0
    }
    return !1
}
async function RTe(t, e) {
    await cc("background", t, e) || await cc("background-image", t, e),
    await cc("mask", t, e) || await cc("-webkit-mask", t, e) || await cc("mask-image", t, e) || await cc("-webkit-mask-image", t, e)
}
async function MTe(t, e) {
    const n = Or(t, HTMLImageElement);
    if (!(n && !Ux(t.src)) && !(Or(t, SVGImageElement) && !Ux(t.href.baseVal)))
        return;
    const r = n ? t.src : t.href.baseVal
      , i = await EE(r, wE(r), e);
    await new Promise( (o, s) => {
        t.onload = o,
        t.onerror = e.onImageErrorHandler ? (...l) => {
            try {
                o(e.onImageErrorHandler(...l))
            } catch (c) {
                s(c)
            }
        }
        : s;
        const a = t;
        a.decode && (a.decode = o),
        a.loading === "lazy" && (a.loading = "eager"),
        n ? (t.srcset = "",
        t.src = i) : t.href.baseVal = i
    }
    )
}
async function DTe(t, e) {
    const r = Zs(t.childNodes).map(i => PF(i, e));
    await Promise.all(r).then( () => t)
}
async function PF(t, e) {
    Or(t, Element) && (await RTe(t, e),
    await MTe(t, e),
    await DTe(t, e))
}
function BTe(t, e) {
    const {style: n} = t;
    e.backgroundColor && (n.backgroundColor = e.backgroundColor),
    e.width && (n.width = `${e.width}px`),
    e.height && (n.height = `${e.height}px`);
    const r = e.style;
    return r != null && Object.keys(r).forEach(i => {
        n[i] = r[i]
    }
    ),
    t
}
const kI = {};
async function NI(t) {
    let e = kI[t];
    if (e != null)
        return e;
    const r = await (await fetch(t)).text();
    return e = {
        url: t,
        cssText: r
    },
    kI[t] = e,
    e
}
async function FI(t, e) {
    let n = t.cssText;
    const r = /url\(["']?([^"')]+)["']?\)/g
      , o = (n.match(/url\([^)]+\)/g) || []).map(async s => {
        let a = s.replace(r, "$1");
        return a.startsWith("https://") || (a = new URL(a,t.url).href),
        EF(a, e.fetchRequestInit, ({result: l}) => (n = n.replace(s, `url(${l})`),
        [s, l]))
    }
    );
    return Promise.all(o).then( () => n)
}
function LI(t) {
    if (t == null)
        return [];
    const e = []
      , n = /(\/\*[\s\S]*?\*\/)/gi;
    let r = t.replace(n, "");
    const i = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");
    for (; ; ) {
        const l = i.exec(r);
        if (l === null)
            break;
        e.push(l[0])
    }
    r = r.replace(i, "");
    const o = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi
      , s = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})"
      , a = new RegExp(s,"gi");
    for (; ; ) {
        let l = o.exec(r);
        if (l === null) {
            if (l = a.exec(r),
            l === null)
                break;
            o.lastIndex = a.lastIndex
        } else
            a.lastIndex = o.lastIndex;
        e.push(l[0])
    }
    return e
}
async function kTe(t, e) {
    const n = []
      , r = [];
    return t.forEach(i => {
        if ("cssRules"in i)
            try {
                Zs(i.cssRules || []).forEach( (o, s) => {
                    if (o.type === CSSRule.IMPORT_RULE) {
                        let a = s + 1;
                        const l = o.href
                          , c = NI(l).then(u => FI(u, e)).then(u => LI(u).forEach(f => {
                            try {
                                i.insertRule(f, f.startsWith("@import") ? a += 1 : i.cssRules.length)
                            } catch (d) {
                                console.error("Error inserting rule from remote css", {
                                    rule: f,
                                    error: d
                                })
                            }
                        }
                        )).catch(u => {
                            console.error("Error loading remote css", u.toString())
                        }
                        );
                        r.push(c)
                    }
                }
                )
            } catch (o) {
                const s = t.find(a => a.href == null) || document.styleSheets[0];
                i.href != null && r.push(NI(i.href).then(a => FI(a, e)).then(a => LI(a).forEach(l => {
                    s.insertRule(l, s.cssRules.length)
                }
                )).catch(a => {
                    console.error("Error loading remote stylesheet", a)
                }
                )),
                console.error("Error inlining remote css file", o)
            }
    }
    ),
    Promise.all(r).then( () => (t.forEach(i => {
        if ("cssRules"in i)
            try {
                Zs(i.cssRules || []).forEach(o => {
                    n.push(o)
                }
                )
            } catch (o) {
                console.error(`Error while reading CSS rules from ${i.href}`, o)
            }
    }
    ),
    n))
}
function NTe(t) {
    return t.filter(e => e.type === CSSRule.FONT_FACE_RULE).filter(e => AF(e.style.getPropertyValue("src")))
}
async function FTe(t, e) {
    if (t.ownerDocument == null)
        throw new Error("Provided element is not within a Document");
    const n = Zs(t.ownerDocument.styleSheets)
      , r = await kTe(n, e);
    return NTe(r)
}
function IF(t) {
    return t.trim().replace(/["']/g, "")
}
function LTe(t) {
    const e = new Set;
    function n(r) {
        (r.style.fontFamily || getComputedStyle(r).fontFamily).split(",").forEach(o => {
            e.add(IF(o))
        }
        ),
        Array.from(r.children).forEach(o => {
            o instanceof HTMLElement && n(o)
        }
        )
    }
    return n(t),
    e
}
async function OF(t, e) {
    const n = await FTe(t, e)
      , r = LTe(t);
    return (await Promise.all(n.filter(o => r.has(IF(o.style.fontFamily))).map(o => {
        const s = o.parentStyleSheet ? o.parentStyleSheet.href : null;
        return TF(o.cssText, s, e)
    }
    ))).join(`
`)
}
async function $Te(t, e) {
    const n = e.fontEmbedCSS != null ? e.fontEmbedCSS : e.skipFonts ? null : await OF(t, e);
    if (n) {
        const r = document.createElement("style")
          , i = document.createTextNode(n);
        r.appendChild(i),
        t.firstChild ? t.insertBefore(r, t.firstChild) : t.appendChild(r)
    }
}
async function RF(t, e={}) {
    const {width: n, height: r} = bE(t, e)
      , i = await Cm(t, e, !0);
    return await $Te(i, e),
    await PF(i, e),
    BTe(i, e),
    await oTe(i, n, r)
}
async function gh(t, e={}) {
    const {width: n, height: r} = bE(t, e)
      , i = await RF(t, e)
      , o = await Z0(i)
      , s = document.createElement("canvas")
      , a = s.getContext("2d")
      , l = e.pixelRatio || tTe()
      , c = e.canvasWidth || n
      , u = e.canvasHeight || r;
    return s.width = c * l,
    s.height = u * l,
    e.skipAutoScale || nTe(s),
    s.style.width = `${c}`,
    s.style.height = `${u}`,
    e.backgroundColor && (a.fillStyle = e.backgroundColor,
    a.fillRect(0, 0, s.width, s.height)),
    a.drawImage(o, 0, 0, s.width, s.height),
    s
}
async function UTe(t, e={}) {
    const {width: n, height: r} = bE(t, e);
    return (await gh(t, e)).getContext("2d").getImageData(0, 0, n, r).data
}
async function GTe(t, e={}) {
    return (await gh(t, e)).toDataURL()
}
async function HTe(t, e={}) {
    return (await gh(t, e)).toDataURL("image/jpeg", e.quality || 1)
}
async function VTe(t, e={}) {
    const n = await gh(t, e);
    return await rTe(n)
}
async function zTe(t, e={}) {
    return OF(t, e)
}
const KPe = Object.freeze(Object.defineProperty({
    __proto__: null,
    getFontEmbedCSS: zTe,
    toBlob: VTe,
    toCanvas: gh,
    toJpeg: HTe,
    toPixelData: UTe,
    toPng: GTe,
    toSvg: RF
}, Symbol.toStringTag, {
    value: "Module"
}));
export {ePe as $, qr as A, o3e as B, we as C, M7 as D, T$ as E, mb as F, Ft as G, B7 as H, pg as I, dr as J, HL as K, AK as L, R as M, bPe as N, wPe as O, hu as P, Xe as Q, cs as R, KTe as S, fs as T, bo as U, pt as V, ve as W, rQ as X, w3e as Y, sPe as Z, WPe as _, YPe as a, T6 as a$, uPe as a0, i3e as a1, a3e as a2, hPe as a3, Qy as a4, hi as a5, tPe as a6, ig as a7, Sce as a8, lp as a9, f7 as aA, T7 as aB, s0 as aC, hM as aD, lM as aE, PU as aF, Xxe as aG, _Pe as aH, LPe as aI, rPe as aJ, Die as aK, VPe as aL, dn as aM, ff as aN, iPe as aO, nPe as aP, zPe as aQ, D7 as aR, pPe as aS, Zn as aT, HU as aU, GPe as aV, UPe as aW, $Pe as aX, oPe as aY, ah as aZ, CO as a_, Xr as aa, vl as ab, TPe as ac, OPe as ad, fPe as ae, EPe as af, xPe as ag, yPe as ah, J3e as ai, M6 as aj, RPe as ak, M$ as al, kd as am, R$ as an, N7 as ao, HPe as ap, cPe as aq, gb as ar, ob as as, vPe as at, di as au, pi as av, Bd as aw, D4 as ax, mg as ay, u7 as az, RI as b, m3e as b$, _L as b0, ra as b1, na as b2, Q3e as b3, XAe as b4, l3e as b5, fl as b6, yL as b7, Gd as b8, pq as b9, k7 as bA, DPe as bB, MPe as bC, Uoe as bD, _me as bE, BPe as bF, kPe as bG, NPe as bH, FPe as bI, I3e as bJ, JTe as bK, h3e as bL, f3e as bM, k3e as bN, N3e as bO, A3e as bP, T3e as bQ, p3e as bR, Kq as bS, QTe as bT, e3e as bU, M3e as bV, E3e as bW, S3e as bX, y3e as bY, _3e as bZ, ds as b_, tn as ba, u3e as bb, d0 as bc, O3e as bd, n3e as be, r3e as bf, I7 as bg, y7 as bh, Un as bi, APe as bj, I0 as bk, Gt as bl, Cde as bm, IPe as bn, Ae as bo, PPe as bp, U3e as bq, fu as br, Mn as bs, By as bt, yt as bu, dPe as bv, hg as bw, st as bx, jPe as by, CQ as bz, XPe as c, b3e as c0, v3e as c1, B3e as c2, L3e as c3, P3e as c4, c3e as c5, Nl as c6, mZ as c7, x3e as c8, F3e as c9, G3e as ca, g3e as cb, D3e as cc, Dg as cd, R3e as ce, SM as cf, $3e as cg, C3e as ch, OO as ci, jTe as cj, YTe as ck, gPe as cl, Il as cm, lPe as cn, mPe as co, KPe as cp, V3e as d, z3e as e, j3e as f, W3e as g, Y3e as h, X3e as i, K3e as j, q3e as k, Z3e as l, H3e as m, Uf as n, s3e as o, XTe as p, qTe as q, Z as r, CK as s, WTe as t, aPe as u, kw as v, Mt as w, re as x, Ht as y, QO as z};
