const HF = "modulepreload",
  VF = function (t) {
    return "/" + t;
  },
  PE = {},
  Wf = function (e, n, r) {
    if (!n || n.length === 0) return e();
    const i = document.getElementsByTagName("link");
    return Promise.all(
      n.map((o) => {
        if (((o = VF(o)), o in PE)) return;
        PE[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" : HF),
          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 zF(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 Rd = Object.assign,
  jF = Object.prototype.hasOwnProperty,
  lg = (t, e) => jF.call(t, e),
  Yo = Array.isArray,
  gf = (t) => YI(t) === "[object Map]",
  Xx = (t) => typeof t == "function",
  WF = (t) => typeof t == "string",
  Kx = (t) => typeof t == "symbol",
  Md = (t) => t !== null && typeof t == "object",
  YF = Object.prototype.toString,
  YI = (t) => YF.call(t),
  XI = (t) => YI(t).slice(8, -1),
  qx = (t) =>
    WF(t) && t !== "NaN" && t[0] !== "-" && "" + parseInt(t, 10) === t,
  XF = (t) => {
    const e = Object.create(null);
    return (n) => e[n] || (e[n] = t(n));
  },
  KF = XF((t) => t.charAt(0).toUpperCase() + t.slice(1)),
  Zx = (t, e) => !Object.is(t, e),
  qF = (t, e, n) => {
    Object.defineProperty(t, e, { configurable: !0, enumerable: !1, value: n });
  };
function o0(t, ...e) {
  console.warn(`[Vue warn] ${t}`, ...e);
}
let $r;
class Jx {
  constructor(e = !1) {
    (this.detached = e),
      (this._active = !0),
      (this.effects = []),
      (this.cleanups = []),
      (this.parent = $r),
      !e && $r && (this.index = ($r.scopes || ($r.scopes = [])).push(this) - 1);
  }
  get active() {
    return this._active;
  }
  run(e) {
    if (this._active) {
      const n = $r;
      try {
        return ($r = this), e();
      } finally {
        $r = n;
      }
    } else o0("cannot run an inactive effect scope.");
  }
  on() {
    $r = this;
  }
  off() {
    $r = 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 Dd(t) {
  return new Jx(t);
}
function KI(t, e = $r) {
  e && e.active && e.effects.push(t);
}
function Bd() {
  return $r;
}
function Qx(t) {
  $r
    ? $r.cleanups.push(t)
    : o0(
        "onScopeDispose() is called when there is no active effect scope to be associated with."
      );
}
const eb = (t) => {
    const e = new Set(t);
    return (e.w = 0), (e.n = 0), e;
  },
  qI = (t) => (t.w & na) > 0,
  ZI = (t) => (t.n & na) > 0,
  ZF = ({ deps: t }) => {
    if (t.length) for (let e = 0; e < t.length; e++) t[e].w |= na;
  },
  JF = (t) => {
    const { deps: e } = t;
    if (e.length) {
      let n = 0;
      for (let r = 0; r < e.length; r++) {
        const i = e[r];
        qI(i) && !ZI(i) ? i.delete(t) : (e[n++] = i),
          (i.w &= ~na),
          (i.n &= ~na);
      }
      e.length = n;
    }
  },
  s0 = new WeakMap();
let rf = 0,
  na = 1;
const py = 30;
let ur;
const el = Symbol("iterate"),
  gy = Symbol("Map key iterate");
class kd {
  constructor(e, n = null, r) {
    (this.fn = e),
      (this.scheduler = n),
      (this.active = !0),
      (this.deps = []),
      (this.parent = void 0),
      KI(this, r);
  }
  run() {
    if (!this.active) return this.fn();
    let e = ur,
      n = Ws;
    for (; e; ) {
      if (e === this) return;
      e = e.parent;
    }
    try {
      return (
        (this.parent = ur),
        (ur = this),
        (Ws = !0),
        (na = 1 << ++rf),
        rf <= py ? ZF(this) : IE(this),
        this.fn()
      );
    } finally {
      rf <= py && JF(this),
        (na = 1 << --rf),
        (ur = this.parent),
        (Ws = n),
        (this.parent = void 0),
        this.deferStop && this.stop();
    }
  }
  stop() {
    ur === this
      ? (this.deferStop = !0)
      : this.active &&
        (IE(this), this.onStop && this.onStop(), (this.active = !1));
  }
}
function IE(t) {
  const { deps: e } = t;
  if (e.length) {
    for (let n = 0; n < e.length; n++) e[n].delete(t);
    e.length = 0;
  }
}
function QF(t, e) {
  t.effect && (t = t.effect.fn);
  const n = new kd(t);
  e && (Rd(n, e), e.scope && KI(n, e.scope)), (!e || !e.lazy) && n.run();
  const r = n.run.bind(n);
  return (r.effect = n), r;
}
function eL(t) {
  t.effect.stop();
}
let Ws = !0;
const JI = [];
function Rl() {
  JI.push(Ws), (Ws = !1);
}
function Ml() {
  const t = JI.pop();
  Ws = t === void 0 ? !0 : t;
}
function nr(t, e, n) {
  if (Ws && ur) {
    let r = s0.get(t);
    r || s0.set(t, (r = new Map()));
    let i = r.get(n);
    i || r.set(n, (i = eb())),
      QI(i, { effect: ur, target: t, type: e, key: n });
  }
}
function QI(t, e) {
  let n = !1;
  rf <= py ? ZI(t) || ((t.n |= na), (n = !qI(t))) : (n = !t.has(ur)),
    n &&
      (t.add(ur),
      ur.deps.push(t),
      ur.onTrack && ur.onTrack(Rd({ effect: ur }, e)));
}
function po(t, e, n, r, i, o) {
  const s = s0.get(t);
  if (!s) return;
  let a = [];
  if (e === "clear") a = [...s.values()];
  else if (n === "length" && Yo(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":
        Yo(t)
          ? qx(n) && a.push(s.get("length"))
          : (a.push(s.get(el)), gf(t) && a.push(s.get(gy)));
        break;
      case "delete":
        Yo(t) || (a.push(s.get(el)), gf(t) && a.push(s.get(gy)));
        break;
      case "set":
        gf(t) && a.push(s.get(el));
        break;
    }
  const l = {
    target: t,
    type: e,
    key: n,
    newValue: r,
    oldValue: i,
    oldTarget: o,
  };
  if (a.length === 1) a[0] && my(a[0], l);
  else {
    const c = [];
    for (const u of a) u && c.push(...u);
    my(eb(c), l);
  }
}
function my(t, e) {
  const n = Yo(t) ? t : [...t];
  for (const r of n) r.computed && OE(r, e);
  for (const r of n) r.computed || OE(r, e);
}
function OE(t, e) {
  (t !== ur || t.allowRecurse) &&
    (t.onTrigger && t.onTrigger(Rd({ effect: t }, e)),
    t.scheduler ? t.scheduler() : t.run());
}
function tL(t, e) {
  var n;
  return (n = s0.get(t)) == null ? void 0 : n.get(e);
}
const nL = zF("__proto__,__v_isRef,__isVue"),
  e4 = new Set(
    Object.getOwnPropertyNames(Symbol)
      .filter((t) => t !== "arguments" && t !== "caller")
      .map((t) => Symbol[t])
      .filter(Kx)
  ),
  rL = cg(),
  iL = cg(!1, !0),
  oL = cg(!0),
  sL = cg(!0, !0),
  RE = aL();
function aL() {
  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++) nr(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) {
        Rl();
        const r = Le(this)[e].apply(this, n);
        return Ml(), r;
      };
    }),
    t
  );
}
function lL(t) {
  const e = Le(this);
  return nr(e, "has", t), e.hasOwnProperty(t);
}
function cg(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 ? l4 : a4) : e ? s4 : o4).get(r))
      return r;
    const s = Yo(r);
    if (!t) {
      if (s && lg(RE, i)) return Reflect.get(RE, i, o);
      if (i === "hasOwnProperty") return lL;
    }
    const a = Reflect.get(r, i, o);
    return (Kx(i) ? e4.has(i) : nL(i)) || (t || nr(r, "get", i), e)
      ? a
      : pt(a)
      ? s && qx(i)
        ? a
        : a.value
      : Md(a)
      ? t
        ? Dl(a)
        : At(a)
      : a;
  };
}
const cL = t4(),
  uL = t4(!0);
function t4(t = !1) {
  return function (n, r, i, o) {
    let s = n[r];
    if (is(s) && pt(s) && !pt(i)) return !1;
    if (
      !t &&
      (!Yf(i) && !is(i) && ((s = Le(s)), (i = Le(i))),
      !Yo(n) && pt(s) && !pt(i))
    )
      return (s.value = i), !0;
    const a = Yo(n) && qx(r) ? Number(r) < n.length : lg(n, r),
      l = Reflect.set(n, r, i, o);
    return (
      n === Le(o) &&
        (a ? Zx(i, s) && po(n, "set", r, i, s) : po(n, "add", r, i)),
      l
    );
  };
}
function fL(t, e) {
  const n = lg(t, e),
    r = t[e],
    i = Reflect.deleteProperty(t, e);
  return i && n && po(t, "delete", e, void 0, r), i;
}
function dL(t, e) {
  const n = Reflect.has(t, e);
  return (!Kx(e) || !e4.has(e)) && nr(t, "has", e), n;
}
function hL(t) {
  return nr(t, "iterate", Yo(t) ? "length" : el), Reflect.ownKeys(t);
}
const n4 = { get: rL, set: cL, deleteProperty: fL, has: dL, ownKeys: hL },
  r4 = {
    get: oL,
    set(t, e) {
      return (
        o0(
          `Set operation on key "${String(e)}" failed: target is readonly.`,
          t
        ),
        !0
      );
    },
    deleteProperty(t, e) {
      return (
        o0(
          `Delete operation on key "${String(e)}" failed: target is readonly.`,
          t
        ),
        !0
      );
    },
  },
  pL = Rd({}, n4, { get: iL, set: uL }),
  gL = Rd({}, r4, { get: sL }),
  tb = (t) => t,
  ug = (t) => Reflect.getPrototypeOf(t);
function Eh(t, e, n = !1, r = !1) {
  t = t.__v_raw;
  const i = Le(t),
    o = Le(e);
  n || (e !== o && nr(i, "get", e), nr(i, "get", o));
  const { has: s } = ug(i),
    a = r ? tb : n ? nb : Kf;
  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 Sh(t, e = !1) {
  const n = this.__v_raw,
    r = Le(n),
    i = Le(t);
  return (
    e || (t !== i && nr(r, "has", t), nr(r, "has", i)),
    t === i ? n.has(t) : n.has(t) || n.has(i)
  );
}
function Ch(t, e = !1) {
  return (
    (t = t.__v_raw), !e && nr(Le(t), "iterate", el), Reflect.get(t, "size", t)
  );
}
function ME(t) {
  t = Le(t);
  const e = Le(this);
  return ug(e).has.call(e, t) || (e.add(t), po(e, "add", t, t)), this;
}
function DE(t, e) {
  e = Le(e);
  const n = Le(this),
    { has: r, get: i } = ug(n);
  let o = r.call(n, t);
  o ? i4(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) && po(n, "set", t, e, s) : po(n, "add", t, e),
    this
  );
}
function BE(t) {
  const e = Le(this),
    { has: n, get: r } = ug(e);
  let i = n.call(e, t);
  i ? i4(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 && po(e, "delete", t, void 0, o), s;
}
function kE() {
  const t = Le(this),
    e = t.size !== 0,
    n = gf(t) ? new Map(t) : new Set(t),
    r = t.clear();
  return e && po(t, "clear", void 0, void 0, n), r;
}
function Ah(t, e) {
  return function (r, i) {
    const o = this,
      s = o.__v_raw,
      a = Le(s),
      l = e ? tb : t ? nb : Kf;
    return (
      !t && nr(a, "iterate", el), s.forEach((c, u) => r.call(i, l(c), l(u), o))
    );
  };
}
function Th(t, e, n) {
  return function (...r) {
    const i = this.__v_raw,
      o = Le(i),
      s = gf(o),
      a = t === "entries" || (t === Symbol.iterator && s),
      l = t === "keys" && s,
      c = i[t](...r),
      u = n ? tb : e ? nb : Kf;
    return (
      !e && nr(o, "iterate", l ? gy : el),
      {
        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 xs(t) {
  return function (...e) {
    {
      const n = e[0] ? `on key "${e[0]}" ` : "";
      console.warn(
        `${KF(t)} operation ${n}failed: target is readonly.`,
        Le(this)
      );
    }
    return t === "delete" ? !1 : this;
  };
}
function mL() {
  const t = {
      get(o) {
        return Eh(this, o);
      },
      get size() {
        return Ch(this);
      },
      has: Sh,
      add: ME,
      set: DE,
      delete: BE,
      clear: kE,
      forEach: Ah(!1, !1),
    },
    e = {
      get(o) {
        return Eh(this, o, !1, !0);
      },
      get size() {
        return Ch(this);
      },
      has: Sh,
      add: ME,
      set: DE,
      delete: BE,
      clear: kE,
      forEach: Ah(!1, !0),
    },
    n = {
      get(o) {
        return Eh(this, o, !0);
      },
      get size() {
        return Ch(this, !0);
      },
      has(o) {
        return Sh.call(this, o, !0);
      },
      add: xs("add"),
      set: xs("set"),
      delete: xs("delete"),
      clear: xs("clear"),
      forEach: Ah(!0, !1),
    },
    r = {
      get(o) {
        return Eh(this, o, !0, !0);
      },
      get size() {
        return Ch(this, !0);
      },
      has(o) {
        return Sh.call(this, o, !0);
      },
      add: xs("add"),
      set: xs("set"),
      delete: xs("delete"),
      clear: xs("clear"),
      forEach: Ah(!0, !0),
    };
  return (
    ["keys", "values", "entries", Symbol.iterator].forEach((o) => {
      (t[o] = Th(o, !1, !1)),
        (n[o] = Th(o, !0, !1)),
        (e[o] = Th(o, !1, !0)),
        (r[o] = Th(o, !0, !0));
    }),
    [t, n, e, r]
  );
}
const [vL, yL, _L, xL] = mL();
function fg(t, e) {
  const n = e ? (t ? xL : _L) : t ? yL : vL;
  return (r, i, o) =>
    i === "__v_isReactive"
      ? !t
      : i === "__v_isReadonly"
      ? t
      : i === "__v_raw"
      ? r
      : Reflect.get(lg(n, i) && i in r ? n : r, i, o);
}
const bL = { get: fg(!1, !1) },
  wL = { get: fg(!1, !0) },
  EL = { get: fg(!0, !1) },
  SL = { get: fg(!0, !0) };
function i4(t, e, n) {
  const r = Le(n);
  if (r !== n && e.call(t, r)) {
    const i = XI(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 o4 = new WeakMap(),
  s4 = new WeakMap(),
  a4 = new WeakMap(),
  l4 = new WeakMap();
function CL(t) {
  switch (t) {
    case "Object":
    case "Array":
      return 1;
    case "Map":
    case "Set":
    case "WeakMap":
    case "WeakSet":
      return 2;
    default:
      return 0;
  }
}
function AL(t) {
  return t.__v_skip || !Object.isExtensible(t) ? 0 : CL(XI(t));
}
function At(t) {
  return is(t) ? t : dg(t, !1, n4, bL, o4);
}
function c4(t) {
  return dg(t, !1, pL, wL, s4);
}
function Dl(t) {
  return dg(t, !0, r4, EL, a4);
}
function _c(t) {
  return dg(t, !0, gL, SL, l4);
}
function dg(t, e, n, r, i) {
  if (!Md(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 = AL(t);
  if (s === 0) return t;
  const a = new Proxy(t, s === 2 ? r : n);
  return i.set(t, a), a;
}
function ki(t) {
  return is(t) ? ki(t.__v_raw) : !!(t && t.__v_isReactive);
}
function is(t) {
  return !!(t && t.__v_isReadonly);
}
function Yf(t) {
  return !!(t && t.__v_isShallow);
}
function Xf(t) {
  return ki(t) || is(t);
}
function Le(t) {
  const e = t && t.__v_raw;
  return e ? Le(e) : t;
}
function ao(t) {
  return qF(t, "__v_skip", !0), t;
}
const Kf = (t) => (Md(t) ? At(t) : t),
  nb = (t) => (Md(t) ? Dl(t) : t);
function rb(t) {
  Ws &&
    ur &&
    ((t = Le(t)),
    QI(t.dep || (t.dep = eb()), { target: t, type: "get", key: "value" }));
}
function hg(t, e) {
  t = Le(t);
  const n = t.dep;
  n && my(n, { target: t, type: "set", key: "value", newValue: e });
}
function pt(t) {
  return !!(t && t.__v_isRef === !0);
}
function Z(t) {
  return u4(t, !1);
}
function pg(t) {
  return u4(t, !0);
}
function u4(t, e) {
  return pt(t) ? t : new TL(t, e);
}
class TL {
  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 : Kf(e));
  }
  get value() {
    return rb(this), this._value;
  }
  set value(e) {
    const n = this.__v_isShallow || Yf(e) || is(e);
    (e = n ? e : Le(e)),
      Zx(e, this._rawValue) &&
        ((this._rawValue = e), (this._value = n ? e : Kf(e)), hg(this, e));
  }
}
function PL(t) {
  hg(t, t.value);
}
function hr(t) {
  return pt(t) ? t.value : t;
}
function IL(t) {
  return Xx(t) ? t() : hr(t);
}
const OL = {
  get: (t, e, n) => hr(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 ib(t) {
  return ki(t) ? t : new Proxy(t, OL);
}
class RL {
  constructor(e) {
    (this.dep = void 0), (this.__v_isRef = !0);
    const { get: n, set: r } = e(
      () => rb(this),
      () => hg(this)
    );
    (this._get = n), (this._set = r);
  }
  get value() {
    return this._get();
  }
  set value(e) {
    this._set(e);
  }
}
function f4(t) {
  return new RL(t);
}
function vy(t) {
  Xf(t) ||
    console.warn(
      "toRefs() expects a reactive object but received a plain one."
    );
  const e = Yo(t) ? new Array(t.length) : {};
  for (const n in t) e[n] = d4(t, n);
  return e;
}
class ML {
  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 tL(Le(this._object), this._key);
  }
}
class DL {
  constructor(e) {
    (this._getter = e), (this.__v_isRef = !0), (this.__v_isReadonly = !0);
  }
  get value() {
    return this._getter();
  }
}
function mf(t, e, n) {
  return pt(t)
    ? t
    : Xx(t)
    ? new DL(t)
    : Md(t) && arguments.length > 1
    ? d4(t, e, n)
    : Z(t);
}
function d4(t, e, n) {
  const r = t[e];
  return pt(r) ? r : new ML(t, e, n);
}
class BL {
  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 kd(e, () => {
        this._dirty || ((this._dirty = !0), hg(this));
      })),
      (this.effect.computed = this),
      (this.effect.active = this._cacheable = !i),
      (this.__v_isReadonly = r);
  }
  get value() {
    const e = Le(this);
    return (
      rb(e),
      (e._dirty || !e._cacheable) &&
        ((e._dirty = !1), (e._value = e.effect.run())),
      e._value
    );
  }
  set value(e) {
    this._setter(e);
  }
}
function kL(t, e, n = !1) {
  let r, i;
  const o = Xx(t);
  o
    ? ((r = t),
      (i = () => {
        console.warn("Write operation failed: computed value is readonly");
      }))
    : ((r = t.get), (i = t.set));
  const s = new BL(r, i, o || !i, n);
  return (
    e &&
      !n &&
      ((s.effect.onTrack = e.onTrack), (s.effect.onTrigger = e.onTrigger)),
    s
  );
}
function Nd(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({}),
  Ic = Object.freeze([]),
  Ar = () => {},
  h4 = () => !1,
  NL = /^on[^a-z]/,
  Fd = (t) => NL.test(t),
  yy = (t) => t.startsWith("onUpdate:"),
  Xt = Object.assign,
  ob = (t, e) => {
    const n = t.indexOf(e);
    n > -1 && t.splice(n, 1);
  },
  FL = Object.prototype.hasOwnProperty,
  lt = (t, e) => FL.call(t, e),
  Ve = Array.isArray,
  p4 = (t) => Ld(t) === "[object Map]",
  g4 = (t) => Ld(t) === "[object Set]",
  LL = (t) => Ld(t) === "[object RegExp]",
  He = (t) => typeof t == "function",
  nn = (t) => typeof t == "string",
  Pt = (t) => t !== null && typeof t == "object",
  gg = (t) => Pt(t) && He(t.then) && He(t.catch),
  m4 = Object.prototype.toString,
  Ld = (t) => m4.call(t),
  $L = (t) => Ld(t).slice(8, -1),
  v4 = (t) => Ld(t) === "[object Object]",
  vf = Nd(
    ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  ),
  UL = Nd(
    "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  ),
  mg = (t) => {
    const e = Object.create(null);
    return (n) => e[n] || (e[n] = t(n));
  },
  GL = /-(\w)/g,
  Li = mg((t) => t.replace(GL, (e, n) => (n ? n.toUpperCase() : ""))),
  HL = /\B([A-Z])/g,
  $c = mg((t) => t.replace(HL, "-$1").toLowerCase()),
  Uc = mg((t) => t.charAt(0).toUpperCase() + t.slice(1)),
  $o = mg((t) => (t ? `on${Uc(t)}` : "")),
  _y = (t, e) => !Object.is(t, e),
  $a = (t, e) => {
    for (let n = 0; n < t.length; n++) t[n](e);
  },
  xy = (t, e, n) => {
    Object.defineProperty(t, e, { configurable: !0, enumerable: !1, value: n });
  },
  VL = (t) => {
    const e = parseFloat(t);
    return isNaN(e) ? t : e;
  },
  zL = (t) => {
    const e = nn(t) ? Number(t) : NaN;
    return isNaN(e) ? t : e;
  };
let NE;
const a0 = () =>
    NE ||
    (NE =
      typeof globalThis < "u"
        ? globalThis
        : typeof self < "u"
        ? self
        : typeof window < "u"
        ? window
        : typeof global < "u"
        ? global
        : {}),
  jL =
    "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",
  WL = Nd(jL);
function $d(t) {
  if (Ve(t)) {
    const e = {};
    for (let n = 0; n < t.length; n++) {
      const r = t[n],
        i = nn(r) ? qL(r) : $d(r);
      if (i) for (const o in i) e[o] = i[o];
    }
    return e;
  } else {
    if (nn(t)) return t;
    if (Pt(t)) return t;
  }
}
const YL = /;(?![^(]*\))/g,
  XL = /:([^]+)/,
  KL = /\/\*[^]*?\*\//g;
function qL(t) {
  const e = {};
  return (
    t
      .replace(KL, "")
      .split(YL)
      .forEach((n) => {
        if (n) {
          const r = n.split(XL);
          r.length > 1 && (e[r[0].trim()] = r[1].trim());
        }
      }),
    e
  );
}
function Ud(t) {
  let e = "";
  if (nn(t)) e = t;
  else if (Ve(t))
    for (let n = 0; n < t.length; n++) {
      const r = Ud(t[n]);
      r && (e += r + " ");
    }
  else if (Pt(t)) for (const n in t) t[n] && (e += n + " ");
  return e.trim();
}
function ZL(t) {
  if (!t) return null;
  let { class: e, style: n } = t;
  return e && !nn(e) && (t.class = Ud(e)), n && (t.style = $d(n)), t;
}
const JL = (t) =>
    nn(t)
      ? t
      : t == null
      ? ""
      : Ve(t) || (Pt(t) && (t.toString === m4 || !He(t.toString)))
      ? JSON.stringify(t, y4, 2)
      : String(t),
  y4 = (t, e) =>
    e && e.__v_isRef
      ? y4(t, e.value)
      : p4(e)
      ? {
          [`Map(${e.size})`]: [...e.entries()].reduce(
            (n, [r, i]) => ((n[`${r} =>`] = i), n),
            {}
          ),
        }
      : g4(e)
      ? { [`Set(${e.size})`]: [...e.values()] }
      : Pt(e) && !Ve(e) && !v4(e)
      ? String(e)
      : e,
  tl = [];
function yf(t) {
  tl.push(t);
}
function _f() {
  tl.pop();
}
function ae(t, ...e) {
  Rl();
  const n = tl.length ? tl[tl.length - 1].component : null,
    r = n && n.appContext.config.warnHandler,
    i = QL();
  if (r)
    co(r, n, 11, [
      t + e.join(""),
      n && n.proxy,
      i.map(({ vnode: o }) => `at <${Pg(n, o.type)}>`).join(`
`),
      i,
    ]);
  else {
    const o = [`[Vue warn]: ${t}`, ...e];
    i.length &&
      o.push(
        `
`,
        ...e7(i)
      ),
      console.warn(...o);
  }
  Ml();
}
function QL() {
  let t = tl[tl.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 e7(t) {
  const e = [];
  return (
    t.forEach((n, r) => {
      e.push(
        ...(r === 0
          ? []
          : [
              `
`,
            ]),
        ...t7(n)
      );
    }),
    e
  );
}
function t7({ vnode: t, recurseCount: e }) {
  const n = e > 0 ? `... (${e} recursive calls)` : "",
    r = t.component ? t.component.parent == null : !1,
    i = ` at <${Pg(t.component, t.type, r)}`,
    o = ">" + n;
  return t.props ? [i, ...n7(t.props), o] : [i + o];
}
function n7(t) {
  const e = [],
    n = Object.keys(t);
  return (
    n.slice(0, 3).forEach((r) => {
      e.push(..._4(r, t[r]));
    }),
    n.length > 3 && e.push(" ..."),
    e
  );
}
function _4(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 = _4(t, Le(e.value), !0)), n ? e : [`${t}=Ref<`, e, ">"])
    : He(e)
    ? [`${t}=fn${e.name ? `<${e.name}>` : ""}`]
    : ((e = Le(e)), n ? e : [`${t}=`, e]);
}
function sb(t, e) {
  t !== void 0 &&
    (typeof t != "number"
      ? ae(`${e} is not a valid number - got ${JSON.stringify(t)}.`)
      : isNaN(t) &&
        ae(`${e} is NaN - the duration expression might be incorrect.`));
}
const ab = {
  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 co(t, e, n, r) {
  let i;
  try {
    i = r ? t(...r) : t();
  } catch (o) {
    Bl(o, e, n);
  }
  return i;
}
function Vr(t, e, n, r) {
  if (He(t)) {
    const o = co(t, e, n, r);
    return (
      o &&
        gg(o) &&
        o.catch((s) => {
          Bl(s, e, n);
        }),
      o
    );
  }
  const i = [];
  for (let o = 0; o < t.length; o++) i.push(Vr(t[o], e, n, r));
  return i;
}
function Bl(t, e, n, r = !0) {
  const i = e ? e.vnode : null;
  if (e) {
    let o = e.parent;
    const s = e.proxy,
      a = ab[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) {
      co(l, null, 10, [t, s, a]);
      return;
    }
  }
  r7(t, n, i, r);
}
function r7(t, e, n, r = !0) {
  {
    const i = ab[e];
    if (
      (n && yf(n),
      ae(`Unhandled error${i ? ` during execution of ${i}` : ""}`),
      n && _f(),
      r)
    )
      throw t;
    console.error(t);
  }
}
let qf = !1,
  by = !1;
const Jn = [];
let oo = 0;
const Oc = [];
let eo = null,
  Rs = 0;
const x4 = Promise.resolve();
let lb = null;
const i7 = 100;
function Xe(t) {
  const e = lb || x4;
  return t ? e.then(this ? t.bind(this) : t) : e;
}
function o7(t) {
  let e = oo + 1,
    n = Jn.length;
  for (; e < n; ) {
    const r = (e + n) >>> 1;
    Zf(Jn[r]) < t ? (e = r + 1) : (n = r);
  }
  return e;
}
function Gd(t) {
  (!Jn.length || !Jn.includes(t, qf && t.allowRecurse ? oo + 1 : oo)) &&
    (t.id == null ? Jn.push(t) : Jn.splice(o7(t.id), 0, t), b4());
}
function b4() {
  !qf && !by && ((by = !0), (lb = x4.then(w4)));
}
function s7(t) {
  const e = Jn.indexOf(t);
  e > oo && Jn.splice(e, 1);
}
function vg(t) {
  Ve(t)
    ? Oc.push(...t)
    : (!eo || !eo.includes(t, t.allowRecurse ? Rs + 1 : Rs)) && Oc.push(t),
    b4();
}
function FE(t, e = qf ? oo + 1 : 0) {
  for (t = t || new Map(); e < Jn.length; e++) {
    const n = Jn[e];
    if (n && n.pre) {
      if (cb(t, n)) continue;
      Jn.splice(e, 1), e--, n();
    }
  }
}
function l0(t) {
  if (Oc.length) {
    const e = [...new Set(Oc)];
    if (((Oc.length = 0), eo)) {
      eo.push(...e);
      return;
    }
    for (
      eo = e, t = t || new Map(), eo.sort((n, r) => Zf(n) - Zf(r)), Rs = 0;
      Rs < eo.length;
      Rs++
    )
      cb(t, eo[Rs]) || eo[Rs]();
    (eo = null), (Rs = 0);
  }
}
const Zf = (t) => (t.id == null ? 1 / 0 : t.id),
  a7 = (t, e) => {
    const n = Zf(t) - Zf(e);
    if (n === 0) {
      if (t.pre && !e.pre) return -1;
      if (e.pre && !t.pre) return 1;
    }
    return n;
  };
function w4(t) {
  (by = !1), (qf = !0), (t = t || new Map()), Jn.sort(a7);
  const e = (n) => cb(t, n);
  try {
    for (oo = 0; oo < Jn.length; oo++) {
      const n = Jn[oo];
      if (n && n.active !== !1) {
        if (e(n)) continue;
        co(n, null, 14);
      }
    }
  } finally {
    (oo = 0),
      (Jn.length = 0),
      l0(t),
      (qf = !1),
      (lb = null),
      (Jn.length || Oc.length) && w4(t);
  }
}
function cb(t, e) {
  if (!t.has(e)) t.set(e, 1);
  else {
    const n = t.get(e);
    if (n > i7) {
      const r = e.ownerInstance,
        i = r && nd(r.type);
      return (
        ae(
          `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 Ys = !1;
const hc = new Set();
a0().__VUE_HMR_RUNTIME__ = {
  createRecord: Lm(E4),
  rerender: Lm(u7),
  reload: Lm(f7),
};
const fl = new Map();
function l7(t) {
  const e = t.type.__hmrId;
  let n = fl.get(e);
  n || (E4(e, t.type), (n = fl.get(e))), n.instances.add(t);
}
function c7(t) {
  fl.get(t.type.__hmrId).instances.delete(t);
}
function E4(t, e) {
  return fl.has(t)
    ? !1
    : (fl.set(t, { initialDef: xf(e), instances: new Set() }), !0);
}
function xf(t) {
  return hO(t) ? t.__vccOpts : t;
}
function u7(t, e) {
  const n = fl.get(t);
  n &&
    ((n.initialDef.render = e),
    [...n.instances].forEach((r) => {
      e && ((r.render = e), (xf(r.type).render = e)),
        (r.renderCache = []),
        (Ys = !0),
        r.update(),
        (Ys = !1);
    }));
}
function f7(t, e) {
  const n = fl.get(t);
  if (!n) return;
  (e = xf(e)), LE(n.initialDef, e);
  const r = [...n.instances];
  for (const i of r) {
    const o = xf(i.type);
    hc.has(o) || (o !== n.initialDef && LE(o, e), hc.add(o)),
      i.appContext.propsCache.delete(i.type),
      i.appContext.emitsCache.delete(i.type),
      i.appContext.optionsCache.delete(i.type),
      i.ceReload
        ? (hc.add(o), i.ceReload(e.styles), hc.delete(o))
        : i.parent
        ? Gd(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."
          );
  }
  vg(() => {
    for (const i of r) hc.delete(xf(i.type));
  });
}
function LE(t, e) {
  Xt(t, e);
  for (const n in t) n !== "__file" && !(n in e) && delete t[n];
}
function Lm(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,
  of = [],
  wy = !1;
function Hd(t, ...e) {
  Ci ? Ci.emit(t, ...e) : wy || of.push({ event: t, args: e });
}
function ub(t, e) {
  var n, r;
  (Ci = t),
    Ci
      ? ((Ci.enabled = !0),
        of.forEach(({ event: i, args: o }) => Ci.emit(i, ...o)),
        (of = []))
      : 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) => {
          ub(o, e);
        }),
        setTimeout(() => {
          Ci || ((e.__VUE_DEVTOOLS_HOOK_REPLAY__ = null), (wy = !0), (of = []));
        }, 3e3))
      : ((wy = !0), (of = []));
}
function d7(t, e) {
  Hd("app:init", t, e, { Fragment: Ft, Text: go, Comment: en, Static: Xs });
}
function h7(t) {
  Hd("app:unmount", t);
}
const Ey = fb("component:added"),
  S4 = fb("component:updated"),
  p7 = fb("component:removed"),
  g7 = (t) => {
    Ci &&
      typeof Ci.cleanupBuffer == "function" &&
      !Ci.cleanupBuffer(t) &&
      p7(t);
  };
function fb(t) {
  return (e) => {
    Hd(t, e.appContext.app, e.uid, e.parent ? e.parent.uid : void 0, e);
  };
}
const m7 = C4("perf:start"),
  v7 = C4("perf:end");
function C4(t) {
  return (e, n, r) => {
    Hd(t, e.appContext.app, e.uid, e, n, r);
  };
}
function y7(t, e, n) {
  Hd("component:emit", t.appContext.app, t, e, n);
}
function _7(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 || !($o(e) in f)) &&
          ae(
            `Component emitted event "${e}" but it is neither declared in the emits option nor as an "${$o(
              e
            )}" prop.`
          );
      else {
        const d = u[e];
        He(d) &&
          (d(...n) ||
            ae(
              `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(VL));
  }
  y7(t, e, i);
  {
    const u = e.toLowerCase();
    u !== e &&
      r[$o(u)] &&
      ae(
        `Event "${u}" is emitted in component ${Pg(
          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 "${$c(
          e
        )}" instead of "${e}".`
      );
  }
  let a,
    l = r[(a = $o(e))] || r[(a = $o(Li(e)))];
  !l && o && (l = r[(a = $o($c(e)))]), l && Vr(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), Vr(c, t, 6, i);
  }
}
function A4(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 (!He(t)) {
    const l = (c) => {
      const u = A4(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
    ? (Pt(t) && r.set(t, null), null)
    : (Ve(o) ? o.forEach((l) => (s[l] = null)) : Xt(s, o),
      Pt(t) && r.set(t, s),
      s);
}
function yg(t, e) {
  return !t || !Fd(e)
    ? !1
    : ((e = e.slice(2).replace(/Once$/, "")),
      lt(t, e[0].toLowerCase() + e.slice(1)) || lt(t, $c(e)) || lt(t, e));
}
let un = null,
  _g = null;
function Jf(t) {
  const e = un;
  return (un = t), (_g = (t && t.type.__scopeId) || null), e;
}
function x7(t) {
  _g = t;
}
function b7() {
  _g = null;
}
const w7 = (t) => db;
function db(t, e = un, n) {
  if (!e || t._n) return t;
  const r = (...i) => {
    r._d && Ry(-1);
    const o = Jf(e);
    let s;
    try {
      s = t(...i);
    } finally {
      Jf(o), r._d && Ry(1);
    }
    return S4(e), s;
  };
  return (r._n = !0), (r._c = !0), (r._d = !0), r;
}
let Sy = !1;
function c0() {
  Sy = !0;
}
function Op(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: g,
  } = t;
  let m, v;
  const y = Jf(t);
  Sy = !1;
  try {
    if (n.shapeFlag & 4) {
      const b = i || r;
      (m = Er(u.call(b, b, f, o, h, d, p))), (v = l);
    } else {
      const b = e;
      l === o && c0(),
        (m = Er(
          b.length > 1
            ? b(o, {
                get attrs() {
                  return c0(), l;
                },
                slots: a,
                emit: c,
              })
            : b(o, null)
        )),
        (v = e.props ? l : S7(l));
    }
  } catch (b) {
    (wf.length = 0), Bl(b, t, 1), (m = R(en));
  }
  let _ = m,
    x;
  if (
    (m.patchFlag > 0 && m.patchFlag & 2048 && ([_, x] = E7(m)), v && g !== !1)
  ) {
    const b = Object.keys(v),
      { shapeFlag: w } = _;
    if (b.length) {
      if (w & 7) s && b.some(yy) && (v = C7(v, s)), (_ = vi(_, v));
      else if (!Sy && _.type !== en) {
        const E = Object.keys(l),
          S = [],
          P = [];
        for (let C = 0, A = E.length; C < A; C++) {
          const T = E[C];
          Fd(T) ? yy(T) || S.push(T[2].toLowerCase() + T.slice(3)) : P.push(T);
        }
        P.length &&
          ae(
            `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 &&
            ae(
              `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 &&
      ($E(_) ||
        ae(
          "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 &&
      ($E(_) ||
        ae(
          "Component inside <Transition> renders non-element root node that cannot be animated."
        ),
      (_.transition = n.transition)),
    x ? x(_) : (m = _),
    Jf(y),
    m
  );
}
const E7 = (t) => {
  const e = t.children,
    n = t.dynamicChildren,
    r = hb(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 [Er(r), s];
};
function hb(t) {
  let e;
  for (let n = 0; n < t.length; n++) {
    const r = t[n];
    if (mo(r)) {
      if (r.type !== en || r.children === "v-if") {
        if (e) return;
        e = r;
      }
    } else return;
  }
  return e;
}
const S7 = (t) => {
    let e;
    for (const n in t)
      (n === "class" || n === "style" || Fd(n)) && ((e || (e = {}))[n] = t[n]);
    return e;
  },
  C7 = (t, e) => {
    const n = {};
    for (const r in t) (!yy(r) || !(r.slice(9) in e)) && (n[r] = t[r]);
    return n;
  },
  $E = (t) => t.shapeFlag & 7 || t.type === en;
function A7(t, e, n) {
  const { props: r, children: i, component: o } = t,
    { props: s, children: a, patchFlag: l } = e,
    c = o.emitsOptions;
  if (((i || a) && Ys) || e.dirs || e.transition) return !0;
  if (n && l >= 0) {
    if (l & 1024) return !0;
    if (l & 16) return r ? UE(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] && !yg(c, d)) return !0;
      }
    }
  } else
    return (i || a) && (!a || !a.$stable)
      ? !0
      : r === s
      ? !1
      : r
      ? s
        ? UE(r, s, c)
        : !0
      : !!s;
  return !1;
}
function UE(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] && !yg(n, o)) return !0;
  }
  return !1;
}
function pb({ vnode: t, parent: e }, n) {
  for (; e && e.subTree === t; ) ((t = e.vnode).el = n), (e = e.parent);
}
const T4 = (t) => t.__isSuspense,
  T7 = {
    name: "Suspense",
    __isSuspense: !0,
    process(t, e, n, r, i, o, s, a, l, c) {
      t == null ? I7(e, n, r, i, o, s, a, l, c) : O7(t, e, n, r, i, s, a, l, c);
    },
    hydrate: R7,
    create: gb,
    normalize: M7,
  },
  P7 = T7;
function Qf(t, e) {
  const n = t.props && t.props[e];
  He(n) && n();
}
function I7(t, e, n, r, i, o, s, a, l) {
  const {
      p: c,
      o: { createElement: u },
    } = l,
    f = u("div"),
    d = (t.suspense = gb(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
      ? (Qf(t, "onPending"),
        Qf(t, "onFallback"),
        c(null, t.ssFallback, e, n, r, null, o, s),
        Rc(d, t.ssFallback))
      : d.resolve(!1, !0);
}
function O7(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: g, isInFallback: m, isHydrating: v } = f;
  if (g)
    (f.pendingBranch = d),
      Ai(d, g)
        ? (l(g, d, f.hiddenContainer, null, i, f, o, s, a),
          f.deps <= 0
            ? f.resolve()
            : m && (l(p, h, n, r, i, null, o, s, a), Rc(f, h)))
        : (f.pendingId++,
          v ? ((f.isHydrating = !1), (f.activeBranch = g)) : c(g, i, f),
          (f.deps = 0),
          (f.effects.length = 0),
          (f.hiddenContainer = u("div")),
          m
            ? (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), Rc(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), Rc(f, d);
  else if (
    (Qf(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: y, pendingId: _ } = f;
    y > 0
      ? setTimeout(() => {
          f.pendingId === _ && f.fallback(h);
        }, y)
      : y === 0 && f.fallback(h);
  }
}
let GE = !1;
function gb(t, e, n, r, i, o, s, a, l, c, u = !1) {
  GE ||
    ((GE = !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: g, remove: m },
  } = c;
  let v;
  const y = D7(t);
  y && e != null && e.pendingBranch && ((v = e.pendingId), e.deps++);
  const _ = t.props ? zL(t.props.timeout) : void 0;
  sb(_, "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 D = S && P.transition && P.transition.mode === "out-in";
        D &&
          (S.transition.afterLeave = () => {
            C === x.pendingId && d(P, I, $, 0);
          });
        let { anchor: $ } = x;
        S && (($ = p(S)), h(S, T, x, !0)), D || d(P, I, $, 0);
      }
      Rc(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 || vg(A),
        (x.effects = []),
        y &&
          e &&
          e.pendingBranch &&
          v === e.pendingId &&
          (e.deps--, e.deps === 0 && !w && e.resolve()),
        Qf(E, "onResolve");
    },
    fallback(b) {
      if (!x.pendingBranch) return;
      const {
        vnode: w,
        activeBranch: E,
        parentComponent: S,
        container: P,
        isSVG: C,
      } = x;
      Qf(w, "onFallback");
      const A = p(E),
        T = () => {
          x.isInFallback && (f(null, b, P, A, S, null, C, a, l), Rc(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) => {
          Bl(P, b, 0);
        })
        .then((P) => {
          if (b.isUnmounted || x.isUnmounted || x.pendingId !== b.suspenseId)
            return;
          b.asyncResolved = !0;
          const { vnode: C } = b;
          yf(C), By(b, P, !1), S && (C.el = S);
          const A = !S && b.subTree.el;
          w(b, C, g(S || b.subTree.el), S ? null : p(b.subTree), x, s, l),
            A && m(A),
            pb(b, C.el),
            _f(),
            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 R7(t, e, n, r, i, o, s, a, l) {
  const c = (e.suspense = gb(
      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 M7(t) {
  const { shapeFlag: e, children: n } = t,
    r = e & 32;
  (t.ssContent = HE(r ? n.default : n)),
    (t.ssFallback = r ? HE(n.fallback) : R(en));
}
function HE(t) {
  let e;
  if (He(t)) {
    const n = hl && t._c;
    n && ((t._d = !1), Sg()), (t = t()), n && ((t._d = !0), (e = Tr), rO());
  }
  if (Ve(t)) {
    const n = hb(t);
    n || ae("<Suspense> slots expect a single root node."), (t = n);
  }
  return (
    (t = Er(t)),
    e && !t.dynamicChildren && (t.dynamicChildren = e.filter((n) => n !== t)),
    t
  );
}
function P4(t, e) {
  e && e.pendingBranch
    ? Ve(t)
      ? e.effects.push(...t)
      : e.effects.push(t)
    : vg(t);
}
function Rc(t, e) {
  t.activeBranch = e;
  const { vnode: n, parentComponent: r } = t,
    i = (n.el = e.el);
  r && r.subTree === n && ((r.vnode.el = i), pb(r, i));
}
function D7(t) {
  var e;
  return (
    ((e = t.props) == null ? void 0 : e.suspensible) != null &&
    t.props.suspensible !== !1
  );
}
function gu(t, e) {
  return Vd(t, null, e);
}
function I4(t, e) {
  return Vd(t, null, Xt({}, e, { flush: "post" }));
}
function B7(t, e) {
  return Vd(t, null, Xt({}, e, { flush: "sync" }));
}
const Ph = {};
function ve(t, e, n) {
  return (
    He(e) ||
      ae(
        "`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."
      ),
    Vd(t, e, n)
  );
}
function Vd(
  t,
  e,
  { immediate: n, deep: r, flush: i, onTrack: o, onTrigger: s } = St
) {
  var a;
  e ||
    (n !== void 0 &&
      ae(
        'watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'
      ),
    r !== void 0 &&
      ae(
        'watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'
      ));
  const l = (b) => {
      ae(
        "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 = Bd() === ((a = cn) == null ? void 0 : a.scope) ? cn : null;
  let u,
    f = !1,
    d = !1;
  if (
    (pt(t)
      ? ((u = () => t.value), (f = Yf(t)))
      : ki(t)
      ? ((u = () => t), (r = !0))
      : Ve(t)
      ? ((d = !0),
        (f = t.some((b) => ki(b) || Yf(b))),
        (u = () =>
          t.map((b) => {
            if (pt(b)) return b.value;
            if (ki(b)) return Va(b);
            if (He(b)) return co(b, c, 2);
            l(b);
          })))
      : He(t)
      ? e
        ? (u = () => co(t, c, 2))
        : (u = () => {
            if (!(c && c.isUnmounted)) return h && h(), Vr(t, c, 3, [p]);
          })
      : ((u = Ar), l(t)),
    e && r)
  ) {
    const b = u;
    u = () => Va(b());
  }
  let h,
    p = (b) => {
      h = _.onStop = () => {
        co(b, c, 4);
      };
    },
    g;
  if (Hc)
    if (
      ((p = Ar),
      e ? n && Vr(e, c, 3, [u(), d ? [] : void 0, p]) : u(),
      i === "sync")
    ) {
      const b = gO();
      g = b.__watcherHandles || (b.__watcherHandles = []);
    } else return Ar;
  let m = d ? new Array(t.length).fill(Ph) : Ph;
  const v = () => {
    if (_.active)
      if (e) {
        const b = _.run();
        (r || f || (d ? b.some((w, E) => _y(w, m[E])) : _y(b, m))) &&
          (h && h(),
          Vr(e, c, 3, [b, m === Ph ? void 0 : d && m[0] === Ph ? [] : m, p]),
          (m = b));
      } else _.run();
  };
  v.allowRecurse = !!e;
  let y;
  i === "sync"
    ? (y = v)
    : i === "post"
    ? (y = () => Gn(v, c && c.suspense))
    : ((v.pre = !0), c && (v.id = c.uid), (y = () => Gd(v)));
  const _ = new kd(u, y);
  (_.onTrack = o),
    (_.onTrigger = s),
    e
      ? n
        ? v()
        : (m = _.run())
      : i === "post"
      ? Gn(_.run.bind(_), c && c.suspense)
      : _.run();
  const x = () => {
    _.stop(), c && c.scope && ob(c.scope.effects, _);
  };
  return g && g.push(x), x;
}
function k7(t, e, n) {
  const r = this.proxy,
    i = nn(t) ? (t.includes(".") ? O4(r, t) : () => r[t]) : t.bind(r, r);
  let o;
  He(e) ? (o = e) : ((o = e.handler), (n = e));
  const s = cn;
  ra(this);
  const a = Vd(i, o.bind(r), n);
  return s ? ra(s) : Ks(), a;
}
function O4(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 Va(t, e) {
  if (!Pt(t) || t.__v_skip || ((e = e || new Set()), e.has(t))) return t;
  if ((e.add(t), pt(t))) Va(t.value, e);
  else if (Ve(t)) for (let n = 0; n < t.length; n++) Va(t[n], e);
  else if (g4(t) || p4(t))
    t.forEach((n) => {
      Va(n, e);
    });
  else if (v4(t)) for (const n in t) Va(t[n], e);
  return t;
}
function R4(t) {
  UL(t) && ae("Do not use built-in directive ids as custom directive id: " + t);
}
function di(t, e) {
  const n = un;
  if (n === null)
    return ae("withDirectives can only be used inside render functions."), t;
  const r = Tg(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 &&
      (He(s) && (s = { mounted: s, updated: s }),
      s.deep && Va(a),
      i.push({
        dir: s,
        instance: r,
        value: a,
        oldValue: void 0,
        arg: l,
        modifiers: c,
      }));
  }
  return t;
}
function no(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 && (Rl(), Vr(l, n, 8, [t.el, a, t, e]), Ml());
  }
}
function mb() {
  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],
  vb = {
    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,
  },
  N7 = {
    name: "BaseTransition",
    props: vb,
    setup(t, { slots: e }) {
      const n = yt(),
        r = mb();
      let i;
      return () => {
        const o = e.default && xg(e.default(), !0);
        if (!o || !o.length) return;
        let s = o[0];
        if (o.length > 1) {
          let g = !1;
          for (const m of o)
            if (m.type !== en) {
              if (g) {
                ae(
                  "<transition> can only be used on a single element or component. Use <transition-group> for lists."
                );
                break;
              }
              (s = m), (g = !0);
            }
        }
        const a = Le(t),
          { mode: l } = a;
        if (
          (l &&
            l !== "in-out" &&
            l !== "out-in" &&
            l !== "default" &&
            ae(`invalid <transition> mode: ${l}`),
          r.isLeaving)
        )
          return $m(s);
        const c = VE(s);
        if (!c) return $m(s);
        const u = Gc(c, a, r, n);
        dl(c, u);
        const f = n.subTree,
          d = f && VE(f);
        let h = !1;
        const { getTransitionKey: p } = c.type;
        if (p) {
          const g = p();
          i === void 0 ? (i = g) : g !== i && ((i = g), (h = !0));
        }
        if (d && d.type !== en && (!Ai(c, d) || h)) {
          const g = Gc(d, a, r, n);
          if ((dl(d, g), l === "out-in"))
            return (
              (r.isLeaving = !0),
              (g.afterLeave = () => {
                (r.isLeaving = !1), n.update.active !== !1 && n.update();
              }),
              $m(s)
            );
          l === "in-out" &&
            c.type !== en &&
            (g.delayLeave = (m, v, y) => {
              const _ = D4(r, d);
              (_[String(d.key)] = d),
                (m._leaveCb = () => {
                  v(), (m._leaveCb = void 0), delete u.delayedLeave;
                }),
                (u.delayedLeave = y);
            });
        }
        return s;
      };
    },
  },
  M4 = N7;
function D4(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 Gc(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: g,
      onAppear: m,
      onAfterAppear: v,
      onAppearCancelled: y,
    } = e,
    _ = String(t.key),
    x = D4(n, t),
    b = (S, P) => {
      S && Vr(S, r, 9, P);
    },
    w = (S, P) => {
      const C = P[1];
      b(S, P),
        Ve(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 = g || 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 = m || l), (C = v || c), (A = y || 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 Gc(S, e, n, r);
      },
    };
  return E;
}
function $m(t) {
  if (mu(t)) return (t = vi(t)), (t.children = null), t;
}
function VE(t) {
  return mu(t) ? (t.children ? t.children[0] : void 0) : t;
}
function dl(t, e) {
  t.shapeFlag & 6 && t.component
    ? dl(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 xg(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(xg(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 He(t) ? (() => Xt({ name: t.name }, e, { setup: t }))() : t;
}
const nl = (t) => !!t.type.__asyncLoader;
function F7(t) {
  He(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((g, m) => {
                  a(
                    p,
                    () => g(f()),
                    () => m(p),
                    u + 1
                  );
                });
              throw p;
            })
            .then((p) => {
              if (h !== l && l) return l;
              if (
                (p ||
                  ae(
                    "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 && !Pt(p) && !He(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 = cn;
      if (c) return () => Um(c, h);
      const p = (y) => {
        (l = null), Bl(y, h, 13, !r);
      };
      if ((s && h.suspense) || Hc)
        return d()
          .then((y) => () => Um(y, h))
          .catch((y) => (p(y), () => (r ? R(r, { error: y }) : null)));
      const g = Z(!1),
        m = Z(),
        v = Z(!!i);
      return (
        i &&
          setTimeout(() => {
            v.value = !1;
          }, i),
        o != null &&
          setTimeout(() => {
            if (!g.value && !m.value) {
              const y = new Error(`Async component timed out after ${o}ms.`);
              p(y), (m.value = y);
            }
          }, o),
        d()
          .then(() => {
            (g.value = !0),
              h.parent && mu(h.parent.vnode) && Gd(h.parent.update);
          })
          .catch((y) => {
            p(y), (m.value = y);
          }),
        () => {
          if (g.value && c) return Um(c, h);
          if (m.value && r) return R(r, { error: m.value });
          if (n && !v.value) return R(n);
        }
      );
    },
  });
}
function Um(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 mu = (t) => t.type.__isKeepAlive,
  L7 = {
    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 y = e.default && e.default();
          return y && y.length === 1 ? y[0] : y;
        };
      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 = (y, _, x, b, w) => {
        const E = y.component;
        c(y, _, x, 0, a),
          l(E.vnode, y, _, x, E, a, b, y.slotScopeIds, w),
          Gn(() => {
            (E.isDeactivated = !1), E.a && $a(E.a);
            const S = y.props && y.props.onVnodeMounted;
            S && xr(S, E.parent, y);
          }, a),
          Ey(E);
      }),
        (r.deactivate = (y) => {
          const _ = y.component;
          c(y, d, null, 1, a),
            Gn(() => {
              _.da && $a(_.da);
              const x = y.props && y.props.onVnodeUnmounted;
              x && xr(x, _.parent, y), (_.isDeactivated = !0);
            }, a),
            Ey(_);
        });
      function h(y) {
        Gm(y), u(y, n, a, !0);
      }
      function p(y) {
        i.forEach((_, x) => {
          const b = nd(_.type);
          b && (!y || !y(b)) && g(x);
        });
      }
      function g(y) {
        const _ = i.get(y);
        !s || !Ai(_, s) ? h(_) : s && Gm(s), i.delete(y), o.delete(y);
      }
      ve(
        () => [t.include, t.exclude],
        ([y, _]) => {
          y && p((x) => sf(y, x)), _ && p((x) => !sf(_, x));
        },
        { flush: "post", deep: !0 }
      );
      let m = null;
      const v = () => {
        m != null && i.set(m, Hm(n.subTree));
      };
      return (
        Ht(v),
        kl(v),
        qr(() => {
          i.forEach((y) => {
            const { subTree: _, suspense: x } = n,
              b = Hm(_);
            if (y.type === b.type && y.key === b.key) {
              Gm(b);
              const w = b.component.da;
              w && Gn(w, x);
              return;
            }
            h(y);
          });
        }),
        () => {
          if (((m = null), !e.default)) return null;
          const y = e.default(),
            _ = y[0];
          if (y.length > 1)
            return (
              ae("KeepAlive should contain exactly one component child."),
              (s = null),
              y
            );
          if (!mo(_) || (!(_.shapeFlag & 4) && !(_.shapeFlag & 128)))
            return (s = null), _;
          let x = Hm(_);
          const b = x.type,
            w = nd(nl(x) ? x.type.__asyncResolved || {} : b),
            { include: E, exclude: S, max: P } = t;
          if ((E && (!w || !sf(E, w))) || (S && w && sf(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)),
            (m = C),
            A
              ? ((x.el = A.el),
                (x.component = A.component),
                x.transition && dl(x, x.transition),
                (x.shapeFlag |= 512),
                o.delete(C),
                o.add(C))
              : (o.add(C),
                P && o.size > parseInt(P, 10) && g(o.values().next().value)),
            (x.shapeFlag |= 256),
            (s = x),
            T4(_.type) ? _ : x
          );
        }
      );
    },
  },
  $7 = L7;
function sf(t, e) {
  return Ve(t)
    ? t.some((n) => sf(n, e))
    : nn(t)
    ? t.split(",").includes(e)
    : LL(t)
    ? t.test(e)
    : !1;
}
function ps(t, e) {
  B4(t, "a", e);
}
function Eo(t, e) {
  B4(t, "da", e);
}
function B4(t, e, n = cn) {
  const r =
    t.__wdc ||
    (t.__wdc = () => {
      let i = n;
      for (; i; ) {
        if (i.isDeactivated) return;
        i = i.parent;
      }
      return t();
    });
  if ((bg(e, r, n), n)) {
    let i = n.parent;
    for (; i && i.parent; )
      mu(i.parent.vnode) && U7(r, e, n, i), (i = i.parent);
  }
}
function U7(t, e, n, r) {
  const i = bg(e, t, r, !0);
  ms(() => {
    ob(r[e], i);
  }, n);
}
function Gm(t) {
  (t.shapeFlag &= -257), (t.shapeFlag &= -513);
}
function Hm(t) {
  return t.shapeFlag & 128 ? t.ssContent : t;
}
function bg(t, e, n = cn, r = !1) {
  if (n) {
    const i = n[t] || (n[t] = []),
      o =
        e.__weh ||
        (e.__weh = (...s) => {
          if (n.isUnmounted) return;
          Rl(), ra(n);
          const a = Vr(e, n, t, s);
          return Ks(), Ml(), a;
        });
    return r ? i.unshift(o) : i.push(o), o;
  } else {
    const i = $o(ab[t].replace(/ hook$/, ""));
    ae(
      `${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 gs =
    (t) =>
    (e, n = cn) =>
      (!Hc || t === "sp") && bg(t, (...r) => e(...r), n),
  k4 = gs("bm"),
  Ht = gs("m"),
  wg = gs("bu"),
  kl = gs("u"),
  qr = gs("bum"),
  ms = gs("um"),
  N4 = gs("sp"),
  F4 = gs("rtg"),
  L4 = gs("rtc");
function $4(t, e = cn) {
  bg("ec", t, e);
}
const u0 = "components",
  G7 = "directives";
function H7(t, e) {
  return yb(u0, t, !0, e) || t;
}
const U4 = Symbol.for("v-ndc");
function V7(t) {
  return nn(t) ? yb(u0, t, !1) || t : t || U4;
}
function G4(t) {
  return yb(G7, t);
}
function yb(t, e, n = !0, r = !1) {
  const i = un || cn;
  if (i) {
    const o = i.type;
    if (t === u0) {
      const a = nd(o, !1);
      if (a && (a === e || a === Li(e) || a === Uc(Li(e)))) return o;
    }
    const s = zE(i[t] || o[t], e) || zE(i.appContext[t], e);
    if (!s && r) return o;
    if (n && !s) {
      const a =
        t === u0
          ? `
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`
          : "";
      ae(`Failed to resolve ${t.slice(0, -1)}: ${e}${a}`);
    }
    return s;
  } else
    ae(`resolve${Uc(t.slice(0, -1))} can only be used in render() or setup().`);
}
function zE(t, e) {
  return t && (t[e] || t[Li(e)] || t[Uc(Li(e))]);
}
function z7(t, e, n, r) {
  let i;
  const o = n && n[r];
  if (Ve(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) ||
      ae(`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 (Pt(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 j7(t, e) {
  for (let n = 0; n < e.length; n++) {
    const r = e[n];
    if (Ve(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 W7(t, e, n = {}, r, i) {
  if (un.isCE || (un.parent && nl(un.parent) && un.parent.isCE))
    return e !== "default" && (n.name = e), R("slot", n, r && r());
  let o = t[e];
  o &&
    o.length > 1 &&
    (ae(
      "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),
    Sg();
  const s = o && H4(o(n)),
    a = wb(
      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 H4(t) {
  return t.some((e) =>
    mo(e) ? !(e.type === en || (e.type === Ft && !H4(e.children))) : !0
  )
    ? t
    : null;
}
function Y7(t, e) {
  const n = {};
  if (!Pt(t)) return ae("v-on with no argument expects an object value."), n;
  for (const r in t) n[e && /[A-Z]/.test(r) ? `on:${r}` : $o(r)] = t[r];
  return n;
}
const Cy = (t) => (t ? (cO(t) ? Tg(t) || t.proxy : Cy(t.parent)) : null),
  rl = Xt(Object.create(null), {
    $: (t) => t,
    $el: (t) => t.vnode.el,
    $data: (t) => t.data,
    $props: (t) => _c(t.props),
    $attrs: (t) => _c(t.attrs),
    $slots: (t) => _c(t.slots),
    $refs: (t) => _c(t.refs),
    $parent: (t) => Cy(t.parent),
    $root: (t) => Cy(t.root),
    $emit: (t) => t.emit,
    $options: (t) => xb(t),
    $forceUpdate: (t) => t.f || (t.f = () => Gd(t.update)),
    $nextTick: (t) => t.n || (t.n = Xe.bind(t.proxy)),
    $watch: (t) => k7.bind(t),
  }),
  _b = (t) => t === "_" || t === "$",
  Vm = (t, e) => t !== St && !t.__isScriptSetup && lt(t, e),
  bf = {
    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 (Vm(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];
          Ay && (s[e] = 0);
        }
      }
      const u = rl[e];
      let f, d;
      if (u)
        return (
          e === "$attrs"
            ? (nr(t, "get", e), c0())
            : e === "$slots" && nr(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];
      un &&
        (!nn(e) || e.indexOf("__v") !== 0) &&
        (i !== St && _b(e[0]) && lt(i, e)
          ? ae(
              `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 === un &&
            ae(
              `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 Vm(i, e)
        ? ((i[e] = n), !0)
        : i.__isScriptSetup && lt(i, e)
        ? (ae(`Cannot mutate <script setup> binding "${e}" from Options API.`),
          !1)
        : r !== St && lt(r, e)
        ? ((r[e] = n), !0)
        : lt(t.props, e)
        ? (ae(`Attempting to mutate prop "${e}". Props are readonly.`), !1)
        : e[0] === "$" && e.slice(1) in t
        ? (ae(
            `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)) ||
        Vm(e, s) ||
        ((a = o[0]) && lt(a, s)) ||
        lt(r, s) ||
        lt(rl, 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)
      );
    },
  };
bf.ownKeys = (t) => (
  ae(
    "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 X7 = Xt({}, bf, {
  get(t, e) {
    if (e !== Symbol.unscopables) return bf.get(t, e, t);
  },
  has(t, e) {
    const n = e[0] !== "_" && !WL(e);
    return (
      !n &&
        bf.has(t, e) &&
        ae(
          `Property ${JSON.stringify(
            e
          )} should not start with _ which is a reserved prefix for Vue internals.`
        ),
      n
    );
  },
});
function K7(t) {
  const e = {};
  return (
    Object.defineProperty(e, "_", {
      configurable: !0,
      enumerable: !1,
      get: () => t,
    }),
    Object.keys(rl).forEach((n) => {
      Object.defineProperty(e, n, {
        configurable: !0,
        enumerable: !1,
        get: () => rl[n](t),
        set: Ar,
      });
    }),
    e
  );
}
function q7(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: Ar,
      });
    });
}
function Z7(t) {
  const { ctx: e, setupState: n } = t;
  Object.keys(Le(n)).forEach((r) => {
    if (!n.__isScriptSetup) {
      if (_b(r[0])) {
        ae(
          `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: Ar,
      });
    }
  });
}
const Nl = (t) =>
  ae(
    `${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 J7() {
  return Nl("defineProps"), null;
}
function Q7() {
  return Nl("defineEmits"), null;
}
function e$(t) {
  Nl("defineExpose");
}
function t$(t) {
  Nl("defineOptions");
}
function n$() {
  return Nl("defineSlots"), null;
}
function r$() {
  Nl("defineModel");
}
function i$(t, e) {
  return Nl("withDefaults"), null;
}
function o$() {
  return V4().slots;
}
function s$() {
  return V4().attrs;
}
function a$(t, e, n) {
  const r = yt();
  if (!r) return ae("useModel() called without active instance."), Z();
  if (!r.propsOptions[0][e])
    return ae(`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 V4() {
  const t = yt();
  return (
    t || ae("useContext() called without active instance."),
    t.setupContext || (t.setupContext = dO(t))
  );
}
function ed(t) {
  return Ve(t) ? t.reduce((e, n) => ((e[n] = null), e), {}) : t;
}
function l$(t, e) {
  const n = ed(t);
  for (const r in e) {
    if (r.startsWith("__skip")) continue;
    let i = n[r];
    i
      ? Ve(i) || He(i)
        ? (i = n[r] = { type: i, default: e[r] })
        : (i.default = e[r])
      : i === null
      ? (i = n[r] = { default: e[r] })
      : ae(`props default key "${r}" has no corresponding declaration.`),
      i && e[`__skip_${r}`] && (i.skipFactory = !0);
  }
  return n;
}
function c$(t, e) {
  return !t || !e
    ? t || e
    : Ve(t) && Ve(e)
    ? t.concat(e)
    : Xt({}, ed(t), ed(e));
}
function u$(t, e) {
  const n = {};
  for (const r in t)
    e.includes(r) ||
      Object.defineProperty(n, r, { enumerable: !0, get: () => t[r] });
  return n;
}
function f$(t) {
  const e = yt();
  e ||
    ae(
      "withAsyncContext called without active current instance. This is likely a bug."
    );
  let n = t();
  return (
    Ks(),
    gg(n) &&
      (n = n.catch((r) => {
        throw (ra(e), r);
      })),
    [n, () => ra(e)]
  );
}
function d$() {
  const t = Object.create(null);
  return (e, n) => {
    t[n]
      ? ae(`${e} property "${n}" is already defined in ${t[n]}.`)
      : (t[n] = e);
  };
}
let Ay = !0;
function h$(t) {
  const e = xb(t),
    n = t.proxy,
    r = t.ctx;
  (Ay = !1), e.beforeCreate && jE(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: g,
      deactivated: m,
      beforeDestroy: v,
      beforeUnmount: y,
      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 = d$();
  {
    const [$] = t.propsOptions;
    if ($) for (const z in $) G("Props", z);
  }
  if ((c && p$(c, r, G), s))
    for (const $ in s) {
      const z = s[$];
      He(z)
        ? (Object.defineProperty(r, $, {
            value: z.bind(n),
            configurable: !0,
            enumerable: !0,
            writable: !0,
          }),
          G("Methods", $))
        : ae(
            `Method "${$}" has type "${typeof z}" in the component definition. Did you reference the function correctly?`
          );
    }
  if (i) {
    He(i) ||
      ae(
        "The data option must be a function. Plain object usage is no longer supported."
      );
    const $ = i.call(n, n);
    if (
      (gg($) &&
        ae(
          "data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."
        ),
      !Pt($))
    )
      ae("data() should return an object.");
    else {
      t.data = At($);
      for (const z in $)
        G("Data", z),
          _b(z[0]) ||
            Object.defineProperty(r, z, {
              configurable: !0,
              enumerable: !0,
              get: () => $[z],
              set: Ar,
            });
    }
  }
  if (((Ay = !0), o))
    for (const $ in o) {
      const z = o[$],
        K = He(z) ? z.bind(n, n) : He(z.get) ? z.get.bind(n, n) : Ar;
      K === Ar && ae(`Computed property "${$}" has no getter.`);
      const fe =
          !He(z) && He(z.set)
            ? z.set.bind(n)
            : () => {
                ae(
                  `Write operation failed: computed property "${$}" is readonly.`
                );
              },
        se = re({ get: K, set: fe });
      Object.defineProperty(r, $, {
        enumerable: !0,
        configurable: !0,
        get: () => se.value,
        set: (Y) => (se.value = Y),
      }),
        G("Computed", $);
    }
  if (a) for (const $ in a) z4(a[$], r, n, $);
  if (l) {
    const $ = He(l) ? l.call(n) : l;
    Reflect.ownKeys($).forEach((z) => {
      hi(z, $[z]);
    });
  }
  u && jE(u, t, "c");
  function D($, z) {
    Ve(z) ? z.forEach((K) => $(K.bind(n))) : z && $(z.bind(n));
  }
  if (
    (D(k4, f),
    D(Ht, d),
    D(wg, h),
    D(kl, p),
    D(ps, g),
    D(Eo, m),
    D($4, S),
    D(L4, w),
    D(F4, E),
    D(qr, y),
    D(ms, x),
    D(N4, P),
    Ve(C))
  )
    if (C.length) {
      const $ = t.exposed || (t.exposed = {});
      C.forEach((z) => {
        Object.defineProperty($, z, {
          get: () => n[z],
          set: (K) => (n[z] = K),
        });
      });
    } else t.exposed || (t.exposed = {});
  b && t.render === Ar && (t.render = b),
    A != null && (t.inheritAttrs = A),
    T && (t.components = T),
    I && (t.directives = I);
}
function p$(t, e, n = Ar) {
  Ve(t) && (t = Ty(t));
  for (const r in t) {
    const i = t[r];
    let o;
    Pt(i)
      ? "default" in i
        ? (o = hn(i.from || r, i.default, !0))
        : (o = hn(i.from || r))
      : (o = hn(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 jE(t, e, n) {
  Vr(Ve(t) ? t.map((r) => r.bind(e.proxy)) : t.bind(e.proxy), e, n);
}
function z4(t, e, n, r) {
  const i = r.includes(".") ? O4(n, r) : () => n[r];
  if (nn(t)) {
    const o = e[t];
    He(o) ? ve(i, o) : ae(`Invalid watch handler specified by key "${t}"`, o);
  } else if (He(t)) ve(i, t.bind(n));
  else if (Pt(t))
    if (Ve(t)) t.forEach((o) => z4(o, e, n, r));
    else {
      const o = He(t.handler) ? t.handler.bind(n) : e[t.handler];
      He(o)
        ? ve(i, o, t)
        : ae(`Invalid watch handler specified by key "${t.handler}"`, o);
    }
  else ae(`Invalid watch option: "${r}"`, t);
}
function xb(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) => f0(l, c, s, !0)), f0(l, e, s)),
    Pt(e) && o.set(e, l),
    l
  );
}
function f0(t, e, n, r = !1) {
  const { mixins: i, extends: o } = e;
  o && f0(t, o, n, !0), i && i.forEach((s) => f0(t, s, n, !0));
  for (const s in e)
    if (r && s === "expose")
      ae(
        '"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.'
      );
    else {
      const a = g$[s] || (n && n[s]);
      t[s] = a ? a(t[s], e[s]) : e[s];
    }
  return t;
}
const g$ = {
  data: WE,
  props: YE,
  emits: YE,
  methods: af,
  computed: af,
  beforeCreate: ar,
  created: ar,
  beforeMount: ar,
  mounted: ar,
  beforeUpdate: ar,
  updated: ar,
  beforeDestroy: ar,
  beforeUnmount: ar,
  destroyed: ar,
  unmounted: ar,
  activated: ar,
  deactivated: ar,
  errorCaptured: ar,
  serverPrefetch: ar,
  components: af,
  directives: af,
  watch: v$,
  provide: WE,
  inject: m$,
};
function WE(t, e) {
  return e
    ? t
      ? function () {
          return Xt(
            He(t) ? t.call(this, this) : t,
            He(e) ? e.call(this, this) : e
          );
        }
      : e
    : t;
}
function m$(t, e) {
  return af(Ty(t), Ty(e));
}
function Ty(t) {
  if (Ve(t)) {
    const e = {};
    for (let n = 0; n < t.length; n++) e[t[n]] = t[n];
    return e;
  }
  return t;
}
function ar(t, e) {
  return t ? [...new Set([].concat(t, e))] : e;
}
function af(t, e) {
  return t ? Xt(Object.create(null), t, e) : e;
}
function YE(t, e) {
  return t
    ? Ve(t) && Ve(e)
      ? [...new Set([...t, ...e])]
      : Xt(Object.create(null), ed(t), ed(e ?? {}))
    : e;
}
function v$(t, e) {
  if (!t) return e;
  if (!e) return t;
  const n = Xt(Object.create(null), t);
  for (const r in e) n[r] = ar(t[r], e[r]);
  return n;
}
function j4() {
  return {
    app: null,
    config: {
      isNativeTag: h4,
      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 y$ = 0;
function _$(t, e) {
  return function (r, i = null) {
    He(r) || (r = Xt({}, r)),
      i != null &&
        !Pt(i) &&
        (ae("root props passed to app.mount() must be an object."), (i = null));
    const o = j4();
    Object.defineProperty(o.config, "unwrapInjectedRef", {
      get() {
        return !0;
      },
      set() {
        ae(
          "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: y$++,
      _component: r,
      _props: i,
      _container: null,
      _context: o,
      _instance: null,
      version: Ny,
      get config() {
        return o.config;
      },
      set config(c) {
        ae("app.config cannot be replaced. Modify individual options instead.");
      },
      use(c, ...u) {
        return (
          s.has(c)
            ? ae("Plugin has already been applied to target app.")
            : c && He(c.install)
            ? (s.add(c), c.install(l, ...u))
            : He(c)
            ? (s.add(c), c(l, ...u))
            : ae(
                'A plugin must either be a function or an object with an "install" function.'
              ),
          l
        );
      },
      mixin(c) {
        return (
          o.mixins.includes(c)
            ? ae(
                "Mixin has already been applied to target app" +
                  (c.name ? `: ${c.name}` : "")
              )
            : o.mixins.push(c),
          l
        );
      },
      component(c, u) {
        return (
          Dy(c, o.config),
          u
            ? (o.components[c] &&
                ae(
                  `Component "${c}" has already been registered in target app.`
                ),
              (o.components[c] = u),
              l)
            : o.components[c]
        );
      },
      directive(c, u) {
        return (
          R4(c),
          u
            ? (o.directives[c] &&
                ae(
                  `Directive "${c}" has already been registered in target app.`
                ),
              (o.directives[c] = u),
              l)
            : o.directives[c]
        );
      },
      mount(c, u, f) {
        if (a)
          ae(
            "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__ &&
            ae(
              "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),
            d7(l, Ny),
            Tg(d.component) || d.component.proxy
          );
        }
      },
      unmount() {
        a
          ? (t(null, l._container),
            (l._instance = null),
            h7(l),
            delete l._container.__vue_app__)
          : ae("Cannot unmount an app that is not mounted.");
      },
      provide(c, u) {
        return (
          c in o.provides &&
            ae(
              `App already provides property with key "${String(
                c
              )}". It will be overwritten with the new value.`
            ),
          (o.provides[c] = u),
          l
        );
      },
      runWithContext(c) {
        td = l;
        try {
          return c();
        } finally {
          td = null;
        }
      },
    });
    return l;
  };
}
let td = null;
function hi(t, e) {
  if (!cn) ae("provide() can only be used inside setup().");
  else {
    let n = cn.provides;
    const r = cn.parent && cn.parent.provides;
    r === n && (n = cn.provides = Object.create(r)), (n[t] = e);
  }
}
function hn(t, e, n = !1) {
  const r = cn || un;
  if (r || td) {
    const i = r
      ? r.parent == null
        ? r.vnode.appContext && r.vnode.appContext.provides
        : r.parent.provides
      : td._context.provides;
    if (i && t in i) return i[t];
    if (arguments.length > 1) return n && He(e) ? e.call(r && r.proxy) : e;
    ae(`injection "${String(t)}" not found.`);
  } else
    ae("inject() can only be used inside setup() or functional components.");
}
function W4() {
  return !!(cn || un || td);
}
function x$(t, e, n, r = !1) {
  const i = {},
    o = {};
  xy(o, Cg, 1), (t.propsDefaults = Object.create(null)), Y4(t, e, i, o);
  for (const s in t.propsOptions[0]) s in i || (i[s] = void 0);
  K4(e || {}, i, t),
    n
      ? (t.props = r ? i : c4(i))
      : t.type.props
      ? (t.props = i)
      : (t.props = o),
    (t.attrs = o);
}
function b$(t) {
  for (; t; ) {
    if (t.type.__hmrId) return !0;
    t = t.parent;
  }
}
function w$(t, e, n, r) {
  const {
      props: i,
      attrs: o,
      vnode: { patchFlag: s },
    } = t,
    a = Le(i),
    [l] = t.propsOptions;
  let c = !1;
  if (!b$(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 (yg(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 = Li(d);
            i[p] = Py(l, a, p, h, t, !1);
          }
        else h !== o[d] && ((o[d] = h), (c = !0));
      }
    }
  } else {
    Y4(t, e, i, o) && (c = !0);
    let u;
    for (const f in a)
      (!e || (!lt(e, f) && ((u = $c(f)) === f || !lt(e, u)))) &&
        (l
          ? n &&
            (n[f] !== void 0 || n[u] !== void 0) &&
            (i[f] = Py(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 && po(t, "set", "$attrs"), K4(e || {}, i, t);
}
function Y4(t, e, n, r) {
  const [i, o] = t.propsOptions;
  let s = !1,
    a;
  if (e)
    for (let l in e) {
      if (vf(l)) continue;
      const c = e[l];
      let u;
      i && lt(i, (u = Li(l)))
        ? !o || !o.includes(u)
          ? (n[u] = c)
          : ((a || (a = {}))[u] = c)
        : yg(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] = Py(i, l, f, c[f], t, !lt(c, f));
    }
  }
  return s;
}
function Py(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 && He(l)) {
        const { propsDefaults: c } = i;
        n in c ? (r = c[n]) : (ra(i), (r = c[n] = l.call(null, e)), Ks());
      } else r = l;
    }
    s[0] &&
      (o && !a ? (r = !1) : s[1] && (r === "" || r === $c(n)) && (r = !0));
  }
  return r;
}
function X4(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 (!He(t)) {
    const u = (f) => {
      l = !0;
      const [d, h] = X4(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 Pt(t) && r.set(t, Ic), Ic;
  if (Ve(o))
    for (let u = 0; u < o.length; u++) {
      nn(o[u]) || ae("props must be strings when using array syntax.", o[u]);
      const f = Li(o[u]);
      XE(f) && (s[f] = St);
    }
  else if (o) {
    Pt(o) || ae("invalid props options", o);
    for (const u in o) {
      const f = Li(u);
      if (XE(f)) {
        const d = o[u],
          h = (s[f] = Ve(d) || He(d) ? { type: d } : Xt({}, d));
        if (h) {
          const p = qE(Boolean, h.type),
            g = qE(String, h.type);
          (h[0] = p > -1),
            (h[1] = g < 0 || p < g),
            (p > -1 || lt(h, "default")) && a.push(f);
        }
      }
    }
  }
  const c = [s, a];
  return Pt(t) && r.set(t, c), c;
}
function XE(t) {
  return t[0] !== "$"
    ? !0
    : (ae(`Invalid prop name: "${t}" is a reserved property.`), !1);
}
function Iy(t) {
  const e = t && t.toString().match(/^\s*(function|class) (\w+)/);
  return e ? e[2] : t === null ? "null" : "";
}
function KE(t, e) {
  return Iy(t) === Iy(e);
}
function qE(t, e) {
  return Ve(e) ? e.findIndex((n) => KE(n, t)) : He(e) && KE(e, t) ? 0 : -1;
}
function K4(t, e, n) {
  const r = Le(e),
    i = n.propsOptions[0];
  for (const o in i) {
    let s = i[o];
    s != null && E$(o, r[o], s, !lt(t, o) && !lt(t, $c(o)));
  }
}
function E$(t, e, n, r) {
  const { type: i, required: o, validator: s, skipCheck: a } = n;
  if (o && r) {
    ae('Missing required prop: "' + t + '"');
    return;
  }
  if (!(e == null && !o)) {
    if (i != null && i !== !0 && !a) {
      let l = !1;
      const c = Ve(i) ? i : [i],
        u = [];
      for (let f = 0; f < c.length && !l; f++) {
        const { valid: d, expectedType: h } = C$(e, c[f]);
        u.push(h || ""), (l = d);
      }
      if (!l) {
        ae(A$(t, e, u));
        return;
      }
    }
    s &&
      !s(e) &&
      ae('Invalid prop: custom validator check failed for prop "' + t + '".');
  }
}
const S$ = Nd("String,Number,Boolean,Function,Symbol,BigInt");
function C$(t, e) {
  let n;
  const r = Iy(e);
  if (S$(r)) {
    const i = typeof t;
    (n = i === r.toLowerCase()), !n && i === "object" && (n = t instanceof e);
  } else
    r === "Object"
      ? (n = Pt(t))
      : r === "Array"
      ? (n = Ve(t))
      : r === "null"
      ? (n = t === null)
      : (n = t instanceof e);
  return { valid: n, expectedType: r };
}
function A$(t, e, n) {
  let r = `Invalid prop: type check failed for prop "${t}". Expected ${n
    .map(Uc)
    .join(" | ")}`;
  const i = n[0],
    o = $L(e),
    s = ZE(e, i),
    a = ZE(e, o);
  return (
    n.length === 1 && JE(i) && !T$(i, o) && (r += ` with value ${s}`),
    (r += `, got ${o} `),
    JE(o) && (r += `with value ${a}.`),
    r
  );
}
function ZE(t, e) {
  return e === "String" ? `"${t}"` : e === "Number" ? `${Number(t)}` : `${t}`;
}
function JE(t) {
  return ["string", "number", "boolean"].some((n) => t.toLowerCase() === n);
}
function T$(...t) {
  return t.some((e) => e.toLowerCase() === "boolean");
}
const q4 = (t) => t[0] === "_" || t === "$stable",
  bb = (t) => (Ve(t) ? t.map(Er) : [Er(t)]),
  P$ = (t, e, n) => {
    if (e._n) return e;
    const r = db(
      (...i) => (
        cn &&
          ae(
            `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.`
          ),
        bb(e(...i))
      ),
      n
    );
    return (r._c = !1), r;
  },
  Z4 = (t, e, n) => {
    const r = t._ctx;
    for (const i in t) {
      if (q4(i)) continue;
      const o = t[i];
      if (He(o)) e[i] = P$(i, o, r);
      else if (o != null) {
        ae(
          `Non-function value encountered for slot "${i}". Prefer function slots for better performance.`
        );
        const s = bb(o);
        e[i] = () => s;
      }
    }
  },
  J4 = (t, e) => {
    mu(t.vnode) ||
      ae(
        "Non-function value encountered for default slot. Prefer function slots for better performance."
      );
    const n = bb(e);
    t.slots.default = () => n;
  },
  I$ = (t, e) => {
    if (t.vnode.shapeFlag & 32) {
      const n = e._;
      n ? ((t.slots = Le(e)), xy(e, "_", n)) : Z4(e, (t.slots = {}));
    } else (t.slots = {}), e && J4(t, e);
    xy(t.slots, Cg, 1);
  },
  O$ = (t, e, n) => {
    const { vnode: r, slots: i } = t;
    let o = !0,
      s = St;
    if (r.shapeFlag & 32) {
      const a = e._;
      a
        ? Ys
          ? (Xt(i, e), po(t, "set", "$slots"))
          : n && a === 1
          ? (o = !1)
          : (Xt(i, e), !n && a === 1 && delete i._)
        : ((o = !e.$stable), Z4(e, i)),
        (s = e);
    } else e && (J4(t, e), (s = { default: 1 }));
    if (o) for (const a in i) !q4(a) && !(a in s) && delete i[a];
  };
function d0(t, e, n, r, i = !1) {
  if (Ve(t)) {
    t.forEach((d, h) => d0(d, e && (Ve(e) ? e[h] : e), n, r, i));
    return;
  }
  if (nl(r) && !i) return;
  const o = r.shapeFlag & 4 ? Tg(r.component) || r.component.proxy : r.el,
    s = i ? null : o,
    { i: a, r: l } = t;
  if (!a) {
    ae(
      "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)),
    He(l))
  )
    co(l, a, 12, [s, u]);
  else {
    const d = nn(l),
      h = pt(l);
    if (d || h) {
      const p = () => {
        if (t.f) {
          const g = d ? (lt(f, l) ? f[l] : u[l]) : l.value;
          i
            ? Ve(g) && ob(g, o)
            : Ve(g)
            ? g.includes(o) || g.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))
            : ae("Invalid template ref type:", l, `(${typeof l})`);
      };
      s ? ((p.id = -1), Gn(p, n)) : p();
    } else ae("Invalid template ref type:", l, `(${typeof l})`);
  }
}
let bs = !1;
const Ih = (t) => /svg/.test(t.namespaceURI) && t.tagName !== "foreignObject",
  Ou = (t) => t.nodeType === 8;
function R$(t) {
  const {
      mt: e,
      p: n,
      o: {
        patchProp: r,
        createText: i,
        nextSibling: o,
        parentNode: s,
        remove: a,
        insert: l,
        createComment: c,
      },
    } = t,
    u = (v, y) => {
      if (!y.hasChildNodes()) {
        ae(
          "Attempting to hydrate existing markup but container is empty. Performing full mount instead."
        ),
          n(null, v, y),
          l0(),
          (y._vnode = v);
        return;
      }
      (bs = !1),
        f(y.firstChild, v, null, null, null),
        l0(),
        (y._vnode = v),
        bs && console.error("Hydration completed but contains mismatches.");
    },
    f = (v, y, _, x, b, w = !1) => {
      const E = Ou(v) && v.data === "[",
        S = () => g(v, y, _, x, b, E),
        { type: P, ref: C, shapeFlag: A, patchFlag: T } = y;
      let I = v.nodeType;
      (y.el = v), T === -2 && ((w = !1), (y.dynamicChildren = null));
      let B = null;
      switch (P) {
        case go:
          I !== 3
            ? y.children === ""
              ? (l((y.el = i("")), s(v), v), (B = v))
              : (B = S())
            : (v.data !== y.children &&
                ((bs = !0),
                ae(`Hydration text mismatch:
- Client: ${JSON.stringify(v.data)}
- Server: ${JSON.stringify(y.children)}`),
                (v.data = y.children)),
              (B = o(v)));
          break;
        case en:
          I !== 8 || E ? (B = S()) : (B = o(v));
          break;
        case Xs:
          if ((E && ((v = o(v)), (I = v.nodeType)), I === 1 || I === 3)) {
            B = v;
            const G = !y.children.length;
            for (let D = 0; D < y.staticCount; D++)
              G && (y.children += B.nodeType === 1 ? B.outerHTML : B.data),
                D === y.staticCount - 1 && (y.anchor = B),
                (B = o(B));
            return E ? o(B) : B;
          } else S();
          break;
        case Ft:
          E ? (B = p(v, y, _, x, b, w)) : (B = S());
          break;
        default:
          if (A & 1)
            I !== 1 || y.type.toLowerCase() !== v.tagName.toLowerCase()
              ? (B = S())
              : (B = d(v, y, _, x, b, w));
          else if (A & 6) {
            y.slotScopeIds = b;
            const G = s(v);
            if (
              (e(y, G, null, _, x, Ih(G), w),
              (B = E ? m(v) : o(v)),
              B && Ou(B) && B.data === "teleport end" && (B = o(B)),
              nl(y))
            ) {
              let D;
              E
                ? ((D = R(Ft)),
                  (D.anchor = B ? B.previousSibling : G.lastChild))
                : (D = v.nodeType === 3 ? Ag("") : R("div")),
                (D.el = v),
                (y.component.subTree = D);
            }
          } else
            A & 64
              ? I !== 8
                ? (B = S())
                : (B = y.type.hydrate(v, y, _, x, b, w, t, h))
              : A & 128
              ? (B = y.type.hydrate(v, y, _, x, Ih(s(v)), b, w, t, f))
              : ae("Invalid HostVNode type:", P, `(${typeof P})`);
      }
      return C != null && d0(C, null, x, y), B;
    },
    d = (v, y, _, x, b, w) => {
      w = w || !!y.dynamicChildren;
      const { type: E, props: S, patchFlag: P, shapeFlag: C, dirs: A } = y,
        T = (E === "input" && A) || E === "option";
      {
        if ((A && no(y, null, _, "created"), S))
          if (T || !w || P & 48)
            for (const B in S)
              ((T && B.endsWith("value")) || (Fd(B) && !vf(B))) &&
                r(v, B, null, S[B], !1, void 0, _);
          else S.onClick && r(v, "onClick", null, S.onClick, !1, void 0, _);
        let I;
        if (
          ((I = S && S.onVnodeBeforeMount) && xr(I, _, y),
          A && no(y, null, _, "beforeMount"),
          ((I = S && S.onVnodeMounted) || A) &&
            P4(() => {
              I && xr(I, _, y), A && no(y, null, _, "mounted");
            }, x),
          C & 16 && !(S && (S.innerHTML || S.textContent)))
        ) {
          let B = h(v.firstChild, y, v, _, x, b, w),
            G = !1;
          for (; B; ) {
            (bs = !0),
              G ||
                (ae(
                  `Hydration children mismatch in <${y.type}>: server rendered element contains more child nodes than client vdom.`
                ),
                (G = !0));
            const D = B;
            (B = B.nextSibling), a(D);
          }
        } else
          C & 8 &&
            v.textContent !== y.children &&
            ((bs = !0),
            ae(`Hydration text content mismatch in <${y.type}>:
- Client: ${v.textContent}
- Server: ${y.children}`),
            (v.textContent = y.children));
      }
      return v.nextSibling;
    },
    h = (v, y, _, x, b, w, E) => {
      E = E || !!y.dynamicChildren;
      const S = y.children,
        P = S.length;
      let C = !1;
      for (let A = 0; A < P; A++) {
        const T = E ? S[A] : (S[A] = Er(S[A]));
        if (v) v = f(v, T, x, b, w, E);
        else {
          if (T.type === go && !T.children) continue;
          (bs = !0),
            C ||
              (ae(
                `Hydration children mismatch in <${_.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
              ),
              (C = !0)),
            n(null, T, _, null, x, b, Ih(_), w);
        }
      }
      return v;
    },
    p = (v, y, _, x, b, w) => {
      const { slotScopeIds: E } = y;
      E && (b = b ? b.concat(E) : E);
      const S = s(v),
        P = h(o(v), y, S, _, x, b, w);
      return P && Ou(P) && P.data === "]"
        ? o((y.anchor = P))
        : ((bs = !0), l((y.anchor = c("]")), S, P), P);
    },
    g = (v, y, _, x, b, w) => {
      if (
        ((bs = !0),
        ae(
          `Hydration node mismatch:
- Client vnode:`,
          y.type,
          `
- Server rendered DOM:`,
          v,
          v.nodeType === 3
            ? "(text)"
            : Ou(v) && v.data === "["
            ? "(start of fragment)"
            : ""
        ),
        (y.el = null),
        w)
      ) {
        const P = m(v);
        for (;;) {
          const C = o(v);
          if (C && C !== P) a(C);
          else break;
        }
      }
      const E = o(v),
        S = s(v);
      return a(v), n(null, y, S, E, _, x, Ih(S), b), E;
    },
    m = (v) => {
      let y = 0;
      for (; v; )
        if (
          ((v = o(v)), v && Ou(v) && (v.data === "[" && y++, v.data === "]"))
        ) {
          if (y === 0) return o(v);
          y--;
        }
      return v;
    };
  return [u, f];
}
let Ru, ks;
function Do(t, e) {
  t.appContext.config.performance && h0() && ks.mark(`vue-${e}-${t.uid}`),
    m7(t, e, h0() ? ks.now() : Date.now());
}
function Bo(t, e) {
  if (t.appContext.config.performance && h0()) {
    const n = `vue-${e}-${t.uid}`,
      r = n + ":end";
    ks.mark(r),
      ks.measure(`<${Pg(t, t.type)}> ${e}`, n, r),
      ks.clearMarks(n),
      ks.clearMarks(r);
  }
  v7(t, e, h0() ? ks.now() : Date.now());
}
function h0() {
  return (
    Ru !== void 0 ||
      (typeof window < "u" && window.performance
        ? ((Ru = !0), (ks = window.performance))
        : (Ru = !1)),
    Ru
  );
}
function M$() {
  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 Gn = P4;
function Q4(t) {
  return tO(t);
}
function eO(t) {
  return tO(t, R$);
}
function tO(t, e) {
  M$();
  const n = a0();
  (n.__VUE__ = !0), ub(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 = Ar,
      insertStaticContent: p,
    } = t,
    g = (
      O,
      U,
      W,
      ce = null,
      ue = null,
      M = null,
      N = !1,
      H = null,
      q = Ys ? !1 : !!U.dynamicChildren
    ) => {
      if (O === U) return;
      O && !Ai(O, U) && ((ce = ne(O)), te(O, ue, M, !0), (O = null)),
        U.patchFlag === -2 && ((q = !1), (U.dynamicChildren = null));
      const { type: le, ref: ye, shapeFlag: he } = U;
      switch (le) {
        case go:
          m(O, U, W, ce);
          break;
        case en:
          v(O, U, W, ce);
          break;
        case Xs:
          O == null ? y(U, W, ce, N) : _(O, U, W, N);
          break;
        case Ft:
          I(O, U, W, ce, ue, M, N, H, q);
          break;
        default:
          he & 1
            ? w(O, U, W, ce, ue, M, N, H, q)
            : he & 6
            ? B(O, U, W, ce, ue, M, N, H, q)
            : he & 64 || he & 128
            ? le.process(O, U, W, ce, ue, M, N, H, q, de)
            : ae("Invalid VNode type:", le, `(${typeof le})`);
      }
      ye != null && ue && d0(ye, O && O.ref, M, U || O, !U);
    },
    m = (O, U, W, ce) => {
      if (O == null) r((U.el = a(U.children)), W, ce);
      else {
        const ue = (U.el = O.el);
        U.children !== O.children && c(ue, U.children);
      }
    },
    v = (O, U, W, ce) => {
      O == null ? r((U.el = l(U.children || "")), W, ce) : (U.el = O.el);
    },
    y = (O, U, W, ce) => {
      [O.el, O.anchor] = p(O.children, U, W, ce, O.el, O.anchor);
    },
    _ = (O, U, W, ce) => {
      if (U.children !== O.children) {
        const ue = d(O.anchor);
        b(O), ([U.el, U.anchor] = p(U.children, W, ue, ce));
      } else (U.el = O.el), (U.anchor = O.anchor);
    },
    x = ({ el: O, anchor: U }, W, ce) => {
      let ue;
      for (; O && O !== U; ) (ue = d(O)), r(O, W, ce), (O = ue);
      r(U, W, ce);
    },
    b = ({ el: O, anchor: U }) => {
      let W;
      for (; O && O !== U; ) (W = d(O)), i(O), (O = W);
      i(U);
    },
    w = (O, U, W, ce, ue, M, N, H, q) => {
      (N = N || U.type === "svg"),
        O == null ? E(U, W, ce, ue, M, N, H, q) : C(O, U, ue, M, N, H, q);
    },
    E = (O, U, W, ce, ue, M, N, H) => {
      let q, le;
      const { type: ye, props: he, shapeFlag: j, transition: ie, dirs: Ce } = O;
      if (
        ((q = O.el = s(O.type, M, he && he.is, he)),
        j & 8
          ? u(q, O.children)
          : j & 16 &&
            P(O.children, q, null, ce, ue, M && ye !== "foreignObject", N, H),
        Ce && no(O, null, ce, "created"),
        S(q, O, O.scopeId, N, ce),
        he)
      ) {
        for (const et in he)
          et !== "value" &&
            !vf(et) &&
            o(q, et, null, he[et], M, O.children, ce, ue, L);
        "value" in he && o(q, "value", null, he.value),
          (le = he.onVnodeBeforeMount) && xr(le, ce, O);
      }
      Object.defineProperty(q, "__vnode", { value: O, enumerable: !1 }),
        Object.defineProperty(q, "__vueParentComponent", {
          value: ce,
          enumerable: !1,
        }),
        Ce && no(O, null, ce, "beforeMount");
      const Ue = (!ue || (ue && !ue.pendingBranch)) && ie && !ie.persisted;
      Ue && ie.beforeEnter(q),
        r(q, U, W),
        ((le = he && he.onVnodeMounted) || Ue || Ce) &&
          Gn(() => {
            le && xr(le, ce, O),
              Ue && ie.enter(q),
              Ce && no(O, null, ce, "mounted");
          }, ue);
    },
    S = (O, U, W, ce, ue) => {
      if ((W && h(O, W), ce)) for (let M = 0; M < ce.length; M++) h(O, ce[M]);
      if (ue) {
        let M = ue.subTree;
        if (
          (M.patchFlag > 0 && M.patchFlag & 2048 && (M = hb(M.children) || M),
          U === M)
        ) {
          const N = ue.vnode;
          S(O, N, N.scopeId, N.slotScopeIds, ue.parent);
        }
      }
    },
    P = (O, U, W, ce, ue, M, N, H, q = 0) => {
      for (let le = q; le < O.length; le++) {
        const ye = (O[le] = H ? Ms(O[le]) : Er(O[le]));
        g(null, ye, U, W, ce, ue, M, N, H);
      }
    },
    C = (O, U, W, ce, ue, M, N) => {
      const H = (U.el = O.el);
      let { patchFlag: q, dynamicChildren: le, dirs: ye } = U;
      q |= O.patchFlag & 16;
      const he = O.props || St,
        j = U.props || St;
      let ie;
      W && wa(W, !1),
        (ie = j.onVnodeBeforeUpdate) && xr(ie, W, U, O),
        ye && no(U, O, W, "beforeUpdate"),
        W && wa(W, !0),
        Ys && ((q = 0), (N = !1), (le = null));
      const Ce = ue && U.type !== "foreignObject";
      if (
        (le
          ? (A(O.dynamicChildren, le, H, W, ce, Ce, M), p0(O, U))
          : N || K(O, U, H, null, W, ce, Ce, M, !1),
        q > 0)
      ) {
        if (q & 16) T(H, U, he, j, W, ce, ue);
        else if (
          (q & 2 && he.class !== j.class && o(H, "class", null, j.class, ue),
          q & 4 && o(H, "style", he.style, j.style, ue),
          q & 8)
        ) {
          const Ue = U.dynamicProps;
          for (let et = 0; et < Ue.length; et++) {
            const Dt = Ue[et],
              Pn = he[Dt],
              yr = j[Dt];
            (yr !== Pn || Dt === "value") &&
              o(H, Dt, Pn, yr, ue, O.children, W, ce, L);
          }
        }
        q & 1 && O.children !== U.children && u(H, U.children);
      } else !N && le == null && T(H, U, he, j, W, ce, ue);
      ((ie = j.onVnodeUpdated) || ye) &&
        Gn(() => {
          ie && xr(ie, W, U, O), ye && no(U, O, W, "updated");
        }, ce);
    },
    A = (O, U, W, ce, ue, M, N) => {
      for (let H = 0; H < U.length; H++) {
        const q = O[H],
          le = U[H],
          ye =
            q.el && (q.type === Ft || !Ai(q, le) || q.shapeFlag & 70)
              ? f(q.el)
              : W;
        g(q, le, ye, null, ce, ue, M, N, !0);
      }
    },
    T = (O, U, W, ce, ue, M, N) => {
      if (W !== ce) {
        if (W !== St)
          for (const H in W)
            !vf(H) &&
              !(H in ce) &&
              o(O, H, W[H], null, N, U.children, ue, M, L);
        for (const H in ce) {
          if (vf(H)) continue;
          const q = ce[H],
            le = W[H];
          q !== le && H !== "value" && o(O, H, le, q, N, U.children, ue, M, L);
        }
        "value" in ce && o(O, "value", W.value, ce.value);
      }
    },
    I = (O, U, W, ce, ue, M, N, H, q) => {
      const le = (U.el = O ? O.el : a("")),
        ye = (U.anchor = O ? O.anchor : a(""));
      let { patchFlag: he, dynamicChildren: j, slotScopeIds: ie } = U;
      (Ys || he & 2048) && ((he = 0), (q = !1), (j = null)),
        ie && (H = H ? H.concat(ie) : ie),
        O == null
          ? (r(le, W, ce), r(ye, W, ce), P(U.children, W, ye, ue, M, N, H, q))
          : he > 0 && he & 64 && j && O.dynamicChildren
          ? (A(O.dynamicChildren, j, W, ue, M, N, H), p0(O, U))
          : K(O, U, W, ye, ue, M, N, H, q);
    },
    B = (O, U, W, ce, ue, M, N, H, q) => {
      (U.slotScopeIds = H),
        O == null
          ? U.shapeFlag & 512
            ? ue.ctx.activate(U, W, ce, N, q)
            : G(U, W, ce, ue, M, N, q)
          : D(O, U, q);
    },
    G = (O, U, W, ce, ue, M, N) => {
      const H = (O.component = lO(O, ce, ue));
      if (
        (H.type.__hmrId && l7(H),
        yf(O),
        Do(H, "mount"),
        mu(O) && (H.ctx.renderer = de),
        Do(H, "init"),
        uO(H),
        Bo(H, "init"),
        H.asyncDep)
      ) {
        if ((ue && ue.registerDep(H, $), !O.el)) {
          const q = (H.subTree = R(en));
          v(null, q, U, W);
        }
        return;
      }
      $(H, O, U, W, ue, M, N), _f(), Bo(H, "mount");
    },
    D = (O, U, W) => {
      const ce = (U.component = O.component);
      if (A7(O, U, W))
        if (ce.asyncDep && !ce.asyncResolved) {
          yf(U), z(ce, U, W), _f();
          return;
        } else (ce.next = U), s7(ce.update), ce.update();
      else (U.el = O.el), (ce.vnode = U);
    },
    $ = (O, U, W, ce, ue, M, N) => {
      const H = () => {
          if (O.isMounted) {
            let { next: ye, bu: he, u: j, parent: ie, vnode: Ce } = O,
              Ue = ye,
              et;
            yf(ye || O.vnode),
              wa(O, !1),
              ye ? ((ye.el = Ce.el), z(O, ye, N)) : (ye = Ce),
              he && $a(he),
              (et = ye.props && ye.props.onVnodeBeforeUpdate) &&
                xr(et, ie, ye, Ce),
              wa(O, !0),
              Do(O, "render");
            const Dt = Op(O);
            Bo(O, "render");
            const Pn = O.subTree;
            (O.subTree = Dt),
              Do(O, "patch"),
              g(Pn, Dt, f(Pn.el), ne(Pn), O, ue, M),
              Bo(O, "patch"),
              (ye.el = Dt.el),
              Ue === null && pb(O, Dt.el),
              j && Gn(j, ue),
              (et = ye.props && ye.props.onVnodeUpdated) &&
                Gn(() => xr(et, ie, ye, Ce), ue),
              S4(O),
              _f();
          } else {
            let ye;
            const { el: he, props: j } = U,
              { bm: ie, m: Ce, parent: Ue } = O,
              et = nl(U);
            if (
              (wa(O, !1),
              ie && $a(ie),
              !et && (ye = j && j.onVnodeBeforeMount) && xr(ye, Ue, U),
              wa(O, !0),
              he && xe)
            ) {
              const Dt = () => {
                Do(O, "render"),
                  (O.subTree = Op(O)),
                  Bo(O, "render"),
                  Do(O, "hydrate"),
                  xe(he, O.subTree, O, ue, null),
                  Bo(O, "hydrate");
              };
              et
                ? U.type.__asyncLoader().then(() => !O.isUnmounted && Dt())
                : Dt();
            } else {
              Do(O, "render");
              const Dt = (O.subTree = Op(O));
              Bo(O, "render"),
                Do(O, "patch"),
                g(null, Dt, W, ce, O, ue, M),
                Bo(O, "patch"),
                (U.el = Dt.el);
            }
            if ((Ce && Gn(Ce, ue), !et && (ye = j && j.onVnodeMounted))) {
              const Dt = U;
              Gn(() => xr(ye, Ue, Dt), ue);
            }
            (U.shapeFlag & 256 ||
              (Ue && nl(Ue.vnode) && Ue.vnode.shapeFlag & 256)) &&
              O.a &&
              Gn(O.a, ue),
              (O.isMounted = !0),
              Ey(O),
              (U = W = ce = null);
          }
        },
        q = (O.effect = new kd(H, () => Gd(le), O.scope)),
        le = (O.update = () => q.run());
      (le.id = O.uid),
        wa(O, !0),
        (q.onTrack = O.rtc ? (ye) => $a(O.rtc, ye) : void 0),
        (q.onTrigger = O.rtg ? (ye) => $a(O.rtg, ye) : void 0),
        (le.ownerInstance = O),
        le();
    },
    z = (O, U, W) => {
      U.component = O;
      const ce = O.vnode.props;
      (O.vnode = U),
        (O.next = null),
        w$(O, U.props, ce, W),
        O$(O, U.children, W),
        Rl(),
        FE(),
        Ml();
    },
    K = (O, U, W, ce, ue, M, N, H, q = !1) => {
      const le = O && O.children,
        ye = O ? O.shapeFlag : 0,
        he = U.children,
        { patchFlag: j, shapeFlag: ie } = U;
      if (j > 0) {
        if (j & 128) {
          se(le, he, W, ce, ue, M, N, H, q);
          return;
        } else if (j & 256) {
          fe(le, he, W, ce, ue, M, N, H, q);
          return;
        }
      }
      ie & 8
        ? (ye & 16 && L(le, ue, M), he !== le && u(W, he))
        : ye & 16
        ? ie & 16
          ? se(le, he, W, ce, ue, M, N, H, q)
          : L(le, ue, M, !0)
        : (ye & 8 && u(W, ""), ie & 16 && P(he, W, ce, ue, M, N, H, q));
    },
    fe = (O, U, W, ce, ue, M, N, H, q) => {
      (O = O || Ic), (U = U || Ic);
      const le = O.length,
        ye = U.length,
        he = Math.min(le, ye);
      let j;
      for (j = 0; j < he; j++) {
        const ie = (U[j] = q ? Ms(U[j]) : Er(U[j]));
        g(O[j], ie, W, null, ue, M, N, H, q);
      }
      le > ye ? L(O, ue, M, !0, !1, he) : P(U, W, ce, ue, M, N, H, q, he);
    },
    se = (O, U, W, ce, ue, M, N, H, q) => {
      let le = 0;
      const ye = U.length;
      let he = O.length - 1,
        j = ye - 1;
      for (; le <= he && le <= j; ) {
        const ie = O[le],
          Ce = (U[le] = q ? Ms(U[le]) : Er(U[le]));
        if (Ai(ie, Ce)) g(ie, Ce, W, null, ue, M, N, H, q);
        else break;
        le++;
      }
      for (; le <= he && le <= j; ) {
        const ie = O[he],
          Ce = (U[j] = q ? Ms(U[j]) : Er(U[j]));
        if (Ai(ie, Ce)) g(ie, Ce, W, null, ue, M, N, H, q);
        else break;
        he--, j--;
      }
      if (le > he) {
        if (le <= j) {
          const ie = j + 1,
            Ce = ie < ye ? U[ie].el : ce;
          for (; le <= j; )
            g(null, (U[le] = q ? Ms(U[le]) : Er(U[le])), W, Ce, ue, M, N, H, q),
              le++;
        }
      } else if (le > j) for (; le <= he; ) te(O[le], ue, M, !0), le++;
      else {
        const ie = le,
          Ce = le,
          Ue = new Map();
        for (le = Ce; le <= j; le++) {
          const ir = (U[le] = q ? Ms(U[le]) : Er(U[le]));
          ir.key != null &&
            (Ue.has(ir.key) &&
              ae(
                "Duplicate keys found during update:",
                JSON.stringify(ir.key),
                "Make sure keys are unique."
              ),
            Ue.set(ir.key, le));
        }
        let et,
          Dt = 0;
        const Pn = j - Ce + 1;
        let yr = !1,
          wh = 0;
        const _s = new Array(Pn);
        for (le = 0; le < Pn; le++) _s[le] = 0;
        for (le = ie; le <= he; le++) {
          const ir = O[le];
          if (Dt >= Pn) {
            te(ir, ue, M, !0);
            continue;
          }
          let Wi;
          if (ir.key != null) Wi = Ue.get(ir.key);
          else
            for (et = Ce; et <= j; et++)
              if (_s[et - Ce] === 0 && Ai(ir, U[et])) {
                Wi = et;
                break;
              }
          Wi === void 0
            ? te(ir, ue, M, !0)
            : ((_s[Wi - Ce] = le + 1),
              Wi >= wh ? (wh = Wi) : (yr = !0),
              g(ir, U[Wi], W, null, ue, M, N, H, q),
              Dt++);
        }
        const AE = yr ? D$(_s) : Ic;
        for (et = AE.length - 1, le = Pn - 1; le >= 0; le--) {
          const ir = Ce + le,
            Wi = U[ir],
            TE = ir + 1 < ye ? U[ir + 1].el : ce;
          _s[le] === 0
            ? g(null, Wi, W, TE, ue, M, N, H, q)
            : yr && (et < 0 || le !== AE[et] ? Y(Wi, W, TE, 2) : et--);
        }
      }
    },
    Y = (O, U, W, ce, ue = null) => {
      const { el: M, type: N, transition: H, children: q, shapeFlag: le } = O;
      if (le & 6) {
        Y(O.component.subTree, U, W, ce);
        return;
      }
      if (le & 128) {
        O.suspense.move(U, W, ce);
        return;
      }
      if (le & 64) {
        N.move(O, U, W, de);
        return;
      }
      if (N === Ft) {
        r(M, U, W);
        for (let he = 0; he < q.length; he++) Y(q[he], U, W, ce);
        r(O.anchor, U, W);
        return;
      }
      if (N === Xs) {
        x(O, U, W);
        return;
      }
      if (ce !== 2 && le & 1 && H)
        if (ce === 0) H.beforeEnter(M), r(M, U, W), Gn(() => H.enter(M), ue);
        else {
          const { leave: he, delayLeave: j, afterLeave: ie } = H,
            Ce = () => r(M, U, W),
            Ue = () => {
              he(M, () => {
                Ce(), ie && ie();
              });
            };
          j ? j(M, Ce, Ue) : Ue();
        }
      else r(M, U, W);
    },
    te = (O, U, W, ce = !1, ue = !1) => {
      const {
        type: M,
        props: N,
        ref: H,
        children: q,
        dynamicChildren: le,
        shapeFlag: ye,
        patchFlag: he,
        dirs: j,
      } = O;
      if ((H != null && d0(H, null, W, O, !0), ye & 256)) {
        U.ctx.deactivate(O);
        return;
      }
      const ie = ye & 1 && j,
        Ce = !nl(O);
      let Ue;
      if ((Ce && (Ue = N && N.onVnodeBeforeUnmount) && xr(Ue, U, O), ye & 6))
        J(O.component, W, ce);
      else {
        if (ye & 128) {
          O.suspense.unmount(W, ce);
          return;
        }
        ie && no(O, null, U, "beforeUnmount"),
          ye & 64
            ? O.type.remove(O, U, W, ue, de, ce)
            : le && (M !== Ft || (he > 0 && he & 64))
            ? L(le, U, W, !1, !0)
            : ((M === Ft && he & 384) || (!ue && ye & 16)) && L(q, U, W),
          ce && pe(O);
      }
      ((Ce && (Ue = N && N.onVnodeUnmounted)) || ie) &&
        Gn(() => {
          Ue && xr(Ue, U, O), ie && no(O, null, U, "unmounted");
        }, W);
    },
    pe = (O) => {
      const { type: U, el: W, anchor: ce, transition: ue } = O;
      if (U === Ft) {
        O.patchFlag > 0 && O.patchFlag & 2048 && ue && !ue.persisted
          ? O.children.forEach((N) => {
              N.type === en ? i(N.el) : pe(N);
            })
          : F(W, ce);
        return;
      }
      if (U === Xs) {
        b(O);
        return;
      }
      const M = () => {
        i(W), ue && !ue.persisted && ue.afterLeave && ue.afterLeave();
      };
      if (O.shapeFlag & 1 && ue && !ue.persisted) {
        const { leave: N, delayLeave: H } = ue,
          q = () => N(W, M);
        H ? H(O.el, M, q) : q();
      } else M();
    },
    F = (O, U) => {
      let W;
      for (; O !== U; ) (W = d(O)), i(O), (O = W);
      i(U);
    },
    J = (O, U, W) => {
      O.type.__hmrId && c7(O);
      const { bum: ce, scope: ue, update: M, subTree: N, um: H } = O;
      ce && $a(ce),
        ue.stop(),
        M && ((M.active = !1), te(N, O, U, W)),
        H && Gn(H, U),
        Gn(() => {
          O.isUnmounted = !0;
        }, U),
        U &&
          U.pendingBranch &&
          !U.isUnmounted &&
          O.asyncDep &&
          !O.asyncResolved &&
          O.suspenseId === U.pendingId &&
          (U.deps--, U.deps === 0 && U.resolve()),
        g7(O);
    },
    L = (O, U, W, ce = !1, ue = !1, M = 0) => {
      for (let N = M; N < O.length; N++) te(O[N], U, W, ce, ue);
    },
    ne = (O) =>
      O.shapeFlag & 6
        ? ne(O.component.subTree)
        : O.shapeFlag & 128
        ? O.suspense.next()
        : d(O.anchor || O.el),
    ee = (O, U, W) => {
      O == null
        ? U._vnode && te(U._vnode, null, null, !0)
        : g(U._vnode || null, O, U, null, null, null, W),
        FE(),
        l0(),
        (U._vnode = O);
    },
    de = {
      p: g,
      um: te,
      m: Y,
      r: pe,
      mt: G,
      mc: P,
      pc: K,
      pbc: A,
      n: ne,
      o: t,
    };
  let ge, xe;
  return (
    e && ([ge, xe] = e(de)), { render: ee, hydrate: ge, createApp: _$(ee, ge) }
  );
}
function wa({ effect: t, update: e }, n) {
  t.allowRecurse = e.allowRecurse = n;
}
function p0(t, e, n = !1) {
  const r = t.children,
    i = e.children;
  if (Ve(r) && Ve(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] = Ms(i[o])), (a.el = s.el)),
        n || p0(s, a)),
        a.type === go && (a.el = s.el),
        a.type === en && !a.el && (a.el = s.el);
    }
}
function D$(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 B$ = (t) => t.__isTeleport,
  Mc = (t) => t && (t.disabled || t.disabled === ""),
  QE = (t) => typeof SVGElement < "u" && t instanceof SVGElement,
  Oy = (t, e) => {
    const n = t && t.to;
    if (nn(n))
      if (e) {
        const r = e(n);
        return (
          r ||
            ae(
              `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 (
          ae(
            "Current renderer does not support string target for Teleports. (missing querySelector renderer option)"
          ),
          null
        );
    else return !n && !Mc(t) && ae(`Invalid Teleport target: ${n}`), n;
  },
  k$ = {
    __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: g, createComment: m },
        } = c,
        v = Mc(e.props);
      let { shapeFlag: y, children: _, dynamicChildren: x } = e;
      if ((Ys && ((l = !1), (x = null)), t == null)) {
        const b = (e.el = m("teleport start")),
          w = (e.anchor = m("teleport end"));
        h(b, n, r), h(w, n, r);
        const E = (e.target = Oy(e.props, p)),
          S = (e.targetAnchor = g(""));
        E
          ? (h(S, E), (s = s || QE(E)))
          : v || ae("Invalid Teleport target on mount:", E, `(${typeof E})`);
        const P = (C, A) => {
          y & 16 && u(_, C, A, i, o, s, a, l);
        };
        v ? 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 = Mc(t.props),
          P = S ? n : w,
          C = S ? b : E;
        if (
          ((s = s || QE(w)),
          x
            ? (d(t.dynamicChildren, x, P, i, o, s, a), p0(t, e, !0))
            : l || f(t, e, P, C, i, o, s, a, !1),
          v)
        )
          S || Oh(e, n, b, c, 1);
        else if ((e.props && e.props.to) !== (t.props && t.props.to)) {
          const A = (e.target = Oy(e.props, p));
          A
            ? Oh(e, A, null, c, 0)
            : ae("Invalid Teleport target on update:", w, `(${typeof w})`);
        } else S && Oh(e, w, E, c, 1);
      }
      nO(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 || !Mc(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: Oh,
    hydrate: N$,
  };
function Oh(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 || Mc(u)) && l & 16))
    for (let d = 0; d < c.length; d++) i(c[d], e, n, 2);
  f && r(a, e, n);
}
function N$(
  t,
  e,
  n,
  r,
  i,
  o,
  { o: { nextSibling: s, parentNode: a, querySelector: l } },
  c
) {
  const u = (e.target = Oy(e.props, l));
  if (u) {
    const f = u._lpa || u.firstChild;
    if (e.shapeFlag & 16)
      if (Mc(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);
      }
    nO(e);
  }
  return e.anchor && s(e.anchor);
}
const Eg = k$;
function nO(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"),
  go = Symbol.for("v-txt"),
  en = Symbol.for("v-cmt"),
  Xs = Symbol.for("v-stc"),
  wf = [];
let Tr = null;
function Sg(t = !1) {
  wf.push((Tr = t ? null : []));
}
function rO() {
  wf.pop(), (Tr = wf[wf.length - 1] || null);
}
let hl = 1;
function Ry(t) {
  hl += t;
}
function iO(t) {
  return (
    (t.dynamicChildren = hl > 0 ? Tr || Ic : null),
    rO(),
    hl > 0 && Tr && Tr.push(t),
    t
  );
}
function F$(t, e, n, r, i, o) {
  return iO(Eb(t, e, n, r, i, o, !0));
}
function wb(t, e, n, r, i) {
  return iO(R(t, e, n, r, i, !0));
}
function mo(t) {
  return t ? t.__v_isVNode === !0 : !1;
}
function Ai(t, e) {
  return e.shapeFlag & 6 && hc.has(e.type)
    ? ((t.shapeFlag &= -257), (e.shapeFlag &= -513), !1)
    : t.type === e.type && t.key === e.key;
}
let My;
function L$(t) {
  My = t;
}
const $$ = (...t) => U$(...(My ? My(t, un) : t)),
  Cg = "__vInternal",
  oO = ({ key: t }) => t ?? null,
  Rp = ({ ref: t, ref_key: e, ref_for: n }) => (
    typeof t == "number" && (t = "" + t),
    t != null
      ? nn(t) || pt(t) || He(t)
        ? { i: un, r: t, k: e, f: !!n }
        : t
      : null
  );
function Eb(
  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 && oO(e),
    ref: e && Rp(e),
    scopeId: _g,
    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: un,
  };
  return (
    a
      ? (Sb(l, n), o & 128 && t.normalize(l))
      : n && (l.shapeFlag |= nn(n) ? 8 : 16),
    l.key !== l.key &&
      ae("VNode created with invalid key (NaN). VNode type:", l.type),
    hl > 0 &&
      !s &&
      Tr &&
      (l.patchFlag > 0 || o & 6) &&
      l.patchFlag !== 32 &&
      Tr.push(l),
    l
  );
}
const R = $$;
function U$(t, e = null, n = null, r = 0, i = null, o = !1) {
  if (
    ((!t || t === U4) &&
      (t || ae(`Invalid vnode type when creating vnode: ${t}.`), (t = en)),
    mo(t))
  ) {
    const a = vi(t, e, !0);
    return (
      n && Sb(a, n),
      hl > 0 &&
        !o &&
        Tr &&
        (a.shapeFlag & 6 ? (Tr[Tr.indexOf(t)] = a) : Tr.push(a)),
      (a.patchFlag |= -2),
      a
    );
  }
  if ((hO(t) && (t = t.__vccOpts), e)) {
    e = sO(e);
    let { class: a, style: l } = e;
    a && !nn(a) && (e.class = Ud(a)),
      Pt(l) && (Xf(l) && !Ve(l) && (l = Xt({}, l)), (e.style = $d(l)));
  }
  const s = nn(t) ? 1 : T4(t) ? 128 : B$(t) ? 64 : Pt(t) ? 4 : He(t) ? 2 : 0;
  return (
    s & 4 &&
      Xf(t) &&
      ((t = Le(t)),
      ae(
        "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
      )),
    Eb(t, e, n, r, i, s, o, !0)
  );
}
function sO(t) {
  return t ? (Xf(t) || Cg 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 && oO(a),
    ref:
      e && e.ref
        ? n && i
          ? Ve(i)
            ? i.concat(Rp(e))
            : [i, Rp(e)]
          : Rp(e)
        : i,
    scopeId: t.scopeId,
    slotScopeIds: t.slotScopeIds,
    children: o === -1 && Ve(s) ? s.map(aO) : 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 aO(t) {
  const e = vi(t);
  return Ve(t.children) && (e.children = t.children.map(aO)), e;
}
function Ag(t = " ", e = 0) {
  return R(go, null, t, e);
}
function G$(t, e) {
  const n = R(Xs, null, t);
  return (n.staticCount = e), n;
}
function H$(t = "", e = !1) {
  return e ? (Sg(), wb(en, null, t)) : R(en, null, t);
}
function Er(t) {
  return t == null || typeof t == "boolean"
    ? R(en)
    : Ve(t)
    ? R(Ft, null, t.slice())
    : typeof t == "object"
    ? Ms(t)
    : R(go, null, String(t));
}
function Ms(t) {
  return (t.el === null && t.patchFlag !== -1) || t.memo ? t : vi(t);
}
function Sb(t, e) {
  let n = 0;
  const { shapeFlag: r } = t;
  if (e == null) e = null;
  else if (Ve(e)) n = 16;
  else if (typeof e == "object")
    if (r & 65) {
      const i = e.default;
      i && (i._c && (i._d = !1), Sb(t, i()), i._c && (i._d = !0));
      return;
    } else {
      n = 32;
      const i = e._;
      !i && !(Cg in e)
        ? (e._ctx = un)
        : i === 3 &&
          un &&
          (un.slots._ === 1 ? (e._ = 1) : ((e._ = 2), (t.patchFlag |= 1024)));
    }
  else
    He(e)
      ? ((e = { default: e, _ctx: un }), (n = 32))
      : ((e = String(e)), r & 64 ? ((n = 16), (e = [Ag(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 = Ud([e.class, r.class]));
      else if (i === "style") e.style = $d([e.style, r.style]);
      else if (Fd(i)) {
        const o = e[i],
          s = r[i];
        s &&
          o !== s &&
          !(Ve(o) && o.includes(s)) &&
          (e[i] = o ? [].concat(o, s) : s);
      } else i !== "" && (e[i] = r[i]);
  }
  return e;
}
function xr(t, e, n, r = null) {
  Vr(t, e, 7, [n, r]);
}
const V$ = j4();
let z$ = 0;
function lO(t, e, n) {
  const r = t.type,
    i = (e ? e.appContext : t.appContext) || V$,
    o = {
      uid: z$++,
      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: X4(r, i),
      emitsOptions: A4(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 = K7(o)),
    (o.root = e ? e.root : o),
    (o.emit = _7.bind(null, o)),
    t.ce && t.ce(o),
    o
  );
}
let cn = null;
const yt = () => cn || un;
let Cb,
  zl,
  eS = "__VUE_INSTANCE_SETTERS__";
(zl = a0()[eS]) || (zl = a0()[eS] = []),
  zl.push((t) => (cn = t)),
  (Cb = (t) => {
    zl.length > 1 ? zl.forEach((e) => e(t)) : zl[0](t);
  });
const ra = (t) => {
    Cb(t), t.scope.on();
  },
  Ks = () => {
    cn && cn.scope.off(), Cb(null);
  },
  j$ = Nd("slot,component");
function Dy(t, e) {
  const n = e.isNativeTag || h4;
  (j$(t) || n(t)) &&
    ae("Do not use built-in or reserved HTML elements as component id: " + t);
}
function cO(t) {
  return t.vnode.shapeFlag & 4;
}
let Hc = !1;
function uO(t, e = !1) {
  Hc = e;
  const { props: n, children: r } = t.vnode,
    i = cO(t);
  x$(t, n, i, e), I$(t, r);
  const o = i ? W$(t, e) : void 0;
  return (Hc = !1), o;
}
function W$(t, e) {
  var n;
  const r = t.type;
  {
    if ((r.name && Dy(r.name, t.appContext.config), r.components)) {
      const o = Object.keys(r.components);
      for (let s = 0; s < o.length; s++) Dy(o[s], t.appContext.config);
    }
    if (r.directives) {
      const o = Object.keys(r.directives);
      for (let s = 0; s < o.length; s++) R4(o[s]);
    }
    r.compilerOptions &&
      Ab() &&
      ae(
        '"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 = ao(new Proxy(t.ctx, bf))),
    q7(t);
  const { setup: i } = r;
  if (i) {
    const o = (t.setupContext = i.length > 1 ? dO(t) : null);
    ra(t), Rl();
    const s = co(i, t, 0, [_c(t.props), o]);
    if ((Ml(), Ks(), gg(s))) {
      if ((s.then(Ks, Ks), e))
        return s
          .then((a) => {
            By(t, a, e);
          })
          .catch((a) => {
            Bl(a, t, 0);
          });
      if (((t.asyncDep = s), !t.suspense)) {
        const a = (n = r.name) != null ? n : "Anonymous";
        ae(
          `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 By(t, s, e);
  } else fO(t, e);
}
function By(t, e, n) {
  He(e)
    ? t.type.__ssrInlineRender
      ? (t.ssrRender = e)
      : (t.render = e)
    : Pt(e)
    ? (mo(e) &&
        ae(
          "setup() should not return VNodes directly - return a render function instead."
        ),
      (t.devtoolsRawSetupState = e),
      (t.setupState = ib(e)),
      Z7(t))
    : e !== void 0 &&
      ae(
        `setup() should return an object. Received: ${
          e === null ? "null" : typeof e
        }`
      ),
    fO(t, n);
}
let Ef, ky;
function Y$(t) {
  (Ef = t),
    (ky = (e) => {
      e.render._rc && (e.withProxy = new Proxy(e.ctx, X7));
    });
}
const Ab = () => !Ef;
function fO(t, e, n) {
  const r = t.type;
  if (!t.render) {
    if (!e && Ef && !r.render) {
      const i = r.template || xb(t).template;
      if (i) {
        Do(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 = Ef(i, c)), Bo(t, "compile");
      }
    }
    (t.render = r.render || Ar), ky && ky(t);
  }
  ra(t),
    Rl(),
    h$(t),
    Ml(),
    Ks(),
    !r.render &&
      t.render === Ar &&
      !e &&
      (!Ef && r.template
        ? ae(
            '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".'
          )
        : ae("Component is missing template or render function."));
}
function X$(t) {
  return (
    t.attrsProxy ||
    (t.attrsProxy = new Proxy(t.attrs, {
      get(e, n) {
        return c0(), nr(t, "get", "$attrs"), e[n];
      },
      set() {
        return ae("setupContext.attrs is readonly."), !1;
      },
      deleteProperty() {
        return ae("setupContext.attrs is readonly."), !1;
      },
    }))
  );
}
function K$(t) {
  return (
    t.slotsProxy ||
    (t.slotsProxy = new Proxy(t.slots, {
      get(e, n) {
        return nr(t, "get", "$slots"), e[n];
      },
    }))
  );
}
function dO(t) {
  return Object.freeze({
    get attrs() {
      return X$(t);
    },
    get slots() {
      return K$(t);
    },
    get emit() {
      return (n, ...r) => t.emit(n, ...r);
    },
    expose: (n) => {
      if (
        (t.exposed && ae("expose() should be called only once per setup()."),
        n != null)
      ) {
        let r = typeof n;
        r === "object" && (Ve(n) ? (r = "array") : pt(n) && (r = "ref")),
          r !== "object" &&
            ae(`expose() should be passed a plain object, received ${r}.`);
      }
      t.exposed = n || {};
    },
  });
}
function Tg(t) {
  if (t.exposed)
    return (
      t.exposeProxy ||
      (t.exposeProxy = new Proxy(ib(ao(t.exposed)), {
        get(e, n) {
          if (n in e) return e[n];
          if (n in rl) return rl[n](t);
        },
        has(e, n) {
          return n in e || n in rl;
        },
      }))
    );
}
const q$ = /(?:^|[-_])(\w)/g,
  Z$ = (t) => t.replace(q$, (e) => e.toUpperCase()).replace(/[-_]/g, "");
function nd(t, e = !0) {
  return He(t) ? t.displayName || t.name : t.name || (e && t.__name);
}
function Pg(t, e, n = !1) {
  let r = nd(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 ? Z$(r) : n ? "App" : "Anonymous";
}
function hO(t) {
  return He(t) && "__vccOpts" in t;
}
const re = (t, e) => kL(t, e, Hc);
function Bn(t, e, n) {
  const r = arguments.length;
  return r === 2
    ? Pt(e) && !Ve(e)
      ? mo(e)
        ? R(t, null, [e])
        : R(t, e)
      : R(t, null, e)
    : (r > 3
        ? (n = Array.prototype.slice.call(arguments, 2))
        : r === 3 && mo(n) && (n = [n]),
      R(t, e, n));
}
const pO = Symbol.for("v-scx"),
  gO = () => {
    {
      const t = hn(pO);
      return (
        t ||
          ae(
            "Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."
          ),
        t
      );
    }
  };
function zm(t) {
  return !!(t && t.__v_isShallow);
}
function mO() {
  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 Pt(f)
          ? f.__isVue
            ? ["div", t, "VueInstance"]
            : pt(f)
            ? ["div", {}, ["span", t, u(f)], "<", a(f.value), ">"]
            : ki(f)
            ? [
                "div",
                {},
                ["span", t, zm(f) ? "ShallowReactive" : "Reactive"],
                "<",
                a(f),
                `>${is(f) ? " (readonly)" : ""}`,
              ]
            : is(f)
            ? [
                "div",
                {},
                ["span", t, zm(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]
      : Pt(f)
      ? ["object", { object: d ? Le(f) : f }]
      : ["span", n, String(f)];
  }
  function l(f, d) {
    const h = f.type;
    if (He(h)) return;
    const p = {};
    for (const g in f.ctx) c(h, g, d) && (p[g] = f.ctx[g]);
    return p;
  }
  function c(f, d, h) {
    const p = f[h];
    if (
      (Ve(p) && p.includes(d)) ||
      (Pt(p) && d in p) ||
      (f.extends && c(f.extends, d, h)) ||
      (f.mixins && f.mixins.some((g) => c(g, d, h)))
    )
      return !0;
  }
  function u(f) {
    return zm(f) ? "ShallowRef" : f.effect ? "ComputedRef" : "Ref";
  }
  window.devtoolsFormatters
    ? window.devtoolsFormatters.push(i)
    : (window.devtoolsFormatters = [i]);
}
function J$(t, e, n, r) {
  const i = n[r];
  if (i && vO(i, t)) return i;
  const o = e();
  return (o.memo = t.slice()), (n[r] = o);
}
function vO(t, e) {
  const n = t.memo;
  if (n.length != e.length) return !1;
  for (let r = 0; r < n.length; r++) if (_y(n[r], e[r])) return !1;
  return hl > 0 && Tr && Tr.push(t), !0;
}
const Ny = "3.3.4",
  Q$ = {
    createComponentInstance: lO,
    setupComponent: uO,
    renderComponentRoot: Op,
    setCurrentRenderingInstance: Jf,
    isVNode: mo,
    normalizeVNode: Er,
  },
  eU = Q$,
  tU = null,
  nU = null;
function Tb(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 jm = Object.freeze({}),
  rU = /^on[^a-z]/,
  iU = (t) => rU.test(t),
  oU = (t) => t.startsWith("onUpdate:"),
  zd = Object.assign,
  Mr = Array.isArray,
  jd = (t) => _O(t) === "[object Set]",
  tS = (t) => _O(t) === "[object Date]",
  yO = (t) => typeof t == "function",
  rd = (t) => typeof t == "string",
  nS = (t) => typeof t == "symbol",
  Fy = (t) => t !== null && typeof t == "object",
  sU = Object.prototype.toString,
  _O = (t) => sU.call(t),
  Pb = (t) => {
    const e = Object.create(null);
    return (n) => e[n] || (e[n] = t(n));
  },
  aU = /-(\w)/g,
  Wm = Pb((t) => t.replace(aU, (e, n) => (n ? n.toUpperCase() : ""))),
  lU = /\B([A-Z])/g,
  Ns = Pb((t) => t.replace(lU, "-$1").toLowerCase()),
  cU = Pb((t) => t.charAt(0).toUpperCase() + t.slice(1)),
  uU = (t, e) => {
    for (let n = 0; n < t.length; n++) t[n](e);
  },
  Ly = (t) => {
    const e = parseFloat(t);
    return isNaN(e) ? t : e;
  },
  $y = (t) => {
    const e = rd(t) ? Number(t) : NaN;
    return isNaN(e) ? t : e;
  },
  fU =
    "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",
  dU =
    "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",
  hU = Tb(fU),
  pU = Tb(dU),
  gU =
    "itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",
  mU = Tb(gU);
function xO(t) {
  return !!t || t === "";
}
function vU(t, e) {
  if (t.length !== e.length) return !1;
  let n = !0;
  for (let r = 0; n && r < t.length; r++) n = ia(t[r], e[r]);
  return n;
}
function ia(t, e) {
  if (t === e) return !0;
  let n = tS(t),
    r = tS(e);
  if (n || r) return n && r ? t.getTime() === e.getTime() : !1;
  if (((n = nS(t)), (r = nS(e)), n || r)) return t === e;
  if (((n = Mr(t)), (r = Mr(e)), n || r)) return n && r ? vU(t, e) : !1;
  if (((n = Fy(t)), (r = Fy(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) || !ia(t[s], e[s])) return !1;
    }
  }
  return String(t) === String(e);
}
function Ig(t, e) {
  return t.findIndex((n) => ia(n, e));
}
const yU = "http://www.w3.org/2000/svg",
  Ua = typeof document < "u" ? document : null,
  rS = Ua && Ua.createElement("template"),
  _U = {
    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
        ? Ua.createElementNS(yU, t)
        : Ua.createElement(t, n ? { is: n } : void 0);
      return (
        t === "select" &&
          r &&
          r.multiple != null &&
          i.setAttribute("multiple", r.multiple),
        i
      );
    },
    createText: (t) => Ua.createTextNode(t),
    createComment: (t) => Ua.createComment(t),
    setText: (t, e) => {
      t.nodeValue = e;
    },
    setElementText: (t, e) => {
      t.textContent = e;
    },
    parentNode: (t) => t.parentNode,
    nextSibling: (t) => t.nextSibling,
    querySelector: (t) => Ua.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 {
        rS.innerHTML = r ? `<svg>${t}</svg>` : t;
        const a = rS.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 xU(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 bU(t, e, n) {
  const r = t.style,
    i = rd(n);
  if (n && !i) {
    if (e && !rd(e)) for (const o in e) n[o] == null && Uy(r, o, "");
    for (const o in n) Uy(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 wU = /[^\\];\s*$/,
  iS = /\s*!important$/;
function Uy(t, e, n) {
  if (Mr(n)) n.forEach((r) => Uy(t, e, r));
  else if (
    (n == null && (n = ""),
    wU.test(n) &&
      ae(`Unexpected semicolon at the end of '${e}' style value: '${n}'`),
    e.startsWith("--"))
  )
    t.setProperty(e, n);
  else {
    const r = EU(t, e);
    iS.test(n)
      ? t.setProperty(Ns(r), n.replace(iS, ""), "important")
      : (t[r] = n);
  }
}
const oS = ["Webkit", "Moz", "ms"],
  Ym = {};
function EU(t, e) {
  const n = Ym[e];
  if (n) return n;
  let r = Li(e);
  if (r !== "filter" && r in t) return (Ym[e] = r);
  r = cU(r);
  for (let i = 0; i < oS.length; i++) {
    const o = oS[i] + r;
    if (o in t) return (Ym[e] = o);
  }
  return e;
}
const sS = "http://www.w3.org/1999/xlink";
function SU(t, e, n, r, i) {
  if (r && e.startsWith("xlink:"))
    n == null
      ? t.removeAttributeNS(sS, e.slice(6, e.length))
      : t.setAttributeNS(sS, e, n);
  else {
    const o = mU(e);
    n == null || (o && !xO(n))
      ? t.removeAttribute(e)
      : t.setAttribute(e, o ? "" : n);
  }
}
function CU(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 = xO(n))
      : n == null && c === "string"
      ? ((n = ""), (l = !0))
      : c === "number" && ((n = 0), (l = !0));
  }
  try {
    t[e] = n;
  } catch (c) {
    l ||
      ae(
        `Failed setting prop "${e}" on <${a.toLowerCase()}>: value ${n} is invalid.`,
        c
      );
  }
  l && t.removeAttribute(e);
}
function Vo(t, e, n, r) {
  t.addEventListener(e, n, r);
}
function AU(t, e, n, r) {
  t.removeEventListener(e, n, r);
}
function TU(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] = PU(e);
    if (r) {
      const c = (o[e] = RU(r, i));
      Vo(t, a, c, l);
    } else s && (AU(t, a, s, l), (o[e] = void 0));
  }
}
const aS = /(?:Once|Passive|Capture)$/;
function PU(t) {
  let e;
  if (aS.test(t)) {
    e = {};
    let r;
    for (; (r = t.match(aS)); )
      (t = t.slice(0, t.length - r[0].length)), (e[r[0].toLowerCase()] = !0);
  }
  return [t[2] === ":" ? t.slice(3) : Ns(t.slice(2)), e];
}
let Xm = 0;
const IU = Promise.resolve(),
  OU = () => Xm || (IU.then(() => (Xm = 0)), (Xm = Date.now()));
function RU(t, e) {
  const n = (r) => {
    if (!r._vts) r._vts = Date.now();
    else if (r._vts <= n.attached) return;
    Vr(MU(r, n.value), e, 5, [r]);
  };
  return (n.value = t), (n.attached = OU()), n;
}
function MU(t, e) {
  if (Mr(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 lS = /^on[a-z]/,
  DU = (t, e, n, r, i = !1, o, s, a, l) => {
    e === "class"
      ? xU(t, r, i)
      : e === "style"
      ? bU(t, n, r)
      : iU(e)
      ? oU(e) || TU(t, e, n, r, s)
      : (
          e[0] === "."
            ? ((e = e.slice(1)), !0)
            : e[0] === "^"
            ? ((e = e.slice(1)), !1)
            : BU(t, e, r, i)
        )
      ? CU(t, e, r, o, s, a, l)
      : (e === "true-value"
          ? (t._trueValue = r)
          : e === "false-value" && (t._falseValue = r),
        SU(t, e, r, i));
  };
function BU(t, e, n, r) {
  return r
    ? !!(
        e === "innerHTML" ||
        e === "textContent" ||
        (e in t && lS.test(e) && yO(n))
      )
    : e === "spellcheck" ||
      e === "draggable" ||
      e === "translate" ||
      e === "form" ||
      (e === "list" && t.tagName === "INPUT") ||
      (e === "type" && t.tagName === "TEXTAREA") ||
      (lS.test(e) && rd(n))
    ? !1
    : e in t;
}
function bO(t, e) {
  const n = we(t);
  class r extends Og {
    constructor(o) {
      super(n, o, e);
    }
  }
  return (r.def = n), r;
}
const kU = (t) => bO(t, FO),
  NU = typeof HTMLElement < "u" ? HTMLElement : class {};
class Og extends NU {
  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 &&
            ae(
              "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 || (Vy(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 && !Mr(o))
          for (const l in o) {
            const c = o[l];
            (c === Number || (c && c.type === Number)) &&
              (l in this._props && (this._props[l] = $y(this._props[l])),
              ((a || (a = Object.create(null)))[Wm(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 = Mr(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(Wm))
      Object.defineProperty(this, i, {
        get() {
          return this._getProp(i);
        },
        set(o) {
          this._setProp(i, o);
        },
      });
  }
  _setAttr(e) {
    let n = this.getAttribute(e);
    const r = Wm(e);
    this._numberProps && this._numberProps[r] && (n = $y(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(Ns(e), "")
          : typeof n == "string" || typeof n == "number"
          ? this.setAttribute(Ns(e), n + "")
          : n || this.removeAttribute(Ns(e))));
  }
  _update() {
    Vy(this._createVNode(), this.shadowRoot);
  }
  _createVNode() {
    const e = R(this._def, zd({}, 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), Ns(o) !== o && r(Ns(o), s);
          };
          let i = this;
          for (; (i = i && (i.parentNode || i.host)); )
            if (i instanceof Og) {
              (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 FU(t = "$style") {
  {
    const e = yt();
    if (!e) return ae("useCssModule must be called inside setup()"), jm;
    const n = e.type.__cssModules;
    if (!n)
      return ae("Current instance does not have CSS modules injected."), jm;
    const r = n[t];
    return (
      r || (ae(`Current instance does not have CSS module named "${t}".`), jm)
    );
  }
}
function LU(t) {
  const e = yt();
  if (!e) {
    ae("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) => Hy(o, i));
    }),
    r = () => {
      const i = t(e.proxy);
      Gy(e.subTree, i), n(i);
    };
  I4(r),
    Ht(() => {
      const i = new MutationObserver(r);
      i.observe(e.subTree.el.parentNode, { childList: !0 }),
        ms(() => i.disconnect());
    });
}
function Gy(t, e) {
  if (t.shapeFlag & 128) {
    const n = t.suspense;
    (t = n.activeBranch),
      n.pendingBranch &&
        !n.isHydrating &&
        n.effects.push(() => {
          Gy(n.activeBranch, e);
        });
  }
  for (; t.component; ) t = t.component.subTree;
  if (t.shapeFlag & 1 && t.el) Hy(t.el, e);
  else if (t.type === Ft) t.children.forEach((n) => Gy(n, e));
  else if (t.type === Xs) {
    let { el: n, anchor: r } = t;
    for (; n && (Hy(n, e), n !== r); ) n = n.nextSibling;
  }
}
function Hy(t, e) {
  if (t.nodeType === 1) {
    const n = t.style;
    for (const r in e) n.setProperty(`--${r}`, e[r]);
  }
}
const ws = "transition",
  Mu = "animation",
  Wd = (t, { slots: e }) => Bn(M4, EO(t), e);
Wd.displayName = "Transition";
const wO = {
    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,
  },
  $U = (Wd.props = zd({}, vb, wO)),
  Ea = (t, e = []) => {
    Mr(t) ? t.forEach((n) => n(...e)) : t && t(...e);
  },
  cS = (t) => (t ? (Mr(t) ? t.some((e) => e.length > 1) : t.length > 1) : !1);
function EO(t) {
  const e = {};
  for (const T in t) T in wO || (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 = UU(i),
    g = p && p[0],
    m = p && p[1],
    {
      onBeforeEnter: v,
      onEnter: y,
      onEnterCancelled: _,
      onLeave: x,
      onLeaveCancelled: b,
      onBeforeAppear: w = v,
      onAppear: E = y,
      onAppearCancelled: S = _,
    } = e,
    P = (T, I, B) => {
      Os(T, I ? u : a), Os(T, I ? c : s), B && B();
    },
    C = (T, I) => {
      (T._isLeaving = !1), Os(T, f), Os(T, h), Os(T, d), I && I();
    },
    A = (T) => (I, B) => {
      const G = T ? E : y,
        D = () => P(I, T, B);
      Ea(G, [I, D]),
        uS(() => {
          Os(I, T ? l : o), ko(I, T ? u : a), cS(G) || fS(I, r, g, D);
        });
    };
  return zd(e, {
    onBeforeEnter(T) {
      Ea(v, [T]), ko(T, o), ko(T, s);
    },
    onBeforeAppear(T) {
      Ea(w, [T]), ko(T, l), ko(T, c);
    },
    onEnter: A(!1),
    onAppear: A(!0),
    onLeave(T, I) {
      T._isLeaving = !0;
      const B = () => C(T, I);
      ko(T, f),
        CO(),
        ko(T, d),
        uS(() => {
          T._isLeaving && (Os(T, f), ko(T, h), cS(x) || fS(T, r, m, B));
        }),
        Ea(x, [T, B]);
    },
    onEnterCancelled(T) {
      P(T, !1), Ea(_, [T]);
    },
    onAppearCancelled(T) {
      P(T, !0), Ea(S, [T]);
    },
    onLeaveCancelled(T) {
      C(T), Ea(b, [T]);
    },
  });
}
function UU(t) {
  if (t == null) return null;
  if (Fy(t)) return [Km(t.enter), Km(t.leave)];
  {
    const e = Km(t);
    return [e, e];
  }
}
function Km(t) {
  const e = $y(t);
  return sb(e, "<transition> explicit duration"), e;
}
function ko(t, e) {
  e.split(/\s+/).forEach((n) => n && t.classList.add(n)),
    (t._vtc || (t._vtc = new Set())).add(e);
}
function Os(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 uS(t) {
  requestAnimationFrame(() => {
    requestAnimationFrame(t);
  });
}
let GU = 0;
function fS(t, e, n, r) {
  const i = (t._endId = ++GU),
    o = () => {
      i === t._endId && r();
    };
  if (n) return setTimeout(o, n);
  const { type: s, timeout: a, propCount: l } = SO(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 SO(t, e) {
  const n = window.getComputedStyle(t),
    r = (p) => (n[p] || "").split(", "),
    i = r(`${ws}Delay`),
    o = r(`${ws}Duration`),
    s = dS(i, o),
    a = r(`${Mu}Delay`),
    l = r(`${Mu}Duration`),
    c = dS(a, l);
  let u = null,
    f = 0,
    d = 0;
  e === ws
    ? s > 0 && ((u = ws), (f = s), (d = o.length))
    : e === Mu
    ? c > 0 && ((u = Mu), (f = c), (d = l.length))
    : ((f = Math.max(s, c)),
      (u = f > 0 ? (s > c ? ws : Mu) : null),
      (d = u ? (u === ws ? o.length : l.length) : 0));
  const h =
    u === ws && /\b(transform|all)(,|$)/.test(r(`${ws}Property`).toString());
  return { type: u, timeout: f, propCount: d, hasTransform: h };
}
function dS(t, e) {
  for (; t.length < e.length; ) t = t.concat(t);
  return Math.max(...e.map((n, r) => hS(n) + hS(t[r])));
}
function hS(t) {
  return Number(t.slice(0, -1).replace(",", ".")) * 1e3;
}
function CO() {
  return document.body.offsetHeight;
}
const AO = new WeakMap(),
  TO = new WeakMap(),
  PO = {
    name: "TransitionGroup",
    props: zd({}, $U, { tag: String, moveClass: String }),
    setup(t, { slots: e }) {
      const n = yt(),
        r = mb();
      let i, o;
      return (
        kl(() => {
          if (!i.length) return;
          const s = t.moveClass || `${t.name || "v"}-move`;
          if (!YU(i[0].el, n.vnode.el, s)) return;
          i.forEach(zU), i.forEach(jU);
          const a = i.filter(WU);
          CO(),
            a.forEach((l) => {
              const c = l.el,
                u = c.style;
              ko(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),
                    Os(c, s)));
              });
              c.addEventListener("transitionend", f);
            });
        }),
        () => {
          const s = Le(t),
            a = EO(s);
          let l = s.tag || Ft;
          (i = o), (o = e.default ? xg(e.default()) : []);
          for (let c = 0; c < o.length; c++) {
            const u = o[c];
            u.key != null
              ? dl(u, Gc(u, a, r, n))
              : ae("<TransitionGroup> children must be keyed.");
          }
          if (i)
            for (let c = 0; c < i.length; c++) {
              const u = i[c];
              dl(u, Gc(u, a, r, n)), AO.set(u, u.el.getBoundingClientRect());
            }
          return R(l, null, o);
        }
      );
    },
  },
  HU = (t) => delete t.mode;
PO.props;
const VU = PO;
function zU(t) {
  const e = t.el;
  e._moveCb && e._moveCb(), e._enterCb && e._enterCb();
}
function jU(t) {
  TO.set(t, t.el.getBoundingClientRect());
}
function WU(t) {
  const e = AO.get(t),
    n = TO.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 YU(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 } = SO(r);
  return i.removeChild(r), o;
}
const oa = (t) => {
  const e = t.props["onUpdate:modelValue"] || !1;
  return Mr(e) ? (n) => uU(e, n) : e;
};
function XU(t) {
  t.target.composing = !0;
}
function pS(t) {
  const e = t.target;
  e.composing && ((e.composing = !1), e.dispatchEvent(new Event("input")));
}
const g0 = {
    created(t, { modifiers: { lazy: e, trim: n, number: r } }, i) {
      t._assign = oa(i);
      const o = r || (i.props && i.props.type === "number");
      Vo(t, e ? "change" : "input", (s) => {
        if (s.target.composing) return;
        let a = t.value;
        n && (a = a.trim()), o && (a = Ly(a)), t._assign(a);
      }),
        n &&
          Vo(t, "change", () => {
            t.value = t.value.trim();
          }),
        e ||
          (Vo(t, "compositionstart", XU),
          Vo(t, "compositionend", pS),
          Vo(t, "change", pS));
    },
    mounted(t, { value: e }) {
      t.value = e ?? "";
    },
    beforeUpdate(
      t,
      { value: e, modifiers: { lazy: n, trim: r, number: i } },
      o
    ) {
      if (
        ((t._assign = oa(o)),
        t.composing ||
          (document.activeElement === t &&
            t.type !== "range" &&
            (n ||
              (r && t.value.trim() === e) ||
              ((i || t.type === "number") && Ly(t.value) === e))))
      )
        return;
      const s = e ?? "";
      t.value !== s && (t.value = s);
    },
  },
  Ib = {
    deep: !0,
    created(t, e, n) {
      (t._assign = oa(n)),
        Vo(t, "change", () => {
          const r = t._modelValue,
            i = Vc(t),
            o = t.checked,
            s = t._assign;
          if (Mr(r)) {
            const a = Ig(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 (jd(r)) {
            const a = new Set(r);
            o ? a.add(i) : a.delete(i), s(a);
          } else s(OO(t, o));
        });
    },
    mounted: gS,
    beforeUpdate(t, e, n) {
      (t._assign = oa(n)), gS(t, e, n);
    },
  };
function gS(t, { value: e, oldValue: n }, r) {
  (t._modelValue = e),
    Mr(e)
      ? (t.checked = Ig(e, r.props.value) > -1)
      : jd(e)
      ? (t.checked = e.has(r.props.value))
      : e !== n && (t.checked = ia(e, OO(t, !0)));
}
const Ob = {
    created(t, { value: e }, n) {
      (t.checked = ia(e, n.props.value)),
        (t._assign = oa(n)),
        Vo(t, "change", () => {
          t._assign(Vc(t));
        });
    },
    beforeUpdate(t, { value: e, oldValue: n }, r) {
      (t._assign = oa(r)), e !== n && (t.checked = ia(e, r.props.value));
    },
  },
  IO = {
    deep: !0,
    created(t, { value: e, modifiers: { number: n } }, r) {
      const i = jd(e);
      Vo(t, "change", () => {
        const o = Array.prototype.filter
          .call(t.options, (s) => s.selected)
          .map((s) => (n ? Ly(Vc(s)) : Vc(s)));
        t._assign(t.multiple ? (i ? new Set(o) : o) : o[0]);
      }),
        (t._assign = oa(r));
    },
    mounted(t, { value: e }) {
      mS(t, e);
    },
    beforeUpdate(t, e, n) {
      t._assign = oa(n);
    },
    updated(t, { value: e }) {
      mS(t, e);
    },
  };
function mS(t, e) {
  const n = t.multiple;
  if (n && !Mr(e) && !jd(e)) {
    ae(
      `<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 = Vc(o);
    if (n) Mr(e) ? (o.selected = Ig(e, s) > -1) : (o.selected = e.has(s));
    else if (ia(Vc(o), e)) {
      t.selectedIndex !== r && (t.selectedIndex = r);
      return;
    }
  }
  !n && t.selectedIndex !== -1 && (t.selectedIndex = -1);
}
function Vc(t) {
  return "_value" in t ? t._value : t.value;
}
function OO(t, e) {
  const n = e ? "_trueValue" : "_falseValue";
  return n in t ? t[n] : e;
}
const RO = {
  created(t, e, n) {
    Rh(t, e, n, null, "created");
  },
  mounted(t, e, n) {
    Rh(t, e, n, null, "mounted");
  },
  beforeUpdate(t, e, n, r) {
    Rh(t, e, n, r, "beforeUpdate");
  },
  updated(t, e, n, r) {
    Rh(t, e, n, r, "updated");
  },
};
function MO(t, e) {
  switch (t) {
    case "SELECT":
      return IO;
    case "TEXTAREA":
      return g0;
    default:
      switch (e) {
        case "checkbox":
          return Ib;
        case "radio":
          return Ob;
        default:
          return g0;
      }
  }
}
function Rh(t, e, n, r, i) {
  const s = MO(t.tagName, n.props && n.props.type)[i];
  s && s(t, e, n, r);
}
function KU() {
  (g0.getSSRProps = ({ value: t }) => ({ value: t })),
    (Ob.getSSRProps = ({ value: t }, e) => {
      if (e.props && ia(e.props.value, t)) return { checked: !0 };
    }),
    (Ib.getSSRProps = ({ value: t }, e) => {
      if (Mr(t)) {
        if (e.props && Ig(t, e.props.value) > -1) return { checked: !0 };
      } else if (jd(t)) {
        if (e.props && t.has(e.props.value)) return { checked: !0 };
      } else if (t) return { checked: !0 };
    }),
    (RO.getSSRProps = (t, e) => {
      if (typeof e.type != "string") return;
      const n = MO(e.type.toUpperCase(), e.props && e.props.type);
      if (n.getSSRProps) return n.getSSRProps(t, e);
    });
}
const qU = ["ctrl", "shift", "alt", "meta"],
  ZU = {
    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) => qU.some((n) => t[`${n}Key`] && !e.includes(n)),
  },
  JU =
    (t, e) =>
    (n, ...r) => {
      for (let i = 0; i < e.length; i++) {
        const o = ZU[e[i]];
        if (o && o(n, e)) return;
      }
      return t(n, ...r);
    },
  QU = {
    esc: "escape",
    space: " ",
    up: "arrow-up",
    left: "arrow-left",
    right: "arrow-right",
    down: "arrow-down",
    delete: "backspace",
  },
  DO = (t, e) => (n) => {
    if (!("key" in n)) return;
    const r = Ns(n.key);
    if (e.some((i) => i === r || QU[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) : Du(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), Du(t, !0), r.enter(t))
            : r.leave(t, () => {
                Du(t, !1);
              })
          : Du(t, e));
    },
    beforeUnmount(t, { value: e }) {
      Du(t, e);
    },
  };
function Du(t, e) {
  t.style.display = e ? t._vod : "none";
}
function eG() {
  pi.getSSRProps = ({ value: t }) => {
    if (!t) return { style: { display: "none" } };
  };
}
const BO = zd({ patchProp: DU }, _U);
let Sf,
  vS = !1;
function kO() {
  return Sf || (Sf = Q4(BO));
}
function NO() {
  return (Sf = vS ? Sf : eO(BO)), (vS = !0), Sf;
}
const Vy = (...t) => {
    kO().render(...t);
  },
  FO = (...t) => {
    NO().hydrate(...t);
  },
  LO = (...t) => {
    const e = kO().createApp(...t);
    $O(e), UO(e);
    const { mount: n } = e;
    return (
      (e.mount = (r) => {
        const i = GO(r);
        if (!i) return;
        const o = e._component;
        !yO(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
    );
  },
  tG = (...t) => {
    const e = NO().createApp(...t);
    $O(e), UO(e);
    const { mount: n } = e;
    return (
      (e.mount = (r) => {
        const i = GO(r);
        if (i) return n(i, !0, i instanceof SVGElement);
      }),
      e
    );
  };
function $O(t) {
  Object.defineProperty(t.config, "isNativeTag", {
    value: (e) => hU(e) || pU(e),
    writable: !1,
  });
}
function UO(t) {
  if (Ab()) {
    const e = t.config.isCustomElement;
    Object.defineProperty(t.config, "isCustomElement", {
      get() {
        return e;
      },
      set() {
        ae(
          "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 ae(r), n;
      },
      set() {
        ae(r);
      },
    });
  }
}
function GO(t) {
  if (rd(t)) {
    const e = document.querySelector(t);
    return (
      e ||
        ae(`Failed to mount app: mount target selector "${t}" returned null.`),
      e
    );
  }
  return (
    window.ShadowRoot &&
      t instanceof window.ShadowRoot &&
      t.mode === "closed" &&
      ae(
        'mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'
      ),
    t
  );
}
let yS = !1;
const nG = () => {
  yS || ((yS = !0), KU(), eG());
};
function rG() {
  mO();
}
rG();
const iG = () => {
    ae(
      'Runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'
    );
  },
  oG = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        BaseTransition: M4,
        BaseTransitionPropsValidators: vb,
        Comment: en,
        EffectScope: Jx,
        Fragment: Ft,
        KeepAlive: $7,
        ReactiveEffect: kd,
        Static: Xs,
        Suspense: P7,
        Teleport: Eg,
        Text: go,
        Transition: Wd,
        TransitionGroup: VU,
        VueElement: Og,
        assertNumber: sb,
        callWithAsyncErrorHandling: Vr,
        callWithErrorHandling: co,
        camelize: Li,
        capitalize: Uc,
        cloneVNode: vi,
        compatUtils: nU,
        compile: iG,
        computed: re,
        createApp: LO,
        createBlock: wb,
        createCommentVNode: H$,
        createElementBlock: F$,
        createElementVNode: Eb,
        createHydrationRenderer: eO,
        createPropsRestProxy: u$,
        createRenderer: Q4,
        createSSRApp: tG,
        createSlots: j7,
        createStaticVNode: G$,
        createTextVNode: Ag,
        createVNode: R,
        customRef: f4,
        defineAsyncComponent: F7,
        defineComponent: we,
        defineCustomElement: bO,
        defineEmits: Q7,
        defineExpose: e$,
        defineModel: r$,
        defineOptions: t$,
        defineProps: J7,
        defineSSRCustomElement: kU,
        defineSlots: n$,
        get devtools() {
          return Ci;
        },
        effect: QF,
        effectScope: Dd,
        getCurrentInstance: yt,
        getCurrentScope: Bd,
        getTransitionRawChildren: xg,
        guardReactiveProps: sO,
        h: Bn,
        handleError: Bl,
        hasInjectionContext: W4,
        hydrate: FO,
        initCustomFormatter: mO,
        initDirectivesForSSR: nG,
        inject: hn,
        isMemoSame: vO,
        isProxy: Xf,
        isReactive: ki,
        isReadonly: is,
        isRef: pt,
        isRuntimeOnly: Ab,
        isShallow: Yf,
        isVNode: mo,
        markRaw: ao,
        mergeDefaults: l$,
        mergeModels: c$,
        mergeProps: st,
        nextTick: Xe,
        normalizeClass: Ud,
        normalizeProps: ZL,
        normalizeStyle: $d,
        onActivated: ps,
        onBeforeMount: k4,
        onBeforeUnmount: qr,
        onBeforeUpdate: wg,
        onDeactivated: Eo,
        onErrorCaptured: $4,
        onMounted: Ht,
        onRenderTracked: L4,
        onRenderTriggered: F4,
        onScopeDispose: Qx,
        onServerPrefetch: N4,
        onUnmounted: ms,
        onUpdated: kl,
        openBlock: Sg,
        popScopeId: b7,
        provide: hi,
        proxyRefs: ib,
        pushScopeId: x7,
        queuePostFlushCb: vg,
        reactive: At,
        readonly: Dl,
        ref: Z,
        registerRuntimeCompiler: Y$,
        render: Vy,
        renderList: z7,
        renderSlot: W7,
        resolveComponent: H7,
        resolveDirective: G4,
        resolveDynamicComponent: V7,
        resolveFilter: tU,
        resolveTransitionHooks: Gc,
        setBlockTracking: Ry,
        setDevtoolsHook: ub,
        setTransitionHooks: dl,
        shallowReactive: c4,
        shallowReadonly: _c,
        shallowRef: pg,
        ssrContextKey: pO,
        ssrUtils: eU,
        stop: eL,
        toDisplayString: JL,
        toHandlerKey: $o,
        toHandlers: Y7,
        toRaw: Le,
        toRef: mf,
        toRefs: vy,
        toValue: IL,
        transformVNodeArgs: L$,
        triggerRef: PL,
        unref: hr,
        useAttrs: s$,
        useCssModule: FU,
        useCssVars: LU,
        useModel: a$,
        useSSRContext: gO,
        useSlots: o$,
        useTransitionState: mb,
        vModelCheckbox: Ib,
        vModelDynamic: RO,
        vModelRadio: Ob,
        vModelSelect: IO,
        vModelText: g0,
        vShow: pi,
        version: Ny,
        warn: ae,
        watch: ve,
        watchEffect: gu,
        watchPostEffect: I4,
        watchSyncEffect: B7,
        withAsyncContext: f$,
        withCtx: db,
        withDefaults: i$,
        withDirectives: di,
        withKeys: DO,
        withMemo: J$,
        withModifiers: JU,
        withScopeId: w7,
      },
      Symbol.toStringTag,
      { value: "Module" }
    )
  );
var sG = !1;
function Mh(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 qm(t, e) {
  if (Array.isArray(t)) {
    t.splice(e, 1);
    return;
  }
  delete t[e];
}
function aG() {
  return HO().__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
function HO() {
  return typeof navigator < "u" && typeof window < "u"
    ? window
    : typeof globalThis < "u"
    ? globalThis
    : {};
}
const lG = typeof Proxy == "function",
  cG = "devtools-plugin:setup",
  uG = "plugin:settings:set";
let jl, zy;
function fG() {
  var t;
  return (
    jl !== void 0 ||
      (typeof window < "u" && window.performance
        ? ((jl = !0), (zy = window.performance))
        : typeof globalThis < "u" &&
          !((t = globalThis.perf_hooks) === null || t === void 0) &&
          t.performance
        ? ((jl = !0), (zy = globalThis.perf_hooks.performance))
        : (jl = !1)),
    jl
  );
}
function dG() {
  return fG() ? zy.now() : Date.now();
}
class hG {
  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 dG();
      },
    }),
      n &&
        n.on(uG, (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 Rg(t, e) {
  const n = t,
    r = HO(),
    i = aG(),
    o = lG && n.enableEarlyProxy;
  if (i && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !o)) i.emit(cG, t, e);
  else {
    const s = o ? new hG(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 jy;
const id = (t) => (jy = t),
  VO = Symbol("pinia");
function pl(t) {
  return (
    t &&
    typeof t == "object" &&
    Object.prototype.toString.call(t) === "[object Object]" &&
    typeof t.toJSON != "function"
  );
}
var uo;
(function (t) {
  (t.direct = "direct"),
    (t.patchObject = "patch object"),
    (t.patchFunction = "patch function");
})(uo || (uo = {}));
const il = typeof window < "u",
  _S = (() =>
    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 pG(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 Rb(t, e, n) {
  const r = new XMLHttpRequest();
  r.open("GET", t),
    (r.responseType = "blob"),
    (r.onload = function () {
      WO(r.response, e, n);
    }),
    (r.onerror = function () {
      console.error("could not download file");
    }),
    r.send();
}
function zO(t) {
  const e = new XMLHttpRequest();
  e.open("HEAD", t, !1);
  try {
    e.send();
  } catch {}
  return e.status >= 200 && e.status <= 299;
}
function Mp(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 Dp = typeof navigator == "object" ? navigator : { userAgent: "" },
  jO = (() =>
    /Macintosh/.test(Dp.userAgent) &&
    /AppleWebKit/.test(Dp.userAgent) &&
    !/Safari/.test(Dp.userAgent))(),
  WO = il
    ? typeof HTMLAnchorElement < "u" &&
      "download" in HTMLAnchorElement.prototype &&
      !jO
      ? gG
      : "msSaveOrOpenBlob" in Dp
      ? mG
      : vG
    : () => {};
function gG(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
          ? zO(r.href)
            ? Rb(t, e, n)
            : ((r.target = "_blank"), Mp(r))
          : Mp(r))
      : ((r.href = URL.createObjectURL(t)),
        setTimeout(function () {
          URL.revokeObjectURL(r.href);
        }, 4e4),
        setTimeout(function () {
          Mp(r);
        }, 0));
}
function mG(t, e = "download", n) {
  if (typeof t == "string")
    if (zO(t)) Rb(t, e, n);
    else {
      const r = document.createElement("a");
      (r.href = t),
        (r.target = "_blank"),
        setTimeout(function () {
          Mp(r);
        });
    }
  else navigator.msSaveOrOpenBlob(pG(t, n), e);
}
function vG(t, e, n, r) {
  if (
    ((r = r || open("", "_blank")),
    r && (r.document.title = r.document.body.innerText = "downloading..."),
    typeof t == "string")
  )
    return Rb(t, e, n);
  const i = t.type === "application/octet-stream",
    o = /constructor/i.test(String(_S.HTMLElement)) || "safari" in _S,
    s = /CriOS\/[\d]+/.test(navigator.userAgent);
  if ((s || (i && o) || jO) && 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 Dn(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 Mb(t) {
  return "_a" in t && "install" in t;
}
function YO() {
  if (!("clipboard" in navigator))
    return Dn("Your browser doesn't support the Clipboard API", "error"), !0;
}
function XO(t) {
  return t instanceof Error &&
    t.message.toLowerCase().includes("document is not focused")
    ? (Dn(
        'You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',
        "warn"
      ),
      !0)
    : !1;
}
async function yG(t) {
  if (!YO())
    try {
      await navigator.clipboard.writeText(JSON.stringify(t.state.value)),
        Dn("Global state copied to clipboard.");
    } catch (e) {
      if (XO(e)) return;
      Dn(
        "Failed to serialize the state. Check the console for more details.",
        "error"
      ),
        console.error(e);
    }
}
async function _G(t) {
  if (!YO())
    try {
      KO(t, JSON.parse(await navigator.clipboard.readText())),
        Dn("Global state pasted from clipboard.");
    } catch (e) {
      if (XO(e)) return;
      Dn(
        "Failed to deserialize the state from clipboard. Check the console for more details.",
        "error"
      ),
        console.error(e);
    }
}
async function xG(t) {
  try {
    WO(
      new Blob([JSON.stringify(t.state.value)], {
        type: "text/plain;charset=utf-8",
      }),
      "pinia-state.json"
    );
  } catch (e) {
    Dn(
      "Failed to export the state as JSON. Check the console for more details.",
      "error"
    ),
      console.error(e);
  }
}
let To;
function bG() {
  To ||
    ((To = document.createElement("input")),
    (To.type = "file"),
    (To.accept = ".json"));
  function t() {
    return new Promise((e, n) => {
      (To.onchange = async () => {
        const r = To.files;
        if (!r) return e(null);
        const i = r.item(0);
        return e(i ? { text: await i.text(), file: i } : null);
      }),
        (To.oncancel = () => e(null)),
        (To.onerror = n),
        To.click();
    });
  }
  return t;
}
async function wG(t) {
  try {
    const n = await bG()();
    if (!n) return;
    const { text: r, file: i } = n;
    KO(t, JSON.parse(r)), Dn(`Global state imported from "${i.name}".`);
  } catch (e) {
    Dn(
      "Failed to import the state from JSON. Check the console for more details.",
      "error"
    ),
      console.error(e);
  }
}
function KO(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 qO = "🍍 Pinia (root)",
  Bp = "_root";
function EG(t) {
  return Mb(t) ? { id: Bp, label: qO } : { id: t.$id, label: t.$id };
}
function SG(t) {
  if (Mb(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 CG(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 AG(t) {
  switch (t) {
    case uo.direct:
      return "mutation";
    case uo.patchFunction:
      return "$patch";
    case uo.patchObject:
      return "$patch";
    default:
      return "unknown";
  }
}
let xc = !0;
const kp = [],
  Ma = "pinia:mutations",
  qn = "pinia",
  { assign: TG } = Object,
  m0 = (t) => "🍍 " + t;
function PG(t, e) {
  Rg(
    {
      id: "dev.esm.pinia",
      label: "Pinia 🍍",
      logo: "https://pinia.vuejs.org/logo.svg",
      packageName: "pinia",
      homepage: "https://pinia.vuejs.org",
      componentStateTypes: kp,
      app: t,
    },
    (n) => {
      typeof n.now != "function" &&
        Dn(
          "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: Ma, label: "Pinia 🍍", color: 15064968 }),
        n.addInspector({
          id: qn,
          label: "Pinia 🍍",
          icon: "storage",
          treeFilterPlaceholder: "Search stores",
          actions: [
            {
              icon: "content_copy",
              action: () => {
                yG(e);
              },
              tooltip: "Serialize and copy the state",
            },
            {
              icon: "content_paste",
              action: async () => {
                await _G(e), n.sendInspectorTree(qn), n.sendInspectorState(qn);
              },
              tooltip: "Replace the state with the content of your clipboard",
            },
            {
              icon: "save",
              action: () => {
                xG(e);
              },
              tooltip: "Save the state as a JSON file",
            },
            {
              icon: "folder_open",
              action: async () => {
                await wG(e), n.sendInspectorTree(qn), n.sendInspectorState(qn);
              },
              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"
                    ? Dn(
                        `Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,
                        "warn"
                      )
                    : (i.$reset(), Dn(`Store "${r}" reset.`))
                  : Dn(
                      `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: m0(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: m0(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 === qn) {
            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())
                        : qO.toLowerCase().includes(r.filter.toLowerCase())
                    )
                  : i
              ).map(EG));
          }
        }),
        (globalThis.$pinia = e),
        n.on.getInspectorState((r) => {
          if (r.app === t && r.inspectorId === qn) {
            const i = r.nodeId === Bp ? e : e._s.get(r.nodeId);
            if (!i) return;
            i &&
              (r.nodeId !== Bp && (globalThis.$store = Le(i)),
              (r.state = SG(i)));
          }
        }),
        n.on.editInspectorState((r, i) => {
          if (r.app === t && r.inspectorId === qn) {
            const o = r.nodeId === Bp ? e : e._s.get(r.nodeId);
            if (!o) return Dn(`store "${r.nodeId}" not found`, "error");
            const { path: s } = r;
            Mb(o)
              ? s.unshift("state")
              : (s.length !== 1 ||
                  !o._customProperties.has(s[0]) ||
                  s[0] in o.$state) &&
                s.unshift("$state"),
              (xc = !1),
              r.set(o, s, r.state.value),
              (xc = !0);
          }
        }),
        n.on.editComponentState((r) => {
          if (r.type.startsWith("🍍")) {
            const i = r.type.replace(/^🍍\s*/, ""),
              o = e._s.get(i);
            if (!o) return Dn(`store "${i}" not found`, "error");
            const { path: s } = r;
            if (s[0] !== "state")
              return Dn(`Invalid path for store "${i}":
${s}
Only state can be modified.`);
            (s[0] = "$state"), (xc = !1), r.set(o, s, r.state.value), (xc = !0);
          }
        });
    }
  );
}
function IG(t, e) {
  kp.includes(m0(e.$id)) || kp.push(m0(e.$id)),
    Rg(
      {
        id: "dev.esm.pinia",
        label: "Pinia 🍍",
        logo: "https://pinia.vuejs.org/logo.svg",
        packageName: "pinia",
        homepage: "https://pinia.vuejs.org",
        componentStateTypes: kp,
        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 = ZO++;
          n.addTimelineEvent({
            layerId: Ma,
            event: {
              time: r(),
              title: "🛫 " + l,
              subtitle: "start",
              data: { store: Si(e.$id), action: Si(l), args: c },
              groupId: u,
            },
          }),
            s((f) => {
              (Ls = void 0),
                n.addTimelineEvent({
                  layerId: Ma,
                  event: {
                    time: r(),
                    title: "🛬 " + l,
                    subtitle: "end",
                    data: {
                      store: Si(e.$id),
                      action: Si(l),
                      args: c,
                      result: f,
                    },
                    groupId: u,
                  },
                });
            }),
            a((f) => {
              (Ls = void 0),
                n.addTimelineEvent({
                  layerId: Ma,
                  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(
              () => hr(e[s]),
              (a, l) => {
                n.notifyComponentUpdate(),
                  n.sendInspectorState(qn),
                  xc &&
                    n.addTimelineEvent({
                      layerId: Ma,
                      event: {
                        time: r(),
                        title: "Change",
                        subtitle: s,
                        data: { newValue: a, oldValue: l },
                        groupId: Ls,
                      },
                    });
              },
              { deep: !0 }
            );
          }),
          e.$subscribe(
            ({ events: s, type: a }, l) => {
              if ((n.notifyComponentUpdate(), n.sendInspectorState(qn), !xc))
                return;
              const c = {
                time: r(),
                title: AG(a),
                data: TG({ store: Si(e.$id) }, CG(s)),
                groupId: Ls,
              };
              a === uo.patchFunction
                ? (c.subtitle = "⤵️")
                : a === uo.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: Ma, event: c });
            },
            { detached: !0, flush: "sync" }
          );
        const i = e._hotUpdate;
        e._hotUpdate = ao((s) => {
          i(s),
            n.addTimelineEvent({
              layerId: Ma,
              event: {
                time: r(),
                title: "🔥 " + e.$id,
                subtitle: "HMR update",
                data: { store: Si(e.$id), info: Si("HMR update") },
              },
            }),
            n.notifyComponentUpdate(),
            n.sendInspectorTree(qn),
            n.sendInspectorState(qn);
        });
        const { $dispose: o } = e;
        (e.$dispose = () => {
          o(),
            n.notifyComponentUpdate(),
            n.sendInspectorTree(qn),
            n.sendInspectorState(qn),
            n.getSettings().logStoreChanges &&
              Dn(`Disposed "${e.$id}" store 🗑`);
        }),
          n.notifyComponentUpdate(),
          n.sendInspectorTree(qn),
          n.sendInspectorState(qn),
          n.getSettings().logStoreChanges &&
            Dn(`"${e.$id}" store installed 🆕`);
      }
    );
}
let ZO = 0,
  Ls;
function xS(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 = ZO,
        s = n
          ? new Proxy(t, {
              get(...l) {
                return (Ls = o), Reflect.get(...l);
              },
              set(...l) {
                return (Ls = o), Reflect.set(...l);
              },
            })
          : t;
      Ls = o;
      const a = r[i].apply(s, arguments);
      return (Ls = void 0), a;
    };
}
function OG({ app: t, store: e, options: n }) {
  if (!e.$id.startsWith("__hot:")) {
    if (((e._isOptionsAPI = !!n.state), !e._p._testing)) {
      xS(e, Object.keys(n.actions), e._isOptionsAPI);
      const r = e._hotUpdate;
      Le(e)._hotUpdate = function (i) {
        r.apply(this, arguments),
          xS(e, Object.keys(i._hmrPayload.actions), !!e._isOptionsAPI);
      };
    }
    IG(t, e);
  }
}
function l3e() {
  const t = Dd(!0),
    e = t.run(() => Z({}));
  let n = [],
    r = [];
  const i = ao({
    install(o) {
      id(i),
        (i._a = o),
        o.provide(VO, i),
        (o.config.globalProperties.$pinia = i),
        il && PG(o, i),
        r.forEach((s) => n.push(s)),
        (r = []);
    },
    use(o) {
      return !this._a && !sG ? r.push(o) : n.push(o), this;
    },
    _p: n,
    _a: null,
    _e: t,
    _s: new Map(),
    state: e,
  });
  return il && typeof Proxy < "u" && i.use(OG), i;
}
function JO(t, e) {
  for (const n in e) {
    const r = e[n];
    if (!(n in t)) continue;
    const i = t[n];
    pl(i) && pl(r) && !pt(r) && !ki(r) ? (t[n] = JO(i, r)) : (t[n] = r);
  }
  return t;
}
const RG = () => {};
function bS(t, e, n, r = RG) {
  t.push(e);
  const i = () => {
    const o = t.indexOf(e);
    o > -1 && (t.splice(o, 1), r());
  };
  return !n && Bd() && Qx(i), i;
}
function Wl(t, ...e) {
  t.slice().forEach((n) => {
    n(...e);
  });
}
const MG = (t) => t(),
  wS = Symbol(),
  Zm = Symbol();
function Wy(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];
    pl(i) && pl(r) && t.hasOwnProperty(n) && !pt(r) && !ki(r)
      ? (t[n] = Wy(i, r))
      : (t[n] = r);
  }
  return t;
}
const DG = Symbol("pinia:skipHydration");
function BG(t) {
  return !pl(t) || !t.hasOwnProperty(DG);
}
const { assign: ii } = Object;
function ES(t) {
  return !!(pt(t) && t.effect);
}
function SS(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 = vy(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] = ao(
            re(() => {
              id(n);
              const h = n._s.get(t);
              return s[d].call(h, h);
            })
          )),
          f
        ),
        {}
      )
    );
  }
  return (l = Yy(t, c, e, n, r, !0)), l;
}
function Yy(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 g = Z({});
  let m;
  function v(C) {
    let A;
    (c = u = !1),
      (h = []),
      typeof C == "function"
        ? (C(r.state.value[t]),
          (A = { type: uo.patchFunction, storeId: t, events: h }))
        : (Wy(r.state.value[t], C),
          (A = { type: uo.patchObject, payload: C, storeId: t, events: h }));
    const T = (m = Symbol());
    Xe().then(() => {
      m === T && (c = !0);
    }),
      (u = !0),
      Wl(f, A, r.state.value[t]);
  }
  const y = 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 (wS in C) return (C[Zm] = A), C;
      const T = function () {
        id(r);
        const I = Array.from(arguments),
          B = [],
          G = [];
        function D(K) {
          B.push(K);
        }
        function $(K) {
          G.push(K);
        }
        Wl(d, { args: I, name: T[Zm], store: E, after: D, onError: $ });
        let z;
        try {
          z = C.apply(this && this.$id === t ? this : E, I);
        } catch (K) {
          throw (Wl(G, K), K);
        }
        return z instanceof Promise
          ? z
              .then((K) => (Wl(B, K), K))
              .catch((K) => (Wl(G, K), Promise.reject(K)))
          : (Wl(B, z), z);
      };
      return (T[wS] = !0), (T[Zm] = A), T;
    },
    b = ao({ actions: {}, getters: {}, state: [], hotState: g }),
    w = {
      _p: r,
      $id: t,
      $onAction: bS.bind(null, d),
      $patch: v,
      $reset: y,
      $subscribe(C, A = {}) {
        const T = bS(f, C, A.detached, () => I()),
          I = s.run(() =>
            ve(
              () => r.state.value[t],
              (B) => {
                (A.flush === "sync" ? u : c) &&
                  C({ storeId: t, type: uo.direct, events: h }, B);
              },
              ii({}, l, A)
            )
          );
        return T;
      },
      $dispose: _,
    },
    E = At(ii({ _hmrPayload: b, _customProperties: ao(new Set()) }, w));
  r._s.set(t, E);
  const P = ((r._a && r._a.runWithContext) || MG)(() =>
    r._e.run(() => (s = Dd()).run(() => e({ action: x })))
  );
  for (const C in P) {
    const A = P[C];
    if ((pt(A) && !ES(A)) || ki(A))
      i
        ? Mh(g.value, C, mf(P, C))
        : o ||
          (p && BG(A) && (pt(A) ? (A.value = p[C]) : Wy(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
      ES(A) &&
        ((b.getters[C] = o ? n.getters[C] : A),
        il && (P._getters || (P._getters = ao([]))).push(C));
  }
  if (
    (ii(E, P),
    ii(Le(E), P),
    Object.defineProperty(E, "$state", {
      get: () => (i ? g.value : r.state.value[t]),
      set: (C) => {
        if (i) throw new Error("cannot set hotState");
        v((A) => {
          ii(A, C);
        });
      },
    }),
    (E._hotUpdate = ao((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" && pl(T) && pl(I)
              ? JO(T, I)
              : (C.$state[A] = I);
          }
          Mh(E, A, mf(C.$state, A));
        }),
        Object.keys(E.$state).forEach((A) => {
          A in C.$state || qm(E, A);
        }),
        (c = !1),
        (u = !1),
        (r.state.value[t] = mf(C._hmrPayload, "hotState")),
        (u = !0),
        Xe().then(() => {
          c = !0;
        });
      for (const A in C._hmrPayload.actions) {
        const T = C[A];
        Mh(E, A, x(T, A));
      }
      for (const A in C._hmrPayload.getters) {
        const T = C._hmrPayload.getters[A],
          I = o ? re(() => (id(r), T.call(E, E))) : T;
        Mh(E, A, I);
      }
      Object.keys(E._hmrPayload.getters).forEach((A) => {
        A in C._hmrPayload.getters || qm(E, A);
      }),
        Object.keys(E._hmrPayload.actions).forEach((A) => {
          A in C._hmrPayload.actions || qm(E, A);
        }),
        (E._hmrPayload = C._hmrPayload),
        (E._getters = C._getters),
        (E._hotUpdating = !1);
    })),
    il)
  ) {
    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 (il) {
        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 c3e(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 = W4();
    if (((a = a || (c ? hn(VO, null) : null)), a && id(a), !jy))
      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 = jy), a._s.has(r) || (o ? Yy(r, e, i, a) : SS(r, i, a), (s._pinia = a));
    const u = a._s.get(r);
    if (l) {
      const f = "__hot:" + r,
        d = o ? Yy(f, e, i, a, !0) : SS(f, ii({}, i), a, !0);
      l._hotUpdate(d), delete a.state.value[f], a._s.delete(f);
    }
    if (il) {
      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),
      g = t.devicePixelRatio;
    p
      ? g >= 3 && (!s || s >= 3)
        ? (s = 3)
        : g >= 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 m = n.createElement("div");
      m.appendChild(i), n.write(m.innerHTML);
    }
  function v() {
    var y = r.getBoundingClientRect().width;
    y / s > 540 && (y = 540 * s);
    var _ = y / 10;
    (r.style.fontSize = _ + "px"), (c.rem = t.rem = _);
  }
  t.addEventListener(
    "resize",
    function () {
      clearTimeout(l), (l = setTimeout(v, 300));
    },
    !1
  ),
    t.addEventListener(
      "pageshow",
      function (y) {
        y.persisted && (clearTimeout(l), (l = setTimeout(v, 300)));
      },
      !1
    ),
    n.readyState === "complete"
      ? (n.body.style.fontSize = 12 * s + "px")
      : n.addEventListener(
          "DOMContentLoaded",
          function (y) {
            n.body.style.fontSize = 12 * s + "px";
          },
          !1
        ),
    v(),
    (c.dpr = t.dpr = s),
    (c.refreshRem = v),
    (c.rem2px = function (y) {
      var _ = parseFloat(y) * this.rem;
      return typeof y == "string" && y.match(/rem$/) && (_ += "px"), _;
    }),
    (c.px2rem = function (y) {
      var _ = parseFloat(y) / this.rem;
      return typeof y == "string" && y.match(/px$/) && (_ += "rem"), _;
    });
})(window, window.lib || (window.lib = {}));
function kG(t) {
  return typeof t == "object" && t !== null;
}
function CS(t, e) {
  return (
    (t = kG(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 NG(t, e) {
  return e.reduce((n, r) => (n == null ? void 0 : n[r]), t);
}
function FG(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 LG(t, e) {
  return e.reduce((n, r) => {
    const i = r.split(".");
    return FG(n, i, NG(t, i));
  }, {});
}
function $G(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 AS(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 TS(t, { storage: e, serializer: n, key: r, paths: i, debug: o }) {
  try {
    const s = Array.isArray(i) ? LG(t, i) : t;
    e.setItem(r, n.serialize(s));
  } catch (s) {
    o && console.error("[pinia-plugin-persistedstate]", s);
  }
}
function UG(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) => CS(a, t)) : [CS(r, t)])
      .map($G(t, i))
      .filter(Boolean);
    (i.$persist = () => {
      s.forEach((a) => {
        TS(i.$state, a);
      });
    }),
      (i.$hydrate = ({ runHooks: a = !0 } = {}) => {
        s.forEach((l) => {
          const { beforeRestore: c, afterRestore: u } = l;
          a && (c == null || c(e)), AS(i, l), a && (u == null || u(e));
        });
      }),
      s.forEach((a) => {
        const { beforeRestore: l, afterRestore: c } = a;
        l == null || l(e),
          AS(i, a),
          c == null || c(e),
          i.$subscribe(
            (u, f) => {
              TS(f, a);
            },
            { detached: !0 }
          );
      });
  };
}
var u3e = UG(),
  os =
    typeof globalThis < "u"
      ? globalThis
      : typeof window < "u"
      ? window
      : typeof global < "u"
      ? global
      : typeof self < "u"
      ? self
      : {};
function fa(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default")
    ? t.default
    : t;
}
function Db(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 Wn = Db(oG);
var QO = { exports: {} },
  Bb = Object.defineProperty,
  GG = Object.getOwnPropertyDescriptor,
  HG = Object.getOwnPropertyNames,
  VG = Object.prototype.hasOwnProperty,
  zG = (t, e) => {
    for (var n in e) Bb(t, n, { get: e[n], enumerable: !0 });
  },
  jG = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of HG(e))
        !VG.call(t, i) &&
          i !== n &&
          Bb(t, i, {
            get: () => e[i],
            enumerable: !(r = GG(e, i)) || r.enumerable,
          });
    return t;
  },
  WG = (t) => jG(Bb({}, "__esModule", { value: !0 }), t),
  eR = {};
zG(eR, {
  extend: () => XG,
  flat: () => oH,
  get: () => tH,
  inBrowser: () => tR,
  isDate: () => ZG,
  isDef: () => KG,
  isFunction: () => Xy,
  isIOS: () => eH,
  isMobile: () => JG,
  isNumeric: () => QG,
  isObject: () => kb,
  isPromise: () => qG,
  isSameValue: () => rH,
  noop: () => YG,
  pick: () => nH,
  toArray: () => iH,
});
var da = WG(eR);
function YG() {}
const XG = Object.assign,
  tR = typeof window < "u",
  kb = (t) => t !== null && typeof t == "object",
  KG = (t) => t != null,
  Xy = (t) => typeof t == "function",
  qG = (t) => kb(t) && Xy(t.then) && Xy(t.catch),
  ZG = (t) =>
    Object.prototype.toString.call(t) === "[object Date]" &&
    !Number.isNaN(t.getTime());
function JG(t) {
  return (
    (t = t.replace(/[^-|\d]/g, "")),
    /^((\+86)|(86))?(1)\d{10}$/.test(t) || /^0[0-9-]{10,13}$/.test(t)
  );
}
const QG = (t) => typeof t == "number" || /^\d+(\.\d+)?$/.test(t),
  eH = () =>
    tR ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : !1;
function tH(t, e) {
  const n = e.split(".");
  let r = t;
  return (
    n.forEach((i) => {
      var o;
      r = kb(r) && (o = r[i]) != null ? o : "";
    }),
    r
  );
}
function nH(t, e, n) {
  return e.reduce((r, i) => ((!n || t[i] !== void 0) && (r[i] = t[i]), r), {});
}
const rH = (t, e) => JSON.stringify(t) === JSON.stringify(e),
  iH = (t) => (Array.isArray(t) ? t : [t]),
  oH = (t) => t.reduce((e, n) => e.concat(n), []);
var Nb = Object.defineProperty,
  sH = Object.getOwnPropertyDescriptor,
  aH = Object.getOwnPropertyNames,
  lH = Object.prototype.hasOwnProperty,
  cH = (t, e) => {
    for (var n in e) Nb(t, n, { get: e[n], enumerable: !0 });
  },
  uH = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of aH(e))
        !lH.call(t, i) &&
          i !== n &&
          Nb(t, i, {
            get: () => e[i],
            enumerable: !(r = sH(e, i)) || r.enumerable,
          });
    return t;
  },
  fH = (t) => uH(Nb({}, "__esModule", { value: !0 }), t),
  nR = {};
cH(nR, {
  makeArrayProp: () => mH,
  makeNumberProp: () => vH,
  makeNumericProp: () => yH,
  makeRequiredProp: () => gH,
  makeStringProp: () => _H,
  numericProp: () => rR,
  truthProp: () => pH,
  unknownProp: () => hH,
});
var dH = fH(nR);
const hH = null,
  rR = [Number, String],
  pH = { type: Boolean, default: !0 },
  gH = (t) => ({ type: t, required: !0 }),
  mH = () => ({ type: Array, default: () => [] }),
  vH = (t) => ({ type: Number, default: t }),
  yH = (t) => ({ type: rR, default: t }),
  _H = (t) => ({ type: String, default: t });
var So = typeof window < "u",
  xH = !0;
function pr(t) {
  return So ? requestAnimationFrame(t) : -1;
}
function Yd(t) {
  So && cancelAnimationFrame(t);
}
function za(t) {
  pr(() => pr(t));
}
var bH = (t) => t === window,
  PS = (t, e) => ({
    top: 0,
    left: 0,
    right: t,
    bottom: e,
    width: t,
    height: e,
  }),
  Sn = (t) => {
    const e = hr(t);
    if (bH(e)) {
      const n = e.innerWidth,
        r = e.innerHeight;
      return PS(n, r);
    }
    return e != null && e.getBoundingClientRect
      ? e.getBoundingClientRect()
      : PS(0, 0);
  };
function iR(t = !1) {
  const e = Z(t);
  return [
    e,
    (r = !e.value) => {
      e.value = r;
    },
  ];
}
function Zr(t) {
  const e = hn(t, null);
  if (e) {
    const n = yt(),
      { link: r, unlink: i, internalChildren: o } = e;
    r(n), ms(() => i(n));
    const s = re(() => o.indexOf(n));
    return { parent: e, index: s };
  }
  return { parent: null, index: Z(-1) };
}
function oR(t) {
  const e = [],
    n = (r) => {
      Array.isArray(r) &&
        r.forEach((i) => {
          var o;
          mo(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 IS = (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 sR(t, e, n) {
  const r = oR(t.subTree.children);
  n.sort((o, s) => IS(r, o.vnode) - IS(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 Hi(t) {
  const e = At([]),
    n = At([]),
    r = yt();
  return {
    children: e,
    linkChildren: (o) => {
      hi(
        t,
        Object.assign(
          {
            link: (l) => {
              l.proxy && (n.push(l), e.push(l.proxy), sR(r, e, n));
            },
            unlink: (l) => {
              const c = n.indexOf(l);
              e.splice(c, 1), n.splice(c, 1);
            },
            children: e,
            internalChildren: n,
          },
          o
        )
      );
    },
  };
}
var Ky = 1e3,
  qy = 60 * Ky,
  Zy = 60 * qy,
  OS = 24 * Zy;
function wH(t) {
  const e = Math.floor(t / OS),
    n = Math.floor((t % OS) / Zy),
    r = Math.floor((t % Zy) / qy),
    i = Math.floor((t % qy) / Ky),
    o = Math.floor(t % Ky);
  return {
    total: t,
    days: e,
    hours: n,
    minutes: r,
    seconds: i,
    milliseconds: o,
  };
}
function EH(t, e) {
  return Math.floor(t / 1e3) === Math.floor(e / 1e3);
}
function aR(t) {
  let e, n, r, i;
  const o = Z(t.time),
    s = re(() => wH(o.value)),
    a = () => {
      (r = !1), Yd(e);
    },
    l = () => Math.max(n - Date.now(), 0),
    c = (g) => {
      var m, v;
      (o.value = g),
        (m = t.onChange) == null || m.call(t, s.value),
        g === 0 && (a(), (v = t.onFinish) == null || v.call(t));
    },
    u = () => {
      e = pr(() => {
        r && (c(l()), o.value > 0 && u());
      });
    },
    f = () => {
      e = pr(() => {
        if (r) {
          const g = l();
          (!EH(g, o.value) || g === 0) && c(g), o.value > 0 && f();
        }
      });
    },
    d = () => {
      So && (t.millisecond ? u() : f());
    },
    h = () => {
      r || ((n = Date.now() + o.value), (r = !0), d());
    },
    p = (g = t.time) => {
      a(), (o.value = g);
    };
  return (
    qr(a),
    ps(() => {
      i && ((r = !0), (i = !1), d());
    }),
    Eo(() => {
      r && (a(), (i = !0));
    }),
    { start: h, pause: a, reset: p, current: s }
  );
}
function vu(t) {
  let e;
  Ht(() => {
    t(),
      Xe(() => {
        e = !0;
      });
  }),
    ps(() => {
      e && t();
    });
}
function vr(t, e, n = {}) {
  if (!So) return;
  const { target: r = window, passive: i = !1, capture: o = !1 } = n;
  let s = !1,
    a;
  const l = (f) => {
      if (s) return;
      const d = hr(f);
      d &&
        !a &&
        (d.addEventListener(t, e, { capture: o, passive: i }), (a = !0));
    },
    c = (f) => {
      if (s) return;
      const d = hr(f);
      d && a && (d.removeEventListener(t, e, o), (a = !1));
    };
  ms(() => c(r)), Eo(() => c(r)), vu(() => l(r));
  let u;
  return (
    pt(r) &&
      (u = ve(r, (f, d) => {
        c(d), l(f);
      })),
    () => {
      u == null || u(), c(r), (s = !0);
    }
  );
}
function lR(t, e, n = {}) {
  if (!So) return;
  const { eventName: r = "click" } = n;
  vr(
    r,
    (o) => {
      (Array.isArray(t) ? t : [t]).every((l) => {
        const c = hr(l);
        return c && !c.contains(o.target);
      }) && e(o);
    },
    { target: document }
  );
}
var Dh, Jm;
function cR() {
  if (!Dh && ((Dh = Z(0)), (Jm = Z(0)), So)) {
    const t = () => {
      (Dh.value = window.innerWidth), (Jm.value = window.innerHeight);
    };
    t(),
      window.addEventListener("resize", t, { passive: !0 }),
      window.addEventListener("orientationchange", t, { passive: !0 });
  }
  return { width: Dh, height: Jm };
}
var SH = /scroll|auto|overlay/i,
  uR = So ? window : void 0;
function CH(t) {
  return t.tagName !== "HTML" && t.tagName !== "BODY" && t.nodeType === 1;
}
function Fb(t, e = uR) {
  let n = t;
  for (; n && n !== e && CH(n); ) {
    const { overflowY: r } = window.getComputedStyle(n);
    if (SH.test(r)) return n;
    n = n.parentNode;
  }
  return e;
}
function Xd(t, e = uR) {
  const n = Z();
  return (
    Ht(() => {
      t.value && (n.value = Fb(t.value, e));
    }),
    n
  );
}
var Bh;
function fR() {
  if (!Bh && ((Bh = Z("visible")), So)) {
    const t = () => {
      Bh.value = document.hidden ? "hidden" : "visible";
    };
    t(), window.addEventListener("visibilitychange", t);
  }
  return Bh;
}
var Lb = Symbol("van-field");
function Fl(t) {
  const e = hn(Lb, null);
  e &&
    !e.customValue.value &&
    ((e.customValue.value = t),
    ve(t, () => {
      e.resetValidation(), e.validateWithTrigger("onChange");
    }));
}
function AH(t, e) {
  if (So) {
    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 TH = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        CUSTOM_FIELD_INJECTION_KEY: Lb,
        cancelRaf: Yd,
        doubleRaf: za,
        flattenVNodes: oR,
        getScrollParent: Fb,
        inBrowser: So,
        onMountedOrActivated: vu,
        raf: pr,
        sortChildren: sR,
        supportsPassive: xH,
        useChildren: Hi,
        useClickAway: lR,
        useCountDown: aR,
        useCustomFieldValue: Fl,
        useEventListener: vr,
        usePageVisibility: fR,
        useParent: Zr,
        useRaf: AH,
        useRect: Sn,
        useScrollParent: Xd,
        useToggle: iR,
        useWindowSize: cR,
      },
      Symbol.toStringTag,
      { value: "Module" }
    )
  ),
  Mg = Db(TH);
var $b = Object.defineProperty,
  PH = Object.getOwnPropertyDescriptor,
  IH = Object.getOwnPropertyNames,
  OH = Object.prototype.hasOwnProperty,
  RH = (t, e) => {
    for (var n in e) $b(t, n, { get: e[n], enumerable: !0 });
  },
  MH = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of IH(e))
        !OH.call(t, i) &&
          i !== n &&
          $b(t, i, {
            get: () => e[i],
            enumerable: !(r = PH(e, i)) || r.enumerable,
          });
    return t;
  },
  DH = (t) => MH($b({}, "__esModule", { value: !0 }), t),
  dR = {};
RH(dR, {
  getContainingBlock: () => zH,
  getElementTop: () => NH,
  getRootScrollTop: () => Ub,
  getScrollTop: () => gR,
  isHidden: () => UH,
  preventDefault: () => $H,
  resetScroll: () => LH,
  setRootScrollTop: () => mR,
  setScrollTop: () => Jy,
  stopPropagation: () => vR,
  windowHeight: () => HH,
  windowWidth: () => GH,
});
var hR = DH(dR),
  pR = Mg,
  BH = Wn,
  kH = da;
function gR(t) {
  const e = "scrollTop" in t ? t.scrollTop : t.pageYOffset;
  return Math.max(e, 0);
}
function Jy(t, e) {
  "scrollTop" in t ? (t.scrollTop = e) : t.scrollTo(t.scrollX, e);
}
function Ub() {
  return (
    window.pageYOffset ||
    document.documentElement.scrollTop ||
    document.body.scrollTop ||
    0
  );
}
function mR(t) {
  Jy(window, t), Jy(document.body, t);
}
function NH(t, e) {
  if (t === window) return 0;
  const n = e ? gR(e) : Ub();
  return (0, pR.useRect)(t).top + n;
}
const FH = (0, kH.isIOS)();
function LH() {
  FH && mR(Ub());
}
const vR = (t) => t.stopPropagation();
function $H(t, e) {
  (typeof t.cancelable != "boolean" || t.cancelable) && t.preventDefault(),
    e && vR(t);
}
function UH(t) {
  const e = (0, BH.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: GH, height: HH } = (0, pR.useWindowSize)();
function VH(t) {
  const e = window.getComputedStyle(t);
  return (
    e.transform !== "none" ||
    e.perspective !== "none" ||
    ["transform", "perspective", "filter"].some((n) =>
      (e.willChange || "").includes(n)
    )
  );
}
function zH(t) {
  let e = t.parentElement;
  for (; e; ) {
    if (e && e.tagName !== "HTML" && e.tagName !== "BODY" && VH(e)) return e;
    e = e.parentElement;
  }
  return null;
}
var Gb = Object.defineProperty,
  jH = Object.getOwnPropertyDescriptor,
  WH = Object.getOwnPropertyNames,
  YH = Object.prototype.hasOwnProperty,
  XH = (t, e) => {
    for (var n in e) Gb(t, n, { get: e[n], enumerable: !0 });
  },
  KH = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of WH(e))
        !YH.call(t, i) &&
          i !== n &&
          Gb(t, i, {
            get: () => e[i],
            enumerable: !(r = jH(e, i)) || r.enumerable,
          });
    return t;
  },
  qH = (t) => KH(Gb({}, "__esModule", { value: !0 }), t),
  yR = {};
XH(yR, {
  addNumber: () => fV,
  addUnit: () => Np,
  camelize: () => sV,
  clamp: () => cV,
  formatNumber: () => uV,
  getSizeStyle: () => JH,
  getZIndexStyle: () => QH,
  kebabCase: () => aV,
  padZero: () => lV,
  unitToPx: () => iV,
});
var Hb = qH(yR),
  ZH = da,
  _R = hR,
  Qy = da;
function Np(t) {
  if ((0, Qy.isDef)(t)) return (0, Qy.isNumeric)(t) ? `${t}px` : String(t);
}
function JH(t) {
  if ((0, Qy.isDef)(t)) {
    if (Array.isArray(t)) return { width: Np(t[0]), height: Np(t[1]) };
    const e = Np(t);
    return { width: e, height: e };
  }
}
function QH(t) {
  const e = {};
  return t !== void 0 && (e.zIndex = +t), e;
}
let Qm;
function eV() {
  if (!Qm) {
    const t = document.documentElement,
      e = t.style.fontSize || window.getComputedStyle(t).fontSize;
    Qm = parseFloat(e);
  }
  return Qm;
}
function tV(t) {
  return (t = t.replace(/rem/g, "")), +t * eV();
}
function nV(t) {
  return (t = t.replace(/vw/g, "")), (+t * _R.windowWidth.value) / 100;
}
function rV(t) {
  return (t = t.replace(/vh/g, "")), (+t * _R.windowHeight.value) / 100;
}
function iV(t) {
  if (typeof t == "number") return t;
  if (ZH.inBrowser) {
    if (t.includes("rem")) return tV(t);
    if (t.includes("vw")) return nV(t);
    if (t.includes("vh")) return rV(t);
  }
  return parseFloat(t);
}
const oV = /-(\w)/g,
  sV = (t) => t.replace(oV, (e, n) => n.toUpperCase()),
  aV = (t) =>
    t
      .replace(/([A-Z])/g, "-$1")
      .toLowerCase()
      .replace(/^-/, "");
function lV(t, e = 2) {
  let n = t + "";
  for (; n.length < e; ) n = "0" + n;
  return n;
}
const cV = (t, e, n) => Math.min(Math.max(t, e), n);
function RS(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 uV(t, e = !0, n = !0) {
  e ? (t = RS(t, ".", /\./g)) : (t = t.split(".")[0]),
    n ? (t = RS(t, "-", /-/g)) : (t = t.replace(/-/, ""));
  const r = e ? /[^-0-9.]/g : /[^-0-9]/g;
  return t.replace(r, "");
}
function fV(t, e) {
  return Math.round((t + e) * 1e10) / 1e10;
}
var Vb = Object.defineProperty,
  dV = Object.getOwnPropertyDescriptor,
  hV = Object.getOwnPropertyNames,
  pV = Object.prototype.hasOwnProperty,
  gV = (t, e) => {
    for (var n in e) Vb(t, n, { get: e[n], enumerable: !0 });
  },
  mV = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of hV(e))
        !pV.call(t, i) &&
          i !== n &&
          Vb(t, i, {
            get: () => e[i],
            enumerable: !(r = dV(e, i)) || r.enumerable,
          });
    return t;
  },
  vV = (t) => mV(Vb({}, "__esModule", { value: !0 }), t),
  xR = {};
gV(xR, { deepAssign: () => bR });
var yV = vV(xR),
  MS = da;
const { hasOwnProperty: _V } = Object.prototype;
function xV(t, e, n) {
  const r = e[n];
  (0, MS.isDef)(r) &&
    (!_V.call(t, n) || !(0, MS.isObject)(r)
      ? (t[n] = r)
      : (t[n] = bR(Object(t[n]), r)));
}
function bR(t, e) {
  return (
    Object.keys(e).forEach((n) => {
      xV(t, e, n);
    }),
    t
  );
}
var zb = Object.defineProperty,
  bV = Object.getOwnPropertyDescriptor,
  wV = Object.getOwnPropertyNames,
  EV = Object.prototype.hasOwnProperty,
  SV = (t, e) => {
    for (var n in e) zb(t, n, { get: e[n], enumerable: !0 });
  },
  CV = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of wV(e))
        !EV.call(t, i) &&
          i !== n &&
          zb(t, i, {
            get: () => e[i],
            enumerable: !(r = bV(e, i)) || r.enumerable,
          });
    return t;
  },
  AV = (t) => CV(zb({}, "__esModule", { value: !0 }), t),
  wR = {};
SV(wR, { default: () => PV });
var TV = AV(wR),
  PV = {
    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: "新增地址" },
  },
  IV = Object.create,
  Dg = Object.defineProperty,
  OV = Object.getOwnPropertyDescriptor,
  RV = Object.getOwnPropertyNames,
  MV = Object.getPrototypeOf,
  DV = Object.prototype.hasOwnProperty,
  BV = (t, e) => {
    for (var n in e) Dg(t, n, { get: e[n], enumerable: !0 });
  },
  ER = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of RV(e))
        !DV.call(t, i) &&
          i !== n &&
          Dg(t, i, {
            get: () => e[i],
            enumerable: !(r = OV(e, i)) || r.enumerable,
          });
    return t;
  },
  kV = (t, e, n) => (
    (n = t != null ? IV(MV(t)) : {}),
    ER(
      e || !t || !t.__esModule
        ? Dg(n, "default", { value: t, enumerable: !0 })
        : n,
      t
    )
  ),
  NV = (t) => ER(Dg({}, "__esModule", { value: !0 }), t),
  SR = {};
BV(SR, { Locale: () => AR, default: () => GV, useCurrentLang: () => UV });
var FV = NV(SR),
  CR = Wn,
  LV = yV,
  $V = kV(TV);
const e_ = (0, CR.ref)("zh-CN"),
  DS = (0, CR.reactive)({ "zh-CN": $V.default }),
  AR = {
    messages() {
      return DS[e_.value];
    },
    use(t, e) {
      (e_.value = t), this.add({ [t]: e });
    },
    add(t = {}) {
      (0, LV.deepAssign)(DS, t);
    },
  },
  UV = () => e_;
var GV = AR,
  HV = Object.create,
  Bg = Object.defineProperty,
  VV = Object.getOwnPropertyDescriptor,
  zV = Object.getOwnPropertyNames,
  jV = Object.getPrototypeOf,
  WV = Object.prototype.hasOwnProperty,
  YV = (t, e) => {
    for (var n in e) Bg(t, n, { get: e[n], enumerable: !0 });
  },
  TR = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of zV(e))
        !WV.call(t, i) &&
          i !== n &&
          Bg(t, i, {
            get: () => e[i],
            enumerable: !(r = VV(e, i)) || r.enumerable,
          });
    return t;
  },
  XV = (t, e, n) => (
    (n = t != null ? HV(jV(t)) : {}),
    TR(
      e || !t || !t.__esModule
        ? Bg(n, "default", { value: t, enumerable: !0 })
        : n,
      t
    )
  ),
  KV = (t) => TR(Bg({}, "__esModule", { value: !0 }), t),
  PR = {};
YV(PR, {
  createBEM: () => OR,
  createNamespace: () => QV,
  createTranslate: () => IR,
});
var qV = KV(PR),
  e1 = da,
  ZV = Hb,
  JV = XV(FV);
function IR(t) {
  const e = (0, ZV.camelize)(t) + ".";
  return (n, ...r) => {
    const i = JV.default.messages(),
      o = (0, e1.get)(i, e + n) || (0, e1.get)(i, n);
    return (0, e1.isFunction)(o) ? o(...r) : o;
  };
}
function t_(t, e) {
  return e
    ? typeof e == "string"
      ? ` ${t}--${e}`
      : Array.isArray(e)
      ? e.reduce((n, r) => n + t_(t, r), "")
      : Object.keys(e).reduce((n, r) => n + (e[r] ? t_(t, r) : ""), "")
    : "";
}
function OR(t) {
  return (e, n) => (
    e && typeof e != "string" && ((n = e), (e = "")),
    (e = e ? `${t}__${e}` : t),
    `${e}${t_(e, n)}`
  );
}
function QV(t) {
  const e = `van-${t}`;
  return [e, OR(e), IR(e)];
}
var jb = Object.defineProperty,
  ez = Object.getOwnPropertyDescriptor,
  tz = Object.getOwnPropertyNames,
  nz = Object.prototype.hasOwnProperty,
  rz = (t, e) => {
    for (var n in e) jb(t, n, { get: e[n], enumerable: !0 });
  },
  iz = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of tz(e))
        !nz.call(t, i) &&
          i !== n &&
          jb(t, i, {
            get: () => e[i],
            enumerable: !(r = ez(e, i)) || r.enumerable,
          });
    return t;
  },
  oz = (t) => iz(jb({}, "__esModule", { value: !0 }), t),
  RR = {};
rz(RR, {
  BORDER: () => ha,
  BORDER_BOTTOM: () => uz,
  BORDER_LEFT: () => lz,
  BORDER_RIGHT: () => cz,
  BORDER_SURROUND: () => fz,
  BORDER_TOP: () => az,
  BORDER_TOP_BOTTOM: () => dz,
  BORDER_UNSET_TOP_BOTTOM: () => hz,
  FORM_KEY: () => gz,
  HAPTICS_FEEDBACK: () => pz,
  LONG_PRESS_START_TIME: () => mz,
  TAP_OFFSET: () => vz,
});
var sz = oz(RR);
const ha = "van-hairline",
  az = `${ha}--top`,
  lz = `${ha}--left`,
  cz = `${ha}--right`,
  uz = `${ha}--bottom`,
  fz = `${ha}--surround`,
  dz = `${ha}--top-bottom`,
  hz = `${ha}-unset--top-bottom`,
  pz = "van-haptics-feedback",
  gz = Symbol("van-form"),
  mz = 500,
  vz = 5;
var Wb = Object.defineProperty,
  yz = Object.getOwnPropertyDescriptor,
  _z = Object.getOwnPropertyNames,
  xz = Object.prototype.hasOwnProperty,
  bz = (t, e) => {
    for (var n in e) Wb(t, n, { get: e[n], enumerable: !0 });
  },
  wz = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of _z(e))
        !xz.call(t, i) &&
          i !== n &&
          Wb(t, i, {
            get: () => e[i],
            enumerable: !(r = yz(e, i)) || r.enumerable,
          });
    return t;
  },
  Ez = (t) => wz(Wb({}, "__esModule", { value: !0 }), t),
  MR = {};
bz(MR, { callInterceptor: () => Cz });
var Sz = Ez(MR),
  BS = da;
function Cz(t, { args: e = [], done: n, canceled: r, error: i }) {
  if (t) {
    const o = t.apply(null, e);
    (0, BS.isPromise)(o)
      ? o
          .then((s) => {
            s ? n() : r && r();
          })
          .catch(i || BS.noop)
      : o
      ? n()
      : r && r();
  } else n();
}
var Yb = Object.defineProperty,
  Az = Object.getOwnPropertyDescriptor,
  Tz = Object.getOwnPropertyNames,
  Pz = Object.prototype.hasOwnProperty,
  Iz = (t, e) => {
    for (var n in e) Yb(t, n, { get: e[n], enumerable: !0 });
  },
  Oz = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of Tz(e))
        !Pz.call(t, i) &&
          i !== n &&
          Yb(t, i, {
            get: () => e[i],
            enumerable: !(r = Az(e, i)) || r.enumerable,
          });
    return t;
  },
  Rz = (t) => Oz(Yb({}, "__esModule", { value: !0 }), t),
  DR = {};
Iz(DR, { withInstall: () => Bz });
var Mz = Rz(DR),
  Dz = Hb;
function Bz(t) {
  return (
    (t.install = (e) => {
      const { name: n } = t;
      n && (e.component(n, t), e.component((0, Dz.camelize)(`-${n}`), t));
    }),
    t
  );
}
var Xb = Object.defineProperty,
  kz = Object.getOwnPropertyDescriptor,
  Nz = Object.getOwnPropertyNames,
  Fz = Object.prototype.hasOwnProperty,
  Lz = (t, e) => {
    for (var n in e) Xb(t, n, { get: e[n], enumerable: !0 });
  },
  $z = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of Nz(e))
        !Fz.call(t, i) &&
          i !== n &&
          Xb(t, i, {
            get: () => e[i],
            enumerable: !(r = kz(e, i)) || r.enumerable,
          });
    return t;
  },
  Uz = (t) => $z(Xb({}, "__esModule", { value: !0 }), t),
  BR = {};
Lz(BR, { closest: () => Hz });
var Gz = Uz(BR);
function Hz(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, da, t.exports),
    s(l, dH, t.exports),
    s(l, hR, t.exports),
    s(l, qV, t.exports),
    s(l, Hb, t.exports),
    s(l, sz, t.exports),
    s(l, Sz, t.exports),
    s(l, Mz, t.exports),
    s(l, Gz, t.exports);
})(QO);
var Yn = QO.exports,
  Kb = Object.defineProperty,
  Vz = Object.getOwnPropertyDescriptor,
  zz = Object.getOwnPropertyNames,
  jz = Object.prototype.hasOwnProperty,
  Wz = (t, e) => {
    for (var n in e) Kb(t, n, { get: e[n], enumerable: !0 });
  },
  Yz = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of zz(e))
        !jz.call(t, i) &&
          i !== n &&
          Kb(t, i, {
            get: () => e[i],
            enumerable: !(r = Vz(e, i)) || r.enumerable,
          });
    return t;
  },
  Xz = (t) => Yz(Kb({}, "__esModule", { value: !0 }), t),
  kR = {};
Wz(kR, { useExpose: () => Zz });
var NR = Xz(kR),
  Kz = Wn,
  qz = Yn;
function Zz(t) {
  const e = (0, Kz.getCurrentInstance)();
  e && (0, qz.extend)(e.proxy, t);
}
var qb = Object.defineProperty,
  Jz = Object.getOwnPropertyDescriptor,
  Qz = Object.getOwnPropertyNames,
  ej = Object.prototype.hasOwnProperty,
  tj = (t, e) => {
    for (var n in e) qb(t, n, { get: e[n], enumerable: !0 });
  },
  nj = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of Qz(e))
        !ej.call(t, i) &&
          i !== n &&
          qb(t, i, {
            get: () => e[i],
            enumerable: !(r = Jz(e, i)) || r.enumerable,
          });
    return t;
  },
  rj = (t) => nj(qb({}, "__esModule", { value: !0 }), t),
  FR = {};
tj(FR, { mountComponent: () => lj, usePopupState: () => aj });
var ij = rj(FR),
  LR = Wn,
  oj = da,
  sj = NR;
function aj() {
  const t = (0, LR.reactive)({ show: !1 }),
    e = (i) => {
      t.show = i;
    },
    n = (i) => {
      (0, oj.extend)(t, i, { transitionAppear: !0 }), e(!0);
    },
    r = () => e(!1);
  return (
    (0, sj.useExpose)({ open: n, close: r, toggle: e }),
    { open: n, close: r, state: t, toggle: e }
  );
}
function lj(t) {
  const e = (0, LR.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,
  cj = Object.getOwnPropertyDescriptor,
  uj = Object.getOwnPropertyNames,
  fj = Object.prototype.hasOwnProperty,
  dj = (t, e) => {
    for (var n in e) Zb(t, n, { get: e[n], enumerable: !0 });
  },
  hj = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of uj(e))
        !fj.call(t, i) &&
          i !== n &&
          Zb(t, i, {
            get: () => e[i],
            enumerable: !(r = cj(e, i)) || r.enumerable,
          });
    return t;
  },
  pj = (t) => hj(Zb({}, "__esModule", { value: !0 }), t),
  $R = {};
dj($R, { lockClick: () => mj });
var gj = pj($R);
let Bu = 0;
function mj(t) {
  t
    ? (Bu || document.body.classList.add("van-toast--unclickable"), Bu++)
    : Bu &&
      (Bu--, Bu || document.body.classList.remove("van-toast--unclickable"));
}
var Jb = Object.defineProperty,
  vj = Object.getOwnPropertyDescriptor,
  yj = Object.getOwnPropertyNames,
  _j = Object.prototype.hasOwnProperty,
  xj = (t, e) => {
    for (var n in e) Jb(t, n, { get: e[n], enumerable: !0 });
  },
  bj = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of yj(e))
        !_j.call(t, i) &&
          i !== n &&
          Jb(t, i, {
            get: () => e[i],
            enumerable: !(r = vj(e, i)) || r.enumerable,
          });
    return t;
  },
  wj = (t) => bj(Jb({}, "__esModule", { value: !0 }), t),
  UR = {};
xj(UR, { badgeProps: () => HR, default: () => Sj });
var GR = wj(UR),
  kh = Wn,
  cr = Yn;
const [Ej, kS] = (0, cr.createNamespace)("badge"),
  HR = {
    dot: Boolean,
    max: cr.numericProp,
    tag: (0, cr.makeStringProp)("div"),
    color: String,
    offset: Array,
    content: cr.numericProp,
    showZero: cr.truthProp,
    position: (0, cr.makeStringProp)("top-right"),
  };
var Sj = (0, kh.defineComponent)({
    name: Ej,
    props: HR,
    setup(t, { slots: e }) {
      const n = () => {
          if (e.content) return !0;
          const { content: a, showZero: l } = t;
          return (0, cr.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, cr.isDef)(l) && (0, cr.isNumeric)(c) && +c > +l
              ? `${l}+`
              : c;
        },
        i = (a) => (a.startsWith("-") ? a.replace("-", "") : `-${a}`),
        o = (0, kh.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, cr.addUnit)(f === "top" ? c : -c))
                  : (a[f] = f === "top" ? (0, cr.addUnit)(c) : i(c)),
                typeof l == "number"
                  ? (a[d] = (0, cr.addUnit)(d === "left" ? l : -l))
                  : (a[d] = d === "left" ? (0, cr.addUnit)(l) : i(l)))
              : ((a.marginTop = (0, cr.addUnit)(c)),
                (a.marginLeft = (0, cr.addUnit)(l)));
          }
          return a;
        }),
        s = () => {
          if (n() || t.dot)
            return (0, kh.createVNode)(
              "div",
              {
                class: kS([t.position, { dot: t.dot, fixed: !!e.default }]),
                style: o.value,
              },
              [r()]
            );
        };
      return () => {
        if (e.default) {
          const { tag: a } = t;
          return (0, kh.createVNode)(
            a,
            { class: kS("wrapper") },
            { default: () => [e.default(), s()] }
          );
        }
        return s();
      };
    },
  }),
  Cj = Object.create,
  kg = Object.defineProperty,
  Aj = Object.getOwnPropertyDescriptor,
  Tj = Object.getOwnPropertyNames,
  Pj = Object.getPrototypeOf,
  Ij = Object.prototype.hasOwnProperty,
  Oj = (t, e) => {
    for (var n in e) kg(t, n, { get: e[n], enumerable: !0 });
  },
  VR = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of Tj(e))
        !Ij.call(t, i) &&
          i !== n &&
          kg(t, i, {
            get: () => e[i],
            enumerable: !(r = Aj(e, i)) || r.enumerable,
          });
    return t;
  },
  Rj = (t, e, n) => (
    (n = t != null ? Cj(Pj(t)) : {}),
    VR(
      e || !t || !t.__esModule
        ? kg(n, "default", { value: t, enumerable: !0 })
        : n,
      t
    )
  ),
  Mj = (t) => VR(kg({}, "__esModule", { value: !0 }), t),
  zR = {};
Oj(zR, { Badge: () => jR, badgeProps: () => Nj.badgeProps, default: () => Fj });
var Dj = Mj(zR),
  Bj = Yn,
  kj = Rj(GR),
  Nj = GR;
const jR = (0, Bj.withInstall)(kj.default);
var Fj = jR,
  Qb = Object.defineProperty,
  Lj = Object.getOwnPropertyDescriptor,
  $j = Object.getOwnPropertyNames,
  Uj = Object.prototype.hasOwnProperty,
  Gj = (t, e) => {
    for (var n in e) Qb(t, n, { get: e[n], enumerable: !0 });
  },
  Hj = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of $j(e))
        !Uj.call(t, i) &&
          i !== n &&
          Qb(t, i, {
            get: () => e[i],
            enumerable: !(r = Lj(e, i)) || r.enumerable,
          });
    return t;
  },
  Vj = (t) => Hj(Qb({}, "__esModule", { value: !0 }), t),
  WR = {};
Gj(WR, { setGlobalZIndex: () => jj, useGlobalZIndex: () => zj });
var YR = Vj(WR);
let XR = 2e3;
const zj = () => ++XR,
  jj = (t) => {
    XR = t;
  };
var ew = Object.defineProperty,
  Wj = Object.getOwnPropertyDescriptor,
  Yj = Object.getOwnPropertyNames,
  Xj = Object.prototype.hasOwnProperty,
  Kj = (t, e) => {
    for (var n in e) ew(t, n, { get: e[n], enumerable: !0 });
  },
  qj = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of Yj(e))
        !Xj.call(t, i) &&
          i !== n &&
          ew(t, i, {
            get: () => e[i],
            enumerable: !(r = Wj(e, i)) || r.enumerable,
          });
    return t;
  },
  Zj = (t) => qj(ew({}, "__esModule", { value: !0 }), t),
  KR = {};
Kj(KR, {
  CONFIG_PROVIDER_KEY: () => ZR,
  configProviderProps: () => JR,
  default: () => rW,
});
var Jj = Zj(KR),
  _i = Wn,
  ol = Yn,
  Qj = YR;
const [qR, eW] = (0, ol.createNamespace)("config-provider"),
  ZR = Symbol(qR),
  JR = {
    tag: (0, ol.makeStringProp)("div"),
    theme: (0, ol.makeStringProp)("light"),
    zIndex: Number,
    themeVars: Object,
    themeVarsDark: Object,
    themeVarsLight: Object,
    themeVarsScope: (0, ol.makeStringProp)("local"),
    iconPrefix: String,
  };
function tW(t) {
  return t.replace(/([a-zA-Z])(\d)/g, "$1-$2");
}
function nW(t) {
  const e = {};
  return (
    Object.keys(t).forEach((n) => {
      const r = tW((0, ol.kebabCase)(n));
      e[`--van-${r}`] = t[n];
    }),
    e
  );
}
function Nh(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 rW = (0, _i.defineComponent)({
    name: qR,
    props: JR,
    setup(t, { slots: e }) {
      const n = (0, _i.computed)(() =>
        nW(
          (0, ol.extend)(
            {},
            t.themeVars,
            t.theme === "dark" ? t.themeVarsDark : t.themeVarsLight
          )
        )
      );
      if (ol.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" && Nh(o, s);
          }),
          (0, _i.watch)(
            () => t.themeVarsScope,
            (o, s) => {
              s === "global" && Nh({}, n.value),
                o === "global" && Nh(n.value, {});
            }
          ),
          t.themeVarsScope === "global" && Nh(n.value, {});
      }
      return (
        (0, _i.provide)(ZR, t),
        (0, _i.watchEffect)(() => {
          t.zIndex !== void 0 && (0, Qj.setGlobalZIndex)(t.zIndex);
        }),
        () =>
          (0, _i.createVNode)(
            t.tag,
            {
              class: eW(),
              style: t.themeVarsScope === "local" ? n.value : void 0,
            },
            {
              default: () => {
                var r;
                return [(r = e.default) == null ? void 0 : r.call(e)];
              },
            }
          )
      );
    },
  }),
  tw = Object.defineProperty,
  iW = Object.getOwnPropertyDescriptor,
  oW = Object.getOwnPropertyNames,
  sW = Object.prototype.hasOwnProperty,
  aW = (t, e) => {
    for (var n in e) tw(t, n, { get: e[n], enumerable: !0 });
  },
  lW = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of oW(e))
        !sW.call(t, i) &&
          i !== n &&
          tw(t, i, {
            get: () => e[i],
            enumerable: !(r = iW(e, i)) || r.enumerable,
          });
    return t;
  },
  cW = (t) => lW(tw({}, "__esModule", { value: !0 }), t),
  QR = {};
aW(QR, { default: () => pW, iconProps: () => t8 });
var e8 = cW(QR),
  Yl = Wn,
  Cf = Yn,
  uW = Dj,
  fW = Jj;
const [dW, NS] = (0, Cf.createNamespace)("icon"),
  hW = (t) => (t == null ? void 0 : t.includes("/")),
  t8 = {
    dot: Boolean,
    tag: (0, Cf.makeStringProp)("i"),
    name: String,
    size: Cf.numericProp,
    badge: Cf.numericProp,
    color: String,
    badgeProps: Object,
    classPrefix: String,
  };
var pW = (0, Yl.defineComponent)({
    name: dW,
    props: t8,
    setup(t, { slots: e }) {
      const n = (0, Yl.inject)(fW.CONFIG_PROVIDER_KEY, null),
        r = (0, Yl.computed)(
          () => t.classPrefix || (n == null ? void 0 : n.iconPrefix) || NS()
        );
      return () => {
        const { tag: i, dot: o, name: s, size: a, badge: l, color: c } = t,
          u = hW(s);
        return (0, Yl.createVNode)(
          uW.Badge,
          (0, Yl.mergeProps)(
            {
              dot: o,
              tag: i,
              class: [r.value, u ? "" : `${r.value}-${s}`],
              style: { color: c, fontSize: (0, Cf.addUnit)(a) },
              content: l,
            },
            t.badgeProps
          ),
          {
            default: () => {
              var f;
              return [
                (f = e.default) == null ? void 0 : f.call(e),
                u &&
                  (0, Yl.createVNode)(
                    "img",
                    { class: NS("image"), src: s },
                    null
                  ),
              ];
            },
          }
        );
      };
    },
  }),
  gW = Object.create,
  Ng = Object.defineProperty,
  mW = Object.getOwnPropertyDescriptor,
  vW = Object.getOwnPropertyNames,
  yW = Object.getPrototypeOf,
  _W = Object.prototype.hasOwnProperty,
  xW = (t, e) => {
    for (var n in e) Ng(t, n, { get: e[n], enumerable: !0 });
  },
  n8 = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of vW(e))
        !_W.call(t, i) &&
          i !== n &&
          Ng(t, i, {
            get: () => e[i],
            enumerable: !(r = mW(e, i)) || r.enumerable,
          });
    return t;
  },
  bW = (t, e, n) => (
    (n = t != null ? gW(yW(t)) : {}),
    n8(
      e || !t || !t.__esModule
        ? Ng(n, "default", { value: t, enumerable: !0 })
        : n,
      t
    )
  ),
  wW = (t) => n8(Ng({}, "__esModule", { value: !0 }), t),
  r8 = {};
xW(r8, { Icon: () => o8, default: () => AW, iconProps: () => CW.iconProps });
var i8 = wW(r8),
  EW = Yn,
  SW = bW(e8),
  CW = e8;
const o8 = (0, EW.withInstall)(SW.default);
var AW = o8,
  nw = Object.defineProperty,
  TW = Object.getOwnPropertyDescriptor,
  PW = Object.getOwnPropertyNames,
  IW = Object.prototype.hasOwnProperty,
  OW = (t, e) => {
    for (var n in e) nw(t, n, { get: e[n], enumerable: !0 });
  },
  RW = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of PW(e))
        !IW.call(t, i) &&
          i !== n &&
          nw(t, i, {
            get: () => e[i],
            enumerable: !(r = TW(e, i)) || r.enumerable,
          });
    return t;
  },
  MW = (t) => RW(nw({}, "__esModule", { value: !0 }), t),
  s8 = {};
OW(s8, { popupSharedPropKeys: () => BW, popupSharedProps: () => a8 });
var DW = MW(s8),
  Sa = Yn;
const a8 = {
    show: Boolean,
    zIndex: Sa.numericProp,
    overlay: Sa.truthProp,
    duration: Sa.numericProp,
    teleport: [String, Object],
    lockScroll: Sa.truthProp,
    lazyRender: Sa.truthProp,
    beforeClose: Function,
    overlayProps: Object,
    overlayStyle: Object,
    overlayClass: Sa.unknownProp,
    transitionAppear: Boolean,
    closeOnClickOverlay: Sa.truthProp,
  },
  BW = Object.keys(a8);
var rw = Object.defineProperty,
  kW = Object.getOwnPropertyDescriptor,
  NW = Object.getOwnPropertyNames,
  FW = Object.prototype.hasOwnProperty,
  LW = (t, e) => {
    for (var n in e) rw(t, n, { get: e[n], enumerable: !0 });
  },
  $W = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of NW(e))
        !FW.call(t, i) &&
          i !== n &&
          rw(t, i, {
            get: () => e[i],
            enumerable: !(r = kW(e, i)) || r.enumerable,
          });
    return t;
  },
  UW = (t) => $W(rw({}, "__esModule", { value: !0 }), t),
  l8 = {};
LW(l8, { useTouch: () => VW });
var GW = UW(l8),
  Es = Wn,
  FS = Yn;
function HW(t, e) {
  return t > e ? "horizontal" : e > t ? "vertical" : "";
}
function VW() {
  const t = (0, Es.ref)(0),
    e = (0, Es.ref)(0),
    n = (0, Es.ref)(0),
    r = (0, Es.ref)(0),
    i = (0, Es.ref)(0),
    o = (0, Es.ref)(0),
    s = (0, Es.ref)(""),
    a = (0, Es.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 g = 10;
      (!s.value || (i.value < g && o.value < g)) &&
        (s.value = HW(i.value, o.value)),
        a.value &&
          (i.value > FS.TAP_OFFSET || o.value > FS.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 iw = Object.defineProperty,
  zW = Object.getOwnPropertyDescriptor,
  jW = Object.getOwnPropertyNames,
  WW = Object.prototype.hasOwnProperty,
  YW = (t, e) => {
    for (var n in e) iw(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 &&
          iw(t, i, {
            get: () => e[i],
            enumerable: !(r = zW(e, i)) || r.enumerable,
          });
    return t;
  },
  KW = (t) => XW(iw({}, "__esModule", { value: !0 }), t),
  c8 = {};
YW(c8, { useLockScroll: () => QW });
var qW = KW(c8),
  t1 = Wn,
  LS = Mg,
  ZW = GW,
  JW = Yn;
let ku = 0;
const $S = "van-overflow-hidden";
function QW(t, e) {
  const n = (0, ZW.useTouch)(),
    r = "01",
    i = "10",
    o = (u) => {
      n.move(u);
      const f = n.deltaY.value > 0 ? i : r,
        d = (0, LS.getScrollParent)(u.target, t.value),
        { scrollHeight: h, offsetHeight: p, scrollTop: g } = d;
      let m = "11";
      g === 0 ? (m = p >= h ? "00" : "01") : g + p >= h && (m = "10"),
        m !== "11" &&
          n.isVertical() &&
          !(parseInt(m, 2) & parseInt(f, 2)) &&
          (0, JW.preventDefault)(u, !0);
    },
    s = () => {
      document.addEventListener("touchstart", n.start),
        document.addEventListener("touchmove", o, { passive: !1 }),
        ku || document.body.classList.add($S),
        ku++;
    },
    a = () => {
      ku &&
        (document.removeEventListener("touchstart", n.start),
        document.removeEventListener("touchmove", o),
        ku--,
        ku || document.body.classList.remove($S));
    },
    l = () => e() && s(),
    c = () => e() && a();
  (0, LS.onMountedOrActivated)(l),
    (0, t1.onDeactivated)(c),
    (0, t1.onBeforeUnmount)(c),
    (0, t1.watch)(e, (u) => {
      u ? s() : a();
    });
}
var ow = Object.defineProperty,
  eY = Object.getOwnPropertyDescriptor,
  tY = Object.getOwnPropertyNames,
  nY = Object.prototype.hasOwnProperty,
  rY = (t, e) => {
    for (var n in e) ow(t, n, { get: e[n], enumerable: !0 });
  },
  iY = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of tY(e))
        !nY.call(t, i) &&
          i !== n &&
          ow(t, i, {
            get: () => e[i],
            enumerable: !(r = eY(e, i)) || r.enumerable,
          });
    return t;
  },
  oY = (t) => iY(ow({}, "__esModule", { value: !0 }), t),
  u8 = {};
rY(u8, { useLazyRender: () => sY });
var f8 = oY(u8),
  US = Wn;
function sY(t) {
  const e = (0, US.ref)(!1);
  return (
    (0, US.watch)(
      t,
      (n) => {
        n && (e.value = n);
      },
      { immediate: !0 }
    ),
    (n) => () => e.value ? n() : null
  );
}
var sw = Object.defineProperty,
  aY = Object.getOwnPropertyDescriptor,
  lY = Object.getOwnPropertyNames,
  cY = Object.prototype.hasOwnProperty,
  uY = (t, e) => {
    for (var n in e) sw(t, n, { get: e[n], enumerable: !0 });
  },
  fY = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of lY(e))
        !cY.call(t, i) &&
          i !== n &&
          sw(t, i, {
            get: () => e[i],
            enumerable: !(r = aY(e, i)) || r.enumerable,
          });
    return t;
  },
  dY = (t) => fY(sw({}, "__esModule", { value: !0 }), t),
  d8 = {};
uY(d8, { POPUP_TOGGLE_KEY: () => h8, onPopupReopen: () => pY });
var hY = dY(d8),
  GS = Wn;
const h8 = Symbol();
function pY(t) {
  const e = (0, GS.inject)(h8, null);
  e &&
    (0, GS.watch)(e, (n) => {
      n && t();
    });
}
var aw = Object.defineProperty,
  gY = Object.getOwnPropertyDescriptor,
  mY = Object.getOwnPropertyNames,
  vY = Object.prototype.hasOwnProperty,
  yY = (t, e) => {
    for (var n in e) aw(t, n, { get: e[n], enumerable: !0 });
  },
  _Y = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of mY(e))
        !vY.call(t, i) &&
          i !== n &&
          aw(t, i, {
            get: () => e[i],
            enumerable: !(r = gY(e, i)) || r.enumerable,
          });
    return t;
  },
  xY = (t) => _Y(aw({}, "__esModule", { value: !0 }), t),
  p8 = {};
yY(p8, { useScopeId: () => EY });
var bY = xY(p8),
  wY = Wn;
const EY = () => {
  var t;
  const { scopeId: e } =
    ((t = (0, wY.getCurrentInstance)()) == null ? void 0 : t.vnode) || {};
  return e ? { [e]: "" } : null;
};
var lw = Object.defineProperty,
  SY = Object.getOwnPropertyDescriptor,
  CY = Object.getOwnPropertyNames,
  AY = Object.prototype.hasOwnProperty,
  TY = (t, e) => {
    for (var n in e) lw(t, n, { get: e[n], enumerable: !0 });
  },
  PY = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of CY(e))
        !AY.call(t, i) &&
          i !== n &&
          lw(t, i, {
            get: () => e[i],
            enumerable: !(r = SY(e, i)) || r.enumerable,
          });
    return t;
  },
  IY = (t) => PY(lw({}, "__esModule", { value: !0 }), t),
  g8 = {};
TY(g8, { default: () => BY, overlayProps: () => v8 });
var m8 = IY(g8),
  Yi = Wn,
  so = Yn,
  OY = Mg,
  RY = f8;
const [MY, DY] = (0, so.createNamespace)("overlay"),
  v8 = {
    show: Boolean,
    zIndex: so.numericProp,
    duration: so.numericProp,
    className: so.unknownProp,
    lockScroll: so.truthProp,
    lazyRender: so.truthProp,
    customStyle: Object,
    teleport: [String, Object],
  };
var BY = (0, Yi.defineComponent)({
    name: MY,
    inheritAttrs: !1,
    props: v8,
    setup(t, { attrs: e, slots: n }) {
      const r = (0, Yi.ref)(),
        i = (0, RY.useLazyRender)(() => t.show || !t.lazyRender),
        o = (a) => {
          t.lockScroll && (0, so.preventDefault)(a, !0);
        },
        s = i(() => {
          var a;
          const l = (0, so.extend)(
            (0, so.getZIndexStyle)(t.zIndex),
            t.customStyle
          );
          return (
            (0, so.isDef)(t.duration) &&
              (l.animationDuration = `${t.duration}s`),
            (0, Yi.withDirectives)(
              (0, Yi.createVNode)(
                "div",
                (0, Yi.mergeProps)(
                  { ref: r, style: l, class: [DY(), t.className] },
                  e
                ),
                [(a = n.default) == null ? void 0 : a.call(n)]
              ),
              [[Yi.vShow, t.show]]
            )
          );
        });
      return (
        (0, OY.useEventListener)("touchmove", o, { target: r }),
        () => {
          const a = (0, Yi.createVNode)(
            Yi.Transition,
            { name: "van-fade", appear: !0 },
            { default: s }
          );
          return t.teleport
            ? (0, Yi.createVNode)(
                Yi.Teleport,
                { to: t.teleport },
                { default: () => [a] }
              )
            : a;
        }
      );
    },
  }),
  kY = Object.create,
  Fg = Object.defineProperty,
  NY = Object.getOwnPropertyDescriptor,
  FY = Object.getOwnPropertyNames,
  LY = Object.getPrototypeOf,
  $Y = Object.prototype.hasOwnProperty,
  UY = (t, e) => {
    for (var n in e) Fg(t, n, { get: e[n], enumerable: !0 });
  },
  y8 = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of FY(e))
        !$Y.call(t, i) &&
          i !== n &&
          Fg(t, i, {
            get: () => e[i],
            enumerable: !(r = NY(e, i)) || r.enumerable,
          });
    return t;
  },
  GY = (t, e, n) => (
    (n = t != null ? kY(LY(t)) : {}),
    y8(
      e || !t || !t.__esModule
        ? Fg(n, "default", { value: t, enumerable: !0 })
        : n,
      t
    )
  ),
  HY = (t) => y8(Fg({}, "__esModule", { value: !0 }), t),
  _8 = {};
UY(_8, {
  Overlay: () => x8,
  default: () => YY,
  overlayProps: () => WY.overlayProps,
});
var VY = HY(_8),
  zY = Yn,
  jY = GY(m8),
  WY = m8;
const x8 = (0, zY.withInstall)(jY.default);
var YY = x8,
  cw = Object.defineProperty,
  XY = Object.getOwnPropertyDescriptor,
  KY = Object.getOwnPropertyNames,
  qY = Object.prototype.hasOwnProperty,
  ZY = (t, e) => {
    for (var n in e) cw(t, n, { get: e[n], enumerable: !0 });
  },
  JY = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of KY(e))
        !qY.call(t, i) &&
          i !== n &&
          cw(t, i, {
            get: () => e[i],
            enumerable: !(r = XY(e, i)) || r.enumerable,
          });
    return t;
  },
  QY = (t) => JY(cw({}, "__esModule", { value: !0 }), t),
  b8 = {};
ZY(b8, { default: () => uX, popupProps: () => E8 });
var w8 = QY(b8),
  Vt = Wn,
  eX = DW,
  jo = Yn,
  tX = Mg,
  nX = NR,
  rX = qW,
  iX = f8,
  oX = hY,
  sX = YR,
  HS = bY,
  aX = i8,
  lX = VY;
const E8 = (0, jo.extend)({}, eX.popupSharedProps, {
    round: Boolean,
    position: (0, jo.makeStringProp)("center"),
    closeIcon: (0, jo.makeStringProp)("cross"),
    closeable: Boolean,
    transition: String,
    iconPrefix: String,
    closeOnPopstate: Boolean,
    closeIconPosition: (0, jo.makeStringProp)("top-right"),
    destroyOnClose: Boolean,
    safeAreaInsetTop: Boolean,
    safeAreaInsetBottom: Boolean,
  }),
  [cX, VS] = (0, jo.createNamespace)("popup");
var uX = (0, Vt.defineComponent)({
    name: cX,
    inheritAttrs: !1,
    props: E8,
    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, iX.useLazyRender)(() => t.show || !t.lazyRender),
        c = (0, Vt.computed)(() => {
          const w = { zIndex: s.value };
          if ((0, jo.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, sX.useGlobalZIndex)()),
            e("open"));
        },
        f = () => {
          i &&
            (0, jo.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, jo.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)(
              lX.Overlay,
              (0, Vt.mergeProps)(w, (0, HS.useScopeId)(), { onClick: d }),
              { default: r["overlay-content"] }
            );
          }
        },
        p = (w) => {
          e("clickCloseIcon", w), f();
        },
        g = () => {
          if (t.closeable)
            return (0, Vt.createVNode)(
              aX.Icon,
              {
                role: "button",
                tabindex: 0,
                name: t.closeIcon,
                class: [
                  VS("close-icon", t.closeIconPosition),
                  jo.HAPTICS_FEEDBACK,
                ],
                classPrefix: t.iconPrefix,
                onClick: p,
              },
              null
            );
        };
      let m;
      const v = () => {
          m && clearTimeout(m),
            (m = setTimeout(() => {
              e("opened");
            }));
        },
        y = () => 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: [
                      VS({ round: S, [P]: P }),
                      { "van-safe-area-top": C, "van-safe-area-bottom": A },
                    ],
                    onKeydown: _,
                  },
                  n,
                  (0, HS.useScopeId)()
                ),
                [(w = r.default) == null ? void 0 : w.call(r), g()]
              ),
              [[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: v, onAfterLeave: y },
            { 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, nX.useExpose)({ popupRef: a }),
        (0, rX.useLockScroll)(a, () => t.show && t.lockScroll),
        (0, tX.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)(oX.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()])
      );
    },
  }),
  fX = Object.create,
  Lg = Object.defineProperty,
  dX = Object.getOwnPropertyDescriptor,
  hX = Object.getOwnPropertyNames,
  pX = Object.getPrototypeOf,
  gX = Object.prototype.hasOwnProperty,
  mX = (t, e) => {
    for (var n in e) Lg(t, n, { get: e[n], enumerable: !0 });
  },
  S8 = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of hX(e))
        !gX.call(t, i) &&
          i !== n &&
          Lg(t, i, {
            get: () => e[i],
            enumerable: !(r = dX(e, i)) || r.enumerable,
          });
    return t;
  },
  vX = (t, e, n) => (
    (n = t != null ? fX(pX(t)) : {}),
    S8(
      e || !t || !t.__esModule
        ? Lg(n, "default", { value: t, enumerable: !0 })
        : n,
      t
    )
  ),
  yX = (t) => S8(Lg({}, "__esModule", { value: !0 }), t),
  C8 = {};
mX(C8, { Popup: () => A8, default: () => EX, popupProps: () => wX.popupProps });
var _X = yX(C8),
  xX = Yn,
  bX = vX(w8),
  wX = w8;
const A8 = (0, xX.withInstall)(bX.default);
var EX = A8,
  uw = Object.defineProperty,
  SX = Object.getOwnPropertyDescriptor,
  CX = Object.getOwnPropertyNames,
  AX = Object.prototype.hasOwnProperty,
  TX = (t, e) => {
    for (var n in e) uw(t, n, { get: e[n], enumerable: !0 });
  },
  PX = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of CX(e))
        !AX.call(t, i) &&
          i !== n &&
          uw(t, i, {
            get: () => e[i],
            enumerable: !(r = SX(e, i)) || r.enumerable,
          });
    return t;
  },
  IX = (t) => PX(uw({}, "__esModule", { value: !0 }), t),
  T8 = {};
TX(T8, { default: () => DX, loadingProps: () => I8 });
var P8 = IX(T8),
  Fs = Wn,
  sl = Yn;
const [OX, Af] = (0, sl.createNamespace)("loading"),
  RX = Array(12)
    .fill(null)
    .map((t, e) =>
      (0, Fs.createVNode)("i", { class: Af("line", String(e + 1)) }, null)
    ),
  MX = (0, Fs.createVNode)(
    "svg",
    { class: Af("circular"), viewBox: "25 25 50 50" },
    [
      (0, Fs.createVNode)(
        "circle",
        { cx: "50", cy: "50", r: "20", fill: "none" },
        null
      ),
    ]
  ),
  I8 = {
    size: sl.numericProp,
    type: (0, sl.makeStringProp)("circular"),
    color: String,
    vertical: Boolean,
    textSize: sl.numericProp,
    textColor: String,
  };
var DX = (0, Fs.defineComponent)({
    name: OX,
    props: I8,
    setup(t, { slots: e }) {
      const n = (0, Fs.computed)(() =>
          (0, sl.extend)({ color: t.color }, (0, sl.getSizeStyle)(t.size))
        ),
        r = () => {
          const o = t.type === "spinner" ? RX : MX;
          return (0, Fs.createVNode)(
            "span",
            { class: Af("spinner", t.type), style: n.value },
            [e.icon ? e.icon() : o]
          );
        },
        i = () => {
          var o;
          if (e.default)
            return (0, Fs.createVNode)(
              "span",
              {
                class: Af("text"),
                style: {
                  fontSize: (0, sl.addUnit)(t.textSize),
                  color: (o = t.textColor) != null ? o : t.color,
                },
              },
              [e.default()]
            );
        };
      return () => {
        const { type: o, vertical: s } = t;
        return (0, Fs.createVNode)(
          "div",
          {
            class: Af([o, { vertical: s }]),
            "aria-live": "polite",
            "aria-busy": !0,
          },
          [r(), i()]
        );
      };
    },
  }),
  BX = Object.create,
  $g = Object.defineProperty,
  kX = Object.getOwnPropertyDescriptor,
  NX = Object.getOwnPropertyNames,
  FX = Object.getPrototypeOf,
  LX = Object.prototype.hasOwnProperty,
  $X = (t, e) => {
    for (var n in e) $g(t, n, { get: e[n], enumerable: !0 });
  },
  O8 = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of NX(e))
        !LX.call(t, i) &&
          i !== n &&
          $g(t, i, {
            get: () => e[i],
            enumerable: !(r = kX(e, i)) || r.enumerable,
          });
    return t;
  },
  UX = (t, e, n) => (
    (n = t != null ? BX(FX(t)) : {}),
    O8(
      e || !t || !t.__esModule
        ? $g(n, "default", { value: t, enumerable: !0 })
        : n,
      t
    )
  ),
  GX = (t) => O8($g({}, "__esModule", { value: !0 }), t),
  R8 = {};
$X(R8, {
  Loading: () => M8,
  default: () => WX,
  loadingProps: () => jX.loadingProps,
});
var HX = GX(R8),
  VX = Yn,
  zX = UX(P8),
  jX = P8;
const M8 = (0, VX.withInstall)(zX.default);
var WX = M8,
  fw = Object.defineProperty,
  YX = Object.getOwnPropertyDescriptor,
  XX = Object.getOwnPropertyNames,
  KX = Object.prototype.hasOwnProperty,
  qX = (t, e) => {
    for (var n in e) fw(t, n, { get: e[n], enumerable: !0 });
  },
  ZX = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of XX(e))
        !KX.call(t, i) &&
          i !== n &&
          fw(t, i, {
            get: () => e[i],
            enumerable: !(r = YX(e, i)) || r.enumerable,
          });
    return t;
  },
  JX = (t) => ZX(fw({}, "__esModule", { value: !0 }), t),
  D8 = {};
qX(D8, { default: () => sK, toastProps: () => B8 });
var QX = JX(D8),
  ti = Wn,
  si = Yn,
  eK = gj,
  tK = i8,
  nK = _X,
  rK = HX;
const [iK, Xl] = (0, si.createNamespace)("toast"),
  oK = [
    "show",
    "overlay",
    "teleport",
    "transition",
    "overlayClass",
    "overlayStyle",
    "closeOnClickOverlay",
    "zIndex",
  ],
  B8 = {
    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 sK = (0, ti.defineComponent)({
    name: iK,
    props: B8,
    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, eK.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: g,
          } = t;
          if (f || d === "success" || d === "fail")
            return (0, ti.createVNode)(
              tK.Icon,
              { name: f || d, size: h, class: Xl("icon"), classPrefix: p },
              null
            );
          if (d === "loading")
            return (0, ti.createVNode)(
              rK.Loading,
              { class: Xl("loading"), size: h, type: g },
              null
            );
        },
        u = () => {
          const { type: f, message: d } = t;
          if (n.message)
            return (0, ti.createVNode)("div", { class: Xl("text") }, [
              n.message(),
            ]);
          if ((0, si.isDef)(d) && d !== "")
            return f === "html"
              ? (0, ti.createVNode)(
                  "div",
                  { key: 0, class: Xl("text"), innerHTML: String(d) },
                  null
                )
              : (0, ti.createVNode)("div", { class: Xl("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)(
            nK.Popup,
            (0, ti.mergeProps)(
              {
                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,
              },
              (0, si.pick)(t, oK)
            ),
            { default: () => [c(), u()] }
          )
      );
    },
  }),
  aK = Object.create,
  Ug = Object.defineProperty,
  lK = Object.getOwnPropertyDescriptor,
  cK = Object.getOwnPropertyNames,
  uK = Object.getPrototypeOf,
  fK = Object.prototype.hasOwnProperty,
  dK = (t, e) => {
    for (var n in e) Ug(t, n, { get: e[n], enumerable: !0 });
  },
  k8 = (t, e, n, r) => {
    if ((e && typeof e == "object") || typeof e == "function")
      for (let i of cK(e))
        !fK.call(t, i) &&
          i !== n &&
          Ug(t, i, {
            get: () => e[i],
            enumerable: !(r = lK(e, i)) || r.enumerable,
          });
    return t;
  },
  hK = (t, e, n) => (
    (n = t != null ? aK(uK(t)) : {}),
    k8(
      e || !t || !t.__esModule
        ? Ug(n, "default", { value: t, enumerable: !0 })
        : n,
      t
    )
  ),
  pK = (t) => k8(Ug({}, "__esModule", { value: !0 }), t),
  N8 = {};
dK(N8, {
  allowMultipleToast: () => SK,
  closeToast: () => bK,
  resetToastDefaultOptions: () => EK,
  setToastDefaultOptions: () => wK,
  showFailToast: () => xK,
  showLoadingToast: () => yK,
  showSuccessToast: () => _K,
  showToast: () => $8,
});
var f3e = pK(N8),
  Nu = Wn,
  gl = Yn,
  zS = ij,
  gK = hK(QX);
const F8 = {
  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 = [],
  Gg = !1,
  v0 = (0, gl.extend)({}, F8);
const y0 = new Map();
function L8(t) {
  return (0, gl.isObject)(t) ? t : { message: t };
}
function mK() {
  const { instance: t, unmount: e } = (0, zS.mountComponent)({
    setup() {
      const n = (0, Nu.ref)(""),
        { open: r, state: i, close: o, toggle: s } = (0, zS.usePopupState)(),
        a = () => {
          Gg && ((Ti = Ti.filter((c) => c !== t)), e());
        },
        l = () => {
          const c = { onClosed: a, "onUpdate:show": s };
          return (0, Nu.createVNode)(
            gK.default,
            (0, Nu.mergeProps)(i, c),
            null
          );
        };
      return (
        (0, Nu.watch)(n, (c) => {
          i.message = c;
        }),
        ((0, Nu.getCurrentInstance)().render = l),
        { open: r, close: o, message: n }
      );
    },
  });
  return t;
}
function vK() {
  if (!Ti.length || Gg) {
    const t = mK();
    Ti.push(t);
  }
  return Ti[Ti.length - 1];
}
function $8(t = {}) {
  if (!gl.inBrowser) return {};
  const e = vK(),
    n = L8(t);
  return e.open((0, gl.extend)({}, v0, y0.get(n.type || v0.type), n)), e;
}
const dw = (t) => (e) => $8((0, gl.extend)({ type: t }, L8(e))),
  yK = dw("loading"),
  _K = dw("success"),
  xK = dw("fail"),
  bK = (t) => {
    var e;
    Ti.length &&
      (t
        ? (Ti.forEach((n) => {
            n.close();
          }),
          (Ti = []))
        : Gg
        ? (e = Ti.shift()) == null || e.close()
        : Ti[0].close());
  };
function wK(t, e) {
  typeof t == "string" ? y0.set(t, e) : (0, gl.extend)(v0, t);
}
const EK = (t) => {
    typeof t == "string"
      ? y0.delete(t)
      : ((v0 = (0, gl.extend)({}, F8)), y0.clear());
  },
  SK = (t = !0) => {
    Gg = t;
  };
var U8 = { 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(v, y) {
      var _ = v[0],
        x = v[1],
        b = v[2],
        w = v[3];
      (_ += (((x & b) | (~x & w)) + y[0] - 680876936) | 0),
        (_ = (((_ << 7) | (_ >>> 25)) + x) | 0),
        (w += (((_ & x) | (~_ & b)) + y[1] - 389564586) | 0),
        (w = (((w << 12) | (w >>> 20)) + _) | 0),
        (b += (((w & _) | (~w & x)) + y[2] + 606105819) | 0),
        (b = (((b << 17) | (b >>> 15)) + w) | 0),
        (x += (((b & w) | (~b & _)) + y[3] - 1044525330) | 0),
        (x = (((x << 22) | (x >>> 10)) + b) | 0),
        (_ += (((x & b) | (~x & w)) + y[4] - 176418897) | 0),
        (_ = (((_ << 7) | (_ >>> 25)) + x) | 0),
        (w += (((_ & x) | (~_ & b)) + y[5] + 1200080426) | 0),
        (w = (((w << 12) | (w >>> 20)) + _) | 0),
        (b += (((w & _) | (~w & x)) + y[6] - 1473231341) | 0),
        (b = (((b << 17) | (b >>> 15)) + w) | 0),
        (x += (((b & w) | (~b & _)) + y[7] - 45705983) | 0),
        (x = (((x << 22) | (x >>> 10)) + b) | 0),
        (_ += (((x & b) | (~x & w)) + y[8] + 1770035416) | 0),
        (_ = (((_ << 7) | (_ >>> 25)) + x) | 0),
        (w += (((_ & x) | (~_ & b)) + y[9] - 1958414417) | 0),
        (w = (((w << 12) | (w >>> 20)) + _) | 0),
        (b += (((w & _) | (~w & x)) + y[10] - 42063) | 0),
        (b = (((b << 17) | (b >>> 15)) + w) | 0),
        (x += (((b & w) | (~b & _)) + y[11] - 1990404162) | 0),
        (x = (((x << 22) | (x >>> 10)) + b) | 0),
        (_ += (((x & b) | (~x & w)) + y[12] + 1804603682) | 0),
        (_ = (((_ << 7) | (_ >>> 25)) + x) | 0),
        (w += (((_ & x) | (~_ & b)) + y[13] - 40341101) | 0),
        (w = (((w << 12) | (w >>> 20)) + _) | 0),
        (b += (((w & _) | (~w & x)) + y[14] - 1502002290) | 0),
        (b = (((b << 17) | (b >>> 15)) + w) | 0),
        (x += (((b & w) | (~b & _)) + y[15] + 1236535329) | 0),
        (x = (((x << 22) | (x >>> 10)) + b) | 0),
        (_ += (((x & w) | (b & ~w)) + y[1] - 165796510) | 0),
        (_ = (((_ << 5) | (_ >>> 27)) + x) | 0),
        (w += (((_ & b) | (x & ~b)) + y[6] - 1069501632) | 0),
        (w = (((w << 9) | (w >>> 23)) + _) | 0),
        (b += (((w & x) | (_ & ~x)) + y[11] + 643717713) | 0),
        (b = (((b << 14) | (b >>> 18)) + w) | 0),
        (x += (((b & _) | (w & ~_)) + y[0] - 373897302) | 0),
        (x = (((x << 20) | (x >>> 12)) + b) | 0),
        (_ += (((x & w) | (b & ~w)) + y[5] - 701558691) | 0),
        (_ = (((_ << 5) | (_ >>> 27)) + x) | 0),
        (w += (((_ & b) | (x & ~b)) + y[10] + 38016083) | 0),
        (w = (((w << 9) | (w >>> 23)) + _) | 0),
        (b += (((w & x) | (_ & ~x)) + y[15] - 660478335) | 0),
        (b = (((b << 14) | (b >>> 18)) + w) | 0),
        (x += (((b & _) | (w & ~_)) + y[4] - 405537848) | 0),
        (x = (((x << 20) | (x >>> 12)) + b) | 0),
        (_ += (((x & w) | (b & ~w)) + y[9] + 568446438) | 0),
        (_ = (((_ << 5) | (_ >>> 27)) + x) | 0),
        (w += (((_ & b) | (x & ~b)) + y[14] - 1019803690) | 0),
        (w = (((w << 9) | (w >>> 23)) + _) | 0),
        (b += (((w & x) | (_ & ~x)) + y[3] - 187363961) | 0),
        (b = (((b << 14) | (b >>> 18)) + w) | 0),
        (x += (((b & _) | (w & ~_)) + y[8] + 1163531501) | 0),
        (x = (((x << 20) | (x >>> 12)) + b) | 0),
        (_ += (((x & w) | (b & ~w)) + y[13] - 1444681467) | 0),
        (_ = (((_ << 5) | (_ >>> 27)) + x) | 0),
        (w += (((_ & b) | (x & ~b)) + y[2] - 51403784) | 0),
        (w = (((w << 9) | (w >>> 23)) + _) | 0),
        (b += (((w & x) | (_ & ~x)) + y[7] + 1735328473) | 0),
        (b = (((b << 14) | (b >>> 18)) + w) | 0),
        (x += (((b & _) | (w & ~_)) + y[12] - 1926607734) | 0),
        (x = (((x << 20) | (x >>> 12)) + b) | 0),
        (_ += ((x ^ b ^ w) + y[5] - 378558) | 0),
        (_ = (((_ << 4) | (_ >>> 28)) + x) | 0),
        (w += ((_ ^ x ^ b) + y[8] - 2022574463) | 0),
        (w = (((w << 11) | (w >>> 21)) + _) | 0),
        (b += ((w ^ _ ^ x) + y[11] + 1839030562) | 0),
        (b = (((b << 16) | (b >>> 16)) + w) | 0),
        (x += ((b ^ w ^ _) + y[14] - 35309556) | 0),
        (x = (((x << 23) | (x >>> 9)) + b) | 0),
        (_ += ((x ^ b ^ w) + y[1] - 1530992060) | 0),
        (_ = (((_ << 4) | (_ >>> 28)) + x) | 0),
        (w += ((_ ^ x ^ b) + y[4] + 1272893353) | 0),
        (w = (((w << 11) | (w >>> 21)) + _) | 0),
        (b += ((w ^ _ ^ x) + y[7] - 155497632) | 0),
        (b = (((b << 16) | (b >>> 16)) + w) | 0),
        (x += ((b ^ w ^ _) + y[10] - 1094730640) | 0),
        (x = (((x << 23) | (x >>> 9)) + b) | 0),
        (_ += ((x ^ b ^ w) + y[13] + 681279174) | 0),
        (_ = (((_ << 4) | (_ >>> 28)) + x) | 0),
        (w += ((_ ^ x ^ b) + y[0] - 358537222) | 0),
        (w = (((w << 11) | (w >>> 21)) + _) | 0),
        (b += ((w ^ _ ^ x) + y[3] - 722521979) | 0),
        (b = (((b << 16) | (b >>> 16)) + w) | 0),
        (x += ((b ^ w ^ _) + y[6] + 76029189) | 0),
        (x = (((x << 23) | (x >>> 9)) + b) | 0),
        (_ += ((x ^ b ^ w) + y[9] - 640364487) | 0),
        (_ = (((_ << 4) | (_ >>> 28)) + x) | 0),
        (w += ((_ ^ x ^ b) + y[12] - 421815835) | 0),
        (w = (((w << 11) | (w >>> 21)) + _) | 0),
        (b += ((w ^ _ ^ x) + y[15] + 530742520) | 0),
        (b = (((b << 16) | (b >>> 16)) + w) | 0),
        (x += ((b ^ w ^ _) + y[2] - 995338651) | 0),
        (x = (((x << 23) | (x >>> 9)) + b) | 0),
        (_ += ((b ^ (x | ~w)) + y[0] - 198630844) | 0),
        (_ = (((_ << 6) | (_ >>> 26)) + x) | 0),
        (w += ((x ^ (_ | ~b)) + y[7] + 1126891415) | 0),
        (w = (((w << 10) | (w >>> 22)) + _) | 0),
        (b += ((_ ^ (w | ~x)) + y[14] - 1416354905) | 0),
        (b = (((b << 15) | (b >>> 17)) + w) | 0),
        (x += ((w ^ (b | ~_)) + y[5] - 57434055) | 0),
        (x = (((x << 21) | (x >>> 11)) + b) | 0),
        (_ += ((b ^ (x | ~w)) + y[12] + 1700485571) | 0),
        (_ = (((_ << 6) | (_ >>> 26)) + x) | 0),
        (w += ((x ^ (_ | ~b)) + y[3] - 1894986606) | 0),
        (w = (((w << 10) | (w >>> 22)) + _) | 0),
        (b += ((_ ^ (w | ~x)) + y[10] - 1051523) | 0),
        (b = (((b << 15) | (b >>> 17)) + w) | 0),
        (x += ((w ^ (b | ~_)) + y[1] - 2054922799) | 0),
        (x = (((x << 21) | (x >>> 11)) + b) | 0),
        (_ += ((b ^ (x | ~w)) + y[8] + 1873313359) | 0),
        (_ = (((_ << 6) | (_ >>> 26)) + x) | 0),
        (w += ((x ^ (_ | ~b)) + y[15] - 30611744) | 0),
        (w = (((w << 10) | (w >>> 22)) + _) | 0),
        (b += ((_ ^ (w | ~x)) + y[6] - 1560198380) | 0),
        (b = (((b << 15) | (b >>> 17)) + w) | 0),
        (x += ((w ^ (b | ~_)) + y[13] + 1309151649) | 0),
        (x = (((x << 21) | (x >>> 11)) + b) | 0),
        (_ += ((b ^ (x | ~w)) + y[4] - 145523070) | 0),
        (_ = (((_ << 6) | (_ >>> 26)) + x) | 0),
        (w += ((x ^ (_ | ~b)) + y[11] - 1120210379) | 0),
        (w = (((w << 10) | (w >>> 22)) + _) | 0),
        (b += ((_ ^ (w | ~x)) + y[2] + 718787259) | 0),
        (b = (((b << 15) | (b >>> 17)) + w) | 0),
        (x += ((w ^ (b | ~_)) + y[9] - 343485551) | 0),
        (x = (((x << 21) | (x >>> 11)) + b) | 0),
        (v[0] = (_ + v[0]) | 0),
        (v[1] = (x + v[1]) | 0),
        (v[2] = (b + v[2]) | 0),
        (v[3] = (w + v[3]) | 0);
    }
    function o(v) {
      var y = [],
        _;
      for (_ = 0; _ < 64; _ += 4)
        y[_ >> 2] =
          v.charCodeAt(_) +
          (v.charCodeAt(_ + 1) << 8) +
          (v.charCodeAt(_ + 2) << 16) +
          (v.charCodeAt(_ + 3) << 24);
      return y;
    }
    function s(v) {
      var y = [],
        _;
      for (_ = 0; _ < 64; _ += 4)
        y[_ >> 2] =
          v[_] + (v[_ + 1] << 8) + (v[_ + 2] << 16) + (v[_ + 3] << 24);
      return y;
    }
    function a(v) {
      var y = v.length,
        _ = [1732584193, -271733879, -1732584194, 271733878],
        x,
        b,
        w,
        E,
        S,
        P;
      for (x = 64; x <= y; x += 64) i(_, o(v.substring(x - 64, x)));
      for (
        v = v.substring(x - 64),
          b = v.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] |= v.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 = y * 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(v) {
      var y = v.length,
        _ = [1732584193, -271733879, -1732584194, 271733878],
        x,
        b,
        w,
        E,
        S,
        P;
      for (x = 64; x <= y; x += 64) i(_, s(v.subarray(x - 64, x)));
      for (
        v = x - 64 < y ? v.subarray(x - 64) : new Uint8Array(0),
          b = v.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] |= v[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 = y * 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(v) {
      var y = "",
        _;
      for (_ = 0; _ < 4; _ += 1)
        y += r[(v >> (_ * 8 + 4)) & 15] + r[(v >> (_ * 8)) & 15];
      return y;
    }
    function u(v) {
      var y;
      for (y = 0; y < v.length; y += 1) v[y] = c(v[y]);
      return v.join("");
    }
    u(a("hello")),
      typeof ArrayBuffer < "u" &&
        !ArrayBuffer.prototype.slice &&
        (function () {
          function v(y, _) {
            return (
              (y = y | 0 || 0), y < 0 ? Math.max(y + _, 0) : Math.min(y, _)
            );
          }
          ArrayBuffer.prototype.slice = function (y, _) {
            var x = this.byteLength,
              b = v(y, x),
              w = x,
              E,
              S,
              P,
              C;
            return (
              _ !== n && (w = v(_, 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(v) {
      return (
        /[\u0080-\uFFFF]/.test(v) && (v = unescape(encodeURIComponent(v))), v
      );
    }
    function d(v, y) {
      var _ = v.length,
        x = new ArrayBuffer(_),
        b = new Uint8Array(x),
        w;
      for (w = 0; w < _; w += 1) b[w] = v.charCodeAt(w);
      return y ? b : x;
    }
    function h(v) {
      return String.fromCharCode.apply(null, new Uint8Array(v));
    }
    function p(v, y, _) {
      var x = new Uint8Array(v.byteLength + y.byteLength);
      return (
        x.set(new Uint8Array(v)),
        x.set(new Uint8Array(y), v.byteLength),
        _ ? x : x.buffer
      );
    }
    function g(v) {
      var y = [],
        _ = v.length,
        x;
      for (x = 0; x < _ - 1; x += 2) y.push(parseInt(v.substr(x, 2), 16));
      return String.fromCharCode.apply(String, y);
    }
    function m() {
      this.reset();
    }
    return (
      (m.prototype.append = function (v) {
        return this.appendBinary(f(v)), this;
      }),
      (m.prototype.appendBinary = function (v) {
        (this._buff += v), (this._length += v.length);
        var y = this._buff.length,
          _;
        for (_ = 64; _ <= y; _ += 64)
          i(this._hash, o(this._buff.substring(_ - 64, _)));
        return (this._buff = this._buff.substring(_ - 64)), this;
      }),
      (m.prototype.end = function (v) {
        var y = this._buff,
          _ = y.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] |= y.charCodeAt(x) << (x % 4 << 3);
        return (
          this._finish(b, _),
          (w = u(this._hash)),
          v && (w = g(w)),
          this.reset(),
          w
        );
      }),
      (m.prototype.reset = function () {
        return (
          (this._buff = ""),
          (this._length = 0),
          (this._hash = [1732584193, -271733879, -1732584194, 271733878]),
          this
        );
      }),
      (m.prototype.getState = function () {
        return {
          buff: this._buff,
          length: this._length,
          hash: this._hash.slice(),
        };
      }),
      (m.prototype.setState = function (v) {
        return (
          (this._buff = v.buff),
          (this._length = v.length),
          (this._hash = v.hash),
          this
        );
      }),
      (m.prototype.destroy = function () {
        delete this._hash, delete this._buff, delete this._length;
      }),
      (m.prototype._finish = function (v, y) {
        var _ = y,
          x,
          b,
          w;
        if (((v[_ >> 2] |= 128 << (_ % 4 << 3)), _ > 55))
          for (i(this._hash, v), _ = 0; _ < 16; _ += 1) v[_] = 0;
        (x = this._length * 8),
          (x = x.toString(16).match(/(.*?)(.{0,8})$/)),
          (b = parseInt(x[2], 16)),
          (w = parseInt(x[1], 16) || 0),
          (v[14] = b),
          (v[15] = w),
          i(this._hash, v);
      }),
      (m.hash = function (v, y) {
        return m.hashBinary(f(v), y);
      }),
      (m.hashBinary = function (v, y) {
        var _ = a(v),
          x = u(_);
        return y ? g(x) : x;
      }),
      (m.ArrayBuffer = function () {
        this.reset();
      }),
      (m.ArrayBuffer.prototype.append = function (v) {
        var y = p(this._buff.buffer, v, !0),
          _ = y.length,
          x;
        for (this._length += v.byteLength, x = 64; x <= _; x += 64)
          i(this._hash, s(y.subarray(x - 64, x)));
        return (
          (this._buff =
            x - 64 < _
              ? new Uint8Array(y.buffer.slice(x - 64))
              : new Uint8Array(0)),
          this
        );
      }),
      (m.ArrayBuffer.prototype.end = function (v) {
        var y = this._buff,
          _ = y.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] |= y[b] << (b % 4 << 3);
        return (
          this._finish(x, _),
          (w = u(this._hash)),
          v && (w = g(w)),
          this.reset(),
          w
        );
      }),
      (m.ArrayBuffer.prototype.reset = function () {
        return (
          (this._buff = new Uint8Array(0)),
          (this._length = 0),
          (this._hash = [1732584193, -271733879, -1732584194, 271733878]),
          this
        );
      }),
      (m.ArrayBuffer.prototype.getState = function () {
        var v = m.prototype.getState.call(this);
        return (v.buff = h(v.buff)), v;
      }),
      (m.ArrayBuffer.prototype.setState = function (v) {
        return (v.buff = d(v.buff, !0)), m.prototype.setState.call(this, v);
      }),
      (m.ArrayBuffer.prototype.destroy = m.prototype.destroy),
      (m.ArrayBuffer.prototype._finish = m.prototype._finish),
      (m.ArrayBuffer.hash = function (v, y) {
        var _ = l(new Uint8Array(v)),
          x = u(_);
        return y ? g(x) : x;
      }),
      m
    );
  });
})(U8);
var CK = U8.exports;
const d3e = fa(CK);
var G8 = { exports: {} };
(function (t, e) {
  (function (n, r) {
    t.exports = r();
  })(os, 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",
      g = "Invalid Date",
      m =
        /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
      v =
        /\[([^\]]+)]|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,
      y = {
        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"],
            D = B % 100;
          return "[" + B + (G[(D - 20) % 10] || G[D] || G[0]) + "]";
        },
      },
      _ = function (B, G, D) {
        var $ = String(B);
        return !$ || $.length >= G
          ? B
          : "" + Array(G + 1 - $.length).join(D) + B;
      },
      x = {
        s: _,
        z: function (B) {
          var G = -B.utcOffset(),
            D = Math.abs(G),
            $ = Math.floor(D / 60),
            z = D % 60;
          return (G <= 0 ? "+" : "-") + _($, 2, "0") + ":" + _(z, 2, "0");
        },
        m: function B(G, D) {
          if (G.date() < D.date()) return -B(D, G);
          var $ = 12 * (D.year() - G.year()) + (D.month() - G.month()),
            z = G.clone().add($, f),
            K = D - z < 0,
            fe = G.clone().add($ + (K ? -1 : 1), f);
          return +(-($ + (D - z) / (K ? z - fe : fe - z)) || 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] = y;
    var E = "$isDayjsObject",
      S = function (B) {
        return B instanceof T || !(!B || !B[E]);
      },
      P = function B(G, D, $) {
        var z;
        if (!G) return b;
        if (typeof G == "string") {
          var K = G.toLowerCase();
          w[K] && (z = K), D && ((w[K] = D), (z = K));
          var fe = G.split("-");
          if (!z && fe.length > 1) return B(fe[0]);
        } else {
          var se = G.name;
          (w[se] = G), (z = se);
        }
        return !$ && z && (b = z), z || (!$ && b);
      },
      C = function (B, G) {
        if (S(B)) return B.clone();
        var D = typeof G == "object" ? G : {};
        return (D.date = B), (D.args = arguments), new T(D);
      },
      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(D) {
          (this.$L = P(D.locale, null, !0)),
            this.parse(D),
            (this.$x = this.$x || D.x || {}),
            (this[E] = !0);
        }
        var G = B.prototype;
        return (
          (G.parse = function (D) {
            (this.$d = (function ($) {
              var z = $.date,
                K = $.utc;
              if (z === null) return new Date(NaN);
              if (A.u(z)) return new Date();
              if (z instanceof Date) return new Date(z);
              if (typeof z == "string" && !/Z$/i.test(z)) {
                var fe = z.match(m);
                if (fe) {
                  var se = fe[2] - 1 || 0,
                    Y = (fe[7] || "0").substring(0, 3);
                  return K
                    ? new Date(
                        Date.UTC(
                          fe[1],
                          se,
                          fe[3] || 1,
                          fe[4] || 0,
                          fe[5] || 0,
                          fe[6] || 0,
                          Y
                        )
                      )
                    : new Date(
                        fe[1],
                        se,
                        fe[3] || 1,
                        fe[4] || 0,
                        fe[5] || 0,
                        fe[6] || 0,
                        Y
                      );
                }
              }
              return new Date(z);
            })(D)),
              this.init();
          }),
          (G.init = function () {
            var D = this.$d;
            (this.$y = D.getFullYear()),
              (this.$M = D.getMonth()),
              (this.$D = D.getDate()),
              (this.$W = D.getDay()),
              (this.$H = D.getHours()),
              (this.$m = D.getMinutes()),
              (this.$s = D.getSeconds()),
              (this.$ms = D.getMilliseconds());
          }),
          (G.$utils = function () {
            return A;
          }),
          (G.isValid = function () {
            return this.$d.toString() !== g;
          }),
          (G.isSame = function (D, $) {
            var z = C(D);
            return this.startOf($) <= z && z <= this.endOf($);
          }),
          (G.isAfter = function (D, $) {
            return C(D) < this.startOf($);
          }),
          (G.isBefore = function (D, $) {
            return this.endOf($) < C(D);
          }),
          (G.$g = function (D, $, z) {
            return A.u(D) ? this[$] : this.set(z, D);
          }),
          (G.unix = function () {
            return Math.floor(this.valueOf() / 1e3);
          }),
          (G.valueOf = function () {
            return this.$d.getTime();
          }),
          (G.startOf = function (D, $) {
            var z = this,
              K = !!A.u($) || $,
              fe = A.p(D),
              se = function (ee, de) {
                var ge = A.w(
                  z.$u ? Date.UTC(z.$y, de, ee) : new Date(z.$y, de, ee),
                  z
                );
                return K ? ge : ge.endOf(c);
              },
              Y = function (ee, de) {
                return A.w(
                  z
                    .toDate()
                    [ee].apply(
                      z.toDate("s"),
                      (K ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(de)
                    ),
                  z
                );
              },
              te = this.$W,
              pe = this.$M,
              F = this.$D,
              J = "set" + (this.$u ? "UTC" : "");
            switch (fe) {
              case h:
                return K ? se(1, 0) : se(31, 11);
              case f:
                return K ? se(1, pe) : se(0, pe + 1);
              case u:
                var L = this.$locale().weekStart || 0,
                  ne = (te < L ? te + 7 : te) - L;
                return se(K ? F - ne : F + (6 - ne), pe);
              case c:
              case p:
                return Y(J + "Hours", 0);
              case l:
                return Y(J + "Minutes", 1);
              case a:
                return Y(J + "Seconds", 2);
              case s:
                return Y(J + "Milliseconds", 3);
              default:
                return this.clone();
            }
          }),
          (G.endOf = function (D) {
            return this.startOf(D, !1);
          }),
          (G.$set = function (D, $) {
            var z,
              K = A.p(D),
              fe = "set" + (this.$u ? "UTC" : ""),
              se = ((z = {}),
              (z[c] = fe + "Date"),
              (z[p] = fe + "Date"),
              (z[f] = fe + "Month"),
              (z[h] = fe + "FullYear"),
              (z[l] = fe + "Hours"),
              (z[a] = fe + "Minutes"),
              (z[s] = fe + "Seconds"),
              (z[o] = fe + "Milliseconds"),
              z)[K],
              Y = K === c ? this.$D + ($ - this.$W) : $;
            if (K === f || K === h) {
              var te = this.clone().set(p, 1);
              te.$d[se](Y),
                te.init(),
                (this.$d = te.set(p, Math.min(this.$D, te.daysInMonth())).$d);
            } else se && this.$d[se](Y);
            return this.init(), this;
          }),
          (G.set = function (D, $) {
            return this.clone().$set(D, $);
          }),
          (G.get = function (D) {
            return this[A.p(D)]();
          }),
          (G.add = function (D, $) {
            var z,
              K = this;
            D = Number(D);
            var fe = A.p($),
              se = function (pe) {
                var F = C(K);
                return A.w(F.date(F.date() + Math.round(pe * D)), K);
              };
            if (fe === f) return this.set(f, this.$M + D);
            if (fe === h) return this.set(h, this.$y + D);
            if (fe === c) return se(1);
            if (fe === u) return se(7);
            var Y = ((z = {}), (z[a] = r), (z[l] = i), (z[s] = n), z)[fe] || 1,
              te = this.$d.getTime() + D * Y;
            return A.w(te, this);
          }),
          (G.subtract = function (D, $) {
            return this.add(-1 * D, $);
          }),
          (G.format = function (D) {
            var $ = this,
              z = this.$locale();
            if (!this.isValid()) return z.invalidDate || g;
            var K = D || "YYYY-MM-DDTHH:mm:ssZ",
              fe = A.z(this),
              se = this.$H,
              Y = this.$m,
              te = this.$M,
              pe = z.weekdays,
              F = z.months,
              J = z.meridiem,
              L = function (de, ge, xe, O) {
                return (de && (de[ge] || de($, K))) || xe[ge].slice(0, O);
              },
              ne = function (de) {
                return A.s(se % 12 || 12, de, "0");
              },
              ee =
                J ||
                function (de, ge, xe) {
                  var O = de < 12 ? "AM" : "PM";
                  return xe ? O.toLowerCase() : O;
                };
            return K.replace(v, function (de, ge) {
              return (
                ge ||
                (function (xe) {
                  switch (xe) {
                    case "YY":
                      return String($.$y).slice(-2);
                    case "YYYY":
                      return A.s($.$y, 4, "0");
                    case "M":
                      return te + 1;
                    case "MM":
                      return A.s(te + 1, 2, "0");
                    case "MMM":
                      return L(z.monthsShort, te, F, 3);
                    case "MMMM":
                      return L(F, te);
                    case "D":
                      return $.$D;
                    case "DD":
                      return A.s($.$D, 2, "0");
                    case "d":
                      return String($.$W);
                    case "dd":
                      return L(z.weekdaysMin, $.$W, pe, 2);
                    case "ddd":
                      return L(z.weekdaysShort, $.$W, pe, 3);
                    case "dddd":
                      return pe[$.$W];
                    case "H":
                      return String(se);
                    case "HH":
                      return A.s(se, 2, "0");
                    case "h":
                      return ne(1);
                    case "hh":
                      return ne(2);
                    case "a":
                      return ee(se, Y, !0);
                    case "A":
                      return ee(se, Y, !1);
                    case "m":
                      return String(Y);
                    case "mm":
                      return A.s(Y, 2, "0");
                    case "s":
                      return String($.$s);
                    case "ss":
                      return A.s($.$s, 2, "0");
                    case "SSS":
                      return A.s($.$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 (D, $, z) {
            var K,
              fe = this,
              se = A.p($),
              Y = C(D),
              te = (Y.utcOffset() - this.utcOffset()) * r,
              pe = this - Y,
              F = function () {
                return A.m(fe, Y);
              };
            switch (se) {
              case h:
                K = F() / 12;
                break;
              case f:
                K = F();
                break;
              case d:
                K = F() / 3;
                break;
              case u:
                K = (pe - te) / 6048e5;
                break;
              case c:
                K = (pe - te) / 864e5;
                break;
              case l:
                K = pe / i;
                break;
              case a:
                K = pe / r;
                break;
              case s:
                K = pe / n;
                break;
              default:
                K = pe;
            }
            return z ? K : A.a(K);
          }),
          (G.daysInMonth = function () {
            return this.endOf(f).$D;
          }),
          (G.$locale = function () {
            return w[this.$L];
          }),
          (G.locale = function (D, $) {
            if (!D) return this.$L;
            var z = this.clone(),
              K = P(D, $, !0);
            return K && (z.$L = K), z;
          }),
          (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
    );
  });
})(G8);
var hw = G8.exports;
const h3e = fa(hw);
function n_() {}
const We = Object.assign,
  vo = typeof window < "u",
  yo = (t) => t !== null && typeof t == "object",
  Lt = (t) => t != null,
  zc = (t) => typeof t == "function",
  pw = (t) => yo(t) && zc(t.then) && zc(t.catch),
  od = (t) =>
    Object.prototype.toString.call(t) === "[object Date]" &&
    !Number.isNaN(t.getTime()),
  H8 = (t) => typeof t == "number" || /^\d+(\.\d+)?$/.test(t),
  AK = () =>
    vo ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : !1;
function jS(t, e) {
  const n = e.split(".");
  let r = t;
  return (
    n.forEach((i) => {
      var o;
      r = yo(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 qs = (t, e) => JSON.stringify(t) === JSON.stringify(e),
  _0 = (t) => (Array.isArray(t) ? t : [t]),
  pn = null,
  Se = [Number, String],
  _e = { type: Boolean, default: !0 },
  fr = (t) => ({ type: t, required: !0 }),
  ss = () => ({ type: Array, default: () => [] }),
  Hg = (t) => ({ type: Number, default: t }),
  ze = (t) => ({ type: Se, default: t }),
  Me = (t) => ({ type: String, default: t });
function Kd(t) {
  const e = "scrollTop" in t ? t.scrollTop : t.pageYOffset;
  return Math.max(e, 0);
}
function x0(t, e) {
  "scrollTop" in t ? (t.scrollTop = e) : t.scrollTo(t.scrollX, e);
}
function gw() {
  return (
    window.pageYOffset ||
    document.documentElement.scrollTop ||
    document.body.scrollTop ||
    0
  );
}
function mw(t) {
  x0(window, t), x0(document.body, t);
}
function WS(t, e) {
  if (t === window) return 0;
  const n = e ? Kd(e) : gw();
  return Sn(t).top + n;
}
const TK = AK();
function V8() {
  TK && mw(gw());
}
const z8 = (t) => t.stopPropagation();
function Nn(t, e) {
  (typeof t.cancelable != "boolean" || t.cancelable) && t.preventDefault(),
    e && z8(t);
}
function jc(t) {
  const e = hr(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: Xo, height: Zs } = cR();
function nt(t) {
  if (Lt(t)) return H8(t) ? `${t}px` : String(t);
}
function Ll(t) {
  if (Lt(t)) {
    if (Array.isArray(t)) return { width: nt(t[0]), height: nt(t[1]) };
    const e = nt(t);
    return { width: e, height: e };
  }
}
function j8(t) {
  const e = {};
  return t !== void 0 && (e.zIndex = +t), e;
}
let n1;
function PK() {
  if (!n1) {
    const t = document.documentElement,
      e = t.style.fontSize || window.getComputedStyle(t).fontSize;
    n1 = parseFloat(e);
  }
  return n1;
}
function IK(t) {
  return (t = t.replace(/rem/g, "")), +t * PK();
}
function OK(t) {
  return (t = t.replace(/vw/g, "")), (+t * Xo.value) / 100;
}
function RK(t) {
  return (t = t.replace(/vh/g, "")), (+t * Zs.value) / 100;
}
function vw(t) {
  if (typeof t == "number") return t;
  if (vo) {
    if (t.includes("rem")) return IK(t);
    if (t.includes("vw")) return OK(t);
    if (t.includes("vh")) return RK(t);
  }
  return parseFloat(t);
}
const MK = /-(\w)/g,
  W8 = (t) => t.replace(MK, (e, n) => n.toUpperCase());
function Ga(t, e = 2) {
  let n = t + "";
  for (; n.length < e; ) n = "0" + n;
  return n;
}
const Hn = (t, e, n) => Math.min(Math.max(t, e), n);
function YS(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 r_(t, e = !0, n = !0) {
  e ? (t = YS(t, ".", /\./g)) : (t = t.split(".")[0]),
    n ? (t = YS(t, "-", /-/g)) : (t = t.replace(/-/, ""));
  const r = e ? /[^-0-9.]/g : /[^-0-9]/g;
  return t.replace(r, "");
}
function Y8(t, e) {
  return Math.round((t + e) * 1e10) / 1e10;
}
const { hasOwnProperty: DK } = Object.prototype;
function BK(t, e, n) {
  const r = e[n];
  Lt(r) &&
    (!DK.call(t, n) || !yo(r) ? (t[n] = r) : (t[n] = X8(Object(t[n]), r)));
}
function X8(t, e) {
  return (
    Object.keys(e).forEach((n) => {
      BK(t, e, n);
    }),
    t
  );
}
var kK = {
  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 XS = Z("zh-CN"),
  KS = At({ "zh-CN": kK }),
  NK = {
    messages() {
      return KS[XS.value];
    },
    use(t, e) {
      (XS.value = t), this.add({ [t]: e });
    },
    add(t = {}) {
      X8(KS, t);
    },
  };
var FK = NK;
function LK(t) {
  const e = W8(t) + ".";
  return (n, ...r) => {
    const i = FK.messages(),
      o = jS(i, e + n) || jS(i, n);
    return zc(o) ? o(...r) : o;
  };
}
function i_(t, e) {
  return e
    ? typeof e == "string"
      ? ` ${t}--${e}`
      : Array.isArray(e)
      ? e.reduce((n, r) => n + i_(t, r), "")
      : Object.keys(e).reduce((n, r) => n + (e[r] ? i_(t, r) : ""), "")
    : "";
}
function $K(t) {
  return (e, n) => (
    e && typeof e != "string" && ((n = e), (e = "")),
    (e = e ? `${t}__${e}` : t),
    `${e}${i_(e, n)}`
  );
}
function Te(t) {
  const e = `van-${t}`;
  return [e, $K(e), LK(e)];
}
const pa = "van-hairline",
  K8 = `${pa}--top`,
  UK = `${pa}--left`,
  GK = `${pa}--right`,
  HK = `${pa}--bottom`,
  Fp = `${pa}--surround`,
  q8 = `${pa}--top-bottom`,
  VK = `${pa}-unset--top-bottom`,
  as = "van-haptics-feedback",
  Z8 = Symbol("van-form"),
  J8 = 500,
  qS = 5;
function yu(t, { args: e = [], done: n, canceled: r, error: i }) {
  if (t) {
    const o = t.apply(null, e);
    pw(o)
      ? o
          .then((s) => {
            s ? n() : r && r();
          })
          .catch(i || n_)
      : o
      ? n()
      : r && r();
  } else n();
}
function De(t) {
  return (
    (t.install = (e) => {
      const { name: n } = t;
      n && (e.component(n, t), e.component(W8(`-${n}`), t));
    }),
    t
  );
}
function ZS(t, e) {
  return t.reduce((n, r) => (Math.abs(n - e) < Math.abs(r - e) ? n : r));
}
const Q8 = Symbol();
function yw(t) {
  const e = hn(Q8, null);
  e &&
    ve(e, (n) => {
      n && t();
    });
}
const eM = (t, e) => {
  const n = Z(),
    r = () => {
      n.value = Sn(t).height;
    };
  return (
    Ht(() => {
      if ((Xe(r), e)) for (let i = 1; i <= 3; i++) setTimeout(r, 100 * i);
    }),
    yw(() => Xe(r)),
    ve([Xo, Zs], r),
    n
  );
};
function zK(t, e) {
  const n = eM(t, !0);
  return (r) =>
    R(
      "div",
      {
        class: e("placeholder"),
        style: { height: n.value ? `${n.value}px` : void 0 },
      },
      [r()]
    );
}
const [tM, JS] = Te("action-bar"),
  nM = Symbol(tM),
  jK = { placeholder: Boolean, safeAreaInsetBottom: _e };
var WK = we({
  name: tM,
  props: jK,
  setup(t, { slots: e }) {
    const n = Z(),
      r = zK(n, JS),
      { linkChildren: i } = Hi(nM);
    i();
    const o = () => {
      var s;
      return R(
        "div",
        {
          ref: n,
          class: [JS(), { "van-safe-area-bottom": t.safeAreaInsetBottom }],
        },
        [(s = e.default) == null ? void 0 : s.call(e)]
      );
    };
    return () => (t.placeholder ? r(o) : o());
  },
});
const YK = De(WK);
function Kt(t) {
  const e = yt();
  e && We(e.proxy, t);
}
const _u = { to: [String, Object], url: String, replace: Boolean };
function rM({ to: t, url: e, replace: n, $router: r }) {
  t && r
    ? r[n ? "replace" : "push"](t)
    : e && (n ? location.replace(e) : (location.href = e));
}
function qd() {
  const t = yt().proxy;
  return () => rM(t);
}
const [XK, QS] = Te("badge"),
  KK = {
    dot: Boolean,
    max: Se,
    tag: Me("div"),
    color: String,
    offset: Array,
    content: Se,
    showZero: _e,
    position: Me("top-right"),
  };
var qK = we({
  name: XK,
  props: KK,
  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) && H8(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] = nt(f === "top" ? c : -c))
                : (a[f] = f === "top" ? nt(c) : i(c)),
              typeof l == "number"
                ? (a[d] = nt(d === "left" ? l : -l))
                : (a[d] = d === "left" ? nt(l) : i(l)))
            : ((a.marginTop = nt(c)), (a.marginLeft = nt(l)));
        }
        return a;
      }),
      s = () => {
        if (n() || t.dot)
          return R(
            "div",
            {
              class: QS([t.position, { dot: t.dot, fixed: !!e.default }]),
              style: o.value,
            },
            [r()]
          );
      };
    return () => {
      if (e.default) {
        const { tag: a } = t;
        return R(
          a,
          { class: QS("wrapper") },
          { default: () => [e.default(), s()] }
        );
      }
      return s();
    };
  },
});
const Vg = De(qK);
let ZK = 2e3;
const JK = () => ++ZK,
  [QK, p3e] = Te("config-provider"),
  eq = Symbol(QK),
  [tq, eC] = Te("icon"),
  nq = (t) => (t == null ? void 0 : t.includes("/")),
  rq = {
    dot: Boolean,
    tag: Me("i"),
    name: String,
    size: Se,
    badge: Se,
    color: String,
    badgeProps: Object,
    classPrefix: String,
  };
var iq = we({
  name: tq,
  props: rq,
  setup(t, { slots: e }) {
    const n = hn(eq, null),
      r = re(
        () => t.classPrefix || (n == null ? void 0 : n.iconPrefix) || eC()
      );
    return () => {
      const { tag: i, dot: o, name: s, size: a, badge: l, color: c } = t,
        u = nq(s);
      return R(
        Vg,
        st(
          {
            dot: o,
            tag: i,
            class: [r.value, u ? "" : `${r.value}-${s}`],
            style: { color: c, fontSize: nt(a) },
            content: l,
          },
          t.badgeProps
        ),
        {
          default: () => {
            var f;
            return [
              (f = e.default) == null ? void 0 : f.call(e),
              u && R("img", { class: eC("image"), src: s }, null),
            ];
          },
        }
      );
    };
  },
});
const tn = De(iq);
var oq = tn;
const [sq, Tf] = Te("loading"),
  aq = Array(12)
    .fill(null)
    .map((t, e) => R("i", { class: Tf("line", String(e + 1)) }, null)),
  lq = R("svg", { class: Tf("circular"), viewBox: "25 25 50 50" }, [
    R("circle", { cx: "50", cy: "50", r: "20", fill: "none" }, null),
  ]),
  cq = {
    size: Se,
    type: Me("circular"),
    color: String,
    vertical: Boolean,
    textSize: Se,
    textColor: String,
  };
var uq = we({
  name: sq,
  props: cq,
  setup(t, { slots: e }) {
    const n = re(() => We({ color: t.color }, Ll(t.size))),
      r = () => {
        const o = t.type === "spinner" ? aq : lq;
        return R("span", { class: Tf("spinner", t.type), style: n.value }, [
          e.icon ? e.icon() : o,
        ]);
      },
      i = () => {
        var o;
        if (e.default)
          return R(
            "span",
            {
              class: Tf("text"),
              style: {
                fontSize: nt(t.textSize),
                color: (o = t.textColor) != null ? o : t.color,
              },
            },
            [e.default()]
          );
      };
    return () => {
      const { type: o, vertical: s } = t;
      return R(
        "div",
        {
          class: Tf([o, { vertical: s }]),
          "aria-live": "polite",
          "aria-busy": !0,
        },
        [r(), i()]
      );
    };
  },
});
const vs = De(uq),
  [fq, Kl] = Te("button"),
  dq = We({}, _u, {
    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 hq = we({
  name: fq,
  props: dq,
  emits: ["click"],
  setup(t, { emit: e, slots: n }) {
    const r = qd(),
      i = () =>
        n.loading
          ? n.loading()
          : R(
              vs,
              {
                size: t.loadingSize,
                type: t.loadingType,
                class: Kl("loading"),
              },
              null
            ),
      o = () => {
        if (t.loading) return i();
        if (n.icon) return R("div", { class: Kl("icon") }, [n.icon()]);
        if (t.icon)
          return R(
            tn,
            { name: t.icon, class: Kl("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: Kl("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 ? Nn(c) : t.disabled || (e("click", c), r());
      };
    return () => {
      const {
          tag: c,
          type: u,
          size: f,
          block: d,
          round: h,
          plain: p,
          square: g,
          loading: m,
          disabled: v,
          hairline: y,
          nativeType: _,
          iconPosition: x,
        } = t,
        b = [
          Kl([
            u,
            f,
            {
              plain: p,
              block: d,
              round: h,
              square: g,
              loading: m,
              disabled: v,
              hairline: y,
            },
          ]),
          { [Fp]: y },
        ];
      return R(
        c,
        { type: _, class: b, style: a(), disabled: v, onClick: l },
        {
          default: () => [
            R("div", { class: Kl("content") }, [
              x === "left" && o(),
              s(),
              x === "right" && o(),
            ]),
          ],
        }
      );
    };
  },
});
const b0 = De(hq),
  [pq, gq] = Te("action-bar-button"),
  mq = We({}, _u, {
    type: String,
    text: String,
    icon: String,
    color: String,
    loading: Boolean,
    disabled: Boolean,
  });
var vq = we({
  name: pq,
  props: mq,
  setup(t, { slots: e }) {
    const n = qd(),
      { parent: r, index: i } = Zr(nM),
      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(
          b0,
          {
            class: gq([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 tC = De(vq),
  Zd = {
    show: Boolean,
    zIndex: Se,
    overlay: _e,
    duration: Se,
    teleport: [String, Object],
    lockScroll: _e,
    lazyRender: _e,
    beforeClose: Function,
    overlayProps: Object,
    overlayStyle: Object,
    overlayClass: pn,
    transitionAppear: Boolean,
    closeOnClickOverlay: _e,
  },
  iM = Object.keys(Zd);
function yq(t, e) {
  return t > e ? "horizontal" : e > t ? "vertical" : "";
}
function $l() {
  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 g = 10;
      (!s.value || (i.value < g && o.value < g)) &&
        (s.value = yq(i.value, o.value)),
        a.value && (i.value > qS || o.value > qS) && (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 Fu = 0;
const nC = "van-overflow-hidden";
function _q(t, e) {
  const n = $l(),
    r = "01",
    i = "10",
    o = (u) => {
      n.move(u);
      const f = n.deltaY.value > 0 ? i : r,
        d = Fb(u.target, t.value),
        { scrollHeight: h, offsetHeight: p, scrollTop: g } = d;
      let m = "11";
      g === 0 ? (m = p >= h ? "00" : "01") : g + p >= h && (m = "10"),
        m !== "11" &&
          n.isVertical() &&
          !(parseInt(m, 2) & parseInt(f, 2)) &&
          Nn(u, !0);
    },
    s = () => {
      document.addEventListener("touchstart", n.start),
        document.addEventListener("touchmove", o, { passive: !1 }),
        Fu || document.body.classList.add(nC),
        Fu++;
    },
    a = () => {
      Fu &&
        (document.removeEventListener("touchstart", n.start),
        document.removeEventListener("touchmove", o),
        Fu--,
        Fu || document.body.classList.remove(nC));
    },
    l = () => e() && s(),
    c = () => e() && a();
  vu(l),
    Eo(c),
    qr(c),
    ve(e, (u) => {
      u ? s() : a();
    });
}
function _w(t) {
  const e = Z(!1);
  return (
    ve(
      t,
      (n) => {
        n && (e.value = n);
      },
      { immediate: !0 }
    ),
    (n) => () => e.value ? n() : null
  );
}
const o_ = () => {
    var t;
    const { scopeId: e } = ((t = yt()) == null ? void 0 : t.vnode) || {};
    return e ? { [e]: "" } : null;
  },
  [xq, bq] = Te("overlay"),
  wq = {
    show: Boolean,
    zIndex: Se,
    duration: Se,
    className: pn,
    lockScroll: _e,
    lazyRender: _e,
    customStyle: Object,
    teleport: [String, Object],
  };
var Eq = we({
  name: xq,
  inheritAttrs: !1,
  props: wq,
  setup(t, { attrs: e, slots: n }) {
    const r = Z(),
      i = _w(() => t.show || !t.lazyRender),
      o = (a) => {
        t.lockScroll && Nn(a, !0);
      },
      s = i(() => {
        var a;
        const l = We(j8(t.zIndex), t.customStyle);
        return (
          Lt(t.duration) && (l.animationDuration = `${t.duration}s`),
          di(
            R("div", st({ ref: r, style: l, class: [bq(), t.className] }, e), [
              (a = n.default) == null ? void 0 : a.call(n),
            ]),
            [[pi, t.show]]
          )
        );
      });
    return (
      vr("touchmove", o, { target: r }),
      () => {
        const a = R(Wd, { name: "van-fade", appear: !0 }, { default: s });
        return t.teleport
          ? R(Eg, { to: t.teleport }, { default: () => [a] })
          : a;
      }
    );
  },
});
const Sq = De(Eq),
  Cq = We({}, Zd, {
    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,
  }),
  [Aq, rC] = Te("popup");
var Tq = we({
  name: Aq,
  inheritAttrs: !1,
  props: Cq,
  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 = _w(() => 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 : JK()),
          e("open"));
      },
      f = () => {
        i &&
          yu(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(Sq, st(w, o_(), { onClick: d }), {
            default: r["overlay-content"],
          });
        }
      },
      p = (w) => {
        e("clickCloseIcon", w), f();
      },
      g = () => {
        if (t.closeable)
          return R(
            tn,
            {
              role: "button",
              tabindex: 0,
              name: t.closeIcon,
              class: [rC("close-icon", t.closeIconPosition), as],
              classPrefix: t.iconPrefix,
              onClick: p,
            },
            null
          );
      };
    let m;
    const v = () => {
        m && clearTimeout(m),
          (m = setTimeout(() => {
            e("opened");
          }));
      },
      y = () => 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: [
                    rC({ round: S, [P]: P }),
                    { "van-safe-area-top": C, "van-safe-area-bottom": A },
                  ],
                  onKeydown: _,
                },
                n,
                o_()
              ),
              [(w = r.default) == null ? void 0 : w.call(r), g()]
            ),
            [[pi, T]]
          );
      }),
      b = () => {
        const { position: w, transition: E, transitionAppear: S } = t,
          P = w === "center" ? "van-fade" : `van-popup-slide-${w}`;
        return R(
          Wd,
          { name: E || P, appear: S, onAfterEnter: v, onAfterLeave: y },
          { 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 }),
      _q(a, () => t.show && t.lockScroll),
      vr("popstate", () => {
        t.closeOnPopstate && (f(), (o = !1));
      }),
      Ht(() => {
        t.show && u();
      }),
      ps(() => {
        o && (e("update:show", !0), (o = !1));
      }),
      Eo(() => {
        t.show && t.teleport && (f(), (o = !0));
      }),
      hi(Q8, () => t.show),
      () =>
        t.teleport
          ? R(Eg, { to: t.teleport }, { default: () => [h(), b()] })
          : R(Ft, null, [h(), b()])
    );
  },
});
const Ul = De(Tq),
  [Pq, ni] = Te("action-sheet"),
  Iq = We({}, Zd, {
    title: String,
    round: _e,
    actions: ss(),
    closeIcon: Me("cross"),
    closeable: _e,
    cancelText: String,
    description: String,
    closeOnPopstate: _e,
    closeOnClickAction: Boolean,
    safeAreaInsetBottom: _e,
  }),
  Oq = [...iM, "round", "closeOnPopstate", "safeAreaInsetBottom"];
var Rq = we({
  name: Pq,
  props: Iq,
  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"), as], 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(vs, { 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: g,
            disabled: m,
            className: v,
          } = f,
          y = () => {
            m ||
              p ||
              (g && g(f),
              t.closeOnClickAction && r(!1),
              Xe(() => n("select", f, d)));
          };
        return R(
          "button",
          {
            type: "button",
            style: { color: h },
            class: [ni("item", { loading: p, disabled: m }), v],
            onClick: y,
          },
          [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(
        Ul,
        st({ class: ni(), position: "bottom", "onUpdate:show": r }, $t(t, Oq)),
        {
          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 g3e = De(Rq),
  [Mq, zo, iC] = Te("picker"),
  oM = (t) => t.find((e) => !e.disabled) || t[0];
function Dq(t, e) {
  const n = t[0];
  if (n) {
    if (Array.isArray(n)) return "multiple";
    if (e.children in n) return "cascade";
  }
  return "default";
}
function Lp(t, e) {
  e = Hn(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 oC = (t, e, n) => e !== void 0 && t.some((r) => r[n.value] === e);
function s_(t, e, n) {
  const r = t.findIndex((o) => o[n.value] === e),
    i = Lp(t, r);
  return t[i];
}
function Bq(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) ? s_(s, a, e) : void 0), !i && s.length)) {
      const l = oM(s)[e.value];
      i = s_(s, l, e);
    }
    o++, r.push(s);
  }
  return r;
}
function kq(t) {
  const { transform: e } = window.getComputedStyle(t),
    n = e.slice(7, e.length - 1).split(", ")[5];
  return Number(n);
}
function Nq(t) {
  return We({ text: "text", value: "value", children: "children" }, t);
}
const sC = 200,
  aC = 300,
  Fq = 15,
  [sM, r1] = Te("picker-column"),
  aM = Symbol(sM);
var Lq = we({
  name: sM,
  props: {
    value: Se,
    fields: fr(Object),
    options: ss(),
    readonly: Boolean,
    allowHtml: Boolean,
    optionHeight: fr(Number),
    swipeDuration: fr(Se),
    visibleOptionNum: fr(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 = $l(),
      h = () => t.options.length,
      p = () => (t.optionHeight * (+t.visibleOptionNum - 1)) / 2,
      g = (C) => {
        let A = Lp(t.options, C);
        const T = -A * t.optionHeight,
          I = () => {
            A > h() - 1 && (A = Lp(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);
      },
      m = () => t.readonly || !t.options.length,
      v = (C) => {
        r ||
          m() ||
          ((a = null), (f.value = sC), g(C), e("clickOption", t.options[C]));
      },
      y = (C) => Hn(Math.round(-C / t.optionHeight), 0, h() - 1),
      _ = re(() => y(u.value)),
      x = (C, A) => {
        const T = Math.abs(C / A);
        C = u.value + (T / 0.003) * (C < 0 ? -1 : 1);
        const I = y(C);
        (f.value = +t.swipeDuration), g(I);
      },
      b = () => {
        (r = !1), (f.value = 0), a && (a(), (a = null));
      },
      w = (C) => {
        if (!m()) {
          if ((d.start(C), r)) {
            const A = kq(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 (m()) return;
        d.move(C), d.isVertical() && ((r = !0), Nn(C, !0));
        const A = Hn(
            i + d.deltaY.value,
            -(h() * t.optionHeight),
            t.optionHeight
          ),
          T = y(A);
        T !== _.value && e("scrollInto", t.options[T]), (u.value = A);
        const I = Date.now();
        I - o > aC && ((o = I), (s = A));
      },
      S = () => {
        if (m()) return;
        const C = u.value - s,
          A = Date.now() - o;
        if (A < aC && Math.abs(C) > Fq) {
          x(C, A);
          return;
        }
        const I = y(u.value);
        (f.value = sC),
          g(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],
            D = {
              role: "button",
              style: C,
              tabindex: B ? -1 : 0,
              class: [
                r1("item", { disabled: B, selected: G === t.value }),
                A.className,
              ],
              onClick: () => v(T),
            },
            $ = {
              class: "van-ellipsis",
              [t.allowHtml ? "innerHTML" : "textContent"]: I,
            };
          return R("li", D, [n.option ? n.option(A, T) : R("div", $, null)]);
        });
      };
    return (
      Zr(aM),
      Kt({ stopMomentum: b }),
      gu(() => {
        const C = r
            ? Math.floor(-u.value / t.optionHeight)
            : t.options.findIndex((I) => I[t.fields.value] === t.value),
          A = Lp(t.options, C),
          T = -A * t.optionHeight;
        r && A < C && b(), (u.value = T);
      }),
      vr("touchmove", E, { target: l }),
      () =>
        R(
          "div",
          {
            ref: l,
            class: r1(),
            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: r1("wrapper"),
                onTransitionend: b,
              },
              [P()]
            ),
          ]
        )
    );
  },
});
const [$q] = Te("picker-toolbar"),
  zg = { title: String, cancelButtonText: String, confirmButtonText: String },
  Uq = ["cancel", "confirm", "title", "toolbar"],
  Gq = Object.keys(zg);
var Hq = we({
  name: $q,
  props: zg,
  emits: ["confirm", "cancel"],
  setup(t, { emit: e, slots: n }) {
    const r = () => {
        if (n.title) return n.title();
        if (t.title)
          return R("div", { class: [zo("title"), "van-ellipsis"] }, [t.title]);
      },
      i = () => e("cancel"),
      o = () => e("confirm"),
      s = () => {
        var l;
        const c = (l = t.cancelButtonText) != null ? l : iC("cancel");
        if (!(!n.cancel && !c))
          return R(
            "button",
            { type: "button", class: [zo("cancel"), as], onClick: i },
            [n.cancel ? n.cancel() : c]
          );
      },
      a = () => {
        var l;
        const c = (l = t.confirmButtonText) != null ? l : iC("confirm");
        if (!(!n.confirm && !c))
          return R(
            "button",
            { type: "button", class: [zo("confirm"), as], onClick: o },
            [n.confirm ? n.confirm() : c]
          );
      };
    return () =>
      R("div", { class: zo("toolbar") }, [
        n.toolbar ? n.toolbar() : [s(), r(), a()],
      ]);
  },
});
const Vq = (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.22
 * (c) 2018-present Yuxi (Evan) You and Vue contributors
 * @license MIT
 **/ const lM = Array.isArray,
  sd = (t) => typeof t == "string",
  cM = (t) => t !== null && typeof t == "object",
  zq = (t) => {
    const e = Object.create(null);
    return (n) => e[n] || (e[n] = t(n));
  },
  jq = /\B([A-Z])/g,
  Wq = zq((t) => t.replace(jq, "-$1").toLowerCase());
function uM(t) {
  if (lM(t)) {
    const e = {};
    for (let n = 0; n < t.length; n++) {
      const r = t[n],
        i = sd(r) ? qq(r) : uM(r);
      if (i) for (const o in i) e[o] = i[o];
    }
    return e;
  } else if (sd(t) || cM(t)) return t;
}
const Yq = /;(?![^(]*\))/g,
  Xq = /:([^]+)/,
  Kq = /\/\*[^]*?\*\//g;
function qq(t) {
  const e = {};
  return (
    t
      .replace(Kq, "")
      .split(Yq)
      .forEach((n) => {
        if (n) {
          const r = n.split(Xq);
          r.length > 1 && (e[r[0].trim()] = r[1].trim());
        }
      }),
    e
  );
}
function Zq(t) {
  if (!t) return "";
  if (sd(t)) return t;
  let e = "";
  for (const n in t) {
    const r = t[n];
    if (sd(r) || typeof r == "number") {
      const i = n.startsWith("--") ? n : Wq(n);
      e += `${i}:${r};`;
    }
  }
  return e;
}
function fM(t) {
  let e = "";
  if (sd(t)) e = t;
  else if (lM(t))
    for (let n = 0; n < t.length; n++) {
      const r = fM(t[n]);
      r && (e += r + " ");
    }
  else if (cM(t)) for (const n in t) t[n] && (e += n + " ");
  return e.trim();
}
function Jq(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() {
    Yd(r);
  }
  function c() {
    (a += (e - o) / s), (t.scrollLeft = a), ++i < s && (r = pr(c));
  }
  return c(), l;
}
function Qq(t, e, n, r) {
  let i,
    o = Kd(t);
  const s = o < e,
    a = n === 0 ? 1 : Math.round((n * 1e3) / 16),
    l = (e - o) / a;
  function c() {
    Yd(i);
  }
  function u() {
    (o += l),
      ((s && o > e) || (!s && o < e)) && (o = e),
      x0(t, o),
      (s && o < e) || (!s && o > e) ? (i = pr(u)) : r && (i = pr(r));
  }
  return u(), c;
}
let eZ = 0;
function xw() {
  const t = yt(),
    { name: e = "unknown" } = (t == null ? void 0 : t.type) || {};
  return `${e}-${++eZ}`;
}
function dM() {
  const t = Z([]),
    e = [];
  return (
    wg(() => {
      t.value = [];
    }),
    [
      t,
      (r) => (
        e[r] ||
          (e[r] = (i) => {
            t.value[r] = i;
          }),
        e[r]
      ),
    ]
  );
}
function hM(t, e) {
  if (!vo || !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);
    };
  Eo(i), qr(i), vu(r);
}
const [tZ, nZ] = Te("sticky"),
  rZ = {
    zIndex: Se,
    position: Me("top"),
    container: Object,
    offsetTop: ze(0),
    offsetBottom: ze(0),
  };
var iZ = we({
  name: tZ,
  props: rZ,
  emits: ["scroll", "change"],
  setup(t, { emit: e, slots: n }) {
    const r = Z(),
      i = Xd(r),
      o = At({ fixed: !1, width: 0, height: 0, transform: 0 }),
      s = Z(!1),
      a = re(() => vw(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(j8(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 || jc(r)) return;
        const { container: d, position: h } = t,
          p = Sn(r),
          g = Kd(window);
        if (((o.width = p.width), (o.height = p.height), h === "top"))
          if (d) {
            const m = Sn(d),
              v = m.bottom - a.value - o.height;
            (o.fixed = a.value > p.top && m.bottom > 0),
              (o.transform = v < 0 ? v : 0);
          } else o.fixed = a.value > p.top;
        else {
          const { clientHeight: m } = document.documentElement;
          if (d) {
            const v = Sn(d),
              y = m - v.top - a.value - o.height;
            (o.fixed = m - a.value < p.bottom && m > v.top),
              (o.transform = y < 0 ? -y : 0);
          } else o.fixed = m - a.value < p.bottom;
        }
        u(g);
      };
    return (
      ve(
        () => o.fixed,
        (d) => e("change", d)
      ),
      vr("scroll", f, { target: i, passive: !0 }),
      hM(r, f),
      ve([Xo, Zs], () => {
        !r.value ||
          jc(r) ||
          !o.fixed ||
          ((s.value = !0),
          Xe(() => {
            const d = Sn(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: nZ({ fixed: o.fixed && !s.value }), style: c.value },
            [(d = n.default) == null ? void 0 : d.call(n)]
          ),
        ]);
      }
    );
  },
});
const oZ = De(iZ),
  [pM, Fh] = Te("swipe"),
  sZ = {
    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,
  },
  gM = Symbol(pM);
var aZ = we({
  name: pM,
  props: sZ,
  emits: ["change", "dragStart", "dragEnd"],
  setup(t, { emit: e, slots: n }) {
    const r = Z(),
      i = Z(),
      o = At({
        rect: null,
        width: 0,
        height: 0,
        offset: 0,
        active: 0,
        swiping: !1,
      });
    let s = !1;
    const a = $l(),
      { children: l, linkChildren: c } = Hi(gM),
      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
      ),
      g = re(() => u.value * f.value),
      m = re(() => (o.active + u.value) % u.value),
      v = re(() => {
        const se = t.vertical ? "vertical" : "horizontal";
        return a.direction.value === se;
      }),
      y = re(() => {
        const se = {
          transitionDuration: `${o.swiping ? 0 : t.duration}ms`,
          transform: `translate${t.vertical ? "Y" : "X"}(${+o.offset.toFixed(
            2
          )}px)`,
        };
        if (f.value) {
          const Y = t.vertical ? "height" : "width",
            te = t.vertical ? "width" : "height";
          (se[Y] = `${g.value}px`), (se[te] = t[te] ? `${t[te]}px` : "");
        }
        return se;
      }),
      _ = (se) => {
        const { active: Y } = o;
        return se
          ? t.loop
            ? Hn(Y + se, -1, u.value)
            : Hn(Y + se, 0, p.value)
          : Y;
      },
      x = (se, Y = 0) => {
        let te = se * f.value;
        t.loop || (te = Math.min(te, -h.value));
        let pe = Y - te;
        return t.loop || (pe = Hn(pe, h.value, 0)), pe;
      },
      b = ({ pace: se = 0, offset: Y = 0, emitChange: te }) => {
        if (u.value <= 1) return;
        const { active: pe } = o,
          F = _(se),
          J = x(F, Y);
        if (t.loop) {
          if (l[0] && J !== h.value) {
            const L = J < h.value;
            l[0].setOffset(L ? g.value : 0);
          }
          if (l[u.value - 1] && J !== 0) {
            const L = J > 0;
            l[u.value - 1].setOffset(L ? -g.value : 0);
          }
        }
        (o.active = F), (o.offset = J), te && F !== pe && e("change", m.value);
      },
      w = () => {
        (o.swiping = !0),
          o.active <= -1
            ? b({ pace: u.value })
            : o.active >= u.value && b({ pace: -u.value });
      },
      E = () => {
        w(),
          a.reset(),
          za(() => {
            (o.swiping = !1), b({ pace: -1, emitChange: !0 });
          });
      },
      S = () => {
        w(),
          a.reset(),
          za(() => {
            (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 = (se = +t.initialSwipe) => {
        if (!r.value) return;
        const Y = () => {
          var te, pe;
          if (!jc(r)) {
            const F = {
              width: r.value.offsetWidth,
              height: r.value.offsetHeight,
            };
            (o.rect = F),
              (o.width = +((te = t.width) != null ? te : F.width)),
              (o.height = +((pe = t.height) != null ? pe : F.height));
          }
          u.value &&
            ((se = Math.min(u.value - 1, se)), se === -1 && (se = u.value - 1)),
            (o.active = se),
            (o.swiping = !0),
            (o.offset = x(se)),
            l.forEach((F) => {
              F.setOffset(0);
            }),
            A();
        };
        jc(r) ? Xe().then(Y) : Y();
      },
      I = () => T(o.active);
    let B;
    const G = (se) => {
        !t.touchable ||
          se.touches.length > 1 ||
          (a.start(se), (s = !1), (B = Date.now()), C(), w());
      },
      D = (se) => {
        t.touchable &&
          o.swiping &&
          (a.move(se),
          v.value &&
            ((!t.loop &&
              ((o.active === 0 && d.value > 0) ||
                (o.active === u.value - 1 && d.value < 0))) ||
              (Nn(se, t.stopPropagation),
              b({ offset: d.value }),
              s || (e("dragStart", { index: m.value }), (s = !0)))));
      },
      $ = () => {
        if (!t.touchable || !o.swiping) return;
        const se = Date.now() - B,
          Y = d.value / se;
        if (
          (Math.abs(Y) > 0.25 || Math.abs(d.value) > f.value / 2) &&
          v.value
        ) {
          const pe = t.vertical ? a.offsetY.value : a.offsetX.value;
          let F = 0;
          t.loop
            ? (F = pe > 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: m.value }), A();
      },
      z = (se, Y = {}) => {
        w(),
          a.reset(),
          za(() => {
            let te;
            t.loop && se === u.value
              ? (te = o.active === 0 ? 0 : se)
              : (te = se % u.value),
              Y.immediate
                ? za(() => {
                    o.swiping = !1;
                  })
                : (o.swiping = !1),
              b({ pace: te - o.active, emitChange: !0 });
          });
      },
      K = (se, Y) => {
        const te = Y === m.value,
          pe = te ? { backgroundColor: t.indicatorColor } : void 0;
        return R(
          "i",
          { style: pe, class: Fh("indicator", { active: te }) },
          null
        );
      },
      fe = () => {
        if (n.indicator)
          return n.indicator({ active: m.value, total: u.value });
        if (t.showIndicators && u.value > 1)
          return R(
            "div",
            { class: Fh("indicators", { vertical: t.vertical }) },
            [Array(u.value).fill("").map(K)]
          );
      };
    return (
      Kt({ prev: E, next: S, state: o, resize: I, swipeTo: z }),
      c({ size: f, props: t, count: u, activeIndicator: m }),
      ve(
        () => t.initialSwipe,
        (se) => T(+se)
      ),
      ve(u, () => T(o.active)),
      ve(() => t.autoplay, A),
      ve([Xo, Zs, () => t.width, () => t.height], I),
      ve(fR(), (se) => {
        se === "visible" ? A() : C();
      }),
      Ht(T),
      ps(() => T(o.active)),
      yw(() => T(o.active)),
      Eo(C),
      qr(C),
      vr("touchmove", D, { target: i }),
      () => {
        var se;
        return R("div", { ref: r, class: Fh() }, [
          R(
            "div",
            {
              ref: i,
              style: y.value,
              class: Fh("track", { vertical: t.vertical }),
              onTouchstartPassive: G,
              onTouchend: $,
              onTouchcancel: $,
            },
            [(se = n.default) == null ? void 0 : se.call(n)]
          ),
          fe(),
        ]);
      }
    );
  },
});
const mM = De(aZ),
  [lZ, lC] = Te("tabs");
var cZ = we({
  name: lZ,
  props: {
    count: fr(Number),
    inited: Boolean,
    animated: Boolean,
    duration: fr(Se),
    swipeable: Boolean,
    lazyRender: Boolean,
    currentIndex: fr(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(
              mM,
              {
                ref: r,
                loop: !1,
                class: lC("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: lC("content", { animated: t.animated || t.swipeable }) },
          [o()]
        )
    );
  },
});
const [vM, Lh] = Te("tabs"),
  uZ = {
    type: Me("line"),
    color: String,
    border: Boolean,
    sticky: Boolean,
    shrink: Boolean,
    active: ze(0),
    duration: ze(0.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,
  },
  yM = Symbol(vM);
var fZ = we({
  name: vM,
  props: uZ,
  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 = xw(),
      h = Xd(l),
      [p, g] = dM(),
      { children: m, linkChildren: v } = Hi(yM),
      y = At({ inited: !1, position: "", lineStyle: {}, currentIndex: -1 }),
      _ = re(() => m.length > +t.swipeThreshold || !t.ellipsis || t.shrink),
      x = re(() => ({ borderColor: t.color, background: t.background })),
      b = (F, J) => {
        var L;
        return (L = F.name) != null ? L : J;
      },
      w = re(() => {
        const F = m[y.currentIndex];
        if (F) return b(F, y.currentIndex);
      }),
      E = re(() => vw(t.offsetTop)),
      S = re(() => (t.sticky ? E.value + r : 0)),
      P = (F) => {
        const J = c.value,
          L = p.value;
        if (!_.value || !J || !L || !L[y.currentIndex]) return;
        const ne = L[y.currentIndex].$el,
          ee = ne.offsetLeft - (J.offsetWidth - ne.offsetWidth) / 2;
        s && s(), (s = Jq(J, ee, F ? 0 : +t.duration));
      },
      C = () => {
        const F = y.inited;
        Xe(() => {
          const J = p.value;
          if (!J || !J[y.currentIndex] || t.type !== "line" || jc(l.value))
            return;
          const L = J[y.currentIndex].$el,
            { lineWidth: ne, lineHeight: ee } = t,
            de = L.offsetLeft + L.offsetWidth / 2,
            ge = {
              width: nt(ne),
              backgroundColor: t.color,
              transform: `translateX(${de}px) translateX(-50%)`,
            };
          if ((F && (ge.transitionDuration = `${t.duration}s`), Lt(ee))) {
            const xe = nt(ee);
            (ge.height = xe), (ge.borderRadius = xe);
          }
          y.lineStyle = ge;
        });
      },
      A = (F) => {
        const J = F < y.currentIndex ? -1 : 1;
        for (; F >= 0 && F < m.length; ) {
          if (!m[F].disabled) return F;
          F += J;
        }
      },
      T = (F, J) => {
        const L = A(F);
        if (!Lt(L)) return;
        const ne = m[L],
          ee = b(ne, L),
          de = y.currentIndex !== null;
        y.currentIndex !== L && ((y.currentIndex = L), J || P(), C()),
          ee !== t.active &&
            (e("update:active", ee), de && e("change", ee, ne.title)),
          o && !t.scrollspy && mw(Math.ceil(WS(l.value) - E.value));
      },
      I = (F, J) => {
        const L = m.findIndex((ne, ee) => b(ne, ee) === F);
        T(L === -1 ? 0 : L, J);
      },
      B = (F = !1) => {
        if (t.scrollspy) {
          const J = m[y.currentIndex].$el;
          if (J && h.value) {
            const L = WS(J, h.value) - S.value;
            (i = !0),
              a && a(),
              (a = Qq(h.value, L, F ? 0 : +t.duration, () => {
                i = !1;
              }));
          }
        }
      },
      G = (F, J, L) => {
        const { title: ne, disabled: ee } = m[J],
          de = b(m[J], J);
        ee ||
          (yu(t.beforeChange, {
            args: [de],
            done: () => {
              T(J), B();
            },
          }),
          rM(F)),
          e("clickTab", { name: de, title: ne, event: L, disabled: ee });
      },
      D = (F) => {
        (o = F.isFixed), e("scroll", F);
      },
      $ = (F) => {
        Xe(() => {
          I(F), B(!0);
        });
      },
      z = () => {
        for (let F = 0; F < m.length; F++) {
          const { top: J } = Sn(m[F].$el);
          if (J > S.value) return F === 0 ? 0 : F - 1;
        }
        return m.length - 1;
      },
      K = () => {
        if (t.scrollspy && !i) {
          const F = z();
          T(F);
        }
      },
      fe = () => {
        if (t.type === "line" && m.length)
          return R("div", { class: Lh("line"), style: y.lineStyle }, null);
      },
      se = () => {
        var F, J, L;
        const { type: ne, border: ee, sticky: de } = t,
          ge = [
            R(
              "div",
              {
                ref: de ? void 0 : u,
                class: [Lh("wrap"), { [q8]: ne === "line" && ee }],
              },
              [
                R(
                  "div",
                  {
                    ref: c,
                    role: "tablist",
                    class: Lh("nav", [
                      ne,
                      { shrink: t.shrink, complete: _.value },
                    ]),
                    style: x.value,
                    "aria-orientation": "horizontal",
                  },
                  [
                    (F = n["nav-left"]) == null ? void 0 : F.call(n),
                    m.map((xe) => xe.renderTitle(G)),
                    fe(),
                    (J = n["nav-right"]) == null ? void 0 : J.call(n),
                  ]
                ),
              ]
            ),
            (L = n["nav-bottom"]) == null ? void 0 : L.call(n),
          ];
        return de ? R("div", { ref: u }, [ge]) : ge;
      },
      Y = () => {
        C(),
          Xe(() => {
            var F, J;
            P(!0),
              (J = (F = f.value) == null ? void 0 : F.swipeRef.value) == null ||
                J.resize();
          });
      };
    ve(() => [t.color, t.duration, t.lineWidth, t.lineHeight], C),
      ve(Xo, Y),
      ve(
        () => t.active,
        (F) => {
          F !== w.value && I(F);
        }
      ),
      ve(
        () => m.length,
        () => {
          y.inited &&
            (I(t.active),
            C(),
            Xe(() => {
              P(!0);
            }));
        }
      );
    const te = () => {
        I(t.active, !0),
          Xe(() => {
            (y.inited = !0), u.value && (r = Sn(u.value).height), P(!0);
          });
      },
      pe = (F, J) => e("rendered", F, J);
    return (
      Kt({ resize: Y, scrollTo: $ }),
      ps(C),
      yw(C),
      vu(te),
      hM(l, C),
      vr("scroll", K, { target: h, passive: !0 }),
      v({
        id: d,
        props: t,
        setLine: C,
        scrollable: _,
        onRendered: pe,
        currentName: w,
        setTitleRefs: g,
        scrollIntoView: P,
      }),
      () =>
        R("div", { ref: l, class: Lh([t.type]) }, [
          t.showHeader
            ? t.sticky
              ? R(
                  oZ,
                  { container: l.value, offsetTop: E.value, onScroll: D },
                  { default: () => [se()] }
                )
              : se()
            : null,
          R(
            cZ,
            {
              ref: f,
              count: m.length,
              inited: y.inited,
              animated: t.animated,
              duration: t.duration,
              swipeable: t.swipeable,
              lazyRender: t.lazyRender,
              currentIndex: y.currentIndex,
              onChange: T,
            },
            {
              default: () => {
                var F;
                return [(F = n.default) == null ? void 0 : F.call(n)];
              },
            }
          ),
        ])
    );
  },
});
const dZ = Symbol(),
  _M = Symbol(),
  xM = () => hn(_M, null),
  hZ = (t) => {
    const e = xM();
    hi(dZ, t),
      hi(
        _M,
        re(() => (e == null || e.value) && t.value)
      );
  },
  [pZ, cC] = Te("tab"),
  gZ = we({
    name: pZ,
    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: cC("text", { ellipsis: !t.scrollable }) },
            [e.title ? e.title() : t.title]
          );
          return t.dot || (Lt(t.badge) && t.badge !== "")
            ? R(
                Vg,
                { dot: t.dot, content: t.badge, showZero: t.showZeroBadge },
                { default: () => [i] }
              )
            : i;
        };
      return () =>
        R(
          "div",
          {
            id: t.id,
            role: "tab",
            class: [
              cC([
                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()]
        );
    },
  }),
  [mZ, vZ] = Te("swipe-item");
var yZ = we({
  name: mZ,
  setup(t, { slots: e }) {
    let n;
    const r = At({ offset: 0, inited: !1, mounted: !1 }),
      { parent: i, index: o } = Zr(gM);
    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: vZ(), style: s.value }, [
          a.value ? ((c = e.default) == null ? void 0 : c.call(e)) : null,
        ]);
      }
    );
  },
});
const bM = De(yZ),
  [_Z, i1] = Te("tab"),
  xZ = We({}, _u, {
    dot: Boolean,
    name: Se,
    badge: Se,
    title: String,
    disabled: Boolean,
    titleClass: pn,
    titleStyle: [String, Object],
    showZeroBadge: _e,
  });
var bZ = we({
  name: _Z,
  props: xZ,
  setup(t, { slots: e }) {
    const n = xw(),
      r = Z(!1),
      i = yt(),
      { parent: o, index: s } = Zr(yM);
    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("");
    gu(() => {
      const { titleClass: p, titleStyle: g } = t;
      (u.value = p ? fM(p) : ""),
        (f.value = g && typeof g != "string" ? Zq(uM(g)) : g);
    });
    const d = (p) =>
        R(
          gZ,
          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: (g) => p(i.proxy, s.value, g),
            },
            $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)
          : za(() => {
              h.value = !0;
            });
      }),
      ve(
        () => t.title,
        () => {
          o.setLine(), o.scrollIntoView();
        }
      ),
      hZ(c),
      Kt({ id: n, renderTitle: d }),
      () => {
        var p;
        const g = `${o.id}-${s.value}`,
          { animated: m, swipeable: v, scrollspy: y, lazyRender: _ } = o.props;
        if (!e.default && !m) return;
        const x = y || c.value;
        if (m || v)
          return R(
            bM,
            {
              id: n,
              role: "tabpanel",
              class: i1("panel-wrapper", { inactive: h.value }),
              tabindex: c.value ? 0 : -1,
              "aria-hidden": !c.value,
              "aria-labelledby": g,
              "data-allow-mismatch": "attribute",
            },
            {
              default: () => {
                var E;
                return [
                  R("div", { class: i1("panel") }, [
                    (E = e.default) == null ? void 0 : E.call(e),
                  ]),
                ];
              },
            }
          );
        const w =
          r.value || y || !_
            ? (p = e.default) == null
              ? void 0
              : p.call(e)
            : null;
        return di(
          R(
            "div",
            {
              id: n,
              role: "tabpanel",
              class: i1("panel"),
              tabindex: x ? 0 : -1,
              "aria-labelledby": g,
              "data-allow-mismatch": "attribute",
            },
            [w]
          ),
          [[pi, x]]
        );
      }
    );
  },
});
const m3e = De(bZ),
  v3e = De(fZ),
  [wZ, y3e] = Te("picker-group"),
  EZ = Symbol(wZ);
We({ tabs: ss(), activeTab: ze(0), nextStepText: String, showToolbar: _e }, zg);
const bw = We(
    {
      loading: Boolean,
      readonly: Boolean,
      allowHtml: Boolean,
      optionHeight: ze(44),
      showToolbar: _e,
      swipeDuration: ze(1e3),
      visibleOptionNum: ze(6),
    },
    zg
  ),
  SZ = We({}, bw, {
    columns: ss(),
    modelValue: ss(),
    toolbarPosition: Me("top"),
    columnsFieldNames: Object,
  });
var CZ = we({
  name: Mq,
  props: SZ,
  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(EZ),
      { children: s, linkChildren: a } = Hi(aM);
    a();
    const l = re(() => Nq(t.columnsFieldNames)),
      c = re(() => vw(t.optionHeight)),
      u = re(() => Dq(t.columns, l.value)),
      f = re(() => {
        const { columns: T } = t;
        switch (u.value) {
          case "multiple":
            return T;
          case "cascade":
            return Bq(T, l.value, i);
          default:
            return [T];
        }
      }),
      d = re(() => f.value.some((T) => T.length)),
      h = re(() => f.value.map((T, I) => s_(T, i.value[I], l.value))),
      p = re(() =>
        f.value.map((T, I) =>
          T.findIndex((B) => B[l.value.value] === i.value[I])
        )
      ),
      g = (T, I) => {
        if (i.value[T] !== I) {
          const B = i.value.slice(0);
          (B[T] = I), (i.value = B);
        }
      },
      m = () => ({
        selectedValues: i.value.slice(0),
        selectedOptions: h.value,
        selectedIndexes: p.value,
      }),
      v = (T, I) => {
        g(I, T),
          u.value === "cascade" &&
            i.value.forEach((B, G) => {
              const D = f.value[G];
              oC(D, B, l.value) ||
                g(G, D.length ? D[0][l.value.value] : void 0);
            }),
          Xe(() => {
            e("change", We({ columnIndex: I }, m()));
          });
      },
      y = (T, I) => {
        const B = { columnIndex: I, currentOption: T };
        e("clickOption", We(m(), B)), e("scrollInto", B);
      },
      _ = () => {
        s.forEach((I) => I.stopMomentum());
        const T = m();
        return (
          Xe(() => {
            const I = m();
            e("confirm", I);
          }),
          T
        );
      },
      x = () => e("cancel", m()),
      b = () =>
        f.value.map((T, I) =>
          R(
            Lq,
            {
              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) => v(B, I),
              onClickOption: (B) => y(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: zo("mask"), style: B }, null),
            R("div", { class: [VK, zo("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: zo("columns"), style: I }, [b(), w(T)]);
      },
      S = () => {
        if (t.showToolbar && !o)
          return R(Hq, st($t(t, Gq), { onConfirm: _, onCancel: x }), $t(n, Uq));
      },
      P = (T) => {
        T.forEach((I, B) => {
          I.length && !oC(I, i.value[B], l.value) && g(B, oM(I)[l.value.value]);
        });
      };
    ve(f, (T) => P(T), { immediate: !0 });
    let C;
    return (
      ve(
        () => t.modelValue,
        (T) => {
          !qs(T, i.value) &&
            !qs(T, C) &&
            ((i.value = T.slice(0)), (C = T.slice(0))),
            t.modelValue.length === 0 && P(f.value);
        },
        { deep: !0 }
      ),
      ve(
        i,
        (T) => {
          qs(T, t.modelValue) || ((C = T.slice(0)), e("update:modelValue", C));
        },
        { immediate: !0 }
      ),
      vr("touchmove", Nn, { target: r }),
      Kt({ confirm: _, getSelectedOptions: () => h.value }),
      () => {
        var T, I;
        return R("div", { class: zo() }, [
          t.toolbarPosition === "top" ? S() : null,
          t.loading ? R(vs, { class: zo("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 AZ = De(CZ),
  [TZ, ql] = Te("cell"),
  jg = {
    tag: Me("div"),
    icon: String,
    size: String,
    title: Se,
    value: Se,
    label: Se,
    center: Boolean,
    isLink: Boolean,
    border: _e,
    iconPrefix: String,
    valueClass: pn,
    labelClass: pn,
    titleClass: pn,
    titleStyle: null,
    arrowDirection: String,
    required: { type: [Boolean, String], default: null },
    clickable: { type: Boolean, default: null },
  },
  PZ = We({}, jg, _u);
var IZ = we({
  name: TZ,
  props: PZ,
  setup(t, { slots: e }) {
    const n = qd(),
      r = () => {
        if (e.label || Lt(t.label))
          return R("div", { class: [ql("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: [ql("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: [ql("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: ql("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: ql("right-icon") }, null);
        }
      };
    return () => {
      var l;
      const {
          tag: c,
          size: u,
          center: f,
          border: d,
          isLink: h,
          required: p,
        } = t,
        g = (l = t.clickable) != null ? l : h,
        m = { center: f, required: !!p, clickable: g, borderless: !d };
      return (
        u && (m[u] = !!u),
        R(
          c,
          {
            class: ql(m),
            role: g ? "button" : void 0,
            tabindex: g ? 0 : void 0,
            onClick: n,
          },
          {
            default: () => {
              var v;
              return [
                s(),
                i(),
                o(),
                a(),
                (v = e.extra) == null ? void 0 : v.call(e),
              ];
            },
          }
        )
      );
    };
  },
});
const wM = De(IZ),
  [OZ, RZ] = Te("form"),
  MZ = {
    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 DZ = we({
  name: OZ,
  props: MZ,
  emits: ["submit", "failed"],
  setup(t, { emit: e, slots: n }) {
    const { children: r, linkChildren: i } = Hi(Z8),
      o = (m) => (m ? r.filter((v) => m.includes(v.name)) : r),
      s = (m) =>
        new Promise((v, y) => {
          const _ = [];
          o(m)
            .reduce(
              (b, w) =>
                b.then(() => {
                  if (!_.length)
                    return w.validate().then((E) => {
                      E && _.push(E);
                    });
                }),
              Promise.resolve()
            )
            .then(() => {
              _.length ? y(_) : v();
            });
        }),
      a = (m) =>
        new Promise((v, y) => {
          const _ = o(m);
          Promise.all(_.map((x) => x.validate())).then((x) => {
            (x = x.filter(Boolean)), x.length ? y(x) : v();
          });
        }),
      l = (m) => {
        const v = r.find((y) => y.name === m);
        return v
          ? new Promise((y, _) => {
              v.validate().then((x) => {
                x ? _(x) : y();
              });
            })
          : Promise.reject();
      },
      c = (m) => (typeof m == "string" ? l(m) : t.validateFirst ? s(m) : a(m)),
      u = (m) => {
        typeof m == "string" && (m = [m]),
          o(m).forEach((y) => {
            y.resetValidation();
          });
      },
      f = () =>
        r.reduce((m, v) => ((m[v.name] = v.getValidationStatus()), m), {}),
      d = (m, v) => {
        r.some((y) => (y.name === m ? (y.$el.scrollIntoView(v), !0) : !1));
      },
      h = () =>
        r.reduce(
          (m, v) => (v.name !== void 0 && (m[v.name] = v.formValue.value), m),
          {}
        ),
      p = () => {
        const m = h();
        c()
          .then(() => e("submit", m))
          .catch((v) => {
            e("failed", { values: m, errors: v });
            const { scrollToError: y, scrollToErrorPosition: _ } = t;
            y && v[0].name && d(v[0].name, _ ? { block: _ } : void 0);
          });
      },
      g = (m) => {
        Nn(m), p();
      };
    return (
      i({ props: t }),
      Kt({
        submit: p,
        validate: c,
        getValues: h,
        scrollToField: d,
        resetValidation: u,
        getValidationStatus: f,
      }),
      () => {
        var m;
        return R("form", { class: RZ(), onSubmit: g }, [
          (m = n.default) == null ? void 0 : m.call(n),
        ]);
      }
    );
  },
});
const _3e = De(DZ);
function EM(t) {
  return Array.isArray(t) ? !t.length : t === 0 ? !1 : !t;
}
function BZ(t, e) {
  if (EM(t)) {
    if (e.required) return !1;
    if (e.validateEmpty === !1) return !0;
  }
  return !(e.pattern && !e.pattern.test(String(t)));
}
function kZ(t, e) {
  return new Promise((n) => {
    const r = e.validator(t, e);
    if (pw(r)) {
      r.then(n);
      return;
    }
    n(r);
  });
}
function uC(t, e) {
  const { message: n } = e;
  return zc(n) ? n(t, e) : n || "";
}
function NZ({ target: t }) {
  t.composing = !0;
}
function fC({ target: t }) {
  t.composing && ((t.composing = !1), t.dispatchEvent(new Event("input")));
}
function FZ(t, e) {
  const n = gw();
  t.style.height = "auto";
  let r = t.scrollHeight;
  if (yo(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`), mw(n));
}
function LZ(t, e) {
  return (
    t === "number" && ((t = "text"), e ?? (e = "decimal")),
    t === "digit" && ((t = "tel"), e ?? (e = "numeric")),
    { type: t, inputmode: e }
  );
}
function Po(t) {
  return [...t].length;
}
function o1(t, e) {
  return [...t].slice(0, e).join("");
}
const [$Z, ri] = Te("field"),
  UZ = {
    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,
  },
  GZ = We({}, jg, UZ, {
    rows: Se,
    type: Me("text"),
    rules: Array,
    autosize: [Boolean, Object],
    labelWidth: Se,
    labelClass: pn,
    labelAlign: String,
    showWordLimit: Boolean,
    errorMessageAlign: String,
    colon: { type: Boolean, default: null },
  });
var HZ = we({
  name: $Z,
  props: GZ,
  emits: [
    "blur",
    "focus",
    "clear",
    "keypress",
    "clickInput",
    "endValidate",
    "startValidate",
    "clickLeftIcon",
    "clickRightIcon",
    "update:modelValue",
  ],
  setup(t, { emit: e, slots: n }) {
    const r = xw(),
      i = At({ status: "unvalidated", focused: !1, validateMessage: "" }),
      o = Z(),
      s = Z(),
      a = Z(),
      { parent: l } = Zr(Z8),
      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 ne = c() !== "",
            ee =
              t.clearTrigger === "always" ||
              (t.clearTrigger === "focus" && i.focused);
          return ne && ee;
        }
        return !1;
      }),
      d = re(() => (a.value && n.input ? a.value() : t.modelValue)),
      h = re(() => {
        var L;
        const ne = u("required");
        return ne === "auto"
          ? (L = t.rules) == null
            ? void 0
            : L.some((ee) => ee.required)
          : ne;
      }),
      p = (L) =>
        L.reduce(
          (ne, ee) =>
            ne.then(() => {
              if (i.status === "failed") return;
              let { value: de } = d;
              if ((ee.formatter && (de = ee.formatter(de, ee)), !BZ(de, ee))) {
                (i.status = "failed"), (i.validateMessage = uC(de, ee));
                return;
              }
              if (ee.validator)
                return EM(de) && ee.validateEmpty === !1
                  ? void 0
                  : kZ(de, ee).then((ge) => {
                      ge && typeof ge == "string"
                        ? ((i.status = "failed"), (i.validateMessage = ge))
                        : ge === !1 &&
                          ((i.status = "failed"),
                          (i.validateMessage = uC(de, ee)));
                    });
            }),
          Promise.resolve()
        ),
      g = () => {
        (i.status = "unvalidated"), (i.validateMessage = "");
      },
      m = () =>
        e("endValidate", { status: i.status, message: i.validateMessage }),
      v = (L = t.rules) =>
        new Promise((ne) => {
          g(),
            L
              ? (e("startValidate"),
                p(L).then(() => {
                  i.status === "failed"
                    ? (ne({ name: t.name, message: i.validateMessage }), m())
                    : ((i.status = "passed"), ne(), m());
                }))
              : ne();
        }),
      y = (L) => {
        if (l && t.rules) {
          const { validateTrigger: ne } = l.props,
            ee = _0(ne).includes(L),
            de = t.rules.filter((ge) =>
              ge.trigger ? _0(ge.trigger).includes(L) : ee
            );
          de.length && v(de);
        }
      },
      _ = (L) => {
        var ne;
        const { maxlength: ee } = t;
        if (Lt(ee) && Po(L) > +ee) {
          const de = c();
          if (de && Po(de) === +ee) return de;
          const ge = (ne = o.value) == null ? void 0 : ne.selectionEnd;
          if (i.focused && ge) {
            const xe = [...L],
              O = xe.length - +ee;
            return xe.splice(ge - O, O), xe.join("");
          }
          return o1(L, +ee);
        }
        return L;
      },
      x = (L, ne = "onChange") => {
        var ee, de;
        const ge = L;
        L = _(L);
        const xe = Po(ge) - Po(L);
        if (t.type === "number" || t.type === "digit") {
          const U = t.type === "number";
          if (
            ((L = r_(L, U, U)),
            ne === "onBlur" &&
              L !== "" &&
              (t.min !== void 0 || t.max !== void 0))
          ) {
            const W = Hn(
              +L,
              (ee = t.min) != null ? ee : -1 / 0,
              (de = t.max) != null ? de : 1 / 0
            );
            +L !== W && (L = W.toString());
          }
        }
        let O = 0;
        if (t.formatter && ne === t.formatTrigger) {
          const { formatter: U, maxlength: W } = t;
          if (
            ((L = U(L)),
            Lt(W) && Po(L) > +W && (L = o1(L, +W)),
            o.value && i.focused)
          ) {
            const { selectionEnd: ce } = o.value,
              ue = o1(ge, ce);
            O = Po(U(ue)) - Po(ue);
          }
        }
        if (o.value && o.value.value !== L)
          if (i.focused) {
            let { selectionStart: U, selectionEnd: W } = o.value;
            if (((o.value.value = L), Lt(U) && Lt(W))) {
              const ce = Po(L);
              xe ? ((U -= xe), (W -= xe)) : O && ((U += O), (W += O)),
                o.value.setSelectionRange(Math.min(U, ce), Math.min(W, ce));
            }
          } 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 && FZ(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") && (y("onBlur"), Xe(S), V8());
      },
      A = (L) => e("clickInput", L),
      T = (L) => e("clickLeftIcon", L),
      I = (L) => e("clickRightIcon", L),
      B = (L) => {
        Nn(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;
      }),
      D = re(() => {
        const L = u("labelWidth"),
          ne = u("labelAlign");
        if (L && ne !== "top") return { width: nt(L) };
      }),
      $ = (L) => {
        L.keyCode === 13 &&
          (!(l && l.props.submitOnEnter) && t.type !== "textarea" && Nn(L),
          t.type === "search" && w()),
          e("keypress", L);
      },
      z = () => 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 ne = {
          id: z(),
          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: fC,
          onKeypress: $,
          onCompositionend: fC,
          onCompositionstart: NZ,
        };
        return t.type === "textarea"
          ? R("textarea", st(ne, { inputmode: t.inputmode }), null)
          : R("input", st(LZ(t.type, t.inputmode), ne), null);
      },
      se = () => {
        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),
          ]);
      },
      Y = () => {
        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),
          ]);
      },
      te = () => {
        if (t.showWordLimit && t.maxlength) {
          const L = Po(c());
          return R("div", { class: ri("word-limit") }, [
            R("span", { class: ri("word-num") }, [L]),
            Ag("/"),
            t.maxlength,
          ]);
        }
      },
      pe = () => {
        if (l && l.props.showErrorMessage === !1) return;
        const L = t.errorMessage || i.validateMessage;
        if (L) {
          const ne = n["error-message"],
            ee = u("errorMessageAlign");
          return R("div", { class: ri("error-message", ee) }, [
            ne ? ne({ message: L }) : L,
          ]);
        }
      },
      F = () => {
        const L = u("labelWidth"),
          ne = u("labelAlign"),
          ee = u("colon") ? ":" : "";
        if (n.label) return [n.label(), ee];
        if (t.label)
          return R(
            "label",
            {
              id: `${r}-label`,
              for: n.input ? void 0 : z(),
              "data-allow-mismatch": "attribute",
              onClick: (de) => {
                Nn(de), E();
              },
              style: ne === "top" && L ? { width: nt(L) } : void 0,
            },
            [t.label + ee]
          );
      },
      J = () => [
        R("div", { class: ri("body") }, [
          fe(),
          f.value &&
            R(tn, { ref: s, name: t.clearIcon, class: ri("clear") }, null),
          Y(),
          n.button && R("div", { class: ri("button") }, [n.button()]),
        ]),
        te(),
        pe(),
      ];
    return (
      Kt({
        blur: w,
        focus: E,
        validate: v,
        formValue: d,
        resetValidation: g,
        getValidationStatus: K,
      }),
      hi(Lb, { customValue: a, resetValidation: g, validateWithTrigger: y }),
      ve(
        () => t.modelValue,
        () => {
          x(c()), g(), y("onChange"), Xe(S);
        }
      ),
      Ht(() => {
        x(c(), t.formatTrigger), Xe(S);
      }),
      vr("touchstart", B, {
        target: re(() => {
          var L;
          return (L = s.value) == null ? void 0 : L.$el;
        }),
      }),
      () => {
        const L = u("disabled"),
          ne = u("labelAlign"),
          ee = se(),
          de = () => {
            const ge = F();
            return ne === "top" ? [ee, ge].filter(Boolean) : ge || [];
          };
        return R(
          wM,
          {
            size: t.size,
            class: ri({ error: G.value, disabled: L, [`label-${ne}`]: ne }),
            center: t.center,
            border: t.border,
            isLink: t.isLink,
            clickable: t.clickable,
            titleStyle: D.value,
            valueClass: ri("value"),
            titleClass: [
              ri("label", [ne, { required: h.value }]),
              t.labelClass,
            ],
            arrowDirection: t.arrowDirection,
          },
          {
            icon: ee && ne !== "top" ? () => ee : null,
            title: de,
            value: J,
            extra: n.extra,
          }
        );
      }
    );
  },
});
const x3e = De(HZ);
let Lu = 0;
function VZ(t) {
  t
    ? (Lu || document.body.classList.add("van-toast--unclickable"), Lu++)
    : Lu &&
      (Lu--, Lu || document.body.classList.remove("van-toast--unclickable"));
}
const [zZ, Zl] = Te("toast"),
  jZ = [
    "show",
    "overlay",
    "teleport",
    "transition",
    "overlayClass",
    "overlayStyle",
    "closeOnClickOverlay",
    "zIndex",
  ],
  WZ = {
    icon: String,
    show: Boolean,
    type: Me("text"),
    overlay: Boolean,
    message: Se,
    iconSize: Se,
    duration: Hg(2e3),
    position: Me("middle"),
    teleport: [String, Object],
    wordBreak: String,
    className: pn,
    iconPrefix: String,
    transition: Me("van-fade"),
    loadingType: String,
    forbidClick: Boolean,
    overlayClass: pn,
    overlayStyle: Object,
    closeOnClick: Boolean,
    closeOnClickOverlay: Boolean,
    zIndex: Se,
  };
var SM = we({
  name: zZ,
  props: WZ,
  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), VZ(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: g,
        } = t;
        if (f || d === "success" || d === "fail")
          return R(
            tn,
            { name: f || d, size: h, class: Zl("icon"), classPrefix: p },
            null
          );
        if (d === "loading")
          return R(vs, { class: Zl("loading"), size: h, type: g }, null);
      },
      u = () => {
        const { type: f, message: d } = t;
        if (n.message) return R("div", { class: Zl("text") }, [n.message()]);
        if (Lt(d) && d !== "")
          return f === "html"
            ? R(
                "div",
                { key: 0, class: Zl("text"), innerHTML: String(d) },
                null
              )
            : R("div", { class: Zl("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),
      ms(o),
      () =>
        R(
          Ul,
          st(
            {
              class: [
                Zl([
                  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, jZ)
          ),
          { default: () => [c(), u()] }
        )
    );
  },
});
function Wg() {
  const t = At({ 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 Yg(t) {
  const e = LO(t),
    n = document.createElement("div");
  return (
    document.body.appendChild(n),
    {
      instance: e.mount(n),
      unmount() {
        e.unmount(), document.body.removeChild(n);
      },
    }
  );
}
const YZ = {
  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 $s = [],
  XZ = !1,
  a_ = We({}, YZ);
const CM = new Map();
function AM(t) {
  return yo(t) ? t : { message: t };
}
function KZ() {
  const { instance: t, unmount: e } = Yg({
    setup() {
      const n = Z(""),
        { open: r, state: i, close: o, toggle: s } = Wg(),
        a = () => {},
        l = () => R(SM, 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 qZ() {
  if (!$s.length || XZ) {
    const t = KZ();
    $s.push(t);
  }
  return $s[$s.length - 1];
}
function l_(t = {}) {
  if (!vo) return {};
  const e = qZ(),
    n = AM(t);
  return e.open(We({}, a_, CM.get(n.type || a_.type), n)), e;
}
const ww = (t) => (e) => l_(We({ type: t }, AM(e))),
  b3e = ww("loading"),
  w3e = ww("success"),
  E3e = ww("fail"),
  S3e = (t) => {
    $s.length &&
      (t
        ? ($s.forEach((e) => {
            e.close();
          }),
          ($s = []))
        : $s[0].close());
  };
function C3e(t, e) {
  typeof t == "string" ? CM.set(t, e) : We(a_, t);
}
const A3e = De(SM),
  [ZZ, s1] = Te("switch"),
  JZ = {
    size: Se,
    loading: Boolean,
    disabled: Boolean,
    modelValue: pn,
    activeColor: String,
    inactiveColor: String,
    activeValue: { type: pn, default: !0 },
    inactiveValue: { type: pn, default: !1 },
  };
var QZ = we({
  name: ZZ,
  props: JZ,
  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(vs, { class: s1("loading"), color: s }, null);
        }
        if (n.node) return n.node();
      };
    return (
      Fl(() => t.modelValue),
      () => {
        var s;
        const {
            size: a,
            loading: l,
            disabled: c,
            activeColor: u,
            inactiveColor: f,
          } = t,
          d = r(),
          h = { fontSize: nt(a), backgroundColor: d ? u : f };
        return R(
          "div",
          {
            role: "switch",
            class: s1({ on: d, loading: l, disabled: c }),
            style: h,
            tabindex: c ? void 0 : 0,
            "aria-checked": d,
            onClick: i,
          },
          [
            R("div", { class: s1("node") }, [o()]),
            (s = n.background) == null ? void 0 : s.call(n),
          ]
        );
      }
    );
  },
});
const T3e = De(QZ),
  [TM, eJ] = Te("radio-group"),
  tJ = {
    shape: String,
    disabled: Boolean,
    iconSize: Se,
    direction: String,
    modelValue: pn,
    checkedColor: String,
  },
  PM = Symbol(TM);
var nJ = we({
  name: TM,
  props: tJ,
  emits: ["change", "update:modelValue"],
  setup(t, { emit: e, slots: n }) {
    const { linkChildren: r } = Hi(PM),
      i = (o) => e("update:modelValue", o);
    return (
      ve(
        () => t.modelValue,
        (o) => e("change", o)
      ),
      r({ props: t, updateValue: i }),
      Fl(() => t.modelValue),
      () => {
        var o;
        return R("div", { class: eJ([t.direction]), role: "radiogroup" }, [
          (o = n.default) == null ? void 0 : o.call(n),
        ]);
      }
    );
  },
});
const P3e = De(nJ),
  [rJ, I3e] = Te("checkbox-group"),
  iJ = Symbol(rJ),
  Ew = {
    name: pn,
    disabled: Boolean,
    iconSize: Se,
    modelValue: pn,
    checkedColor: String,
    labelPosition: String,
    labelDisabled: Boolean,
  };
var IM = we({
  props: We({}, Ew, {
    bem: fr(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"),
              g = p && h >= +p;
            return d || (g && !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,
          g = p === h || (p == null ? void 0 : p.contains(h));
        !o.value && (g || !t.labelDisabled) && e("toggle"), e("click", d);
      },
      u = () => {
        var d, h;
        const { bem: p, checked: g, indeterminate: m } = t,
          v = t.iconSize || i("iconSize");
        return R(
          "div",
          {
            ref: r,
            class: p("icon", [
              l.value,
              { disabled: o.value, checked: g, indeterminate: m },
            ]),
            style:
              l.value !== "dot"
                ? { fontSize: nt(v) }
                : {
                    width: nt(v),
                    height: nt(v),
                    borderColor: (d = a.value) == null ? void 0 : d.borderColor,
                  },
          },
          [
            n.icon
              ? n.icon({ checked: g, disabled: o.value })
              : l.value !== "dot"
              ? R(tn, { name: m ? "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 oJ = We({}, Ew, { shape: String }),
  [sJ, aJ] = Te("radio");
var lJ = we({
  name: sJ,
  props: oJ,
  emits: ["update:modelValue"],
  setup(t, { emit: e, slots: n }) {
    const { parent: r } = Zr(PM),
      i = () => (r ? r.props.modelValue : t.modelValue) === t.name,
      o = () => {
        r ? r.updateValue(t.name) : e("update:modelValue", t.name);
      };
    return () =>
      R(
        IM,
        st({ bem: aJ, role: "radio", parent: r, checked: i(), onToggle: o }, t),
        $t(n, ["default", "icon"])
      );
  },
});
const O3e = De(lJ),
  [cJ, uJ] = Te("checkbox"),
  fJ = We({}, Ew, {
    shape: String,
    bindGroup: _e,
    indeterminate: { type: Boolean, default: null },
  });
var dJ = we({
  name: cJ,
  props: fJ,
  emits: ["change", "update:modelValue"],
  setup(t, { emit: e, slots: n }) {
    const { parent: r } = Zr(iJ),
      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 }),
      Fl(() => t.modelValue),
      () =>
        R(
          IM,
          st(
            {
              bem: uJ,
              role: "checkbox",
              parent: r,
              checked: o.value,
              onToggle: s,
            },
            t
          ),
          $t(n, ["default", "icon"])
        )
    );
  },
});
const R3e = De(dJ),
  [hJ, Qt, Ko] = Te("calendar"),
  pJ = (t) => Ko("monthTitle", t.getFullYear(), t.getMonth() + 1);
function ja(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 br(t, e) {
  const n = ja(t, e);
  if (n === 0) {
    const r = t.getDate(),
      i = e.getDate();
    return r === i ? 0 : r > i ? 1 : -1;
  }
  return n;
}
const Wc = (t) => new Date(t),
  dC = (t) => (Array.isArray(t) ? t.map(Wc) : Wc(t));
function Sw(t, e) {
  const n = Wc(t);
  return n.setDate(n.getDate() + e), n;
}
function Cw(t, e) {
  const n = Wc(t);
  return (
    n.setMonth(n.getMonth() + e), n.getDate() !== t.getDate() && n.setDate(0), n
  );
}
function OM(t, e) {
  const n = Wc(t);
  return (
    n.setFullYear(n.getFullYear() + e),
    n.getDate() !== t.getDate() && n.setDate(0),
    n
  );
}
const c_ = (t) => Sw(t, -1),
  u_ = (t) => Sw(t, 1),
  hC = (t) => Cw(t, -1),
  pC = (t) => Cw(t, 1),
  gC = (t) => OM(t, -1),
  mC = (t) => OM(t, 1),
  $h = () => {
    const t = new Date();
    return t.setHours(0, 0, 0, 0), t;
  };
function gJ(t) {
  const e = t[0].getTime();
  return (t[1].getTime() - e) / (1e3 * 60 * 60 * 24) + 1;
}
function mJ(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 vJ = We({}, bw, {
    modelValue: ss(),
    filter: Function,
    formatter: { type: Function, default: (t, e) => e },
  }),
  yJ = Object.keys(bw);
function _J(t, e) {
  if (t < 0) return [];
  const n = Array(t);
  let r = -1;
  for (; ++r < t; ) n[r] = e(r);
  return n;
}
const RM = (t, e) => 32 - new Date(t, e - 1, 32).getDate(),
  a1 = (t, e, n, r, i, o) => {
    const s = _J(e - t + 1, (a) => {
      const l = Ga(t + a);
      return r(n, { text: l, value: l });
    });
    return i ? i(n, s, o) : s;
  },
  xJ = (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 Ga(Hn(+n, o, s));
      }
      return n;
    }),
  [bJ] = Te("calendar-day");
var wJ = we({
  name: bJ,
  props: {
    item: fr(Object),
    color: String,
    index: Number,
    offset: Hg(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 && mJ(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 [EJ] = Te("calendar-month"),
  SJ = {
    date: fr(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 CJ = we({
  name: EJ,
  props: SJ,
  emits: ["click", "clickDisabledDate"],
  setup(t, { emit: e, slots: n }) {
    const [r, i] = iR(),
      o = Z(),
      s = Z(),
      a = eM(s),
      l = re(() => pJ(t.date)),
      c = re(() => nt(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(() => RM(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) => br(I, T) === 0);
        if (A(C)) {
          const T = c_(C),
            I = u_(C),
            B = A(T),
            G = A(I);
          return B && G
            ? "multiple-middle"
            : B
            ? "end"
            : G
            ? "start"
            : "multiple-selected";
        }
        return "";
      },
      g = (C) => {
        const [A, T] = t.currentDate;
        if (!A) return "";
        const I = br(C, A);
        if (!T) return I === 0 ? "start" : "";
        const B = br(C, T);
        return t.allowSameDay && I === 0 && B === 0
          ? "start-end"
          : I === 0
          ? "start"
          : B === 0
          ? "end"
          : I > 0 && B < 0
          ? "middle"
          : "";
      },
      m = (C) => {
        const { type: A, minDate: T, maxDate: I, currentDate: B } = t;
        if ((T && br(C, T) < 0) || (I && br(C, I) > 0)) return "disabled";
        if (B === null) return "";
        if (Array.isArray(B)) {
          if (A === "multiple") return p(C);
          if (A === "range") return g(C);
        } else if (A === "single") return br(C, B) === 0 ? "selected" : "";
        return "";
      },
      v = (C) => {
        if (t.type === "range") {
          if (C === "start" || C === "end") return Ko(C);
          if (C === "start-end") return `${Ko("start")}/${Ko("end")}`;
        }
      },
      y = () => {
        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 = m(B);
          let D = { date: B, type: G, text: I, bottomInfo: v(G) };
          t.formatter && (D = t.formatter(D)), C.push(D);
        }
        return C;
      }),
      w = re(() => b.value.filter((C) => C.type === "disabled")),
      E = (C, A) => {
        if (o.value) {
          const T = Sn(o.value),
            I = x.value.length,
            G = ((Math.ceil((A.getDate() + u.value) / 7) - 1) * T.height) / I;
          x0(C, T.top + G + C.scrollTop - Sn(C).top);
        }
      },
      S = (C, A) =>
        R(
          wJ,
          {
            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 }, [y(), P()])
    );
  },
});
const [AJ] = Te("calendar-header");
var TJ = we({
  name: AJ,
  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 && ja(hC(t.date), t.minDate) < 0),
      i = re(() => t.date && t.minDate && ja(gC(t.date), t.minDate) < 0),
      o = re(() => t.date && t.maxDate && ja(pC(t.date), t.maxDate) > 0),
      s = re(() => t.date && t.maxDate && ja(mC(t.date), t.maxDate) > 0),
      a = () => {
        if (t.showTitle) {
          const h = t.title || Ko("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",
          g = e[h ? "next-month" : "prev-month"],
          m = e[h ? "next-year" : "prev-year"],
          v = h ? o.value : r.value,
          y = h ? s.value : i.value,
          _ = h ? "arrow" : "arrow-left",
          x = h ? "arrow-double-right" : "arrow-double-left",
          b = () => c((h ? pC : hC)(t.date)),
          w = () => c((h ? mC : gC)(t.date)),
          E = R(
            "view",
            {
              class: Qt("header-action", { disabled: v }),
              onClick: v ? void 0 : b,
            },
            [
              g
                ? g({ disabled: v })
                : R(tn, { class: { [as]: !v }, name: _ }, null),
            ]
          ),
          S =
            p &&
            R(
              "view",
              {
                class: Qt("header-action", { disabled: y }),
                onClick: y ? void 0 : w,
              },
              [
                m
                  ? m({ disabled: y })
                  : R(tn, { class: { [as]: !y }, 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 = Ko("weekdays"),
          g = [...p.slice(h, 7), ...p.slice(0, h)];
        return R("div", { class: Qt("weekdays") }, [
          g.map((m) => R("span", { class: Qt("weekday") }, [m])),
        ]);
      };
    return () => R("div", { class: Qt("header") }, [a(), f(), d()]);
  },
});
const PJ = {
  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: od },
  maxDate: { type: Date, validator: od },
  firstDayOfWeek: { type: Se, default: 0, validator: (t) => t >= 0 && t <= 6 },
};
var IJ = we({
  name: hJ,
  props: PJ,
  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 ? $h() : t.minDate)),
      o = re(() => (!t.maxDate && !r.value ? Cw($h(), 6) : t.maxDate)),
      s = (Y, te = i.value, pe = o.value) =>
        te && br(Y, te) === -1 ? te : pe && br(Y, pe) === 1 ? pe : Y,
      a = (Y = t.defaultDate) => {
        const { type: te, allowSameDay: pe } = t;
        if (Y === null) return Y;
        const F = $h();
        if (te === "range") {
          Array.isArray(Y) || (Y = []),
            Y.length === 1 && br(Y[0], F) === 1 && (Y = []);
          const J = i.value,
            L = o.value,
            ne = s(Y[0] || F, J, L ? (pe ? L : c_(L)) : void 0),
            ee = s(Y[1] || (pe ? F : u_(F)), J ? (pe ? J : u_(J)) : void 0);
          return [ne, ee];
        }
        return te === "multiple"
          ? Array.isArray(Y)
            ? Y.map((J) => s(J))
            : [s(F)]
          : ((!Y || Array.isArray(Y)) && (Y = F), s(Y));
      },
      l = () => {
        const Y = Array.isArray(f.value) ? f.value[0] : f.value;
        return Y || s($h());
      };
    let c;
    const u = Z(),
      f = Z(a()),
      d = Z(l()),
      h = Z(),
      [p, g] = dM(),
      m = re(() => (t.firstDayOfWeek ? +t.firstDayOfWeek % 7 : 0)),
      v = re(() => {
        const Y = [];
        if (!i.value || !o.value) return Y;
        const te = new Date(i.value);
        te.setDate(1);
        do Y.push(new Date(te)), te.setMonth(te.getMonth() + 1);
        while (ja(te, o.value) !== 1);
        return Y;
      }),
      y = 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 Y = Kd(u.value),
          te = Y + c,
          pe = v.value.map((ee, de) => p.value[de].getHeight()),
          F = pe.reduce((ee, de) => ee + de, 0);
        if (te > F && Y > 0) return;
        let J = 0,
          L;
        const ne = [-1, -1];
        for (let ee = 0; ee < v.value.length; ee++) {
          const de = p.value[ee];
          J <= te &&
            J + pe[ee] >= Y &&
            ((ne[1] = ee),
            L || ((L = de), (ne[0] = ee)),
            p.value[ee].showed ||
              ((p.value[ee].showed = !0),
              e("monthShow", { date: de.date, title: de.getTitle() }))),
            (J += pe[ee]);
        }
        v.value.forEach((ee, de) => {
          const ge = de >= ne[0] - 1 && de <= ne[1] + 1;
          p.value[de].setVisible(ge);
        }),
          L && (h.value = L);
      },
      b = (Y) => {
        r.value
          ? (d.value = Y)
          : pr(() => {
              v.value.some((te, pe) =>
                ja(te, Y) === 0
                  ? (u.value && p.value[pe].scrollToDate(u.value, Y), !0)
                  : !1
              ),
                x();
            });
      },
      w = () => {
        if (!(t.poppable && !t.show))
          if (f.value) {
            const Y = t.type === "single" ? f.value : f.value[0];
            od(Y) && b(Y);
          } else r.value || pr(x);
      },
      E = () => {
        (t.poppable && !t.show) ||
          (r.value ||
            pr(() => {
              c = Math.floor(Sn(u).height);
            }),
          w());
      },
      S = (Y = a()) => {
        (f.value = Y), w();
      },
      P = (Y) => {
        const { maxRange: te, rangePrompt: pe, showRangePrompt: F } = t;
        return te && gJ(Y) > +te
          ? (F && l_(pe || Ko("rangePrompt", te)), e("overRange"), !1)
          : !0;
      },
      C = (Y) => {
        (d.value = Y), e("panelChange", { date: Y });
      },
      A = () => {
        var Y;
        return e("confirm", (Y = f.value) != null ? Y : dC(f.value));
      },
      T = (Y, te) => {
        const pe = (F) => {
          (f.value = F), e("select", dC(F));
        };
        if (te && t.type === "range" && !P(Y)) {
          pe([Y[0], Sw(Y[0], +t.maxRange - 1)]);
          return;
        }
        pe(Y), te && !t.showConfirm && A();
      },
      I = (Y, te, pe) => {
        var F;
        return (F = Y.find(
          (J) => br(te, J.date) === -1 && br(J.date, pe) === -1
        )) == null
          ? void 0
          : F.date;
      },
      B = re(() =>
        p.value.reduce((Y, te) => {
          var pe, F;
          return (
            Y.push(
              ...((F = (pe = te.disabledDays) == null ? void 0 : pe.value) !=
              null
                ? F
                : [])
            ),
            Y
          );
        }, [])
      ),
      G = (Y) => {
        if (t.readonly || !Y.date) return;
        const { date: te } = Y,
          { type: pe } = t;
        if (pe === "range") {
          if (!f.value) {
            T([te]);
            return;
          }
          const [F, J] = f.value;
          if (F && !J) {
            const L = br(te, F);
            if (L === 1) {
              const ne = I(B.value, F, te);
              if (ne) {
                const ee = c_(ne);
                br(F, ee) === -1 ? T([F, ee]) : T([te]);
              } else T([F, te], !0);
            } else L === -1 ? T([te]) : t.allowSameDay && T([te, te], !0);
          } else T([te]);
        } else if (pe === "multiple") {
          if (!f.value) {
            T([te]);
            return;
          }
          const F = f.value,
            J = F.findIndex((L) => br(L, te) === 0);
          if (J !== -1) {
            const [L] = F.splice(J, 1);
            e("unselect", Wc(L));
          } else
            t.maxRange && F.length >= +t.maxRange
              ? l_(t.rangePrompt || Ko("rangePrompt", t.maxRange))
              : T([...F, te]);
        } else T(te, !0);
      },
      D = (Y) => e("clickOverlay", Y),
      $ = (Y) => e("update:show", Y),
      z = (Y, te) => {
        const pe = te !== 0 || !t.showSubtitle;
        return R(
          CJ,
          st(
            {
              ref: r.value ? h : g(te),
              date: Y,
              currentDate: f.value,
              showMonthTitle: pe,
              firstDayOfWeek: m.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 Y = n["confirm-text"],
            te = y.value,
            pe = te ? t.confirmDisabledText : t.confirmText;
          return R(
            b0,
            {
              round: !0,
              block: !0,
              type: "primary",
              color: t.color,
              class: Qt("confirm"),
              disabled: te,
              nativeType: "button",
              onClick: A,
            },
            { default: () => [Y ? Y({ disabled: te }) : pe || Ko("confirm")] }
          );
        }
      },
      fe = () =>
        R(
          "div",
          {
            class: [
              Qt("footer"),
              { "van-safe-area-bottom": t.safeAreaInsetBottom },
            ],
          },
          [K()]
        ),
      se = () => {
        var Y, te;
        return R("div", { class: Qt() }, [
          R(
            TJ,
            {
              date: (Y = h.value) == null ? void 0 : Y.date,
              maxDate: o.value,
              minDate: i.value,
              title: t.title,
              subtitle: (te = h.value) == null ? void 0 : te.getTitle(),
              showTitle: t.showTitle,
              showSubtitle: t.showSubtitle,
              switchMode: t.switchMode,
              firstDayOfWeek: m.value,
              onClickSubtitle: (pe) => e("clickSubtitle", pe),
              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 ? z(d.value, 0) : v.value.map(z)]
          ),
          fe(),
        ]);
      };
    return (
      ve(() => t.show, E),
      ve(
        () => [t.type, t.minDate, t.maxDate, t.switchMode],
        () => S(a(f.value))
      ),
      ve(
        () => t.defaultDate,
        (Y) => {
          S(Y);
        }
      ),
      Kt({ reset: S, scrollToDate: b, getSelectedDate: _ }),
      vu(E),
      () =>
        t.poppable
          ? R(
              Ul,
              {
                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: D,
                "onUpdate:show": $,
              },
              { default: se }
            )
          : se()
    );
  },
});
const M3e = De(IJ),
  [OJ, Jl] = Te("image"),
  RJ = {
    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 MJ = we({
  name: OJ,
  props: RJ,
  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 m = { width: nt(t.width), height: nt(t.height) };
        return (
          Lt(t.radius) &&
            ((m.overflow = "hidden"), (m.borderRadius = nt(t.radius))),
          m
        );
      });
    ve(
      () => t.src,
      () => {
        (r.value = !1), (i.value = !0);
      }
    );
    const l = (m) => {
        i.value && ((i.value = !1), e("load", m));
      },
      c = () => {
        const m = new Event("load");
        Object.defineProperty(m, "target", { value: o.value, enumerable: !0 }),
          l(m);
      },
      u = (m) => {
        (r.value = !0), (i.value = !1), e("error", m);
      },
      f = (m, v, y) =>
        y
          ? y()
          : R(
              tn,
              {
                name: m,
                size: t.iconSize,
                class: v,
                classPrefix: t.iconPrefix,
              },
              null
            ),
      d = () => {
        if (i.value && t.showLoading)
          return R("div", { class: Jl("loading") }, [
            f(t.loadingIcon, Jl("loading-icon"), n.loading),
          ]);
        if (r.value && t.showError)
          return R("div", { class: Jl("error") }, [
            f(t.errorIcon, Jl("error-icon"), n.error),
          ]);
      },
      h = () => {
        if (r.value || !t.src) return;
        const m = {
          alt: t.alt,
          class: Jl("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 }, m), null), [[G4("lazy"), t.src]])
          : R(
              "img",
              st({ ref: o, src: t.src, onLoad: l, onError: u }, m),
              null
            );
      },
      p = ({ el: m }) => {
        const v = () => {
          m === o.value && i.value && c();
        };
        o.value ? v() : Xe(v);
      },
      g = ({ el: m }) => {
        m === o.value && !r.value && u();
      };
    return (
      s &&
        vo &&
        (s.$on("loaded", p),
        s.$on("error", g),
        qr(() => {
          s.$off("loaded", p), s.$off("error", g);
        })),
      Ht(() => {
        Xe(() => {
          var m;
          (m = o.value) != null && m.complete && !t.lazyLoad && c();
        });
      }),
      () => {
        var m;
        return R(
          "div",
          { class: Jl({ round: t.round, block: t.block }), style: a.value },
          [h(), d(), (m = n.default) == null ? void 0 : m.call(n)]
        );
      }
    );
  },
});
const MM = De(MJ),
  [DJ, Uh] = Te("circle");
let BJ = 0;
const vC = (t) => Math.min(Math.max(+t, 0), 100);
function kJ(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 NJ = {
  text: String,
  size: Se,
  fill: Me("none"),
  rate: ze(100),
  speed: ze(0),
  color: [String, Object],
  clockwise: _e,
  layerColor: String,
  currentRate: Hg(0),
  strokeWidth: ze(40),
  strokeLinecap: String,
  startPosition: Me("top"),
};
var FJ = we({
  name: DJ,
  props: NJ,
  emits: ["update:currentRate"],
  setup(t, { emit: e, slots: n }) {
    const r = `van-circle-${BJ++}`,
      i = re(() => +t.strokeWidth + 1e3),
      o = re(() => kJ(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,
          g = vC(f),
          m = Math.abs(((p - g) * 1e3) / +t.speed),
          v = () => {
            const y = Date.now(),
              x = Math.min((y - h) / m, 1) * (g - p) + p;
            e("update:currentRate", vC(parseFloat(x.toFixed(1)))),
              (g > p ? x < g : x > g) && (d = pr(v));
          };
        t.speed ? (d && Yd(d), (d = pr(v))) : e("update:currentRate", g);
      },
      { immediate: !0 }
    );
    const a = () => {
        const { strokeWidth: d, currentRate: h, strokeLinecap: p } = t,
          g = (3140 * h) / 100,
          m = yo(t.color) ? `url(#${r})` : t.color,
          v = {
            stroke: m,
            strokeWidth: `${+d + 1}px`,
            strokeLinecap: p,
            strokeDasharray: `${g}px 3140px`,
          };
        return R(
          "path",
          { d: o.value, style: v, class: Uh("hover"), stroke: m },
          null
        );
      },
      l = () => {
        const f = {
          fill: t.fill,
          stroke: t.layerColor,
          strokeWidth: `${t.strokeWidth}px`,
        };
        return R("path", { class: Uh("layer"), style: f, d: o.value }, null);
      },
      c = () => {
        const { color: f } = t;
        if (!yo(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: Uh("text") }, [t.text]);
      };
    return () =>
      R("div", { class: Uh(), style: Ll(t.size) }, [
        R("svg", { viewBox: `0 0 ${i.value} ${i.value}`, style: s.value }, [
          c(),
          l(),
          a(),
        ]),
        u(),
      ]);
  },
});
const D3e = De(FJ),
  [DM, LJ] = Te("row"),
  BM = Symbol(DM),
  $J = {
    tag: Me("div"),
    wrap: _e,
    align: String,
    gutter: { type: [String, Number, Array], default: 0 },
    justify: String,
  };
var UJ = we({
  name: DM,
  props: $J,
  setup(t, { slots: e }) {
    const { children: n, linkChildren: r } = Hi(BM),
      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: LJ({ [`align-${c}`]: c, [`justify-${u}`]: u, nowrap: !l }) },
          {
            default: () => {
              var f;
              return [(f = e.default) == null ? void 0 : f.call(e)];
            },
          }
        );
      }
    );
  },
});
const [GJ, HJ] = Te("col"),
  VJ = { tag: Me("div"), span: ze(0), offset: Se };
var zJ = we({
  name: GJ,
  props: VJ,
  setup(t, { slots: e }) {
    const { parent: n, index: r } = Zr(BM),
      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: HJ({ [s]: s, [`offset-${a}`]: a }) },
        {
          default: () => {
            var l;
            return [(l = e.default) == null ? void 0 : l.call(e)];
          },
        }
      );
    };
  },
});
const B3e = De(zJ),
  [kM, jJ] = Te("collapse"),
  NM = Symbol(kM),
  WJ = {
    border: _e,
    accordion: Boolean,
    modelValue: { type: [String, Number, Array], default: "" },
  };
function YJ(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 XJ = we({
  name: kM,
  props: WJ,
  emits: ["change", "update:modelValue"],
  setup(t, { emit: e, slots: n }) {
    const { linkChildren: r, children: i } = Hi(NM),
      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 YJ(f, u) ? (u ? f === c : f.includes(c)) : !1;
      };
    return (
      Kt({ toggleAll: a }),
      r({ toggle: s, isExpanded: l }),
      () => {
        var c;
        return R("div", { class: [jJ(), { [q8]: t.border }] }, [
          (c = n.default) == null ? void 0 : c.call(n),
        ]);
      }
    );
  },
});
const k3e = De(XJ),
  [KJ, Gh] = Te("collapse-item"),
  qJ = ["icon", "title", "value", "label", "right-icon"],
  ZJ = We({}, jg, {
    name: Se,
    isLink: _e,
    disabled: Boolean,
    readonly: Boolean,
    lazyRender: _e,
  });
var JJ = we({
  name: KJ,
  props: ZJ,
  setup(t, { slots: e }) {
    const n = Z(),
      r = Z(),
      { parent: i, index: o } = Zr(NM);
    if (!i) {
      console.error(
        "[Vant] <CollapseItem> must be a child component of <Collapse>."
      );
      return;
    }
    const s = re(() => {
        var g;
        return (g = t.name) != null ? g : o.value;
      }),
      a = re(() => i.isExpanded(s.value)),
      l = Z(a.value),
      c = _w(() => l.value || !t.lazyRender),
      u = () => {
        a.value ? n.value && (n.value.style.height = "") : (l.value = !1);
      };
    ve(a, (g, m) => {
      if (m === null) return;
      g && (l.value = !0),
        (g ? Xe : pr)(() => {
          if (!r.value || !n.value) return;
          const { offsetHeight: y } = r.value;
          if (y) {
            const _ = `${y}px`;
            (n.value.style.height = g ? "0" : _),
              za(() => {
                n.value && (n.value.style.height = g ? _ : "0");
              });
          } else u();
        });
    });
    const f = (g = !a.value) => {
        i.toggle(s.value, g);
      },
      d = () => {
        !t.disabled && !t.readonly && f();
      },
      h = () => {
        const { border: g, disabled: m, readonly: v } = t,
          y = $t(t, Object.keys(jg));
        return (
          v && (y.isLink = !1),
          (m || v) && (y.clickable = !1),
          R(
            wM,
            st(
              {
                role: "button",
                class: Gh("title", {
                  disabled: m,
                  expanded: a.value,
                  borderless: !g,
                }),
                "aria-expanded": String(a.value),
                onClick: d,
              },
              y
            ),
            $t(e, qJ)
          )
        );
      },
      p = c(() => {
        var g;
        return di(
          R("div", { ref: n, class: Gh("wrapper"), onTransitionend: u }, [
            R("div", { ref: r, class: Gh("content") }, [
              (g = e.default) == null ? void 0 : g.call(e),
            ]),
          ]),
          [[pi, l.value]]
        );
      });
    return (
      Kt({ toggle: f, expanded: a, itemName: s }),
      () =>
        R("div", { class: [Gh({ border: o.value && t.border })] }, [h(), p()])
    );
  },
});
const N3e = De(JJ);
function QJ(t, e) {
  const { days: n } = e;
  let { hours: r, minutes: i, seconds: o, milliseconds: s } = e;
  if (
    (t.includes("DD") ? (t = t.replace("DD", Ga(n))) : (r += n * 24),
    t.includes("HH") ? (t = t.replace("HH", Ga(r))) : (i += r * 60),
    t.includes("mm") ? (t = t.replace("mm", Ga(i))) : (o += i * 60),
    t.includes("ss") ? (t = t.replace("ss", Ga(o))) : (s += o * 1e3),
    t.includes("S"))
  ) {
    const a = Ga(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 [eQ, tQ] = Te("count-down"),
  nQ = {
    time: ze(0),
    format: Me("HH:mm:ss"),
    autoStart: _e,
    millisecond: Boolean,
  };
var rQ = we({
  name: eQ,
  props: nQ,
  emits: ["change", "finish"],
  setup(t, { emit: e, slots: n }) {
    const {
        start: r,
        pause: i,
        reset: o,
        current: s,
      } = aR({
        time: +t.time,
        millisecond: t.millisecond,
        onChange: (c) => e("change", c),
        onFinish: () => e("finish"),
      }),
      a = re(() => QJ(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: tQ() }, [
          n.default ? n.default(s.value) : a.value,
        ])
    );
  },
});
const F3e = De(rQ),
  yC = new Date().getFullYear(),
  [iQ] = Te("date-picker"),
  oQ = We({}, vJ, {
    columnsType: { type: Array, default: () => ["year", "month", "day"] },
    minDate: {
      type: Date,
      default: () => new Date(yC - 10, 0, 1),
      validator: od,
    },
    maxDate: {
      type: Date,
      default: () => new Date(yC + 10, 11, 31),
      validator: od,
    },
  });
var sQ = we({
  name: iQ,
  props: oQ,
  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 a1(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 a1(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() : RM(b, w);
        return a1(E, S, "day", t.formatter, t.filter, s.value);
      },
      g = () => {
        var b;
        return (b = o.value) == null ? void 0 : b.confirm();
      },
      m = () => r.value,
      v = 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) => {
      qs(b, t.modelValue) || e("update:modelValue", b);
    }),
      ve(
        () => t.modelValue,
        (b, w) => {
          (i.value = qs(w, r.value)),
            (b = xJ(b, v.value)),
            qs(b, r.value) || (r.value = b),
            (i.value = !1);
        },
        { immediate: !0 }
      );
    const y = (...b) => e("change", ...b),
      _ = (...b) => e("cancel", ...b),
      x = (...b) => e("confirm", ...b);
    return (
      Kt({ confirm: g, getSelectedDate: m }),
      () =>
        R(
          AZ,
          st(
            {
              ref: o,
              modelValue: r.value,
              "onUpdate:modelValue": (b) => (r.value = b),
              columns: v.value,
              onChange: y,
              onCancel: _,
              onConfirm: x,
            },
            $t(t, yJ)
          ),
          n
        )
    );
  },
});
const L3e = De(sQ),
  [aQ, xi, Hh] = Te("dialog"),
  lQ = We({}, Zd, {
    title: String,
    theme: String,
    width: Se,
    message: [String, Function],
    callback: Function,
    allowHtml: Boolean,
    className: pn,
    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,
  }),
  cQ = [...iM, "transition", "closeOnPopstate", "destroyOnClose"];
var FM = we({
  name: aQ,
  props: lQ,
  emits: ["confirm", "cancel", "keydown", "update:show"],
  setup(t, { emit: e, slots: n }) {
    const r = Z(),
      i = At({ confirm: !1, cancel: !1 }),
      o = (v) => e("update:show", v),
      s = (v) => {
        var y;
        o(!1), (y = t.callback) == null || y.call(t, v);
      },
      a = (v) => () => {
        t.show &&
          (e(v),
          t.beforeClose
            ? ((i[v] = !0),
              yu(t.beforeClose, {
                args: [v],
                done() {
                  s(v), (i[v] = !1);
                },
                canceled() {
                  i[v] = !1;
                },
              }))
            : s(v));
      },
      l = a("cancel"),
      c = a("confirm"),
      u = DO(
        (v) => {
          var y, _;
          if (
            !t.keyboardEnabled ||
            v.target !==
              ((_ = (y = r.value) == null ? void 0 : y.popupRef) == null
                ? void 0
                : _.value)
          )
            return;
          ({
            Enter: t.showConfirmButton ? c : n_,
            Escape: t.showCancelButton ? l : n_,
          }[v.key](),
            e("keydown", v));
        },
        ["enter", "esc"]
      ),
      f = () => {
        const v = n.title ? n.title() : t.title;
        if (v)
          return R(
            "div",
            { class: xi("header", { isolated: !t.message && !n.default }) },
            [v]
          );
      },
      d = (v) => {
        const { message: y, allowHtml: _, messageAlign: x } = t,
          b = xi("message", { "has-title": v, [x]: x }),
          w = zc(y) ? y() : y;
        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: v, message: y, allowHtml: _ } = t;
        if (y) {
          const x = !!(v || n.title);
          return R(
            "div",
            { key: _ ? 1 : 0, class: xi("content", { isolated: !x }) },
            [d(x)]
          );
        }
      },
      p = () =>
        R("div", { class: [K8, xi("footer")] }, [
          t.showCancelButton &&
            R(
              b0,
              {
                size: "large",
                text: t.cancelButtonText || Hh("cancel"),
                class: xi("cancel"),
                style: { color: t.cancelButtonColor },
                loading: i.cancel,
                disabled: t.cancelButtonDisabled,
                onClick: l,
              },
              null
            ),
          t.showConfirmButton &&
            R(
              b0,
              {
                size: "large",
                text: t.confirmButtonText || Hh("confirm"),
                class: [xi("confirm"), { [UK]: t.showCancelButton }],
                style: { color: t.confirmButtonColor },
                loading: i.confirm,
                disabled: t.confirmButtonDisabled,
                onClick: c,
              },
              null
            ),
        ]),
      g = () =>
        R(
          YK,
          { class: xi("footer") },
          {
            default: () => [
              t.showCancelButton &&
                R(
                  tC,
                  {
                    type: "warning",
                    text: t.cancelButtonText || Hh("cancel"),
                    class: xi("cancel"),
                    color: t.cancelButtonColor,
                    loading: i.cancel,
                    disabled: t.cancelButtonDisabled,
                    onClick: l,
                  },
                  null
                ),
              t.showConfirmButton &&
                R(
                  tC,
                  {
                    type: "danger",
                    text: t.confirmButtonText || Hh("confirm"),
                    class: xi("confirm"),
                    color: t.confirmButtonColor,
                    loading: i.confirm,
                    disabled: t.confirmButtonDisabled,
                    onClick: c,
                  },
                  null
                ),
            ],
          }
        ),
      m = () =>
        n.footer ? n.footer() : t.theme === "round-button" ? g() : p();
    return () => {
      const { width: v, title: y, theme: _, message: x, className: b } = t;
      return R(
        Ul,
        st(
          {
            ref: r,
            role: "dialog",
            class: [xi([_]), b],
            style: { width: nt(v) },
            tabindex: 0,
            "aria-labelledby": y || x,
            onKeydown: u,
            "onUpdate:show": o,
          },
          $t(t, cQ)
        ),
        { default: () => [f(), h(), m()] }
      );
    };
  },
});
let f_;
const uQ = {
  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 fQ = We({}, uQ);
function dQ() {
  ({ instance: f_ } = Yg({
    setup() {
      const { state: e, toggle: n } = Wg();
      return () => R(FM, st(e, { "onUpdate:show": n }), null);
    },
  }));
}
function hQ(t) {
  return vo
    ? new Promise((e, n) => {
        f_ || dQ(),
          f_.open(
            We({}, fQ, t, {
              callback: (r) => {
                (r === "confirm" ? e : n)(r);
              },
            })
          );
      })
    : Promise.resolve(void 0);
}
const $3e = (t) => hQ(We({ showCancelButton: !0 }, t)),
  U3e = De(FM),
  [pQ, gQ] = Te("divider"),
  mQ = {
    dashed: Boolean,
    hairline: _e,
    vertical: Boolean,
    contentPosition: Me("center"),
  };
var vQ = we({
  name: pQ,
  props: mQ,
  setup(t, { slots: e }) {
    return () => {
      var n;
      return R(
        "div",
        {
          role: "separator",
          class: gQ({
            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 G3e = De(vQ),
  yQ = {
    gap: { type: [Number, Object], default: 24 },
    icon: String,
    axis: Me("y"),
    magnetic: String,
    offset: Object,
    teleport: { type: [String, Object], default: "body" },
  },
  [_Q, _C] = Te("floating-bubble");
var xQ = we({
  name: _Q,
  inheritAttrs: !1,
  props: yQ,
  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(() => (yo(t.gap) ? t.gap.x : t.gap)),
      a = re(() => (yo(t.gap) ? t.gap.y : t.gap)),
      l = re(() => ({
        top: a.value,
        right: Xo.value - o.value.width - s.value,
        bottom: Zs.value - o.value.height - a.value,
        left: s.value,
      })),
      c = Z(!1);
    let u = !1;
    const f = re(() => {
        const b = {},
          w = nt(o.value.x),
          E = nt(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 } = Sn(i.value),
          { offset: E } = t;
        o.value = {
          x: E ? E.x : Xo.value - b - s.value,
          y: E ? E.y : Zs.value - w - a.value,
          width: b,
          height: w,
        };
      },
      h = $l();
    let p = 0,
      g = 0;
    const m = (b) => {
      h.start(b), (c.value = !0), (p = o.value.x), (g = o.value.y);
    };
    vr(
      "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 = g + 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 y = () => {
        (c.value = !1),
          Xe(() => {
            if (t.magnetic === "x") {
              const b = ZS([l.value.left, l.value.right], o.value.x);
              o.value.x = b;
            }
            if (t.magnetic === "y") {
              const b = ZS([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 || g !== b.y) && n("offsetChange", b);
            }
          });
      },
      _ = (b) => {
        h.isTap.value ? n("click", b) : b.stopPropagation();
      };
    Ht(() => {
      d(),
        Xe(() => {
          u = !0;
        });
    }),
      ve([Xo, Zs, s, a, () => t.offset], d, { deep: !0 });
    const x = Z(!0);
    return (
      ps(() => {
        x.value = !0;
      }),
      Eo(() => {
        t.teleport && (x.value = !1);
      }),
      () => {
        const b = di(
          R(
            "div",
            st(
              {
                class: _C(),
                ref: i,
                onTouchstartPassive: m,
                onTouchend: y,
                onTouchcancel: y,
                onClickCapture: _,
                style: f.value,
              },
              r
            ),
            [
              e.default
                ? e.default()
                : R(oq, { name: t.icon, class: _C("icon") }, null),
            ]
          ),
          [[pi, x.value]]
        );
        return t.teleport
          ? R(Eg, { to: t.teleport }, { default: () => [b] })
          : b;
      }
    );
  },
});
const H3e = De(xQ),
  [LM, bQ] = Te("grid"),
  wQ = {
    square: Boolean,
    center: _e,
    border: _e,
    gutter: Se,
    reverse: Boolean,
    iconSize: Se,
    direction: String,
    clickable: Boolean,
    columnNum: ze(4),
  },
  $M = Symbol(LM);
var EQ = we({
  name: LM,
  props: wQ,
  setup(t, { slots: e }) {
    const { linkChildren: n } = Hi($M);
    return (
      n({ props: t }),
      () => {
        var r;
        return R(
          "div",
          {
            style: { paddingLeft: nt(t.gutter) },
            class: [bQ(), { [K8]: t.border && !t.gutter }],
          },
          [(r = e.default) == null ? void 0 : r.call(e)]
        );
      }
    );
  },
});
const V3e = De(EQ),
  [SQ, Vh] = Te("grid-item"),
  CQ = We({}, _u, {
    dot: Boolean,
    text: String,
    icon: String,
    badge: Se,
    iconColor: String,
    iconPrefix: String,
    badgeProps: Object,
  });
var AQ = we({
  name: SQ,
  props: CQ,
  setup(t, { slots: e }) {
    const { parent: n, index: r } = Zr($M),
      i = qd();
    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 g = nt(f);
          (p.paddingRight = g), r.value >= +d && (p.marginTop = g);
        }
        return p;
      }),
      s = re(() => {
        const { square: u, gutter: f } = n.props;
        if (u && f) {
          const d = nt(f);
          return { right: d, bottom: d, height: "auto" };
        }
      }),
      a = () => {
        if (e.icon)
          return R(Vg, 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: Vh("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: Vh("text") }, [t.text]);
      },
      c = () => (e.default ? e.default() : [a(), l()]);
    return () => {
      const {
          center: u,
          border: f,
          square: d,
          gutter: h,
          reverse: p,
          direction: g,
          clickable: m,
        } = n.props,
        v = [
          Vh("content", [
            g,
            {
              center: u,
              square: d,
              reverse: p,
              clickable: m,
              surround: f && h,
            },
          ]),
          { [pa]: f },
        ];
      return R("div", { class: [Vh({ square: d })], style: o.value }, [
        R(
          "div",
          {
            role: m ? "button" : void 0,
            class: v,
            style: s.value,
            tabindex: m ? 0 : void 0,
            onClick: i,
          },
          [c()]
        ),
      ]);
    };
  },
});
const z3e = De(AQ),
  xC = (t) =>
    Math.sqrt(
      (t[0].clientX - t[1].clientX) ** 2 + (t[0].clientY - t[1].clientY) ** 2
    ),
  TQ = (t) => ({
    x: (t[0].clientX + t[1].clientX) / 2,
    y: (t[0].clientY + t[1].clientY) / 2,
  }),
  l1 = Te("image-preview")[1],
  bC = 2.6,
  PQ = {
    src: String,
    show: Boolean,
    active: Number,
    minZoom: fr(Se),
    maxZoom: fr(Se),
    rootWidth: fr(Number),
    rootHeight: fr(Number),
    disableZoom: Boolean,
    doubleScale: Boolean,
    closeOnClickImage: Boolean,
    closeOnClickOverlay: Boolean,
    vertical: Boolean,
  };
var IQ = we({
  props: PQ,
  emits: ["scale", "close", "longPress"],
  setup(t, { emit: e, slots: n }) {
    const r = At({
        scale: 1,
        moveX: 0,
        moveY: 0,
        moving: !1,
        zooming: !1,
        initializing: !1,
        imageRatio: 0,
      }),
      i = $l(),
      o = Z(),
      s = Z(),
      a = Z(!1),
      l = Z(!1);
    let c = 0;
    const u = re(() => {
        const {
            scale: D,
            moveX: $,
            moveY: z,
            moving: K,
            zooming: fe,
            initializing: se,
          } = r,
          Y = { transitionDuration: fe || K || se ? "0s" : ".3s" };
        return (
          (D !== 1 || l.value) &&
            (Y.transform = `matrix(${D}, 0, 0, ${D}, ${$}, ${z})`),
          Y
        );
      }),
      f = re(() => {
        if (r.imageRatio) {
          const { rootWidth: D, rootHeight: $ } = t,
            z = a.value ? $ / r.imageRatio : D;
          return Math.max(0, (r.scale * z - D) / 2);
        }
        return 0;
      }),
      d = re(() => {
        if (r.imageRatio) {
          const { rootWidth: D, rootHeight: $ } = t,
            z = a.value ? $ : D * r.imageRatio;
          return Math.max(0, (r.scale * z - $) / 2);
        }
        return 0;
      }),
      h = (D, $) => {
        var z;
        if (((D = Hn(D, +t.minZoom, +t.maxZoom + 1)), D !== r.scale)) {
          const K = D / r.scale;
          if (((r.scale = D), $)) {
            const fe = Sn((z = o.value) == null ? void 0 : z.$el),
              se = { x: fe.width * 0.5, y: fe.height * 0.5 },
              Y = r.moveX - ($.x - fe.left - se.x) * (K - 1),
              te = r.moveY - ($.y - fe.top - se.y) * (K - 1);
            (r.moveX = Hn(Y, -f.value, f.value)),
              (r.moveY = Hn(te, -d.value, d.value));
          } else (r.moveX = 0), (r.moveY = l.value ? c : 0);
          e("scale", { scale: D, index: t.active });
        }
      },
      p = () => {
        h(1);
      },
      g = () => {
        const D = r.scale > 1 ? 1 : 2;
        h(
          D,
          D === 2 || l.value ? { x: i.startX.value, y: i.startY.value } : void 0
        );
      };
    let m,
      v,
      y,
      _,
      x,
      b,
      w,
      E,
      S = !1;
    const P = (D) => {
        const { touches: $ } = D;
        if (((m = $.length), m === 2 && t.disableZoom)) return;
        const { offsetX: z } = i;
        i.start(D),
          (v = r.moveX),
          (y = r.moveY),
          (E = Date.now()),
          (S = !1),
          (r.moving = m === 1 && (r.scale !== 1 || l.value)),
          (r.zooming = m === 2 && !z.value),
          r.zooming && ((_ = r.scale), (x = xC($)));
      },
      C = (D) => {
        const { touches: $ } = D;
        if ((i.move(D), r.moving)) {
          const { deltaX: z, deltaY: K } = i,
            fe = z.value + v,
            se = K.value + y;
          if (
            (t.vertical
              ? i.isVertical() && Math.abs(se) > d.value
              : i.isHorizontal() && Math.abs(fe) > f.value) &&
            !S
          ) {
            r.moving = !1;
            return;
          }
          (S = !0),
            Nn(D, !0),
            (r.moveX = Hn(fe, -f.value, f.value)),
            (r.moveY = Hn(se, -d.value, d.value));
        }
        if (r.zooming && (Nn(D, !0), $.length === 2)) {
          const z = xC($),
            K = (_ * z) / x;
          (b = TQ($)), h(K, b);
        }
      },
      A = (D) => {
        var $;
        const z = ($ = s.value) == null ? void 0 : $.$el;
        if (!z) return;
        const K = z.firstElementChild,
          fe = D.target === z,
          se = K == null ? void 0 : K.contains(D.target);
        (!t.closeOnClickImage && se) ||
          (!t.closeOnClickOverlay && fe) ||
          e("close");
      },
      T = (D) => {
        if (m > 1) return;
        const $ = Date.now() - E,
          z = 250;
        i.isTap.value &&
          ($ < z
            ? t.doubleScale
              ? w
                ? (clearTimeout(w), (w = null), g())
                : (w = setTimeout(() => {
                    A(D), (w = null);
                  }, z))
              : A(D)
            : $ > J8 && e("longPress"));
      },
      I = (D) => {
        let $ = !1;
        if (
          (r.moving || r.zooming) &&
          (($ = !0),
          r.moving && v === r.moveX && y === r.moveY && ($ = !1),
          !D.touches.length)
        ) {
          r.zooming &&
            ((r.moveX = Hn(r.moveX, -f.value, f.value)),
            (r.moveY = Hn(r.moveY, -d.value, d.value)),
            (r.zooming = !1)),
            (r.moving = !1),
            (v = 0),
            (y = 0),
            (_ = 1),
            r.scale < 1 && p();
          const z = +t.maxZoom;
          r.scale > z && h(z, b);
        }
        Nn(D, $), T(D), i.reset();
      },
      B = () => {
        const { rootWidth: D, rootHeight: $ } = t,
          z = $ / D,
          { imageRatio: K } = r;
        (a.value = r.imageRatio > z && K < bC),
          (l.value = r.imageRatio > z && K >= bC),
          l.value &&
            ((c = (K * D - $) / 2),
            (r.moveY = c),
            (r.initializing = !0),
            pr(() => {
              r.initializing = !1;
            })),
          p();
      },
      G = (D) => {
        const { naturalWidth: $, naturalHeight: z } = D.target;
        (r.imageRatio = z / $), B();
      };
    return (
      ve(() => t.active, p),
      ve(
        () => t.show,
        (D) => {
          D || p();
        }
      ),
      ve(() => [t.rootWidth, t.rootHeight], B),
      vr("touchmove", C, {
        target: re(() => {
          var D;
          return (D = s.value) == null ? void 0 : D.$el;
        }),
      }),
      Kt({ resetScale: p }),
      () => {
        const D = { loading: () => R(vs, { type: "spinner" }, null) };
        return R(
          bM,
          {
            ref: s,
            class: l1("swipe-item"),
            onTouchstartPassive: P,
            onTouchend: I,
            onTouchcancel: I,
          },
          {
            default: () => [
              n.image
                ? R("div", { class: l1("image-wrap") }, [
                    n.image({ src: t.src, onLoad: G, style: u.value }),
                  ])
                : R(
                    MM,
                    {
                      ref: o,
                      src: t.src,
                      fit: "contain",
                      class: l1("image", { vertical: a.value }),
                      style: u.value,
                      onLoad: G,
                    },
                    D
                  ),
            ],
          }
        );
      }
    );
  },
});
const [OQ, Ql] = Te("image-preview"),
  RQ = ["show", "teleport", "transition", "overlayStyle", "closeOnPopstate"],
  MQ = {
    show: Boolean,
    loop: _e,
    images: ss(),
    minZoom: ze(1 / 3),
    maxZoom: ze(3),
    overlay: _e,
    vertical: Boolean,
    closeable: Boolean,
    showIndex: _e,
    className: pn,
    closeIcon: Me("clear"),
    transition: String,
    beforeClose: Function,
    doubleScale: _e,
    overlayClass: pn,
    overlayStyle: Object,
    swipeDuration: ze(300),
    startPosition: ze(0),
    showIndicators: Boolean,
    closeOnPopstate: _e,
    closeOnClickImage: _e,
    closeOnClickOverlay: _e,
    closeIconPosition: Me("top-right"),
    teleport: [String, Object],
  };
var UM = we({
  name: OQ,
  props: MQ,
  emits: ["scale", "close", "closed", "change", "longPress", "update:show"],
  setup(t, { emit: e, slots: n }) {
    const r = Z(),
      i = Z(),
      o = At({ active: 0, rootWidth: 0, rootHeight: 0, disableZoom: !1 }),
      s = () => {
        if (r.value) {
          const _ = Sn(r.value.$el);
          (o.rootWidth = _.width), (o.rootHeight = _.height), r.value.resize();
        }
      },
      a = (_) => e("scale", _),
      l = (_) => e("update:show", _),
      c = () => {
        yu(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;
      },
      g = () =>
        R(
          mM,
          {
            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(
                  IQ,
                  {
                    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 }
                )
              ),
            ],
          }
        ),
      m = () => {
        if (t.closeable)
          return R(
            tn,
            {
              role: "button",
              name: t.closeIcon,
              class: [Ql("close-icon", t.closeIconPosition), as],
              onClick: c,
            },
            null
          );
      },
      v = () => e("closed"),
      y = (_, x) => {
        var b;
        return (b = r.value) == null ? void 0 : b.swipeTo(_, x);
      };
    return (
      Kt({
        resetScale: () => {
          var _;
          (_ = i.value) == null || _.resetScale();
        },
        swipeTo: y,
      }),
      Ht(s),
      ve([Xo, Zs], s),
      ve(
        () => t.startPosition,
        (_) => u(+_)
      ),
      ve(
        () => t.show,
        (_) => {
          const { images: x, startPosition: b } = t;
          _
            ? (u(+b),
              Xe(() => {
                s(), y(+b, { immediate: !0 });
              }))
            : e("close", { index: o.active, url: x[o.active] });
        }
      ),
      () =>
        R(
          Ul,
          st(
            {
              class: [Ql(), t.className],
              overlayClass: [Ql("overlay"), t.overlayClass],
              onClosed: v,
              "onUpdate:show": l,
            },
            $t(t, RQ)
          ),
          { default: () => [m(), g(), f(), d()] }
        )
    );
  },
});
let $p;
const DQ = {
  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 BQ() {
  ({ instance: $p } = Yg({
    setup() {
      const { state: t, toggle: e } = Wg(),
        n = () => {
          t.images = [];
        };
      return () => R(UM, st(t, { onClosed: n, "onUpdate:show": e }), null);
    },
  }));
}
const kQ = (t, e = 0) => {
  if (vo)
    return (
      $p || BQ(),
      (t = Array.isArray(t) ? { images: t, startPosition: e } : t),
      $p.open(We({}, DQ, t)),
      $p
    );
};
De(UM);
const [NQ, ec, FQ] = Te("list"),
  LQ = {
    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 $Q = we({
  name: NQ,
  props: LQ,
  emits: ["load", "update:error", "update:loading"],
  setup(t, { emit: e, slots: n }) {
    const r = Z(t.loading),
      i = Z(),
      o = Z(),
      s = xM(),
      a = Xd(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,
            g = +t.offset,
            m = Sn(l);
          if (!m.height || jc(i)) return;
          let v = !1;
          const y = Sn(o);
          p === "up"
            ? (v = m.top - y.top <= g)
            : (v = y.bottom - m.bottom <= g),
            v && ((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: ec("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: ec("error-text"),
                tabindex: 0,
                onClick: f,
              },
              [p]
            );
        }
      },
      h = () => {
        if (r.value && !t.finished && !t.disabled)
          return R("div", { class: ec("loading") }, [
            n.loading
              ? n.loading()
              : R(
                  vs,
                  { class: ec("loading-icon") },
                  { default: () => [t.loadingText || FQ("loading")] }
                ),
          ]);
      };
    return (
      ve(() => [t.loading, t.finished, t.error], c),
      s &&
        ve(s, (p) => {
          p && c();
        }),
      kl(() => {
        r.value = t.loading;
      }),
      Ht(() => {
        t.immediateCheck && c();
      }),
      Kt({ check: c }),
      vr("scroll", c, { target: l, passive: !0 }),
      () => {
        var p;
        const g = (p = n.default) == null ? void 0 : p.call(n),
          m = R("div", { ref: o, class: ec("placeholder") }, null);
        return R(
          "div",
          { ref: i, role: "feed", class: ec(), "aria-busy": r.value },
          [
            t.direction === "down" ? g : m,
            h(),
            u(),
            d(),
            t.direction === "up" ? g : m,
          ]
        );
      }
    );
  },
});
const j3e = De($Q),
  [UQ, GQ] = Te("notify"),
  HQ = ["lockScroll", "position", "show", "teleport", "zIndex"],
  VQ = We({}, Zd, {
    type: Me("danger"),
    color: String,
    message: Se,
    position: Me("top"),
    className: pn,
    background: String,
    lockScroll: Boolean,
  });
var GM = we({
  name: UQ,
  props: VQ,
  emits: ["update:show"],
  setup(t, { emit: e, slots: n }) {
    const r = (i) => e("update:show", i);
    return () =>
      R(
        Ul,
        st(
          {
            class: [GQ([t.type]), t.className],
            style: { color: t.color, background: t.background },
            overlay: !1,
            duration: 0.2,
            "onUpdate:show": r,
          },
          $t(t, HQ)
        ),
        { default: () => [n.default ? n.default() : t.message] }
      );
  },
});
let wC, Dc;
const zQ = (t) => (yo(t) ? t : { message: t });
function jQ() {
  ({ instance: Dc } = Yg({
    setup() {
      const { state: t, toggle: e } = Wg();
      return () => R(GM, st(t, { "onUpdate:show": e }), null);
    },
  }));
}
const WQ = () => ({
  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 YQ = WQ();
const XQ = () => {
  Dc && Dc.toggle(!1);
};
function W3e(t) {
  if (vo)
    return (
      Dc || jQ(),
      (t = We({}, YQ, zQ(t))),
      Dc.open(t),
      clearTimeout(wC),
      t.duration > 0 && (wC = setTimeout(XQ, t.duration)),
      Dc
    );
}
De(GM);
const [KQ, tc, EC] = Te("pagination"),
  c1 = (t, e, n) => ({ number: t, text: e, active: n }),
  qQ = {
    mode: Me("multi"),
    prevText: String,
    nextText: String,
    pageCount: ze(0),
    modelValue: Hg(0),
    totalItems: ze(0),
    showPageSize: ze(5),
    itemsPerPage: ze(10),
    forceEllipses: Boolean,
    showPrevButton: _e,
    showNextButton: _e,
  };
var ZQ = we({
  name: KQ,
  props: qQ,
  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 g = 1,
          m = f;
        const v = d < f;
        v &&
          ((g = Math.max(h - Math.floor(d / 2), 1)),
          (m = g + d - 1),
          m > f && ((m = f), (g = m - d + 1)));
        for (let y = g; y <= m; y++) {
          const _ = c1(y, y, y === h);
          u.push(_);
        }
        if (v && d > 0 && p) {
          if (g > 1) {
            const y = c1(g - 1, "...");
            u.unshift(y);
          }
          if (m < f) {
            const y = c1(m + 1, "...");
            u.push(y);
          }
        }
        return u;
      }),
      o = (u, f) => {
        (u = Hn(u, 1, r.value)),
          t.modelValue !== u &&
            (e("update:modelValue", u), f && e("change", u));
      };
    gu(() => o(t.modelValue));
    const s = () =>
        R("li", { class: tc("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: [
              tc("item", { disabled: p, border: u === "simple", prev: !0 }),
              Fp,
            ],
          },
          [
            R(
              "button",
              { type: "button", disabled: p, onClick: () => o(f - 1, !0) },
              [h ? h() : t.prevText || EC("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: [
              tc("item", { disabled: p, border: u === "simple", next: !0 }),
              Fp,
            ],
          },
          [
            R(
              "button",
              { type: "button", disabled: p, onClick: () => o(f + 1, !0) },
              [h ? h() : t.nextText || EC("next")]
            ),
          ]
        );
      },
      c = () =>
        i.value.map((u) =>
          R("li", { class: [tc("item", { active: u.active, page: !0 }), Fp] }, [
            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: tc() }, [
        R("ul", { class: tc("items") }, [
          a(),
          t.mode === "simple" ? s() : c(),
          l(),
        ]),
      ]);
  },
});
const Y3e = De(ZQ);
function Vi(t) {
  if (t == null) return window;
  if (t.toString() !== "[object Window]") {
    var e = t.ownerDocument;
    return (e && e.defaultView) || window;
  }
  return t;
}
function Aw(t) {
  var e = Vi(t).Element;
  return t instanceof e || t instanceof Element;
}
function Ni(t) {
  var e = Vi(t).HTMLElement;
  return t instanceof e || t instanceof HTMLElement;
}
function HM(t) {
  if (typeof ShadowRoot > "u") return !1;
  var e = Vi(t).ShadowRoot;
  return t instanceof e || t instanceof ShadowRoot;
}
var Yc = Math.round;
function d_() {
  var t = navigator.userAgentData;
  return t != null && t.brands
    ? t.brands
        .map(function (e) {
          return e.brand + "/" + e.version;
        })
        .join(" ")
    : navigator.userAgent;
}
function JQ() {
  return !/^((?!chrome|android).)*safari/i.test(d_());
}
function w0(t, e, n) {
  e === void 0 && (e = !1), n === void 0 && (n = !1);
  var r = t.getBoundingClientRect(),
    i = 1,
    o = 1;
  e &&
    Ni(t) &&
    ((i = (t.offsetWidth > 0 && Yc(r.width) / t.offsetWidth) || 1),
    (o = (t.offsetHeight > 0 && Yc(r.height) / t.offsetHeight) || 1));
  var s = Aw(t) ? Vi(t) : window,
    a = s.visualViewport,
    l = !JQ() && 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 VM(t) {
  var e = Vi(t),
    n = e.pageXOffset,
    r = e.pageYOffset;
  return { scrollLeft: n, scrollTop: r };
}
function QQ(t) {
  return { scrollLeft: t.scrollLeft, scrollTop: t.scrollTop };
}
function eee(t) {
  return t === Vi(t) || !Ni(t) ? VM(t) : QQ(t);
}
function ls(t) {
  return t ? (t.nodeName || "").toLowerCase() : null;
}
function Xg(t) {
  return ((Aw(t) ? t.ownerDocument : t.document) || window.document)
    .documentElement;
}
function tee(t) {
  return w0(Xg(t)).left + VM(t).scrollLeft;
}
function cs(t) {
  return Vi(t).getComputedStyle(t);
}
function Tw(t) {
  var e = cs(t),
    n = e.overflow,
    r = e.overflowX,
    i = e.overflowY;
  return /auto|scroll|overlay|hidden/.test(n + i + r);
}
function nee(t) {
  var e = t.getBoundingClientRect(),
    n = Yc(e.width) / t.offsetWidth || 1,
    r = Yc(e.height) / t.offsetHeight || 1;
  return n !== 1 || r !== 1;
}
function ree(t, e, n) {
  n === void 0 && (n = !1);
  var r = Ni(e),
    i = Ni(e) && nee(e),
    o = Xg(e),
    s = w0(t, i, n),
    a = { scrollLeft: 0, scrollTop: 0 },
    l = { x: 0, y: 0 };
  return (
    (r || (!r && !n)) &&
      ((ls(e) !== "body" || Tw(o)) && (a = eee(e)),
      Ni(e)
        ? ((l = w0(e, !0)), (l.x += e.clientLeft), (l.y += e.clientTop))
        : o && (l.x = tee(o))),
    {
      x: s.left + a.scrollLeft - l.x,
      y: s.top + a.scrollTop - l.y,
      width: s.width,
      height: s.height,
    }
  );
}
function iee(t) {
  var e = w0(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 Pw(t) {
  return ls(t) === "html"
    ? t
    : t.assignedSlot || t.parentNode || (HM(t) ? t.host : null) || Xg(t);
}
function zM(t) {
  return ["html", "body", "#document"].indexOf(ls(t)) >= 0
    ? t.ownerDocument.body
    : Ni(t) && Tw(t)
    ? t
    : zM(Pw(t));
}
function Up(t, e) {
  var n;
  e === void 0 && (e = []);
  var r = zM(t),
    i = r === ((n = t.ownerDocument) == null ? void 0 : n.body),
    o = Vi(r),
    s = i ? [o].concat(o.visualViewport || [], Tw(r) ? r : []) : r,
    a = e.concat(s);
  return i ? a : a.concat(Up(Pw(s)));
}
function oee(t) {
  return ["table", "td", "th"].indexOf(ls(t)) >= 0;
}
function SC(t) {
  return !Ni(t) || cs(t).position === "fixed" ? null : t.offsetParent;
}
function see(t) {
  var e = /firefox/i.test(d_()),
    n = /Trident/i.test(d_());
  if (n && Ni(t)) {
    var r = cs(t);
    if (r.position === "fixed") return null;
  }
  var i = Pw(t);
  for (HM(i) && (i = i.host); Ni(i) && ["html", "body"].indexOf(ls(i)) < 0; ) {
    var o = cs(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 jM(t) {
  for (var e = Vi(t), n = SC(t); n && oee(n) && cs(n).position === "static"; )
    n = SC(n);
  return n &&
    (ls(n) === "html" || (ls(n) === "body" && cs(n).position === "static"))
    ? e
    : n || see(t) || e;
}
var Bc = "top",
  E0 = "bottom",
  ad = "right",
  al = "left",
  WM = "auto",
  aee = [Bc, E0, ad, al],
  YM = "start",
  S0 = "end",
  lee = [].concat(aee, [WM]).reduce(function (t, e) {
    return t.concat([e, e + "-" + YM, e + "-" + S0]);
  }, []),
  cee = "beforeRead",
  uee = "read",
  fee = "afterRead",
  dee = "beforeMain",
  hee = "main",
  pee = "afterMain",
  gee = "beforeWrite",
  mee = "write",
  vee = "afterWrite",
  h_ = [cee, uee, fee, dee, hee, pee, gee, mee, vee];
function yee(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 _ee(t) {
  var e = yee(t);
  return h_.reduce(function (n, r) {
    return n.concat(
      e.filter(function (i) {
        return i.phase === r;
      })
    );
  }, []);
}
function xee(t) {
  var e;
  return function () {
    return (
      e ||
        (e = new Promise(function (n) {
          Promise.resolve().then(function () {
            (e = void 0), n(t());
          });
        })),
      e
    );
  };
}
function Ss(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 Ca =
    'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',
  bee =
    'Popper: modifier "%s" requires "%s", but "%s" modifier is not available',
  CC = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
function wee(t) {
  t.forEach(function (e) {
    []
      .concat(Object.keys(e), CC)
      .filter(function (n, r, i) {
        return i.indexOf(n) === r;
      })
      .forEach(function (n) {
        switch (n) {
          case "name":
            typeof e.name != "string" &&
              console.error(
                Ss(
                  Ca,
                  String(e.name),
                  '"name"',
                  '"string"',
                  '"' + String(e.name) + '"'
                )
              );
            break;
          case "enabled":
            typeof e.enabled != "boolean" &&
              console.error(
                Ss(
                  Ca,
                  e.name,
                  '"enabled"',
                  '"boolean"',
                  '"' + String(e.enabled) + '"'
                )
              );
            break;
          case "phase":
            h_.indexOf(e.phase) < 0 &&
              console.error(
                Ss(
                  Ca,
                  e.name,
                  '"phase"',
                  "either " + h_.join(", "),
                  '"' + String(e.phase) + '"'
                )
              );
            break;
          case "fn":
            typeof e.fn != "function" &&
              console.error(
                Ss(Ca, e.name, '"fn"', '"function"', '"' + String(e.fn) + '"')
              );
            break;
          case "effect":
            e.effect != null &&
              typeof e.effect != "function" &&
              console.error(
                Ss(
                  Ca,
                  e.name,
                  '"effect"',
                  '"function"',
                  '"' + String(e.fn) + '"'
                )
              );
            break;
          case "requires":
            e.requires != null &&
              !Array.isArray(e.requires) &&
              console.error(
                Ss(
                  Ca,
                  e.name,
                  '"requires"',
                  '"array"',
                  '"' + String(e.requires) + '"'
                )
              );
            break;
          case "requiresIfExists":
            Array.isArray(e.requiresIfExists) ||
              console.error(
                Ss(
                  Ca,
                  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 ' +
                CC.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(Ss(bee, String(e.name), r, r));
          });
      });
  });
}
function Eee(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 Kg(t) {
  return t.split("-")[0];
}
function See(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 XM(t) {
  return t.split("-")[1];
}
function Cee(t) {
  return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
}
function Aee(t) {
  var e = t.reference,
    n = t.element,
    r = t.placement,
    i = r ? Kg(r) : null,
    o = r ? XM(r) : null,
    s = e.x + e.width / 2 - n.width / 2,
    a = e.y + e.height / 2 - n.height / 2,
    l;
  switch (i) {
    case Bc:
      l = { x: s, y: e.y - n.height };
      break;
    case E0:
      l = { x: s, y: e.y + e.height };
      break;
    case ad:
      l = { x: e.x + e.width, y: a };
      break;
    case al:
      l = { x: e.x - n.width, y: a };
      break;
    default:
      l = { x: e.x, y: e.y };
  }
  var c = i ? Cee(i) : null;
  if (c != null) {
    var u = c === "y" ? "height" : "width";
    switch (o) {
      case YM:
        l[c] = l[c] - (e[u] / 2 - n[u] / 2);
        break;
      case S0:
        l[c] = l[c] + (e[u] / 2 - n[u] / 2);
        break;
    }
  }
  return l;
}
var AC =
    "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",
  Tee =
    "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",
  TC = { placement: "bottom", modifiers: [], strategy: "absolute" };
function PC() {
  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 Pee(t) {
  t === void 0 && (t = {});
  var e = t,
    n = e.defaultModifiers,
    r = n === void 0 ? [] : n,
    i = e.defaultOptions,
    o = i === void 0 ? TC : i;
  return function (a, l, c) {
    c === void 0 && (c = o);
    var u = {
        placement: "bottom",
        orderedModifiers: [],
        options: Object.assign({}, TC, o),
        modifiersData: {},
        elements: { reference: a, popper: l },
        attributes: {},
        styles: {},
      },
      f = [],
      d = !1,
      h = {
        state: u,
        setOptions: function (v) {
          var y = typeof v == "function" ? v(u.options) : v;
          g(),
            (u.options = Object.assign({}, o, u.options, y)),
            (u.scrollParents = {
              reference: Aw(a)
                ? Up(a)
                : a.contextElement
                ? Up(a.contextElement)
                : [],
              popper: Up(l),
            });
          var _ = _ee(See([].concat(r, u.options.modifiers)));
          u.orderedModifiers = _.filter(function (A) {
            return A.enabled;
          });
          {
            var x = Eee([].concat(_, u.options.modifiers), function (A) {
              var T = A.name;
              return T;
            });
            if ((wee(x), Kg(u.options.placement) === WM)) {
              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 = cs(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 v = u.elements,
              y = v.reference,
              _ = v.popper;
            if (!PC(y, _)) {
              console.error(AC);
              return;
            }
            (u.rects = {
              reference: ree(y, jM(_), u.options.strategy === "fixed"),
              popper: iee(_),
            }),
              (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(Tee);
                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: xee(function () {
          return new Promise(function (m) {
            h.forceUpdate(), m(u);
          });
        }),
        destroy: function () {
          g(), (d = !0);
        },
      };
    if (!PC(a, l)) return console.error(AC), h;
    h.setOptions(c).then(function (m) {
      !d && c.onFirstUpdate && c.onFirstUpdate(m);
    });
    function p() {
      u.orderedModifiers.forEach(function (m) {
        var v = m.name,
          y = m.options,
          _ = y === void 0 ? {} : y,
          x = m.effect;
        if (typeof x == "function") {
          var b = x({ state: u, name: v, instance: h, options: _ }),
            w = function () {};
          f.push(b || w);
        }
      });
    }
    function g() {
      f.forEach(function (m) {
        return m();
      }),
        (f = []);
    }
    return h;
  };
}
var zh = { passive: !0 };
function Iee(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 = Vi(e.elements.popper),
    c = [].concat(e.scrollParents.reference, e.scrollParents.popper);
  return (
    o &&
      c.forEach(function (u) {
        u.addEventListener("scroll", n.update, zh);
      }),
    a && l.addEventListener("resize", n.update, zh),
    function () {
      o &&
        c.forEach(function (u) {
          u.removeEventListener("scroll", n.update, zh);
        }),
        a && l.removeEventListener("resize", n.update, zh);
    }
  );
}
var Oee = {
  name: "eventListeners",
  enabled: !0,
  phase: "write",
  fn: function () {},
  effect: Iee,
  data: {},
};
function Ree(t) {
  var e = t.state,
    n = t.name;
  e.modifiersData[n] = Aee({
    reference: e.rects.reference,
    element: e.rects.popper,
    strategy: "absolute",
    placement: e.placement,
  });
}
var Mee = {
    name: "popperOffsets",
    enabled: !0,
    phase: "read",
    fn: Ree,
    data: {},
  },
  Dee = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function Bee(t) {
  var e = t.x,
    n = t.y,
    r = window,
    i = r.devicePixelRatio || 1;
  return { x: Yc(e * i) / i || 0, y: Yc(n * i) / i || 0 };
}
function IC(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,
    g = p === void 0 ? 0 : p,
    m = typeof u == "function" ? u({ x: h, y: g }) : { x: h, y: g };
  (h = m.x), (g = m.y);
  var v = s.hasOwnProperty("x"),
    y = s.hasOwnProperty("y"),
    _ = al,
    x = Bc,
    b = window;
  if (c) {
    var w = jM(n),
      E = "clientHeight",
      S = "clientWidth";
    if (
      (w === Vi(n) &&
        ((w = Xg(n)),
        cs(w).position !== "static" &&
          a === "absolute" &&
          ((E = "scrollHeight"), (S = "scrollWidth"))),
      (w = w),
      i === Bc || ((i === al || i === ad) && o === S0))
    ) {
      x = E0;
      var P = f && w === b && b.visualViewport ? b.visualViewport.height : w[E];
      (g -= P - r.height), (g *= l ? 1 : -1);
    }
    if (i === al || ((i === Bc || i === E0) && o === S0)) {
      _ = ad;
      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 && Dee),
    T = u === !0 ? Bee({ x: h, y: g }) : { x: h, y: g };
  if (((h = T.x), (g = T.y), l)) {
    var I;
    return Object.assign(
      {},
      A,
      ((I = {}),
      (I[x] = y ? "0" : ""),
      (I[_] = v ? "0" : ""),
      (I.transform =
        (b.devicePixelRatio || 1) <= 1
          ? "translate(" + h + "px, " + g + "px)"
          : "translate3d(" + h + "px, " + g + "px, 0)"),
      I)
    );
  }
  return Object.assign(
    {},
    A,
    ((e = {}),
    (e[x] = y ? g + "px" : ""),
    (e[_] = v ? h + "px" : ""),
    (e.transform = ""),
    e)
  );
}
function kee(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 = cs(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: Kg(e.placement),
    variation: XM(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,
      IC(
        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,
        IC(
          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 Nee = {
  name: "computeStyles",
  enabled: !0,
  phase: "beforeWrite",
  fn: kee,
  data: {},
};
function Fee(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];
    !Ni(o) ||
      !ls(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 Lee(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;
          }, {});
        !Ni(i) ||
          !ls(i) ||
          (Object.assign(i.style, a),
          Object.keys(o).forEach(function (l) {
            i.removeAttribute(l);
          }));
      });
    }
  );
}
var $ee = {
    name: "applyStyles",
    enabled: !0,
    phase: "write",
    fn: Fee,
    effect: Lee,
    requires: ["computeStyles"],
  },
  Uee = [Oee, Mee, Nee, $ee],
  Gee = Pee({ defaultModifiers: Uee });
function Hee(t, e, n) {
  var r = Kg(t),
    i = [al, Bc].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),
    [al, ad].indexOf(r) >= 0 ? { x: a, y: s } : { x: s, y: a }
  );
}
function Vee(t) {
  var e = t.state,
    n = t.options,
    r = t.name,
    i = n.offset,
    o = i === void 0 ? [0, 0] : i,
    s = lee.reduce(function (u, f) {
      return (u[f] = Hee(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 zee = {
  name: "offset",
  enabled: !0,
  phase: "main",
  requires: ["popperOffsets"],
  fn: Vee,
};
const [jee, Aa] = Te("popover"),
  Wee = [
    "overlay",
    "duration",
    "teleport",
    "overlayStyle",
    "overlayClass",
    "closeOnClickOverlay",
  ],
  Yee = {
    show: Boolean,
    theme: Me("light"),
    overlay: Boolean,
    actions: ss(),
    actionsDirection: Me("vertical"),
    trigger: Me("click"),
    duration: Se,
    showArrow: _e,
    placement: Me("bottom"),
    iconPrefix: String,
    overlayClass: pn,
    overlayStyle: Object,
    closeOnClickAction: _e,
    closeOnClickOverlay: _e,
    closeOnClickOutside: _e,
    offset: { type: Array, default: () => [0, 8] },
    teleport: { type: [String, Object], default: "body" },
  };
var Xee = we({
  name: jee,
  props: Yee,
  emits: ["select", "touchstart", "update:show"],
  setup(t, { emit: e, slots: n, attrs: r }) {
    let i;
    const o = Z(),
      s = Z(),
      a = Z(),
      l = Vq(
        () => t.show,
        (y) => e("update:show", y)
      ),
      c = () => ({
        placement: t.placement,
        modifiers: [
          {
            name: "computeStyles",
            options: { adaptive: !1, gpuAcceleration: !1 },
          },
          We({}, zee, { options: { offset: t.offset } }),
        ],
      }),
      u = () =>
        s.value && a.value ? Gee(s.value, a.value.popupRef.value, c()) : null,
      f = () => {
        Xe(() => {
          l.value &&
            (i
              ? i.setOptions(c())
              : ((i = u()),
                vo &&
                  (window.addEventListener("animationend", f),
                  window.addEventListener("transitionend", f))));
        });
      },
      d = (y) => {
        l.value = y;
      },
      h = () => {
        t.trigger === "click" && (l.value = !l.value);
      },
      p = (y, _) => {
        y.disabled ||
          (e("select", y, _), t.closeOnClickAction && (l.value = !1));
      },
      g = () => {
        l.value &&
          t.closeOnClickOutside &&
          (!t.overlay || t.closeOnClickOverlay) &&
          (l.value = !1);
      },
      m = (y, _) =>
        n.action
          ? n.action({ action: y, index: _ })
          : [
              y.icon &&
                R(
                  tn,
                  {
                    name: y.icon,
                    classPrefix: t.iconPrefix,
                    class: Aa("action-icon"),
                  },
                  null
                ),
              R(
                "div",
                {
                  class: [
                    Aa("action-text"),
                    { [HK]: t.actionsDirection === "vertical" },
                  ],
                },
                [y.text]
              ),
            ],
      v = (y, _) => {
        const { icon: x, color: b, disabled: w, className: E } = y;
        return R(
          "div",
          {
            role: "menuitem",
            class: [
              Aa("action", { disabled: w, "with-icon": x }),
              { [GK]: t.actionsDirection === "horizontal" },
              E,
            ],
            style: { color: b },
            tabindex: w ? void 0 : 0,
            "aria-disabled": w || void 0,
            onClick: () => p(y, _),
          },
          [m(y, _)]
        );
      };
    return (
      Ht(() => {
        f(),
          gu(() => {
            var y;
            o.value = (y = a.value) == null ? void 0 : y.popupRef.value;
          });
      }),
      qr(() => {
        i &&
          (vo &&
            (window.removeEventListener("animationend", f),
            window.removeEventListener("transitionend", f)),
          i.destroy(),
          (i = null));
      }),
      ve(() => [l.value, t.offset, t.placement], f),
      lR([s, o], g, { eventName: "touchstart" }),
      () => {
        var y;
        return R(Ft, null, [
          R("span", { ref: s, class: Aa("wrapper"), onClick: h }, [
            (y = n.reference) == null ? void 0 : y.call(n),
          ]),
          R(
            Ul,
            st(
              {
                ref: a,
                show: l.value,
                class: Aa([t.theme]),
                position: "",
                transition: "van-popover-zoom",
                lockScroll: !1,
                "onUpdate:show": d,
              },
              r,
              o_(),
              $t(t, Wee)
            ),
            {
              default: () => [
                t.showArrow && R("div", { class: Aa("arrow") }, null),
                R(
                  "div",
                  { role: "menu", class: Aa("content", t.actionsDirection) },
                  [n.default ? n.default() : t.actions.map(v)]
                ),
              ],
            }
          ),
        ]);
      }
    );
  },
});
const X3e = De(Xee),
  [Kee, u1] = Te("progress"),
  qee = {
    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 Zee = we({
  name: Kee,
  props: qee,
  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: u1("pivot", { inactive: t.inactive }) },
            [c]
          );
        }
      };
    return () => {
      const { trackColor: i, percentage: o, strokeWidth: s } = t,
        a = n(o),
        l = { background: i, height: nt(s) },
        c = { width: `${a}%`, background: e.value };
      return R("div", { class: u1(), style: l }, [
        R(
          "span",
          { class: u1("portion", { inactive: t.inactive }), style: c },
          null
        ),
        r(),
      ]);
    };
  },
});
const K3e = De(Zee),
  [Jee, $u, Qee] = Te("pull-refresh"),
  KM = 50,
  ete = ["pulling", "loosing", "success"],
  tte = {
    disabled: Boolean,
    modelValue: Boolean,
    headHeight: ze(KM),
    successText: String,
    pullingText: String,
    loosingText: String,
    loadingText: String,
    pullDistance: Se,
    successDuration: ze(500),
    animationDuration: ze(300),
  };
var nte = we({
  name: Jee,
  props: tte,
  emits: ["change", "refresh", "update:modelValue"],
  setup(t, { emit: e, slots: n }) {
    let r;
    const i = Z(),
      o = Z(),
      s = Xd(i),
      a = At({ status: "normal", distance: 0, duration: 0 }),
      l = $l(),
      c = () => {
        if (t.headHeight !== KM) 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`] || Qee(x);
      },
      p = () => {
        const { status: x, distance: b } = a;
        if (n[x]) return n[x]({ distance: b });
        const w = [];
        return (
          ete.includes(x) && w.push(R("div", { class: $u("text") }, [h()])),
          x === "loading" &&
            w.push(R(vs, { class: $u("loading") }, { default: h })),
          w
        );
      },
      g = () => {
        (a.status = "success"),
          setTimeout(() => {
            d(0);
          }, +t.successDuration);
      },
      m = (x) => {
        (r = Kd(s.value) === 0), r && ((a.duration = 0), l.start(x));
      },
      v = (x) => {
        u() && m(x);
      },
      y = (x) => {
        if (u()) {
          r || m(x);
          const { deltaY: b } = l;
          l.move(x),
            r && b.value >= 0 && l.isVertical() && (Nn(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
              ? g()
              : d(0, !1);
        }
      ),
      vr("touchmove", y, { 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: $u() }, [
          R(
            "div",
            {
              ref: o,
              class: $u("track"),
              style: b,
              onTouchstartPassive: v,
              onTouchend: _,
              onTouchcancel: _,
            },
            [
              R("div", { class: $u("head"), style: c() }, [p()]),
              (x = n.default) == null ? void 0 : x.call(n),
            ]
          ),
        ]);
      }
    );
  },
});
const q3e = De(nte),
  Z3e = De(UJ),
  [qM, rte] = Te("sidebar"),
  ZM = Symbol(qM),
  ite = { modelValue: ze(0) };
var ote = we({
  name: qM,
  props: ite,
  emits: ["change", "update:modelValue"],
  setup(t, { emit: e, slots: n }) {
    const { linkChildren: r } = Hi(ZM),
      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: rte() }, [
          (s = n.default) == null ? void 0 : s.call(n),
        ]);
      }
    );
  },
});
const J3e = De(ote),
  [ste, OC] = Te("sidebar-item"),
  ate = We({}, _u, {
    dot: Boolean,
    title: String,
    badge: Se,
    disabled: Boolean,
    badgeProps: Object,
  });
var lte = we({
  name: ste,
  props: ate,
  emits: ["click"],
  setup(t, { emit: e, slots: n }) {
    const r = qd(),
      { parent: i, index: o } = Zr(ZM);
    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: OC({ select: f, disabled: u }),
          tabindex: u ? void 0 : 0,
          "aria-selected": f,
          onClick: s,
        },
        [
          R(Vg, st({ dot: a, class: OC("text"), content: l }, t.badgeProps), {
            default: () => [n.title ? n.title() : c],
          }),
        ]
      );
    };
  },
});
const Q3e = De(lte),
  [cte, ute] = Te("skeleton-title"),
  fte = { round: Boolean, titleWidth: Se };
var dte = we({
  name: cte,
  props: fte,
  setup(t) {
    return () =>
      R(
        "h3",
        {
          class: ute([{ round: t.round }]),
          style: { width: nt(t.titleWidth) },
        },
        null
      );
  },
});
const hte = De(dte);
var pte = hte;
const [gte, mte] = Te("skeleton-avatar"),
  vte = { avatarSize: Se, avatarShape: Me("round") };
var yte = we({
  name: gte,
  props: vte,
  setup(t) {
    return () =>
      R("div", { class: mte([t.avatarShape]), style: Ll(t.avatarSize) }, null);
  },
});
const _te = De(yte);
var xte = _te;
const Iw = "100%",
  bte = { round: Boolean, rowWidth: { type: Se, default: Iw } },
  [wte, Ete] = Te("skeleton-paragraph");
var Ste = we({
  name: wte,
  props: bte,
  setup(t) {
    return () =>
      R(
        "div",
        { class: Ete([{ round: t.round }]), style: { width: t.rowWidth } },
        null
      );
  },
});
const Cte = De(Ste);
var Ate = Cte;
const [Tte, RC] = Te("skeleton"),
  Pte = "60%",
  Ite = {
    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: Iw },
  };
var Ote = we({
  name: Tte,
  inheritAttrs: !1,
  props: Ite,
  setup(t, { slots: e, attrs: n }) {
    const r = () => {
        if (t.avatar)
          return R(
            xte,
            { avatarShape: t.avatarShape, avatarSize: t.avatarSize },
            null
          );
      },
      i = () => {
        if (t.title)
          return R(pte, { round: t.round, titleWidth: t.titleWidth }, null);
      },
      o = (l) => {
        const { rowWidth: c } = t;
        return c === Iw && l === +t.row - 1 ? Pte : Array.isArray(c) ? c[l] : c;
      },
      s = () =>
        Array(+t.row)
          .fill("")
          .map((l, c) =>
            R(Ate, { key: c, round: t.round, rowWidth: nt(o(c)) }, null)
          ),
      a = () =>
        e.template
          ? e.template()
          : R(Ft, null, [r(), R("div", { class: RC("content") }, [i(), s()])]);
    return () => {
      var l;
      return t.loading
        ? R(
            "div",
            st({ class: RC({ animate: t.animate, round: t.round }) }, n),
            [a()]
          )
        : (l = e.default) == null
        ? void 0
        : l.call(e);
    };
  },
});
const ePe = De(Ote),
  [Rte, Uu] = Te("slider"),
  Mte = {
    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 Dte = we({
  name: Rte,
  props: Mte,
  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 = $l(),
      u = re(() => Number(t.max) - Number(t.min)),
      f = re(() => {
        const A = t.vertical ? "width" : "height";
        return { background: t.inactiveColor, [A]: nt(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%";
      },
      g = 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;
      }),
      m = (A) => {
        const T = +t.min,
          I = +t.max,
          B = +t.step;
        A = Hn(A, T, I);
        const G = Math.round((A - T) / B) * B;
        return Y8(T, G);
      },
      v = () => {
        const A = t.modelValue;
        d(A) ? (o = A.map(m)) : (o = m(A));
      },
      y = (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 = y(A).map(m)) : (A = m(A)),
          qs(A, t.modelValue) || e("update:modelValue", A),
          T && !qs(A, o) && e("change", A);
      },
      x = (A) => {
        if ((A.stopPropagation(), t.disabled || t.readonly)) return;
        v();
        const { min: T, reverse: I, vertical: B, modelValue: G } = t,
          D = Sn(s),
          $ = () =>
            B
              ? I
                ? D.bottom - A.clientY
                : A.clientY - D.top
              : I
              ? D.right - A.clientX
              : A.clientX - D.left,
          z = B ? D.height : D.width,
          K = Number(T) + ($() / z) * u.value;
        if (d(G)) {
          const [fe, se] = G,
            Y = (fe + se) / 2;
          K <= Y ? _([K, se], !0) : _([fe, K], !0);
        } else _(K, !0);
      },
      b = (A) => {
        t.disabled ||
          t.readonly ||
          (c.start(A), (i = t.modelValue), v(), (l.value = "start"));
      },
      w = (A) => {
        if (t.disabled || t.readonly) return;
        l.value === "start" && e("dragStart", A),
          Nn(A, !0),
          c.move(A),
          (l.value = "dragging");
        const T = Sn(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 D = t.reverse ? 1 - r : r;
          i[D] = o[D] + 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"
          ? Uu("button-wrapper", ["left", "right"][A])
          : Uu("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: Uu("button"), style: Ll(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: z8,
          },
          [P(T, A)]
        );
      };
    return (
      _(t.modelValue),
      Fl(() => t.modelValue),
      a.forEach((A) => {
        vr("touchmove", w, { target: A });
      }),
      () =>
        R(
          "div",
          {
            ref: s,
            style: f.value,
            class: Uu({ vertical: t.vertical, disabled: t.disabled }),
            onClick: x,
          },
          [
            R("div", { class: Uu("bar"), style: g.value }, [
              t.range ? [C(0), C(1)] : C(),
            ]),
          ]
        )
    );
  },
});
const tPe = De(Dte),
  [MC, Bte] = Te("space"),
  kte = {
    align: String,
    direction: { type: String, default: "horizontal" },
    size: { type: [Number, String, Array], default: 8 },
    wrap: Boolean,
    fill: Boolean,
  };
function JM(t = []) {
  const e = [];
  return (
    t.forEach((n) => {
      Array.isArray(n)
        ? e.push(...n)
        : n.type === Ft
        ? e.push(...JM(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 === go && n.children.trim() === ""))
      );
    })
  );
}
var Nte = we({
  name: MC,
  props: kte,
  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 = JM((o = e.default) == null ? void 0 : o.call(e));
      return R(
        "div",
        {
          class: [
            Bte({
              [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: `${MC}-item`,
                style: i(l === s.length - 1),
              },
              [a]
            )
          ),
        ]
      );
    };
  },
});
const nPe = De(Nte),
  [Fte, jh] = Te("stepper"),
  Lte = 200,
  Wh = (t, e) => String(t) === String(e),
  $te = {
    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 Ute = we({
  name: Fte,
  props: $te,
  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 = r_(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 Wh(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: nt(t.inputWidth), height: nt(t.buttonSize) })),
      u = re(() => Ll(t.buttonSize)),
      f = () => {
        const S = n(s.value);
        Wh(S, s.value) || (s.value = S);
      },
      d = (S) => {
        t.beforeChange
          ? yu(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(Y8(+s.value, S));
        d(P), e(i);
      },
      p = (S) => {
        const P = S.target,
          { value: C } = P,
          { decimalLength: A } = t;
        let T = r_(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))
          : Wh(C, T) || (P.value = T);
        const I = T === String(+T);
        d(I ? +T : T);
      },
      g = (S) => {
        var P;
        t.disableInput ? (P = o.value) == null || P.blur() : e("focus", S);
      },
      m = (S) => {
        const P = S.target,
          C = n(P.value, t.autoFixed);
        (P.value = String(C)),
          (s.value = C),
          Xe(() => {
            e("blur", S), V8();
          });
      };
    let v, y;
    const _ = () => {
        y = setTimeout(() => {
          h(), _();
        }, Lte);
      },
      x = () => {
        t.longPress &&
          ((v = !1),
          clearTimeout(y),
          (y = setTimeout(() => {
            (v = !0), h(), _();
          }, J8)));
      },
      b = (S) => {
        t.longPress && (clearTimeout(y), v && Nn(S));
      },
      w = (S) => {
        t.disableInput && Nn(S);
      },
      E = (S) => ({
        onClick: (P) => {
          Nn(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) => {
          Wh(S, s.value) || (s.value = n(S));
        }
      ),
      ve(s, (S) => {
        e("update:modelValue", S), e("change", S, { name: t.name });
      }),
      Fl(() => t.modelValue),
      () =>
        R("div", { role: "group", class: jh([t.theme]) }, [
          di(
            R(
              "button",
              st(
                {
                  type: "button",
                  style: u.value,
                  class: [
                    jh("minus", { disabled: a.value }),
                    { [as]: !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: jh("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: m,
                onInput: p,
                onFocus: g,
                onMousedown: w,
              },
              null
            ),
            [[pi, t.showInput]]
          ),
          di(
            R(
              "button",
              st(
                {
                  type: "button",
                  style: u.value,
                  class: [
                    jh("plus", { disabled: l.value }),
                    { [as]: !l.value },
                  ],
                  "aria-disabled": l.value || void 0,
                },
                E("plus")
              ),
              null
            ),
            [[pi, t.showPlus]]
          ),
        ])
    );
  },
});
const rPe = De(Ute),
  [Gte, xn, Hte] = Te("uploader");
function DC(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 QM(t, e) {
  return _0(t).some((n) =>
    n.file ? (zc(e) ? e(n.file) : n.file.size > +e) : !1
  );
}
function Vte(t, e) {
  const n = [],
    r = [];
  return (
    t.forEach((i) => {
      QM(i, e) ? r.push(i) : n.push(i);
    }),
    { valid: n, invalid: r }
  );
}
const zte = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i,
  jte = (t) => zte.test(t);
function e6(t) {
  return t.isImage
    ? !0
    : t.file && t.file.type
    ? t.file.type.indexOf("image") === 0
    : t.url
    ? jte(t.url)
    : typeof t.content == "string"
    ? t.content.indexOf("data:image") === 0
    : !1;
}
var Wte = we({
  props: {
    name: Se,
    item: fr(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: xn("mask-icon") }, null)
                : R(vs, { class: xn("loading") }, null),
            h = Lt(f) && f !== "";
          return R("div", { class: xn("mask") }, [
            d,
            h && R("div", { class: xn("mask-message") }, [f]),
          ]);
        }
      },
      i = (u) => {
        const { name: f, item: d, index: h, beforeDelete: p } = t;
        u.stopPropagation(),
          yu(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: xn("preview-delete", { shadow: !u }),
              tabindex: 0,
              "aria-label": Hte("delete"),
              onClick: i,
            },
            [
              u
                ? u()
                : R(
                    tn,
                    { name: "cross", class: xn("preview-delete-icon") },
                    null
                  ),
            ]
          );
        }
      },
      l = () => {
        if (n["preview-cover"]) {
          const { index: u, item: f } = t;
          return R("div", { class: xn("preview-cover") }, [
            n["preview-cover"](We({ index: u }, f)),
          ]);
        }
      },
      c = () => {
        const {
          item: u,
          lazyLoad: f,
          imageFit: d,
          previewSize: h,
          reupload: p,
        } = t;
        return e6(u)
          ? R(
              MM,
              {
                fit: d,
                src: u.objectUrl || u.content || u.url,
                class: xn("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: xn("file"), style: Ll(t.previewSize) }, [
              R(tn, { class: xn("file-icon"), name: "description" }, null),
              R("div", { class: [xn("file-name"), "van-ellipsis"] }, [
                u.file ? u.file.name : u.url,
              ]),
              l(),
            ]);
      };
    return () => R("div", { class: xn("preview") }, [c(), r(), a()]);
  },
});
const Yte = {
  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: ss(),
  beforeRead: Function,
  beforeDelete: Function,
  previewSize: [Number, String, Array],
  previewImage: _e,
  previewOptions: Object,
  previewFullImage: _e,
  maxSize: { type: [Number, String, Function], default: 1 / 0 },
};
var Xte = we({
  name: Gte,
  props: Yte,
  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(), QM(S, t.maxSize)))
          if (Array.isArray(S)) {
            const P = Vte(S, t.maxSize);
            if (((S = P.valid), e("oversize", P.invalid, a()), !S.length))
              return;
          } else {
            e("oversize", S, a());
            return;
          }
        if (((S = At(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, ..._0(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) => DC(I, A))).then((I) => {
              const B = S.map((G, D) => {
                const $ = {
                  file: G,
                  status: "",
                  message: "",
                  objectUrl: URL.createObjectURL(G),
                };
                return I[D] && ($.content = I[D]), $;
              });
              c(B);
            });
        } else
          DC(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 (pw(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(e6),
            C = P.map(
              (A) => (
                A.objectUrl &&
                  !A.url &&
                  A.status !== "failed" &&
                  ((A.url = A.objectUrl), i.push(A.url)),
                A.url
              )
            ).filter(Boolean);
          d = kQ(
            We(
              { images: C, startPosition: P.indexOf(S), onClose: h },
              t.previewOptions
            )
          );
        }
      },
      g = () => {
        d && d.close();
      },
      m = (S, P) => {
        const C = t.modelValue.slice(0);
        C.splice(P, 1), e("update:modelValue", C), e("delete", S, a(P));
      },
      v = (S) => {
        (s.value = !0), (o.value = S), Xe(() => E());
      },
      y = () => {
        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(
          Wte,
          st(
            {
              item: S,
              index: P,
              onClick: () =>
                e(t.reupload ? "clickReupload" : "clickPreview", S, a(P)),
              onDelete: () => m(S, P),
              onPreview: () => p(S),
              onReupload: () => v(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: xn("input"),
                  accept: t.accept,
                  capture: t.capture,
                  multiple: t.multiple && o.value === -1,
                  disabled: t.disabled,
                  onChange: f,
                  onClick: y,
                },
                null
              );
        return n.default
          ? di(
              R("div", { class: xn("input-wrapper"), onClick: b }, [
                n.default(),
                P,
              ]),
              [[pi, S]]
            )
          : di(
              R(
                "div",
                {
                  class: xn("upload", { readonly: t.readonly }),
                  style: Ll(t.previewSize),
                  onClick: b,
                },
                [
                  R(tn, { name: t.uploadIcon, class: xn("upload-icon") }, null),
                  t.uploadText &&
                    R("span", { class: xn("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: v, closeImagePreview: g }),
      Fl(() => t.modelValue),
      () =>
        R("div", { class: xn() }, [
          R("div", { class: xn("wrapper", { disabled: t.disabled }) }, [
            x(),
            w(),
          ]),
        ])
    );
  },
});
const iPe = De(Xte);
/*!
 * shared v11.1.12
 * (c) 2025 kazuya kawaguchi
 * Released under the MIT License.
 */ function _o(t, e) {
  typeof console < "u" &&
    (console.warn("[intlify] " + t), e && console.warn(e.stack));
}
const BC = {};
function Ow(t) {
  BC[t] || ((BC[t] = !0), _o(t));
}
const $i = typeof window < "u";
let Hr, ml;
{
  const t = $i && window.performance;
  t &&
    t.mark &&
    t.measure &&
    t.clearMarks &&
    t.clearMeasures &&
    ((Hr = (e) => {
      t.mark(e);
    }),
    (ml = (e, n, r) => {
      t.measure(e, n, r), t.clearMarks(n), t.clearMarks(r);
    }));
}
const Kte = /\{([0-9a-zA-Z]+)\}/g;
function qg(t, ...e) {
  return (
    e.length === 1 && ot(e[0]) && (e = e[0]),
    (!e || !e.hasOwnProperty) && (e = {}),
    t.replace(Kte, (n, r) => (e.hasOwnProperty(r) ? e[r] : ""))
  );
}
const Co = (t, e = !1) => (e ? Symbol.for(t) : Symbol(t)),
  qte = (t, e, n) => Zte({ l: t, k: e, s: n }),
  Zte = (t) =>
    JSON.stringify(t)
      .replace(/\u2028/g, "\\u2028")
      .replace(/\u2029/g, "\\u2029")
      .replace(/\u0027/g, "\\u0027"),
  fn = (t) => typeof t == "number" && isFinite(t),
  Jte = (t) => Rw(t) === "[object Date]",
  Xc = (t) => Rw(t) === "[object RegExp]",
  Zg = (t) => Ze(t) && Object.keys(t).length === 0,
  An = Object.assign,
  Qte = Object.create,
  Ct = (t = null) => Qte(t);
let kC;
const Wa = () =>
  kC ||
  (kC =
    typeof globalThis < "u"
      ? globalThis
      : typeof self < "u"
      ? self
      : typeof window < "u"
      ? window
      : typeof global < "u"
      ? global
      : Ct());
function NC(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 FC(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 ene(t) {
  return (
    (t = t.replace(/(\w+)\s*=\s*"([^"]*)"/g, (r, i, o) => `${i}="${FC(o)}"`)),
    (t = t.replace(/(\w+)\s*=\s*'([^']*)'/g, (r, i, o) => `${i}='${FC(o)}'`)),
    /\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(t) &&
      (_o(
        "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 tne = Object.prototype.hasOwnProperty;
function Mi(t, e) {
  return tne.call(t, e);
}
const Wt = Array.isArray,
  Tt = (t) => typeof t == "function",
  Ee = (t) => typeof t == "string",
  ct = (t) => typeof t == "boolean",
  ot = (t) => t !== null && typeof t == "object",
  nne = (t) => ot(t) && Tt(t.then) && Tt(t.catch),
  t6 = Object.prototype.toString,
  Rw = (t) => t6.call(t),
  Ze = (t) => Rw(t) === "[object Object]",
  rne = (t) =>
    t == null
      ? ""
      : Wt(t) || (Ze(t) && t.toString === t6)
      ? JSON.stringify(t, null, 2)
      : String(t);
function Mw(t, e = "") {
  return t.reduce((n, r, i) => (i === 0 ? n + r : n + e + r), "");
}
const LC = 2;
function ine(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 - LC; a <= s + LC || 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 Dw() {
  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 Yh = (t) => !ot(t) || Wt(t);
function Gp(t, e) {
  if (Yh(t) || Yh(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()),
        Yh(i[o]) || Yh(r[o])
          ? (i[o] = r[o])
          : n.push({ src: r[o], des: i[o] }));
    });
  }
}
/*!
 * message-compiler v11.1.12
 * (c) 2025 kazuya kawaguchi
 * Released under the MIT License.
 */ function one(t, e, n) {
  return { line: t, column: e, offset: n };
}
function p_(t, e, n) {
  const r = { start: t, end: e };
  return n != null && (r.source = n), r;
}
const Ge = {
    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,
  },
  sne = 17,
  ane = {
    [Ge.EXPECTED_TOKEN]: "Expected token: '{0}'",
    [Ge.INVALID_TOKEN_IN_PLACEHOLDER]: "Invalid token in placeholder: '{0}'",
    [Ge.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:
      "Unterminated single quote in placeholder",
    [Ge.UNKNOWN_ESCAPE_SEQUENCE]: "Unknown escape sequence: \\{0}",
    [Ge.INVALID_UNICODE_ESCAPE_SEQUENCE]:
      "Invalid unicode escape sequence: {0}",
    [Ge.UNBALANCED_CLOSING_BRACE]: "Unbalanced closing brace",
    [Ge.UNTERMINATED_CLOSING_BRACE]: "Unterminated closing brace",
    [Ge.EMPTY_PLACEHOLDER]: "Empty placeholder",
    [Ge.NOT_ALLOW_NEST_PLACEHOLDER]: "Not allowed nest placeholder",
    [Ge.INVALID_LINKED_FORMAT]: "Invalid linked format",
    [Ge.MUST_HAVE_MESSAGES_IN_PLURAL]: "Plural must have messages",
    [Ge.UNEXPECTED_EMPTY_LINKED_MODIFIER]: "Unexpected empty linked modifier",
    [Ge.UNEXPECTED_EMPTY_LINKED_KEY]: "Unexpected empty linked key",
    [Ge.UNEXPECTED_LEXICAL_ANALYSIS]:
      "Unexpected lexical analysis in token: '{0}'",
    [Ge.UNHANDLED_CODEGEN_NODE_TYPE]: "unhandled codegen node type: '{0}'",
    [Ge.UNHANDLED_MINIFIER_NODE_TYPE]: "unhandled mimifier node type: '{0}'",
  };
function xu(t, e, n = {}) {
  const { domain: r, messages: i, args: o } = n,
    s = qg((i || ane)[t] || "", ...(o || [])),
    a = new SyntaxError(String(s));
  return (a.code = t), e && (a.location = e), (a.domain = r), a;
}
function lne(t) {
  throw t;
}
const cne = /<\/?[\w\s="/.':;#-\/]+>/,
  une = (t) => cne.test(t),
  Xi = " ",
  fne = "\r",
  Xn = `
`,
  dne = String.fromCharCode(8232),
  hne = String.fromCharCode(8233);
function pne(t) {
  const e = t;
  let n = 0,
    r = 1,
    i = 1,
    o = 0;
  const s = (E) => e[E] === fne && e[E + 1] === Xn,
    a = (E) => e[E] === Xn,
    l = (E) => e[E] === hne,
    c = (E) => e[E] === dne,
    u = (E) => s(E) || a(E) || l(E) || c(E),
    f = () => n,
    d = () => r,
    h = () => i,
    p = () => o,
    g = (E) => (s(E) || l(E) || c(E) ? Xn : e[E]),
    m = () => g(n),
    v = () => g(n + o);
  function y() {
    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; ) y();
    o = 0;
  }
  return {
    index: f,
    line: d,
    column: h,
    peekOffset: p,
    charAt: g,
    currentChar: m,
    currentPeek: v,
    next: y,
    peek: _,
    reset: x,
    resetPeek: b,
    skipToPeek: w,
  };
}
const Io = void 0,
  gne = ".",
  $C = "'",
  mne = "tokenizer";
function vne(t, e = {}) {
  const n = e.location !== !1,
    r = pne(t),
    i = () => r.index(),
    o = () => one(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, N, H, ...q) {
    const le = c();
    if (((N.column += H), (N.offset += H), u)) {
      const ye = n ? p_(le.startLoc, N) : null,
        he = xu(M, ye, { domain: mne, args: q });
      u(he);
    }
  }
  function d(M, N, H) {
    (M.endLoc = o()), (M.currentType = N);
    const q = { type: N };
    return (
      n && (q.loc = p_(M.startLoc, M.endLoc)), H != null && (q.value = H), q
    );
  }
  const h = (M) => d(M, 13);
  function p(M, N) {
    return M.currentChar() === N
      ? (M.next(), N)
      : (f(Ge.EXPECTED_TOKEN, o(), 0, N), "");
  }
  function g(M) {
    let N = "";
    for (; M.currentPeek() === Xi || M.currentPeek() === Xn; )
      (N += M.currentPeek()), M.peek();
    return N;
  }
  function m(M) {
    const N = g(M);
    return M.skipToPeek(), N;
  }
  function v(M) {
    if (M === Io) return !1;
    const N = M.charCodeAt(0);
    return (N >= 97 && N <= 122) || (N >= 65 && N <= 90) || N === 95;
  }
  function y(M) {
    if (M === Io) return !1;
    const N = M.charCodeAt(0);
    return N >= 48 && N <= 57;
  }
  function _(M, N) {
    const { currentType: H } = N;
    if (H !== 2) return !1;
    g(M);
    const q = v(M.currentPeek());
    return M.resetPeek(), q;
  }
  function x(M, N) {
    const { currentType: H } = N;
    if (H !== 2) return !1;
    g(M);
    const q = M.currentPeek() === "-" ? M.peek() : M.currentPeek(),
      le = y(q);
    return M.resetPeek(), le;
  }
  function b(M, N) {
    const { currentType: H } = N;
    if (H !== 2) return !1;
    g(M);
    const q = M.currentPeek() === $C;
    return M.resetPeek(), q;
  }
  function w(M, N) {
    const { currentType: H } = N;
    if (H !== 7) return !1;
    g(M);
    const q = M.currentPeek() === ".";
    return M.resetPeek(), q;
  }
  function E(M, N) {
    const { currentType: H } = N;
    if (H !== 8) return !1;
    g(M);
    const q = v(M.currentPeek());
    return M.resetPeek(), q;
  }
  function S(M, N) {
    const { currentType: H } = N;
    if (!(H === 7 || H === 11)) return !1;
    g(M);
    const q = M.currentPeek() === ":";
    return M.resetPeek(), q;
  }
  function P(M, N) {
    const { currentType: H } = N;
    if (H !== 9) return !1;
    const q = () => {
        const ye = M.currentPeek();
        return ye === "{"
          ? v(M.peek())
          : ye === "@" ||
            ye === "|" ||
            ye === ":" ||
            ye === "." ||
            ye === Xi ||
            !ye
          ? !1
          : ye === Xn
          ? (M.peek(), q())
          : A(M, !1);
      },
      le = q();
    return M.resetPeek(), le;
  }
  function C(M) {
    g(M);
    const N = M.currentPeek() === "|";
    return M.resetPeek(), N;
  }
  function A(M, N = !0) {
    const H = (le = !1, ye = "") => {
        const he = M.currentPeek();
        return he === "{" || he === "@" || !he
          ? le
          : he === "|"
          ? !(ye === Xi || ye === Xn)
          : he === Xi
          ? (M.peek(), H(!0, Xi))
          : he === Xn
          ? (M.peek(), H(!0, Xn))
          : !0;
      },
      q = H();
    return N && M.resetPeek(), q;
  }
  function T(M, N) {
    const H = M.currentChar();
    return H === Io ? Io : N(H) ? (M.next(), H) : null;
  }
  function I(M) {
    const N = M.charCodeAt(0);
    return (
      (N >= 97 && N <= 122) ||
      (N >= 65 && N <= 90) ||
      (N >= 48 && N <= 57) ||
      N === 95 ||
      N === 36
    );
  }
  function B(M) {
    return T(M, I);
  }
  function G(M) {
    const N = M.charCodeAt(0);
    return (
      (N >= 97 && N <= 122) ||
      (N >= 65 && N <= 90) ||
      (N >= 48 && N <= 57) ||
      N === 95 ||
      N === 36 ||
      N === 45
    );
  }
  function D(M) {
    return T(M, G);
  }
  function $(M) {
    const N = M.charCodeAt(0);
    return N >= 48 && N <= 57;
  }
  function z(M) {
    return T(M, $);
  }
  function K(M) {
    const N = M.charCodeAt(0);
    return (
      (N >= 48 && N <= 57) || (N >= 65 && N <= 70) || (N >= 97 && N <= 102)
    );
  }
  function fe(M) {
    return T(M, K);
  }
  function se(M) {
    let N = "",
      H = "";
    for (; (N = z(M)); ) H += N;
    return H;
  }
  function Y(M) {
    let N = "";
    for (;;) {
      const H = M.currentChar();
      if (H === "{" || H === "}" || H === "@" || H === "|" || !H) break;
      if (H === Xi || H === Xn)
        if (A(M)) (N += H), M.next();
        else {
          if (C(M)) break;
          (N += H), M.next();
        }
      else (N += H), M.next();
    }
    return N;
  }
  function te(M) {
    m(M);
    let N = "",
      H = "";
    for (; (N = D(M)); ) H += N;
    const q = M.currentChar();
    if (q && q !== "}" && q !== Io && q !== Xi && q !== Xn && q !== "　") {
      const le = de(M);
      return f(Ge.INVALID_TOKEN_IN_PLACEHOLDER, o(), 0, H + le), H + le;
    }
    return (
      M.currentChar() === Io && f(Ge.UNTERMINATED_CLOSING_BRACE, o(), 0), H
    );
  }
  function pe(M) {
    m(M);
    let N = "";
    return (
      M.currentChar() === "-" ? (M.next(), (N += `-${se(M)}`)) : (N += se(M)),
      M.currentChar() === Io && f(Ge.UNTERMINATED_CLOSING_BRACE, o(), 0),
      N
    );
  }
  function F(M) {
    return M !== $C && M !== Xn;
  }
  function J(M) {
    m(M), p(M, "'");
    let N = "",
      H = "";
    for (; (N = T(M, F)); ) N === "\\" ? (H += L(M)) : (H += N);
    const q = M.currentChar();
    return q === Xn || q === Io
      ? (f(Ge.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, o(), 0),
        q === Xn && (M.next(), p(M, "'")),
        H)
      : (p(M, "'"), H);
  }
  function L(M) {
    const N = M.currentChar();
    switch (N) {
      case "\\":
      case "'":
        return M.next(), `\\${N}`;
      case "u":
        return ne(M, N, 4);
      case "U":
        return ne(M, N, 6);
      default:
        return f(Ge.UNKNOWN_ESCAPE_SEQUENCE, o(), 0, N), "";
    }
  }
  function ne(M, N, H) {
    p(M, N);
    let q = "";
    for (let le = 0; le < H; le++) {
      const ye = fe(M);
      if (!ye) {
        f(
          Ge.INVALID_UNICODE_ESCAPE_SEQUENCE,
          o(),
          0,
          `\\${N}${q}${M.currentChar()}`
        );
        break;
      }
      q += ye;
    }
    return `\\${N}${q}`;
  }
  function ee(M) {
    return M !== "{" && M !== "}" && M !== Xi && M !== Xn;
  }
  function de(M) {
    m(M);
    let N = "",
      H = "";
    for (; (N = T(M, ee)); ) H += N;
    return H;
  }
  function ge(M) {
    let N = "",
      H = "";
    for (; (N = B(M)); ) H += N;
    return H;
  }
  function xe(M) {
    const N = (H) => {
      const q = M.currentChar();
      return q === "{" ||
        q === "@" ||
        q === "|" ||
        q === "(" ||
        q === ")" ||
        !q ||
        q === Xi
        ? H
        : ((H += q), M.next(), N(H));
    };
    return N("");
  }
  function O(M) {
    m(M);
    const N = p(M, "|");
    return m(M), N;
  }
  function U(M, N) {
    let H = null;
    switch (M.currentChar()) {
      case "{":
        return (
          N.braceNest >= 1 && f(Ge.NOT_ALLOW_NEST_PLACEHOLDER, o(), 0),
          M.next(),
          (H = d(N, 2, "{")),
          m(M),
          N.braceNest++,
          H
        );
      case "}":
        return (
          N.braceNest > 0 &&
            N.currentType === 2 &&
            f(Ge.EMPTY_PLACEHOLDER, o(), 0),
          M.next(),
          (H = d(N, 3, "}")),
          N.braceNest--,
          N.braceNest > 0 && m(M),
          N.inLinked && N.braceNest === 0 && (N.inLinked = !1),
          H
        );
      case "@":
        return (
          N.braceNest > 0 && f(Ge.UNTERMINATED_CLOSING_BRACE, o(), 0),
          (H = W(M, N) || h(N)),
          (N.braceNest = 0),
          H
        );
      default: {
        let le = !0,
          ye = !0,
          he = !0;
        if (C(M))
          return (
            N.braceNest > 0 && f(Ge.UNTERMINATED_CLOSING_BRACE, o(), 0),
            (H = d(N, 1, O(M))),
            (N.braceNest = 0),
            (N.inLinked = !1),
            H
          );
        if (
          N.braceNest > 0 &&
          (N.currentType === 4 || N.currentType === 5 || N.currentType === 6)
        )
          return (
            f(Ge.UNTERMINATED_CLOSING_BRACE, o(), 0),
            (N.braceNest = 0),
            ce(M, N)
          );
        if ((le = _(M, N))) return (H = d(N, 4, te(M))), m(M), H;
        if ((ye = x(M, N))) return (H = d(N, 5, pe(M))), m(M), H;
        if ((he = b(M, N))) return (H = d(N, 6, J(M))), m(M), H;
        if (!le && !ye && !he)
          return (
            (H = d(N, 12, de(M))),
            f(Ge.INVALID_TOKEN_IN_PLACEHOLDER, o(), 0, H.value),
            m(M),
            H
          );
        break;
      }
    }
    return H;
  }
  function W(M, N) {
    const { currentType: H } = N;
    let q = null;
    const le = M.currentChar();
    switch (
      ((H === 7 || H === 8 || H === 11 || H === 9) &&
        (le === Xn || le === Xi) &&
        f(Ge.INVALID_LINKED_FORMAT, o(), 0),
      le)
    ) {
      case "@":
        return M.next(), (q = d(N, 7, "@")), (N.inLinked = !0), q;
      case ".":
        return m(M), M.next(), d(N, 8, ".");
      case ":":
        return m(M), M.next(), d(N, 9, ":");
      default:
        return C(M)
          ? ((q = d(N, 1, O(M))), (N.braceNest = 0), (N.inLinked = !1), q)
          : w(M, N) || S(M, N)
          ? (m(M), W(M, N))
          : E(M, N)
          ? (m(M), d(N, 11, ge(M)))
          : P(M, N)
          ? (m(M), le === "{" ? U(M, N) || q : d(N, 10, xe(M)))
          : (H === 7 && f(Ge.INVALID_LINKED_FORMAT, o(), 0),
            (N.braceNest = 0),
            (N.inLinked = !1),
            ce(M, N));
    }
  }
  function ce(M, N) {
    let H = { type: 13 };
    if (N.braceNest > 0) return U(M, N) || h(N);
    if (N.inLinked) return W(M, N) || h(N);
    switch (M.currentChar()) {
      case "{":
        return U(M, N) || h(N);
      case "}":
        return f(Ge.UNBALANCED_CLOSING_BRACE, o(), 0), M.next(), d(N, 3, "}");
      case "@":
        return W(M, N) || h(N);
      default: {
        if (C(M))
          return (H = d(N, 1, O(M))), (N.braceNest = 0), (N.inLinked = !1), H;
        if (A(M)) return d(N, 0, Y(M));
        break;
      }
    }
    return H;
  }
  function ue() {
    const { currentType: M, offset: N, startLoc: H, endLoc: q } = l;
    return (
      (l.lastType = M),
      (l.lastOffset = N),
      (l.lastStartLoc = H),
      (l.lastEndLoc = q),
      (l.offset = i()),
      (l.startLoc = o()),
      r.currentChar() === Io ? d(l, 13) : ce(r, l)
    );
  }
  return { nextToken: ue, currentOffset: i, currentPosition: o, context: c };
}
const yne = "parser",
  _ne = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;
function xne(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 bne(t = {}) {
  const e = t.location !== !1,
    { onError: n } = t;
  function r(v, y, _, x, ...b) {
    const w = v.currentPosition();
    if (((w.offset += x), (w.column += x), n)) {
      const E = e ? p_(_, w) : null,
        S = xu(y, E, { domain: yne, args: b });
      n(S);
    }
  }
  function i(v, y, _) {
    const x = { type: v };
    return e && ((x.start = y), (x.end = y), (x.loc = { start: _, end: _ })), x;
  }
  function o(v, y, _, x) {
    e && ((v.end = y), v.loc && (v.loc.end = _));
  }
  function s(v, y) {
    const _ = v.context(),
      x = i(3, _.offset, _.startLoc);
    return (x.value = y), o(x, v.currentOffset(), v.currentPosition()), x;
  }
  function a(v, y) {
    const _ = v.context(),
      { lastOffset: x, lastStartLoc: b } = _,
      w = i(5, x, b);
    return (
      (w.index = parseInt(y, 10)),
      v.nextToken(),
      o(w, v.currentOffset(), v.currentPosition()),
      w
    );
  }
  function l(v, y) {
    const _ = v.context(),
      { lastOffset: x, lastStartLoc: b } = _,
      w = i(4, x, b);
    return (
      (w.key = y),
      v.nextToken(),
      o(w, v.currentOffset(), v.currentPosition()),
      w
    );
  }
  function c(v, y) {
    const _ = v.context(),
      { lastOffset: x, lastStartLoc: b } = _,
      w = i(9, x, b);
    return (
      (w.value = y.replace(_ne, xne)),
      v.nextToken(),
      o(w, v.currentOffset(), v.currentPosition()),
      w
    );
  }
  function u(v) {
    const y = v.nextToken(),
      _ = v.context(),
      { lastOffset: x, lastStartLoc: b } = _,
      w = i(8, x, b);
    return y.type !== 11
      ? (r(v, Ge.UNEXPECTED_EMPTY_LINKED_MODIFIER, _.lastStartLoc, 0),
        (w.value = ""),
        o(w, x, b),
        { nextConsumeToken: y, node: w })
      : (y.value == null &&
          r(v, Ge.UNEXPECTED_LEXICAL_ANALYSIS, _.lastStartLoc, 0, Ki(y)),
        (w.value = y.value || ""),
        o(w, v.currentOffset(), v.currentPosition()),
        { node: w });
  }
  function f(v, y) {
    const _ = v.context(),
      x = i(7, _.offset, _.startLoc);
    return (x.value = y), o(x, v.currentOffset(), v.currentPosition()), x;
  }
  function d(v) {
    const y = v.context(),
      _ = i(6, y.offset, y.startLoc);
    let x = v.nextToken();
    if (x.type === 8) {
      const b = u(v);
      (_.modifier = b.node), (x = b.nextConsumeToken || v.nextToken());
    }
    switch (
      (x.type !== 9 &&
        r(v, Ge.UNEXPECTED_LEXICAL_ANALYSIS, y.lastStartLoc, 0, Ki(x)),
      (x = v.nextToken()),
      x.type === 2 && (x = v.nextToken()),
      x.type)
    ) {
      case 10:
        x.value == null &&
          r(v, Ge.UNEXPECTED_LEXICAL_ANALYSIS, y.lastStartLoc, 0, Ki(x)),
          (_.key = f(v, x.value || ""));
        break;
      case 4:
        x.value == null &&
          r(v, Ge.UNEXPECTED_LEXICAL_ANALYSIS, y.lastStartLoc, 0, Ki(x)),
          (_.key = l(v, x.value || ""));
        break;
      case 5:
        x.value == null &&
          r(v, Ge.UNEXPECTED_LEXICAL_ANALYSIS, y.lastStartLoc, 0, Ki(x)),
          (_.key = a(v, x.value || ""));
        break;
      case 6:
        x.value == null &&
          r(v, Ge.UNEXPECTED_LEXICAL_ANALYSIS, y.lastStartLoc, 0, Ki(x)),
          (_.key = c(v, x.value || ""));
        break;
      default: {
        r(v, Ge.UNEXPECTED_EMPTY_LINKED_KEY, y.lastStartLoc, 0);
        const b = v.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(_, v.currentOffset(), v.currentPosition()), { node: _ };
  }
  function h(v) {
    const y = v.context(),
      _ = y.currentType === 1 ? v.currentOffset() : y.offset,
      x = y.currentType === 1 ? y.endLoc : y.startLoc,
      b = i(2, _, x);
    b.items = [];
    let w = null;
    do {
      const P = w || v.nextToken();
      switch (((w = null), P.type)) {
        case 0:
          P.value == null &&
            r(v, Ge.UNEXPECTED_LEXICAL_ANALYSIS, y.lastStartLoc, 0, Ki(P)),
            b.items.push(s(v, P.value || ""));
          break;
        case 5:
          P.value == null &&
            r(v, Ge.UNEXPECTED_LEXICAL_ANALYSIS, y.lastStartLoc, 0, Ki(P)),
            b.items.push(a(v, P.value || ""));
          break;
        case 4:
          P.value == null &&
            r(v, Ge.UNEXPECTED_LEXICAL_ANALYSIS, y.lastStartLoc, 0, Ki(P)),
            b.items.push(l(v, P.value || ""));
          break;
        case 6:
          P.value == null &&
            r(v, Ge.UNEXPECTED_LEXICAL_ANALYSIS, y.lastStartLoc, 0, Ki(P)),
            b.items.push(c(v, P.value || ""));
          break;
        case 7: {
          const C = d(v);
          b.items.push(C.node), (w = C.nextConsumeToken || null);
          break;
        }
      }
    } while (y.currentType !== 13 && y.currentType !== 1);
    const E = y.currentType === 1 ? y.lastOffset : v.currentOffset(),
      S = y.currentType === 1 ? y.lastEndLoc : v.currentPosition();
    return o(b, E, S), b;
  }
  function p(v, y, _, x) {
    const b = v.context();
    let w = x.items.length === 0;
    const E = i(1, y, _);
    (E.cases = []), E.cases.push(x);
    do {
      const S = h(v);
      w || (w = S.items.length === 0), E.cases.push(S);
    } while (b.currentType !== 13);
    return (
      w && r(v, Ge.MUST_HAVE_MESSAGES_IN_PLURAL, _, 0),
      o(E, v.currentOffset(), v.currentPosition()),
      E
    );
  }
  function g(v) {
    const y = v.context(),
      { offset: _, startLoc: x } = y,
      b = h(v);
    return y.currentType === 13 ? b : p(v, _, x, b);
  }
  function m(v) {
    const y = vne(v, An({}, t)),
      _ = y.context(),
      x = i(0, _.offset, _.startLoc);
    return (
      e && x.loc && (x.loc.source = v),
      (x.body = g(y)),
      t.onCacheKey && (x.cacheKey = t.onCacheKey(v)),
      _.currentType !== 13 &&
        r(
          y,
          Ge.UNEXPECTED_LEXICAL_ANALYSIS,
          _.lastStartLoc,
          0,
          v[_.offset] || ""
        ),
      o(x, y.currentOffset(), y.currentPosition()),
      x
    );
  }
  return { parse: m };
}
function Ki(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 wne(t, e = {}) {
  const n = { ast: t, helpers: new Set() };
  return { context: () => n, helper: (o) => (n.helpers.add(o), o) };
}
function UC(t, e) {
  for (let n = 0; n < t.length; n++) Bw(t[n], e);
}
function Bw(t, e) {
  switch (t.type) {
    case 1:
      UC(t.cases, e), e.helper("plural");
      break;
    case 2:
      UC(t.items, e);
      break;
    case 6: {
      Bw(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 Ene(t, e = {}) {
  const n = wne(t);
  n.helper("normalize"), t.body && Bw(t.body, n);
  const r = n.context();
  t.helpers = Array.from(r.helpers);
}
function Sne(t) {
  const e = t.body;
  return e.type === 2 ? GC(e) : e.cases.forEach((n) => GC(n)), t;
}
function GC(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 = Mw(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 Cne = "minifier";
function pc(t) {
  switch (((t.t = t.type), t.type)) {
    case 0: {
      const e = t;
      pc(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++) pc(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++) pc(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;
      pc(e.key),
        (e.k = e.key),
        delete e.key,
        e.modifier && (pc(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 xu(Ge.UNHANDLED_MINIFIER_NODE_TYPE, null, {
        domain: Cne,
        args: [t.type],
      });
  }
  delete t.type;
}
const Ane = "parser";
function Tne(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(m, v) {
    a.code += m;
  }
  function u(m, v = !0) {
    const y = v ? i : "";
    c(o ? y + "  ".repeat(m) : y);
  }
  function f(m = !0) {
    const v = ++a.indentLevel;
    m && u(v);
  }
  function d(m = !0) {
    const v = --a.indentLevel;
    m && u(v);
  }
  function h() {
    u(a.indentLevel);
  }
  return {
    context: l,
    push: c,
    indent: f,
    deindent: d,
    newline: h,
    helper: (m) => `_${m}`,
    needIndent: () => a.needIndent,
  };
}
function Pne(t, e) {
  const { helper: n } = t;
  t.push(`${n("linked")}(`),
    Kc(t, e.key),
    e.modifier
      ? (t.push(", "), Kc(t, e.modifier), t.push(", _type"))
      : t.push(", undefined, _type"),
    t.push(")");
}
function Ine(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 && (Kc(t, e.items[o]), o !== i - 1); o++) t.push(", ");
  t.deindent(r()), t.push("])");
}
function One(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 && (Kc(t, e.cases[o]), o !== i - 1); o++)
      t.push(", ");
    t.deindent(r()), t.push("])");
  }
}
function Rne(t, e) {
  e.body ? Kc(t, e.body) : t.push("null");
}
function Kc(t, e) {
  const { helper: n } = t;
  switch (e.type) {
    case 0:
      Rne(t, e);
      break;
    case 1:
      One(t, e);
      break;
    case 2:
      Ine(t, e);
      break;
    case 6:
      Pne(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 xu(Ge.UNHANDLED_CODEGEN_NODE_TYPE, null, {
        domain: Ane,
        args: [e.type],
      });
  }
}
const Mne = (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 = Tne(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 { ${Mw(
          a.map((f) => `${f}: _${f}`),
          ", "
        )} } = ctx`
      ),
      l.newline()),
    l.push("return "),
    Kc(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 Dne(t, e = {}) {
  const n = An({}, e),
    r = !!n.jit,
    i = !!n.minify,
    o = n.optimize == null ? !0 : n.optimize,
    a = bne(n).parse(t);
  return r
    ? (o && Sne(a), i && pc(a), { ast: a, code: "" })
    : (Ene(a, n), Mne(a, n));
}
/*!
 * core-base v11.1.12
 * (c) 2025 kazuya kawaguchi
 * Released under the MIT License.
 */ function Bne() {
  typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" &&
    (Wa().__INTLIFY_PROD_DEVTOOLS__ = !1),
    typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" &&
      (Wa().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1);
}
function gi(t) {
  return ot(t) && kw(t) === 0 && (Mi(t, "b") || Mi(t, "body"));
}
const n6 = ["b", "body"];
function kne(t) {
  return ga(t, n6);
}
const r6 = ["c", "cases"];
function Nne(t) {
  return ga(t, r6, []);
}
const i6 = ["s", "static"];
function Fne(t) {
  return ga(t, i6);
}
const o6 = ["i", "items"];
function Lne(t) {
  return ga(t, o6, []);
}
const s6 = ["t", "type"];
function kw(t) {
  return ga(t, s6);
}
const a6 = ["v", "value"];
function Xh(t, e) {
  const n = ga(t, a6);
  if (n != null) return n;
  throw ld(e);
}
const l6 = ["m", "modifier"];
function $ne(t) {
  return ga(t, l6);
}
const c6 = ["k", "key"];
function Une(t) {
  const e = ga(t, c6);
  if (e) return e;
  throw ld(6);
}
function ga(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 u6 = [...n6, ...r6, ...i6, ...o6, ...c6, ...l6, ...a6, ...s6];
function ld(t) {
  return new Error(`unhandled node type: ${t}`);
}
function f1(t) {
  return (n) => Gne(n, t);
}
function Gne(t, e) {
  const n = kne(e);
  if (n == null) throw ld(0);
  if (kw(n) === 1) {
    const o = Nne(n);
    return t.plural(o.reduce((s, a) => [...s, HC(t, a)], []));
  } else return HC(t, n);
}
function HC(t, e) {
  const n = Fne(e);
  if (n != null) return t.type === "text" ? n : t.normalize([n]);
  {
    const r = Lne(e).reduce((i, o) => [...i, g_(t, o)], []);
    return t.normalize(r);
  }
}
function g_(t, e) {
  const n = kw(e);
  switch (n) {
    case 3:
      return Xh(e, n);
    case 9:
      return Xh(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 ld(n);
    }
    case 5: {
      const r = e;
      if (Mi(r, "i") && fn(r.i)) return t.interpolate(t.list(r.i));
      if (Mi(r, "index") && fn(r.index)) return t.interpolate(t.list(r.index));
      throw ld(n);
    }
    case 6: {
      const r = e,
        i = $ne(r),
        o = Une(r);
      return t.linked(g_(t, o), i ? g_(t, i) : void 0, t.type);
    }
    case 7:
      return Xh(e, n);
    case 8:
      return Xh(e, n);
    default:
      throw new Error(`unhandled node on format message part: ${n}`);
  }
}
const Hne =
  "Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";
function Vne(t, e) {
  e && une(t) && _o(qg(Hne, { source: t }));
}
const zne = (t) => t;
let Kh = Ct();
function jne(t, e = {}) {
  let n = !1;
  const r = e.onError || lne;
  return (
    (e.onError = (i) => {
      (n = !0), r(i);
    }),
    { ...Dne(t, e), detectError: n }
  );
}
function Wne(t, e) {
  if (!__INTLIFY_DROP_MESSAGE_COMPILER__ && Ee(t)) {
    const n = ct(e.warnHtmlMessage) ? e.warnHtmlMessage : !0;
    Vne(t, n);
    const i = (e.onCacheKey || zne)(t),
      o = Kh[i];
    if (o) return o;
    const { ast: s, detectError: a } = jne(t, { ...e, location: !0, jit: !0 }),
      l = f1(s);
    return a ? l : (Kh[i] = l);
  } else {
    if (!gi(t))
      return (
        _o(
          `the message that is resolve with key '${e.key}' is not supported for jit compilation`
        ),
        () => t
      );
    const n = t.cacheKey;
    if (n) {
      const r = Kh[n];
      return r || (Kh[n] = f1(t));
    } else return f1(t);
  }
}
let cd = null;
function Yne(t) {
  cd = t;
}
function Xne(t, e, n) {
  cd &&
    cd.emit("i18n:init", {
      timestamp: Date.now(),
      i18n: t,
      version: e,
      meta: n,
    });
}
const Kne = qne("function:translate");
function qne(t) {
  return (e) => cd && cd.emit(t, e);
}
const Zn = {
    INVALID_ARGUMENT: sne,
    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,
  },
  Zne = 24;
function Wo(t) {
  return xu(t, null, { messages: Jne });
}
const Jne = {
  [Zn.INVALID_ARGUMENT]: "Invalid arguments",
  [Zn.INVALID_DATE_ARGUMENT]:
    "The date provided is an invalid Date object.Make sure your Date represents a valid date.",
  [Zn.INVALID_ISO_DATE_ARGUMENT]:
    "The argument provided is not a valid ISO date string",
  [Zn.NOT_SUPPORT_NON_STRING_MESSAGE]: "Not support non-string message",
  [Zn.NOT_SUPPORT_LOCALE_PROMISE_VALUE]: "cannot support promise value",
  [Zn.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]: "cannot support async function",
  [Zn.NOT_SUPPORT_LOCALE_TYPE]: "cannot support locale type",
};
function Nw(t, e) {
  return e.locale != null ? VC(e.locale) : VC(t.locale);
}
let d1;
function VC(t) {
  if (Ee(t)) return t;
  if (Tt(t)) {
    if (t.resolvedOnce && d1 != null) return d1;
    if (t.constructor.name === "Function") {
      const e = t();
      if (nne(e)) throw Wo(Zn.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
      return (d1 = e);
    } else throw Wo(Zn.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
  } else throw Wo(Zn.NOT_SUPPORT_LOCALE_TYPE);
}
function Qne(t, e, n) {
  return [
    ...new Set([
      n,
      ...(Wt(e) ? e : ot(e) ? Object.keys(e) : Ee(e) ? [e] : [n]),
    ]),
  ];
}
function f6(t, e, n) {
  const r = Ee(n) ? n : ud,
    i = t;
  i.__localeChainCache || (i.__localeChainCache = new Map());
  let o = i.__localeChainCache.get(r);
  if (!o) {
    o = [];
    let s = [n];
    for (; Wt(s); ) s = zC(o, s, e);
    const a = Wt(e) || !Ze(e) ? e : e.default ? e.default : null;
    (s = Ee(a) ? [a] : a),
      Wt(s) && zC(o, s, !1),
      i.__localeChainCache.set(r, o);
  }
  return o;
}
function zC(t, e, n) {
  let r = !0;
  for (let i = 0; i < e.length && ct(r); i++) {
    const o = e[i];
    Ee(o) && (r = ere(t, e[i], n));
  }
  return r;
}
function ere(t, e, n) {
  let r;
  const i = e.split("-");
  do {
    const o = i.join("-");
    (r = tre(t, o, n)), i.splice(-1, 1);
  } while (i.length && r === !0);
  return r;
}
function tre(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 ma = [];
ma[0] = { w: [0], i: [3, 0], "[": [4], o: [7] };
ma[1] = { w: [1], ".": [2], "[": [4], o: [7] };
ma[2] = { w: [2], i: [3, 0], 0: [3, 0] };
ma[3] = {
  i: [3, 0],
  0: [3, 0],
  w: [1, 1],
  ".": [2, 1],
  "[": [4, 1],
  o: [7, 1],
};
ma[4] = { "'": [5, 0], '"': [6, 0], "[": [4, 2], "]": [1, 3], o: 8, l: [4, 0] };
ma[5] = { "'": [4, 0], o: 8, l: [5, 0] };
ma[6] = { '"': [4, 0], o: 8, l: [6, 0] };
const nre = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
function rre(t) {
  return nre.test(t);
}
function ire(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 ore(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 sre(t) {
  const e = t.trim();
  return t.charAt(0) === "0" && isNaN(parseInt(t))
    ? !1
    : rre(e)
    ? ire(e)
    : "*" + e;
}
function are(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 = sre(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 = ore(o)),
        (f = ma[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 jC = new Map();
function lre(t, e) {
  return ot(t) ? t[e] : null;
}
function cre(t, e) {
  if (!ot(t)) return null;
  let n = jC.get(e);
  if ((n || ((n = are(e)), n && jC.set(e, n)), !n)) return null;
  const r = n.length;
  let i = t,
    o = 0;
  for (; o < r; ) {
    const s = n[o];
    if (u6.includes(s) && gi(i)) return null;
    const a = i[s];
    if (a === void 0 || Tt(i)) return null;
    (i = a), o++;
  }
  return i;
}
const wr = {
    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,
  },
  ure = 8,
  fre = {
    [wr.NOT_FOUND_KEY]: "Not found '{key}' key in '{locale}' locale messages.",
    [wr.FALLBACK_TO_TRANSLATE]:
      "Fall back to translate '{key}' key with '{target}' locale.",
    [wr.CANNOT_FORMAT_NUMBER]:
      "Cannot format a number value due to not supported Intl.NumberFormat.",
    [wr.FALLBACK_TO_NUMBER_FORMAT]:
      "Fall back to number format '{key}' key with '{target}' locale.",
    [wr.CANNOT_FORMAT_DATE]:
      "Cannot format a date value due to not supported Intl.DateTimeFormat.",
    [wr.FALLBACK_TO_DATE_FORMAT]:
      "Fall back to datetime format '{key}' key with '{target}' locale.",
    [wr.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 vl(t, ...e) {
  return qg(fre[t], ...e);
}
const dre = "11.1.12",
  Jg = -1,
  ud = "en-US",
  C0 = "",
  WC = (t) => `${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;
function hre() {
  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)
        ? WC(t)
        : e === "vnode" && ot(t) && "__v_isVNode" in t
        ? WC(t.children)
        : t,
  };
}
let d6;
function pre(t) {
  d6 = t;
}
let h6;
function gre(t) {
  h6 = t;
}
let p6;
function mre(t) {
  p6 = t;
}
let g6 = null;
const vre = (t) => {
    g6 = t;
  },
  yre = () => g6;
let m6 = null;
const YC = (t) => {
    m6 = t;
  },
  _re = () => m6;
let XC = 0;
function xre(t = {}) {
  const e = Tt(t.onWarn) ? t.onWarn : _o,
    n = Ee(t.version) ? t.version : dre,
    r = Ee(t.locale) || Tt(t.locale) ? t.locale : ud,
    i = Tt(r) ? ud : r,
    o =
      Wt(t.fallbackLocale) ||
      Ze(t.fallbackLocale) ||
      Ee(t.fallbackLocale) ||
      t.fallbackLocale === !1
        ? t.fallbackLocale
        : i,
    s = Ze(t.messages) ? t.messages : h1(i),
    a = Ze(t.datetimeFormats) ? t.datetimeFormats : h1(i),
    l = Ze(t.numberFormats) ? t.numberFormats : h1(i),
    c = An(Ct(), t.modifiers, hre()),
    u = t.pluralRules || Ct(),
    f = Tt(t.missing) ? t.missing : null,
    d = ct(t.missingWarn) || Xc(t.missingWarn) ? t.missingWarn : !0,
    h = ct(t.fallbackWarn) || Xc(t.fallbackWarn) ? t.fallbackWarn : !0,
    p = !!t.fallbackFormat,
    g = !!t.unresolving,
    m = Tt(t.postTranslation) ? t.postTranslation : null,
    v = Ze(t.processor) ? t.processor : null,
    y = ct(t.warnHtmlMessage) ? t.warnHtmlMessage : !0,
    _ = !!t.escapeParameter,
    x = Tt(t.messageCompiler) ? t.messageCompiler : d6;
  Tt(t.messageCompiler) && Ow(vl(wr.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));
  const b = Tt(t.messageResolver) ? t.messageResolver : h6 || lre,
    w = Tt(t.localeFallbacker) ? t.localeFallbacker : p6 || Qne,
    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 : {};
  XC++;
  const T = {
    version: n,
    cid: XC,
    locale: r,
    fallbackLocale: o,
    messages: s,
    modifiers: c,
    pluralRules: u,
    missing: f,
    missingWarn: d,
    fallbackWarn: h,
    fallbackFormat: p,
    unresolving: g,
    postTranslation: m,
    processor: v,
    warnHtmlMessage: y,
    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),
    Xne(T, n, A),
    T
  );
}
const h1 = (t) => ({ [t]: Ct() });
function Qg(t, e) {
  return t instanceof RegExp ? t.test(e) : t;
}
function v6(t, e) {
  return t instanceof RegExp ? t.test(e) : t;
}
function Fw(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 v6(r, e) && s(vl(wr.NOT_FOUND_KEY, { key: e, locale: n })), e;
}
function Gu(t, e, n) {
  const r = t;
  (r.__localeChainCache = new Map()), t.localeFallbacker(t, n, e);
}
function y6(t, e) {
  return t === e ? !1 : t.split("-")[0] === e.split("-")[0];
}
function bre(t, e) {
  const n = e.indexOf(t);
  if (n === -1) return !1;
  for (let r = n + 1; r < e.length; r++) if (y6(t, e[r])) return !0;
  return !1;
}
const KC = typeof Intl < "u",
  _6 = {
    dateTimeFormat: KC && typeof Intl.DateTimeFormat < "u",
    numberFormat: KC && typeof Intl.NumberFormat < "u",
  };
function qC(t, ...e) {
  const {
      datetimeFormats: n,
      unresolving: r,
      fallbackLocale: i,
      onWarn: o,
      localeFallbacker: s,
    } = t,
    { __datetimeFormatters: a } = t;
  if (!_6.dateTimeFormat) return o(vl(wr.CANNOT_FORMAT_DATE)), C0;
  const [l, c, u, f] = m_(...e),
    d = ct(u.missingWarn) ? u.missingWarn : t.missingWarn,
    h = ct(u.fallbackWarn) ? u.fallbackWarn : t.fallbackWarn,
    p = !!u.part,
    g = Nw(t, u),
    m = s(t, i, g);
  if (!Ee(l) || l === "") return new Intl.DateTimeFormat(g, f).format(c);
  let v = {},
    y,
    _ = null,
    x = g,
    b = null;
  const w = "datetime format";
  for (let P = 0; P < m.length; P++) {
    if (
      ((y = b = m[P]),
      g !== y &&
        Qg(h, l) &&
        o(vl(wr.FALLBACK_TO_DATE_FORMAT, { key: l, target: y })),
      g !== y)
    ) {
      const C = t.__v_emitter;
      C &&
        C.emit("fallback", {
          type: w,
          key: l,
          from: x,
          to: b,
          groupId: `${w}:${l}`,
        });
    }
    if (((v = n[y] || {}), (_ = v[l]), Ze(_))) break;
    Fw(t, l, y, d, w), (x = b);
  }
  if (!Ze(_) || !Ee(y)) return r ? Jg : l;
  let E = `${y}__${l}`;
  Zg(f) || (E = `${E}__${JSON.stringify(f)}`);
  let S = a.get(E);
  return (
    S || ((S = new Intl.DateTimeFormat(y, An({}, _, f))), a.set(E, S)),
    p ? S.formatToParts(c) : S.format(c)
  );
}
const x6 = [
  "localeMatcher",
  "weekday",
  "era",
  "year",
  "month",
  "day",
  "hour",
  "minute",
  "second",
  "timeZoneName",
  "formatMatcher",
  "hour12",
  "timeZone",
  "dateStyle",
  "timeStyle",
  "calendar",
  "dayPeriod",
  "numberingSystem",
  "hourCycle",
  "fractionalSecondDigits",
];
function m_(...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 Wo(Zn.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 Wo(Zn.INVALID_ISO_DATE_ARGUMENT);
    }
  } else if (Jte(e)) {
    if (isNaN(e.getTime())) throw Wo(Zn.INVALID_DATE_ARGUMENT);
    a = e;
  } else if (fn(e)) a = e;
  else throw Wo(Zn.INVALID_ARGUMENT);
  return (
    Ee(n)
      ? (o.key = n)
      : Ze(n) &&
        Object.keys(n).forEach((l) => {
          x6.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.__datetimeFormatters.has(o) && r.__datetimeFormatters.delete(o);
  }
}
function JC(t, ...e) {
  const {
      numberFormats: n,
      unresolving: r,
      fallbackLocale: i,
      onWarn: o,
      localeFallbacker: s,
    } = t,
    { __numberFormatters: a } = t;
  if (!_6.numberFormat) return o(vl(wr.CANNOT_FORMAT_NUMBER)), C0;
  const [l, c, u, f] = v_(...e),
    d = ct(u.missingWarn) ? u.missingWarn : t.missingWarn,
    h = ct(u.fallbackWarn) ? u.fallbackWarn : t.fallbackWarn,
    p = !!u.part,
    g = Nw(t, u),
    m = s(t, i, g);
  if (!Ee(l) || l === "") return new Intl.NumberFormat(g, f).format(c);
  let v = {},
    y,
    _ = null,
    x = g,
    b = null;
  const w = "number format";
  for (let P = 0; P < m.length; P++) {
    if (
      ((y = b = m[P]),
      g !== y &&
        Qg(h, l) &&
        o(vl(wr.FALLBACK_TO_NUMBER_FORMAT, { key: l, target: y })),
      g !== y)
    ) {
      const C = t.__v_emitter;
      C &&
        C.emit("fallback", {
          type: w,
          key: l,
          from: x,
          to: b,
          groupId: `${w}:${l}`,
        });
    }
    if (((v = n[y] || {}), (_ = v[l]), Ze(_))) break;
    Fw(t, l, y, d, w), (x = b);
  }
  if (!Ze(_) || !Ee(y)) return r ? Jg : l;
  let E = `${y}__${l}`;
  Zg(f) || (E = `${E}__${JSON.stringify(f)}`);
  let S = a.get(E);
  return (
    S || ((S = new Intl.NumberFormat(y, An({}, _, f))), a.set(E, S)),
    p ? S.formatToParts(c) : S.format(c)
  );
}
const b6 = [
  "localeMatcher",
  "style",
  "currency",
  "currencyDisplay",
  "currencySign",
  "useGrouping",
  "minimumIntegerDigits",
  "minimumFractionDigits",
  "maximumFractionDigits",
  "minimumSignificantDigits",
  "maximumSignificantDigits",
  "compactDisplay",
  "notation",
  "signDisplay",
  "unit",
  "unitDisplay",
  "roundingMode",
  "roundingPriority",
  "roundingIncrement",
  "trailingZeroDisplay",
];
function v_(...t) {
  const [e, n, r, i] = t,
    o = Ct();
  let s = Ct();
  if (!fn(e)) throw Wo(Zn.INVALID_ARGUMENT);
  const a = e;
  return (
    Ee(n)
      ? (o.key = n)
      : Ze(n) &&
        Object.keys(n).forEach((l) => {
          b6.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 QC(t, e, n) {
  const r = t;
  for (const i in n) {
    const o = `${e}__${i}`;
    r.__numberFormatters.has(o) && r.__numberFormatters.delete(o);
  }
}
const wre = (t) => t,
  Ere = (t) => "",
  Sre = "text",
  Cre = (t) => (t.length === 0 ? "" : Mw(t)),
  Are = rne;
function eA(t, e) {
  return (
    (t = Math.abs(t)),
    e === 2 ? (t ? (t > 1 ? 1 : 0) : 1) : t ? Math.min(t, 2) : 0
  );
}
function Tre(t) {
  const e = fn(t.pluralIndex) ? t.pluralIndex : -1;
  return t.named && (fn(t.named.count) || fn(t.named.n))
    ? fn(t.named.count)
      ? t.named.count
      : fn(t.named.n)
      ? t.named.n
      : e
    : e;
}
function Pre(t, e) {
  e.count || (e.count = t), e.n || (e.n = t);
}
function Ire(t = {}) {
  const e = t.locale,
    n = Tre(t),
    r =
      ot(t.pluralRules) && Ee(e) && Tt(t.pluralRules[e])
        ? t.pluralRules[e]
        : eA,
    i = ot(t.pluralRules) && Ee(e) && Tt(t.pluralRules[e]) ? eA : void 0,
    o = (v) => v[r(n, v.length, i)],
    s = t.list || [],
    a = (v) => s[v],
    l = t.named || Ct();
  fn(t.pluralIndex) && Pre(n, l);
  const c = (v) => l[v];
  function u(v, y) {
    const _ = Tt(t.messages)
      ? t.messages(v, !!y)
      : ot(t.messages)
      ? t.messages[v]
      : !1;
    return _ || (t.parent ? t.parent.message(v) : Ere);
  }
  const f = (v) => (t.modifiers ? t.modifiers[v] : wre),
    d =
      Ze(t.processor) && Tt(t.processor.normalize)
        ? t.processor.normalize
        : Cre,
    h =
      Ze(t.processor) && Tt(t.processor.interpolate)
        ? t.processor.interpolate
        : Are,
    p = Ze(t.processor) && Ee(t.processor.type) ? t.processor.type : Sre,
    m = {
      list: a,
      named: c,
      plural: o,
      linked: (v, ...y) => {
        const [_, x] = y;
        let b = "text",
          w = "";
        y.length === 1
          ? ot(_)
            ? ((w = _.modifier || w), (b = _.type || b))
            : Ee(_) && (w = _ || w)
          : y.length === 2 && (Ee(_) && (w = _ || w), Ee(x) && (b = x || b));
        const E = u(v, !0)(m),
          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: An(Ct(), s, l),
    };
  return m;
}
const tA = () => "",
  ai = (t) => Tt(t);
function nA(t, ...e) {
  const {
      fallbackFormat: n,
      postTranslation: r,
      unresolving: i,
      messageCompiler: o,
      fallbackLocale: s,
      messages: a,
    } = t,
    [l, c] = y_(...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,
    g = n || (p != null && (Ee(p) || Tt(p))),
    m = Nw(t, c);
  d && Ore(c);
  let [v, y, _] = h ? [l, m, a[m] || Ct()] : w6(t, l, m, s, f, u),
    x = v,
    b = l;
  if (
    (!h && !(Ee(x) || gi(x) || ai(x)) && g && ((x = p), (b = x)),
    !h && (!(Ee(x) || gi(x) || ai(x)) || !Ee(y)))
  )
    return i ? Jg : l;
  if (Ee(x) && t.messageCompiler == null)
    return (
      _o(
        `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 : E6(t, l, y, x, b, E);
  if (w) return x;
  const P = Bre(t, y, _, c),
    C = Ire(P),
    A = Rre(t, S, C);
  let T = r ? r(A, l) : A;
  d && Ee(T) && (T = ene(T));
  {
    const I = {
      timestamp: Date.now(),
      key: Ee(l) ? l : ai(x) ? x.key : "",
      locale: y || (ai(x) ? x.locale : ""),
      format: Ee(x) ? x : ai(x) ? x.source : "",
      message: T,
    };
    (I.meta = An({}, t.__meta, yre() || {})), Kne(I);
  }
  return T;
}
function Ore(t) {
  Wt(t.list)
    ? (t.list = t.list.map((e) => (Ee(e) ? NC(e) : e)))
    : ot(t.named) &&
      Object.keys(t.named).forEach((e) => {
        Ee(t.named[e]) && (t.named[e] = NC(t.named[e]));
      });
}
function w6(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,
    g = null;
  const m = "translate";
  for (let v = 0; v < u.length; v++) {
    if (
      ((d = g = u[v]),
      n !== d &&
        !y6(n, d) &&
        Qg(i, e) &&
        a(vl(wr.FALLBACK_TO_TRANSLATE, { key: e, target: d })),
      n !== d)
    ) {
      const b = t.__v_emitter;
      b &&
        b.emit("fallback", {
          type: m,
          key: e,
          from: p,
          to: g,
          groupId: `${m}:${e}`,
        });
    }
    f = s[d] || Ct();
    let y = null,
      _,
      x;
    if (
      ($i &&
        ((y = window.performance.now()),
        (_ = "intlify-message-resolve-start"),
        (x = "intlify-message-resolve-end"),
        Hr && Hr(_)),
      (h = l(f, e)) === null && (h = f[e]),
      $i)
    ) {
      const b = window.performance.now(),
        w = t.__v_emitter;
      w &&
        y &&
        h &&
        w.emit("message-resolve", {
          type: "message-resolve",
          key: e,
          message: h,
          time: b - y,
          groupId: `${m}:${e}`,
        }),
        _ && x && Hr && ml && (Hr(x), ml("intlify message resolve", _, x));
    }
    if (Ee(h) || gi(h) || ai(h)) break;
    if (!bre(d, u)) {
      const b = Fw(t, e, d, o, m);
      b !== e && (h = b);
    }
    p = g;
  }
  return [h, d, f];
}
function E6(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;
  $i &&
    ((l = window.performance.now()),
    (c = "intlify-message-compilation-start"),
    (u = "intlify-message-compilation-end"),
    Hr && Hr(c));
  const f = s(r, Mre(t, n, i, r, a, o));
  if ($i) {
    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 && Hr && ml && (Hr(u), ml("intlify message compilation", c, u));
  }
  return (f.locale = n), (f.key = e), (f.source = r), f;
}
function Rre(t, e, n) {
  let r = null,
    i,
    o;
  $i &&
    ((r = window.performance.now()),
    (i = "intlify-message-evaluation-start"),
    (o = "intlify-message-evaluation-end"),
    Hr && Hr(i));
  const s = e(n);
  if ($i) {
    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 && Hr && ml && (Hr(o), ml("intlify message evaluation", i, o));
  }
  return s;
}
function y_(...t) {
  const [e, n, r] = t,
    i = Ct();
  if (!Ee(e) && !fn(e) && !ai(e) && !gi(e)) throw Wo(Zn.INVALID_ARGUMENT);
  const o = fn(e) ? String(e) : (ai(e), e);
  return (
    fn(n)
      ? (i.plural = n)
      : Ee(n)
      ? (i.default = n)
      : Ze(n) && !Zg(n)
      ? (i.named = n)
      : Wt(n) && (i.list = n),
    fn(r) ? (i.plural = r) : Ee(r) ? (i.default = r) : Ze(r) && An(i, r),
    [o, i]
  );
}
function Mre(t, e, n, r, i, o) {
  return {
    locale: e,
    key: n,
    warnHtmlMessage: i,
    onError: (s) => {
      o && o(s);
      {
        const a = Dre(r),
          l = `Message compilation error: ${s.message}`,
          c =
            s.location &&
            a &&
            ine(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) => qte(e, n, s),
  };
}
function Dre(t) {
  if (Ee(t)) return t;
  if (t.loc && t.loc.source) return t.loc.source;
}
function Bre(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 g = s(n, h);
        if (g == null && (u || p)) {
          const [, , m] = w6(u || t, h, e, a, l, c);
          g = s(m, h);
        }
        if (Ee(g) || gi(g)) {
          let m = !1;
          const y = E6(t, h, e, g, h, () => {
            m = !0;
          });
          return m ? tA : y;
        } else return ai(g) ? g : tA;
      },
    };
  return (
    t.processor && (d.processor = t.processor),
    r.list && (d.list = r.list),
    r.named && (d.named = r.named),
    fn(r.plural) && (d.pluralIndex = r.plural),
    d
  );
}
Bne();
/*!
 * vue-i18n v11.1.12
 * (c) 2025 kazuya kawaguchi
 * Released under the MIT License.
 */ const kre = "11.1.12";
function Nre() {
  typeof __VUE_I18N_FULL_INSTALL__ != "boolean" &&
    (Wa().__VUE_I18N_FULL_INSTALL__ = !0),
    typeof __VUE_I18N_LEGACY_API__ != "boolean" &&
      (Wa().__VUE_I18N_LEGACY_API__ = !0),
    typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" &&
      (Wa().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1),
    typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" &&
      (Wa().__INTLIFY_PROD_DEVTOOLS__ = !1);
}
const It = {
  UNEXPECTED_RETURN_TYPE: Zne,
  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 Dr(t, ...e) {
  return xu(t, null, { messages: Fre, args: e });
}
const Fre = {
    [It.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer",
    [It.INVALID_ARGUMENT]: "Invalid argument",
    [It.MUST_BE_CALL_SETUP_TOP]:
      "Must be called at the top of a `setup` function",
    [It.NOT_INSTALLED]: "Need to install with `app.use` function",
    [It.UNEXPECTED_ERROR]: "Unexpected error",
    [It.REQUIRED_VALUE]: "Required in value: {0}",
    [It.INVALID_VALUE]: "Invalid value",
    [It.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: "Cannot setup vue-devtools plugin",
    [It.NOT_INSTALLED_WITH_PROVIDE]: "Need to install with `provide` function",
    [It.NOT_COMPATIBLE_LEGACY_VUE_I18N]: "Not compatible legacy VueI18n.",
    [It.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:
      "Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly",
  },
  __ = Co("__translateVNode"),
  x_ = Co("__datetimeParts"),
  b_ = Co("__numberParts"),
  yl = Co("__enableEmitter"),
  fd = Co("__disableEmitter"),
  S6 = Co("__setPluralRules"),
  C6 = Co("__injectWithOption"),
  w_ = Co("__dispose"),
  li = {
    FALLBACK_TO_ROOT: ure,
    NOT_FOUND_PARENT_SCOPE: 9,
    IGNORE_OBJ_FLATTEN: 10,
    DEPRECATE_LEGACY_MODE: 11,
    DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE: 12,
    DUPLICATE_USE_I18N_CALLING: 13,
  },
  Lre = {
    [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 qc(t, ...e) {
  return qg(Lre[t], ...e);
}
function dd(t) {
  if (!ot(t) || gi(t)) return t;
  for (const e in t)
    if (Mi(t, e))
      if (!e.includes(".")) ot(t[e]) && dd(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]]))) {
            _o(qc(li.IGNORE_OBJ_FLATTEN, { key: n[s] })), (o = !0);
            break;
          }
          i = i[n[s]];
        }
        if (
          (o ||
            (gi(i)
              ? u6.includes(n[r]) || delete t[e]
              : ((i[n[r]] = t[e]), delete t[e])),
          !gi(i))
        ) {
          const s = i[n[r]];
          ot(s) && dd(s);
        }
      }
  return t;
}
function Lw(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()), Gp(c, s[l])) : Gp(c, s);
        } else Ee(a) && Gp(JSON.parse(a), s);
      }),
    i == null && o)
  )
    for (const a in s) Mi(s, a) && dd(s[a]);
  return s;
}
function A6(t) {
  return t.type;
}
function T6(t, e, n) {
  let r = ot(e.messages) ? e.messages : Ct();
  "__i18nGlobal" in n &&
    (r = Lw(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 rA(t) {
  return R(go, null, t, 0);
}
const iA = "__INTLIFY_META__",
  oA = () => [],
  $re = () => !1;
let sA = 0;
function aA(t) {
  return (e, n, r, i) => t(n, r, yt() || void 0, i);
}
const Ure = () => {
  const t = yt();
  let e = null;
  return t && (e = A6(t)[iA]) ? { [iA]: e } : null;
};
function $w(t = {}) {
  const { __root: e, __injectWithOption: n } = t,
    r = e === void 0,
    i = t.flatJson,
    o = $i ? Z : pg;
  let s = ct(t.inheritLocale) ? t.inheritLocale : !0;
  const a = o(e && s ? e.locale.value : Ee(t.locale) ? t.locale : ud),
    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(Lw(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) || Xc(t.missingWarn)
      ? t.missingWarn
      : !0,
    h = e
      ? e.fallbackWarn
      : ct(t.fallbackWarn) || Xc(t.fallbackWarn)
      ? t.fallbackWarn
      : !0,
    p = e ? e.fallbackRoot : ct(t.fallbackRoot) ? t.fallbackRoot : !0,
    g = !!t.fallbackFormat,
    m = Tt(t.missing) ? t.missing : null,
    v = Tt(t.missing) ? aA(t.missing) : null,
    y = Tt(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 && YC(null);
    const j = {
      version: kre,
      locale: a.value,
      fallbackLocale: l.value,
      messages: c.value,
      modifiers: b,
      pluralRules: w,
      missing: v === null ? void 0 : v,
      missingWarn: d,
      fallbackWarn: h,
      fallbackFormat: g,
      unresolving: !0,
      postTranslation: y === null ? void 0 : y,
      warnHtmlMessage: _,
      escapeParameter: x,
      messageResolver: t.messageResolver,
      messageCompiler: t.messageCompiler,
      __meta: { framework: "vue" },
    };
    (j.datetimeFormats = u.value),
      (j.numberFormats = f.value),
      (j.__datetimeFormatters = Ze(E) ? E.__datetimeFormatters : void 0),
      (j.__numberFormatters = Ze(E) ? E.__numberFormatters : void 0),
      (j.__v_emitter = Ze(E) ? E.__v_emitter : void 0);
    const ie = xre(j);
    return r && YC(ie), ie;
  })()),
    Gu(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: (j) => {
        (E.locale = j), (a.value = j);
      },
    }),
    A = re({
      get: () => l.value,
      set: (j) => {
        (E.fallbackLocale = j), (l.value = j), Gu(E, a.value, j);
      },
    }),
    T = re(() => c.value),
    I = re(() => u.value),
    B = re(() => f.value);
  function G() {
    return Tt(y) ? y : null;
  }
  function D(j) {
    (y = j), (E.postTranslation = j);
  }
  function $() {
    return m;
  }
  function z(j) {
    j !== null && (v = aA(j)), (m = j), (E.missing = v);
  }
  function K(j, ie) {
    return j !== "translate" || !ie.resolvedMessage;
  }
  const fe = (j, ie, Ce, Ue, et, Dt) => {
    P();
    let Pn;
    try {
      r || (E.fallbackContext = e ? _re() : void 0), (Pn = j(E));
    } finally {
      r || (E.fallbackContext = void 0);
    }
    if (
      (Ce !== "translate exists" && fn(Pn) && Pn === Jg) ||
      (Ce === "translate exists" && !Pn)
    ) {
      const [yr, wh] = ie();
      if (e && Ee(yr) && K(Ce, wh)) {
        p &&
          (Qg(h, yr) || v6(d, yr)) &&
          _o(qc(li.FALLBACK_TO_ROOT, { key: yr, type: Ce }));
        {
          const { __v_emitter: _s } = E;
          _s &&
            p &&
            _s.emit("fallback", {
              type: Ce,
              key: yr,
              to: "global",
              groupId: `${Ce}:${yr}`,
            });
        }
      }
      return e && p ? Ue(e) : et(yr);
    } else {
      if (Dt(Pn)) return Pn;
      throw Dr(It.UNEXPECTED_RETURN_TYPE);
    }
  };
  function se(...j) {
    return fe(
      (ie) => Reflect.apply(nA, null, [ie, ...j]),
      () => y_(...j),
      "translate",
      (ie) => Reflect.apply(ie.t, ie, [...j]),
      (ie) => ie,
      (ie) => Ee(ie)
    );
  }
  function Y(...j) {
    const [ie, Ce, Ue] = j;
    if (Ue && !ot(Ue)) throw Dr(It.INVALID_ARGUMENT);
    return se(ie, Ce, An({ resolvedMessage: !0 }, Ue || {}));
  }
  function te(...j) {
    return fe(
      (ie) => Reflect.apply(qC, null, [ie, ...j]),
      () => m_(...j),
      "datetime format",
      (ie) => Reflect.apply(ie.d, ie, [...j]),
      () => C0,
      (ie) => Ee(ie) || Wt(ie)
    );
  }
  function pe(...j) {
    return fe(
      (ie) => Reflect.apply(JC, null, [ie, ...j]),
      () => v_(...j),
      "number format",
      (ie) => Reflect.apply(ie.n, ie, [...j]),
      () => C0,
      (ie) => Ee(ie) || Wt(ie)
    );
  }
  function F(j) {
    return j.map((ie) => (Ee(ie) || fn(ie) || ct(ie) ? rA(String(ie)) : ie));
  }
  const L = { normalize: F, interpolate: (j) => j, type: "vnode" };
  function ne(...j) {
    return fe(
      (ie) => {
        let Ce;
        const Ue = ie;
        try {
          (Ue.processor = L), (Ce = Reflect.apply(nA, null, [Ue, ...j]));
        } finally {
          Ue.processor = null;
        }
        return Ce;
      },
      () => y_(...j),
      "translate",
      (ie) => ie[__](...j),
      (ie) => [rA(ie)],
      (ie) => Wt(ie)
    );
  }
  function ee(...j) {
    return fe(
      (ie) => Reflect.apply(JC, null, [ie, ...j]),
      () => v_(...j),
      "number format",
      (ie) => ie[b_](...j),
      oA,
      (ie) => Ee(ie) || Wt(ie)
    );
  }
  function de(...j) {
    return fe(
      (ie) => Reflect.apply(qC, null, [ie, ...j]),
      () => m_(...j),
      "datetime format",
      (ie) => ie[x_](...j),
      oA,
      (ie) => Ee(ie) || Wt(ie)
    );
  }
  function ge(j) {
    (w = j), (E.pluralRules = w);
  }
  function xe(j, ie) {
    return fe(
      () => {
        if (!j) return !1;
        const Ce = Ee(ie) ? ie : a.value,
          Ue = W(Ce),
          et = E.messageResolver(Ue, j);
        return gi(et) || ai(et) || Ee(et);
      },
      () => [j],
      "translate exists",
      (Ce) => Reflect.apply(Ce.te, Ce, [j, ie]),
      $re,
      (Ce) => ct(Ce)
    );
  }
  function O(j) {
    let ie = null;
    const Ce = f6(E, l.value, a.value);
    for (let Ue = 0; Ue < Ce.length; Ue++) {
      const et = c.value[Ce[Ue]] || {},
        Dt = E.messageResolver(et, j);
      if (Dt != null) {
        ie = Dt;
        break;
      }
    }
    return ie;
  }
  function U(j) {
    const ie = O(j);
    return ie ?? (e ? e.tm(j) || {} : {});
  }
  function W(j) {
    return c.value[j] || {};
  }
  function ce(j, ie) {
    if (i) {
      const Ce = { [j]: ie };
      for (const Ue in Ce) Mi(Ce, Ue) && dd(Ce[Ue]);
      ie = Ce[j];
    }
    (c.value[j] = ie), (E.messages = c.value);
  }
  function ue(j, ie) {
    c.value[j] = c.value[j] || {};
    const Ce = { [j]: ie };
    if (i) for (const Ue in Ce) Mi(Ce, Ue) && dd(Ce[Ue]);
    (ie = Ce[j]), Gp(ie, c.value[j]), (E.messages = c.value);
  }
  function M(j) {
    return u.value[j] || {};
  }
  function N(j, ie) {
    (u.value[j] = ie), (E.datetimeFormats = u.value), ZC(E, j, ie);
  }
  function H(j, ie) {
    (u.value[j] = An(u.value[j] || {}, ie)),
      (E.datetimeFormats = u.value),
      ZC(E, j, ie);
  }
  function q(j) {
    return f.value[j] || {};
  }
  function le(j, ie) {
    (f.value[j] = ie), (E.numberFormats = f.value), QC(E, j, ie);
  }
  function ye(j, ie) {
    (f.value[j] = An(f.value[j] || {}, ie)),
      (E.numberFormats = f.value),
      QC(E, j, ie);
  }
  sA++,
    e &&
      $i &&
      (ve(e.locale, (j) => {
        s && ((a.value = j), (E.locale = j), Gu(E, a.value, l.value));
      }),
      ve(e.fallbackLocale, (j) => {
        s && ((l.value = j), (E.fallbackLocale = j), Gu(E, a.value, l.value));
      }));
  const he = {
    id: sA,
    locale: C,
    fallbackLocale: A,
    get inheritLocale() {
      return s;
    },
    set inheritLocale(j) {
      (s = j),
        j &&
          e &&
          ((a.value = e.locale.value),
          (l.value = e.fallbackLocale.value),
          Gu(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(j) {
      (d = j), (E.missingWarn = d);
    },
    get fallbackWarn() {
      return h;
    },
    set fallbackWarn(j) {
      (h = j), (E.fallbackWarn = h);
    },
    get fallbackRoot() {
      return p;
    },
    set fallbackRoot(j) {
      p = j;
    },
    get fallbackFormat() {
      return g;
    },
    set fallbackFormat(j) {
      (g = j), (E.fallbackFormat = g);
    },
    get warnHtmlMessage() {
      return _;
    },
    set warnHtmlMessage(j) {
      (_ = j), (E.warnHtmlMessage = j);
    },
    get escapeParameter() {
      return x;
    },
    set escapeParameter(j) {
      (x = j), (E.escapeParameter = j);
    },
    t: se,
    getLocaleMessage: W,
    setLocaleMessage: ce,
    mergeLocaleMessage: ue,
    getPostTranslationHandler: G,
    setPostTranslationHandler: D,
    getMissingHandler: $,
    setMissingHandler: z,
    [S6]: ge,
  };
  return (
    (he.datetimeFormats = I),
    (he.numberFormats = B),
    (he.rt = Y),
    (he.te = xe),
    (he.tm = U),
    (he.d = te),
    (he.n = pe),
    (he.getDateTimeFormat = M),
    (he.setDateTimeFormat = N),
    (he.mergeDateTimeFormat = H),
    (he.getNumberFormat = q),
    (he.setNumberFormat = le),
    (he.mergeNumberFormat = ye),
    (he[C6] = n),
    (he[__] = ne),
    (he[x_] = de),
    (he[b_] = ee),
    (he[yl] = (j) => {
      E.__v_emitter = j;
    }),
    (he[fd] = () => {
      E.__v_emitter = void 0;
    }),
    he
  );
}
const P6 = "vue-i18n: composer properties",
  p1 = {
    "vue-devtools-plugin-vue-i18n": "Vue I18n DevTools",
    "vue-i18n-resource-inspector": "Vue I18n DevTools",
    "vue-i18n-timeline": "Vue I18n",
  },
  Gre = { "vue-i18n-resource-inspector": "Search for scopes ..." },
  Hre = { "vue-i18n-timeline": 16764185 };
let E_;
async function Vre(t, e) {
  return new Promise((n, r) => {
    try {
      Rg(
        {
          id: "vue-devtools-plugin-vue-i18n",
          label: p1["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: [P6],
          app: t,
        },
        (i) => {
          (E_ = i),
            i.on.visitComponentTree(({ componentInstance: s, treeNode: a }) => {
              zre(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 &&
                      lA(a, s.vnode.el.__VUE_I18N__)
                    : lA(a, s.vnode.el.__VUE_I18N__));
              }
            ),
            i.addInspector({
              id: "vue-i18n-resource-inspector",
              label: p1["vue-i18n-resource-inspector"],
              icon: "language",
              treeFilterPlaceholder: Gre["vue-i18n-resource-inspector"],
            }),
            i.on.getInspectorTree((s) => {
              s.app === t &&
                s.inspectorId === "vue-i18n-resource-inspector" &&
                Kre(s, e);
            });
          const o = new Map();
          i.on.getInspectorState(async (s) => {
            if (s.app === t && s.inspectorId === "vue-i18n-resource-inspector")
              if ((i.unhighlightElement(), Zre(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 = qre(s.nodeId, e);
                a && i.highlightElement(a);
              }
          }),
            i.on.editInspectorState((s) => {
              s.app === t &&
                s.inspectorId === "vue-i18n-resource-inspector" &&
                Qre(s, e);
            }),
            i.addTimelineLayer({
              id: "vue-i18n-timeline",
              label: p1["vue-i18n-timeline"],
              color: Hre["vue-i18n-timeline"],
            }),
            n(!0);
        }
      );
    } catch (i) {
      console.error(i), r(!1);
    }
  });
}
function I6(t) {
  return t.type.name || t.type.displayName || t.type.__file || "Anonymous";
}
function zre(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 (${I6(t)} Scope)`,
      textColor: 0,
      backgroundColor: 16764185,
    };
    e.tags.push(i);
  }
}
function lA(t, e) {
  const n = P6;
  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: Uw(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 Uw(t) {
  const e = {};
  return (
    Object.keys(t).forEach((n) => {
      const r = t[n];
      Tt(r) && "source" in r
        ? (e[n] = Xre(r))
        : gi(r) && r.loc && r.loc.source
        ? (e[n] = r.loc.source)
        : ot(r)
        ? (e[n] = Uw(r))
        : (e[n] = r);
    }),
    e
  );
}
const jre = { "<": "&lt;", ">": "&gt;", '"': "&quot;", "&": "&amp;" };
function Wre(t) {
  return t.replace(/[<>"&]/g, Yre);
}
function Yre(t) {
  return jre[t] || t;
}
function Xre(t) {
  return {
    _custom: {
      type: "function",
      display: `<span>ƒ</span> ${t.source ? `("${Wre(t.source)}")` : "(?)"}`,
    },
  };
}
function Kre(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: `${I6(r)} Scope` });
  }
}
function qre(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 O6(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 Zre(t, e) {
  const n = O6(t.nodeId, e);
  return n && (t.state = Jre(n)), null;
}
function Jre(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: Uw(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 hd(t, e) {
  if (E_) {
    let n;
    e && "groupId" in e && ((n = e.groupId), delete e.groupId),
      E_.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 Qre(t, e) {
  const n = O6(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 eie(t) {
  const e = Ee(t.locale) ? t.locale : ud,
    n =
      Ee(t.fallbackLocale) ||
      Wt(t.fallbackLocale) ||
      Ze(t.fallbackLocale) ||
      t.fallbackLocale === !1
        ? t.fallbackLocale
        : e,
    r = Tt(t.missing) ? t.missing : void 0,
    i =
      ct(t.silentTranslationWarn) || Xc(t.silentTranslationWarn)
        ? !t.silentTranslationWarn
        : !0,
    o =
      ct(t.silentFallbackWarn) || Xc(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 = Tt(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 An(P, b[S]), E;
    }, p || {});
  }
  const { __i18n: g, __root: m, __injectWithOption: v } = t,
    y = t.datetimeFormats,
    _ = t.numberFormats,
    x = t.flatJson;
  return {
    locale: e,
    fallbackLocale: n,
    messages: p,
    flatJson: x,
    datetimeFormats: y,
    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: g,
    __root: m,
    __injectWithOption: v,
  };
}
function S_(t = {}) {
  const e = $w(eie(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[yl] && o[yl](i);
    }),
    (r.__disableEmitter = () => {
      const i = e;
      i[fd] && i[fd]();
    }),
    r
  );
}
function tie(t, e, n) {
  return {
    beforeCreate() {
      const r = yt();
      if (!r) throw Dr(It.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 = cA(t, o);
        else {
          (o.__injectWithOption = !0),
            (o.__extender = n.__vueI18nExtend),
            (this.$i18n = S_(o));
          const s = this.$i18n;
          s.__extender && (s.__disposer = s.__extender(this.$i18n));
        }
      } else if (i.__i18n)
        if (this === this.$root) this.$i18n = cA(t, i);
        else {
          this.$i18n = S_({
            __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 && T6(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 = Dw());
        r.__enableEmitter && r.__enableEmitter(i), i.on("*", hd);
      }
    },
    unmounted() {
      const r = yt();
      if (!r) throw Dr(It.UNEXPECTED_ERROR);
      const i = this.$i18n;
      this.$el &&
        this.$el.__VUE_I18N__ &&
        (this.__v_emitter &&
          (this.__v_emitter.off("*", hd), 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 cA(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[S6](e.pluralizationRules || t.pluralizationRules);
  const n = Lw(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 Gw = {
  tag: { type: [String, Object] },
  locale: { type: String },
  scope: {
    type: String,
    validator: (t) => t === "parent" || t === "global",
    default: "parent",
  },
  i18n: { type: Object },
};
function nie({ 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 R6() {
  return Ft;
}
const rie = we({
    name: "i18n-t",
    props: An(
      {
        keypath: { type: String, required: !0 },
        plural: {
          type: [Number, String],
          validator: (t) => fn(t) || !isNaN(t),
        },
      },
      Gw
    ),
    setup(t, e) {
      const { slots: n, attrs: r } = e,
        i = t.i18n || Hw({ 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 = nie(e, o),
          l = i[__](t.keypath, a, s),
          c = An(Ct(), r),
          u = Ee(t.tag) || ot(t.tag) ? t.tag : R6();
        return Bn(u, c, l);
      };
    },
  }),
  uA = rie;
function iie(t) {
  return Wt(t) && !Ee(t[0]);
}
function M6(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) ? An(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],
            g = p ? p({ [d.type]: d.value, index: h, parts: l }) : [d.value];
          return iie(g) && (g[0].key = `${d.type}-${h}`), g;
        }))
      : Ee(l) && (c = [l]);
    const u = An(Ct(), o),
      f = Ee(t.tag) || ot(t.tag) ? t.tag : R6();
    return Bn(f, u, c);
  };
}
const oie = we({
    name: "i18n-n",
    props: An(
      {
        value: { type: Number, required: !0 },
        format: { type: [String, Object] },
      },
      Gw
    ),
    setup(t, e) {
      const n = t.i18n || Hw({ useScope: t.scope, __useComponent: !0 });
      return M6(t, e, b6, (...r) => n[b_](...r));
    },
  }),
  fA = oie;
function sie(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 aie(t) {
  const e = (s) => {
    Ow(qc(li.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));
    const { instance: a, value: l } = s;
    if (!a || !a.$) throw Dr(It.UNEXPECTED_ERROR);
    const c = sie(t, a.$),
      u = dA(l);
    return [Reflect.apply(c.t, c, [...hA(u)]), c];
  };
  return {
    created: (s, a) => {
      const [l, c] = e(a);
      $i &&
        t.global === c &&
        (s.__i18nWatcher = ve(c.locale, () => {
          a.instance && a.instance.$forceUpdate();
        })),
        (s.__composer = c),
        (s.textContent = l);
    },
    unmounted: (s) => {
      $i &&
        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 = dA(a);
        s.textContent = Reflect.apply(l.t, l, [...hA(c)]);
      }
    },
    getSSRProps: (s) => {
      const [a] = e(s);
      return { textContent: a };
    },
  };
}
function dA(t) {
  if (Ee(t)) return { path: t };
  if (Ze(t)) {
    if (!("path" in t)) throw Dr(It.REQUIRED_VALUE, "path");
    return t;
  } else throw Dr(It.INVALID_VALUE);
}
function hA(t) {
  const { path: e, locale: n, args: r, choice: i, plural: o } = t,
    s = {},
    a = r || {};
  return (
    Ee(n) && (s.locale = n),
    fn(i) && (s.plural = i),
    fn(o) && (s.plural = o),
    [e, a, s]
  );
}
function lie(t, e, ...n) {
  const r = Ze(n[0]) ? n[0] : {};
  (ct(r.globalInstall) ? r.globalInstall : !0) &&
    ([uA.name, "I18nT"].forEach((o) => t.component(o, uA)),
    [fA.name, "I18nN"].forEach((o) => t.component(o, fA)),
    [gA.name, "I18nD"].forEach((o) => t.component(o, gA))),
    t.directive("t", aie(e));
}
const cie = Co("global-vue-i18n");
function oPe(t = {}) {
  const e =
    __VUE_I18N_LEGACY_API__ && ct(t.legacy)
      ? t.legacy
      : __VUE_I18N_LEGACY_API__;
  e && Ow(qc(li.DEPRECATE_LEGACY_MODE));
  const n = ct(t.globalInjection) ? t.globalInjection : !0,
    r = new Map(),
    [i, o] = uie(t, e),
    s = Co("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 g = d[0];
        (u.__composerExtend = g.__composerExtend),
          (u.__vueI18nExtend = g.__vueI18nExtend);
      }
      let h = null;
      !e && n && (h = yie(f, u.global)),
        __VUE_I18N_FULL_INSTALL__ && lie(f, u, ...d),
        __VUE_I18N_LEGACY_API__ && e && f.mixin(tie(o, o.__composer, u));
      const p = f.unmount;
      f.unmount = () => {
        h && h(), u.dispose(), p();
      };
      {
        if (!(await Vre(f, u))) throw Dr(It.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);
        const m = Dw();
        if (e) {
          const v = o;
          v.__enableEmitter && v.__enableEmitter(m);
        } else {
          const v = o;
          v[yl] && v[yl](m);
        }
        m.on("*", hd);
      }
    },
    get global() {
      return o;
    },
    dispose() {
      i.stop();
    },
    __instances: r,
    __getInstance: a,
    __setInstance: l,
    __deleteInstance: c,
  };
  return u;
}
function Hw(t = {}) {
  const e = yt();
  if (e == null) throw Dr(It.MUST_BE_CALL_SETUP_TOP);
  if (
    !e.isCE &&
    e.appContext.app != null &&
    !e.appContext.app.__VUE_I18N_SYMBOL__
  )
    throw Dr(It.NOT_INSTALLED);
  const n = fie(e),
    r = hie(n),
    i = A6(e),
    o = die(t, i);
  if (o === "global") return T6(r, t, i), r;
  if (o === "parent") {
    let l = pie(n, e, t.__useComponent);
    return l == null && (_o(qc(li.NOT_FOUND_PARENT_SCOPE)), (l = r)), l;
  }
  const s = n;
  let a = s.__getInstance(e);
  if (a == null) {
    const l = An({}, t);
    "__i18n" in i && (l.__i18n = i.__i18n),
      r && (l.__root = r),
      (a = $w(l)),
      s.__composerExtend && (a[w_] = s.__composerExtend(a)),
      mie(s, e, a),
      s.__setInstance(e, a);
  } else o === "local" && _o(qc(li.DUPLICATE_USE_I18N_CALLING));
  return a;
}
function uie(t, e) {
  const n = Dd(),
    r = __VUE_I18N_LEGACY_API__ && e ? n.run(() => S_(t)) : n.run(() => $w(t));
  if (r == null) throw Dr(It.UNEXPECTED_ERROR);
  return [n, r];
}
function fie(t) {
  const e = hn(t.isCE ? cie : t.appContext.app.__VUE_I18N_SYMBOL__);
  if (!e)
    throw Dr(t.isCE ? It.NOT_INSTALLED_WITH_PROVIDE : It.UNEXPECTED_ERROR);
  return e;
}
function die(t, e) {
  return Zg(t)
    ? "__i18n" in e
      ? "local"
      : "global"
    : t.useScope
    ? t.useScope
    : "local";
}
function hie(t) {
  return t.mode === "composition" ? t.global : t.global.__composer;
}
function pie(t, e, n = !1) {
  let r = null;
  const i = e.root;
  let o = gie(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[C6] && (r = null));
    }
    if (r != null || i === o) break;
    o = o.parent;
  }
  return r;
}
function gie(t, e = !1) {
  return t == null ? null : (e && t.vnode.ctx) || t.parent;
}
function mie(t, e, n) {
  let r = null;
  Ht(() => {
    if (e.vnode.el) {
      (e.vnode.el.__VUE_I18N__ = n), (r = Dw());
      const i = n;
      i[yl] && i[yl](r), r.on("*", hd);
    }
  }, e),
    ms(() => {
      const i = n;
      e.vnode.el &&
        e.vnode.el.__VUE_I18N__ &&
        (r && r.off("*", hd), i[fd] && i[fd](), delete e.vnode.el.__VUE_I18N__),
        t.__deleteInstance(e);
      const o = i[w_];
      o && (o(), delete i[w_]);
    }, e);
}
const vie = ["locale", "fallbackLocale", "availableLocales"],
  pA = ["t", "rt", "d", "n", "tm", "te"];
function yie(t, e) {
  const n = Object.create(null);
  return (
    vie.forEach((i) => {
      const o = Object.getOwnPropertyDescriptor(e, i);
      if (!o) throw Dr(It.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),
    pA.forEach((i) => {
      const o = Object.getOwnPropertyDescriptor(e, i);
      if (!o || !o.value) throw Dr(It.UNEXPECTED_ERROR);
      Object.defineProperty(t.config.globalProperties, `$${i}`, o);
    }),
    () => {
      delete t.config.globalProperties.$i18n,
        pA.forEach((i) => {
          delete t.config.globalProperties[`$${i}`];
        });
    }
  );
}
const _ie = we({
    name: "i18n-d",
    props: An(
      {
        value: { type: [Number, Date], required: !0 },
        format: { type: [String, Object] },
      },
      Gw
    ),
    setup(t, e) {
      const n = t.i18n || Hw({ useScope: t.scope, __useComponent: !0 });
      return M6(t, e, x6, (...r) => n[x_](...r));
    },
  }),
  gA = _ie;
Nre();
pre(Wne);
gre(cre);
mre(f6);
{
  const t = Wa();
  (t.__INTLIFY__ = !0), Yne(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
}
var sPe = {
    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" },
  },
  aPe = {
    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: "Новый адрес" },
  },
  lPe = {
    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" },
  },
  cPe = {
    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" },
  },
  uPe = {
    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: "नया पता जोड़ें" },
  },
  fPe = {
    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: "เพิ่มที่อยู่" },
  },
  dPe = {
    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" },
  },
  hPe = {
    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: "নতুন ঠিকানা যোগ করুন" },
  },
  pPe = {
    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: "إضافة عنوان جديد" },
  };
/*! Capacitor: https://capacitorjs.com/ - MIT License */ var _l;
(function (t) {
  (t.Unimplemented = "UNIMPLEMENTED"), (t.Unavailable = "UNAVAILABLE");
})(_l || (_l = {}));
class Hp extends Error {
  constructor(e, n, r) {
    super(e), (this.message = e), (this.code = n), (this.data = r);
  }
}
const xie = (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";
  },
  bie = (t) => {
    const e = t.CapacitorCustomPlatform || null,
      n = t.Capacitor || {},
      r = (n.Plugins = n.Plugins || {}),
      i = () => (e !== null ? e.name : xie(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(),
          g = a(f);
        let m;
        const v = async () => (
            !m && p in d
              ? (m =
                  typeof d[p] == "function" ? (m = await d[p]()) : (m = d[p]))
              : e !== null &&
                !m &&
                "web" in d &&
                (m =
                  typeof d.web == "function"
                    ? (m = await d.web())
                    : (m = d.web)),
            m
          ),
          y = (S, P) => {
            var C, A;
            if (g) {
              const T =
                g == null ? void 0 : g.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 Hp(
                `"${f}" plugin is not implemented on ${p}`,
                _l.Unimplemented
              );
            }
          },
          _ = (S) => {
            let P;
            const C = (...A) => {
              const T = v().then((I) => {
                const B = y(I, S);
                if (B) {
                  const G = B(...A);
                  return (P = G == null ? void 0 : G.remove), G;
                } else
                  throw new Hp(
                    `"${f}.${S}()" is not implemented on ${p}`,
                    _l.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 g ? 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), ...(g ? [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 = Hp),
      (n.DEBUG = !!n.DEBUG),
      (n.isLoggingEnabled = !!n.isLoggingEnabled),
      n
    );
  },
  wie = (t) => (t.Capacitor = bie(t)),
  A0 = wie(
    typeof globalThis < "u"
      ? globalThis
      : typeof self < "u"
      ? self
      : typeof window < "u"
      ? window
      : typeof global < "u"
      ? global
      : {}
  ),
  Jd = A0.registerPlugin;
class em {
  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 A0.Exception(e, _l.Unimplemented);
  }
  unavailable(e = "not available") {
    return new A0.Exception(e, _l.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 Eie = Jd("WebView"),
  mA = (t) =>
    encodeURIComponent(t)
      .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
      .replace(/[()]/g, escape),
  vA = (t) => t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
class Sie extends em {
  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 = vA(i).trim()), (o = vA(o).trim()), (n[i] = o);
      }),
      n
    );
  }
  async setCookie(e) {
    try {
      const n = mA(e.key),
        r = mA(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);
    }
  }
}
const Cie = Jd("CapacitorCookies", { web: () => new Sie() }),
  Aie = 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);
    }),
  Tie = (t = {}) => {
    const e = Object.keys(t);
    return Object.keys(t)
      .map((i) => i.toLocaleLowerCase())
      .reduce((i, o, s) => ((i[o] = t[e[s]]), i), {});
  },
  Pie = (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,
  D6 = (t, e = {}) => {
    const n = Object.assign(
        { method: t.method || "GET", headers: t.headers },
        e
      ),
      i = Tie(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 Iie extends em {
  async request(e) {
    const n = D6(e, e.webFetchExtra),
      r = Pie(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 Aie(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" })
    );
  }
}
const Oie = Jd("CapacitorHttp", { web: () => new Iie() }),
  gPe = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        Capacitor: A0,
        CapacitorCookies: Cie,
        CapacitorException: Hp,
        CapacitorHttp: Oie,
        get ExceptionCode() {
          return _l;
        },
        WebPlugin: em,
        WebView: Eie,
        buildRequestInit: D6,
        registerPlugin: Jd,
      },
      Symbol.toStringTag,
      { value: "Module" }
    )
  );
function sa(t) {
  return Bd() ? (Qx(t), !0) : !1;
}
function mPe(t) {
  let e = !1,
    n;
  const r = Dd(!0);
  return (...i) => (e || ((n = r.run(() => t(...i))), (e = !0)), n);
}
function ln(t) {
  return typeof t == "function" ? t() : hr(t);
}
const aa = typeof window < "u" && typeof document < "u",
  vPe =
    typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope,
  Rie = (t) => typeof t < "u",
  Mie = (t) => t != null,
  Die = Object.prototype.toString,
  Bie = (t) => Die.call(t) === "[object Object]",
  gr = () => {},
  C_ = kie();
function kie() {
  var t, e;
  return (
    aa &&
    ((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 Vw(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 B6 = (t) => t();
function k6(t, e = {}) {
  let n,
    r,
    i = gr;
  const o = (a) => {
    clearTimeout(a), i(), (i = gr);
  };
  return (a) => {
    const l = ln(t),
      c = ln(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 Nie(...t) {
  let e = 0,
    n,
    r = !0,
    i = gr,
    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 = gr));
  };
  return (d) => {
    const h = ln(s),
      p = Date.now() - e,
      g = () => (o = d());
    return (
      u(),
      h <= 0
        ? ((e = Date.now()), g())
        : (p > h && (l || !r)
            ? ((e = Date.now()), g())
            : a &&
              (o = new Promise((m, v) => {
                (i = c ? v : m),
                  (n = setTimeout(() => {
                    (e = Date.now()), (r = !0), m(g()), u();
                  }, Math.max(0, h - p)));
              })),
          !l && !n && (n = setTimeout(() => (r = !0), h)),
          (r = !1),
          o)
    );
  };
}
function Fie(t = B6) {
  const e = Z(!0);
  function n() {
    e.value = !1;
  }
  function r() {
    e.value = !0;
  }
  const i = (...o) => {
    e.value && t(...o);
  };
  return { isActive: Dl(e), pause: n, resume: r, eventFilter: i };
}
function Lie(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 $ie(t) {
  return t || yt();
}
function N6(...t) {
  if (t.length !== 1) return mf(...t);
  const e = t[0];
  return typeof e == "function" ? Dl(f4(() => ({ get: e, set: gr }))) : Z(e);
}
function Uie(t, e = 200, n = {}) {
  return Vw(k6(e, n), t);
}
function Gie(t, e = 200, n = !1, r = !0, i = !1) {
  return Vw(Nie(e, n, r, i), t);
}
function F6(t, e, n = {}) {
  const { eventFilter: r = B6, ...i } = n;
  return ve(t, Vw(r, e), i);
}
function L6(t, e, n = {}) {
  const { eventFilter: r, ...i } = n,
    { eventFilter: o, pause: s, resume: a, isActive: l } = Fie(r);
  return {
    stop: F6(t, e, { ...i, eventFilter: o }),
    pause: s,
    resume: a,
    isActive: l,
  };
}
function tm(t, e = !0, n) {
  $ie() ? Ht(t, n) : e ? t() : Xe(t);
}
function yPe(t, e) {
  return re(() =>
    ln(t)
      .map((n) => ln(n))
      .filter(e)
  );
}
function _Pe(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 = ln(e);
    u <= 0 || ((s.value = !0), i && t(), a(), (o = setInterval(t, u)));
  }
  if ((r && aa && c(), pt(e) || typeof e == "function")) {
    const u = ve(e, () => {
      s.value && aa && c();
    });
    sa(u);
  }
  return sa(l), { isActive: s, pause: l, resume: c };
}
function Hie(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);
      }, ln(e)));
  }
  return (
    r && ((i.value = !0), aa && l()),
    sa(a),
    { isPending: Dl(i), start: l, stop: a }
  );
}
function xPe(t, e, n = {}) {
  const { debounce: r = 0, maxWait: i = void 0, ...o } = n;
  return F6(t, e, { ...o, eventFilter: k6(r, { maxWait: i }) });
}
function Di(t) {
  var e;
  const n = ln(t);
  return (e = n == null ? void 0 : n.$el) != null ? e : n;
}
const Ui = aa ? window : void 0,
  $6 = aa ? window.document : void 0,
  U6 = aa ? window.navigator : void 0;
function Fn(...t) {
  let e, n, r, i;
  if (
    (typeof t[0] == "string" || Array.isArray(t[0])
      ? (([n, r, i] = t), (e = Ui))
      : ([e, n, r, i] = t),
    !e)
  )
    return gr;
  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(
      () => [Di(e), ln(i)],
      ([u, f]) => {
        if ((s(), !u)) return;
        const d = Bie(f) ? { ...f } : f;
        o.push(...n.flatMap((h) => r.map((p) => a(u, h, p, d))));
      },
      { immediate: !0, flush: "post" }
    ),
    c = () => {
      l(), s();
    };
  return sa(c), c;
}
let yA = !1;
function bPe(t, e, n = {}) {
  const {
    window: r = Ui,
    ignore: i = [],
    capture: o = !0,
    detectIframe: s = !1,
  } = n;
  if (!r) return gr;
  C_ &&
    !yA &&
    ((yA = !0),
    Array.from(r.document.body.children).forEach((d) =>
      d.addEventListener("click", gr)
    ),
    r.document.documentElement.addEventListener("click", gr));
  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 = Di(h);
          return p && (d.target === p || d.composedPath().includes(p));
        }
      }),
    u = [
      Fn(
        r,
        "click",
        (d) => {
          const h = Di(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 }
      ),
      Fn(
        r,
        "pointerdown",
        (d) => {
          const h = Di(t);
          a = !l(d) && !!(h && !d.composedPath().includes(h));
        },
        { passive: !0 }
      ),
      s &&
        Fn(r, "blur", (d) => {
          setTimeout(() => {
            var h;
            const p = Di(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 Vie() {
  const t = Z(!1),
    e = yt();
  return (
    e &&
      Ht(() => {
        t.value = !0;
      }, e),
    t
  );
}
function nm(t) {
  const e = Vie();
  return re(() => (e.value, !!t()));
}
function zie(t, e, n = {}) {
  const { window: r = Ui, ...i } = n;
  let o;
  const s = nm(() => r && "MutationObserver" in r),
    a = () => {
      o && (o.disconnect(), (o = void 0));
    },
    l = re(() => {
      const d = ln(t),
        h = (Array.isArray(d) ? d : [d]).map(Di).filter(Mie);
      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 sa(f), { isSupported: s, stop: f, takeRecords: u };
}
function wPe(t, e) {
  const {
      interrupt: n = !0,
      onError: r = gr,
      onFinished: i = gr,
      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 = At(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 g = d(h).then(
              (m) => (u(s.fulfilled, m), c.value === t.length - 1 && i(), m)
            );
            return o ? Promise.race([g, jie(o)]) : g;
          })
          .catch((h) =>
            o != null && o.aborted
              ? (u(s.aborted, h), h)
              : (u(s.rejected, h), r(), h)
          ),
      Promise.resolve()
    ),
    { activeIndex: c, result: l }
  );
}
function jie(t) {
  return new Promise((e, n) => {
    const r = new Error("aborted");
    t.aborted ? n(r) : t.addEventListener("abort", () => n(r), { once: !0 });
  });
}
function _A(t, e = {}) {
  const { controls: n = !1, navigator: r = U6 } = e,
    i = nm(() => r && "permissions" in r);
  let o;
  const s = typeof t == "string" ? { name: t } : t,
    a = Z(),
    l = () => {
      o && (a.value = o.state);
    },
    c = Lie(async () => {
      if (i.value) {
        if (!o)
          try {
            (o = await r.permissions.query(s)), Fn(o, "change", l), l();
          } catch {
            a.value = "prompt";
          }
        return o;
      }
    });
  return c(), n ? { state: a, isSupported: i, query: c } : a;
}
function EPe(t = {}) {
  const {
      navigator: e = U6,
      read: n = !1,
      source: r,
      copiedDuring: i = 1500,
      legacy: o = !1,
    } = t,
    s = nm(() => e && "clipboard" in e),
    a = _A("clipboard-read"),
    l = _A("clipboard-write"),
    c = re(() => s.value || o),
    u = Z(""),
    f = Z(!1),
    d = Hie(() => (f.value = !1), i);
  function h() {
    s.value && v(a.value)
      ? e.clipboard.readText().then((y) => {
          u.value = y;
        })
      : (u.value = m());
  }
  c.value && n && Fn(["copy", "cut"], h);
  async function p(y = ln(r)) {
    c.value &&
      y != null &&
      (s.value && v(l.value) ? await e.clipboard.writeText(y) : g(y),
      (u.value = y),
      (f.value = !0),
      d.start());
  }
  function g(y) {
    const _ = document.createElement("textarea");
    (_.value = y ?? ""),
      (_.style.position = "absolute"),
      (_.style.opacity = "0"),
      document.body.appendChild(_),
      _.select(),
      document.execCommand("copy"),
      _.remove();
  }
  function m() {
    var y, _, x;
    return (x =
      (_ =
        (y = document == null ? void 0 : document.getSelection) == null
          ? void 0
          : y.call(document)) == null
        ? void 0
        : _.toString()) != null
      ? x
      : "";
  }
  function v(y) {
    return y === "granted" || y === "prompt";
  }
  return { isSupported: c, text: u, copied: f, copy: p };
}
function Wie(t) {
  return JSON.parse(JSON.stringify(t));
}
const qh =
    typeof globalThis < "u"
      ? globalThis
      : typeof window < "u"
      ? window
      : typeof global < "u"
      ? global
      : typeof self < "u"
      ? self
      : {},
  Zh = "__vueuse_ssr_handlers__",
  Yie = Xie();
function Xie() {
  return Zh in qh || (qh[Zh] = qh[Zh] || {}), qh[Zh];
}
function Kie(t, e) {
  return Yie[t] || e;
}
function qie(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 Zie = {
    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() },
  },
  xA = "vueuse-storage";
function G6(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 = Ui,
      eventFilter: d,
      onError: h = (C) => {
        console.error(C);
      },
      initOnMounted: p,
    } = r,
    g = (u ? pg : Z)(typeof e == "function" ? e() : e);
  if (!n)
    try {
      n = Kie("getDefaultStorage", () => {
        var C;
        return (C = Ui) == null ? void 0 : C.localStorage;
      })();
    } catch (C) {
      h(C);
    }
  if (!n) return g;
  const m = ln(e),
    v = qie(m),
    y = (i = r.serializer) != null ? i : Zie[v],
    { pause: _, resume: x } = L6(g, () => w(g.value), {
      flush: o,
      deep: s,
      eventFilter: d,
    });
  f &&
    a &&
    tm(() => {
      Fn(f, "storage", S), Fn(f, xA, P), p && S();
    }),
    p || S();
  function b(C, A) {
    f &&
      f.dispatchEvent(
        new CustomEvent(xA, {
          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 = y.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 && m != null && n.setItem(t, y.write(m)), m;
    if (!C && c) {
      const T = y.read(A);
      return typeof c == "function"
        ? c(T, m)
        : v === "object" && !Array.isArray(T)
        ? { ...m, ...T }
        : T;
    } else return typeof A != "string" ? A : y.read(A);
  }
  function S(C) {
    if (!(C && C.storageArea !== n)) {
      if (C && C.key == null) {
        g.value = m;
        return;
      }
      if (!(C && C.key !== t)) {
        _();
        try {
          (C == null ? void 0 : C.newValue) !== y.write(g.value) &&
            (g.value = E(C));
        } catch (A) {
          h(A);
        } finally {
          C ? Xe(x) : x();
        }
      }
    }
  }
  function P(C) {
    S(C.detail);
  }
  return g;
}
function SPe(t = {}) {
  const { document: e = $6 } = t;
  if (!e) return Z("visible");
  const n = Z(e.visibilityState);
  return (
    Fn(e, "visibilitychange", () => {
      n.value = e.visibilityState;
    }),
    n
  );
}
function Jie(t, e, n = {}) {
  const { window: r = Ui, ...i } = n;
  let o;
  const s = nm(() => r && "ResizeObserver" in r),
    a = () => {
      o && (o.disconnect(), (o = void 0));
    },
    l = re(() => (Array.isArray(t) ? t.map((f) => Di(f)) : [Di(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 sa(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 g = Di(t);
    if (!g) {
      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 m = g.getBoundingClientRect();
    (s.value = m.height),
      (a.value = m.bottom),
      (l.value = m.left),
      (c.value = m.right),
      (u.value = m.top),
      (f.value = m.width),
      (d.value = m.x),
      (h.value = m.y);
  }
  return (
    Jie(t, p),
    ve(
      () => Di(t),
      (g) => !g && p()
    ),
    zie(t, p, { attributeFilter: ["style", "class"] }),
    i && Fn("scroll", p, { capture: !0, passive: !0 }),
    r && Fn("resize", p, { passive: !0 }),
    tm(() => {
      o && p();
    }),
    {
      height: s,
      bottom: a,
      left: l,
      right: c,
      top: u,
      width: f,
      x: d,
      y: h,
      update: p,
    }
  );
}
const Hu = new Map();
function APe(t) {
  const e = Bd();
  function n(a) {
    var l;
    const c = Hu.get(t) || new Set();
    c.add(a), Hu.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 = Hu.get(t);
    l && (l.delete(a), l.size || o());
  }
  function o() {
    Hu.delete(t);
  }
  function s(a, l) {
    var c;
    (c = Hu.get(t)) == null || c.forEach((u) => u(a, l));
  }
  return { on: n, once: r, off: i, emit: s, reset: o };
}
const bA = 1;
function TPe(t, e = {}) {
  const {
      throttle: n = 0,
      idle: r = 200,
      onStop: i = gr,
      onScroll: o = gr,
      offset: s = { left: 0, right: 0, top: 0, bottom: 0 },
      eventListenerOptions: a = { capture: !1, passive: !0 },
      behavior: l = "auto",
      window: c = Ui,
      onError: u = (E) => {
        console.error(E);
      },
    } = e,
    f = Z(0),
    d = Z(0),
    h = re({
      get() {
        return f.value;
      },
      set(E) {
        g(E, void 0);
      },
    }),
    p = re({
      get() {
        return d.value;
      },
      set(E) {
        g(void 0, E);
      },
    });
  function g(E, S) {
    var P, C, A, T;
    if (!c) return;
    const I = ln(t);
    if (!I) return;
    (A = I instanceof Document ? c.document.body : I) == null ||
      A.scrollTo({
        top: (P = ln(S)) != null ? P : p.value,
        left: (C = ln(E)) != null ? C : h.value,
        behavior: ln(l),
      });
    const B =
      ((T = I == null ? void 0 : I.document) == null
        ? void 0
        : T.documentElement) ||
      (I == null ? void 0 : I.documentElement) ||
      I;
    h != null && (f.value = B.scrollLeft), p != null && (d.value = B.scrollTop);
  }
  const m = Z(!1),
    v = At({ left: !0, right: !1, top: !0, bottom: !1 }),
    y = At({ left: !1, right: !1, top: !1, bottom: !1 }),
    _ = (E) => {
      m.value &&
        ((m.value = !1),
        (y.left = !1),
        (y.right = !1),
        (y.top = !1),
        (y.bottom = !1),
        i(E));
    },
    x = Uie(_, n + r),
    b = (E) => {
      var S;
      if (!c) return;
      const P =
          ((S = E == null ? void 0 : E.document) == null
            ? void 0
            : S.documentElement) ||
          (E == null ? void 0 : E.documentElement) ||
          Di(E),
        { display: C, flexDirection: A } = getComputedStyle(P),
        T = P.scrollLeft;
      (y.left = T < f.value), (y.right = T > f.value);
      const I = Math.abs(T) <= (s.left || 0),
        B = Math.abs(T) + P.clientWidth >= P.scrollWidth - (s.right || 0) - bA;
      C === "flex" && A === "row-reverse"
        ? ((v.left = B), (v.right = I))
        : ((v.left = I), (v.right = B)),
        (f.value = T);
      let G = P.scrollTop;
      E === c.document && !G && (G = c.document.body.scrollTop),
        (y.top = G < d.value),
        (y.bottom = G > d.value);
      const D = Math.abs(G) <= (s.top || 0),
        $ =
          Math.abs(G) + P.clientHeight >= P.scrollHeight - (s.bottom || 0) - bA;
      C === "flex" && A === "column-reverse"
        ? ((v.top = $), (v.bottom = D))
        : ((v.top = D), (v.bottom = $)),
        (d.value = G);
    },
    w = (E) => {
      var S;
      if (!c) return;
      const P = (S = E.target.documentElement) != null ? S : E.target;
      b(P), (m.value = !0), x(E), o(E);
    };
  return (
    Fn(t, "scroll", n ? Gie(w, n, !0, !1) : w, a),
    tm(() => {
      try {
        const E = ln(t);
        if (!E) return;
        b(E);
      } catch (E) {
        u(E);
      }
    }),
    Fn(t, "scrollend", _, a),
    {
      x: h,
      y: p,
      isScrolling: m,
      arrivedState: v,
      directions: y,
      measure() {
        const E = ln(t);
        c && E && b(E);
      },
    }
  );
}
function g1(t) {
  return typeof Window < "u" && t instanceof Window
    ? t.document.documentElement
    : typeof Document < "u" && t instanceof Document
    ? t.documentElement
    : t;
}
function PPe(t, e, n = {}) {
  const { window: r = Ui } = n;
  return G6(t, e, r == null ? void 0 : r.localStorage, n);
}
function H6(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 : H6(n);
  }
}
function Qie(t) {
  const e = t || window.event,
    n = e.target;
  return H6(n)
    ? !1
    : e.touches.length > 1
    ? !0
    : (e.preventDefault && e.preventDefault(), !1);
}
const m1 = new WeakMap();
function IPe(t, e = !1) {
  const n = Z(e);
  let r = null,
    i = "";
  ve(
    N6(t),
    (a) => {
      const l = g1(ln(a));
      if (l) {
        const c = l;
        if (
          (m1.get(c) || m1.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 = g1(ln(t));
      !a ||
        n.value ||
        (C_ &&
          (r = Fn(
            a,
            "touchmove",
            (l) => {
              Qie(l);
            },
            { passive: !1 }
          )),
        (a.style.overflow = "hidden"),
        (n.value = !0));
    },
    s = () => {
      const a = g1(ln(t));
      !a ||
        !n.value ||
        (C_ && (r == null || r()),
        (a.style.overflow = i),
        m1.delete(a),
        (n.value = !1));
    };
  return (
    sa(s),
    re({
      get() {
        return n.value;
      },
      set(a) {
        a ? o() : s();
      },
    })
  );
}
function OPe(t, e, n = {}) {
  const { window: r = Ui } = n;
  return G6(t, e, r == null ? void 0 : r.sessionStorage, n);
}
let eoe = 0;
function RPe(t, e = {}) {
  const n = Z(!1),
    {
      document: r = $6,
      immediate: i = !0,
      manual: o = !1,
      id: s = `vueuse_styletag_${++eoe}`,
    } = 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 && tm(c),
    o || sa(u),
    { id: s, css: a, unload: u, load: c, isLoaded: Dl(n) }
  );
}
function MPe(t, e = {}) {
  const {
      threshold: n = 50,
      onSwipe: r,
      onSwipeEnd: i,
      onSwipeStart: o,
      passive: s = !0,
      window: a = Ui,
    } = e,
    l = At({ x: 0, y: 0 }),
    c = At({ 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),
    g = Z(!1),
    m = re(() =>
      p.value
        ? h(u.value) > h(f.value)
          ? u.value > 0
            ? "left"
            : "right"
          : f.value > 0
          ? "up"
          : "down"
        : "none"
    ),
    v = (P) => [P.touches[0].clientX, P.touches[0].clientY],
    y = (P, C) => {
      (l.x = P), (l.y = C);
    },
    _ = (P, C) => {
      (c.x = P), (c.y = C);
    };
  let x;
  const b = toe(a == null ? void 0 : a.document);
  s
    ? (x = b ? { passive: !0 } : { capture: !1 })
    : (x = b ? { passive: !1, capture: !0 } : { capture: !0 });
  const w = (P) => {
      g.value && (i == null || i(P, m.value)), (g.value = !1);
    },
    E = [
      Fn(
        t,
        "touchstart",
        (P) => {
          if (P.touches.length !== 1) return;
          x.capture && !x.passive && P.preventDefault();
          const [C, A] = v(P);
          y(C, A), _(C, A), o == null || o(P);
        },
        x
      ),
      Fn(
        t,
        "touchmove",
        (P) => {
          if (P.touches.length !== 1) return;
          const [C, A] = v(P);
          _(C, A),
            !g.value && p.value && (g.value = !0),
            g.value && (r == null || r(P));
        },
        x
      ),
      Fn(t, ["touchend", "touchcancel"], w, x),
    ];
  return {
    isPassiveEventSupported: b,
    isSwiping: g,
    direction: m,
    coordsStart: l,
    coordsEnd: c,
    lengthX: u,
    lengthY: f,
    stop: () => E.forEach((P) => P()),
  };
}
function toe(t) {
  if (!t) return !1;
  let e = !1;
  const n = {
    get passive() {
      return (e = !0), !1;
    },
  };
  return t.addEventListener("x", gr, n), t.removeEventListener("x", gr), e;
}
function DPe(t = "history", e = {}) {
  const {
    initialValue: n = {},
    removeNullishValues: r = !0,
    removeFalsyValues: i = !1,
    write: o = !0,
    window: s = Ui,
  } = e;
  if (!s) return At(n);
  const a = At({});
  function l() {
    if (t === "history") return s.location.search || "";
    if (t === "hash") {
      const v = s.location.hash || "",
        y = v.indexOf("?");
      return y > 0 ? v.slice(y) : "";
    } else return (s.location.hash || "").replace(/^#/, "");
  }
  function c(v) {
    const y = v.toString();
    if (t === "history") return `${y ? `?${y}` : ""}${s.location.hash || ""}`;
    if (t === "hash-params")
      return `${s.location.search || ""}${y ? `#${y}` : ""}`;
    const _ = s.location.hash || "#",
      x = _.indexOf("?");
    return x > 0
      ? `${_.slice(0, x)}${y ? `?${y}` : ""}`
      : `${_}${y ? `?${y}` : ""}`;
  }
  function u() {
    return new URLSearchParams(l());
  }
  function f(v) {
    const y = new Set(Object.keys(a));
    for (const _ of v.keys()) {
      const x = v.getAll(_);
      (a[_] = x.length > 1 ? x : v.get(_) || ""), y.delete(_);
    }
    Array.from(y).forEach((_) => delete a[_]);
  }
  const { pause: d, resume: h } = L6(
    a,
    () => {
      const v = new URLSearchParams("");
      Object.keys(a).forEach((y) => {
        const _ = a[y];
        Array.isArray(_)
          ? _.forEach((x) => v.append(y, x))
          : (r && _ == null) || (i && !_)
          ? v.delete(y)
          : v.set(y, _);
      }),
        p(v);
    },
    { deep: !0 }
  );
  function p(v, y) {
    d(),
      y && f(v),
      s.history.replaceState(
        s.history.state,
        s.document.title,
        s.location.pathname + c(v)
      ),
      h();
  }
  function g() {
    o && p(u(), !0);
  }
  Fn(s, "popstate", g, !1), t !== "history" && Fn(s, "hashchange", g, !1);
  const m = u();
  return m.keys().next().value ? f(m) : Object.assign(a, n), a;
}
function noe(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 g = c;
  e || (e = "modelValue"), (g = g || `update:${e.toString()}`);
  const m = (_) => (a ? (typeof a == "function" ? a(_) : Wie(_)) : _),
    v = () => (Rie(t[e]) ? m(t[e]) : f),
    y = (_) => {
      d ? d(_) && p(g, _) : p(g, _);
    };
  if (l) {
    const _ = v(),
      x = Z(_);
    let b = !1;
    return (
      ve(
        () => t[e],
        (w) => {
          b || ((b = !0), (x.value = m(w)), Xe(() => (b = !1)));
        }
      ),
      ve(
        x,
        (w) => {
          !b && (w !== t[e] || u) && y(w);
        },
        { deep: u }
      ),
      x
    );
  } else
    return re({
      get() {
        return v();
      },
      set(_) {
        y(_);
      },
    });
}
function BPe(t, e, n = {}) {
  const r = {};
  for (const i in t) r[i] = noe(t, i, e, n);
  return r;
}
/*!
 * vue-router v4.1.6
 * (c) 2022 Eduardo San Martin Morote
 * @license MIT
 */ const Uo = typeof window < "u";
function roe(t) {
  return t.__esModule || t[Symbol.toStringTag] === "Module";
}
const mt = Object.assign;
function v1(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 Pf = () => {},
  Yr = Array.isArray;
function Qe(t) {
  const e = Array.from(arguments).slice(1);
  console.warn.apply(console, ["[Vue Router warn]: " + t].concat(e));
}
const ioe = /\/$/,
  ooe = (t) => t.replace(ioe, "");
function y1(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 = loe(r ?? e, n)),
    { fullPath: r + (o && "?") + o + s, path: r, query: i, hash: s }
  );
}
function soe(t, e) {
  const n = e.query ? t(e.query) : "";
  return e.path + (n && "?") + n + (e.hash || "");
}
function wA(t, e) {
  return !e || !t.toLowerCase().startsWith(e.toLowerCase())
    ? t
    : t.slice(e.length) || "/";
}
function EA(t, e, n) {
  const r = e.matched.length - 1,
    i = n.matched.length - 1;
  return (
    r > -1 &&
    r === i &&
    la(e.matched[r], n.matched[i]) &&
    V6(e.params, n.params) &&
    t(e.query) === t(n.query) &&
    e.hash === n.hash
  );
}
function la(t, e) {
  return (t.aliasOf || t) === (e.aliasOf || e);
}
function V6(t, e) {
  if (Object.keys(t).length !== Object.keys(e).length) return !1;
  for (const n in t) if (!aoe(t[n], e[n])) return !1;
  return !0;
}
function aoe(t, e) {
  return Yr(t) ? SA(t, e) : Yr(e) ? SA(e, t) : t === e;
}
function SA(t, e) {
  return Yr(e)
    ? t.length === e.length && t.every((n, r) => n === e[r])
    : t.length === 1 && t[0] === e;
}
function loe(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 pd;
(function (t) {
  (t.pop = "pop"), (t.push = "push");
})(pd || (pd = {}));
var If;
(function (t) {
  (t.back = "back"), (t.forward = "forward"), (t.unknown = "");
})(If || (If = {}));
function coe(t) {
  if (!t)
    if (Uo) {
      const e = document.querySelector("base");
      (t = (e && e.getAttribute("href")) || "/"),
        (t = t.replace(/^\w+:\/\/[^\/]+/, ""));
    } else t = "/";
  return t[0] !== "/" && t[0] !== "#" && (t = "/" + t), ooe(t);
}
const uoe = /^[^#]+#/;
function foe(t, e) {
  return t.replace(uoe, "#") + e;
}
function doe(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 rm = () => ({ left: window.pageXOffset, top: window.pageYOffset });
function hoe(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 = doe(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 CA(t, e) {
  return (history.state ? history.state.position - e : -1) + t;
}
const A_ = new Map();
function poe(t, e) {
  A_.set(t, e);
}
function goe(t) {
  const e = A_.get(t);
  return A_.delete(t), e;
}
let moe = () => location.protocol + "//" + location.host;
function z6(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), wA(l, "");
  }
  return wA(n, t) + r + i;
}
function voe(t, e, n, r) {
  let i = [],
    o = [],
    s = null;
  const a = ({ state: d }) => {
    const h = z6(t, location),
      p = n.value,
      g = e.value;
    let m = 0;
    if (d) {
      if (((n.value = h), (e.value = d), s && s === p)) {
        s = null;
        return;
      }
      m = g ? d.position - g.position : 0;
    } else r(h);
    i.forEach((v) => {
      v(n.value, p, {
        delta: m,
        type: pd.pop,
        direction: m ? (m > 0 ? If.forward : If.back) : If.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: rm() }), "");
  }
  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 AA(t, e, n, r = !1, i = !1) {
  return {
    back: t,
    current: e,
    forward: n,
    replaced: r,
    position: window.history.length,
    scroll: i ? rm() : null,
  };
}
function yoe(t) {
  const { history: e, location: n } = window,
    r = { value: z6(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
          : moe() + 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, AA(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: rm() });
    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({}, AA(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 _oe(t) {
  t = coe(t);
  const e = yoe(t),
    n = voe(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: foe.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 kPe(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(/#.*$/, "#")}".`),
    _oe(t)
  );
}
function xoe(t) {
  return typeof t == "string" || (t && typeof t == "object");
}
function j6(t) {
  return typeof t == "string" || typeof t == "symbol";
}
const Cs = {
    path: "/",
    name: void 0,
    params: {},
    query: {},
    hash: "",
    fullPath: "/",
    matched: [],
    meta: {},
    redirectedFrom: void 0,
  },
  W6 = Symbol("navigation failure");
var TA;
(function (t) {
  (t[(t.aborted = 4)] = "aborted"),
    (t[(t.cancelled = 8)] = "cancelled"),
    (t[(t.duplicated = 16)] = "duplicated");
})(TA || (TA = {}));
const boe = {
  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 Zc(t, e) {
  return mt(new Error(boe[t](e)), { type: t, [W6]: !0 }, e);
}
function Oo(t, e) {
  return t instanceof Error && W6 in t && (e == null || !!(t.type & e));
}
const woe = ["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 woe) n in t && (e[n] = t[n]);
  return JSON.stringify(e, null, 2);
}
const PA = "[^/]+?",
  Soe = { sensitive: !1, strict: !1, start: !0, end: !0 },
  Coe = /[.+*?^${}()[\]/\\]/g;
function Aoe(t, e) {
  const n = mt({}, Soe, 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 ? 0.25 : 0);
      if (d.type === 0)
        f || (i += "/"), (i += d.value.replace(Coe, "\\$&")), (h += 40);
      else if (d.type === 1) {
        const { value: p, repeatable: g, optional: m, regexp: v } = d;
        o.push({ name: p, repeatable: g, optional: m });
        const y = v || PA;
        if (y !== PA) {
          h += 10;
          try {
            new RegExp(`(${y})`);
          } catch (x) {
            throw new Error(
              `Invalid custom RegExp for param "${p}" (${y}): ` + x.message
            );
          }
        }
        let _ = g ? `((?:${y})(?:/(?:${y}))*)` : `(${y})`;
        f || (_ = m && c.length < 2 ? `(?:/${_})` : "/" + _),
          m && (_ += "?"),
          (i += _),
          (h += 20),
          m && (h += -8),
          g && (h += -20),
          y === ".*" && (h += -50);
      }
      u.push(h);
    }
    r.push(u);
  }
  if (n.strict && n.end) {
    const c = r.length - 1;
    r[c][r[c].length - 1] += 0.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: g, optional: m } = h,
            v = p in c ? c[p] : "";
          if (Yr(v) && !g)
            throw new Error(
              `Provided param "${p}" is an array but it is not repeatable (* or + modifiers)`
            );
          const y = Yr(v) ? v.join("/") : v;
          if (!y)
            if (m)
              d.length < 2 &&
                (u.endsWith("/") ? (u = u.slice(0, -1)) : (f = !0));
            else throw new Error(`Missing required param "${p}"`);
          u += y;
        }
    }
    return u || "/";
  }
  return { re: s, score: r, keys: o, parse: a, stringify: l };
}
function Toe(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 Poe(t, e) {
  let n = 0;
  const r = t.score,
    i = e.score;
  for (; n < r.length && n < i.length; ) {
    const o = Toe(r[n], i[n]);
    if (o) return o;
    n++;
  }
  if (Math.abs(i.length - r.length) === 1) {
    if (IA(r)) return 1;
    if (IA(i)) return -1;
  }
  return i.length - r.length;
}
function IA(t) {
  const e = t[t.length - 1];
  return t.length > 0 && e[e.length - 1] < 0;
}
const Ioe = { type: 0, value: "" },
  Ooe = /[a-zA-Z0-9_]/;
function Roe(t) {
  if (!t) return [[]];
  if (t === "/") return [[Ioe]];
  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)
          : Ooe.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 Moe(t, e, n) {
  const r = Aoe(Roe(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 Doe(t, e) {
  const n = [],
    r = new Map();
  e = MA({ strict: !1, end: !0, sensitive: !1 }, e);
  function i(u) {
    return r.get(u);
  }
  function o(u, f, d) {
    const h = !d,
      p = Boe(u);
    Loe(p, f), (p.aliasOf = d && d.record);
    const g = MA(e, u),
      m = [p];
    if ("alias" in u) {
      const _ = typeof u.alias == "string" ? [u.alias] : u.alias;
      for (const x of _)
        m.push(
          mt({}, p, {
            components: d ? d.record.components : p.components,
            path: x,
            aliasOf: d ? d.record : p,
          })
        );
    }
    let v, y;
    for (const _ of m) {
      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 (
        ((v = Moe(_, f, g)),
        f && x[0] === "/" && $oe(v, f),
        d
          ? (d.alias.push(v), Foe(d, v))
          : ((y = y || v),
            y !== v && y.alias.push(v),
            h && u.name && !RA(v) && s(u.name)),
        p.children)
      ) {
        const b = p.children;
        for (let w = 0; w < b.length; w++) o(b[w], v, d && d.children[w]);
      }
      (d = d || v),
        ((v.record.components && Object.keys(v.record.components).length) ||
          v.record.name ||
          v.record.redirect) &&
          l(v);
    }
    return y
      ? () => {
          s(y);
        }
      : Pf;
  }
  function s(u) {
    if (j6(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 &&
      Poe(u, n[f]) >= 0 &&
      (u.record.path !== n[f].record.path || !Y6(u, n[f]));

    )
      f++;
    n.splice(f, 0, u), u.record.name && !RA(u) && r.set(u.record.name, u);
  }
  function c(u, f) {
    let d,
      h = {},
      p,
      g;
    if ("name" in u && u.name) {
      if (((d = r.get(u.name)), !d)) throw Zc(1, { location: u });
      {
        const y = Object.keys(u.params || {}).filter(
          (_) => !d.keys.find((x) => x.name === _)
        );
        y.length &&
          Qe(
            `Discarded invalid param(s) "${y.join(
              '", "'
            )}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`
          );
      }
      (g = d.record.name),
        (h = mt(
          OA(
            f.params,
            d.keys.filter((y) => !y.optional).map((y) => y.name)
          ),
          u.params &&
            OA(
              u.params,
              d.keys.map((y) => y.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((y) => y.re.test(p))),
        d && ((h = d.parse(p)), (g = d.record.name));
    else {
      if (((d = f.name ? r.get(f.name) : n.find((y) => y.re.test(f.path))), !d))
        throw Zc(1, { location: u, currentLocation: f });
      (g = d.record.name),
        (h = mt({}, f.params, u.params)),
        (p = d.stringify(h));
    }
    const m = [];
    let v = d;
    for (; v; ) m.unshift(v.record), (v = v.parent);
    return { name: g, path: p, params: h, matched: m, meta: Noe(m) };
  }
  return (
    t.forEach((u) => o(u)),
    {
      addRoute: o,
      resolve: c,
      removeRoute: s,
      getRoutes: a,
      getRecordMatcher: i,
    }
  );
}
function OA(t, e) {
  const n = {};
  for (const r of e) r in t && (n[r] = t[r]);
  return n;
}
function Boe(t) {
  return {
    path: t.path,
    redirect: t.redirect,
    name: t.name,
    meta: t.meta || {},
    aliasOf: void 0,
    beforeEnter: t.beforeEnter,
    props: koe(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 koe(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 RA(t) {
  for (; t; ) {
    if (t.record.aliasOf) return !0;
    t = t.parent;
  }
  return !1;
}
function Noe(t) {
  return t.reduce((e, n) => mt(e, n.meta), {});
}
function MA(t, e) {
  const n = {};
  for (const r in t) n[r] = r in e ? e[r] : t[r];
  return n;
}
function T_(t, e) {
  return (
    t.name === e.name &&
    t.optional === e.optional &&
    t.repeatable === e.repeatable
  );
}
function Foe(t, e) {
  for (const n of t.keys)
    if (!n.optional && !e.keys.find(T_.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(T_.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 Loe(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 $oe(t, e) {
  for (const n of e.keys)
    if (!t.keys.find(T_.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 Y6(t, e) {
  return e.children.some((n) => n === t || Y6(t, n));
}
const X6 = /#/g,
  Uoe = /&/g,
  Goe = /\//g,
  Hoe = /=/g,
  Voe = /\?/g,
  K6 = /\+/g,
  zoe = /%5B/g,
  joe = /%5D/g,
  q6 = /%5E/g,
  Woe = /%60/g,
  Z6 = /%7B/g,
  Yoe = /%7C/g,
  J6 = /%7D/g,
  Xoe = /%20/g;
function zw(t) {
  return encodeURI("" + t)
    .replace(Yoe, "|")
    .replace(zoe, "[")
    .replace(joe, "]");
}
function Koe(t) {
  return zw(t).replace(Z6, "{").replace(J6, "}").replace(q6, "^");
}
function P_(t) {
  return zw(t)
    .replace(K6, "%2B")
    .replace(Xoe, "+")
    .replace(X6, "%23")
    .replace(Uoe, "%26")
    .replace(Woe, "`")
    .replace(Z6, "{")
    .replace(J6, "}")
    .replace(q6, "^");
}
function qoe(t) {
  return P_(t).replace(Hoe, "%3D");
}
function Zoe(t) {
  return zw(t).replace(X6, "%23").replace(Voe, "%3F");
}
function Joe(t) {
  return t == null ? "" : Zoe(t).replace(Goe, "%2F");
}
function gd(t) {
  try {
    return decodeURIComponent("" + t);
  } catch {
    Qe(`Error decoding "${t}". Using original value`);
  }
  return "" + t;
}
function Qoe(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(K6, " "),
      s = o.indexOf("="),
      a = gd(s < 0 ? o : o.slice(0, s)),
      l = s < 0 ? null : gd(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 DA(t) {
  let e = "";
  for (let n in t) {
    const r = t[n];
    if (((n = qoe(n)), r == null)) {
      r !== void 0 && (e += (e.length ? "&" : "") + n);
      continue;
    }
    (Yr(r) ? r.map((o) => o && P_(o)) : [r && P_(r)]).forEach((o) => {
      o !== void 0 &&
        ((e += (e.length ? "&" : "") + n), o != null && (e += "=" + o));
    });
  }
  return e;
}
function ese(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 Q6 = Symbol("router view location matched"),
  BA = Symbol("router view depth"),
  im = Symbol("router"),
  jw = Symbol("route location"),
  I_ = Symbol("router view location");
function Vu() {
  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 tse(t, e, n) {
  const r = () => {
    t[e].delete(n);
  };
  ms(r),
    Eo(r),
    ps(() => {
      t[e].add(n);
    }),
    t[e].add(n);
}
function NPe(t) {
  if (!yt()) {
    Qe(
      "getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function"
    );
    return;
  }
  const e = hn(Q6, {}).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;
  }
  tse(e, "leaveGuards", t);
}
function Ds(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(Zc(4, { from: n, to: e }))
            : f instanceof Error
            ? a(f)
            : xoe(f)
            ? a(Zc(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, nse(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 nse(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 _1(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 (rse(a)) {
          const c = (a.__vccOpts || a)[e];
          c && i.push(Ds(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 = roe(c) ? c.default : c;
                o.components[s] = u;
                const d = (u.__vccOpts || u)[e];
                return d && Ds(d, n, r, o, s)();
              })
            );
        }
    }
  }
  return i;
}
function rse(t) {
  return (
    typeof t == "object" ||
    "displayName" in t ||
    "props" in t ||
    "__vccOpts" in t
  );
}
function kA(t) {
  const e = hn(im),
    n = hn(jw),
    r = re(() => e.resolve(hr(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(la.bind(null, u));
      if (d > -1) return d;
      const h = NA(l[c - 2]);
      return c > 1 && NA(u) === h && f[f.length - 1].path !== h
        ? f.findIndex(la.bind(null, l[c - 2]))
        : d;
    }),
    o = re(() => i.value > -1 && ase(n.params, r.value.params)),
    s = re(
      () =>
        i.value > -1 &&
        i.value === n.matched.length - 1 &&
        V6(n.params, r.value.params)
    );
  function a(l = {}) {
    return sse(l)
      ? e[hr(t.replace) ? "replace" : "push"](hr(t.to)).catch(Pf)
      : Promise.resolve();
  }
  if (Uo) {
    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),
        gu(
          () => {
            (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 ise = 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: kA,
    setup(t, { slots: e }) {
      const n = At(kA(t)),
        { options: r } = hn(im),
        i = re(() => ({
          [FA(t.activeClass, r.linkActiveClass, "router-link-active")]:
            n.isActive,
          [FA(
            t.exactActiveClass,
            r.linkExactActiveClass,
            "router-link-exact-active"
          )]: n.isExactActive,
        }));
      return () => {
        const o = e.default && e.default(n);
        return t.custom
          ? o
          : Bn(
              "a",
              {
                "aria-current": n.isExactActive ? t.ariaCurrentValue : null,
                href: n.href,
                onClick: n.navigate,
                class: i.value,
              },
              o
            );
      };
    },
  }),
  ose = ise;
function sse(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 ase(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 NA(t) {
  return t ? (t.aliasOf ? t.aliasOf.path : t.path) : "";
}
const FA = (t, e, n) => t ?? e ?? n,
  lse = we({
    name: "RouterView",
    inheritAttrs: !1,
    props: { name: { type: String, default: "default" }, route: Object },
    compatConfig: { MODE: 3 },
    setup(t, { attrs: e, slots: n }) {
      use();
      const r = hn(I_),
        i = re(() => t.route || r.value),
        o = hn(BA, 0),
        s = re(() => {
          let c = hr(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(
        BA,
        re(() => s.value + 1)
      ),
        hi(Q6, a),
        hi(I_, 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 || !la(u, h) || !d) &&
                (u.enterCallbacks[f] || []).forEach((g) => g(c));
          },
          { flush: "post" }
        ),
        () => {
          const c = i.value,
            u = t.name,
            f = a.value,
            d = f && f.components[u];
          if (!d) return LA(n.default, { Component: d, route: c });
          const h = f.props[u],
            p = h
              ? h === !0
                ? c.params
                : typeof h == "function"
                ? h(c)
                : h
              : null,
            m = Bn(
              d,
              mt({}, p, e, {
                onVnodeUnmounted: (v) => {
                  v.component.isUnmounted && (f.instances[u] = null);
                },
                ref: l,
              })
            );
          if (Uo && m.ref) {
            const v = {
              depth: s.value,
              name: f.name,
              path: f.path,
              meta: f.meta,
            };
            (Yr(m.ref) ? m.ref.map((_) => _.i) : [m.ref.i]).forEach((_) => {
              _.__vrv_devtools = v;
            });
          }
          return LA(n.default, { Component: m, route: c }) || m;
        }
      );
    },
  });
function LA(t, e) {
  if (!t) return null;
  const n = t(e);
  return n.length === 1 ? n[0] : n;
}
const cse = lse;
function use() {
  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 zu(t, e) {
  const n = mt({}, t, {
    matched: t.matched.map((r) => _se(r, ["instances", "children", "aliasOf"])),
  });
  return {
    _custom: {
      type: null,
      readOnly: !0,
      display: t.fullPath,
      tooltip: e,
      value: n,
    },
  };
}
function Jh(t) {
  return { _custom: { display: t } };
}
let fse = 0;
function dse(t, e, n) {
  if (e.__hasDevtools) return;
  e.__hasDevtools = !0;
  const r = fse++;
  Rg(
    {
      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: zu(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: eD,
            });
          }
          Yr(f.__vrl_devtools) &&
            ((f.__devtoolsApi = i),
            f.__vrl_devtools.forEach((d) => {
              let h = rD,
                p = "";
              d.isExactActive
                ? ((h = nD), (p = "This is exactly active"))
                : d.isActive && ((h = tD), (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: Jh("beforeEach"),
          from: zu(f, "Current Location during this navigation"),
          to: zu(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: Jh("afterEach") };
          d
            ? ((h.failure = {
                _custom: {
                  type: Error,
                  readOnly: !0,
                  display: d ? d.message : "",
                  tooltip: "Navigation Failure",
                  value: d,
                },
              }),
              (h.status = Jh("❌")))
            : (h.status = Jh("✅")),
            (h.from = zu(f, "Current Location during this navigation")),
            (h.to = zu(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(sD),
          u.filter && (f = f.filter((d) => O_(d, u.filter.toLowerCase()))),
          f.forEach((d) => oD(d, e.currentRoute.value)),
          (u.rootNodes = f.map(iD));
      }
      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: pse(d) });
          }
        }),
        i.sendInspectorTree(a),
        i.sendInspectorState(a);
    }
  );
}
function hse(t) {
  return t.optional ? (t.repeatable ? "*" : "?") : t.repeatable ? "+" : "";
}
function pse(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}${hse(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 eD = 15485081,
  tD = 2450411,
  nD = 8702998,
  gse = 2282478,
  rD = 16486972,
  mse = 6710886;
function iD(t) {
  const e = [],
    { record: n } = t;
  n.name != null &&
    e.push({ label: String(n.name), textColor: 0, backgroundColor: gse }),
    n.aliasOf && e.push({ label: "alias", textColor: 0, backgroundColor: rD }),
    t.__vd_match &&
      e.push({ label: "matches", textColor: 0, backgroundColor: eD }),
    t.__vd_exactActive &&
      e.push({ label: "exact", textColor: 0, backgroundColor: nD }),
    t.__vd_active &&
      e.push({ label: "active", textColor: 0, backgroundColor: tD }),
    n.redirect &&
      e.push({
        label:
          typeof n.redirect == "string"
            ? `redirect: ${n.redirect}`
            : "redirects",
        textColor: 16777215,
        backgroundColor: mse,
      });
  let r = n.__vd_id;
  return (
    r == null && ((r = String(vse++)), (n.__vd_id = r)),
    { id: r, label: n.path, tags: e, children: t.children.map(iD) }
  );
}
let vse = 0;
const yse = /^\/(.*)\/([a-z]*)$/;
function oD(t, e) {
  const n = e.matched.length && la(e.matched[e.matched.length - 1], t.record);
  (t.__vd_exactActive = t.__vd_active = n),
    n || (t.__vd_active = e.matched.some((r) => la(r, t.record))),
    t.children.forEach((r) => oD(r, e));
}
function sD(t) {
  (t.__vd_match = !1), t.children.forEach(sD);
}
function O_(t, e) {
  const n = String(t.re).match(yse);
  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) => O_(s, e)),
      t.record.path !== "/" || e === "/"
        ? ((t.__vd_match = t.re.test(e)), !0)
        : !1
    );
  const i = t.record.path.toLowerCase(),
    o = gd(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) => O_(s, e));
}
function _se(t, e) {
  const n = {};
  for (const r in t) e.includes(r) || (n[r] = t[r]);
  return n;
}
function FPe(t) {
  const e = Doe(t.routes, t),
    n = t.parseQuery || Qoe,
    r = t.stringifyQuery || DA,
    i = t.history;
  if (!i)
    throw new Error(
      'Provide the "history" option when calling "createRouter()": https://next.router.vuejs.org/api/#history.'
    );
  const o = Vu(),
    s = Vu(),
    a = Vu(),
    l = pg(Cs);
  let c = Cs;
  Uo &&
    t.scrollBehavior &&
    "scrollRestoration" in history &&
    (history.scrollRestoration = "manual");
  const u = v1.bind(null, (F) => "" + F),
    f = v1.bind(null, Joe),
    d = v1.bind(null, gd);
  function h(F, J) {
    let L, ne;
    return (
      j6(F) ? ((L = e.getRecordMatcher(F)), (ne = J)) : (ne = F),
      e.addRoute(ne, L)
    );
  }
  function p(F) {
    const J = e.getRecordMatcher(F);
    J
      ? e.removeRoute(J)
      : Qe(`Cannot remove non-existent route "${String(F)}"`);
  }
  function g() {
    return e.getRoutes().map((F) => F.record);
  }
  function m(F) {
    return !!e.getRecordMatcher(F);
  }
  function v(F, J) {
    if (((J = mt({}, J || l.value)), typeof F == "string")) {
      const xe = y1(n, F, J.path),
        O = e.resolve({ path: xe.path }, J),
        U = i.createHref(xe.fullPath);
      return (
        U.startsWith("//")
          ? Qe(
              `Location "${F}" resolved to "${U}". 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: gd(xe.hash),
          redirectedFrom: void 0,
          href: U,
        })
      );
    }
    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: y1(n, F.path, J.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) })), (J.params = f(J.params));
    }
    const ne = e.resolve(L, J),
      ee = F.hash || "";
    ee &&
      !ee.startsWith("#") &&
      Qe(
        `A \`hash\` should always start with the character "#". Replace "${ee}" with "#${ee}".`
      ),
      (ne.params = u(d(ne.params)));
    const de = soe(r, mt({}, F, { hash: Koe(ee), path: ne.path })),
      ge = i.createHref(de);
    return (
      ge.startsWith("//")
        ? Qe(
            `Location "${F}" resolved to "${ge}". A resolved location cannot start with multiple slashes.`
          )
        : ne.matched.length ||
          Qe(
            `No match found for location with path "${
              "path" in F ? F.path : F
            }"`
          ),
      mt(
        {
          fullPath: de,
          hash: ee,
          query: r === DA ? ese(F.query) : F.query || {},
        },
        ne,
        { redirectedFrom: void 0, href: ge }
      )
    );
  }
  function y(F) {
    return typeof F == "string" ? y1(n, F, l.value.path) : mt({}, F);
  }
  function _(F, J) {
    if (c !== F) return Zc(8, { from: J, to: F });
  }
  function x(F) {
    return E(F);
  }
  function b(F) {
    return x(mt(y(F), { replace: !0 }));
  }
  function w(F) {
    const J = F.matched[F.matched.length - 1];
    if (J && J.redirect) {
      const { redirect: L } = J;
      let ne = typeof L == "function" ? L(F) : L;
      if (
        (typeof ne == "string" &&
          ((ne =
            ne.includes("?") || ne.includes("#") ? (ne = y(ne)) : { path: ne }),
          (ne.params = {})),
        !("path" in ne) && !("name" in ne))
      )
        throw (
          (Qe(`Invalid redirect found:
${JSON.stringify(ne, 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 ne ? {} : F.params },
        ne
      );
    }
  }
  function E(F, J) {
    const L = (c = v(F)),
      ne = l.value,
      ee = F.state,
      de = F.force,
      ge = F.replace === !0,
      xe = w(L);
    if (xe)
      return E(
        mt(y(xe), {
          state: typeof xe == "object" ? mt({}, ee, xe.state) : ee,
          force: de,
          replace: ge,
        }),
        J || L
      );
    const O = L;
    O.redirectedFrom = J;
    let U;
    return (
      !de &&
        EA(r, ne, L) &&
        ((U = Zc(16, { to: O, from: ne })), fe(ne, ne, !0, !1)),
      (U ? Promise.resolve(U) : P(O, ne))
        .catch((W) => (Oo(W) ? (Oo(W, 2) ? W : K(W)) : $(W, O, ne)))
        .then((W) => {
          if (W) {
            if (Oo(W, 2))
              return EA(r, v(W.to), O) &&
                J &&
                (J._count = J._count ? J._count + 1 : 1) > 10
                ? (Qe(
                    `Detected an infinite redirection in a navigation guard when going from "${ne.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: ge }, y(W.to), {
                      state:
                        typeof W.to == "object" ? mt({}, ee, W.to.state) : ee,
                      force: de,
                    }),
                    J || O
                  );
          } else W = A(O, ne, !0, ge, ee);
          return C(O, ne, W), W;
        })
    );
  }
  function S(F, J) {
    const L = _(F, J);
    return L ? Promise.reject(L) : Promise.resolve();
  }
  function P(F, J) {
    let L;
    const [ne, ee, de] = xse(F, J);
    L = _1(ne.reverse(), "beforeRouteLeave", F, J);
    for (const xe of ne)
      xe.leaveGuards.forEach((O) => {
        L.push(Ds(O, F, J));
      });
    const ge = S.bind(null, F, J);
    return (
      L.push(ge),
      nc(L)
        .then(() => {
          L = [];
          for (const xe of o.list()) L.push(Ds(xe, F, J));
          return L.push(ge), nc(L);
        })
        .then(() => {
          L = _1(ee, "beforeRouteUpdate", F, J);
          for (const xe of ee)
            xe.updateGuards.forEach((O) => {
              L.push(Ds(O, F, J));
            });
          return L.push(ge), nc(L);
        })
        .then(() => {
          L = [];
          for (const xe of F.matched)
            if (xe.beforeEnter && !J.matched.includes(xe))
              if (Yr(xe.beforeEnter))
                for (const O of xe.beforeEnter) L.push(Ds(O, F, J));
              else L.push(Ds(xe.beforeEnter, F, J));
          return L.push(ge), nc(L);
        })
        .then(
          () => (
            F.matched.forEach((xe) => (xe.enterCallbacks = {})),
            (L = _1(de, "beforeRouteEnter", F, J)),
            L.push(ge),
            nc(L)
          )
        )
        .then(() => {
          L = [];
          for (const xe of s.list()) L.push(Ds(xe, F, J));
          return L.push(ge), nc(L);
        })
        .catch((xe) => (Oo(xe, 8) ? xe : Promise.reject(xe)))
    );
  }
  function C(F, J, L) {
    for (const ne of a.list()) ne(F, J, L);
  }
  function A(F, J, L, ne, ee) {
    const de = _(F, J);
    if (de) return de;
    const ge = J === Cs,
      xe = Uo ? history.state : {};
    L &&
      (ne || ge
        ? i.replace(F.fullPath, mt({ scroll: ge && xe && xe.scroll }, ee))
        : i.push(F.fullPath, ee)),
      (l.value = F),
      fe(F, J, L, ge),
      K();
  }
  let T;
  function I() {
    T ||
      (T = i.listen((F, J, L) => {
        if (!pe.listening) return;
        const ne = v(F),
          ee = w(ne);
        if (ee) {
          E(mt(ee, { replace: !0 }), ne).catch(Pf);
          return;
        }
        c = ne;
        const de = l.value;
        Uo && poe(CA(de.fullPath, L.delta), rm()),
          P(ne, de)
            .catch((ge) =>
              Oo(ge, 12)
                ? ge
                : Oo(ge, 2)
                ? (E(ge.to, ne)
                    .then((xe) => {
                      Oo(xe, 20) &&
                        !L.delta &&
                        L.type === pd.pop &&
                        i.go(-1, !1);
                    })
                    .catch(Pf),
                  Promise.reject())
                : (L.delta && i.go(-L.delta, !1), $(ge, ne, de))
            )
            .then((ge) => {
              (ge = ge || A(ne, de, !1)),
                ge &&
                  (L.delta && !Oo(ge, 8)
                    ? i.go(-L.delta, !1)
                    : L.type === pd.pop && Oo(ge, 20) && i.go(-1, !1)),
                C(ne, de, ge);
            })
            .catch(Pf);
      }));
  }
  let B = Vu(),
    G = Vu(),
    D;
  function $(F, J, L) {
    K(F);
    const ne = G.list();
    return (
      ne.length
        ? ne.forEach((ee) => ee(F, J, L))
        : (Qe("uncaught error during route navigation:"), console.error(F)),
      Promise.reject(F)
    );
  }
  function z() {
    return D && l.value !== Cs
      ? Promise.resolve()
      : new Promise((F, J) => {
          B.add([F, J]);
        });
  }
  function K(F) {
    return (
      D ||
        ((D = !F),
        I(),
        B.list().forEach(([J, L]) => (F ? L(F) : J())),
        B.reset()),
      F
    );
  }
  function fe(F, J, L, ne) {
    const { scrollBehavior: ee } = t;
    if (!Uo || !ee) return Promise.resolve();
    const de =
      (!L && goe(CA(F.fullPath, 0))) ||
      ((ne || !L) && history.state && history.state.scroll) ||
      null;
    return Xe()
      .then(() => ee(F, J, de))
      .then((ge) => ge && hoe(ge))
      .catch((ge) => $(ge, F, J));
  }
  const se = (F) => i.go(F);
  let Y;
  const te = new Set(),
    pe = {
      currentRoute: l,
      listening: !0,
      addRoute: h,
      removeRoute: p,
      hasRoute: m,
      getRoutes: g,
      resolve: v,
      options: t,
      push: x,
      replace: b,
      go: se,
      back: () => se(-1),
      forward: () => se(1),
      beforeEach: o.add,
      beforeResolve: s.add,
      afterEach: a.add,
      onError: G.add,
      isReady: z,
      install(F) {
        const J = this;
        F.component("RouterLink", ose),
          F.component("RouterView", cse),
          (F.config.globalProperties.$router = J),
          Object.defineProperty(F.config.globalProperties, "$route", {
            enumerable: !0,
            get: () => hr(l),
          }),
          Uo &&
            !Y &&
            l.value === Cs &&
            ((Y = !0),
            x(i.location).catch((ee) => {
              Qe("Unexpected error when starting the router:", ee);
            }));
        const L = {};
        for (const ee in Cs) L[ee] = re(() => l.value[ee]);
        F.provide(im, J), F.provide(jw, At(L)), F.provide(I_, l);
        const ne = F.unmount;
        te.add(F),
          (F.unmount = function () {
            te.delete(F),
              te.size < 1 &&
                ((c = Cs),
                T && T(),
                (T = null),
                (l.value = Cs),
                (Y = !1),
                (D = !1)),
              ne();
          }),
          Uo && dse(F, J, e);
      },
    };
  return pe;
}
function nc(t) {
  return t.reduce((e, n) => e.then(() => n()), Promise.resolve());
}
function xse(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) => la(c, a)) ? r.push(a) : n.push(a));
    const l = t.matched[s];
    l && (e.matched.find((c) => la(c, l)) || i.push(l));
  }
  return [n, r, i];
}
function LPe() {
  return hn(im);
}
function $Pe() {
  return hn(jw);
}
function aD(t, e) {
  return function () {
    return t.apply(e, arguments);
  };
}
const { toString: bse } = Object.prototype,
  { getPrototypeOf: Ww } = Object,
  { iterator: om, toStringTag: lD } = Symbol,
  sm = ((t) => (e) => {
    const n = bse.call(e);
    return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
  })(Object.create(null)),
  zi = (t) => ((t = t.toLowerCase()), (e) => sm(e) === t),
  am = (t) => (e) => typeof e === t,
  { isArray: bu } = Array,
  Jc = am("undefined");
function Qd(t) {
  return (
    t !== null &&
    !Jc(t) &&
    t.constructor !== null &&
    !Jc(t.constructor) &&
    Pr(t.constructor.isBuffer) &&
    t.constructor.isBuffer(t)
  );
}
const cD = zi("ArrayBuffer");
function wse(t) {
  let e;
  return (
    typeof ArrayBuffer < "u" && ArrayBuffer.isView
      ? (e = ArrayBuffer.isView(t))
      : (e = t && t.buffer && cD(t.buffer)),
    e
  );
}
const Ese = am("string"),
  Pr = am("function"),
  uD = am("number"),
  eh = (t) => t !== null && typeof t == "object",
  Sse = (t) => t === !0 || t === !1,
  Vp = (t) => {
    if (sm(t) !== "object") return !1;
    const e = Ww(t);
    return (
      (e === null ||
        e === Object.prototype ||
        Object.getPrototypeOf(e) === null) &&
      !(lD in t) &&
      !(om in t)
    );
  },
  Cse = (t) => {
    if (!eh(t) || Qd(t)) return !1;
    try {
      return (
        Object.keys(t).length === 0 &&
        Object.getPrototypeOf(t) === Object.prototype
      );
    } catch {
      return !1;
    }
  },
  Ase = zi("Date"),
  Tse = zi("File"),
  Pse = zi("Blob"),
  Ise = zi("FileList"),
  Ose = (t) => eh(t) && Pr(t.pipe),
  Rse = (t) => {
    let e;
    return (
      t &&
      ((typeof FormData == "function" && t instanceof FormData) ||
        (Pr(t.append) &&
          ((e = sm(t)) === "formdata" ||
            (e === "object" &&
              Pr(t.toString) &&
              t.toString() === "[object FormData]"))))
    );
  },
  Mse = zi("URLSearchParams"),
  [Dse, Bse, kse, Nse] = [
    "ReadableStream",
    "Request",
    "Response",
    "Headers",
  ].map(zi),
  Fse = (t) =>
    t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function th(t, e, { allOwnKeys: n = !1 } = {}) {
  if (t === null || typeof t > "u") return;
  let r, i;
  if ((typeof t != "object" && (t = [t]), bu(t)))
    for (r = 0, i = t.length; r < i; r++) e.call(null, t[r], r, t);
  else {
    if (Qd(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 fD(t, e) {
  if (Qd(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 Ya = (() =>
    typeof globalThis < "u"
      ? globalThis
      : typeof self < "u"
      ? self
      : typeof window < "u"
      ? window
      : global)(),
  dD = (t) => !Jc(t) && t !== Ya;
function R_() {
  const { caseless: t, skipUndefined: e } = (dD(this) && this) || {},
    n = {},
    r = (i, o) => {
      const s = (t && fD(n, o)) || o;
      Vp(n[s]) && Vp(i)
        ? (n[s] = R_(n[s], i))
        : Vp(i)
        ? (n[s] = R_({}, i))
        : bu(i)
        ? (n[s] = i.slice())
        : (!e || !Jc(i)) && (n[s] = i);
    };
  for (let i = 0, o = arguments.length; i < o; i++)
    arguments[i] && th(arguments[i], r);
  return n;
}
const Lse = (t, e, n, { allOwnKeys: r } = {}) => (
    th(
      e,
      (i, o) => {
        n && Pr(i) ? (t[o] = aD(i, n)) : (t[o] = i);
      },
      { allOwnKeys: r }
    ),
    t
  ),
  $se = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t),
  Use = (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);
  },
  Gse = (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 && Ww(t);
    } while (t && (!n || n(t, e)) && t !== Object.prototype);
    return e;
  },
  Hse = (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;
  },
  Vse = (t) => {
    if (!t) return null;
    if (bu(t)) return t;
    let e = t.length;
    if (!uD(e)) return null;
    const n = new Array(e);
    for (; e-- > 0; ) n[e] = t[e];
    return n;
  },
  zse = (
    (t) => (e) =>
      t && e instanceof t
  )(typeof Uint8Array < "u" && Ww(Uint8Array)),
  jse = (t, e) => {
    const r = (t && t[om]).call(t);
    let i;
    for (; (i = r.next()) && !i.done; ) {
      const o = i.value;
      e.call(t, o[0], o[1]);
    }
  },
  Wse = (t, e) => {
    let n;
    const r = [];
    for (; (n = t.exec(e)) !== null; ) r.push(n);
    return r;
  },
  Yse = zi("HTMLFormElement"),
  Xse = (t) =>
    t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function (n, r, i) {
      return r.toUpperCase() + i;
    }),
  $A = (
    ({ hasOwnProperty: t }) =>
    (e, n) =>
      t.call(e, n)
  )(Object.prototype),
  Kse = zi("RegExp"),
  hD = (t, e) => {
    const n = Object.getOwnPropertyDescriptors(t),
      r = {};
    th(n, (i, o) => {
      let s;
      (s = e(i, o, t)) !== !1 && (r[o] = s || i);
    }),
      Object.defineProperties(t, r);
  },
  qse = (t) => {
    hD(t, (e, n) => {
      if (Pr(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
        return !1;
      const r = t[n];
      if (Pr(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 + "'");
          });
      }
    });
  },
  Zse = (t, e) => {
    const n = {},
      r = (i) => {
        i.forEach((o) => {
          n[o] = !0;
        });
      };
    return bu(t) ? r(t) : r(String(t).split(e)), n;
  },
  Jse = () => {},
  Qse = (t, e) => (t != null && Number.isFinite((t = +t)) ? t : e);
function eae(t) {
  return !!(t && Pr(t.append) && t[lD] === "FormData" && t[om]);
}
const tae = (t) => {
    const e = new Array(10),
      n = (r, i) => {
        if (eh(r)) {
          if (e.indexOf(r) >= 0) return;
          if (Qd(r)) return r;
          if (!("toJSON" in r)) {
            e[i] = r;
            const o = bu(r) ? [] : {};
            return (
              th(r, (s, a) => {
                const l = n(s, i + 1);
                !Jc(l) && (o[a] = l);
              }),
              (e[i] = void 0),
              o
            );
          }
        }
        return r;
      };
    return n(t, 0);
  },
  nae = zi("AsyncFunction"),
  rae = (t) => t && (eh(t) || Pr(t)) && Pr(t.then) && Pr(t.catch),
  pD = ((t, e) =>
    t
      ? setImmediate
      : e
      ? ((n, r) => (
          Ya.addEventListener(
            "message",
            ({ source: i, data: o }) => {
              i === Ya && o === n && r.length && r.shift()();
            },
            !1
          ),
          (i) => {
            r.push(i), Ya.postMessage(n, "*");
          }
        ))(`axios@${Math.random()}`, [])
      : (n) => setTimeout(n))(
    typeof setImmediate == "function",
    Pr(Ya.postMessage)
  ),
  iae =
    typeof queueMicrotask < "u"
      ? queueMicrotask.bind(Ya)
      : (typeof process < "u" && process.nextTick) || pD,
  oae = (t) => t != null && Pr(t[om]),
  Q = {
    isArray: bu,
    isArrayBuffer: cD,
    isBuffer: Qd,
    isFormData: Rse,
    isArrayBufferView: wse,
    isString: Ese,
    isNumber: uD,
    isBoolean: Sse,
    isObject: eh,
    isPlainObject: Vp,
    isEmptyObject: Cse,
    isReadableStream: Dse,
    isRequest: Bse,
    isResponse: kse,
    isHeaders: Nse,
    isUndefined: Jc,
    isDate: Ase,
    isFile: Tse,
    isBlob: Pse,
    isRegExp: Kse,
    isFunction: Pr,
    isStream: Ose,
    isURLSearchParams: Mse,
    isTypedArray: zse,
    isFileList: Ise,
    forEach: th,
    merge: R_,
    extend: Lse,
    trim: Fse,
    stripBOM: $se,
    inherits: Use,
    toFlatObject: Gse,
    kindOf: sm,
    kindOfTest: zi,
    endsWith: Hse,
    toArray: Vse,
    forEachEntry: jse,
    matchAll: Wse,
    isHTMLForm: Yse,
    hasOwnProperty: $A,
    hasOwnProp: $A,
    reduceDescriptors: hD,
    freezeMethods: qse,
    toObjectSet: Zse,
    toCamelCase: Xse,
    noop: Jse,
    toFiniteNumber: Qse,
    findKey: fD,
    global: Ya,
    isContextDefined: dD,
    isSpecCompliantForm: eae,
    toJSONObject: tae,
    isAsyncFn: nae,
    isThenable: rae,
    setImmediate: pD,
    asap: iae,
    isIterable: oae,
  };
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));
}
Q.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: Q.toJSONObject(this.config),
      code: this.code,
      status: this.status,
    };
  },
});
const gD = Ye.prototype,
  mD = {};
[
  "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) => {
  mD[t] = { value: t };
});
Object.defineProperties(Ye, mD);
Object.defineProperty(gD, "isAxiosError", { value: !0 });
Ye.from = (t, e, n, r, i, o) => {
  const s = Object.create(gD);
  Q.toFlatObject(
    t,
    s,
    function (u) {
      return u !== Error.prototype;
    },
    (c) => c !== "isAxiosError"
  );
  const a = t && t.message ? t.message : "Error",
    l = e == null && t ? t.code : e;
  return (
    Ye.call(s, a, l, n, r, i),
    t &&
      s.cause == null &&
      Object.defineProperty(s, "cause", { value: t, configurable: !0 }),
    (s.name = (t && t.name) || "Error"),
    o && Object.assign(s, o),
    s
  );
};
const sae = null;
function M_(t) {
  return Q.isPlainObject(t) || Q.isArray(t);
}
function vD(t) {
  return Q.endsWith(t, "[]") ? t.slice(0, -2) : t;
}
function UA(t, e, n) {
  return t
    ? t
        .concat(e)
        .map(function (i, o) {
          return (i = vD(i)), !n && o ? "[" + i + "]" : i;
        })
        .join(n ? "." : "")
    : e;
}
function aae(t) {
  return Q.isArray(t) && !t.some(M_);
}
const lae = Q.toFlatObject(Q, {}, null, function (e) {
  return /^is[A-Z]/.test(e);
});
function lm(t, e, n) {
  if (!Q.isObject(t)) throw new TypeError("target must be an object");
  (e = e || new FormData()),
    (n = Q.toFlatObject(
      n,
      { metaTokens: !0, dots: !1, indexes: !1 },
      !1,
      function (g, m) {
        return !Q.isUndefined(m[g]);
      }
    ));
  const r = n.metaTokens,
    i = n.visitor || u,
    o = n.dots,
    s = n.indexes,
    l = (n.Blob || (typeof Blob < "u" && Blob)) && Q.isSpecCompliantForm(e);
  if (!Q.isFunction(i)) throw new TypeError("visitor must be a function");
  function c(p) {
    if (p === null) return "";
    if (Q.isDate(p)) return p.toISOString();
    if (Q.isBoolean(p)) return p.toString();
    if (!l && Q.isBlob(p))
      throw new Ye("Blob is not supported. Use a Buffer instead.");
    return Q.isArrayBuffer(p) || Q.isTypedArray(p)
      ? l && typeof Blob == "function"
        ? new Blob([p])
        : Buffer.from(p)
      : p;
  }
  function u(p, g, m) {
    let v = p;
    if (p && !m && typeof p == "object") {
      if (Q.endsWith(g, "{}"))
        (g = r ? g : g.slice(0, -2)), (p = JSON.stringify(p));
      else if (
        (Q.isArray(p) && aae(p)) ||
        ((Q.isFileList(p) || Q.endsWith(g, "[]")) && (v = Q.toArray(p)))
      )
        return (
          (g = vD(g)),
          v.forEach(function (_, x) {
            !(Q.isUndefined(_) || _ === null) &&
              e.append(
                s === !0 ? UA([g], x, o) : s === null ? g : g + "[]",
                c(_)
              );
          }),
          !1
        );
    }
    return M_(p) ? !0 : (e.append(UA(m, g, o), c(p)), !1);
  }
  const f = [],
    d = Object.assign(lae, {
      defaultVisitor: u,
      convertValue: c,
      isVisitable: M_,
    });
  function h(p, g) {
    if (!Q.isUndefined(p)) {
      if (f.indexOf(p) !== -1)
        throw Error("Circular reference detected in " + g.join("."));
      f.push(p),
        Q.forEach(p, function (v, y) {
          (!(Q.isUndefined(v) || v === null) &&
            i.call(e, v, Q.isString(y) ? y.trim() : y, g, d)) === !0 &&
            h(v, g ? g.concat(y) : [y]);
        }),
        f.pop();
    }
  }
  if (!Q.isObject(t)) throw new TypeError("data must be an object");
  return h(t), e;
}
function GA(t) {
  const e = {
    "!": "%21",
    "'": "%27",
    "(": "%28",
    ")": "%29",
    "~": "%7E",
    "%20": "+",
    "%00": "\0",
  };
  return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function (r) {
    return e[r];
  });
}
function Yw(t, e) {
  (this._pairs = []), t && lm(t, this, e);
}
const yD = Yw.prototype;
yD.append = function (e, n) {
  this._pairs.push([e, n]);
};
yD.toString = function (e) {
  const n = e
    ? function (r) {
        return e.call(this, r, GA);
      }
    : GA;
  return this._pairs
    .map(function (i) {
      return n(i[0]) + "=" + n(i[1]);
    }, "")
    .join("&");
};
function cae(t) {
  return encodeURIComponent(t)
    .replace(/%3A/gi, ":")
    .replace(/%24/g, "$")
    .replace(/%2C/gi, ",")
    .replace(/%20/g, "+");
}
function _D(t, e, n) {
  if (!e) return t;
  const r = (n && n.encode) || cae;
  Q.isFunction(n) && (n = { serialize: n });
  const i = n && n.serialize;
  let o;
  if (
    (i
      ? (o = i(e, n))
      : (o = Q.isURLSearchParams(e) ? e.toString() : new Yw(e, n).toString(r)),
    o)
  ) {
    const s = t.indexOf("#");
    s !== -1 && (t = t.slice(0, s)),
      (t += (t.indexOf("?") === -1 ? "?" : "&") + o);
  }
  return t;
}
class uae {
  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) {
    Q.forEach(this.handlers, function (r) {
      r !== null && e(r);
    });
  }
}
const HA = uae,
  xD = {
    silentJSONParsing: !0,
    forcedJSONParsing: !0,
    clarifyTimeoutError: !1,
  },
  fae = typeof URLSearchParams < "u" ? URLSearchParams : Yw,
  dae = typeof FormData < "u" ? FormData : null,
  hae = typeof Blob < "u" ? Blob : null,
  pae = {
    isBrowser: !0,
    classes: { URLSearchParams: fae, FormData: dae, Blob: hae },
    protocols: ["http", "https", "file", "blob", "url", "data"],
  },
  Xw = typeof window < "u" && typeof document < "u",
  D_ = (typeof navigator == "object" && navigator) || void 0,
  gae =
    Xw &&
    (!D_ || ["ReactNative", "NativeScript", "NS"].indexOf(D_.product) < 0),
  mae = (() =>
    typeof WorkerGlobalScope < "u" &&
    self instanceof WorkerGlobalScope &&
    typeof self.importScripts == "function")(),
  vae = (Xw && window.location.href) || "http://localhost",
  yae = Object.freeze(
    Object.defineProperty(
      {
        __proto__: null,
        hasBrowserEnv: Xw,
        hasStandardBrowserEnv: gae,
        hasStandardBrowserWebWorkerEnv: mae,
        navigator: D_,
        origin: vae,
      },
      Symbol.toStringTag,
      { value: "Module" }
    )
  ),
  Qn = { ...yae, ...pae };
function _ae(t, e) {
  return lm(t, new Qn.classes.URLSearchParams(), {
    visitor: function (n, r, i, o) {
      return Qn.isNode && Q.isBuffer(n)
        ? (this.append(r, n.toString("base64")), !1)
        : o.defaultVisitor.apply(this, arguments);
    },
    ...e,
  });
}
function xae(t) {
  return Q.matchAll(/\w+|\[(\w*)]/g, t).map((e) =>
    e[0] === "[]" ? "" : e[1] || e[0]
  );
}
function bae(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 bD(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 && Q.isArray(i) ? i.length : s),
      l
        ? (Q.hasOwnProp(i, s) ? (i[s] = [i[s], r]) : (i[s] = r), !a)
        : ((!i[s] || !Q.isObject(i[s])) && (i[s] = []),
          e(n, r, i[s], o) && Q.isArray(i[s]) && (i[s] = bae(i[s])),
          !a)
    );
  }
  if (Q.isFormData(t) && Q.isFunction(t.entries)) {
    const n = {};
    return (
      Q.forEachEntry(t, (r, i) => {
        e(xae(r), i, n, 0);
      }),
      n
    );
  }
  return null;
}
function wae(t, e, n) {
  if (Q.isString(t))
    try {
      return (e || JSON.parse)(t), Q.trim(t);
    } catch (r) {
      if (r.name !== "SyntaxError") throw r;
    }
  return (n || JSON.stringify)(t);
}
const Kw = {
  transitional: xD,
  adapter: ["xhr", "http", "fetch"],
  transformRequest: [
    function (e, n) {
      const r = n.getContentType() || "",
        i = r.indexOf("application/json") > -1,
        o = Q.isObject(e);
      if ((o && Q.isHTMLForm(e) && (e = new FormData(e)), Q.isFormData(e)))
        return i ? JSON.stringify(bD(e)) : e;
      if (
        Q.isArrayBuffer(e) ||
        Q.isBuffer(e) ||
        Q.isStream(e) ||
        Q.isFile(e) ||
        Q.isBlob(e) ||
        Q.isReadableStream(e)
      )
        return e;
      if (Q.isArrayBufferView(e)) return e.buffer;
      if (Q.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 _ae(e, this.formSerializer).toString();
        if ((a = Q.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
          const l = this.env && this.env.FormData;
          return lm(
            a ? { "files[]": e } : e,
            l && new l(),
            this.formSerializer
          );
        }
      }
      return o || i ? (n.setContentType("application/json", !1), wae(e)) : e;
    },
  ],
  transformResponse: [
    function (e) {
      const n = this.transitional || Kw.transitional,
        r = n && n.forcedJSONParsing,
        i = this.responseType === "json";
      if (Q.isResponse(e) || Q.isReadableStream(e)) return e;
      if (e && Q.isString(e) && ((r && !this.responseType) || i)) {
        const s = !(n && n.silentJSONParsing) && i;
        try {
          return JSON.parse(e, this.parseReviver);
        } 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,
    },
  },
};
Q.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
  Kw.headers[t] = {};
});
const qw = Kw,
  Eae = Q.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",
  ]),
  Sae = (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
    );
  },
  VA = Symbol("internals");
function ju(t) {
  return t && String(t).trim().toLowerCase();
}
function zp(t) {
  return t === !1 || t == null ? t : Q.isArray(t) ? t.map(zp) : String(t);
}
function Cae(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 Aae = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
function x1(t, e, n, r, i) {
  if (Q.isFunction(r)) return r.call(this, e, n);
  if ((i && (e = n), !!Q.isString(e))) {
    if (Q.isString(r)) return e.indexOf(r) !== -1;
    if (Q.isRegExp(r)) return r.test(e);
  }
}
function Tae(t) {
  return t
    .trim()
    .toLowerCase()
    .replace(/([a-z\d])(\w*)/g, (e, n, r) => n.toUpperCase() + r);
}
function Pae(t, e) {
  const n = Q.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 cm {
  constructor(e) {
    e && this.set(e);
  }
  set(e, n, r) {
    const i = this;
    function o(a, l, c) {
      const u = ju(l);
      if (!u) throw new Error("header name must be a non-empty string");
      const f = Q.findKey(i, u);
      (!f || i[f] === void 0 || c === !0 || (c === void 0 && i[f] !== !1)) &&
        (i[f || l] = zp(a));
    }
    const s = (a, l) => Q.forEach(a, (c, u) => o(c, u, l));
    if (Q.isPlainObject(e) || e instanceof this.constructor) s(e, n);
    else if (Q.isString(e) && (e = e.trim()) && !Aae(e)) s(Sae(e), n);
    else if (Q.isObject(e) && Q.isIterable(e)) {
      let a = {},
        l,
        c;
      for (const u of e) {
        if (!Q.isArray(u))
          throw TypeError("Object iterator must return a key-value pair");
        a[(c = u[0])] = (l = a[c])
          ? Q.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 = ju(e)), e)) {
      const r = Q.findKey(this, e);
      if (r) {
        const i = this[r];
        if (!n) return i;
        if (n === !0) return Cae(i);
        if (Q.isFunction(n)) return n.call(this, i, r);
        if (Q.isRegExp(n)) return n.exec(i);
        throw new TypeError("parser must be boolean|regexp|function");
      }
    }
  }
  has(e, n) {
    if (((e = ju(e)), e)) {
      const r = Q.findKey(this, e);
      return !!(r && this[r] !== void 0 && (!n || x1(this, this[r], r, n)));
    }
    return !1;
  }
  delete(e, n) {
    const r = this;
    let i = !1;
    function o(s) {
      if (((s = ju(s)), s)) {
        const a = Q.findKey(r, s);
        a && (!n || x1(r, r[a], a, n)) && (delete r[a], (i = !0));
      }
    }
    return Q.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 || x1(this, this[o], o, e, !0)) && (delete this[o], (i = !0));
    }
    return i;
  }
  normalize(e) {
    const n = this,
      r = {};
    return (
      Q.forEach(this, (i, o) => {
        const s = Q.findKey(r, o);
        if (s) {
          (n[s] = zp(i)), delete n[o];
          return;
        }
        const a = e ? Tae(o) : String(o).trim();
        a !== o && delete n[o], (n[a] = zp(i)), (r[a] = !0);
      }),
      this
    );
  }
  concat(...e) {
    return this.constructor.concat(this, ...e);
  }
  toJSON(e) {
    const n = Object.create(null);
    return (
      Q.forEach(this, (r, i) => {
        r != null && r !== !1 && (n[i] = e && Q.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[VA] = this[VA] = { accessors: {} }).accessors,
      i = this.prototype;
    function o(s) {
      const a = ju(s);
      r[a] || (Pae(i, s), (r[a] = !0));
    }
    return Q.isArray(e) ? e.forEach(o) : o(e), this;
  }
}
cm.accessor([
  "Content-Type",
  "Content-Length",
  "Accept",
  "Accept-Encoding",
  "User-Agent",
  "Authorization",
]);
Q.reduceDescriptors(cm.prototype, ({ value: t }, e) => {
  let n = e[0].toUpperCase() + e.slice(1);
  return {
    get: () => t,
    set(r) {
      this[n] = r;
    },
  };
});
Q.freezeMethods(cm);
const Fi = cm;
function b1(t, e) {
  const n = this || qw,
    r = e || n,
    i = Fi.from(r.headers);
  let o = r.data;
  return (
    Q.forEach(t, function (a) {
      o = a.call(n, o, i.normalize(), e ? e.status : void 0);
    }),
    i.normalize(),
    o
  );
}
function wD(t) {
  return !!(t && t.__CANCEL__);
}
function wu(t, e, n) {
  Ye.call(this, t ?? "canceled", Ye.ERR_CANCELED, e, n),
    (this.name = "CanceledError");
}
Q.inherits(wu, Ye, { __CANCEL__: !0 });
function ED(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 Iae(t) {
  const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
  return (e && e[1]) || "";
}
function Oae(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 Rae(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 T0 = (t, e, n = 3) => {
    let r = 0;
    const i = Oae(50, 250);
    return Rae((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);
  },
  zA = (t, e) => {
    const n = t != null;
    return [(r) => e[0]({ lengthComputable: n, total: t, loaded: r }), e[1]];
  },
  jA =
    (t) =>
    (...e) =>
      Q.asap(() => t(...e)),
  Mae = 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,
  Dae = Qn.hasStandardBrowserEnv
    ? {
        write(t, e, n, r, i, o) {
          const s = [t + "=" + encodeURIComponent(e)];
          Q.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()),
            Q.isString(r) && s.push("path=" + r),
            Q.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 Bae(t) {
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
}
function kae(t, e) {
  return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
}
function SD(t, e, n) {
  let r = !Bae(e);
  return t && (r || n == !1) ? kae(t, e) : e;
}
const WA = (t) => (t instanceof Fi ? { ...t } : t);
function xl(t, e) {
  e = e || {};
  const n = {};
  function r(c, u, f, d) {
    return Q.isPlainObject(c) && Q.isPlainObject(u)
      ? Q.merge.call({ caseless: d }, c, u)
      : Q.isPlainObject(u)
      ? Q.merge({}, u)
      : Q.isArray(u)
      ? u.slice()
      : u;
  }
  function i(c, u, f, d) {
    if (Q.isUndefined(u)) {
      if (!Q.isUndefined(c)) return r(void 0, c, f, d);
    } else return r(c, u, f, d);
  }
  function o(c, u) {
    if (!Q.isUndefined(u)) return r(void 0, u);
  }
  function s(c, u) {
    if (Q.isUndefined(u)) {
      if (!Q.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(WA(c), WA(u), f, !0),
  };
  return (
    Q.forEach(Object.keys({ ...t, ...e }), function (u) {
      const f = l[u] || i,
        d = f(t[u], e[u], u);
      (Q.isUndefined(d) && f !== a) || (n[u] = d);
    }),
    n
  );
}
const CD = (t) => {
    const e = xl({}, t);
    let {
      data: n,
      withXSRFToken: r,
      xsrfHeaderName: i,
      xsrfCookieName: o,
      headers: s,
      auth: a,
    } = e;
    if (
      ((e.headers = s = Fi.from(s)),
      (e.url = _D(
        SD(e.baseURL, e.url, e.allowAbsoluteUrls),
        t.params,
        t.paramsSerializer
      )),
      a &&
        s.set(
          "Authorization",
          "Basic " +
            btoa(
              (a.username || "") +
                ":" +
                (a.password ? unescape(encodeURIComponent(a.password)) : "")
            )
        ),
      Q.isFormData(n))
    ) {
      if (Qn.hasStandardBrowserEnv || Qn.hasStandardBrowserWebWorkerEnv)
        s.setContentType(void 0);
      else if (Q.isFunction(n.getHeaders)) {
        const l = n.getHeaders(),
          c = ["content-type", "content-length"];
        Object.entries(l).forEach(([u, f]) => {
          c.includes(u.toLowerCase()) && s.set(u, f);
        });
      }
    }
    if (
      Qn.hasStandardBrowserEnv &&
      (r && Q.isFunction(r) && (r = r(e)), r || (r !== !1 && Mae(e.url)))
    ) {
      const l = i && o && Dae.read(o);
      l && s.set(i, l);
    }
    return e;
  },
  Nae = typeof XMLHttpRequest < "u",
  Fae =
    Nae &&
    function (t) {
      return new Promise(function (n, r) {
        const i = CD(t);
        let o = i.data;
        const s = Fi.from(i.headers).normalize();
        let { responseType: a, onUploadProgress: l, onDownloadProgress: c } = i,
          u,
          f,
          d,
          h,
          p;
        function g() {
          h && h(),
            p && p(),
            i.cancelToken && i.cancelToken.unsubscribe(u),
            i.signal && i.signal.removeEventListener("abort", u);
        }
        let m = new XMLHttpRequest();
        m.open(i.method.toUpperCase(), i.url, !0), (m.timeout = i.timeout);
        function v() {
          if (!m) return;
          const _ = Fi.from(
              "getAllResponseHeaders" in m && m.getAllResponseHeaders()
            ),
            b = {
              data:
                !a || a === "text" || a === "json"
                  ? m.responseText
                  : m.response,
              status: m.status,
              statusText: m.statusText,
              headers: _,
              config: t,
              request: m,
            };
          ED(
            function (E) {
              n(E), g();
            },
            function (E) {
              r(E), g();
            },
            b
          ),
            (m = null);
        }
        "onloadend" in m
          ? (m.onloadend = v)
          : (m.onreadystatechange = function () {
              !m ||
                m.readyState !== 4 ||
                (m.status === 0 &&
                  !(m.responseURL && m.responseURL.indexOf("file:") === 0)) ||
                setTimeout(v);
            }),
          (m.onabort = function () {
            m &&
              (r(new Ye("Request aborted", Ye.ECONNABORTED, t, m)), (m = null));
          }),
          (m.onerror = function (x) {
            const b = x && x.message ? x.message : "Network Error",
              w = new Ye(b, Ye.ERR_NETWORK, t, m);
            (w.event = x || null), r(w), (m = null);
          }),
          (m.ontimeout = function () {
            let x = i.timeout
              ? "timeout of " + i.timeout + "ms exceeded"
              : "timeout exceeded";
            const b = i.transitional || xD;
            i.timeoutErrorMessage && (x = i.timeoutErrorMessage),
              r(
                new Ye(
                  x,
                  b.clarifyTimeoutError ? Ye.ETIMEDOUT : Ye.ECONNABORTED,
                  t,
                  m
                )
              ),
              (m = null);
          }),
          o === void 0 && s.setContentType(null),
          "setRequestHeader" in m &&
            Q.forEach(s.toJSON(), function (x, b) {
              m.setRequestHeader(b, x);
            }),
          Q.isUndefined(i.withCredentials) ||
            (m.withCredentials = !!i.withCredentials),
          a && a !== "json" && (m.responseType = i.responseType),
          c && (([d, p] = T0(c, !0)), m.addEventListener("progress", d)),
          l &&
            m.upload &&
            (([f, h] = T0(l)),
            m.upload.addEventListener("progress", f),
            m.upload.addEventListener("loadend", h)),
          (i.cancelToken || i.signal) &&
            ((u = (_) => {
              m &&
                (r(!_ || _.type ? new wu(null, t, m) : _),
                m.abort(),
                (m = null));
            }),
            i.cancelToken && i.cancelToken.subscribe(u),
            i.signal &&
              (i.signal.aborted ? u() : i.signal.addEventListener("abort", u)));
        const y = Iae(i.url);
        if (y && Qn.protocols.indexOf(y) === -1) {
          r(new Ye("Unsupported protocol " + y + ":", Ye.ERR_BAD_REQUEST, t));
          return;
        }
        m.send(o || null);
      });
    },
  Lae = (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 wu(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 = () => Q.asap(a)), l;
    }
  },
  $ae = Lae,
  Uae = 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);
  },
  Gae = async function* (t, e) {
    for await (const n of Hae(t)) yield* Uae(n, e);
  },
  Hae = 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();
    }
  },
  YA = (t, e, n, r) => {
    const i = Gae(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 }
    );
  },
  XA = 64 * 1024,
  { isFunction: Qh } = Q,
  Vae = (({ Request: t, Response: e }) => ({ Request: t, Response: e }))(
    Q.global
  ),
  { ReadableStream: KA, TextEncoder: qA } = Q.global,
  ZA = (t, ...e) => {
    try {
      return !!t(...e);
    } catch {
      return !1;
    }
  },
  zae = (t) => {
    t = Q.merge.call({ skipUndefined: !0 }, Vae, t);
    const { fetch: e, Request: n, Response: r } = t,
      i = e ? Qh(e) : typeof fetch == "function",
      o = Qh(n),
      s = Qh(r);
    if (!i) return !1;
    const a = i && Qh(KA),
      l =
        i &&
        (typeof qA == "function"
          ? (
              (p) => (g) =>
                p.encode(g)
            )(new qA())
          : async (p) => new Uint8Array(await new n(p).arrayBuffer())),
      c =
        o &&
        a &&
        ZA(() => {
          let p = !1;
          const g = new n(Qn.origin, {
            body: new KA(),
            method: "POST",
            get duplex() {
              return (p = !0), "half";
            },
          }).headers.has("Content-Type");
          return p && !g;
        }),
      u = s && a && ZA(() => Q.isReadableStream(new r("").body)),
      f = { stream: u && ((p) => p.body) };
    i &&
      ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((p) => {
        !f[p] &&
          (f[p] = (g, m) => {
            let v = g && g[p];
            if (v) return v.call(g);
            throw new Ye(
              `Response type '${p}' is not supported`,
              Ye.ERR_NOT_SUPPORT,
              m
            );
          });
      });
    const d = async (p) => {
        if (p == null) return 0;
        if (Q.isBlob(p)) return p.size;
        if (Q.isSpecCompliantForm(p))
          return (
            await new n(Qn.origin, { method: "POST", body: p }).arrayBuffer()
          ).byteLength;
        if (Q.isArrayBufferView(p) || Q.isArrayBuffer(p)) return p.byteLength;
        if ((Q.isURLSearchParams(p) && (p = p + ""), Q.isString(p)))
          return (await l(p)).byteLength;
      },
      h = async (p, g) => {
        const m = Q.toFiniteNumber(p.getContentLength());
        return m ?? d(g);
      };
    return async (p) => {
      let {
          url: g,
          method: m,
          data: v,
          signal: y,
          cancelToken: _,
          timeout: x,
          onDownloadProgress: b,
          onUploadProgress: w,
          responseType: E,
          headers: S,
          withCredentials: P = "same-origin",
          fetchOptions: C,
        } = CD(p),
        A = e || fetch;
      E = E ? (E + "").toLowerCase() : "text";
      let T = $ae([y, _ && _.toAbortSignal()], x),
        I = null;
      const B =
        T &&
        T.unsubscribe &&
        (() => {
          T.unsubscribe();
        });
      let G;
      try {
        if (
          w &&
          c &&
          m !== "get" &&
          m !== "head" &&
          (G = await h(S, v)) !== 0
        ) {
          let se = new n(g, { method: "POST", body: v, duplex: "half" }),
            Y;
          if (
            (Q.isFormData(v) &&
              (Y = se.headers.get("content-type")) &&
              S.setContentType(Y),
            se.body)
          ) {
            const [te, pe] = zA(G, T0(jA(w)));
            v = YA(se.body, XA, te, pe);
          }
        }
        Q.isString(P) || (P = P ? "include" : "omit");
        const D = o && "credentials" in n.prototype,
          $ = {
            ...C,
            signal: T,
            method: m.toUpperCase(),
            headers: S.normalize().toJSON(),
            body: v,
            duplex: "half",
            credentials: D ? P : void 0,
          };
        I = o && new n(g, $);
        let z = await (o ? A(I, C) : A(g, $));
        const K = u && (E === "stream" || E === "response");
        if (u && (b || (K && B))) {
          const se = {};
          ["status", "statusText", "headers"].forEach((F) => {
            se[F] = z[F];
          });
          const Y = Q.toFiniteNumber(z.headers.get("content-length")),
            [te, pe] = (b && zA(Y, T0(jA(b), !0))) || [];
          z = new r(
            YA(z.body, XA, te, () => {
              pe && pe(), B && B();
            }),
            se
          );
        }
        E = E || "text";
        let fe = await f[Q.findKey(f, E) || "text"](z, p);
        return (
          !K && B && B(),
          await new Promise((se, Y) => {
            ED(se, Y, {
              data: fe,
              headers: Fi.from(z.headers),
              status: z.status,
              statusText: z.statusText,
              config: p,
              request: I,
            });
          })
        );
      } catch (D) {
        throw (
          (B && B(),
          D && D.name === "TypeError" && /Load failed|fetch/i.test(D.message)
            ? Object.assign(new Ye("Network Error", Ye.ERR_NETWORK, p, I), {
                cause: D.cause || D,
              })
            : Ye.from(D, D && D.code, p, I))
        );
      }
    };
  },
  jae = new Map(),
  AD = (t) => {
    let e = t ? t.env : {};
    const { fetch: n, Request: r, Response: i } = e,
      o = [r, i, n];
    let s = o.length,
      a = s,
      l,
      c,
      u = jae;
    for (; a--; )
      (l = o[a]),
        (c = u.get(l)),
        c === void 0 && u.set(l, (c = a ? new Map() : zae(e))),
        (u = c);
    return c;
  };
AD();
const B_ = { http: sae, xhr: Fae, fetch: { get: AD } };
Q.forEach(B_, (t, e) => {
  if (t) {
    try {
      Object.defineProperty(t, "name", { value: e });
    } catch {}
    Object.defineProperty(t, "adapterName", { value: e });
  }
});
const JA = (t) => `- ${t}`,
  Wae = (t) => Q.isFunction(t) || t === null || t === !1,
  TD = {
    getAdapter: (t, e) => {
      t = Q.isArray(t) ? t : [t];
      const { length: n } = t;
      let r, i;
      const o = {};
      for (let s = 0; s < n; s++) {
        r = t[s];
        let a;
        if (
          ((i = r),
          !Wae(r) && ((i = B_[(a = String(r)).toLowerCase()]), i === void 0))
        )
          throw new Ye(`Unknown adapter '${a}'`);
        if (i && (Q.isFunction(i) || (i = i.get(e)))) break;
        o[a || "#" + s] = i;
      }
      if (!i) {
        const s = Object.entries(o).map(
          ([l, c]) =>
            `adapter ${l} ` +
            (c === !1
              ? "is not supported by the environment"
              : "is not available in the build")
        );
        let a = n
          ? s.length > 1
            ? `since :
` +
              s.map(JA).join(`
`)
            : " " + JA(s[0])
          : "as no adapter specified";
        throw new Ye(
          "There is no suitable adapter to dispatch the request " + a,
          "ERR_NOT_SUPPORT"
        );
      }
      return i;
    },
    adapters: B_,
  };
function w1(t) {
  if (
    (t.cancelToken && t.cancelToken.throwIfRequested(),
    t.signal && t.signal.aborted)
  )
    throw new wu(null, t);
}
function QA(t) {
  return (
    w1(t),
    (t.headers = Fi.from(t.headers)),
    (t.data = b1.call(t, t.transformRequest)),
    ["post", "put", "patch"].indexOf(t.method) !== -1 &&
      t.headers.setContentType("application/x-www-form-urlencoded", !1),
    TD.getAdapter(
      t.adapter || qw.adapter,
      t
    )(t).then(
      function (r) {
        return (
          w1(t),
          (r.data = b1.call(t, t.transformResponse, r)),
          (r.headers = Fi.from(r.headers)),
          r
        );
      },
      function (r) {
        return (
          wD(r) ||
            (w1(t),
            r &&
              r.response &&
              ((r.response.data = b1.call(t, t.transformResponse, r.response)),
              (r.response.headers = Fi.from(r.response.headers)))),
          Promise.reject(r)
        );
      }
    )
  );
}
const PD = "1.12.2",
  um = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach(
  (t, e) => {
    um[t] = function (r) {
      return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
    };
  }
);
const eT = {};
um.transitional = function (e, n, r) {
  function i(o, s) {
    return (
      "[Axios v" +
      PD +
      "] 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 &&
        !eT[s] &&
        ((eT[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
    );
  };
};
um.spelling = function (e) {
  return (n, r) => (console.warn(`${r} is likely a misspelling of ${e}`), !0);
};
function Yae(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 jp = { assertOptions: Yae, validators: um },
  qi = jp.validators;
class P0 {
  constructor(e) {
    (this.defaults = e || {}),
      (this.interceptors = { request: new HA(), response: new HA() });
  }
  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 = xl(this.defaults, n));
    const { transitional: r, paramsSerializer: i, headers: o } = n;
    r !== void 0 &&
      jp.assertOptions(
        r,
        {
          silentJSONParsing: qi.transitional(qi.boolean),
          forcedJSONParsing: qi.transitional(qi.boolean),
          clarifyTimeoutError: qi.transitional(qi.boolean),
        },
        !1
      ),
      i != null &&
        (Q.isFunction(i)
          ? (n.paramsSerializer = { serialize: i })
          : jp.assertOptions(
              i,
              { encode: qi.function, serialize: qi.function },
              !0
            )),
      n.allowAbsoluteUrls !== void 0 ||
        (this.defaults.allowAbsoluteUrls !== void 0
          ? (n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls)
          : (n.allowAbsoluteUrls = !0)),
      jp.assertOptions(
        n,
        {
          baseUrl: qi.spelling("baseURL"),
          withXsrfToken: qi.spelling("withXSRFToken"),
        },
        !0
      ),
      (n.method = (n.method || this.defaults.method || "get").toLowerCase());
    let s = o && Q.merge(o.common, o[n.method]);
    o &&
      Q.forEach(
        ["delete", "get", "head", "post", "put", "patch", "common"],
        (p) => {
          delete o[p];
        }
      ),
      (n.headers = Fi.concat(s, o));
    const a = [];
    let l = !0;
    this.interceptors.request.forEach(function (g) {
      (typeof g.runWhen == "function" && g.runWhen(n) === !1) ||
        ((l = l && g.synchronous), a.unshift(g.fulfilled, g.rejected));
    });
    const c = [];
    this.interceptors.response.forEach(function (g) {
      c.push(g.fulfilled, g.rejected);
    });
    let u,
      f = 0,
      d;
    if (!l) {
      const p = [QA.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 < d; ) {
      const p = a[f++],
        g = a[f++];
      try {
        h = p(h);
      } catch (m) {
        g.call(this, m);
        break;
      }
    }
    try {
      u = QA.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 = xl(this.defaults, e);
    const n = SD(e.baseURL, e.url, e.allowAbsoluteUrls);
    return _D(n, e.params, e.paramsSerializer);
  }
}
Q.forEach(["delete", "get", "head", "options"], function (e) {
  P0.prototype[e] = function (n, r) {
    return this.request(
      xl(r || {}, { method: e, url: n, data: (r || {}).data })
    );
  };
});
Q.forEach(["post", "put", "patch"], function (e) {
  function n(r) {
    return function (o, s, a) {
      return this.request(
        xl(a || {}, {
          method: e,
          headers: r ? { "Content-Type": "multipart/form-data" } : {},
          url: o,
          data: s,
        })
      );
    };
  }
  (P0.prototype[e] = n()), (P0.prototype[e + "Form"] = n(!0));
});
const Wp = P0;
class Zw {
  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 wu(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 Zw(function (i) {
        e = i;
      }),
      cancel: e,
    };
  }
}
const Xae = Zw;
function Kae(t) {
  return function (n) {
    return t.apply(null, n);
  };
}
function qae(t) {
  return Q.isObject(t) && t.isAxiosError === !0;
}
const k_ = {
  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(k_).forEach(([t, e]) => {
  k_[e] = t;
});
const Zae = k_;
function ID(t) {
  const e = new Wp(t),
    n = aD(Wp.prototype.request, e);
  return (
    Q.extend(n, Wp.prototype, e, { allOwnKeys: !0 }),
    Q.extend(n, e, null, { allOwnKeys: !0 }),
    (n.create = function (i) {
      return ID(xl(t, i));
    }),
    n
  );
}
const mn = ID(qw);
mn.Axios = Wp;
mn.CanceledError = wu;
mn.CancelToken = Xae;
mn.isCancel = wD;
mn.VERSION = PD;
mn.toFormData = lm;
mn.AxiosError = Ye;
mn.Cancel = mn.CanceledError;
mn.all = function (e) {
  return Promise.all(e);
};
mn.spread = Kae;
mn.isAxiosError = qae;
mn.mergeConfig = xl;
mn.AxiosHeaders = Fi;
mn.formToJSON = (t) => bD(Q.isHTMLForm(t) ? new FormData(t) : t);
mn.getAdapter = TD.getAdapter;
mn.HttpStatusCode = Zae;
mn.default = mn;
const UPe = mn;
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 N_ = (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;
  },
  ep = (t, e) => N_(t).priority ?? e,
  $e = {
    _addHandlers: {},
    _removeHandlers: {},
    _queue: {},
    remove(...t) {
      return (
        t.map(N_).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(N_).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) => ep(s.value, n) - ep(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) => ep(o, n) - ep(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)
        );
    },
  },
  Jae = {
    extension: { type: V.Environment, name: "browser", priority: -1 },
    test: () => !0,
    load: async () => {
      await Wf(() => Promise.resolve().then(() => Jve), void 0);
    },
  },
  Qae = {
    extension: { type: V.Environment, name: "webworker", priority: 0 },
    test: () => typeof self < "u" && self.WorkerGlobalScope !== void 0,
    load: async () => {
      await Wf(() => Promise.resolve().then(() => Qve), 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 OD = { 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 g = n ? n + c : c;
      if (!this._events[g]) return !1;
      var m = this._events[g],
        v = arguments.length,
        y,
        _;
      if (m.fn) {
        switch ((m.once && this.removeListener(c, m.fn, void 0, !0), v)) {
          case 1:
            return m.fn.call(m.context), !0;
          case 2:
            return m.fn.call(m.context, u), !0;
          case 3:
            return m.fn.call(m.context, u, f), !0;
          case 4:
            return m.fn.call(m.context, u, f, d), !0;
          case 5:
            return m.fn.call(m.context, u, f, d, h), !0;
          case 6:
            return m.fn.call(m.context, u, f, d, h, p), !0;
        }
        for (_ = 1, y = new Array(v - 1); _ < v; _++) y[_ - 1] = arguments[_];
        m.fn.apply(m.context, y);
      } else {
        var x = m.length,
          b;
        for (_ = 0; _ < x; _++)
          switch (
            (m[_].once && this.removeListener(c, m[_].fn, void 0, !0), v)
          ) {
            case 1:
              m[_].fn.call(m[_].context);
              break;
            case 2:
              m[_].fn.call(m[_].context, u);
              break;
            case 3:
              m[_].fn.call(m[_].context, u, f);
              break;
            case 4:
              m[_].fn.call(m[_].context, u, f, d);
              break;
            default:
              if (!y)
                for (b = 1, y = new Array(v - 1); b < v; b++)
                  y[b - 1] = arguments[b];
              m[_].fn.apply(m[_].context, y);
          }
      }
      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 g = 0, m = [], v = p.length; g < v; g++)
          (p[g].fn !== u || (d && !p[g].once) || (f && p[g].context !== f)) &&
            m.push(p[g]);
        m.length ? (this._events[h] = m.length === 1 ? m[0] : m) : 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);
})(OD);
var ele = OD.exports;
const Jr = fa(ele),
  tle = Math.PI * 2,
  nle = 180 / Math.PI,
  rle = Math.PI / 180;
let Gt = class RD {
  constructor(e = 0, n = 0) {
    (this.x = 0), (this.y = 0), (this.x = e), (this.y = n);
  }
  clone() {
    return new RD(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 (E1.x = 0), (E1.y = 0), E1;
  }
};
const E1 = new Gt();
class Re {
  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(tle - 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 Re();
    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 ole.identity();
  }
  static get shared() {
    return ile.identity();
  }
}
const ile = new Re(),
  ole = new Re(),
  Da = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1],
  Ba = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1],
  ka = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1],
  Na = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1],
  F_ = [],
  MD = [],
  tp = Math.sign;
function sle() {
  for (let t = 0; t < 16; t++) {
    const e = [];
    F_.push(e);
    for (let n = 0; n < 16; n++) {
      const r = tp(Da[t] * Da[n] + ka[t] * Ba[n]),
        i = tp(Ba[t] * Da[n] + Na[t] * Ba[n]),
        o = tp(Da[t] * ka[n] + ka[t] * Na[n]),
        s = tp(Ba[t] * ka[n] + Na[t] * Na[n]);
      for (let a = 0; a < 16; a++)
        if (Da[a] === r && Ba[a] === i && ka[a] === o && Na[a] === s) {
          e.push(a);
          break;
        }
    }
  }
  for (let t = 0; t < 16; t++) {
    const e = new Re();
    e.set(Da[t], Ba[t], ka[t], Na[t], 0, 0), MD.push(e);
  }
}
sle();
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) => Da[t],
    uY: (t) => Ba[t],
    vX: (t) => ka[t],
    vY: (t) => Na[t],
    inv: (t) => (t & 8 ? t & 15 : -t & 7),
    add: (t, e) => F_[t][e],
    sub: (t, e) => F_[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 = MD[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);
    },
  },
  np = [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 = 0.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,
      g = a + u,
      m = a + o - u,
      v = l + u,
      y = l + s - u;
    return (
      e >= f &&
      e <= d &&
      n >= h &&
      n <= p &&
      !(e > g && e < m && n > v && n < y)
    );
  }
  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 = np[0].set(e.left, e.top),
      l = np[1].set(e.left, e.bottom),
      c = np[2].set(e.right, e.top),
      u = np[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,
      g = d * i + h * o,
      m = d * r + h * s,
      v = d * i + h * s;
    if (
      Math.max(p, g, m, v) <= d * a.x + h * a.y ||
      Math.min(p, g, m, v) >= d * u.x + h * u.y
    )
      return !1;
    const y = f * (a.y - c.y),
      _ = f * (c.x - a.x),
      x = y * r + _ * o,
      b = y * i + _ * o,
      w = y * r + _ * s,
      E = y * i + _ * s;
    return !(
      Math.max(x, b, w, E) <= y * a.x + _ * a.y ||
      Math.min(x, b, w, E) >= y * 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 = 0.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 S1 = { default: -1 };
function Ot(t = "default") {
  return S1[t] === void 0 && (S1[t] = -1), ++S1[t];
}
const tT = new Set(),
  tt = "8.0.0",
  ale = "8.3.4",
  bc = { quiet: !1, noColor: !1 },
  ke = (t, e, n = 3) => {
    if (bc.quiet || tT.has(e)) return;
    let r = new Error().stack;
    const i = `${e}
Deprecated since v${t}`,
      o = typeof console.groupCollapsed == "function" && !bc.noColor;
    typeof r > "u"
      ? console.warn("PixiJS Deprecation Warning: ", i)
      : ((r = r
          .split(
            `
`
          )
          .splice(n).join(`
`)),
        o
          ? (console.groupCollapsed(
              "%cPixiJS Deprecation Warning: %c%s",
              "color:#614108;background:#fffbe6",
              "font-weight:normal;color:#614108;background:#fffbe6",
              i
            ),
            console.warn(r),
            console.groupEnd())
          : (console.warn("PixiJS Deprecation Warning: ", i), console.warn(r))),
      tT.add(e);
  };
Object.defineProperties(ke, {
  quiet: {
    get: () => bc.quiet,
    set: (t) => {
      bc.quiet = t;
    },
    enumerable: !0,
    configurable: !1,
  },
  noColor: {
    get: () => bc.noColor,
    set: (t) => {
      bc.noColor = t;
    },
    enumerable: !0,
    configurable: !1,
  },
});
const DD = () => {};
function Qc(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 nT(t) {
  return !(t & (t - 1)) && !!t;
}
function BD(t) {
  const e = {};
  for (const n in t) t[n] !== void 0 && (e[n] = t[n]);
  return e;
}
const rT = Object.create(null);
function lle(t) {
  const e = rT[t];
  return e === void 0 && (rT[t] = Ot("resource")), e;
}
const kD = class ND extends Jr {
  constructor(e = {}) {
    super(),
      (this._resourceType = "textureSampler"),
      (this._touched = 0),
      (this._maxAnisotropy = 1),
      (this.destroyed = !1),
      (e = { ...ND.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) {
    ke(tt, "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 = lle(e)), this._resourceId;
  }
  destroy() {
    (this.destroyed = !0),
      this.emit("destroy", this),
      this.emit("change", this),
      this.removeAllListeners();
  }
};
kD.defaultOptions = { addressMode: "clamp-to-edge", scaleMode: "linear" };
let xo = kD;
const FD = class LD extends Jr {
  constructor(e = {}) {
    super(),
      (this.options = e),
      (this.uid = Ot("textureSource")),
      (this._resourceType = "textureSource"),
      (this._resourceId = Ot("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 = { ...LD.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 xo(BD(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 = Ot("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 = Ot("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 = nT(this.pixelWidth) && nT(this.pixelHeight);
  }
  static test(e) {
    throw new Error("Unimplemented");
  }
};
FD.defaultOptions = {
  resolution: 1,
  format: "bgra8unorm",
  alphaMode: "premultiply-alpha-on-upload",
  dimensions: "2d",
  mipLevelCount: 1,
  autoGenerateMipmaps: !1,
  sampleCount: 1,
  antialias: !1,
  autoGarbageCollect: !1,
};
let Tn = FD;
class Jw extends Tn {
  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
    );
  }
}
Jw.extension = V.TextureSource;
const iT = new Re();
class $D {
  constructor(e, n) {
    (this.mapCoord = new Re()),
      (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 : 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 &&
      (iT.set(
        r.width / i.width,
        0,
        0,
        r.height / i.height,
        -i.x / i.width,
        -i.y / i.height
      ),
      this.mapCoord.append(iT));
    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 = Ot("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 Tn()),
      (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 $D(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 ke(tt, "Texture.baseTexture is now Texture.source"), this._source;
  }
}
Ae.EMPTY = new Ae({ label: "EMPTY", source: new Tn({ label: "EMPTY" }) });
Ae.EMPTY.destroy = DD;
Ae.WHITE = new Ae({
  source: new Jw({
    resource: new Uint8Array([255, 255, 255, 255]),
    width: 1,
    height: 1,
    alphaMode: "premultiply-alpha-on-upload",
    label: "WHITE",
  }),
  label: "WHITE",
});
Ae.WHITE.destroy = DD;
function UD(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 oT = new Re();
class jn {
  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 = oT),
      (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 = oT),
      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,
      g = this.maxY,
      m = s * e + l * n + u,
      v = a * e + c * n + f;
    m < d && (d = m),
      v < h && (h = v),
      m > p && (p = m),
      v > g && (g = v),
      (m = s * r + l * n + u),
      (v = a * r + c * n + f),
      m < d && (d = m),
      v < h && (h = v),
      m > p && (p = m),
      v > g && (g = v),
      (m = s * e + l * i + u),
      (v = a * e + c * i + f),
      m < d && (d = m),
      v < h && (h = v),
      m > p && (p = m),
      v > g && (g = v),
      (m = s * r + l * i + u),
      (v = a * r + c * i + f),
      m < d && (d = m),
      v < h && (h = v),
      m > p && (p = m),
      v > g && (g = v),
      (this.minX = d),
      (this.minY = h),
      (this.maxX = p),
      (this.maxY = g);
  }
  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 jn(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 g = n; g < r; g += 2) {
      const m = e[g],
        v = e[g + 1],
        y = c * m + f * v + h,
        _ = u * m + d * v + p;
      (o = y < o ? y : o),
        (s = _ < s ? _ : s),
        (a = y > a ? y : 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 cle = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) },
  Ro = function (t) {
    return typeof t == "string" ? t.length > 0 : typeof t == "number";
  },
  Mn = 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
    );
  },
  GD = function (t) {
    return (t = isFinite(t) ? t % 360 : 0) > 0 ? t : t + 360;
  },
  sT = 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),
    };
  },
  C1 = function (t) {
    return { r: Mn(t.r), g: Mn(t.g), b: Mn(t.b), a: Mn(t.a, 3) };
  },
  ule = /^#([0-9a-f]{3,8})$/i,
  rp = function (t) {
    var e = t.toString(16);
    return e.length < 2 ? "0" + e : e;
  },
  HD = 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,
    };
  },
  VD = 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,
    };
  },
  aT = function (t) {
    return { h: GD(t.h), s: ui(t.s, 0, 100), l: ui(t.l, 0, 100), a: ui(t.a) };
  },
  lT = function (t) {
    return { h: Mn(t.h), s: Mn(t.s), l: Mn(t.l), a: Mn(t.a, 3) };
  },
  cT = function (t) {
    return VD(
      ((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;
  },
  Of = function (t) {
    return {
      h: (e = HD(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;
  },
  fle =
    /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,
  dle =
    /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,
  hle =
    /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,
  ple =
    /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,
  L_ = {
    string: [
      [
        function (t) {
          var e = ule.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 ? Mn(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
                      ? Mn(parseInt(t.substr(6, 2), 16) / 255, 2)
                      : 1,
                }
              : null
            : null;
        },
        "hex",
      ],
      [
        function (t) {
          var e = hle.exec(t) || ple.exec(t);
          return e
            ? e[2] !== e[4] || e[4] !== e[6]
              ? null
              : sT({
                  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 = fle.exec(t) || dle.exec(t);
          if (!e) return null;
          var n,
            r,
            i = aT({
              h:
                ((n = e[1]),
                (r = e[2]),
                r === void 0 && (r = "deg"),
                Number(n) * (cle[r] || 1)),
              s: Number(e[3]),
              l: Number(e[4]),
              a: e[5] === void 0 ? 1 : Number(e[5]) / (e[6] ? 100 : 1),
            });
          return cT(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 Ro(e) && Ro(n) && Ro(r)
            ? sT({ 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 (!Ro(e) || !Ro(n) || !Ro(r)) return null;
          var s = aT({
            h: Number(e),
            s: Number(n),
            l: Number(r),
            a: Number(o),
          });
          return cT(s);
        },
        "hsl",
      ],
      [
        function (t) {
          var e = t.h,
            n = t.s,
            r = t.v,
            i = t.a,
            o = i === void 0 ? 1 : i;
          if (!Ro(e) || !Ro(n) || !Ro(r)) return null;
          var s = (function (a) {
            return {
              h: GD(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 VD(s);
        },
        "hsv",
      ],
    ],
  },
  uT = 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];
  },
  gle = function (t) {
    return typeof t == "string"
      ? uT(t.trim(), L_.string)
      : typeof t == "object" && t !== null
      ? uT(t, L_.object)
      : [null, void 0];
  },
  A1 = function (t, e) {
    var n = Of(t);
    return { h: n.h, s: ui(n.s + 100 * e, 0, 100), l: n.l, a: n.a };
  },
  T1 = function (t) {
    return (299 * t.r + 587 * t.g + 114 * t.b) / 1e3 / 255;
  },
  fT = function (t, e) {
    var n = Of(t);
    return { h: n.h, s: n.s, l: ui(n.l + 100 * e, 0, 100), a: n.a };
  },
  $_ = (function () {
    function t(e) {
      (this.parsed = gle(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 Mn(T1(this.rgba), 2);
      }),
      (t.prototype.isDark = function () {
        return T1(this.rgba) < 0.5;
      }),
      (t.prototype.isLight = function () {
        return T1(this.rgba) >= 0.5;
      }),
      (t.prototype.toHex = function () {
        return (
          (e = C1(this.rgba)),
          (n = e.r),
          (r = e.g),
          (i = e.b),
          (s = (o = e.a) < 1 ? rp(Mn(255 * o)) : ""),
          "#" + rp(n) + rp(r) + rp(i) + s
        );
        var e, n, r, i, o, s;
      }),
      (t.prototype.toRgb = function () {
        return C1(this.rgba);
      }),
      (t.prototype.toRgbString = function () {
        return (
          (e = C1(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 lT(Of(this.rgba));
      }),
      (t.prototype.toHslString = function () {
        return (
          (e = lT(Of(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 = HD(this.rgba)),
          { h: Mn(e.h), s: Mn(e.s), v: Mn(e.v), a: Mn(e.a, 3) }
        );
        var e;
      }),
      (t.prototype.invert = function () {
        return Ji({
          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 = 0.1), Ji(A1(this.rgba, e));
      }),
      (t.prototype.desaturate = function (e) {
        return e === void 0 && (e = 0.1), Ji(A1(this.rgba, -e));
      }),
      (t.prototype.grayscale = function () {
        return Ji(A1(this.rgba, -1));
      }),
      (t.prototype.lighten = function (e) {
        return e === void 0 && (e = 0.1), Ji(fT(this.rgba, e));
      }),
      (t.prototype.darken = function (e) {
        return e === void 0 && (e = 0.1), Ji(fT(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"
          ? Ji({ r: (n = this.rgba).r, g: n.g, b: n.b, a: e })
          : Mn(this.rgba.a, 3);
        var n;
      }),
      (t.prototype.hue = function (e) {
        var n = Of(this.rgba);
        return typeof e == "number"
          ? Ji({ h: e, s: n.s, l: n.l, a: n.a })
          : Mn(n.h);
      }),
      (t.prototype.isEqual = function (e) {
        return this.toHex() === Ji(e).toHex();
      }),
      t
    );
  })(),
  Ji = function (t) {
    return t instanceof $_ ? t : new $_(t);
  },
  dT = [],
  mle = function (t) {
    t.forEach(function (e) {
      dT.indexOf(e) < 0 && (e($_, L_), dT.push(e));
    });
  };
function vle(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 g =
          ((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));
        g < f && ((f = g), (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",
    ]);
}
mle([vle]);
const eu = class lf {
  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 lf)
      (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] = lf._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 + 0.5) | 0),
        (i = (i * e + 0.5) | 0),
        (o = (o * e + 0.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 = lf.HEX_PATTERN.exec(e);
        a && (e = `#${a[2]}`);
      }
      const s = Ji(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 lf ||
      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)
    );
  }
};
eu.shared = new eu();
eu._temp = new eu();
eu.HEX_PATTERN = /^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;
let Ut = eu;
const yle = { cullArea: null, cullable: !1, cullableChildren: !0 };
let P1 = 0;
const hT = 500;
function Fe(...t) {
  P1 !== hT &&
    (P1++,
    P1 === hT
      ? console.warn(
          "PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."
        )
      : console.warn("PixiJS Warning: ", ...t));
}
const Eu = {
  _registeredResources: new Set(),
  register(t) {
    this._registeredResources.add(t);
  },
  unregister(t) {
    this._registeredResources.delete(t);
  },
  release() {
    this._registeredResources.forEach((t) => t.clear());
  },
  get registeredCount() {
    return this._registeredResources.size;
  },
  isRegistered(t) {
    return this._registeredResources.has(t);
  },
  reset() {
    this._registeredResources.clear();
  },
};
class _le {
  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() {
    if (this._pool.length > 0 && this._pool[0].destroy)
      for (let e = 0; e < this._index; e++) this._pool[e].destroy();
    (this._pool.length = 0), (this._count = 0), (this._index = 0);
  }
}
class xle {
  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 _le(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
    );
  }
  clear() {
    this._poolsByClass.forEach((e) => e.clear()), this._poolsByClass.clear();
  }
}
const gn = new xle();
Eu.register(gn);
const ble = {
  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) {
    ke("v8.6.0", "cacheAsBitmap is deprecated, use cacheAsTexture instead."),
      this.cacheAsTexture(t);
  },
};
function zD(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 wle = {
    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));
        }
        zD(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 ||
        ke(
          tt,
          "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);
    },
  },
  Ele = {
    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 I0 {
  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 Sle {
  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 gn.get(r.maskClass, e);
    }
    return e;
  }
  returnMaskEffect(e) {
    gn.return(e);
  }
}
const U_ = new Sle();
$e.handleByList(V.MaskEffect, U_._effectClasses);
const Cle = {
    _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),
          U_.returnMaskEffect(e),
          (this._maskEffect = null)),
        t != null &&
          ((this._maskEffect = U_.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 I0());
      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 I0()),
        (this._filterEffect.filterArea = t);
    },
    get filterArea() {
      var t;
      return (t = this._filterEffect) == null ? void 0 : t.filterArea;
    },
  },
  Ale = {
    label: null,
    get name() {
      return (
        ke(
          tt,
          "Container.name property has been removed, use Container.label instead"
        ),
        this.label
      );
    },
    set name(t) {
      ke(
        tt,
        "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;
    },
  },
  dr = gn.getPool(Re),
  qo = gn.getPool(jn),
  Tle = new Re(),
  Ple = {
    getFastGlobalBounds(t, e) {
      e || (e = new jn()),
        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 = qo.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(Tle).invert()),
          e.addBounds(r),
          qo.return(r);
      } else
        this.renderGroup &&
          (e.addBounds(r, this.relativeGroupTransform), qo.return(r));
    },
  };
function Qw(t, e, n) {
  n.clear();
  let r, i;
  return (
    t.parent
      ? e
        ? (r = t.parent.worldTransform)
        : ((i = dr.get().identity()), (r = e2(t, i)))
      : (r = Re.IDENTITY),
    jD(t, n, r, e),
    i && dr.return(i),
    n.isValid || n.set(0, 0, 0, 0),
    n
  );
}
function jD(t, e, n, r) {
  var a, l;
  if (!t.visible || !t.measurable) return;
  let i;
  r
    ? (i = t.worldTransform)
    : (t.updateLocalTransform(),
      (i = dr.get()),
      i.appendFrom(t.localTransform, n));
  const o = e,
    s = !!t.effects.length;
  if ((s && (e = qo.get().clear()), t.boundsArea)) e.addRect(t.boundsArea, i);
  else {
    const c = t.bounds;
    c && !c.isEmpty() && ((e.matrix = i), e.addBounds(c));
    for (let u = 0; u < t.children.length; u++) jD(t.children[u], 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, Re.IDENTITY), qo.return(e);
  }
  r || dr.return(i);
}
function e2(t, e) {
  const n = t.parent;
  return (
    n && (e2(n, e), n.updateLocalTransform(), e.append(n.localTransform)), e
  );
}
function WD(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 pT = 16777215;
function O0(t, e) {
  return t === pT ? e : e === pT ? t : WD(t, e);
}
function Rf(t) {
  return ((t & 255) << 16) + (t & 65280) + ((t >> 16) & 255);
}
const Ile = {
  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 Re(), e) {
    if (e) return t.copyFrom(this.worldTransform);
    this.updateLocalTransform();
    const n = e2(this, dr.get().identity());
    return t.appendFrom(this.localTransform, n), dr.return(n), t;
  },
  getGlobalTint(t) {
    if (t)
      return this.renderGroup
        ? Rf(this.renderGroup.worldColor)
        : this.parentRenderGroup
        ? Rf(O0(this.localColor, this.parentRenderGroup.worldColor))
        : this.tint;
    let e = this.localColor,
      n = this.parent;
    for (; n; ) (e = O0(e, n.localColor)), (n = n.parent);
    return Rf(e);
  },
};
function t2(t, e, n) {
  return (
    e.clear(),
    n || (n = Re.IDENTITY),
    YD(t, e, n, t, !0),
    e.isValid || e.set(0, 0, 0, 0),
    e
  );
}
function YD(t, e, n, r, i) {
  var l, c;
  let o;
  if (i) (o = dr.get()), (o = n.copyTo(o));
  else {
    if (!t.visible || !t.measurable) return;
    t.updateLocalTransform();
    const u = t.localTransform;
    (o = dr.get()), o.appendFrom(u, n);
  }
  const s = e,
    a = !!t.effects.length;
  if ((a && (e = qo.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++) YD(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, Re.IDENTITY), qo.return(e);
  }
  dr.return(o);
}
function XD(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 && XD(i, e);
  }
  return e.didChange;
}
const Ole = new Re(),
  Rle = {
    _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 jn(),
        });
      const t = this._localBoundsCacheData;
      return (
        (t.index = 1),
        (t.didChange = !1),
        t.data[0] !== this._didViewChangeTick &&
          ((t.didChange = !0), (t.data[0] = this._didViewChangeTick)),
        XD(this, t),
        t.didChange && t2(this, t.localBounds, Ole),
        t.localBounds
      );
    },
    getBounds(t, e) {
      return Qw(this, t, e || new jn());
    },
  },
  Mle = {
    _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;
    },
  },
  Dle = {
    _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(Ble));
    },
  };
function Ble(t, e) {
  return t._zIndex - e._zIndex;
}
const kle = {
  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(dr.get(), n);
    return (e = r.apply(t, e)), dr.return(r), e;
  },
  toLocal(t, e, n, r) {
    e && (t = e.toGlobal(t, n, r));
    const i = this.getGlobalTransform(dr.get(), r);
    return (n = i.applyInverse(t, n)), dr.return(i), n;
  },
};
class KD {
  constructor() {
    (this.uid = Ot("instructionSet")),
      (this.instructions = []),
      (this.instructionSize = 0),
      (this.renderables = []),
      (this.gcTick = 0);
  }
  reset() {
    this.instructionSize = 0;
  }
  destroy() {
    (this.instructions.length = 0),
      (this.renderables.length = 0),
      (this.renderPipes = null),
      (this.gcTick = 0);
  }
  add(e) {
    this.instructions[this.instructionSize++] = e;
  }
  log() {
    (this.instructions.length = this.instructionSize),
      console.table(this.instructions, ["type", "action"]);
  }
}
let Nle = 0;
class Fle {
  constructor(e) {
    (this._poolKeyHash = Object.create(null)),
      (this._texturePool = {}),
      (this.textureOptions = e || {}),
      (this.enableFullScreen = !1),
      (this.textureStyle = new xo(this.textureOptions));
  }
  createTexture(e, n, r) {
    const i = new Tn({
      ...this.textureOptions,
      width: e,
      height: n,
      resolution: 1,
      antialias: r,
      autoGarbageCollect: !1,
    });
    return new Ae({ source: i, label: `texturePool_${Nle++}` });
  }
  getOptimalTexture(e, n, r = 1, i) {
    let o = Math.ceil(e * r - 1e-6),
      s = Math.ceil(n * r - 1e-6);
    (o = Qc(o)), (s = Qc(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 sn = new Fle();
Eu.register(sn);
class G_ {
  constructor() {
    (this.renderPipeId = "renderGroup"),
      (this.root = null),
      (this.canBundle = !1),
      (this.renderGroupParent = null),
      (this.renderGroupChildren = []),
      (this.worldTransform = new Re()),
      (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 KD()),
      (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 &&
        (sn.returnTexture(this.texture, !0), (this.texture = null));
  }
  updateCacheTexture() {
    this.textureNeedsUpdate = !0;
    const e = this._parentCacheAsTextureRenderGroup;
    e && !e.textureNeedsUpdate && e.updateCacheTexture();
  }
  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 Re()),
        this._inverseWorldTransform.copyFrom(this.worldTransform).invert())
      : this._inverseWorldTransform;
  }
  get textureOffsetInverseTransform() {
    return this._matrixDirty & 2
      ? ((this._matrixDirty &= -3),
        this._textureOffsetInverseTransform ||
          (this._textureOffsetInverseTransform = new Re()),
        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 Re()),
        this._inverseParentTextureTransform
          .copyFrom(this.worldTransform)
          .prepend(e.inverseWorldTransform)
          .translate(-e._textureBounds.x, -e._textureBounds.y))
      : this.worldTransform;
  }
  get cacheToLocalTransform() {
    return this.isCachedAsTexture
      ? this.textureOffsetInverseTransform
      : this._parentCacheAsTextureRenderGroup
      ? this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform
      : null;
  }
}
function H_(t, e, n = {}) {
  for (const r in e) !n[r] && e[r] !== void 0 && (t[r] = e[r]);
}
const I1 = new Jt(null),
  ip = new Jt(null),
  O1 = new Jt(null, 1, 1),
  op = new Jt(null),
  R0 = 1,
  n2 = 2,
  Mf = 4;
class Xr extends Jr {
  constructor(e = {}) {
    var n, r;
    super(),
      (this.uid = Ot("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.parentRenderLayer = null),
      (this.updateTick = -1),
      (this.localTransform = new Re()),
      (this.relativeGroupTransform = new Re()),
      (this.groupTransform = this.relativeGroupTransform),
      (this.destroyed = !1),
      (this._position = new Jt(this, 0, 0)),
      (this._scale = O1),
      (this._pivot = ip),
      (this._origin = op),
      (this._skew = I1),
      (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 = []),
      H_(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) {
    ke(
      "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 ||
        ke(
          tt,
          "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 = gn.get(G_, this)),
      (this.groupTransform = Re.IDENTITY),
      e == null || e.addChild(this),
      this._updateIsSimple();
  }
  disableRenderGroup() {
    if (!this.renderGroup) return;
    const e = this.parentRenderGroup;
    e == null || e.removeChild(this),
      gn.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 Re()),
      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 * nle;
  }
  set angle(e) {
    this.rotation = e * rle;
  }
  get pivot() {
    return (
      this._pivot === ip && (this._pivot = new Jt(this, 0, 0)), this._pivot
    );
  }
  set pivot(e) {
    this._pivot === ip &&
      ((this._pivot = new Jt(this, 0, 0)),
      this._origin !== op &&
        Fe(
          "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 === I1 && (this._skew = new Jt(this, 0, 0)), this._skew;
  }
  set skew(e) {
    this._skew === I1 && (this._skew = new Jt(this, 0, 0)),
      this._skew.copyFrom(e);
  }
  get scale() {
    return (
      this._scale === O1 && (this._scale = new Jt(this, 1, 1)), this._scale
    );
  }
  set scale(e) {
    this._scale === O1 && (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 === op && (this._origin = new Jt(this, 0, 0)), this._origin
    );
  }
  set origin(e) {
    this._origin === op &&
      ((this._origin = new Jt(this, 0, 0)),
      this._pivot !== ip &&
        Fe(
          "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 |= R0), this._onUpdate());
  }
  get alpha() {
    return this.localAlpha;
  }
  set tint(e) {
    const r = Ut.shared.setValue(e ?? 16777215).toBgrNumber();
    r !== this.localColor &&
      ((this.localColor = r), (this._updateFlags |= R0), this._onUpdate());
  }
  get tint() {
    return Rf(this.localColor);
  }
  set blendMode(e) {
    this.localBlendMode !== e &&
      (this.parentRenderGroup &&
        (this.parentRenderGroup.structureDidChange = !0),
      (this._updateFlags |= n2),
      (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 |= Mf),
      (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 |= Mf),
      (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 |= Mf),
      (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, wle, Ple, kle, Mle, Rle, Cle, Ale, Dle, yle, ble, Ile, Ele);
class nh 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 jn(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.pushBlendMode(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);
    i.blendMode.popBlendMode(e);
  }
}
class bl extends nh {
  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 bl(e) : new bl(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 (
      UD(this._visualBounds, this._anchor, this._texture), this._visualBounds
    );
  }
  get sourceBounds() {
    return (
      ke(
        "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 Lle = new jn();
function qD(t, e, n) {
  const r = Lle;
  (t.measurable = !0), Qw(t, n, r), e.addBoundsMask(r), (t.measurable = !1);
}
function ZD(t, e, n) {
  const r = qo.get();
  t.measurable = !0;
  const i = dr.get().identity(),
    o = JD(t, n, i);
  t2(t, r, o),
    (t.measurable = !1),
    e.addBoundsMask(r),
    dr.return(i),
    qo.return(r);
}
function JD(t, e, n) {
  return t
    ? (t !== e &&
        (JD(t.parent, e, n),
        t.updateLocalTransform(),
        n.append(t.localTransform)),
      n)
    : (Fe("Mask bounds, renderable is not inside the root container"), n);
}
class QD {
  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 bl)),
      (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 || qD(this.mask, e, n);
  }
  addLocalBounds(e, n) {
    ZD(this.mask, e, n);
  }
  containsPoint(e, n) {
    const r = this.mask;
    return n(r, e);
  }
  destroy() {
    this.reset();
  }
  static test(e) {
    return e instanceof bl;
  }
}
QD.extension = V.MaskEffect;
class eB {
  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";
  }
}
eB.extension = V.MaskEffect;
class tB {
  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) {
    qD(this.mask, e, n);
  }
  addLocalBounds(e, n) {
    ZD(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;
  }
}
tB.extension = V.MaskEffect;
const $le = {
  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 gT = $le;
const je = {
  get() {
    return gT;
  },
  set(t) {
    gT = t;
  },
};
class fo extends Tn {
  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"))
    );
  }
}
fo.extension = V.TextureSource;
class wl extends Tn {
  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)
    );
  }
}
wl.extension = V.TextureSource;
var El = ((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
))(El || {});
class R1 {
  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 nB = class Fr {
  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 R1(null, null, 1 / 0)),
      (this.deltaMS = 1 / Fr.targetFPMS),
      (this.elapsedMS = 1 / Fr.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 = El.NORMAL) {
    return this._addListener(new R1(e, n, r));
  }
  addOnce(e, n, r = El.NORMAL) {
    return this._addListener(new R1(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 * Fr.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, Fr.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 (!Fr._shared) {
      const e = (Fr._shared = new Fr());
      (e.autoStart = !0), (e._protected = !0);
    }
    return Fr._shared;
  }
  static get system() {
    if (!Fr._system) {
      const e = (Fr._system = new Fr());
      (e.autoStart = !0), (e._protected = !0);
    }
    return Fr._system;
  }
};
nB.targetFPMS = 0.06;
let Vn = nB,
  M1;
async function rB() {
  return (
    M1 ??
      (M1 = (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"
        );
      })()),
    M1
  );
}
const fm = class iB extends Tn {
  constructor(e) {
    super(e),
      (this.isReady = !1),
      (this.uploadMethodId = "video"),
      (e = { ...iB.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 = Vn.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 rB()),
      (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 &&
            (Vn.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 ||
            (Vn.shared.add(this.updateFrame, this),
            (this._isConnectedToTicker = !0),
            (this._msToNextUpdate = 0)))
      : (this._videoFrameRequestCallbackHandle !== null &&
          (this.resource.cancelVideoFrameCallback(
            this._videoFrameRequestCallbackHandle
          ),
          (this._videoFrameRequestCallbackHandle = null)),
        this._isConnectedToTicker &&
          (Vn.shared.remove(this.updateFrame, this),
          (this._isConnectedToTicker = !1),
          (this._msToNextUpdate = 0)));
  }
  static test(e) {
    return globalThis.HTMLVideoElement && e instanceof HTMLVideoElement;
  }
};
fm.extension = V.TextureSource;
fm.defaultOptions = {
  ...Tn.defaultOptions,
  autoLoad: !0,
  autoPlay: !0,
  updateFPS: 0,
  crossorigin: !0,
  loop: !1,
  muted: !0,
  playsinline: !0,
  preload: !1,
};
fm.MIME_TYPES = { ogv: "video/ogg", mov: "video/quicktime", m4v: "video/mp4" };
let Df = fm;
const Pi = (t, e, n = !1) => (
  Array.isArray(t) || (t = [t]),
  e ? t.map((r) => (typeof r == "string" || n ? e(r) : r)) : t
);
class Ule {
  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 || Fe(`[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 &&
          Fe("[Cache] already has key:", l),
          this._cache.set(l, o.get(l));
      });
  }
  remove(e) {
    if (!this._cacheMap.has(e)) {
      Fe(`[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 Ule(),
  V_ = [];
$e.handleByList(V.TextureSource, V_);
function oB(t = {}) {
  const e = t && t.resource,
    n = e ? t.resource : t,
    r = e ? t : { resource: t };
  for (let i = 0; i < V_.length; i++) {
    const o = V_[i];
    if (o.test(n)) return new o(r);
  }
  throw new Error(`Could not find a source type for resource: ${r.resource}`);
}
function Gle(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: oB(i) });
  return (
    o.on("destroy", () => {
      bt.has(r) && bt.remove(r);
    }),
    e || bt.set(r, o),
    o
  );
}
function Hle(t, e = !1) {
  return typeof t == "string"
    ? bt.get(t)
    : t instanceof Tn
    ? new Ae({ source: t })
    : Gle(t, e);
}
Ae.from = Hle;
Tn.from = oB;
$e.add(QD, eB, tB, Df, wl, fo, Jw);
var va = ((t) => (
  (t[(t.Low = 0)] = "Low"),
  (t[(t.Normal = 1)] = "Normal"),
  (t[(t.High = 2)] = "High"),
  t
))(va || {});
function bi(t) {
  if (typeof t != "string")
    throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`);
}
function Wu(t) {
  return t.split("?")[0].split("#")[0];
}
function Vle(t) {
  return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function zle(t, e, n) {
  return t.replace(new RegExp(Vle(e), "g"), n);
}
function jle(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 Ir = {
  toPosix(t) {
    return zle(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 = Wu(this.toPosix(e ?? je.get().getBaseUrl())),
      i = Wu(this.toPosix(n ?? this.rootname(r)));
    return (
      (t = this.toPosix(t)),
      t.startsWith("/")
        ? Ir.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 = jle(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 = Wu(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 = Wu(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 = Wu(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 sB(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
      ? sB(t.replace(r[n], a), e, n + 1, r, i)
      : i.push(t.replace(r[n], a));
  }
}
function Wle(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);
    }),
      sB(t, i, 0, n, r);
  } else r.push(t);
  return r;
}
const M0 = (t) => !Array.isArray(t);
class Su {
  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 &&
      Fe("[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) && Fe(`[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" ? Wle(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((g) => {
            let m = {};
            if (typeof g != "object") {
              m.src = g;
              for (let v = 0; v < this._parsers.length; v++) {
                const y = this._parsers[v];
                if (y.test(g)) {
                  m = y.parse(g);
                  break;
                }
              }
            } else
              (a = g.data ?? a),
                (l = g.format ?? l),
                (g.loadParser || g.parser) &&
                  ((c = g.loadParser ?? c), (u = g.parser ?? u)),
                (m = { ...m, ...g });
            if (!d)
              throw new Error(
                `[Resolver] alias is undefined for this asset: ${m.src}`
              );
            (m = this._buildResolvedAsset(m, {
              aliases: d,
              data: a,
              format: l,
              loadParser: c,
              parser: u,
              progressSize: o.progressSize,
            })),
              h.push(m);
          });
        }),
          d.forEach((p) => {
            this._assetMap[p] = h;
          });
      });
  }
  resolveBundle(e) {
    const n = M0(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 = M0(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,
      progressSize: l,
    } = n;
    return (
      (this._basePath || this._rootPath) &&
        (e.src = Ir.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 ?? Yle(e.src)),
      l !== void 0 && (e.progressSize = l),
      e
    );
  }
}
Su.RETINA_PREFIX = /@([0-9\.]+)x/;
function Yle(t) {
  return t.split(".").pop().split("?").shift().split("#").shift();
}
const z_ = (t, e) => {
    const n = e.split("?")[1];
    return n && (t += `?${n}`), t;
  },
  aB = class cf {
    constructor(e, n) {
      this.linkedSheets = [];
      let r = e;
      (e == null ? void 0 : e.source) instanceof Tn &&
        (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 <= cf.BATCH_SIZE
            ? (this._processFrames(0),
              this._processAnimations(),
              this._parseComplete())
            : this._nextBatch();
      });
    }
    _processFrames(e) {
      let n = e;
      const r = cf.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 * cf.BATCH_SIZE),
        this._batchIndex++,
        setTimeout(() => {
          this._batchIndex * cf.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 = []);
    }
  };
aB.BATCH_SIZE = 1e3;
let mT = aB;
const Xle = [
  "jpg",
  "png",
  "jpeg",
  "avif",
  "webp",
  "basis",
  "etc2",
  "bc7",
  "bc6h",
  "bc5",
  "bc4",
  "bc3",
  "bc2",
  "bc1",
  "eac",
  "astc",
];
function lB(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 = Ir.dirname(t[0]);
    e.linkedSheets.forEach((o, s) => {
      const a = lB([`${i}/${e.data.meta.related_multi_packs[s]}`], o, !0);
      Object.assign(r, a);
    });
  }
  return r;
}
const Kle = {
  extension: V.Asset,
  cache: {
    test: (t) => t instanceof mT,
    getCacheableAssets: (t, e) => lB(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" && Xle.includes(i);
    },
    parse: (t) => {
      var n;
      const e = t.split(".");
      return {
        resolution: parseFloat(
          ((n = Su.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: va.Normal,
      name: "spritesheetLoader",
    },
    async testParse(t, e) {
      return Ir.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 = Ir.dirname(e.src);
      a && a.lastIndexOf("/") !== a.length - 1 && (a += "/");
      let l;
      if (r instanceof Ae) l = r;
      else {
        const h = z_(a + (i ?? t.meta.image), e.src);
        l = (await n.load([{ src: h, data: o }]))[h];
      }
      const c = new mT({ 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 g of u) {
          if (typeof g != "string") continue;
          let m = a + g;
          ((d = e.data) != null && d.ignoreMultiPack) ||
            ((m = z_(m, e.src)),
            h.push(
              n.load({
                src: m,
                data: { textureOptions: o, ignoreMultiPack: !0 },
              })
            ));
        }
        const p = await Promise.all(h);
        (c.linkedSheets = p),
          p.forEach((g) => {
            g.linkedSheets = [c].concat(c.linkedSheets.filter((m) => m !== g));
          });
      }
      return c;
    },
    async unload(t, e, n) {
      await n.unload(t.textureSource._sourceOrigin), t.destroy(!1);
    },
  },
};
$e.add(Kle);
class cB {
  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 ||
        Vn.shared.add(this.updateTranslation, this, El.HIGH);
  }
  destroy() {
    this._observer
      ? (this._observer.disconnect(), (this._observer = null))
      : this._tickerAttached && Vn.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 rh {
  constructor(e) {
    (this.bubbles = !0),
      (this.cancelBubble = !0),
      (this.cancelable = !1),
      (this.composed = !1),
      (this.defaultPrevented = !1),
      (this.eventPhase = rh.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 D1 = /iPhone/i,
  vT = /iPod/i,
  yT = /iPad/i,
  _T = /\biOS-universal(?:.+)Mac\b/i,
  B1 = /\bAndroid(?:.+)Mobile\b/i,
  xT = /Android/i,
  rc = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,
  sp = /Silk/i,
  Mo = /Windows Phone/i,
  bT = /\bWindows(?:.+)ARM\b/i,
  wT = /BlackBerry/i,
  ET = /BB10/i,
  ST = /Opera Mini/i,
  CT = /\b(CriOS|Chrome)(?:.+)Mobile/i,
  AT = /Mobile(?:.+)Firefox\b/i,
  TT = function (t) {
    return (
      typeof t < "u" &&
      t.platform === "MacIntel" &&
      typeof t.maxTouchPoints == "number" &&
      t.maxTouchPoints > 1 &&
      typeof MSStream > "u"
    );
  };
function qle(t) {
  return function (e) {
    return e.test(t);
  };
}
function PT(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 = qle(n),
    o = {
      apple: {
        phone: i(D1) && !i(Mo),
        ipod: i(vT),
        tablet: !i(D1) && (i(yT) || TT(e)) && !i(Mo),
        universal: i(_T),
        device: (i(D1) || i(vT) || i(yT) || i(_T) || TT(e)) && !i(Mo),
      },
      amazon: { phone: i(rc), tablet: !i(rc) && i(sp), device: i(rc) || i(sp) },
      android: {
        phone: (!i(Mo) && i(rc)) || (!i(Mo) && i(B1)),
        tablet: !i(Mo) && !i(rc) && !i(B1) && (i(sp) || i(xT)),
        device:
          (!i(Mo) && (i(rc) || i(sp) || i(B1) || i(xT))) || i(/\bokhttp\b/i),
      },
      windows: { phone: i(Mo), tablet: i(bT), device: i(Mo) || i(bT) },
      other: {
        blackberry: i(wT),
        blackberry10: i(ET),
        opera: i(ST),
        firefox: i(AT),
        chrome: i(CT),
        device: i(wT) || i(ET) || i(ST) || i(AT) || i(CT),
      },
      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 Zle = PT.default ?? PT,
  Jle = Zle(globalThis.navigator),
  Qle = 9,
  IT = 100,
  ece = 0,
  tce = 0,
  OT = 2,
  RT = 1,
  nce = -1e3,
  rce = -1e3,
  ice = 2,
  r2 = class uB {
    constructor(e, n = Jle) {
      (this._mobileInfo = n),
        (this.debug = !1),
        (this._activateOnTab = !0),
        (this._deactivateOnMouseMove = !0),
        (this._isActive = !1),
        (this._isMobileAccessibility = !1),
        (this._div = null),
        (this._pools = {}),
        (this._renderId = 0),
        (this._children = []),
        (this._androidUpdateCount = 0),
        (this._androidUpdateFrequency = 500),
        (this._isRunningTests = !1),
        (this._boundOnKeyDown = this._onKeyDown.bind(this)),
        (this._boundOnMouseMove = this._onMouseMove.bind(this)),
        (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;
    }
    get div() {
      return this._div;
    }
    _createTouchHook() {
      const e = document.createElement("button");
      (e.style.width = `${RT}px`),
        (e.style.height = `${RT}px`),
        (e.style.position = "absolute"),
        (e.style.top = `${nce}px`),
        (e.style.left = `${rce}px`),
        (e.style.zIndex = ice.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 = `${ece}px`),
          (this._div.style.left = `${tce}px`),
          (this._div.style.pointerEvents = "none"),
          (this._div.style.zIndex = OT.toString()),
          (this._canvasObserver = new cB({
            domElement: this._div,
            renderer: this._renderer,
          }))),
        this._activateOnTab &&
          globalThis.addEventListener("keydown", this._boundOnKeyDown, !1),
        this._deactivateOnMouseMove &&
          globalThis.document.addEventListener(
            "mousemove",
            this._boundOnMouseMove,
            !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._boundOnMouseMove,
            !0
          ),
          this._activateOnTab &&
            globalThis.addEventListener("keydown", this._boundOnKeyDown, !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);
        for (const e in this._pools)
          this._pools[e].forEach((r) => {
            r.parentNode && r.parentNode.removeChild(r);
          }),
            delete this._pools[e];
        this._div &&
          this._div.parentNode &&
          this._div.parentNode.removeChild(this._div),
          (this._pools = {}),
          (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: {
          ...uB.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._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) &&
          !this._isRunningTests)
      )
        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._getPool(i.accessibleType).push(i._accessibleDiv),
            (i._accessibleDiv = null)),
          (i._accessibleActive = !1),
          zD(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 r = this._getPool(e.accessibleType).pop();
      r
        ? ((r.innerHTML = ""),
          r.removeAttribute("title"),
          r.removeAttribute("aria-label"),
          (r.tabIndex = 0))
        : (e.accessibleType === "button"
            ? (r = document.createElement("button"))
            : ((r = document.createElement(e.accessibleType)),
              (r.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 && (r.innerText = e.accessibleText)),
          (r.style.width = `${IT}px`),
          (r.style.height = `${IT}px`),
          (r.style.backgroundColor = this.debug
            ? "rgba(255,255,255,0.5)"
            : "transparent"),
          (r.style.position = "absolute"),
          (r.style.zIndex = OT.toString()),
          (r.style.borderStyle = "none"),
          navigator.userAgent.toLowerCase().includes("chrome")
            ? r.setAttribute("aria-live", "off")
            : r.setAttribute("aria-live", "polite"),
          navigator.userAgent.match(/rv:.*Gecko\//)
            ? r.setAttribute("aria-relevant", "additions")
            : r.setAttribute("aria-relevant", "text"),
          r.addEventListener("click", this._onClick.bind(this)),
          r.addEventListener("focus", this._onFocus.bind(this)),
          r.addEventListener("focusout", this._onFocusOut.bind(this))),
        (r.style.pointerEvents = e.accessiblePointerEvents),
        (r.type = e.accessibleType),
        e.accessibleTitle && e.accessibleTitle !== null
          ? (r.title = e.accessibleTitle)
          : (!e.accessibleHint || e.accessibleHint === null) &&
            (r.title = `container ${e.tabIndex}`),
        e.accessibleHint &&
          e.accessibleHint !== null &&
          r.setAttribute("aria-label", e.accessibleHint),
        e.interactive ? (r.tabIndex = e.tabIndex) : (r.tabIndex = 0),
        this.debug && this._updateDebugHTML(r),
        (e._accessibleActive = !0),
        (e._accessibleDiv = r),
        (r.container = e),
        this._children.push(e),
        this._div.appendChild(e._accessibleDiv);
    }
    _dispatchEvent(e, n) {
      const { container: r } = e.target,
        i = this._renderer.events.rootBoundary,
        o = Object.assign(new rh(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 !== Qle || !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._pools = null),
        (this._children = null),
        (this._renderer = null),
        (this._hookDiv = null),
        globalThis.removeEventListener("keydown", this._boundOnKeyDown),
        (this._boundOnKeyDown = null),
        globalThis.document.removeEventListener(
          "mousemove",
          this._boundOnMouseMove,
          !0
        ),
        (this._boundOnMouseMove = null);
    }
    setAccessibilityEnabled(e) {
      e ? this._activate() : this._deactivate();
    }
    _getPool(e) {
      return this._pools[e] || (this._pools[e] = []), this._pools[e];
    }
  };
r2.extension = { type: [V.WebGLSystem, V.WebGPUSystem], name: "accessibility" };
r2.defaultOptions = {
  enabledByDefault: !1,
  debug: !1,
  activateOnTab: !0,
  deactivateOnMouseMove: !0,
};
let oce = r2;
const sce = {
    accessible: !1,
    accessibleTitle: null,
    accessibleHint: null,
    tabIndex: 0,
    accessibleType: "button",
    accessibleText: null,
    accessiblePointerEvents: "auto",
    accessibleChildren: !0,
    _accessibleActive: !1,
    _accessibleDiv: null,
    _renderId: -1,
  },
  k1 = Object.create(null),
  MT = Object.create(null);
function md(t, e) {
  let n = MT[t];
  return (
    n === void 0 && (k1[e] === void 0 && (k1[e] = 1), (MT[t] = n = k1[e]++)), n
  );
}
let ic;
function fB() {
  return (
    (!ic || (ic != null && ic.isContextLost())) &&
      (ic = je.get().createCanvas().getContext("webgl", {})),
    ic
  );
}
let ap;
function ace() {
  if (!ap) {
    ap = "mediump";
    const t = fB();
    t &&
      t.getShaderPrecisionFormat &&
      (ap = t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT)
        .precision
        ? "highp"
        : "mediump");
  }
  return ap;
}
function lce(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 cce(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 uce(t, e) {
  return e
    ? `#version 300 es
${t}`
    : t;
}
const fce = {},
  dce = {};
function hce(t, { name: e = "pixi-program" }, n = !0) {
  (e = e.replace(/\s+/g, "-")), (e += n ? "-fragment" : "-vertex");
  const r = n ? fce : dce;
  return (
    r[e] ? (r[e]++, (e += `-${r[e]}`)) : (r[e] = 1),
    t.indexOf("#define SHADER_NAME") !== -1
      ? t
      : `${`#define SHADER_NAME ${e}`}
${t}`
  );
}
function pce(t, e) {
  return e ? t.replace("#version 300 es", "") : t;
}
const N1 = {
    stripVersion: pce,
    ensurePrecision: cce,
    addProgramDefines: lce,
    setProgramName: hce,
    insertVersion: uce,
  },
  Yu = Object.create(null),
  dB = class j_ {
    constructor(e) {
      e = { ...j_.defaultOptions, ...e };
      const n = e.fragment.indexOf("#version 300 es") !== -1,
        r = {
          stripVersion: n,
          ensurePrecision: {
            requestedFragmentPrecision: e.preferredFragmentPrecision,
            requestedVertexPrecision: e.preferredVertexPrecision,
            maxSupportedVertexPrecision: "highp",
            maxSupportedFragmentPrecision: ace(),
          },
          setProgramName: { name: e.name },
          addProgramDefines: n,
          insertVersion: n,
        };
      let i = e.fragment,
        o = e.vertex;
      Object.keys(N1).forEach((s) => {
        const a = r[s];
        (i = N1[s](i, a, !0)), (o = N1[s](o, a, !1));
      }),
        (this.fragment = i),
        (this.vertex = o),
        (this.transformFeedbackVaryings = e.transformFeedbackVaryings),
        (this._key = md(`${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),
        (Yu[this._cacheKey] = null);
    }
    static from(e) {
      const n = `${e.vertex}:${e.fragment}`;
      return Yu[n] || ((Yu[n] = new j_(e)), (Yu[n]._cacheKey = n)), Yu[n];
    }
  };
dB.defaultOptions = {
  preferredVertexPrecision: "highp",
  preferredFragmentPrecision: "mediump",
};
let ya = dB;
const DT = {
  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 ca(t) {
  return DT[t] ?? DT.float32;
}
const gce = {
  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 mce({ 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 = gce[a[3]] ?? "float32";
        n[a[2]] = {
          location: parseInt(a[1], 10),
          format: l,
          stride: ca(l).stride,
          offset: 0,
          instance: !1,
          start: 0,
        };
      }
    }
  }
  return n;
}
function F1(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],
              g = h.match(a).reduce((m, v) => {
                const [y, _] = v.split(":");
                return (m[y.trim()] = _.trim()), m;
              }, {});
            return g ? { name: p, members: g } : null;
          })
          .filter(({ name: h }) => c.some((p) => p.type === h))) ?? [];
  return { groups: c, structs: u };
}
var uf = ((t) => (
  (t[(t.VERTEX = 1)] = "VERTEX"),
  (t[(t.FRAGMENT = 2)] = "FRAGMENT"),
  (t[(t.COMPUTE = 4)] = "COMPUTE"),
  t
))(uf || {});
function vce({ 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: uf.VERTEX | uf.FRAGMENT,
            buffer: { type: "uniform" },
          })
        : r.type === "sampler"
        ? e[r.group].push({
            binding: r.binding,
            visibility: uf.FRAGMENT,
            sampler: { type: "filtering" },
          })
        : r.type === "texture_2d" &&
          e[r.group].push({
            binding: r.binding,
            visibility: uf.FRAGMENT,
            texture: {
              sampleType: "float",
              viewDimension: "2d",
              multisampled: !1,
            },
          });
  }
  return e;
}
function yce({ 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 _ce(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 Xu = Object.create(null);
class ys {
  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 = F1(n.source);
      this.structsAndGroups = c;
    } else {
      const c = F1(r.source),
        u = F1(n.source);
      this.structsAndGroups = _ce(c, u);
    }
    (this.layout = i ?? yce(this.structsAndGroups)),
      (this.gpuLayout = o ?? vce(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 = md(r, "program");
  }
  get attributeData() {
    return (
      this._attributeData ?? (this._attributeData = mce(this.vertex)),
      this._attributeData
    );
  }
  destroy() {
    (this.gpuLayout = null),
      (this.layout = null),
      (this.structsAndGroups = null),
      (this.fragment = null),
      (this.vertex = null),
      (Xu[this._cacheKey] = null);
  }
  static from(e) {
    const n = `${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;
    return Xu[n] || ((Xu[n] = new ys(e)), (Xu[n]._cacheKey = n)), Xu[n];
  }
}
const hB = [
    "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>",
  ],
  xce = hB.reduce((t, e) => ((t[e] = !0), t), {});
function bce(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 pB = class gB {
  constructor(e, n) {
    (this._touched = 0),
      (this.uid = Ot("uniform")),
      (this._resourceType = "uniformGroup"),
      (this._resourceId = Ot("resource")),
      (this.isUniformGroup = !0),
      (this._dirtyId = 0),
      (this.destroyed = !1),
      (n = { ...gB.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), !xce[o.type])) {
        const s = o.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);
        if (s) {
          const [, a, l] = s;
          throw new Error(
            `Uniform type ${o.type} is not supported. Use type: '${a}', size: ${l} instead.`
          );
        }
        throw new Error(
          `Uniform type ${
            o.type
          } is not supported. Supported uniform types are: ${hB.join(", ")}`
        );
      }
      o.value ?? (o.value = bce(o.type, o.size)), (r[i] = o.value);
    }
    (this.uniforms = r),
      (this._dirtyId = 1),
      (this.ubo = n.ubo),
      (this.isStatic = n.isStatic),
      (this._signature = md(
        Object.keys(r)
          .map((i) => `${i}-${e[i].type}`)
          .join("-"),
        "uniform-group"
      ));
  }
  update() {
    this._dirtyId++;
  }
};
pB.defaultOptions = { ubo: !1, isStatic: !1 };
let mr = pB;
class Zo {
  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 == null ? void 0 : 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 = Ot("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 Zo()), 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 mr(d));
        const h = l[f];
        h &&
          (i[h.group] ||
            ((i[h.group] = new Zo()), 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 Zo()),
        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 = ys.from(n)),
      r && (s = ya.from(r)),
      new yi({ gpuProgram: o, glProgram: s, ...i })
    );
  }
}
const wce = {
    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,
  },
  L1 = 0,
  $1 = 1,
  U1 = 2,
  G1 = 3,
  H1 = 4,
  V1 = 5,
  W_ = class mB {
    constructor() {
      (this.data = 0),
        (this.blendMode = "normal"),
        (this.polygonOffset = 0),
        (this.blend = !0),
        (this.depthMask = !0);
    }
    get blend() {
      return !!(this.data & (1 << L1));
    }
    set blend(e) {
      !!(this.data & (1 << L1)) !== e && (this.data ^= 1 << L1);
    }
    get offsets() {
      return !!(this.data & (1 << $1));
    }
    set offsets(e) {
      !!(this.data & (1 << $1)) !== e && (this.data ^= 1 << $1);
    }
    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 << U1));
    }
    set culling(e) {
      !!(this.data & (1 << U1)) !== e && (this.data ^= 1 << U1);
    }
    get depthTest() {
      return !!(this.data & (1 << G1));
    }
    set depthTest(e) {
      !!(this.data & (1 << G1)) !== e && (this.data ^= 1 << G1);
    }
    get depthMask() {
      return !!(this.data & (1 << V1));
    }
    set depthMask(e) {
      !!(this.data & (1 << V1)) !== e && (this.data ^= 1 << V1);
    }
    get clockwiseFrontFace() {
      return !!(this.data & (1 << H1));
    }
    set clockwiseFrontFace(e) {
      !!(this.data & (1 << H1)) !== e && (this.data ^= 1 << H1);
    }
    get blendMode() {
      return this._blendMode;
    }
    set blendMode(e) {
      (this.blend = e !== "none"),
        (this._blendMode = e),
        (this._blendModeId = wce[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 mB();
      return (e.depthTest = !1), (e.blend = !0), e;
    }
  };
W_.default2d = W_.for2d();
let Gi = W_;
const vB = class Y_ extends yi {
  constructor(e) {
    (e = { ...Y_.defaultOptions, ...e }),
      super(e),
      (this.enabled = !0),
      (this._state = Gi.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 = ys.from(n)),
      r && (s = ya.from(r)),
      new Y_({ gpuProgram: o, glProgram: s, ...i })
    );
  }
};
vB.defaultOptions = {
  blendMode: "normal",
  resolution: 1,
  padding: 0,
  antialias: "off",
  blendRequired: !1,
  clipToViewport: !0,
};
let dm = vB;
const X_ = [];
$e.handleByNamedList(V.Environment, X_);
async function Ece(t) {
  if (!t)
    for (let e = 0; e < X_.length; e++) {
      const n = X_[e];
      if (n.value.test()) {
        await n.value.load();
        return;
      }
    }
}
let Ku;
function yB() {
  if (typeof Ku == "boolean") return Ku;
  try {
    Ku =
      new Function(
        "param1",
        "param2",
        "param3",
        "return param1[param2] === param3;"
      )({ a: "b" }, "a", "b") === !0;
  } catch {
    Ku = !1;
  }
  return Ku;
}
function BT(t, e, n = 2) {
  const r = e && e.length,
    i = r ? e[0] * n : t.length;
  let o = _B(t, 0, i, n, !0);
  const s = [];
  if (!o || o.next === o.prev) return s;
  let a, l, c;
  if ((r && (o = Pce(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 vd(o, s, n, a, l, c, 0), s;
}
function _B(t, e, n, r, i) {
  let o;
  if (i === $ce(t, e, n, r) > 0)
    for (let s = e; s < n; s += r) o = kT((s / r) | 0, t[s], t[s + 1], o);
  else
    for (let s = n - r; s >= e; s -= r) o = kT((s / r) | 0, t[s], t[s + 1], o);
  return o && tu(o, o.next) && (_d(o), (o = o.next)), o;
}
function Sl(t, e) {
  if (!t) return t;
  e || (e = t);
  let n = t,
    r;
  do
    if (
      ((r = !1), !n.steiner && (tu(n, n.next) || Yt(n.prev, n, n.next) === 0))
    ) {
      if ((_d(n), (n = e = n.prev), n === n.next)) break;
      r = !0;
    } else n = n.next;
  while (r || n !== e);
  return e;
}
function vd(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 ? Cce(t, r, i, o) : Sce(t)) {
      e.push(l.i, t.i, c.i), _d(t), (t = c.next), (a = c.next);
      continue;
    }
    if (((t = c), t === a)) {
      s
        ? s === 1
          ? ((t = Ace(Sl(t), e)), vd(t, e, n, r, i, o, 2))
          : s === 2 && Tce(t, e, n, r, i, o)
        : vd(Sl(t), e, n, r, i, o, 1);
      break;
    }
  }
}
function Sce(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 &&
      ff(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 Cce(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),
    g = Math.max(a, l, c),
    m = Math.max(u, f, d),
    v = K_(h, p, e, n, r),
    y = K_(g, m, e, n, r);
  let _ = t.prevZ,
    x = t.nextZ;
  for (; _ && _.z >= v && x && x.z <= y; ) {
    if (
      (_.x >= h &&
        _.x <= g &&
        _.y >= p &&
        _.y <= m &&
        _ !== i &&
        _ !== s &&
        ff(a, u, l, f, c, d, _.x, _.y) &&
        Yt(_.prev, _, _.next) >= 0) ||
      ((_ = _.prevZ),
      x.x >= h &&
        x.x <= g &&
        x.y >= p &&
        x.y <= m &&
        x !== i &&
        x !== s &&
        ff(a, u, l, f, c, d, x.x, x.y) &&
        Yt(x.prev, x, x.next) >= 0)
    )
      return !1;
    x = x.nextZ;
  }
  for (; _ && _.z >= v; ) {
    if (
      _.x >= h &&
      _.x <= g &&
      _.y >= p &&
      _.y <= m &&
      _ !== i &&
      _ !== s &&
      ff(a, u, l, f, c, d, _.x, _.y) &&
      Yt(_.prev, _, _.next) >= 0
    )
      return !1;
    _ = _.prevZ;
  }
  for (; x && x.z <= y; ) {
    if (
      x.x >= h &&
      x.x <= g &&
      x.y >= p &&
      x.y <= m &&
      x !== i &&
      x !== s &&
      ff(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 Ace(t, e) {
  let n = t;
  do {
    const r = n.prev,
      i = n.next.next;
    !tu(r, i) &&
      bB(r, n, n.next, i) &&
      yd(r, i) &&
      yd(i, r) &&
      (e.push(r.i, n.i, i.i), _d(n), _d(n.next), (n = t = i)),
      (n = n.next);
  } while (n !== t);
  return Sl(n);
}
function Tce(t, e, n, r, i, o) {
  let s = t;
  do {
    let a = s.next.next;
    for (; a !== s.prev; ) {
      if (s.i !== a.i && Nce(s, a)) {
        let l = wB(s, a);
        (s = Sl(s, s.next)),
          (l = Sl(l, l.next)),
          vd(s, e, n, r, i, o, 0),
          vd(l, e, n, r, i, o, 0);
        return;
      }
      a = a.next;
    }
    s = s.next;
  } while (s !== t);
}
function Pce(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 = _B(t, a, l, r, !1);
    c === c.next && (c.steiner = !0), i.push(kce(c));
  }
  i.sort(Ice);
  for (let o = 0; o < i.length; o++) n = Oce(i[o], n);
  return n;
}
function Ice(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 Oce(t, e) {
  const n = Rce(t, e);
  if (!n) return e;
  const r = wB(n, t);
  return Sl(r, r.next), Sl(n, n.next);
}
function Rce(t, e) {
  let n = e;
  const r = t.x,
    i = t.y;
  let o = -1 / 0,
    s;
  if (tu(t, n)) return n;
  do {
    if (tu(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 &&
      xB(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);
      yd(n, t) &&
        (f < u || (f === u && (n.x > s.x || (n.x === s.x && Mce(s, n))))) &&
        ((s = n), (u = f));
    }
    n = n.next;
  } while (n !== a);
  return s;
}
function Mce(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 = K_(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), Bce(i);
}
function Bce(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 K_(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 kce(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 xB(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 ff(t, e, n, r, i, o, s, a) {
  return !(t === s && e === a) && xB(t, e, n, r, i, o, s, a);
}
function Nce(t, e) {
  return (
    t.next.i !== e.i &&
    t.prev.i !== e.i &&
    !Fce(t, e) &&
    ((yd(t, e) &&
      yd(e, t) &&
      Lce(t, e) &&
      (Yt(t.prev, t, e.prev) || Yt(t, e.prev, e))) ||
      (tu(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 tu(t, e) {
  return t.x === e.x && t.y === e.y;
}
function bB(t, e, n, r) {
  const i = cp(Yt(t, e, n)),
    o = cp(Yt(t, e, r)),
    s = cp(Yt(n, r, t)),
    a = cp(Yt(n, r, e));
  return !!(
    (i !== o && s !== a) ||
    (i === 0 && lp(t, n, e)) ||
    (o === 0 && lp(t, r, e)) ||
    (s === 0 && lp(n, t, r)) ||
    (a === 0 && lp(n, e, r))
  );
}
function lp(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 cp(t) {
  return t > 0 ? 1 : t < 0 ? -1 : 0;
}
function Fce(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 &&
      bB(n, n.next, t, e)
    )
      return !0;
    n = n.next;
  } while (n !== t);
  return !1;
}
function yd(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 Lce(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 wB(t, e) {
  const n = q_(t.i, t.x, t.y),
    r = q_(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 kT(t, e, n, r) {
  const i = q_(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 _d(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 q_(t, e, n) {
  return {
    i: t,
    x: e,
    y: n,
    prev: null,
    next: null,
    z: 0,
    prevZ: null,
    nextZ: null,
    steiner: !1,
  };
}
function $ce(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 Uce = BT.default || BT;
var Gr = ((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
))(Gr || {});
class EB {
  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 Gce = [
    "init",
    "destroy",
    "contextChange",
    "resolutionChange",
    "resetState",
    "renderEnd",
    "renderStart",
    "render",
    "update",
    "postrender",
    "prerender",
  ],
  SB = class CB extends Jr {
    constructor(e) {
      super(),
        (this.uid = Ot("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 = [...Gce, ...(this.config.runners ?? [])];
      this._addRunners(...n), this._unsafeEvalCheck();
    }
    async init(e = {}) {
      const n = e.skipExtensionImports === !0 ? !0 : e.manageImports === !1;
      await Ece(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 = { ...CB.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 &&
            (ke(
              tt,
              "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
          : Ut.shared.setValue(r.clearColor).toArray();
      }
      r.transform ||
        (r.container.updateLocalTransform(),
        (r.transform = r.container.localTransform)),
        r.container.visible &&
          (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 = Gr.ALL);
      const { clear: r, clearColor: i, target: o } = e;
      Ut.shared.setValue(i ?? this.background.colorRgba),
        n.renderTarget.clear(o, r, Ut.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 EB(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)),
          this.runners.destroy.add(this.renderPipes[s]);
      });
    }
    destroy(e = !1) {
      this.runners.destroy.items.reverse(),
        this.runners.destroy.emit(e),
        Object.values(this.runners).forEach((n) => {
          n.destroy();
        }),
        (e === !0 || (typeof e == "object" && e.releaseGlobalResources)) &&
          Eu.release(),
        (this._systemsHash = null),
        (this.renderPipes = null);
    }
    generateTexture(e) {
      return this.textureGenerator.generateTexture(e);
    }
    get roundPixels() {
      return !!this._roundPixels;
    }
    _unsafeEvalCheck() {
      if (!yB())
        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();
    }
  };
SB.defaultOptions = {
  resolution: 1,
  failIfMajorPerformanceCaveat: !1,
  roundPixels: !1,
};
let hm = SB,
  up;
function Hce(t) {
  return (
    up !== void 0 ||
      (up = (() => {
        var n;
        const e = {
          stencil: !0,
          failIfMajorPerformanceCaveat:
            t ?? hm.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;
        }
      })()),
    up
  );
}
let fp;
async function Vce(t = {}) {
  return (
    fp !== void 0 ||
      (fp = await (async () => {
        const e = je.get().getNavigator().gpu;
        if (!e) return !1;
        try {
          return await (await e.requestAdapter(t)).requestDevice(), !0;
        } catch {
          return !1;
        }
      })()),
    fp
  );
}
const NT = ["webgl", "webgpu", "canvas"];
async function zce(t) {
  let e = [];
  t.preference
    ? (e.push(t.preference),
      NT.forEach((o) => {
        o !== t.preference && e.push(o);
      }))
    : (e = NT.slice());
  let n,
    r = {};
  for (let o = 0; o < e.length; o++) {
    const s = e[o];
    if (s === "webgpu" && (await Vce())) {
      const { WebGPURenderer: a } = await Wf(
        () => Promise.resolve().then(() => Ype),
        void 0
      );
      (n = a), (r = { ...t, ...t.webgpu });
      break;
    } else if (
      s === "webgl" &&
      Hce(
        t.failIfMajorPerformanceCaveat ??
          hm.defaultOptions.failIfMajorPerformanceCaveat
      )
    ) {
      const { WebGLRenderer: a } = await Wf(
        () => Promise.resolve().then(() => Ppe),
        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 D0 = "8.14.0";
class AB {
  static init() {
    var e;
    (e = globalThis.__PIXI_APP_INIT__) == null || e.call(globalThis, this, D0);
  }
  static destroy() {}
}
AB.extension = V.Application;
class TB {
  constructor(e) {
    this._renderer = e;
  }
  init() {
    var e;
    (e = globalThis.__PIXI_RENDERER_INIT__) == null ||
      e.call(globalThis, this._renderer, D0);
  }
  destroy() {
    this._renderer = null;
  }
}
TB.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem],
  name: "initHook",
  priority: -10,
};
const PB = class Z_ {
  constructor(...e) {
    (this.stage = new Xr()),
      e[0] !== void 0 &&
        ke(
          tt,
          "Application constructor options are deprecated, please use Application.init() instead."
        );
  }
  async init(e) {
    (e = { ...e }),
      (this.renderer = await zce(e)),
      Z_._plugins.forEach((n) => {
        n.init.call(this, e);
      });
  }
  render() {
    this.renderer.render({ container: this.stage });
  }
  get canvas() {
    return this.renderer.canvas;
  }
  get view() {
    return (
      ke(
        tt,
        "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 = Z_._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);
  }
};
PB._plugins = [];
let jce = PB;
$e.handleByList(V.Application, jce._plugins);
$e.add(AB);
class IB {
  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);
  }
}
IB.extension = V.Application;
class OB {
  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, El.LOW);
        },
        get() {
          return this._ticker;
        },
      }),
      (this.stop = () => {
        this._ticker.stop();
      }),
      (this.start = () => {
        this._ticker.start();
      }),
      (this._ticker = null),
      (this.ticker = e.sharedTicker ? Vn.shared : new Vn()),
      e.autoStart && this.start();
  }
  static destroy() {
    if (this._ticker) {
      const e = this._ticker;
      (this.ticker = null), e.destroy();
    }
  }
}
OB.extension = V.Application;
class RB 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 (
      ke(
        tt,
        "BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."
      ),
      this.fontFamily
    );
  }
  get pageTextures() {
    return (
      ke(
        tt,
        "BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."
      ),
      this.pages
    );
  }
  get size() {
    return (
      ke(
        tt,
        "BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."
      ),
      this.fontMetrics.fontSize
    );
  }
  get distanceFieldRange() {
    return (
      ke(
        tt,
        "BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."
      ),
      this.distanceField.range
    );
  }
  get distanceFieldType() {
    return (
      ke(
        tt,
        "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));
  }
}
/**
 * tiny-lru
 *
 * @copyright 2025 Jason Mulligan <jason.mulligan@avoidwork.com>
 * @license BSD-3-Clause
 * @version 11.4.5
 */ class Wce {
  constructor(e = 0, n = 0, r = !1) {
    (this.first = null),
      (this.items = Object.create(null)),
      (this.last = null),
      (this.max = e),
      (this.resetTtl = r),
      (this.size = 0),
      (this.ttl = n);
  }
  clear() {
    return (
      (this.first = null),
      (this.items = Object.create(null)),
      (this.last = null),
      (this.size = 0),
      this
    );
  }
  delete(e) {
    if (this.has(e)) {
      const n = this.items[e];
      delete this.items[e],
        this.size--,
        n.prev !== null && (n.prev.next = n.next),
        n.next !== null && (n.next.prev = n.prev),
        this.first === n && (this.first = n.next),
        this.last === n && (this.last = n.prev);
    }
    return this;
  }
  entries(e = this.keys()) {
    return e.map((n) => [n, this.get(n)]);
  }
  evict(e = !1) {
    if (e || this.size > 0) {
      const n = this.first;
      delete this.items[n.key],
        --this.size === 0
          ? ((this.first = null), (this.last = null))
          : ((this.first = n.next), (this.first.prev = null));
    }
    return this;
  }
  expiresAt(e) {
    let n;
    return this.has(e) && (n = this.items[e].expiry), n;
  }
  get(e) {
    const n = this.items[e];
    if (n !== void 0) {
      if (this.ttl > 0 && n.expiry <= Date.now()) {
        this.delete(e);
        return;
      }
      return this.moveToEnd(n), n.value;
    }
  }
  has(e) {
    return e in this.items;
  }
  moveToEnd(e) {
    this.last !== e &&
      (e.prev !== null && (e.prev.next = e.next),
      e.next !== null && (e.next.prev = e.prev),
      this.first === e && (this.first = e.next),
      (e.prev = this.last),
      (e.next = null),
      this.last !== null && (this.last.next = e),
      (this.last = e),
      this.first === null && (this.first = e));
  }
  keys() {
    const e = [];
    let n = this.first;
    for (; n !== null; ) e.push(n.key), (n = n.next);
    return e;
  }
  setWithEvicted(e, n, r = this.resetTtl) {
    let i = null;
    if (this.has(e)) this.set(e, n, !0, r);
    else {
      this.max > 0 &&
        this.size === this.max &&
        ((i = { ...this.first }), this.evict(!0));
      let o = (this.items[e] = {
        expiry: this.ttl > 0 ? Date.now() + this.ttl : this.ttl,
        key: e,
        prev: this.last,
        next: null,
        value: n,
      });
      ++this.size === 1 ? (this.first = o) : (this.last.next = o),
        (this.last = o);
    }
    return i;
  }
  set(e, n, r = !1, i = this.resetTtl) {
    let o = this.items[e];
    return (
      r || o !== void 0
        ? ((o.value = n),
          r === !1 &&
            i &&
            (o.expiry = this.ttl > 0 ? Date.now() + this.ttl : this.ttl),
          this.moveToEnd(o))
        : (this.max > 0 && this.size === this.max && this.evict(!0),
          (o = this.items[e] =
            {
              expiry: this.ttl > 0 ? Date.now() + this.ttl : this.ttl,
              key: e,
              prev: this.last,
              next: null,
              value: n,
            }),
          ++this.size === 1 ? (this.first = o) : (this.last.next = o),
          (this.last = o)),
      this
    );
  }
  values(e = this.keys()) {
    return e.map((n) => this.get(n));
  }
}
function MB(t = 1e3, e = 0, n = !1) {
  if (isNaN(t) || t < 0) throw new TypeError("Invalid max value");
  if (isNaN(e) || e < 0) throw new TypeError("Invalid ttl value");
  if (typeof n != "boolean") throw new TypeError("Invalid resetTtl value");
  return new Wce(t, e, n);
}
const Yce = [
  "serif",
  "sans-serif",
  "monospace",
  "cursive",
  "fantasy",
  "system-ui",
];
function B0(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) && !Yce.includes(i) && (i = `"${i}"`),
      (n[r] = i);
  }
  return `${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${e} ${n.join(",")}`;
}
const z1 = { willReadFrequently: !0 },
  ji = class Oe {
    static get experimentalLetterSpacingSupported() {
      let e = Oe._experimentalLetterSpacingSupported;
      if (e === void 0) {
        const n = je.get().getCanvasRenderingContext2D().prototype;
        e = Oe._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 = Oe._canvas, i = n.wordWrap) {
      var y;
      const o = `${e}-${n.styleKey}-wordWrap-${i}`;
      if (Oe._measurementCache.has(o)) return Oe._measurementCache.get(o);
      const s = B0(n),
        a = Oe.measureFont(s);
      a.fontSize === 0 && ((a.fontSize = n.fontSize), (a.ascent = n.fontSize));
      const l = Oe.__context;
      l.font = s;
      const u = (i ? Oe._wordWrap(e, n, r) : e).split(/(?:\r\n|\r|\n)/),
        f = new Array(u.length);
      let d = 0;
      for (let _ = 0; _ < u.length; _++) {
        const x = Oe._measureText(u[_], n.letterSpacing, l);
        (f[_] = x), (d = Math.max(d, x));
      }
      const h = ((y = n._stroke) == null ? void 0 : y.width) || 0;
      let p = d + h;
      n.dropShadow && (p += n.dropShadow.distance);
      const g = n.lineHeight || a.fontSize;
      let m = Math.max(g, a.fontSize + h) + (u.length - 1) * (g + n.leading);
      n.dropShadow && (m += n.dropShadow.distance);
      const v = new Oe(e, n, p, m, u, f, g + n.leading, d, a);
      return Oe._measurementCache.set(o, v), v;
    }
    static _measureText(e, n, r) {
      let i = !1;
      Oe.experimentalLetterSpacingSupported &&
        (Oe.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 = (Oe.graphemeSegmenter(e).length - 1) * n;
          (s += u), (c += u);
        }
      return Math.max(s, c);
    }
    static _wordWrap(e, n, r = Oe._canvas) {
      const i = r.getContext("2d", z1);
      let o = 0,
        s = "",
        a = "";
      const l = Object.create(null),
        { letterSpacing: c, whiteSpace: u } = n,
        f = Oe._collapseSpaces(u),
        d = Oe._collapseNewlines(u);
      let h = !f;
      const p = n.wordWrapWidth + c,
        g = Oe._tokenize(e);
      for (let m = 0; m < g.length; m++) {
        let v = g[m];
        if (Oe._isNewline(v)) {
          if (!d) {
            (a += Oe._addLine(s)), (h = !f), (s = ""), (o = 0);
            continue;
          }
          v = " ";
        }
        if (f) {
          const _ = Oe.isBreakingSpace(v),
            x = Oe.isBreakingSpace(s[s.length - 1]);
          if (_ && x) continue;
        }
        const y = Oe._getFromCache(v, c, l, i);
        if (y > p)
          if (
            (s !== "" && ((a += Oe._addLine(s)), (s = ""), (o = 0)),
            Oe.canBreakWords(v, n.breakWords))
          ) {
            const _ = Oe.wordWrapSplit(v);
            for (let x = 0; x < _.length; x++) {
              let b = _[x],
                w = b,
                E = 1;
              for (; _[x + E]; ) {
                const P = _[x + E];
                if (!Oe.canBreakChars(w, P, v, x, n.breakWords)) b += P;
                else break;
                (w = P), E++;
              }
              x += E - 1;
              const S = Oe._getFromCache(b, c, l, i);
              S + o > p && ((a += Oe._addLine(s)), (h = !1), (s = ""), (o = 0)),
                (s += b),
                (o += S);
            }
          } else {
            s.length > 0 && ((a += Oe._addLine(s)), (s = ""), (o = 0));
            const _ = m === g.length - 1;
            (a += Oe._addLine(v, !_)), (h = !1), (s = ""), (o = 0);
          }
        else
          y + o > p && ((h = !1), (a += Oe._addLine(s)), (s = ""), (o = 0)),
            (s.length > 0 || !Oe.isBreakingSpace(v) || h) &&
              ((s += v), (o += y));
      }
      return (a += Oe._addLine(s, !1)), a;
    }
    static _addLine(e, n = !0) {
      return (
        (e = Oe._trimRight(e)),
        (e = n
          ? `${e}
`
          : e),
        e
      );
    }
    static _getFromCache(e, n, r, i) {
      let o = r[e];
      return (
        typeof o != "number" &&
          ((o = Oe._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 (!Oe.isBreakingSpace(r)) break;
        e = e.slice(0, -1);
      }
      return e;
    }
    static _isNewline(e) {
      return typeof e != "string" ? !1 : Oe._newlines.includes(e.charCodeAt(0));
    }
    static isBreakingSpace(e, n) {
      return typeof e != "string"
        ? !1
        : Oe._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 (Oe.isBreakingSpace(o, s) || Oe._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 Oe.graphemeSegmenter(e);
    }
    static measureFont(e) {
      if (Oe._fonts[e]) return Oe._fonts[e];
      const n = Oe._context;
      n.font = e;
      const r = n.measureText(Oe.METRICS_STRING + Oe.BASELINE_SYMBOL),
        i = {
          ascent: r.actualBoundingBoxAscent,
          descent: r.actualBoundingBoxDescent,
          fontSize: r.actualBoundingBoxAscent + r.actualBoundingBoxDescent,
        };
      return (Oe._fonts[e] = i), i;
    }
    static clearMetrics(e = "") {
      e ? delete Oe._fonts[e] : (Oe._fonts = {});
    }
    static get _canvas() {
      if (!Oe.__canvas) {
        let e;
        try {
          const n = new OffscreenCanvas(0, 0),
            r = n.getContext("2d", z1);
          if (r != null && r.measureText) return (Oe.__canvas = n), n;
          e = je.get().createCanvas();
        } catch {
          e = je.get().createCanvas();
        }
        (e.width = e.height = 10), (Oe.__canvas = e);
      }
      return Oe.__canvas;
    }
    static get _context() {
      return (
        Oe.__context || (Oe.__context = Oe._canvas.getContext("2d", z1)),
        Oe.__context
      );
    }
  };
ji.METRICS_STRING = "|ÉqÅ";
ji.BASELINE_SYMBOL = "M";
ji.BASELINE_MULTIPLIER = 1.4;
ji.HEIGHT_MULTIPLIER = 2;
ji.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];
})();
ji.experimentalLetterSpacing = !1;
ji._fonts = {};
ji._newlines = [10, 13];
ji._breakingSpaces = [
  9, 32, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8200, 8201, 8202, 8287,
  12288,
];
ji._measurementCache = MB(1e3);
let Ii = ji;
const FT = [
    { offset: 0, color: "white" },
    { offset: 1, color: "black" },
  ],
  i2 = class J_ {
    constructor(...e) {
      (this.uid = Ot("fillGradient")),
        (this._tick = 0),
        (this.type = "linear"),
        (this.colorStops = []);
      let n = Xce(e);
      (n = {
        ...(n.type === "radial"
          ? J_.defaultRadialOptions
          : J_.defaultLinearOptions),
        ...BD(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: Ut.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 m = e;
          (e = r), (r = m), (o *= -1);
        }
        if (s < 0) {
          const m = n;
          (n = i), (i = m), (s *= -1);
        }
      }
      const l = this.colorStops.length ? this.colorStops : FT,
        c = this._textureSize,
        { canvas: u, context: f } = $T(c, 1),
        d = a
          ? f.createLinearGradient(this._textureSize, 0, 0, 0)
          : f.createLinearGradient(0, 0, this._textureSize, 0);
      LT(d, l),
        (f.fillStyle = d),
        f.fillRect(0, 0, c, 1),
        (this.texture = new Ae({
          source: new wl({ resource: u, addressMode: this._wrapMode }),
        }));
      const h = Math.sqrt(o * o + s * s),
        p = Math.atan2(s, o),
        g = new Re();
      g.scale(h / c, 1),
        g.rotate(p),
        g.translate(e, n),
        this.textureSpace === "local" && g.scale(c, c),
        (this.transform = g);
    }
    buildGradient() {
      this.texture || this._tick++,
        this.type === "linear"
          ? this.buildLinearGradient()
          : this.buildRadialGradient();
    }
    buildRadialGradient() {
      if (this.texture) return;
      const e = this.colorStops.length ? this.colorStops : FT,
        n = this._textureSize,
        { canvas: r, context: i } = $T(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,
        g = (s - d) * h,
        m = i.createRadialGradient(
          p,
          g,
          c * h,
          (a - f) * h,
          (l - d) * h,
          u * h
        );
      LT(m, e),
        (i.fillStyle = e[e.length - 1].color),
        i.fillRect(0, 0, n, n),
        (i.fillStyle = m),
        i.translate(p, g),
        i.rotate(this.rotation),
        i.scale(1, this.scale),
        i.translate(-p, -g),
        i.fillRect(0, 0, n, n),
        (this.texture = new Ae({
          source: new wl({ resource: r, addressMode: this._wrapMode }),
        }));
      const v = new Re();
      v.scale(1 / h, 1 / h),
        v.translate(f, d),
        this.textureSpace === "local" && v.scale(n, n),
        (this.transform = v);
    }
    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);
    }
    get styleKey() {
      return `fill-gradient-${this.uid}-${this._tick}`;
    }
  };
i2.defaultLinearOptions = {
  start: { x: 0, y: 0 },
  end: { x: 0, y: 1 },
  colorStops: [],
  textureSpace: "local",
  type: "linear",
  textureSize: 256,
  wrapMode: "clamp-to-edge",
};
i2.defaultRadialOptions = {
  center: { x: 0.5, y: 0.5 },
  innerRadius: 0,
  outerRadius: 0.5,
  colorStops: [],
  scale: 1,
  textureSpace: "local",
  type: "radial",
  textureSize: 256,
  wrapMode: "clamp-to-edge",
};
let us = i2;
function LT(t, e) {
  for (let n = 0; n < e.length; n++) {
    const r = e[n];
    t.addColorStop(r.offset, r.color);
  }
}
function $T(t, e) {
  const n = je.get().createCanvas(t, e),
    r = n.getContext("2d");
  return { canvas: n, context: r };
}
function Xce(t) {
  let e = t[0] ?? {};
  return (
    (typeof e == "number" || t[1]) &&
      (ke("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] ?? us.defaultLinearOptions.textureSize,
      })),
    e
  );
}
const UT = {
  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 pm {
  constructor(e, n) {
    (this.uid = Ot("fillPattern")),
      (this._tick = 0),
      (this.transform = new Re()),
      (this.texture = e),
      this.transform.scale(1 / e.frame.width, 1 / e.frame.height),
      n &&
        ((e.source.style.addressModeU = UT[n].addressModeU),
        (e.source.style.addressModeV = UT[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._tick++;
  }
  get texture() {
    return this._texture;
  }
  set texture(e) {
    this._texture !== e && ((this._texture = e), this._tick++);
  }
  get styleKey() {
    return `fill-pattern-${this.uid}-${this._tick}`;
  }
  destroy() {
    this.texture.destroy(!0), (this.texture = null);
  }
}
var Kce = Zce,
  j1 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 },
  qce = /([astvzqmhlc])([^astvzqmhlc]*)/gi;
function Zce(t) {
  var e = [];
  return (
    t.replace(qce, function (n, r, i) {
      var o = r.toLowerCase();
      for (
        i = Qce(i),
          o == "m" &&
            i.length > 2 &&
            (e.push([r].concat(i.splice(0, 2))),
            (o = "l"),
            (r = r == "m" ? "l" : "L"));
        ;

      ) {
        if (i.length == j1[o]) return i.unshift(r), e.push(i);
        if (i.length < j1[o]) throw new Error("malformed path data");
        e.push([r].concat(i.splice(0, j1[o])));
      }
    }),
    e
  );
}
var Jce = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;
function Qce(t) {
  var e = t.match(Jce);
  return e ? e.map(Number) : [];
}
const eue = fa(Kce);
function tue(t, e) {
  const n = eue(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:
        Fe(`Unknown SVG path command: ${c}`);
    }
    c !== "Z" &&
      c !== "z" &&
      i === null &&
      ((i = { startX: o, startY: s }), r.push(i));
  }
  return e;
}
class o2 {
  constructor(e = 0, n = 0, r = 0) {
    (this.type = "circle"), (this.x = e), (this.y = n), (this.radius = r);
  }
  clone() {
    return new o2(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 = 0.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 s2 {
  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 s2(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 = 0.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,
      g = (h * h) / (c * c) + (p * p) / (u * u),
      m = (h * h) / (f * f) + (p * p) / (d * d);
    return g > 1 && m <= 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 nue(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 g = t - h,
    m = e - p;
  return g * g + m * m;
}
let rue, iue;
class Bf {
  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(rue),
      r = e.getBounds(iue);
    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 Bf(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 = 0.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],
        g = nue(e, n, f, d, h, p),
        m = Math.sign((h - f) * (n - d) - (p - d) * (e - f));
      if (g <= (m < 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 (
      ke(
        "8.11.0",
        "Polygon.lastX is deprecated, please use Polygon.lastX instead."
      ),
      this.points[this.points.length - 2]
    );
  }
  get y() {
    return (
      ke(
        "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 dp = (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 a2 {
  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 a2(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 = 0.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,
      g = l - c * 2,
      m = o + a,
      v = s + l;
    return (((e >= o - u && e <= o + f) || (e >= m - f && e <= m + u)) &&
      n >= h &&
      n <= h + g) ||
      (((n >= s - u && n <= s + f) || (n >= v - f && n <= v + u)) &&
        e >= d &&
        e <= d + p)
      ? !0
      : (e < d && n < h && dp(e, n, d, h, c, f, u)) ||
          (e > m - c && n < h && dp(e, n, m - c, h, c, f, u)) ||
          (e > m - c && n > v - c && dp(e, n, m - c, v - c, c, f, u)) ||
          (e < d && n > v - c && dp(e, n, d, v - 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 DB = {};
function l2(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 DB[r] || oue(t, e, r, n);
}
function oue(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 Zo(i);
  return (DB[n] = s), s;
}
class wc {
  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 Q_(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 sue = { normal: "normal-npm", add: "add-npm", screen: "screen-npm" };
var an = ((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
))(an || {});
function xd(t, e) {
  return (e.alphaMode === "no-premultiply-alpha" && sue[t]) || t;
}
const aue = [
  "precision mediump float;",
  "void main(void){",
  "float test = 0.1;",
  "%forloop%",
  "gl_FragColor = vec4(0.0);",
  "}",
].join(`
`);
function lue(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 BB(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 = aue.replace(/%forloop%/gi, lue(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 oc = null;
function cue() {
  var e;
  if (oc) return oc;
  const t = fB();
  return (
    (oc = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)),
    (oc = BB(oc, t)),
    (e = t.getExtension("WEBGL_lose_context")) == null || e.loseContext(),
    oc
  );
}
class uue {
  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 fue {
  constructor() {
    (this.renderPipeId = "batch"),
      (this.action = "startBatch"),
      (this.start = 0),
      (this.size = 0),
      (this.textures = new uue()),
      (this.blendMode = "normal"),
      (this.topology = "triangle-strip"),
      (this.canBundle = !0);
  }
  destroy() {
    (this.textures = null),
      (this.gpuBindGroup = null),
      (this.bindGroup = null),
      (this.batcher = null);
  }
}
const kf = [];
let k0 = 0;
Eu.register({
  clear: () => {
    if (kf.length > 0) for (const t of kf) t && t.destroy();
    (kf.length = 0), (k0 = 0);
  },
});
function GT() {
  return k0 > 0 ? kf[--k0] : new fue();
}
function HT(t) {
  kf[k0++] = t;
}
let qu = 0;
const kB = class NB {
  constructor(e) {
    (this.uid = Ot("batcher")),
      (this.dirty = !0),
      (this.batchIndex = 0),
      (this.batches = []),
      (this._elements = []),
      (e = { ...NB.defaultOptions, ...e }),
      e.maxTextures ||
        (ke(
          "v8.8.0",
          "maxTextures is a required option for Batcher now, please pass it in the options"
        ),
        (e.maxTextures = cue()));
    const {
      maxTextures: n,
      attributesInitialSize: r,
      indicesInitialSize: i,
    } = e;
    (this.attributeBuffer = new wc(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++) HT(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 = GT(),
      i = r.textures;
    i.clear();
    const o = n[this.elementStart];
    let s = xd(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 g = this.elementStart; g < this.elementSize; ++g) {
      const m = n[g];
      n[g] = null;
      const y = m.texture._source,
        _ = xd(m.blendMode, y),
        x = s !== _ || a !== m.topology;
      if (y._batchTick === qu && !x) {
        (m._textureId = y._textureBindLocation),
          (f += m.indexSize),
          m.packAsQuad
            ? (this.packQuadAttributes(
                m,
                l,
                c,
                m._attributeStart,
                m._textureId
              ),
              this.packQuadIndex(
                u,
                m._indexStart,
                m._attributeStart / this.vertexSize
              ))
            : (this.packAttributes(m, l, c, m._attributeStart, m._textureId),
              this.packIndex(
                m,
                u,
                m._indexStart,
                m._attributeStart / this.vertexSize
              )),
          (m._batch = r);
        continue;
      }
      (y._batchTick = qu),
        (i.count >= p || x) &&
          (this._finishBatch(r, d, f - d, i, s, a, e, h),
          (h = "renderBatch"),
          (d = f),
          (s = _),
          (a = m.topology),
          (r = GT()),
          (i = r.textures),
          i.clear(),
          ++qu),
        (m._textureId = y._textureBindLocation = i.count),
        (i.ids[y.uid] = i.count),
        (i.textures[i.count++] = y),
        (m._batch = r),
        (f += m.indexSize),
        m.packAsQuad
          ? (this.packQuadAttributes(m, l, c, m._attributeStart, m._textureId),
            this.packQuadIndex(
              u,
              m._indexStart,
              m._attributeStart / this.vertexSize
            ))
          : (this.packAttributes(m, l, c, m._attributeStart, m._textureId),
            this.packIndex(
              m,
              u,
              m._indexStart,
              m._attributeStart / this.vertexSize
            ));
    }
    i.count > 0 &&
      (this._finishBatch(r, d, f - d, i, s, a, e, h), (d = f), ++qu),
      (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),
      ++qu,
      (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 wc(n);
    Q_(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 Q_(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() {
    if (this.batches !== null) {
      for (let e = 0; e < this.batches.length; e++) HT(this.batches[e]);
      this.batches = null;
      for (let e = 0; e < this._elements.length; e++)
        this._elements[e] && (this._elements[e]._batch = null);
      (this._elements = null),
        (this.indexBuffer = null),
        this.attributeBuffer.destroy(),
        (this.attributeBuffer = null);
    }
  }
};
kB.defaultOptions = {
  maxTextures: null,
  attributesInitialSize: 4,
  indicesInitialSize: 6,
};
let due = kB;
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 = Ot("buffer")),
      (this._resourceType = "buffer"),
      (this._resourceId = Ot("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 = Ot("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 FB(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 hue(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 pue(t) {
  return (
    (t instanceof zr || Array.isArray(t) || t.BYTES_PER_ELEMENT) &&
      (t = { buffer: t }),
    (t.buffer = FB(t.buffer, !1)),
    t
  );
}
class ih extends Jr {
  constructor(e = {}) {
    super(),
      (this.uid = Ot("geometry")),
      (this._layoutKey = 0),
      (this.instanceCount = 1),
      (this._bounds = new jn()),
      (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 = pue(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 = FB(e, !0)), this.buffers.push(this.indexBuffer);
  }
  get bounds() {
    return this._boundsDirty
      ? ((this._boundsDirty = !1), hue(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 gue = new Float32Array(1),
  mue = new Uint32Array(1);
class vue extends ih {
  constructor() {
    const n = new zr({
        data: gue,
        label: "attribute-batch-buffer",
        usage: it.VERTEX | it.COPY_DST,
        shrinkToFit: !1,
      }),
      r = new zr({
        data: mue,
        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 VT(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 Fe(`${r} placement hook does not exist in shader`);
    }
}
const yue = /\{\{(.*?)\}\}/g;
function zT(t) {
  var r;
  const e = {};
  return (
    (
      ((r = t.match(yue)) == null
        ? void 0
        : r.map((i) => i.replace(/[{()}]/g, ""))) ?? []
    ).forEach((i) => {
      e[i] = [];
    }),
    e
  );
}
function jT(t, e) {
  let n;
  const r = /@in\s+([^;]+);/g;
  for (; (n = r.exec(t)) !== null; ) e.push(n[1]);
}
function WT(t, e, n = !1) {
  const r = [];
  jT(e, r),
    t.forEach((a) => {
      a.header && jT(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 YT(t, e) {
  let n;
  const r = /@out\s+([^;]+);/g;
  for (; (n = r.exec(t)) !== null; ) e.push(n[1]);
}
function _ue(t) {
  const n = /\b(\w+)\s*:/g.exec(t);
  return n ? n[1] : "";
}
function xue(t) {
  const e = /@.*?\s+/g;
  return t.replace(e, "");
}
function bue(t, e) {
  const n = [];
  YT(e, n),
    t.forEach((l) => {
      l.header && YT(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 ${xue(l)};`).join(`
`),
    s = `return VSOutput(
            ${n.sort().map((l) => ` ${_ue(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 XT(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 Us = Object.create(null),
  W1 = new Map();
let wue = 0;
function Eue({ template: t, bits: e }) {
  const n = LB(t, e);
  if (Us[n]) return Us[n];
  const { vertex: r, fragment: i } = Cue(t, e);
  return (Us[n] = $B(r, i, e)), Us[n];
}
function Sue({ template: t, bits: e }) {
  const n = LB(t, e);
  return Us[n] || (Us[n] = $B(t.vertex, t.fragment, e)), Us[n];
}
function Cue(t, e) {
  const n = e.map((s) => s.vertex).filter((s) => !!s),
    r = e.map((s) => s.fragment).filter((s) => !!s);
  let i = WT(n, t.vertex, !0);
  i = bue(n, i);
  const o = WT(r, t.fragment, !0);
  return { vertex: i, fragment: o };
}
function LB(t, e) {
  return (
    e
      .map((n) => (W1.has(n) || W1.set(n, wue++), W1.get(n)))
      .sort((n, r) => n - r)
      .join("-") +
    t.vertex +
    t.fragment
  );
}
function $B(t, e, n) {
  const r = zT(t),
    i = zT(e);
  return (
    n.forEach((o) => {
      VT(o.vertex, r, o.name), VT(o.fragment, i, o.name);
    }),
    { vertex: XT(t, r), fragment: XT(e, i) }
  );
}
const Aue = `
    @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}}
    };
`,
  Tue = `
    @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;
      };
`,
  Pue = `
    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}}
    }
`,
  Iue = `

    in vec4 vColor;
    in vec2 vUV;

    out vec4 finalColor;

    {{header}}

    void main(void) {

        {{start}}

        vec4 outColor;

        {{main}}

        finalColor = outColor * vColor;

        {{end}}
    }
`,
  Oue = {
    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;
        `,
    },
  },
  Rue = {
    name: "global-uniforms-bit",
    vertex: {
      header: `
          uniform mat3 uProjectionMatrix;
          uniform mat3 uWorldTransformMatrix;
          uniform vec4 uWorldColorAlpha;
          uniform vec2 uResolution;
        `,
    },
  };
function oh({ bits: t, name: e }) {
  const n = Eue({
    template: { fragment: Tue, vertex: Aue },
    bits: [Oue, ...t],
  });
  return ys.from({
    name: e,
    vertex: { source: n.vertex, entryPoint: "main" },
    fragment: { source: n.fragment, entryPoint: "main" },
  });
}
function sh({ bits: t, name: e }) {
  return new ya({
    name: e,
    ...Sue({ template: { vertex: Pue, fragment: Iue }, bits: [Rue, ...t] }),
  });
}
const c2 = {
    name: "color-bit",
    vertex: {
      header: `
            @in aColor: vec4<f32>;
        `,
      main: `
            vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
        `,
    },
  },
  u2 = {
    name: "color-bit",
    vertex: {
      header: `
            in vec4 aColor;
        `,
      main: `
            vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
        `,
    },
  },
  Y1 = {};
function Mue(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 Due(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 f2(t) {
  return (
    Y1[t] ||
      (Y1[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;

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

                ${Due(t)}
            `,
        },
      }),
    Y1[t]
  );
}
const X1 = {};
function Bue(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 d2(t) {
  return (
    X1[t] ||
      (X1[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: `

                ${Bue(t)}
            `,
        },
      }),
    X1[t]
  );
}
const ah = {
    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;
            }
        `,
    },
  },
  lh = {
    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;
            }
        `,
    },
  },
  KT = {};
function h2(t) {
  let e = KT[t];
  if (e) return e;
  const n = new Int32Array(t);
  for (let r = 0; r < t; r++) n[r] = r;
  return (
    (e = KT[t] =
      new mr(
        { uTextures: { value: n, type: "i32", size: t } },
        { isStatic: !0 }
      )),
    e
  );
}
class kue extends yi {
  constructor(e) {
    const n = sh({ name: "batch", bits: [u2, d2(e), lh] }),
      r = oh({ name: "batch", bits: [c2, f2(e), ah] });
    super({ glProgram: n, gpuProgram: r, resources: { batchSamplers: h2(e) } });
  }
}
let K1 = null;
const UB = class GB extends due {
  constructor(e) {
    super(e),
      (this.geometry = new vue()),
      (this.name = GB.extension.name),
      (this.vertexSize = 6),
      K1 ?? (K1 = new kue(e.maxTextures)),
      (this.shader = K1);
  }
  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: g } = e,
      m = e.color,
      v = e.attributeOffset,
      y = v + e.attributeSize;
    for (let _ = v; _ < y; _++) {
      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++] = g[x]),
        (n[i++] = g[x + 1]),
        (r[i++] = m),
        (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,
      g = p.maxX,
      m = p.minX,
      v = p.maxY,
      y = p.minY,
      _ = s.uvs,
      x = e.color,
      b = (o << 16) | (e.roundPixels & 65535);
    (n[i + 0] = l * m + u * y + d),
      (n[i + 1] = f * y + c * m + h),
      (n[i + 2] = _.x0),
      (n[i + 3] = _.y0),
      (r[i + 4] = x),
      (r[i + 5] = b),
      (n[i + 6] = l * g + u * y + d),
      (n[i + 7] = f * y + c * g + h),
      (n[i + 8] = _.x1),
      (n[i + 9] = _.y1),
      (r[i + 10] = x),
      (r[i + 11] = b),
      (n[i + 12] = l * g + u * v + d),
      (n[i + 13] = f * v + c * g + h),
      (n[i + 14] = _.x2),
      (n[i + 15] = _.y2),
      (r[i + 16] = x),
      (r[i + 17] = b),
      (n[i + 18] = l * m + u * v + d),
      (n[i + 19] = f * v + c * m + h),
      (n[i + 20] = _.x3),
      (n[i + 21] = _.y3),
      (r[i + 22] = x),
      (r[i + 23] = b);
  }
};
UB.extension = { type: [V.Batcher], name: "default" };
let p2 = UB;
function Nue(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 g = t[n],
      m = t[n + 1];
    (r[i] = c * g + f * m + h),
      (r[i + 1] = u * g + d * m + p),
      (i += o),
      (n += e),
      l++;
  }
}
function Fue(t, e, n, r) {
  let i = 0;
  for (e *= n; i < r; ) (t[e] = 0), (t[e + 1] = 0), (e += n), i++;
}
function HB(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 Lue = new Re();
class g2 {
  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
      ? WD(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) || Lue;
  }
  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");
  }
  destroy() {
    (this.renderable = null),
      (this.texture = null),
      (this.geometryData = null),
      (this._batcher = null),
      (this._batch = null);
  }
}
const bd = {
    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,
        g = o,
        m = n + p,
        v = n - p,
        y = r + g;
      if (((e[u++] = m), (e[u++] = y), (e[--f] = y), (e[--f] = v), o)) {
        const x = r - g;
        (e[d++] = v), (e[d++] = x), (e[--h] = x), (e[--h] = m);
      }
      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), (g = o + a), (m = n + p), (v = n - p), (y = r + g);
      const _ = r - g;
      return (
        (e[u++] = m),
        (e[u++] = y),
        (e[--h] = _),
        (e[--h] = m),
        i && ((e[u++] = v), (e[u++] = y), (e[--h] = _), (e[--h] = v)),
        !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);
    },
  },
  $ue = { ...bd, extension: { ...bd.extension, name: "ellipse" } },
  Uue = { ...bd, extension: { ...bd.extension, name: "roundedRectangle" } },
  VB = 1e-4,
  qT = 1e-4;
function Gue(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 ZT(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,
    g = c + h,
    m = u + d,
    v = f + h;
  return a.push(p, g), a.push(m, v), 2;
}
function Ta(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),
    g = Math.sqrt(l * l + c * c),
    m = (((15 * p * Math.sqrt(g)) / Math.PI) >> 0) + 1,
    v = h / m;
  if (((d += v), a)) {
    s.push(t, e), s.push(n, r);
    for (let y = 1, _ = d; y < m; y++, _ += v)
      s.push(t, e), s.push(t + Math.sin(_) * g, e + Math.cos(_) * g);
    s.push(t, e), s.push(i, o);
  } else {
    s.push(n, r), s.push(t, e);
    for (let y = 1, _ = d; y < m; y++, _ += v)
      s.push(t + Math.sin(_) * g, e + Math.cos(_) * g), s.push(t, e);
    s.push(i, o), s.push(t, e);
  }
  return m * 2;
}
function Hue(t, e, n, r, i, o) {
  const s = VB;
  if (t.length === 0) return;
  const a = e;
  let l = a.alignment;
  if (e.alignment !== 0.5) {
    let K = Gue(t);
    n && (K *= -1), (l = (l - 0.5) * K + 0.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) * 0.5,
      fe = (u.y + c.y) * 0.5;
    t.unshift(K, fe), t.push(K, fe);
  }
  const h = i,
    p = t.length / 2;
  let g = t.length;
  const m = h.length / 2,
    v = a.width / 2,
    y = v * v,
    _ = 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 *= v), (A *= v);
  const G = l,
    D = (1 - G) * 2,
    $ = G * 2;
  f ||
    (a.cap === "round"
      ? (g +=
          Ta(
            x - C * (D - $) * 0.5,
            b - A * (D - $) * 0.5,
            x - C * D,
            b - A * D,
            x + C * $,
            b + A * $,
            h,
            !0
          ) + 2)
      : a.cap === "square" && (g += ZT(x, b, C, A, D, $, !0, h))),
    h.push(x - C * D, b - A * D),
    h.push(x + C * $, b + A * $);
  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 *= v),
      (A *= v),
      (T = -(E - P)),
      (I = w - S),
      (B = Math.sqrt(T * T + I * I)),
      (T /= B),
      (I /= B),
      (T *= v),
      (I *= v);
    const fe = w - x,
      se = b - E,
      Y = w - S,
      te = P - E,
      pe = fe * Y + se * te,
      F = se * Y - te * fe,
      J = F < 0;
    if (Math.abs(F) < 0.001 * Math.abs(pe)) {
      h.push(w - C * D, E - A * D),
        h.push(w + C * $, E + A * $),
        pe >= 0 &&
          (a.join === "round"
            ? (g +=
                Ta(w, E, w - C * D, E - A * D, w - T * D, E - I * D, h, !1) + 4)
            : (g += 2),
          h.push(w - T * $, E - I * $),
          h.push(w + T * D, E + I * D));
      continue;
    }
    const L = (-C + x) * (-A + E) - (-C + w) * (-A + b),
      ne = (-T + S) * (-I + E) - (-T + w) * (-I + P),
      ee = (fe * ne - Y * L) / F,
      de = (te * L - se * ne) / F,
      ge = (ee - w) * (ee - w) + (de - E) * (de - E),
      xe = w + (ee - w) * D,
      O = E + (de - E) * D,
      U = w - (ee - w) * $,
      W = E - (de - E) * $,
      ce = Math.min(fe * fe + se * se, Y * Y + te * te),
      ue = J ? D : $,
      M = ce + ue * ue * y;
    ge <= M
      ? a.join === "bevel" || ge / y > _
        ? (J
            ? (h.push(xe, O),
              h.push(w + C * $, E + A * $),
              h.push(xe, O),
              h.push(w + T * $, E + I * $))
            : (h.push(w - C * D, E - A * D),
              h.push(U, W),
              h.push(w - T * D, E - I * D),
              h.push(U, W)),
          (g += 2))
        : a.join === "round"
        ? J
          ? (h.push(xe, O),
            h.push(w + C * $, E + A * $),
            (g +=
              Ta(w, E, w + C * $, E + A * $, w + T * $, E + I * $, h, !0) + 4),
            h.push(xe, O),
            h.push(w + T * $, E + I * $))
          : (h.push(w - C * D, E - A * D),
            h.push(U, W),
            (g +=
              Ta(w, E, w - C * D, E - A * D, w - T * D, E - I * D, h, !1) + 4),
            h.push(w - T * D, E - I * D),
            h.push(U, W))
        : (h.push(xe, O), h.push(U, W))
      : (h.push(w - C * D, E - A * D),
        h.push(w + C * $, E + A * $),
        a.join === "round"
          ? J
            ? (g +=
                Ta(w, E, w + C * $, E + A * $, w + T * $, E + I * $, h, !0) + 2)
            : (g +=
                Ta(w, E, w - C * D, E - A * D, w - T * D, E - I * D, h, !1) + 2)
          : a.join === "miter" &&
            ge / y <= _ &&
            (J ? (h.push(U, W), h.push(U, W)) : (h.push(xe, O), h.push(xe, O)),
            (g += 2)),
        h.push(w - T * D, E - I * D),
        h.push(w + T * $, E + I * $),
        (g += 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 *= v),
    (A *= v),
    h.push(w - C * D, E - A * D),
    h.push(w + C * $, E + A * $),
    f ||
      (a.cap === "round"
        ? (g +=
            Ta(
              w - C * (D - $) * 0.5,
              E - A * (D - $) * 0.5,
              w - C * D,
              E - A * D,
              w + C * $,
              E + A * $,
              h,
              !1
            ) + 2)
        : a.cap === "square" && (g += ZT(w, E, C, A, D, $, !1, h)));
  const z = qT * qT;
  for (let K = m; K < g + m - 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)) < z) &&
        o.push(K, K + 1, K + 2);
}
function Vue(t, e, n, r) {
  const i = VB;
  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 zB(t, e, n, r, i, o, s) {
  const a = Uce(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 zue = [],
  jue = {
    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) {
      zB(t, zue, e, n, r, i, o);
    },
  },
  Wue = {
    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);
    },
  },
  Yue = {
    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);
    },
  },
  Xue = new Re(),
  Kue = new vt();
function que(t, e, n, r) {
  const i = e.matrix ? t.copyFrom(e.matrix).invert() : t.identity();
  if (e.textureSpace === "local") {
    const s = n.getBounds(Kue);
    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,
      g = i.c,
      m = i.d;
    (i.a *= c),
      (i.b *= c),
      (i.c *= u),
      (i.d *= u),
      (i.tx = f * h + d * g + i.tx),
      (i.ty = f * p + d * m + 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 us) &&
      o.addressMode === "clamp-to-edge" &&
      ((o.addressMode = "repeat"), o.update()),
    r && i.append(Xue.copyFrom(r).invert()),
    i
  );
}
const gm = {};
$e.handleByMap(V.ShapeBuilder, gm);
$e.add(Wue, jue, Yue, bd, $ue, Uue);
const Zue = new vt(),
  Jue = new Re();
function Que(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") efe(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 && JT(c.shapePath, l, !0, r, n),
        c &&
          (a.shapePrimitives[a.shapePrimitives.length - 1].holes =
            c.shapePath.shapePrimitives),
        JT(a, l, s, r, n);
    }
  }
}
function efe(t, e, n) {
  const r = [],
    i = gm.rectangle,
    o = Zue;
  (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 && HB(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 = gn.get(g2);
  (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 JT(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 = gm[l.type];
    if (!d.build(l, f)) return;
    const h = a.length,
      p = o.length / 2;
    let g = "triangle-list";
    if ((c && HB(f, c), n)) {
      const _ = l.closePath ?? !0,
        x = e;
      x.pixelLine
        ? (Vue(f, _, o, a), (g = "line-list"))
        : Hue(f, x, !1, _, o, a);
    } else if (u) {
      const _ = [],
        x = f.slice();
      tfe(u).forEach((w) => {
        _.push(x.length / 2), x.push(...w);
      }),
        zB(x, _, o, 2, p, a, h);
    } else d.triangulate(f, o, 2, p, a, h);
    const m = s.length / 2,
      v = e.texture;
    if (v !== Ae.WHITE) {
      const _ = que(Jue, e, l, c);
      Nue(o, 2, p, s, m, 2, o.length / 2 - p, _);
    } else Fue(s, m, 2, o.length / 2 - p);
    const y = gn.get(g2);
    (y.indexOffset = h),
      (y.indexSize = a.length - h),
      (y.attributeOffset = p),
      (y.attributeSize = o.length / 2 - p),
      (y.baseColor = e.color),
      (y.alpha = e.alpha),
      (y.texture = v),
      (y.geometryData = i),
      (y.topology = g),
      r.push(y);
  });
}
function tfe(t) {
  const e = [];
  for (let n = 0; n < t.length; n++) {
    const r = t[n].shape,
      i = [];
    gm[r.type].build(r, i) && e.push(i);
  }
  return e;
}
class nfe {
  constructor() {
    (this.batches = []),
      (this.geometryData = { vertices: [], uvs: [], indices: [] });
  }
}
class rfe {
  constructor() {
    this.instructions = new KD();
  }
  init(e) {
    (this.batcher = new p2({ maxTextures: e })), this.instructions.reset();
  }
  get geometry() {
    return (
      ke(
        ale,
        "GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."
      ),
      this.batcher.geometry
    );
  }
  destroy() {
    this.batcher.destroy(),
      this.instructions.destroy(),
      (this.batcher = null),
      (this.instructions = null);
  }
}
const m2 = class ex {
  constructor(e) {
    (this._gpuContextHash = {}),
      (this._graphicsDataContextHash = Object.create(null)),
      (this._renderer = e),
      e.renderableGC.addManagedHash(this, "_gpuContextHash"),
      e.renderableGC.addManagedHash(this, "_graphicsDataContextHash");
  }
  init(e) {
    ex.defaultOptions.bezierSmoothness =
      (e == null ? void 0 : e.bezierSmoothness) ??
      ex.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)),
        Que(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 = gn.get(rfe, {
        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 = l2(
        f.textures.textures,
        f.textures.count,
        this._renderer.limits.maxBatchableTextures
      );
    }
    return (this._graphicsDataContextHash[e.uid] = n), n;
  }
  _initContext(e) {
    const n = new nfe();
    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] &&
        (gn.return(this.getContextRenderData(e)),
        (this._graphicsDataContextHash[e.uid] = null))),
      n.batches &&
        n.batches.forEach((r) => {
          gn.return(r);
        });
  }
  destroy() {
    for (const e in this._gpuContextHash)
      this._gpuContextHash[e] &&
        this.onGraphicsContextDestroy(this._gpuContextHash[e].context);
  }
};
m2.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
  name: "graphicsContext",
};
m2.defaultOptions = { bezierSmoothness: 0.5 };
let v2 = m2;
const ife = 8,
  hp = 11920929e-14,
  ofe = 1;
function jB(t, e, n, r, i, o, s, a, l, c) {
  const f = Math.min(
    0.99,
    Math.max(0, c ?? v2.defaultOptions.bezierSmoothness)
  );
  let d = (ofe - f) / 1;
  return (d *= d), sfe(e, n, r, i, o, s, a, l, t, d), t;
}
function sfe(t, e, n, r, i, o, s, a, l, c) {
  tx(t, e, n, r, i, o, s, a, l, c, 0), l.push(s, a);
}
function tx(t, e, n, r, i, o, s, a, l, c, u) {
  if (u > ife) return;
  const f = (t + n) / 2,
    d = (e + r) / 2,
    h = (n + i) / 2,
    p = (r + o) / 2,
    g = (i + s) / 2,
    m = (o + a) / 2,
    v = (f + h) / 2,
    y = (d + p) / 2,
    _ = (h + g) / 2,
    x = (p + m) / 2,
    b = (v + _) / 2,
    w = (y + 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 > hp && C > hp) {
      if ((P + C) * (P + C) <= c * (E * E + S * S)) {
        l.push(b, w);
        return;
      }
    } else if (P > hp) {
      if (P * P <= c * (E * E + S * S)) {
        l.push(b, w);
        return;
      }
    } else if (C > hp) {
      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;
    }
  }
  tx(t, e, f, d, v, y, b, w, l, c, u + 1),
    tx(b, w, _, x, g, m, s, a, l, c, u + 1);
}
const afe = 8,
  lfe = 11920929e-14,
  cfe = 1;
function ufe(t, e, n, r, i, o, s, a) {
  const c = Math.min(
    0.99,
    Math.max(0, a ?? v2.defaultOptions.bezierSmoothness)
  );
  let u = (cfe - c) / 1;
  return (u *= u), ffe(e, n, r, i, o, s, t, u), t;
}
function ffe(t, e, n, r, i, o, s, a) {
  nx(s, t, e, n, r, i, o, a, 0), s.push(i, o);
}
function nx(t, e, n, r, i, o, s, a, l) {
  if (l > afe) 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 g = o - e,
    m = s - n;
  const v = Math.abs((r - o) * m - (i - s) * g);
  if (v > lfe) {
    if (v * v <= a * (g * g + m * m)) {
      t.push(h, p);
      return;
    }
  } else if (
    ((g = h - (e + o) / 2), (m = p - (n + s) / 2), g * g + m * m <= a)
  ) {
    t.push(h, p);
    return;
  }
  nx(t, e, n, c, u, h, p, a, l + 1), nx(t, h, p, f, d, o, s, a, l + 1);
}
function WB(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,
      g = n + h * r;
    t.push(p, g), (u += c);
  }
}
function dfe(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,
    g = l * u + c * f,
    m = (o * Math.sqrt(h)) / d,
    v = (o * Math.sqrt(p)) / d,
    y = (m * g) / h,
    _ = (v * g) / p,
    x = m * f + v * c,
    b = m * u + v * l,
    w = c * (v + y),
    E = l * (v + y),
    S = f * (m + _),
    P = u * (m + _),
    C = Math.atan2(E - b, w - x),
    A = Math.atan2(P - b, S - x);
  WB(t, x + e, b + n, o, C, A, c * u > f * l);
}
const Nf = Math.PI * 2,
  q1 = { centerX: 0, centerY: 0, ang1: 0, ang2: 0 },
  Z1 = ({ 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 hfe(t, e) {
  const n =
      e === -1.5707963267948966
        ? -0.551915024494
        : 1.3333333333333333 * Math.tan(e / 4),
    r = e === 1.5707963267948966 ? 0.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 QT = (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);
  },
  pfe = (t, e, n, r, i, o, s, a, l, c, u, f, d) => {
    const h = Math.pow(i, 2),
      p = Math.pow(o, 2),
      g = Math.pow(u, 2),
      m = Math.pow(f, 2);
    let v = h * p - h * m - p * g;
    v < 0 && (v = 0),
      (v /= h * m + p * g),
      (v = Math.sqrt(v) * (s === a ? -1 : 1));
    const y = ((v * i) / o) * f,
      _ = ((v * -o) / i) * u,
      x = c * y - l * _ + (t + n) / 2,
      b = l * y + c * _ + (e + r) / 2,
      w = (u - y) / i,
      E = (f - _) / o,
      S = (-u - y) / i,
      P = (-f - _) / o,
      C = QT(1, 0, w, E);
    let A = QT(w, E, S, P);
    a === 0 && A > 0 && (A -= Nf),
      a === 1 && A < 0 && (A += Nf),
      (d.centerX = x),
      (d.centerY = b),
      (d.ang1 = C),
      (d.ang2 = A);
  };
function gfe(t, e, n, r, i, o, s, a = 0, l = 0, c = 0) {
  if (o === 0 || s === 0) return;
  const u = Math.sin((a * Nf) / 360),
    f = Math.cos((a * Nf) / 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))),
    pfe(e, n, r, i, o, s, l, c, u, f, d, h, q1);
  let { ang1: g, ang2: m } = q1;
  const { centerX: v, centerY: y } = q1;
  let _ = Math.abs(m) / (Nf / 4);
  Math.abs(1 - _) < 1e-7 && (_ = 1);
  const x = Math.max(Math.ceil(_), 1);
  m /= 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 = hfe(g, m),
      { x: C, y: A } = Z1(P[0], o, s, f, u, v, y, E),
      { x: T, y: I } = Z1(P[1], o, s, f, u, v, y, E),
      { x: B, y: G } = Z1(P[2], o, s, f, u, v, y, E);
    jB(t, b, w, C, A, T, I, B, G), (b = B), (w = G), (g += m);
  }
}
function mfe(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 g = d / 2;
    let m,
      v = Math.abs((Math.cos(g) * l) / Math.sin(g));
    v > Math.min(u.len / 2, f.len / 2)
      ? ((v = Math.min(u.len / 2, f.len / 2)),
        (m = Math.abs((v * Math.sin(g)) / Math.cos(g))))
      : (m = l);
    const y = a.x + f.nx * v + -f.ny * m * h,
      _ = a.y + f.ny * v + f.nx * m * 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(y + Math.cos(x) * m, _ + Math.sin(x) * m),
      t.arc(y, _, m, x, b, p),
      (o = a);
  }
}
function vfe(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 m = Math.min(d / 2, c);
      h = o(l, u, m / d);
    }
    const p = i(f, l);
    let g;
    if (p < 1e-4) g = l;
    else {
      const m = Math.min(p / 2, c);
      g = o(l, f, m / p);
    }
    a === 0 ? t.moveTo(h.x, h.y) : t.lineTo(h.x, h.y),
      t.quadraticCurveTo(l.x, l.y, g.x, g.y, r);
  }
}
const yfe = new vt();
class _fe {
  constructor(e) {
    (this.shapePrimitives = []),
      (this._currentPoly = null),
      (this._bounds = new jn()),
      (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 WB(a, e, n, r, i, o, s), this;
  }
  arcTo(e, n, r, i, o) {
    this._ensurePoly();
    const s = this._currentPoly.points;
    return dfe(s, e, n, r, i, o), this;
  }
  arcToSvg(e, n, r, i, o, s, a) {
    const l = this._currentPoly.points;
    return (
      gfe(
        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 (
      jB(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 ufe(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 o2(e, n, r), i), this;
  }
  poly(e, n, r) {
    const i = new Bf(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) - 0.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),
        g = n + r * Math.sin(h),
        m = h + Math.PI + f,
        v = h - Math.PI - f,
        y = p + o * Math.cos(m),
        _ = g + o * Math.sin(m),
        x = p + o * Math.cos(v),
        b = g + o * Math.sin(v);
      d === 0 ? this.moveTo(y, _) : this.lineTo(y, _),
        this.quadraticCurveTo(p, g, x, b, a);
    }
    return this.closePath();
  }
  roundShape(e, n, r = !1, i) {
    return e.length < 3
      ? this
      : (r ? vfe(this, e, n, i) : mfe(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 s2(e, n, r, i), o), this;
  }
  roundRect(e, n, r, i, o, s) {
    return this.drawShape(new a2(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 Bf()),
      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 Bf()), 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(yfe);
      i.transform ? e.addRect(o, i.transform) : e.addRect(o);
    }
    return e;
  }
}
class Jo {
  constructor(e, n = !1) {
    (this.instructions = []),
      (this.uid = Ot("graphicsPath")),
      (this._dirty = !0),
      (this.checkForHoles = n),
      typeof e == "string"
        ? tue(e, this)
        : (this.instructions = (e == null ? void 0 : e.slice()) ?? []);
  }
  get shapePath() {
    return (
      this._shapePath || (this._shapePath = new _fe(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 Jo();
    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,
      g = 0;
    for (let m = 0; m < this.instructions.length; m++) {
      const v = this.instructions[m],
        y = v.data;
      switch (v.action) {
        case "moveTo":
        case "lineTo":
          (l = y[0]),
            (c = y[1]),
            (y[0] = n * l + i * c + s),
            (y[1] = r * l + o * c + a);
          break;
        case "bezierCurveTo":
          (u = y[0]),
            (f = y[1]),
            (d = y[2]),
            (h = y[3]),
            (l = y[4]),
            (c = y[5]),
            (y[0] = n * u + i * f + s),
            (y[1] = r * u + o * f + a),
            (y[2] = n * d + i * h + s),
            (y[3] = r * d + o * h + a),
            (y[4] = n * l + i * c + s),
            (y[5] = r * l + o * c + a);
          break;
        case "quadraticCurveTo":
          (u = y[0]),
            (f = y[1]),
            (l = y[2]),
            (c = y[3]),
            (y[0] = n * u + i * f + s),
            (y[1] = r * u + o * f + a),
            (y[2] = n * l + i * c + s),
            (y[3] = r * l + o * c + a);
          break;
        case "arcToSvg":
          (l = y[5]),
            (c = y[6]),
            (p = y[0]),
            (g = y[1]),
            (y[0] = n * p + i * g),
            (y[1] = r * p + o * g),
            (y[5] = n * l + i * c + s),
            (y[6] = r * l + o * c + a);
          break;
        case "circle":
          y[4] = Zu(y[3], e);
          break;
        case "rect":
          y[4] = Zu(y[4], e);
          break;
        case "ellipse":
          y[8] = Zu(y[8], e);
          break;
        case "roundRect":
          y[5] = Zu(y[5], e);
          break;
        case "addPath":
          y[0].transform(e);
          break;
        case "poly":
          y[2] = Zu(y[2], e);
          break;
        default:
          Fe("unknown transform action", v.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 Zu(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 xfe(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] = bfe(s);
          break;
        case "radialgradient":
          e.defs[s.id] = wfe();
          break;
      }
    }
  }
}
function bfe(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 us(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 = Ut.shared.setValue(l.getAttribute("stop-color")).toNumber();
    s.addColorStop(c, u);
  }
  return s;
}
function wfe(t) {
  return (
    Fe("[SVG Parser] Radial gradients are not yet supported"),
    new us(0, 0, 1, 0)
  );
}
function e3(t) {
  const e = t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);
  return e ? e[1] : "";
}
const t3 = {
  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 YB(t, e) {
  const n = t.getAttribute("style"),
    r = {},
    i = {},
    o = { strokeStyle: r, fillStyle: i, useFill: !1, useStroke: !1 };
  for (const s in t3) {
    const a = t.getAttribute(s);
    a && n3(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(":");
      t3[c] && n3(e, o, c, u.trim());
    }
  }
  return {
    strokeStyle: o.useStroke ? r : null,
    fillStyle: o.useFill ? i : null,
    useFill: o.useFill,
    useStroke: o.useStroke,
  };
}
function n3(t, e, n, r) {
  switch (n) {
    case "stroke":
      if (r !== "none") {
        if (r.startsWith("url(")) {
          const i = e3(r);
          e.strokeStyle.fill = t.defs[i];
        } else e.strokeStyle.color = Ut.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 = e3(r);
          e.fillStyle.fill = t.defs[i];
        } else e.fillStyle.color = Ut.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 Efe(t) {
  if (t.length <= 2) return !0;
  const e = t.map((a) => a.area).sort((a, l) => l - a),
    [n, r] = e,
    i = e[e.length - 1],
    o = n / r,
    s = r / i;
  return !(o > 3 && s < 2);
}
function Sfe(t) {
  return t.split(/(?=[Mm])/).filter((r) => r.trim().length > 0);
}
function Cfe(t) {
  const e = t.match(/[-+]?[0-9]*\.?[0-9]+/g);
  if (!e || e.length < 4) return 0;
  const n = e.map(Number),
    r = [],
    i = [];
  for (let u = 0; u < n.length; u += 2)
    u + 1 < n.length && (r.push(n[u]), i.push(n[u + 1]));
  if (r.length === 0 || i.length === 0) return 0;
  const o = Math.min(...r),
    s = Math.max(...r),
    a = Math.min(...i),
    l = Math.max(...i);
  return (s - o) * (l - a);
}
function r3(t, e) {
  const n = new Jo(t, !1);
  for (const r of n.instructions) e.instructions.push(r);
}
function Afe(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 Jo() };
  xfe(t, n);
  const r = t.children,
    { fillStyle: i, strokeStyle: o } = YB(t, n);
  for (let s = 0; s < r.length; s++) {
    const a = r[s];
    a.nodeName.toLowerCase() !== "defs" && XB(a, n, i, o);
  }
  return e;
}
function XB(t, e, n, r) {
  const i = t.children,
    { fillStyle: o, strokeStyle: s } = YB(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, g, m, v, y, _, x, b, w, E, S;
  switch (t.nodeName.toLowerCase()) {
    case "path": {
      b = t.getAttribute("d");
      const P = t.getAttribute("fill-rule"),
        C = Sfe(b),
        A = P === "evenodd",
        T = C.length > 1;
      if (A && T) {
        const B = C.map((D) => ({ path: D, area: Cfe(D) }));
        if ((B.sort((D, $) => $.area - D.area), C.length > 3 || !Efe(B)))
          for (let D = 0; D < B.length; D++) {
            const $ = B[D],
              z = D === 0;
            e.context.beginPath();
            const K = new Jo(void 0, !0);
            r3($.path, K),
              e.context.path(K),
              z
                ? (n && e.context.fill(n), r && e.context.stroke(r))
                : e.context.cut();
          }
        else
          for (let D = 0; D < B.length; D++) {
            const $ = B[D],
              z = D % 2 === 1;
            e.context.beginPath();
            const K = new Jo(void 0, !0);
            r3($.path, K),
              e.context.path(K),
              z
                ? e.context.cut()
                : (n && e.context.fill(n), r && e.context.stroke(r));
          }
      } else {
        const B = P ? P === "evenodd" : !0;
        (w = new Jo(b, B)),
          e.context.path(w),
          n && e.context.fill(n),
          r && e.context.stroke(r);
      }
      break;
    }
    case "circle":
      (p = Zt(t, "cx", 0)),
        (g = Zt(t, "cy", 0)),
        (m = Zt(t, "r", 0)),
        e.context.ellipse(p, g, m, m),
        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)),
        (v = Zt(t, "rx", 0)),
        (y = Zt(t, "ry", 0)),
        v || y
          ? e.context.roundRect(l, c, E, S, v || y)
          : 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)),
        (g = Zt(t, "cy", 0)),
        (v = Zt(t, "rx", 0)),
        (y = Zt(t, "ry", 0)),
        e.context.beginPath(),
        e.context.ellipse(p, g, v, y),
        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: {
      Fe(`[SVG parser] <${t.nodeName}> elements unsupported`);
      break;
    }
  }
  a && (n = null);
  for (let P = 0; P < i.length; P++) XB(i[P], e, n, r);
}
function Tfe(t) {
  return Ut.isColorLike(t);
}
function i3(t) {
  return t instanceof pm;
}
function o3(t) {
  return t instanceof us;
}
function Pfe(t) {
  return t instanceof Ae;
}
function Ife(t, e, n) {
  const r = Ut.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 s3(t, e, n) {
  return (
    (t.fill = e),
    (t.color = 16777215),
    (t.texture = e.texture),
    (t.matrix = e.transform),
    { ...n, ...t }
  );
}
function a3(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 Rfe(t, e) {
  const n = { ...e, ...t },
    r = Ut.shared.setValue(n.color);
  return (n.alpha *= r.alpha), (n.color = r.toNumber()), n;
}
function Xa(t, e) {
  if (t == null) return null;
  const n = {},
    r = t;
  return Tfe(t)
    ? Ife(n, t, e)
    : Pfe(t)
    ? Ofe(n, t, e)
    : i3(t)
    ? s3(n, t, e)
    : o3(t)
    ? a3(n, t, e)
    : r.fill && i3(r.fill)
    ? s3(r, r.fill, e)
    : r.fill && o3(r.fill)
    ? a3(r, r.fill, e)
    : Rfe(r, e);
}
function N0(t, e) {
  const {
      width: n,
      alignment: r,
      miterLimit: i,
      cap: o,
      join: s,
      pixelLine: a,
      ...l
    } = e,
    c = Xa(t, l);
  return c
    ? {
        width: n,
        alignment: r,
        miterLimit: i,
        cap: o,
        join: s,
        pixelLine: a,
        ...c,
      }
    : null;
}
const Mfe = new Gt(),
  l3 = new Re(),
  y2 = class Qi extends Jr {
    constructor() {
      super(...arguments),
        (this.uid = Ot("graphicsContext")),
        (this.dirty = !0),
        (this.batchMode = "auto"),
        (this.instructions = []),
        (this._activePath = new Jo()),
        (this._transform = new Re()),
        (this._fillStyle = { ...Qi.defaultFillStyle }),
        (this._strokeStyle = { ...Qi.defaultStrokeStyle }),
        (this._stateStack = []),
        (this._tick = 0),
        (this._bounds = new jn()),
        (this._boundsDirty = !0);
    }
    clone() {
      const e = new Qi();
      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 = Xa(e, Qi.defaultFillStyle);
    }
    get strokeStyle() {
      return this._strokeStyle;
    }
    set strokeStyle(e) {
      this._strokeStyle = N0(e, Qi.defaultStrokeStyle);
    }
    setFillStyle(e) {
      return (this._fillStyle = Xa(e, Qi.defaultFillStyle)), this;
    }
    setStrokeStyle(e) {
      return (this._strokeStyle = Xa(e, Qi.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 ? Ut.shared.setValue(n).toNumber() : 16777215,
          },
        }),
        this.onUpdate(),
        this
      );
    }
    beginPath() {
      return (this._activePath = new Jo()), 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" &&
                (ke(
                  tt,
                  "GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"
                ),
                (e = { color: e, alpha: n })),
              (this._fillStyle = Xa(e, Qi.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 = N0(e, Qi.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++, Afe(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 Re
        ? (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 Re
        ? (this._transform.append(e), this)
        : (l3.set(e, n, r, i, o, s), this._transform.append(l3), 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._boundsDirty = !0),
        !this.dirty && (this.emit("update", this, 16), (this.dirty = !0));
    }
    get bounds() {
      if (!this._boundsDirty) return this._bounds;
      this._boundsDirty = !1;
      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, Mfe) : e;
          if (s.action === "fill") r = d.contains(p.x, p.y);
          else {
            const m = c;
            r = d.strokeContains(p.x, p.y, m.width, m.alignment);
          }
          const g = a.hole;
          if (g) {
            const m = (i = g.shapePath) == null ? void 0 : i.shapePrimitives;
            if (m)
              for (let v = 0; v < m.length; v++)
                m[v].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);
    }
  };
y2.defaultFillStyle = {
  color: 16777215,
  alpha: 1,
  texture: Ae.WHITE,
  matrix: null,
  fill: null,
  textureSpace: "local",
};
y2.defaultStrokeStyle = {
  width: 1,
  color: 16777215,
  alpha: 1,
  alignment: 0.5,
  miterLimit: 10,
  cap: "butt",
  join: "miter",
  texture: Ae.WHITE,
  matrix: null,
  fill: null,
  textureSpace: "local",
  pixelLine: !1,
};
let ci = y2;
const _2 = class gc extends Jr {
  constructor(e = {}) {
    super(), (this.uid = Ot("textStyle")), (this._tick = 0), Dfe(e);
    const n = { ...gc.defaultTextStyle, ...e };
    for (const r in n) {
      const i = r;
      this[i] = n[r];
    }
    this.update(), (this._tick = 0);
  }
  get align() {
    return this._align;
  }
  set align(e) {
    this._align !== e && ((this._align = e), this.update());
  }
  get breakWords() {
    return this._breakWords;
  }
  set breakWords(e) {
    this._breakWords !== e && ((this._breakWords = e), this.update());
  }
  get dropShadow() {
    return this._dropShadow;
  }
  set dropShadow(e) {
    this._dropShadow !== e &&
      (e !== null && typeof e == "object"
        ? (this._dropShadow = this._createProxy({
            ...gc.defaultDropShadow,
            ...e,
          }))
        : (this._dropShadow = e
            ? this._createProxy({ ...gc.defaultDropShadow })
            : null),
      this.update());
  }
  get fontFamily() {
    return this._fontFamily;
  }
  set fontFamily(e) {
    this._fontFamily !== e && ((this._fontFamily = e), this.update());
  }
  get fontSize() {
    return this._fontSize;
  }
  set fontSize(e) {
    this._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 &&
      ((this._fontStyle = e.toLowerCase()), this.update());
  }
  get fontVariant() {
    return this._fontVariant;
  }
  set fontVariant(e) {
    this._fontVariant !== e && ((this._fontVariant = e), this.update());
  }
  get fontWeight() {
    return this._fontWeight;
  }
  set fontWeight(e) {
    this._fontWeight !== e && ((this._fontWeight = e), this.update());
  }
  get leading() {
    return this._leading;
  }
  set leading(e) {
    this._leading !== e && ((this._leading = e), this.update());
  }
  get letterSpacing() {
    return this._letterSpacing;
  }
  set letterSpacing(e) {
    this._letterSpacing !== e && ((this._letterSpacing = e), this.update());
  }
  get lineHeight() {
    return this._lineHeight;
  }
  set lineHeight(e) {
    this._lineHeight !== e && ((this._lineHeight = e), this.update());
  }
  get padding() {
    return this._padding;
  }
  set padding(e) {
    this._padding !== e && ((this._padding = e), this.update());
  }
  get filters() {
    return this._filters;
  }
  set filters(e) {
    this._filters !== e && ((this._filters = Object.freeze(e)), this.update());
  }
  get trim() {
    return this._trim;
  }
  set trim(e) {
    this._trim !== e && ((this._trim = e), this.update());
  }
  get textBaseline() {
    return this._textBaseline;
  }
  set textBaseline(e) {
    this._textBaseline !== e && ((this._textBaseline = e), this.update());
  }
  get whiteSpace() {
    return this._whiteSpace;
  }
  set whiteSpace(e) {
    this._whiteSpace !== e && ((this._whiteSpace = e), this.update());
  }
  get wordWrap() {
    return this._wordWrap;
  }
  set wordWrap(e) {
    this._wordWrap !== e && ((this._wordWrap = e), this.update());
  }
  get wordWrapWidth() {
    return this._wordWrapWidth;
  }
  set wordWrapWidth(e) {
    this._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 = Xa({ ...this._originalFill }, ci.defaultFillStyle);
          }
        )),
      (this._fill = Xa(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 = N0(
              { ...this._originalStroke },
              ci.defaultStrokeStyle
            );
          }
        )),
      (this._stroke = N0(e, ci.defaultStrokeStyle)),
      this.update());
  }
  update() {
    this._tick++, this.emit("update", this);
  }
  reset() {
    const e = gc.defaultTextStyle;
    for (const n in e) this[n] = e[n];
  }
  get styleKey() {
    return `${this.uid}-${this._tick}`;
  }
  clone() {
    return new gc({
      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 || ((r[i] = o), n == null || n(i, o), this.update()), !0
      ),
    });
  }
  _isFillStyle(e) {
    return (
      (e ?? null) !== null &&
      !(Ut.isColorLike(e) || e instanceof us || e instanceof pm)
    );
  }
};
_2.defaultDropShadow = {
  alpha: 1,
  angle: Math.PI / 6,
  blur: 0,
  color: "black",
  distance: 5,
};
_2.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 Cl = _2;
function Dfe(t) {
  const e = t;
  if (typeof e.dropShadow == "boolean" && e.dropShadow) {
    const n = Cl.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) {
    ke(tt, "strokeThickness is now a part of stroke");
    const n = e.stroke;
    let r = {};
    if (Ut.isColorLike(n)) r.color = n;
    else if (n instanceof us || n instanceof pm) 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 (
      (ke(tt, "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 &&
      Fe(
        "The number of fill colors must match the number of fill gradient stops."
      );
    const n = new us({
        start: { x: 0, y: 0 },
        end: { x: 0, y: 1 },
        textureSpace: "local",
      }),
      r = e.fillGradientStops.slice(),
      i = e.fill.map((o) => Ut.shared.setValue(o).toNumber());
    r.forEach((o, s) => {
      n.addColorStop(o, i[s]);
    }),
      (t.fill = { fill: n });
  }
}
class Bfe {
  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 = Qc(e)),
      (n = Qc(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 fs = new Bfe();
Eu.register(fs);
const c3 = 1e5;
function F0(t, e, n, r = 0) {
  if (t.texture === Ae.WHITE && !t.fill)
    return Ut.shared
      .setValue(t.color)
      .setAlpha(t.alpha ?? 1)
      .toHexa();
  if (t.fill) {
    if (t.fill instanceof pm) {
      const i = t.fill,
        o = e.createPattern(i.texture.source.resource, "repeat"),
        s = i.transform.copyTo(Re.shared);
      return (
        s.scale(i.texture.frame.width, i.texture.frame.height),
        o.setTransform(s),
        o
      );
    } else if (t.fill instanceof us) {
      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) * 0.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 g = h + p.offset * f;
            c.addColorStop(
              Math.floor(g * c3) / c3,
              Ut.shared.setValue(p.color).toHex()
            );
          });
        }
      } else
        i.colorStops.forEach((f) => {
          c.addColorStop(f.offset, Ut.shared.setValue(f.color).toHex());
        });
      return c;
    }
  } else {
    const i = e.createPattern(t.texture.source.resource, "repeat"),
      o = t.matrix.copyTo(Re.shared);
    return (
      o.scale(t.texture.frame.width, t.texture.frame.height),
      i.setTransform(o),
      i
    );
  }
  return Fe("FillStyle not recognised", t), "red";
}
const KB = class qB extends RB {
  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 = { ...qB.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 = B0(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 xo
            ? n.textureStyle
            : new xo(n.textureStyle)),
      (this.fontMetrics = Ii.measureFont(o)),
      (this.lineHeight =
        r.lineHeight || this.fontMetrics.fontSize || r.fontSize);
  }
  ensureCharacters(e) {
    var m, v;
    const n = Ii.graphemeSegmenter(e)
      .filter((y) => !this._currentChars.includes(y))
      .filter((y, _, x) => x.indexOf(y) === _);
    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,
      g = i.height / this.resolution;
    for (let y = 0; y < n.length; y++) {
      const _ = n[y],
        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 > g))
      ) {
        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 -
        (((m = a.dropShadow) == null ? void 0 : m.distance) ?? 0) -
        (((v = a._stroke) == null ? void 0 : v.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 (
      ke(
        tt,
        "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 = fs.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 wl({
          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 = B0(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 = F0(i, e))),
      n._fill && (e.fillStyle = F0(n._fill, e)),
      n.dropShadow)
    ) {
      const s = n.dropShadow,
        a = Ut.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 g = !1;
    s.stroke && u && ((g = !0), e.strokeText(a, f, d + p - h));
    const { shadowBlur: m, shadowOffsetX: v, shadowOffsetY: y } = e;
    s._fill &&
      (g && ((e.shadowBlur = 0), (e.shadowOffsetX = 0), (e.shadowOffsetY = 0)),
      e.fillText(a, f, d + p - h)),
      g && ((e.shadowBlur = m), (e.shadowOffsetX = v), (e.shadowOffsetY = y));
  }
  destroy() {
    super.destroy();
    for (let e = 0; e < this.pages.length; e++) {
      const { canvasAndContext: n, texture: r } = this.pages[e];
      fs.returnCanvasAndContext(n), r.destroy(!0);
    }
    this.pages = null;
  }
};
KB.defaultOptions = { textureSize: 512, style: new Cl(), mipmap: !0 };
let u3 = KB;
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 = (v) => {
      const y = o.width;
      for (let _ = 0; _ < l.index; _++) {
        const x = v.positions[_];
        o.chars.push(v.chars[_]), o.charPositions.push(x + y);
      }
      (o.width += v.width),
        (a = !1),
        (l.width = 0),
        (l.index = 0),
        (l.chars.length = 0);
    },
    g = () => {
      let v = o.chars.length - 1;
      if (r) {
        let y = o.chars[v];
        for (; y === " "; )
          (o.width -= n.chars[y].xAdvance), (y = o.chars[--v]);
      }
      (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);
    },
    m = (v) => v - u > f;
  for (let v = 0; v < t.length + 1; v++) {
    let y;
    const _ = v === t.length;
    _ || (y = t[v]);
    const x = n.chars[y] || n.chars[" "];
    if (
      /(?:\s)/.test(y) ||
      y === "\r" ||
      y ===
        `
` ||
      _
    ) {
      if (
        (!a && e.wordWrap && m(o.width + l.width)
          ? (g(), p(l), _ || o.charPositions.push(0))
          : ((l.start = o.width), p(l), _ || o.charPositions.push(0)),
        y === "\r" ||
          y ===
            `
`)
      )
        g();
      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(y);
      }
    } else {
      const E = x.kerning[s] || 0,
        S = x.xAdvance + E + u;
      h && m(o.width + l.width + S) && (p(l), g()),
        (l.positions[l.index++] = l.width + E),
        l.chars.push(y),
        (l.width += S);
    }
    s = y;
  }
  return (
    g(),
    e.align === "center"
      ? kfe(i)
      : e.align === "right"
      ? Nfe(i)
      : e.align === "justify" && Ffe(i),
    i
  );
}
function kfe(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 Nfe(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 Ffe(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 Lfe(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 pp = 0;
class $fe {
  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,
      }),
      (this.measureCache = MB(1e3));
  }
  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))
        : (n._stroke || n.dropShadow) &&
          ((r = `${n.styleKey}-bitmap`), (i = !1)),
      !bt.has(r))
    ) {
      const a = Object.create(n);
      a.lineHeight = 0;
      const l = new u3({
        style: a,
        overrideFill: i,
        overrideSize: !0,
        ...this.defaultOptions,
      });
      pp++,
        pp > 50 &&
          Fe(
            "BitmapText",
            `You have dynamically created ${pp} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``
          ),
        l.once("destroy", () => {
          pp--, 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 = `${e}-${n.styleKey}-${r}`;
    if (this.measureCache.has(o)) return this.measureCache.get(o);
    const s = Ii.graphemeSegmenter(e),
      a = ZB(s, n, i, r);
    return this.measureCache.set(o, a), a;
  }
  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,
      }),
      ke(
        tt,
        "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 Cl ? i : new Cl(i),
      s = n.dynamicFill ?? this._canUseTintForStyle(o),
      a = new u3({
        style: o,
        overrideFill: s,
        skipKerning: n.skipKerning,
        padding: n.padding,
        resolution: n.resolution,
        overrideSize: !1,
        textureStyle: n.textureStyle,
      }),
      l = Lfe(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 rx = new $fe();
class JB extends RB {
  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) {
    rx.install(e);
  }
  static uninstall(e) {
    rx.uninstall(e);
  }
}
const J1 = {
    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 g in h) {
          const m = h[g].split("="),
            v = m[0],
            y = m[1].replace(/"/gm, ""),
            _ = parseFloat(y),
            x = isNaN(_) ? y : _;
          p[v] = 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;
    },
  },
  f3 = {
    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;
    },
  },
  d3 = {
    test(t) {
      return typeof t == "string" && t.includes("<font>")
        ? f3.test(je.get().parseXML(t))
        : !1;
    },
    parse(t) {
      return f3.parse(je.get().parseXML(t));
    },
  },
  Ufe = [".xml", ".fnt"],
  Gfe = {
    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
      );
    },
  },
  Hfe = {
    extension: { type: V.LoadParser, priority: va.Normal },
    name: "loadBitmapFont",
    id: "bitmap-font",
    test(t) {
      return Ufe.includes(Ir.extname(t).toLowerCase());
    },
    async testParse(t) {
      return J1.test(t) || d3.test(t);
    },
    async parse(t, e, n) {
      const r = J1.test(t) ? J1.parse(t) : d3.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 = Ir.join(Ir.dirname(i), d);
        (h = z_(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 Vfe {
  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 zfe = {
  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 QB(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 jfe = {
    extension: { type: V.DetectionParser, priority: 1 },
    test: async () =>
      QB(
        "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="
      ),
    add: async (t) => [...t, "avif"],
    remove: async (t) => t.filter((e) => e !== "avif"),
  },
  h3 = ["png", "jpg", "jpeg"],
  Wfe = {
    extension: { type: V.DetectionParser, priority: -1 },
    test: () => Promise.resolve(!0),
    add: async (t) => [...t, ...h3],
    remove: async (t) => t.filter((e) => !h3.includes(e)),
  },
  Yfe =
    "WorkerGlobalScope" in globalThis &&
    globalThis instanceof globalThis.WorkerGlobalScope;
function mm(t) {
  return Yfe ? !1 : document.createElement("video").canPlayType(t) !== "";
}
const Xfe = {
    extension: { type: V.DetectionParser, priority: 0 },
    test: async () => mm("video/mp4"),
    add: async (t) => [...t, "mp4", "m4v"],
    remove: async (t) => t.filter((e) => e !== "mp4" && e !== "m4v"),
  },
  Kfe = {
    extension: { type: V.DetectionParser, priority: 0 },
    test: async () => mm("video/ogg"),
    add: async (t) => [...t, "ogv"],
    remove: async (t) => t.filter((e) => e !== "ogv"),
  },
  qfe = {
    extension: { type: V.DetectionParser, priority: 0 },
    test: async () => mm("video/webm"),
    add: async (t) => [...t, "webm"],
    remove: async (t) => t.filter((e) => e !== "webm"),
  },
  Zfe = {
    extension: { type: V.DetectionParser, priority: 0 },
    test: async () =>
      QB(
        "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="
      ),
    add: async (t) => [...t, "webp"],
    remove: async (t) => t.filter((e) => e !== "webp"),
  },
  ek = class Yp {
    constructor() {
      (this.loadOptions = { ...Yp.defaultOptions }),
        (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 &&
                Fe(
                  `[Assets] "loadParser" is deprecated, use "parser" instead for ${e}`
                ),
              o ||
                Fe(
                  `[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 (
                Fe(
                  `[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();
      const r =
          typeof n == "function"
            ? { ...Yp.defaultOptions, ...this.loadOptions, onProgress: n }
            : { ...Yp.defaultOptions, ...this.loadOptions, ...(n || {}) },
        {
          onProgress: i,
          onError: o,
          strategy: s,
          retryCount: a,
          retryDelay: l,
        } = r;
      let c = 0;
      const u = {},
        f = M0(e),
        d = Pi(e, (g) => ({ alias: [g], src: g, data: {} })),
        h = d.reduce((g, m) => g + (m.progressSize || 1), 0),
        p = d.map(async (g) => {
          const m = Ir.toAbsolute(g.src);
          u[g.src] ||
            (await this._loadAssetWithRetry(
              m,
              g,
              {
                onProgress: i,
                onError: o,
                strategy: s,
                retryCount: a,
                retryDelay: l,
              },
              u
            ),
            (c += g.progressSize || 1),
            i && i(c / h));
        });
      return await Promise.all(p), f ? u[d[0].src] : u;
    }
    async unload(e) {
      const r = Pi(e, (i) => ({ alias: [i], src: i })).map(async (i) => {
        var a, l;
        const o = Ir.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
                ? Fe("[Assets] parser should have an id")
                : (e[n.name] || e[n.id]) &&
                  Fe(`[Assets] parser id conflict "${n.id}"`),
              (e[n.name] = n),
              n.id && (e[n.id] = n),
              e
            ),
            {}
          ));
    }
    async _loadAssetWithRetry(e, n, r, i) {
      let o = 0;
      const { onError: s, strategy: a, retryCount: l, retryDelay: c } = r,
        u = (f) => new Promise((d) => setTimeout(d, f));
      for (;;)
        try {
          this.promiseCache[e] ||
            (this.promiseCache[e] = this._getLoadPromiseAndParser(e, n)),
            (i[n.src] = await this.promiseCache[e].promise);
          return;
        } catch (f) {
          delete this.promiseCache[e], delete i[n.src], o++;
          const d = a !== "retry" || o > l;
          if (a === "retry" && !d) {
            s && s(f, n), await u(c);
            continue;
          }
          if (a === "skip") {
            s && s(f, n);
            return;
          }
          throw (
            (s && s(f, n),
            new Error(`[Loader.load] Failed to load ${e}.
${f}`))
          );
        }
    }
  };
ek.defaultOptions = {
  onProgress: void 0,
  onError: void 0,
  strategy: "throw",
  retryCount: 3,
  retryDelay: 250,
};
let Jfe = ek;
function Cu(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 Au(t, e) {
  const n = t.split("?")[0],
    r = Ir.extname(n).toLowerCase();
  return Array.isArray(e) ? e.includes(r) : r === e;
}
const Qfe = ".json",
  ede = "application/json",
  tde = {
    extension: { type: V.LoadParser, priority: va.Low },
    name: "loadJson",
    id: "json",
    test(t) {
      return Cu(t, ede) || Au(t, Qfe);
    },
    async load(t) {
      return await (await je.get().fetch(t)).json();
    },
  },
  nde = ".txt",
  rde = "text/plain",
  ide = {
    name: "loadTxt",
    id: "text",
    extension: { type: V.LoadParser, priority: va.Low, name: "loadTxt" },
    test(t) {
      return Cu(t, rde) || Au(t, nde);
    },
    async load(t) {
      return await (await je.get().fetch(t)).text();
    },
  },
  ode = [
    "normal",
    "bold",
    "100",
    "200",
    "300",
    "400",
    "500",
    "600",
    "700",
    "800",
    "900",
  ],
  sde = [".ttf", ".otf", ".woff", ".woff2"],
  ade = ["font/ttf", "font/otf", "font/woff", "font/woff2"],
  lde = /^(--|-?[A-Z_])[0-9A-Z_-]*$/i;
function cde(t) {
  const e = Ir.extname(t),
    i = Ir.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(lde)) {
      o = !1;
      break;
    }
  let s = i.join(" ");
  return o || (s = `"${s.replace(/[\\"]/g, "\\$&")}"`), s;
}
const ude = /^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;
function fde(t) {
  return ude.test(t) ? t : encodeURI(t);
}
const dde = {
  extension: { type: V.LoadParser, priority: va.Low },
  name: "loadWebFont",
  id: "web-font",
  test(t) {
    return Cu(t, ade) || Au(t, sde);
  },
  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) ?? cde(t),
        l = ((o = (i = e.data) == null ? void 0 : i.weights) == null
          ? void 0
          : o.filter((u) => ode.includes(u))) ?? ["normal"],
        c = e.data ?? {};
      for (let u = 0; u < l.length; u++) {
        const f = l[u],
          d = new FontFace(a, `url(${fde(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 (
      Fe("[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 x2(t, e = 1) {
  var r;
  const n = (r = Su.RETINA_PREFIX) == null ? void 0 : r.exec(t);
  return n ? parseFloat(n[1]) : e;
}
function b2(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] &&
        (Fe(
          "[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 ||
        (Fe(
          "[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."
        ),
        i());
    }),
    r
  );
}
const hde = ".svg",
  pde = "image/svg+xml",
  gde = {
    extension: { type: V.LoadParser, priority: va.Low, name: "loadSVG" },
    name: "loadSVG",
    id: "svg",
    config: { crossOrigin: "anonymous", parseAsGraphicsContext: !1 },
    test(t) {
      return Cu(t, pde) || Au(t, hde);
    },
    async load(t, e, n) {
      var r;
      return ((r = e.data) == null ? void 0 : r.parseAsGraphicsContext) ??
        this.config.parseAsGraphicsContext
        ? vde(t)
        : mde(t, e, n, this.config.crossOrigin);
    },
    unload(t) {
      t.destroy(!0);
    },
  };
async function mde(t, e, n, r) {
  var m, v, y;
  const i = await je.get().fetch(t),
    o = je.get().createImage();
  (o.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(
    await i.text()
  )}`),
    (o.crossOrigin = r),
    await o.decode();
  const s = ((m = e.data) == null ? void 0 : m.width) ?? o.width,
    a = ((v = e.data) == null ? void 0 : v.height) ?? o.height,
    l = ((y = e.data) == null ? void 0 : y.resolution) || x2(t),
    c = Math.ceil(s * l),
    u = Math.ceil(a * l),
    f = je.get().createCanvas(c, u),
    d = f.getContext("2d");
  (d.imageSmoothingEnabled = !0),
    (d.imageSmoothingQuality = "high"),
    d.drawImage(o, 0, 0, s * l, a * l);
  const { parseAsGraphicsContext: h, ...p } = e.data ?? {},
    g = new wl({
      resource: f,
      alphaMode: "premultiply-alpha-on-upload",
      resolution: l,
      ...p,
    });
  return b2(g, n, t);
}
async function vde(t) {
  const n = await (await je.get().fetch(t)).text(),
    r = new ci();
  return r.svg(n), r;
}
const yde = `(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 kc = null,
  ix = class {
    constructor() {
      kc ||
        (kc = URL.createObjectURL(
          new Blob([yde], { type: "application/javascript" })
        )),
        (this.worker = new Worker(kc));
    }
  };
ix.revokeObjectURL = function () {
  kc && (URL.revokeObjectURL(kc), (kc = null));
};
const _de = `(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 Nc = null;
class tk {
  constructor() {
    Nc ||
      (Nc = URL.createObjectURL(
        new Blob([_de], { type: "application/javascript" })
      )),
      (this.worker = new Worker(Nc));
  }
}
tk.revokeObjectURL = function () {
  Nc && (URL.revokeObjectURL(Nc), (Nc = null));
};
let p3 = 0,
  Q1;
class xde {
  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 ix();
          n.addEventListener("message", (r) => {
            n.terminate(), ix.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() {
    Q1 === void 0 && (Q1 = navigator.hardwareConcurrency || 4);
    let e = this._workerPool.pop();
    return (
      !e &&
        this._createdWorkers < Q1 &&
        (this._createdWorkers++,
        (e = new tk().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[p3] = { resolve: n.resolve, reject: n.reject }),
      e.postMessage({ data: n.arguments, uuid: p3++, 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 g3 = new xde(),
  bde = [".jpeg", ".jpg", ".png", ".webp", ".avif"],
  wde = ["image/jpeg", "image/png", "image/webp", "image/avif"];
async function Ede(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 nk = {
    name: "loadTextures",
    id: "texture",
    extension: { type: V.LoadParser, priority: va.High, name: "loadTextures" },
    config: {
      preferWorkers: !0,
      preferCreateImageBitmap: !0,
      crossOrigin: "anonymous",
    },
    test(t) {
      return Cu(t, wde) || Au(t, bde);
    },
    async load(t, e, n) {
      var o;
      let r = null;
      globalThis.createImageBitmap && this.config.preferCreateImageBitmap
        ? this.config.preferWorkers && (await g3.isImageBitmapSupported())
          ? (r = await g3.loadImageBitmap(t, e))
          : (r = await Ede(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 wl({
        resource: r,
        alphaMode: "premultiply-alpha-on-upload",
        resolution: ((o = e.data) == null ? void 0 : o.resolution) || x2(t),
        ...e.data,
      });
      return b2(i, n, t);
    },
    unload(t) {
      t.destroy(!0);
    },
  },
  Sde = [".mp4", ".m4v", ".webm", ".ogg", ".ogv", ".h264", ".avi", ".mov"];
let ev, tv;
function Cde(t, e, n) {
  n === void 0 && !e.startsWith("data:")
    ? (t.crossOrigin = Tde(e))
    : n !== !1 && (t.crossOrigin = typeof n == "string" ? n : "anonymous");
}
function Ade(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 Tde(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 Pde() {
  const t = [],
    e = [];
  for (const n of Sde) {
    const r = Df.MIME_TYPES[n.substring(1)] || `video/${n.substring(1)}`;
    mm(r) && (t.push(n), e.includes(r) || e.push(r));
  }
  return { validVideoExtensions: t, validVideoMime: e };
}
const Ide = {
    name: "loadVideo",
    id: "video",
    extension: { type: V.LoadParser, name: "loadVideo" },
    test(t) {
      if (!ev || !tv) {
        const { validVideoExtensions: r, validVideoMime: i } = Pde();
        (ev = r), (tv = i);
      }
      const e = Cu(t, tv),
        n = Au(t, ev);
      return e || n;
    },
    async load(t, e, n) {
      var l, c;
      const r = {
          ...Df.defaultOptions,
          resolution: ((l = e.data) == null ? void 0 : l.resolution) || x2(t),
          alphaMode:
            ((c = e.data) == null ? void 0 : c.alphaMode) || (await rB()),
          ...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),
        Cde(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 = Df.MIME_TYPES[u] || `video/${u}`;
      }
      return (
        (s.src = t),
        a && (s.type = a),
        new Promise((u) => {
          const f = async () => {
            const d = new Df({ ...r, resource: i });
            i.removeEventListener("canplay", f),
              e.data.preload && (await Ade(i)),
              u(b2(d, n, t));
          };
          r.preload && !r.autoPlay && i.load(),
            i.addEventListener("canplay", f),
            i.appendChild(s);
        })
      );
    },
    unload(t) {
      t.destroy(!0);
    },
  },
  rk = {
    extension: { type: V.ResolveParser, name: "resolveTexture" },
    test: nk.test,
    parse: (t) => {
      var e;
      return {
        resolution: parseFloat(
          ((e = Su.RETINA_PREFIX.exec(t)) == null ? void 0 : e[1]) ?? "1"
        ),
        format: t.split(".").pop(),
        src: t,
      };
    },
  },
  Ode = {
    extension: { type: V.ResolveParser, priority: -2, name: "resolveJson" },
    test: (t) => Su.RETINA_PREFIX.test(t) && t.endsWith(".json"),
    parse: rk.parse,
  };
class Rde {
  constructor() {
    (this._detections = []),
      (this._initialized = !1),
      (this.resolver = new Su()),
      (this.loader = new Jfe()),
      (this.cache = bt),
      (this._backgroundLoader = new Vfe(this.loader)),
      (this._backgroundLoader.active = !0),
      this.reset();
  }
  async init(e = {}) {
    var o, s;
    if (this._initialized) {
      Fe(
        "[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),
      e.loadOptions &&
        (this.loader.loadOptions = {
          ...this.loader.loadOptions,
          ...e.loadOptions,
        });
  }
  add(e) {
    this.resolver.add(e);
  }
  async load(e, n) {
    this._initialized || (await this.init());
    const r = M0(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;
    const l = [],
      c = () => {
        n == null || n(l.reduce((f, d) => f + d, 0) / a);
      },
      u = s.map((f, d) => {
        const h = i[f],
          p = Object.values(h),
          m = [...new Set(p.flat())].reduce(
            (v, y) => v + (y.progressSize || 1),
            0
          );
        return (
          l.push(0),
          (a += m),
          this._mapLoadToResolve(h, (v) => {
            (l[d] = v * m), c();
          }).then((v) => {
            o[f] = v;
          })
        );
      });
    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 gp = new Rde();
$e.handleByList(V.LoadParser, gp.loader.parsers)
  .handleByList(V.ResolveParser, gp.resolver.parsers)
  .handleByList(V.CacheParser, gp.cache.parsers)
  .handleByList(V.DetectionParser, gp.detections);
$e.add(
  zfe,
  Wfe,
  jfe,
  Zfe,
  Xfe,
  Kfe,
  qfe,
  tde,
  ide,
  dde,
  gde,
  nk,
  Ide,
  Hfe,
  Gfe,
  rk,
  Ode
);
const m3 = {
  loader: V.LoadParser,
  resolver: V.ResolveParser,
  cache: V.CacheParser,
  detection: V.DetectionParser,
};
$e.handle(
  V.Asset,
  (t) => {
    const e = t.ref;
    Object.entries(m3)
      .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(m3)
      .filter((n) => !!e[n])
      .forEach((n) => $e.remove(e[n]));
  }
);
class ik {
  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 cB({
      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);
  }
}
ik.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "dom",
};
class Mde {
  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 ||
      (Vn.system.add(this._tickerUpdate, this, El.INTERACTION),
      (this._tickerAdded = !0));
  }
  removeTickerListener() {
    this._tickerAdded &&
      (Vn.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());
  }
  destroy() {
    this.removeTickerListener(),
      (this.events = null),
      (this.domElement = null),
      (this._deltaTime = 0),
      (this._didMove = !1),
      (this._tickerAdded = !1),
      (this._pauseUpdate = !0);
  }
}
const Go = new Mde();
class L0 extends rh {
  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, g) {
    throw new Error("Method not implemented.");
  }
}
class Ei extends L0 {
  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 nu extends L0 {
  constructor() {
    super(...arguments),
      (this.DOM_DELTA_PIXEL = 0),
      (this.DOM_DELTA_LINE = 1),
      (this.DOM_DELTA_PAGE = 2);
  }
}
nu.DOM_DELTA_PIXEL = 0;
nu.DOM_DELTA_LINE = 1;
nu.DOM_DELTA_PAGE = 2;
const Dde = 2048,
  Bde = new Gt(),
  Ju = new Gt();
class kde {
  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 Fe(`[EventBoundary]: Event mapping not defined for ${e.type}`);
  }
  hitTest(e, n) {
    Go.pauseUpdate = !0;
    const i =
        this._isPointerMoveEvent && this.enableGlobalMoveEvents
          ? "hitTestMoveRecursive"
          : "hitTestRecursive",
      o = this[i](
        this.rootTarget,
        this.rootTarget.eventMode,
        Bde.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") && (Go.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") && (Go.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, Ju), !e.hitArea.contains(Ju.x, Ju.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, Ju), e.containsPoint(Ju))
      : !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)) {
      Fe("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)) {
      Fe("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)) {
      Fe("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)) {
      Fe("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)) {
      Fe("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)) {
      Fe("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 nu)) {
      Fe("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(nu);
    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 L0 &&
      n instanceof L0 &&
      ((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 Nde = 1,
  Fde = {
    touchstart: "pointerdown",
    touchend: "pointerup",
    touchendoutside: "pointerupoutside",
    touchmove: "pointermove",
    touchcancel: "pointercancel",
  },
  w2 = class ox {
    constructor(e) {
      (this.supportsTouchEvents = "ontouchstart" in globalThis),
        (this.supportsPointerEvents = !!globalThis.PointerEvent),
        (this.domElement = null),
        (this.resolution = 1),
        (this.renderer = e),
        (this.rootBoundary = new kde(null)),
        Go.init(this),
        (this.autoPreventDefault = !0),
        (this._eventsAdded = !1),
        (this._rootPointerEvent = new Ei(null)),
        (this._rootWheelEvent = new nu(null)),
        (this.cursorStyles = { default: "inherit", pointer: "pointer" }),
        (this.features = new Proxy(
          { ...ox.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),
        (ox._defaultEventMode = e.eventMode ?? "passive"),
        Object.assign(this.features, e.eventFeatures ?? {}),
        (this.rootBoundary.enableGlobalMoveEvents = this.features.globalMove);
    }
    resolutionChange(e) {
      this.resolution = e;
    }
    destroy() {
      Go.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),
        Go.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),
        (Go.domElement = e),
        this._addEvents();
    }
    _addEvents() {
      if (this._eventsAdded || !this.domElement) return;
      Go.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;
      Go.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 || 0.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 = Nde),
          typeof r.pressure > "u" && (r.pressure = 0.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 = Fde[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);
    }
  };
w2.extension = {
  name: "events",
  type: [V.WebGLSystem, V.CanvasSystem, V.WebGPUSystem],
  priority: -1,
};
w2.defaultEventFeatures = { move: !0, globalMove: !0, click: !0, wheel: !0 };
let ok = w2;
const Lde = {
  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 ?? ok.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 rh))
      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
    );
  },
};
var $de = `in vec2 aPosition;
out vec2 vTextureCoord;

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();
    vTextureCoord = filterTextureCoord();
}
`;
const sk = {
    5: [0.153388, 0.221461, 0.250301],
    7: [0.071303, 0.131514, 0.189879, 0.214607],
    9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],
    11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],
    13: [0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641],
    15: [
      489e-6, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697,
      0.197448,
    ],
  },
  Ude = [
    "in vec2 vBlurTexCoords[%size%];",
    "uniform sampler2D uTexture;",
    "out vec4 finalColor;",
    "void main(void)",
    "{",
    "    finalColor = vec4(0.0);",
    "    %blur%",
    "}",
  ].join(`
`);
function Gde(t) {
  const e = sk[t],
    n = e.length;
  let r = Ude,
    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 Hde = `
    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 Vde(t, e) {
  const n = Math.ceil(t / 2);
  let r = Hde,
    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 zde(t, e) {
  const n = Vde(e, t),
    r = Gde(e);
  return ya.from({
    vertex: n,
    fragment: r,
    name: `blur-${t ? "horizontal" : "vertical"}-pass-filter`,
  });
}
var jde = `

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 Wde(t, e) {
  const n = sk[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 = jde
      .replace("%blur-struct%", a)
      .replace("%blur-vertex-out%", l)
      .replace("%blur-fragment-in%", a)
      .replace("%blur-sampling%", c)
      .replace("%dimension%", t ? "z" : "w");
  return ys.from({
    vertex: { source: u, entryPoint: "mainVertex" },
    fragment: { source: u, entryPoint: "mainFragment" },
  });
}
const ak = class lk extends dm {
  constructor(e) {
    e = { ...lk.defaultOptions, ...e };
    const n = zde(e.horizontal, e.kernelSize),
      r = Wde(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 = sn.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),
        sn.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);
  }
};
ak.defaultOptions = { strength: 8, quality: 4, kernelSize: 5 };
let nv = ak;
class Yde extends dm {
  constructor(...e) {
    let n = e[0] ?? {};
    typeof n == "number" &&
      (ke(
        tt,
        "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 = { ...nv.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 nv({ horizontal: !0, ...n })),
      (this.blurYFilter = new nv({ 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 = sn.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),
        sn.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 (
      ke(
        "8.3.0",
        "BlurFilter.blur is deprecated, please use BlurFilter.strength instead."
      ),
      this.strength
    );
  }
  set blur(e) {
    ke(
      "8.3.0",
      "BlurFilter.blur is deprecated, please use BlurFilter.strength instead."
    ),
      (this.strength = e);
  }
  get blurX() {
    return (
      ke(
        "8.3.0",
        "BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."
      ),
      this.strengthX
    );
  }
  set blurX(e) {
    ke(
      "8.3.0",
      "BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."
    ),
      (this.strengthX = e);
  }
  get blurY() {
    return (
      ke(
        "8.3.0",
        "BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."
      ),
      this.strengthY
    );
  }
  set blurY(e) {
    ke(
      "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();
  }
}
Yde.defaultOptions = { strength: 8, quality: 4, kernelSize: 5 };
var Xde = `in vec2 vTextureCoord;
out vec4 finalColor;
uniform sampler2D uTexture;
void main() {
    finalColor = texture(uTexture, vTextureCoord);
}
`,
  v3 = `struct GlobalFilterUniforms {
  uInputSize: vec4<f32>,
  uInputPixel: vec4<f32>,
  uInputClamp: vec4<f32>,
  uOutputFrame: vec4<f32>,
  uGlobalFrame: vec4<f32>,
  uOutputTexture: vec4<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;

struct VSOutput {
  @builtin(position) position: vec4<f32>,
  @location(0) uv: 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);
}

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

@fragment
fn mainFragment(
  @location(0) uv: vec2<f32>,
) -> @location(0) vec4<f32> {
    return textureSample(uTexture, uSampler, uv);
}
`;
class Kde extends dm {
  constructor() {
    const e = ys.from({
        vertex: { source: v3, entryPoint: "mainVertex" },
        fragment: { source: v3, entryPoint: "mainFragment" },
        name: "passthrough-filter",
      }),
      n = ya.from({ vertex: $de, fragment: Xde, name: "passthrough-filter" });
    super({ gpuProgram: e, glProgram: n });
  }
}
class ck {
  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;
  }
}
ck.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "filter",
};
const y3 = new Re();
function qde(t, e) {
  e.clear();
  const n = e.matrix;
  for (let r = 0; r < t.length; r++) {
    const i = t[r];
    if (i.globalDisplayStatus < 7) continue;
    const o = i.renderGroup ?? i.parentRenderGroup;
    o != null && o.isCachedAsTexture
      ? (e.matrix = y3
          .copyFrom(o.textureOffsetInverseTransform)
          .append(i.worldTransform))
      : o != null && o._parentCacheAsTextureRenderGroup
      ? (e.matrix = y3
          .copyFrom(o._parentCacheAsTextureRenderGroup.inverseWorldTransform)
          .append(i.groupTransform))
      : (e.matrix = i.worldTransform),
      e.addBounds(i.bounds);
  }
  return (e.matrix = n), e;
}
const Zde = new ih({
  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 Jde {
  constructor() {
    (this.skip = !1),
      (this.inputTexture = null),
      (this.backTexture = null),
      (this.filters = null),
      (this.bounds = new jn()),
      (this.container = null),
      (this.blendRequired = !1),
      (this.outputRenderSurface = null),
      (this.globalFrame = { x: 0, y: 0, width: 0, height: 0 }),
      (this.firstEnabledIndex = -1),
      (this.lastEnabledIndex = -1);
  }
}
class uk {
  constructor(e) {
    (this._filterStackIndex = 0),
      (this._filterStack = []),
      (this._filterGlobalUniforms = new mr({
        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 Zo({})),
      (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.every((h) => !h.enabled)) {
      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.every((h) => !h.enabled)) 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 = sn.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 && sn.returnTexture(n.backTexture),
      sn.returnTexture(n.inputTexture));
  }
  getBackTexture(e, n, r) {
    const i = e.colorTexture.source._resolution,
      o = sn.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 p = this._findPreviousFilterOffset();
      (f = p.x), (d = p.y);
    }
    this._updateFilterUniforms(n, r, s, f, d, u, l, i);
    const h = e.enabled ? e : this._getPassthroughFilter();
    this._setupBindGroupsAndRender(h, 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(Re.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() {
    var e;
    (e = this._passthroughFilter) == null || e.destroy(!0),
      (this._passthroughFilter = null);
  }
  _getPassthroughFilter() {
    return (
      this._passthroughFilter ?? (this._passthroughFilter = new Kde()),
      this._passthroughFilter
    );
  }
  _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: Zde,
        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.inputTexture = sn.getOptimalTexture(
        n.width,
        n.height,
        e.resolution,
        e.antialias
      )),
      e.blendRequired)
    ) {
      r.renderTarget.finishRenderPass();
      const o = r.renderTarget.getRenderTarget(e.outputRenderSurface);
      e.backTexture = this.getBackTexture(o, n, i == null ? void 0 : i.bounds);
    }
    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,
      g = 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] = 0.5 * d[2]),
      (h[1] = 0.5 * d[3]),
      (h[2] = e.frame.width * f[2] - 0.5 * d[2]),
      (h[3] = e.frame.height * f[3] - 0.5 * d[3]);
    const m = this.renderer.renderTarget.rootRenderTarget.colorTexture;
    (p[0] = i * s),
      (p[1] = o * s),
      (p[2] = m.source.width * s),
      (p[3] = m.source.height * s),
      n instanceof Ae && (n.source.resource = null);
    const v = this.renderer.renderTarget.getRenderTarget(n);
    this.renderer.renderTarget.bind(n, !!l),
      n instanceof Ae
        ? ((g[0] = n.frame.width), (g[1] = n.frame.height))
        : ((g[0] = v.width), (g[1] = v.height)),
      (g[2] = v.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
        ? qde(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,
      s = e.firstEnabledIndex,
      a = e.lastEnabledIndex;
    if (
      (this._globalFilterBindGroup.setResource(r.source.style, 2),
      this._globalFilterBindGroup.setResource(e.backTexture.source, 3),
      s === a)
    )
      o[s].apply(this, r, e.outputRenderSurface, n);
    else {
      let l = e.inputTexture;
      const c = sn.getOptimalTexture(
        i.width,
        i.height,
        l.source._resolution,
        !1
      );
      let u = c;
      for (let f = s; f < a; f++) {
        const d = o[f];
        if (!d.enabled) continue;
        d.apply(this, l, u, !0);
        const h = l;
        (l = u), (u = h);
      }
      o[a].apply(this, l, e.outputRenderSurface, n), sn.returnTexture(c);
    }
  }
  _calculateFilterBounds(e, n, r, i, o) {
    var v;
    const s = this.renderer,
      a = e.bounds,
      l = e.filters;
    let c = 1 / 0,
      u = 0,
      f = !0,
      d = !1,
      h = !1,
      p = !0,
      g = -1,
      m = -1;
    for (let y = 0; y < l.length; y++) {
      const _ = l[y];
      if (!_.enabled) continue;
      if (
        (g === -1 && (g = y),
        (m = y),
        (c = Math.min(c, _.resolution === "inherit" ? i : _.resolution)),
        (u += _.padding),
        _.antialias === "off"
          ? (f = !1)
          : _.antialias === "inherit" && f && (f = r),
        _.clipToViewport || (p = !1),
        !!!(_.compatibleRenderers & s.type))
      ) {
        h = !1;
        break;
      }
      if (
        _.blendRequired &&
        !(((v = s.backBuffer) == null ? void 0 : v.useBackBuffer) ?? !0)
      ) {
        Fe(
          "Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."
        ),
          (h = !1);
        break;
      }
      (h = !0), d || (d = _.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),
      (e.firstEnabledIndex = g),
      (e.lastEnabledIndex = m);
  }
  _popFilterData() {
    return this._filterStackIndex--, this._filterStack[this._filterStackIndex];
  }
  _getPreviousFilterData() {
    let e,
      n = this._filterStackIndex - 1;
    for (; n > 0 && (n--, (e = this._filterStack[n]), !!e.skip); );
    return e;
  }
  _pushFilterData() {
    let e = this._filterStack[this._filterStackIndex];
    return (
      e || (e = this._filterStack[this._filterStackIndex] = new Jde()),
      this._filterStackIndex++,
      e
    );
  }
}
uk.extension = { type: [V.WebGLSystem, V.WebGPUSystem], name: "filter" };
var Qde = `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;
}
`,
  ehe = `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);
}
`,
  _3 = `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 the extends dm {
  constructor(e) {
    const { sprite: n, ...r } = e,
      i = new $D(n.texture),
      o = new mr({
        uFilterMatrix: { value: new Re(), type: "mat3x3<f32>" },
        uMaskClamp: { value: i.uClampFrame, type: "vec4<f32>" },
        uAlpha: { value: 1, type: "f32" },
        uInverse: { value: e.inverse ? 1 : 0, type: "f32" },
      }),
      s = ys.from({
        vertex: { source: _3, entryPoint: "mainVertex" },
        fragment: { source: _3, entryPoint: "mainFragment" },
      }),
      a = ya.from({ vertex: ehe, fragment: Qde, 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 $0 extends nh {
  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 $0(this._context.clone())
      : ((this._ownedContext = null), new $0(this._context));
  }
  lineStyle(e, n, r) {
    ke(
      tt,
      "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) {
    ke(
      tt,
      "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() {
    ke(
      tt,
      "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 (
      ke(tt, "Graphics#drawCircle has been renamed to Graphics#circle"),
      this._callContextMethod("circle", e)
    );
  }
  drawEllipse(...e) {
    return (
      ke(tt, "Graphics#drawEllipse has been renamed to Graphics#ellipse"),
      this._callContextMethod("ellipse", e)
    );
  }
  drawPolygon(...e) {
    return (
      ke(tt, "Graphics#drawPolygon has been renamed to Graphics#poly"),
      this._callContextMethod("poly", e)
    );
  }
  drawRect(...e) {
    return (
      ke(tt, "Graphics#drawRect has been renamed to Graphics#rect"),
      this._callContextMethod("rect", e)
    );
  }
  drawRoundedRect(...e) {
    return (
      ke(tt, "Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),
      this._callContextMethod("roundRect", e)
    );
  }
  drawStar(...e) {
    return (
      ke(tt, "Graphics#drawStar has been renamed to Graphics#star"),
      this._callContextMethod("star", e)
    );
  }
}
const fk = class dk extends ih {
  constructor(...e) {
    let n = e[0] ?? {};
    n instanceof Float32Array &&
      (ke(tt, "use new MeshGeometry({ positions, uvs, indices }) instead"),
      (n = { positions: n, uvs: e[1], indices: e[2] })),
      (n = { ...dk.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;
  }
};
fk.defaultOptions = { topology: "triangle-list", shrinkBuffersToFit: !1 };
let E2 = fk;
class nhe {
  constructor({ matrix: e, observer: n } = {}) {
    (this.dirty = !0),
      (this._matrix = e ?? new Re()),
      (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 hk = class Xp extends nh {
  constructor(...e) {
    let n = e[0] || {};
    n instanceof Ae && (n = { texture: n }),
      e.length > 1 &&
        (ke(
          tt,
          "use new TilingSprite({ texture, width:100, height:100 }) instead"
        ),
        (n.width = e[1]),
        (n.height = e[2])),
      (n = { ...Xp.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 nhe({
        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 Xp({ texture: bt.get(e), ...n })
      : new Xp({ texture: e, ...n });
  }
  get uvRespectAnchor() {
    return (
      ke(
        tt,
        "uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"
      ),
      this.applyAnchorToTexture
    );
  }
  set uvRespectAnchor(e) {
    ke(
      tt,
      "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;
  }
};
hk.defaultOptions = {
  texture: Ae.EMPTY,
  anchor: { x: 0, y: 0 },
  tilePosition: { x: 0, y: 0 },
  tileScale: { x: 1, y: 1 },
  tileRotation: 0,
  applyAnchorToTexture: !1,
};
let VPe = hk;
class rhe extends nh {
  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);
  }
  get styleKey() {
    return `${this._text}:${this._style.styleKey}:${this._resolution}`;
  }
}
function ihe(t, e) {
  let n = t[0] ?? {};
  return (
    (typeof n == "string" || t[1]) &&
      (ke(tt, `use new ${e}({ text: "hi!", style }) instead`),
      (n = { text: n, style: t[1] })),
    n
  );
}
let Pa = null,
  Ho = null;
function ohe(t, e) {
  Pa ||
    ((Pa = je.get().createCanvas(256, 128)),
    (Ho = Pa.getContext("2d", { willReadFrequently: !0 })),
    (Ho.globalCompositeOperation = "copy"),
    (Ho.globalAlpha = 1)),
    (Pa.width < t || Pa.height < e) &&
      ((Pa.width = Qc(t)), (Pa.height = Qc(e)));
}
function x3(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 b3(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 she(...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 ((ohe(i, o), !Ho)) throw new TypeError("Failed to get canvas 2D context");
  Ho.drawImage(n, 0, 0, i, o, 0, 0, i * r, o * r);
  const l = Ho.getImageData(0, 0, i, o).data;
  let c = 0,
    u = 0,
    f = i - 1,
    d = o - 1;
  for (; u < o && x3(l, i, u); ) ++u;
  if (u === o) return vt.EMPTY;
  for (; x3(l, i, d); ) --d;
  for (; b3(l, i, c, u, d); ) ++c;
  for (; b3(l, i, f, u, d); ) --f;
  return (
    ++f,
    ++d,
    (Ho.globalCompositeOperation = "source-over"),
    Ho.strokeRect(c, u, f - c, d - u),
    (Ho.globalCompositeOperation = "copy"),
    s ?? (s = new vt()),
    s.set(c / r, u / r, (f - c) / r, (d - u) / r),
    s
  );
}
const w3 = new vt();
class ahe {
  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 = fs.getOptimalCanvasAndContext(a, l);
    this._renderTextToCanvas(n, r, o, i, c);
    const u = r.trim
      ? she({
          canvas: c.canvas,
          width: a,
          height: l,
          resolution: 1,
          output: w3,
        })
      : w3.set(0, 0, a, l);
    return { canvasAndContext: c, frame: u };
  }
  returnCanvasAndContext(e) {
    fs.returnCanvasAndContext(e);
  }
  _renderTextToCanvas(e, n, r, i, o) {
    var _, x, b, w;
    const { canvas: s, context: a } = o,
      l = B0(n),
      c = Ii.measureText(e || " ", n),
      u = c.lines,
      f = c.lineHeight,
      d = c.lineWidths,
      h = c.maxLineWidth,
      p = c.fontProperties,
      g = 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 m, v;
    const y = n.dropShadow ? 2 : 1;
    for (let E = 0; E < y; ++E) {
      const S = n.dropShadow && E === 0,
        P = S ? Math.ceil(Math.max(1, g) + 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 = Ut.shared.setValue(B).setAlpha(G).toRgbaString();
        const D = I.blur * i,
          $ = I.distance * i;
        (a.shadowBlur = D),
          (a.shadowOffsetX = Math.cos(I.angle) * $),
          (a.shadowOffsetY = Math.sin(I.angle) * $ + C);
      } else {
        if (
          ((a.fillStyle = n._fill ? F0(n._fill, a, c, r * 2) : null),
          (x = n._stroke) != null && x.width)
        ) {
          const I = n._stroke.width * 0.5 + r * 2;
          a.strokeStyle = F0(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++)
        (m = T / 2),
          (v = T / 2 + I * f + p.ascent + A),
          n.align === "right"
            ? (m += h - d[I])
            : n.align === "center" && (m += (h - d[I]) / 2),
          (w = n._stroke) != null &&
            w.width &&
            this._drawLetterSpacing(u[I], n, o, m + r, v + r - P, !0),
          n._fill !== void 0 &&
            this._drawLetterSpacing(u[I], n, o, m + r, v + 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 g = f[p];
      s ? a.strokeText(g, u, o) : a.fillText(g, u, o);
      let m = "";
      for (let v = p + 1; v < f.length; ++v) m += f[v];
      (h = a.measureText(m).width), (u += d - h + l), (d = h);
    }
  }
}
const Ff = new ahe();
class zPe extends rhe {
  constructor(...e) {
    const n = ihe(e, "Text");
    super(n, Cl),
      (this.renderPipeId = "text"),
      n.textureStyle &&
        (this.textureStyle =
          n.textureStyle instanceof xo
            ? n.textureStyle
            : new xo(n.textureStyle));
  }
  updateBounds() {
    const e = this._bounds,
      n = this._anchor;
    let r = 0,
      i = 0;
    if (this._style.trim) {
      const { frame: o, canvasAndContext: s } = Ff.getCanvasAndContext({
        text: this.text,
        style: this._style,
        resolution: 1,
      });
      Ff.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 E3 = "http://www.w3.org/2000/svg",
  S3 = "http://www.w3.org/1999/xhtml";
class pk {
  constructor() {
    (this.svgRoot = document.createElementNS(E3, "svg")),
      (this.foreignObject = document.createElementNS(E3, "foreignObject")),
      (this.domElement = document.createElementNS(S3, "div")),
      (this.styleElement = document.createElementNS(S3, "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());
  }
  destroy() {
    this.svgRoot.remove(),
      this.foreignObject.remove(),
      this.styleElement.remove(),
      this.domElement.remove(),
      (this.image.src = ""),
      this.image.remove(),
      (this.svgRoot = null),
      (this.foreignObject = null),
      (this.styleElement = null),
      (this.domElement = null),
      (this.image = null),
      (this.canvasAndContext = null);
  }
}
let C3;
function lhe(t, e, n, r) {
  r || (r = C3 || (C3 = new pk()));
  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 gk {
  constructor() {
    (this._tempState = Gi.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);
  }
}
gk.extension = { type: [V.WebGLPipesAdaptor], name: "batch" };
const mp = Gi.for2d();
class mk {
  start(e, n, r) {
    const i = e.renderer,
      o = i.encoder,
      s = r.gpuProgram;
    (this._shader = r),
      (this._geometry = n),
      o.setGeometry(n, s),
      (mp.blendMode = "normal"),
      i.pipeline.getPipeline(n, s, mp);
    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 = l2(l.textures, l.count, i.limits.maxBatchableTextures);
    }
    mp.blendMode = n.blendMode;
    const s = i.bindGroup.getBindGroup(n.bindGroup, r, 1),
      a = i.pipeline.getPipeline(this._geometry, r, mp, n.topology);
    n.bindGroup._touch(i.textureGC.count),
      o.setPipeline(a),
      o.renderPassEncoder.setBindGroup(1, s),
      o.renderPassEncoder.drawIndexed(n.size, 1, n.start);
  }
}
mk.extension = { type: [V.WebGPUPipesAdaptor], name: "batch" };
const S2 = class vk {
  constructor(e, n) {
    var r, i;
    (this.state = Gi.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 p2({
          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] =
          vk.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;
  }
};
S2.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "batch",
};
S2._availableBatchers = Object.create(null);
let yk = S2;
$e.handleByMap(V.Batcher, yk._availableBatchers);
$e.add(p2);
const Lf = {
    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);
            }
        `,
    },
  },
  che = {
    ...Lf,
    vertex: {
      ...Lf.vertex,
      header: Lf.vertex.header.replace("group(1)", "group(2)"),
    },
  },
  C2 = {
    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);
            }
        `,
    },
  },
  uhe = {
    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);
        `,
    },
  },
  fhe = {
    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);
        `,
    },
  },
  dhe = new jn();
class hhe extends I0 {
  constructor() {
    super(),
      (this.filters = [
        new the({
          sprite: new bl(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 _k {
  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 = gn.get(hhe);
      if (((i.inverse = e.inverse), r)) {
        e.mask.mask.measurable = !0;
        const o = Qw(e.mask.mask, !0, dhe);
        (e.mask.mask.measurable = !1), o.ceil();
        const s = n.renderTarget.renderTarget.colorTexture.source,
          a = sn.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 && sn.returnTexture(i.filterTexture), gn.return(i.filterEffect);
    }
  }
  destroy() {
    (this._renderer = null), (this._activeMaskStage = null);
  }
}
_k.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "alphaMask",
};
class xk {
  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._renderer = null), (this._colorStack = null);
  }
}
xk.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "colorMask",
};
class bk {
  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(an.RENDERING_MASK_ADD, o),
        o++,
        r.colorMask.setMask(0))
      : e.action === "pushMaskEnd"
      ? (e.inverse
          ? r.stencil.setStencilMode(an.INVERSE_MASK_ACTIVE, o)
          : r.stencil.setStencilMode(an.MASK_ACTIVE, o),
        r.colorMask.setMask(15))
      : e.action === "popMaskBegin"
      ? (r.colorMask.setMask(0),
        o !== 0
          ? r.stencil.setStencilMode(an.RENDERING_MASK_REMOVE, o)
          : (r.renderTarget.clear(null, Gr.STENCIL),
            r.stencil.setStencilMode(an.DISABLED, o)),
        o--)
      : e.action === "popMaskEnd" &&
        (e.inverse
          ? r.stencil.setStencilMode(an.INVERSE_MASK_ACTIVE, o)
          : r.stencil.setStencilMode(an.MASK_ACTIVE, o),
        r.colorMask.setMask(15)),
      (this._maskStackHash[i] = o);
  }
  destroy() {
    (this._renderer = null),
      (this._maskStackHash = null),
      (this._maskHash = null);
  }
}
bk.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "stencilMask",
};
var Kp = ((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
))(Kp || {});
class phe {
  constructor(e, n) {
    (this._lastBindBaseLocation = -1),
      (this._lastBindCallId = -1),
      (this.buffer = e || null),
      (this.updateID = -1),
      (this.byteLength = -1),
      (this.type = n);
  }
}
class wk {
  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 = Kp.ARRAY_BUFFER;
    e.descriptor.usage & it.INDEX
      ? (r = Kp.ELEMENT_ARRAY_BUFFER)
      : e.descriptor.usage & it.UNIFORM && (r = Kp.UNIFORM_BUFFER);
    const i = new phe(n.createBuffer(), r);
    return (
      (this._gpuBuffers[e.uid] = i),
      e.on("destroy", this.onBufferDestroy, this),
      i
    );
  }
  resetState() {
    this._boundBufferBases = Object.create(null);
  }
}
wk.extension = { type: [V.WebGLSystem], name: "buffer" };
const A2 = class Ek {
  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 = { ...Ek.defaultOptions, ...e };
    let n = (this.multiView = e.multiView);
    if (
      (e.context &&
        n &&
        (Fe(
          "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 &&
        Fe("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 &&
      Fe(
        "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 ||
        Fe(
          "Provided WebGL context does not support 32 index buffer, large scenes may not render correctly"
        );
  }
};
A2.extension = { type: [V.WebGLSystem], name: "context" };
A2.defaultOptions = {
  context: null,
  premultipliedAlpha: !0,
  preserveDrawingBuffer: !1,
  powerPreference: void 0,
  preferWebGLVersion: 2,
  multiView: !1,
};
let ghe = A2;
function Sk(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))
      : Fe(
          `Attribute ${n} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`
        );
  }
  mhe(t);
}
function mhe(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] += ca(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] += ca(s.format).stride);
  }
}
var sx = ((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
  ))(sx || {}),
  Ck = ((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
  ))(Ck || {}),
  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 A3 = {
  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 vhe(t) {
  return A3[t] ?? A3.float32;
}
const yhe = {
  "point-list": 0,
  "line-list": 1,
  "line-strip": 3,
  "triangle-list": 4,
  "triangle-strip": 5,
};
class Ak {
  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;
    Sk(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 = ca(c.format),
          g = vhe(c.format);
        if (
          (((a = d.format) == null ? void 0 : a.substring(1, 4)) === "int"
            ? r.vertexAttribIPointer(h, p.size, g, c.stride, c.offset)
            : r.vertexAttribPointer(
                h,
                p.size,
                g,
                p.normalised,
                c.stride,
                c.offset
              ),
          c.instance)
        )
          if (this.hasInstance) {
            const m = c.divisor ?? 1;
            r.vertexAttribDivisor(h, m);
          } 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 = yhe[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),
      (this._geometryVaoHash = null);
  }
}
Ak.extension = { type: [V.WebGLSystem], name: "geometry" };
const _he = new ih({ attributes: { aPosition: [-1, -1, 3, -1, -1, 3] } }),
  T2 = class Tk {
    constructor(e) {
      (this.useBackBuffer = !1),
        (this._useBackBufferThisRender = !1),
        (this._renderer = e);
    }
    init(e = {}) {
      const { useBackBuffer: n, antialias: r } = { ...Tk.defaultOptions, ...e };
      (this.useBackBuffer = n),
        (this._antialias = r),
        this._renderer.context.supports.msaa ||
          (Fe("antialiasing, is not supported on when using the back buffer"),
          (this._antialias = !1)),
        (this._state = Gi.for2d());
      const i = new ya({
        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: _he,
            shader: this._bigTriangleShader,
            state: this._state,
          }));
    }
    _getBackBufferTexture(e) {
      return (
        (this._backBufferTexture =
          this._backBufferTexture ||
          new Ae({
            source: new Tn({
              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));
    }
  };
T2.extension = { type: [V.WebGLSystem], name: "backBuffer", priority: 1 };
T2.defaultOptions = { useBackBuffer: !1 };
let xhe = T2;
class Pk {
  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)));
  }
}
Pk.extension = { type: [V.WebGLSystem], name: "colorMask" };
class Ik {
  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;
  }
}
Ik.extension = { type: [V.WebGLSystem], name: "encoder" };
class Ok {
  constructor(e) {
    this._renderer = e;
  }
  contextChange() {
    const e = this._renderer.gl;
    (this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),
      (this.maxBatchableTextures = BB(this.maxTextures, e));
    const n = this._renderer.context.webGLVersion === 2;
    this.maxUniformBindings = n
      ? e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS)
      : 0;
  }
  destroy() {}
}
Ok.extension = { type: [V.WebGLSystem], name: "limits" };
class bhe {
  constructor() {
    (this.width = -1),
      (this.height = -1),
      (this.msaa = !1),
      (this.msaaRenderBuffer = []);
  }
}
const _a = [];
_a[an.NONE] = void 0;
_a[an.DISABLED] = { stencilWriteMask: 0, stencilReadMask: 0 };
_a[an.RENDERING_MASK_ADD] = {
  stencilFront: { compare: "equal", passOp: "increment-clamp" },
  stencilBack: { compare: "equal", passOp: "increment-clamp" },
};
_a[an.RENDERING_MASK_REMOVE] = {
  stencilFront: { compare: "equal", passOp: "decrement-clamp" },
  stencilBack: { compare: "equal", passOp: "decrement-clamp" },
};
_a[an.MASK_ACTIVE] = {
  stencilWriteMask: 0,
  stencilFront: { compare: "equal", passOp: "keep" },
  stencilBack: { compare: "equal", passOp: "keep" },
};
_a[an.INVERSE_MASK_ACTIVE] = {
  stencilWriteMask: 0,
  stencilFront: { compare: "not-equal", passOp: "keep" },
  stencilBack: { compare: "not-equal", passOp: "keep" },
};
class Rk {
  constructor(e) {
    (this._stencilCache = {
      enabled: !1,
      stencilReference: 0,
      stencilMode: an.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: an.DISABLED, stencilReference: 0 }),
      this.setStencilMode(n.stencilMode, n.stencilReference);
  }
  resetState() {
    (this._stencilCache.enabled = !1),
      (this._stencilCache.stencilMode = an.NONE),
      (this._stencilCache.stencilReference = 0);
  }
  setStencilMode(e, n) {
    const r = this._renderTargetStencilState[this._activeRenderTarget.uid],
      i = this._gl,
      o = _a[e],
      s = this._stencilCache;
    if (((r.stencilMode = e), (r.stencilReference = n), e === an.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]
        ));
  }
}
Rk.extension = { type: [V.WebGLSystem], name: "stencil" };
class Mk {
  constructor(e) {
    (this._syncFunctionHash = Object.create(null)),
      (this._adaptor = e),
      this._systemCheck();
  }
  _systemCheck() {
    if (!yB())
      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 Dk = {
  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 whe(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 = Dk[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 Ka = [
  {
    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 Bk(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 < Ka.length; d++)
      if (Ka[d].test(l.data)) {
        (f = l.offset / 4),
          i.push(
            `name = "${c}";`,
            `offset += ${f - o};`,
            Ka[d][e] || Ka[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 sc(t, e) {
  return `
        for (let i = 0; i < ${t * e}; i++) {
            data[offset + (((i / ${t})|0) * 4) + (i % ${t})] = v[i];
        }
    `;
}
const kk = {
    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>": sc(3, 2),
    "mat4x2<f32>": sc(4, 2),
    "mat2x3<f32>": sc(2, 3),
    "mat4x3<f32>": sc(4, 3),
    "mat2x4<f32>": sc(2, 4),
    "mat3x4<f32>": sc(3, 4),
  },
  Ehe = {
    ...kk,
    "mat2x2<f32>": `
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 2] = v[2];
        data[offset + 3] = v[3];
    `,
  };
function She(t, e) {
  const n = Math.max(Dk[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 Che(t) {
  return Bk(t, "uboStd40", She, kk);
}
class Nk extends Mk {
  constructor() {
    super({ createUboElements: whe, generateUboSync: Che });
  }
}
Nk.extension = { type: [V.WebGLSystem], name: "ubo" };
class Ahe {
  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 bhe();
    return e.colorTexture instanceof fo
      ? (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 ? Gr.ALL : Gr.NONE);
    const o = this._renderer.gl;
    if (n & Gr.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)
            : Fe(
                "[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 &&
      fo.test(n) &&
      this._renderer.context.ensureCanvasSize(n);
  }
  postrender(e) {
    if (this._renderer.context.multiView && fo.test(e.colorTexture.resource)) {
      const n = this._renderer.context.canvas,
        r = e.colorTexture;
      r.context2D.drawImage(n, 0, r.pixelHeight - n.height);
    }
  }
}
function The(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 mc = new Map();
Eu.register(mc);
function Fk(t, e) {
  if (!mc.has(t)) {
    const n = new Ae({ source: new fo({ resource: t, ...e }) }),
      r = () => {
        mc.get(t) === n && mc.delete(t);
      };
    n.once("destroy", r), n.source.once("destroy", r), mc.set(t, n);
  }
  return mc.get(t);
}
function Phe(t) {
  const e = t.colorTexture.source.resource;
  return (
    globalThis.HTMLCanvasElement &&
    e instanceof HTMLCanvasElement &&
    document.body.contains(e)
  );
}
const Lk = class $k {
  constructor(e = {}) {
    if (
      ((this.uid = Ot("renderTarget")),
      (this.colorTextures = []),
      (this.dirtyId = 0),
      (this.isRoot = !1),
      (this._size = new Float32Array(2)),
      (this._managedColorTextures = !1),
      (e = { ...$k.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 Tn({
            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 Tn
          ? (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 Tn({
        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);
  }
};
Lk.defaultOptions = {
  width: 0,
  height: 0,
  resolution: 1,
  colorTextures: 1,
  stencil: !1,
  depth: !1,
  antialias: !1,
  isRoot: !1,
};
let ax = Lk;
class Uk {
  constructor(e) {
    (this.rootViewPort = new vt()),
      (this.viewport = new vt()),
      (this.onRenderTargetChange = new EB("onRenderTargetChange")),
      (this.projectionMatrix = new Re()),
      (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 = Phe(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 + 0.5) | 0),
        (c.y = (i.y * d + 0.5) | 0),
        (c.width = (i.width * d + 0.5) | 0),
        (c.height = (i.height * d + 0.5) | 0);
    } else (c.x = 0), (c.y = 0), (c.width = u), (c.height = f);
    return (
      The(
        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 = Gr.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 = Gr.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 (
      fo.test(e) && (e = Fk(e).source),
      e instanceof ax
        ? (n = e)
        : e instanceof Tn &&
          ((n = new ax({ colorTextures: [e] })),
          e.source instanceof fo && (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 Gk extends Uk {
  constructor(e) {
    super(e), (this.adaptor = new Ahe()), this.adaptor.init(e, this);
  }
}
Gk.extension = { type: [V.WebGLSystem], name: "renderTarget" };
class P2 extends Jr {
  constructor({ buffer: e, offset: n, size: r }) {
    super(),
      (this.uid = Ot("buffer")),
      (this._resourceType = "bufferResource"),
      (this._touched = 0),
      (this._resourceId = Ot("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 = Ot("resource")), this.emit("change", this);
  }
  destroy(e = !1) {
    (this.destroyed = !0),
      e && this.buffer.destroy(),
      this.emit("change", this),
      (this.buffer = null);
  }
}
function Ihe(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 mr)
        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 P2) {
        const d = t._uniformBindMap[l][Number(u)];
        n.push(`
                    sS.bindUniformBlock(
                        resources[${u}],
                        '${d}',
                        ${t.glProgram._uniformBlockData[d].index}
                    );
                `);
      } else if (f instanceof Tn) {
        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 Ohe {
  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 T3(t, e, n) {
  const r = t.createShader(e);
  return t.shaderSource(r, n), t.compileShader(r), r;
}
function rv(t) {
  const e = new Array(t);
  for (let n = 0; n < e.length; n++) e[n] = !1;
  return e;
}
function Hk(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 rv(2 * e);
    case "bvec3":
      return rv(3 * e);
    case "bvec4":
      return rv(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 vp = null;
const P3 = {
    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",
  },
  Rhe = {
    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 Vk(t, e) {
  if (!vp) {
    const n = Object.keys(P3);
    vp = {};
    for (let r = 0; r < n.length; ++r) {
      const i = n[r];
      vp[t[i]] = P3[i];
    }
  }
  return vp[e];
}
function Mhe(t, e) {
  const n = Vk(t, e);
  return Rhe[n] || "float32";
}
function Dhe(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 = Mhe(e, a.type);
    r[a.name] = {
      location: 0,
      format: l,
      stride: ca(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 Bhe(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 khe(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 = Vk(e, o.type);
    n[s] = {
      name: s,
      index: i,
      type: l,
      size: o.size,
      isArray: a,
      value: Hk(l, o.size),
    };
  }
  return n;
}
function I3(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 Nhe(t, e, n, r) {
  t.getProgramParameter(e, t.LINK_STATUS) ||
    (t.getShaderParameter(n, t.COMPILE_STATUS) || I3(t, n),
    t.getShaderParameter(r, t.COMPILE_STATUS) || I3(t, r),
    console.error("PixiJS Error: Could not initialize shader."),
    t.getProgramInfoLog(e) !== "" &&
      console.warn(
        "PixiJS Warning: gl.getProgramInfoLog()",
        t.getProgramInfoLog(e)
      ));
}
function Fhe(t, e) {
  const n = T3(t, t.VERTEX_SHADER, e.vertex),
    r = T3(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"
      ? Fe(
          "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) || Nhe(t, i, n, r),
    (e._attributeData = Dhe(
      i,
      t,
      !/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)
    )),
    (e._uniformData = khe(i, t)),
    (e._uniformBlockData = Bhe(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: Hk(c.type, c.size) };
  }
  return new Ohe(i, s);
}
const yp = { textureCount: 0, blockIndex: 0 };
class zk {
  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;
    (yp.textureCount = 0), (yp.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, yp);
  }
  updateUniformGroup(e) {
    this._renderer.uniformGroup.updateUniformGroup(e, this._activeProgram, yp);
  }
  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] = Fhe(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),
      (this._shaderSyncFunctions = null),
      (this._activeProgram = null),
      (this._renderer = null),
      (this._gl = null);
  }
  _generateShaderSync(e, n) {
    return Ihe(e, n);
  }
  resetState() {
    this._activeProgram = null;
  }
}
zk.extension = { type: [V.WebGLSystem], name: "shader" };
const Lhe = {
    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);",
  },
  $he = {
    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 Uhe(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 mr
        ? t.uniforms[r].ubo
          ? n.push(`
                        renderer.shader.bindUniformBlock(uv.${r}, "${r}");
                    `)
          : n.push(`
                        renderer.shader.updateUniformGroup(uv.${r});
                    `)
        : t.uniforms[r] instanceof P2 &&
          n.push(`
                        renderer.shader.bindBufferResource(uv.${r}, "${r}");
                    `);
      continue;
    }
    const i = t.uniformStructures[r];
    let o = !1;
    for (let s = 0; s < Ka.length; s++) {
      const a = Ka[s];
      if (i.type === a.type && a.test(i)) {
        n.push(`name = "${r}";`, Ka[s].uniform), (o = !0);
        break;
      }
    }
    if (!o) {
      const a = (i.size === 1 ? Lhe : $he)[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 jk {
  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 Uhe(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);
  }
}
jk.extension = { type: [V.WebGLSystem], name: "uniformGroup" };
function Ghe(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 Hhe = 0,
  Vhe = 1,
  zhe = 2,
  jhe = 3,
  Whe = 4,
  Yhe = 5,
  Wk = class lx {
    constructor(e) {
      (this._invertFrontFace = !1),
        (this.gl = null),
        (this.stateId = 0),
        (this.polygonOffset = 0),
        (this.blendMode = "none"),
        (this._blendEq = !1),
        (this.map = []),
        (this.map[Hhe] = this.setBlend),
        (this.map[Vhe] = this.setOffset),
        (this.map[zhe] = this.setCullFace),
        (this.map[jhe] = this.setDepthTest),
        (this.map[Whe] = this.setFrontFace),
        (this.map[Yhe] = this.setDepthMask),
        (this.checks = []),
        (this.defaultState = Gi.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 = Ghe(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(lx._checkBlendMode, e),
        this.gl[e ? "enable" : "disable"](this.gl.BLEND);
    }
    setOffset(e) {
      this._updateCheck(lx._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);
    }
  };
Wk.extension = { type: [V.WebGLSystem], name: "state" };
let Xhe = Wk;
class Khe {
  constructor(e) {
    (this.target = Ck.TEXTURE_2D),
      (this.texture = e),
      (this.width = -1),
      (this.height = -1),
      (this.type = ut.UNSIGNED_BYTE),
      (this.internalFormat = sx.RGBA),
      (this.format = sx.RGBA),
      (this.samplerType = 0);
  }
}
const qhe = {
    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);
    },
  },
  Zhe = {
    "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,
  },
  Jhe = {
    id: "compressed",
    upload(t, e, n) {
      n.pixelStorei(n.UNPACK_ALIGNMENT, 4);
      let r = t.pixelWidth,
        i = t.pixelHeight;
      const o = !!Zhe[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));
      }
    },
  },
  Yk = {
    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);
    },
  },
  Qhe = {
    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;
      }
      Yk.upload(t, e, n, r);
    },
  },
  O3 = { linear: 9729, nearest: 9728 },
  epe = {
    linear: { linear: 9987, nearest: 9985 },
    nearest: { linear: 9986, nearest: 9984 },
  },
  iv = { "clamp-to-edge": 33071, repeat: 10497, "mirror-repeat": 33648 },
  tpe = {
    never: 512,
    less: 513,
    equal: 514,
    "less-equal": 515,
    greater: 516,
    "not-equal": 517,
    "greater-equal": 518,
    always: 519,
  };
function R3(t, e, n, r, i, o, s, a) {
  const l = o;
  if (
    !a ||
    t.addressModeU !== "repeat" ||
    t.addressModeV !== "repeat" ||
    t.addressModeW !== "repeat"
  ) {
    const c = iv[s ? "clamp-to-edge" : t.addressModeU],
      u = iv[s ? "clamp-to-edge" : t.addressModeV],
      f = iv[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, O3[t.magFilter]),
    n)
  ) {
    if (!a || t.mipmapFilter !== "linear") {
      const c = epe[t.minFilter][t.mipmapFilter];
      e[i](l, e.TEXTURE_MIN_FILTER, c);
    }
  } else e[i](l, e.TEXTURE_MIN_FILTER, O3[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, tpe[t.compare]);
}
function npe(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 rpe(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 ipe(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 ope = 4;
class Xk {
  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: Yk, buffer: qhe, video: Qhe, compressed: Jhe }),
      (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 = rpe(
          e,
          this._renderer.context.extensions
        )),
        (this._mapFormatToType = ipe(e)),
        (this._mapFormatToFormat = npe(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 Khe(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),
      R3(
        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),
      R3(
        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(ope * 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._glTextures = null),
      (this._glSamplers = null),
      (this._boundTextures = null),
      (this._boundSamplers = null),
      (this._mapFormatToInternalFormat = null),
      (this._mapFormatToType = null),
      (this._mapFormatToFormat = null),
      (this._uploads = 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);
  }
}
Xk.extension = { type: [V.WebGLSystem], name: "texture" };
class Kk {
  contextChange(e) {
    const n = new mr({
        uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" },
        uTransformMatrix: { value: new Re(), type: "mat3x3<f32>" },
        uRound: { value: 0, type: "f32" },
      }),
      r = e.limits.maxBatchableTextures,
      i = sh({ name: "graphics", bits: [u2, d2(r), C2, lh] });
    this.shader = new yi({
      glProgram: i,
      resources: { localUniforms: n, batchSamplers: h2(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);
  }
}
Kk.extension = { type: [V.WebGLPipesAdaptor], name: "graphics" };
class qk {
  init() {
    const e = sh({ name: "mesh", bits: [C2, fhe, lh] });
    this._shader = new yi({
      glProgram: e,
      resources: {
        uTexture: Ae.EMPTY.source,
        textureUniforms: {
          uTextureMatrix: { type: "mat3x3<f32>", value: new Re() },
        },
      },
    });
  }
  execute(e, n) {
    const r = e.renderer;
    let i = n._shader;
    if (i) {
      if (!i.glProgram) {
        Fe("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);
  }
}
qk.extension = { type: [V.WebGLPipesAdaptor], name: "mesh" };
class Zk {
  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;
  }
}
Zk.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "customRender",
};
class vm {
  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 cx(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 spe = new Re();
class Jk {
  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 &&
        (gn.return(e._batchableRenderGroup), (e._batchableRenderGroup = null)),
      n.add(e);
  }
  _addRenderableCacheAsTexture(e, n) {
    const r = e._batchableRenderGroup ?? (e._batchableRenderGroup = gn.get(vm));
    (r.renderable = e.root),
      (r.transform = e.root.relativeGroupTransform),
      (r.texture = e.texture),
      (r.bounds = e._textureBounds),
      n.add(e),
      this._renderer.renderPipes.blendMode.pushBlendMode(
        e,
        e.root.groupBlendMode,
        n
      ),
      this._renderer.renderPipes.batch.addToBatch(r, n),
      this._renderer.renderPipes.blendMode.popBlendMode(n);
  }
  _executeCacheAsTexture(e) {
    if (e.textureNeedsUpdate) {
      e.textureNeedsUpdate = !1;
      const n = spe
        .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,
          offset: { x: 0, y: 0 },
        }),
        cx(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,
    }),
      cx(e, this._renderer.renderPipes),
      this._renderer.globalUniforms.pop();
  }
}
Jk.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "renderGroup",
};
function ux(t, e) {
  e || (e = 0);
  for (let n = e; n < t.length && t[n]; n++) t[n] = null;
}
const ape = new Xr(),
  M3 = Mf | R0 | n2;
function Qk(t, e = !1) {
  lpe(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 &&
        eN(u, r, 0);
    }
    ux(a, l), (s.index = 0);
  }
  if (e)
    for (let i = 0; i < t.renderGroupChildren.length; i++)
      Qk(t.renderGroupChildren[i], e);
}
function lpe(t) {
  const e = t.root;
  let n;
  if (t.renderGroupParent) {
    const r = t.renderGroupParent;
    t.worldTransform.appendFrom(e.relativeGroupTransform, r.worldTransform),
      (t.worldColor = O0(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 eN(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 & M3 && D3(t, i, n))
      : ((n = t._updateFlags),
        t.relativeGroupTransform.copyFrom(r),
        n & M3 && D3(t, ape, n)),
    !t.renderGroup)
  ) {
    const o = t.children,
      s = o.length;
    for (let c = 0; c < s; c++) eN(o[c], e, n);
    const a = t.parentRenderGroup,
      l = t;
    l.renderPipeId && !a.structureDidChange && a.updateRenderable(l);
  }
}
function D3(t, e, n) {
  if (n & R0) {
    t.groupColor = O0(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 & n2 &&
    (t.groupBlendMode =
      t.localBlendMode === "inherit" ? e.groupBlendMode : t.localBlendMode),
    n & Mf &&
      (t.globalDisplayStatus = t.localDisplayStatus & e.globalDisplayStatus),
    (t._updateFlags = 0);
}
function cpe(t, e) {
  const { list: n } = t.childrenRenderablesToUpdate;
  let r = !1;
  for (let i = 0; i < t.childrenRenderablesToUpdate.index; i++) {
    const o = n[i];
    if (((r = e[o.renderPipeId].validateRenderable(o)), r)) break;
  }
  return (t.structureDidChange = r), r;
}
const upe = new Re();
class tN {
  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,
      s = upe;
    n &&
      (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,
      }),
      cx(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._parentCacheAsTextureRenderGroup = n), e.isCachedAsTexture)) {
      if (!e.textureNeedsUpdate) return;
      n = e;
    }
    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 && sn.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 = sn.getOptimalTexture(r.width, r.height, s, a);
        (c._source.style = new xo({ scaleMode: l })),
          (e.texture = c),
          e._textureBounds || (e._textureBounds = new jn()),
          e._textureBounds.copyFrom(r),
          i !== e.texture &&
            e.renderGroupParent &&
            (e.renderGroupParent.structureDidChange = !0);
      }
    } else e.texture && (sn.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
        ? ux(e.childrenRenderablesToUpdate.list, 0)
        : cpe(e, r),
      Qk(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);
    }
    ux(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);
  }
}
tN.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
  name: "renderGroup",
};
class nN {
  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 vm();
    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;
  }
}
nN.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "sprite",
};
const I2 = class rN {
  constructor() {
    (this.clearBeforeRender = !0),
      (this._backgroundColor = new Ut(0)),
      (this.color = this._backgroundColor),
      (this.alpha = 1);
  }
  init(e) {
    (e = { ...rN.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) {
    Ut.shared.setValue(e).alpha < 1 &&
      this._backgroundColor.alpha === 1 &&
      Fe(
        "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() {}
};
I2.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
  name: "background",
  priority: 0,
};
I2.defaultOptions = {
  backgroundAlpha: 1,
  backgroundColor: 0,
  clearBeforeRender: !0,
};
let fpe = I2;
const $f = {};
$e.handle(
  V.BlendMode,
  (t) => {
    if (!t.name)
      throw new Error("BlendMode extension must have a name property");
    $f[t.name] = t.ref;
  },
  (t) => {
    delete $f[t.name];
  }
);
class iN {
  constructor(e) {
    (this._blendModeStack = []),
      (this._isAdvanced = !1),
      (this._filterHash = Object.create(null)),
      (this._renderer = e),
      this._renderer.runners.prerender.add(this);
  }
  prerender() {
    (this._activeBlendMode = "normal"), (this._isAdvanced = !1);
  }
  pushBlendMode(e, n, r) {
    this._blendModeStack.push(n), this.setBlendMode(e, n, r);
  }
  popBlendMode(e) {
    this._blendModeStack.pop();
    const n =
      this._blendModeStack[this._activeBlendMode.length - 1] ?? "normal";
    this.setBlendMode(null, n, e);
  }
  setBlendMode(e, n, r) {
    var o;
    const i = e instanceof G_;
    if (this._activeBlendMode === n) {
      this._isAdvanced &&
        e &&
        !i &&
        ((o = this._renderableList) == null || o.push(e));
      return;
    }
    this._isAdvanced && this._endAdvancedBlendMode(r),
      (this._activeBlendMode = n),
      e &&
        ((this._isAdvanced = !!$f[n]),
        this._isAdvanced && this._beginAdvancedBlendMode(e, r));
  }
  _beginAdvancedBlendMode(e, n) {
    this._renderer.renderPipes.batch.break(n);
    const r = this._activeBlendMode;
    if (!$f[r]) {
      Fe(
        `Unable to assign BlendMode: '${r}'. You may want to include: import 'pixi.js/advanced-blend-modes'`
      );
      return;
    }
    const i = this._ensureFilterEffect(r),
      o = e instanceof G_,
      s = {
        renderPipeId: "filter",
        action: "pushFilter",
        filterEffect: i,
        renderables: o ? null : [e],
        container: o ? e.root : null,
        canBundle: !1,
      };
    (this._renderableList = s.renderables), n.add(s);
  }
  _ensureFilterEffect(e) {
    let n = this._filterHash[e];
    return (
      n || ((n = this._filterHash[e] = new I0()), (n.filters = [new $f[e]()])),
      n
    );
  }
  _endAdvancedBlendMode(e) {
    (this._isAdvanced = !1),
      (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;
  }
}
iN.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "blendMode",
};
const ov = { png: "image/png", jpg: "image/jpeg", webp: "image/webp" },
  O2 = class oN {
    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, oN.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);
            },
            ov[n],
            r
          );
        });
      if (i.toDataURL !== void 0) return i.toDataURL(ov[n], r);
      if (i.convertToBlob !== void 0) {
        const o = await i.convertToBlob({ type: ov[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;
    }
  };
O2.extension = { type: [V.WebGLSystem, V.WebGPUSystem], name: "extract" };
O2.defaultImageOptions = { format: "png", quality: 1 };
let dpe = O2;
class R2 extends Ae {
  static create(e) {
    return new R2({ source: new Tn(e) });
  }
  resize(e, n, r) {
    return this.source.resize(e, n, r), this;
  }
}
const hpe = new vt(),
  ppe = new jn(),
  gpe = [0, 0, 0, 0];
class sN {
  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
            : Ut.shared.setValue(o).toArray())
      : (o = gpe);
    const s =
      ((c = e.frame) == null ? void 0 : c.copyTo(hpe)) || t2(i, ppe).rectangle;
    (s.width = Math.max(s.width, 1 / n) | 0),
      (s.height = Math.max(s.height, 1 / n) | 0);
    const a = R2.create({
        ...e.textureSourceOptions,
        width: s.width,
        height: s.height,
        resolution: n,
        antialias: r,
      }),
      l = Re.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;
  }
}
sN.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem],
  name: "textureGenerator",
};
function ch(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 aN {
  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 Re(),
            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),
      ch(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 Zo()),
        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 mr(
      {
        uProjectionMatrix: { value: new Re(), type: "mat3x3<f32>" },
        uWorldTransformMatrix: { value: new Re(), type: "mat3x3<f32>" },
        uWorldColorAlpha: { value: new Float32Array(4), type: "vec4<f32>" },
        uResolution: { value: [0, 0], type: "vec2<f32>" },
      },
      { isStatic: !0 }
    );
  }
  destroy() {
    (this._renderer = null),
      (this._globalUniformDataStack.length = 0),
      (this._uniformsPool.length = 0),
      (this._activeUniforms.length = 0),
      (this._bindGroupPool.length = 0),
      (this._activeBindGroups.length = 0),
      (this._currentGlobalUniformData = null);
  }
}
aN.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
  name: "globalUniforms",
};
let mpe = 1;
class lN {
  constructor() {
    (this._tasks = []), (this._offset = 0);
  }
  init() {
    Vn.system.add(this._update, this);
  }
  repeat(e, n, r = !0) {
    const i = mpe++;
    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() {
    Vn.system.remove(this._update, this), (this._tasks.length = 0);
  }
}
lN.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
  name: "scheduler",
  priority: 0,
};
let B3 = !1;
function vpe(t) {
  if (!B3) {
    if (
      je.get().getNavigator().userAgent.toLowerCase().indexOf("chrome") > -1
    ) {
      const e = [
        `%c  %c  %c  %c  %c PixiJS %c v${D0} (${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 ${D0} - ${t} - http://www.pixijs.com/`);
    B3 = !0;
  }
}
class M2 {
  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}`),
        vpe(n);
    }
  }
}
M2.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
  name: "hello",
  priority: -2,
};
M2.defaultOptions = { hello: !1 };
function ype(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 _pe(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 xpe = 0;
const D2 = class cN {
  constructor(e) {
    (this._managedRenderables = []),
      (this._managedHashes = []),
      (this._managedArrays = []),
      (this._renderer = e);
  }
  init(e) {
    (e = { ...cN.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] = ype(n.context[n.hash]);
          }, this._frequency)),
          (this._arrayHandler = this._renderer.scheduler.repeat(() => {
            for (const n of this._managedArrays) _pe(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 = xpe++),
      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);
  }
};
D2.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem],
  name: "renderableGC",
  priority: 0,
};
D2.defaultOptions = {
  renderableGCActive: !0,
  renderableGCMaxUnusedTime: 6e4,
  renderableGCFrequency: 3e4,
};
let bpe = D2;
const B2 = class uN {
  constructor(e) {
    (this._renderer = e), (this.count = 0), (this.checkCount = 0);
  }
  init(e) {
    (e = { ...uN.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;
  }
};
B2.extension = { type: [V.WebGLSystem, V.WebGPUSystem], name: "textureGC" };
B2.defaultOptions = {
  textureGCActive: !0,
  textureGCAMaxIdle: null,
  textureGCMaxIdle: 60 * 60,
  textureGCCheckCountMax: 600,
};
let wpe = B2;
const k2 = class fN {
  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 = { ...fN.defaultOptions, ...e }),
      e.view &&
        (ke(tt, "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 = Fk(this.canvas, e)),
      (this.renderTarget = new ax({
        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),
      this.texture.destroy();
  }
};
k2.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
  name: "view",
  priority: 0,
};
k2.defaultOptions = { width: 800, height: 600, autoDensity: !1, antialias: !1 };
let Epe = k2;
const dN = [fpe, aN, M2, Epe, tN, wpe, sN, dpe, TB, bpe, lN],
  hN = [iN, yk, nN, Jk, _k, bk, xk, Zk],
  Spe = [...dN, Nk, xhe, ghe, Ok, wk, Xk, Gk, Ak, jk, zk, Ik, Xhe, Rk, Pk],
  Cpe = [...hN],
  Ape = [gk, qk, Kk],
  pN = [],
  gN = [],
  mN = [];
$e.handleByNamedList(V.WebGLSystem, pN);
$e.handleByNamedList(V.WebGLPipes, gN);
$e.handleByNamedList(V.WebGLPipesAdaptor, mN);
$e.add(...Spe, ...Cpe, ...Ape);
class Tpe extends hm {
  constructor() {
    const e = {
      name: "webgl",
      type: Kr.WEBGL,
      systems: pN,
      renderPipes: gN,
      renderPipeAdaptors: mN,
    };
    super(e);
  }
}
const Ppe = Object.freeze(
  Object.defineProperty(
    { __proto__: null, WebGLRenderer: Tpe },
    Symbol.toStringTag,
    { value: "Module" }
  )
);
class vN {
  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);
  }
}
vN.extension = { type: [V.WebGPUSystem], name: "bindGroup" };
class yN {
  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 && (Q_(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);
  }
}
yN.extension = { type: [V.WebGPUSystem], name: "buffer" };
class Ipe {
  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 _N {
  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);
  }
}
_N.extension = { type: [V.WebGPUSystem], name: "colorMask" };
class N2 {
  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);
  }
}
N2.extension = { type: [V.WebGPUSystem], name: "device" };
N2.defaultOptions = { powerPreference: void 0, forceFallbackAdapter: !1 };
class xN {
  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(parseInt(i, 10), 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;
  }
}
xN.extension = { type: [V.WebGPUSystem], name: "encoder", priority: 1 };
class bN {
  constructor(e) {
    this._renderer = e;
  }
  contextChange() {
    (this.maxTextures =
      this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage),
      (this.maxBatchableTextures = this.maxTextures);
  }
  destroy() {}
}
bN.extension = { type: [V.WebGPUSystem], name: "limits" };
class wN {
  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: an.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);
  }
}
wN.extension = { type: [V.WebGPUSystem], name: "stencil" };
const qp = {
  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 Ope(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 = qp[i.data.type].size;
    const s = qp[i.data.type].align;
    if (!qp[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 Rpe(t, e) {
  const { size: n, align: r } = qp[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 Mpe(t) {
  return Bk(t, "uboWgsl", Rpe, Ehe);
}
class EN extends Mk {
  constructor() {
    super({ createUboElements: Ope, generateUboSync: Mpe });
  }
}
EN.extension = { type: [V.WebGPUSystem], name: "ubo" };
const As = 128;
class SN {
  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 Ipe({ minUniformOffsetAlignment: As }));
    const n = 256 / As;
    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 / As)),
      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 / As);
  }
  getArrayBindGroup(e) {
    const n = this._batchBuffer.addGroup(e);
    return this._getBindGroup(n / As);
  }
  getArrayBufferResource(e) {
    const r = this._batchBuffer.addGroup(e) / As;
    return this._getBufferResource(r);
  }
  _getBufferResource(e) {
    if (!this._bufferResources[e]) {
      const n = this._buffers[e % 2];
      this._bufferResources[e] = new P2({
        buffer: n,
        offset: ((e / 2) | 0) * 256,
        size: As,
      });
    }
    return this._bufferResources[e];
  }
  _getBindGroup(e) {
    if (!this._bindGroups[e]) {
      const n = new Zo({ 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),
        As,
        e.getGPUBuffer(o),
        0,
        this._batchBuffer.byteIndex
      );
    }
    this._renderer.gpu.device.queue.submit([r.finish()]);
  }
  destroy() {
    var e;
    for (let n = 0; n < this._bindGroups.length; n++)
      (e = this._bindGroups[n]) == null || e.destroy();
    (this._bindGroups = null), (this._bindGroupHash = null);
    for (let n = 0; n < this._buffers.length; n++) this._buffers[n].destroy();
    this._buffers = null;
    for (let n = 0; n < this._bufferResources.length; n++)
      this._bufferResources[n].destroy();
    (this._bufferResources = null),
      this._batchBuffer.destroy(),
      (this._bindGroupHash = null),
      (this._renderer = null);
  }
}
SN.extension = { type: [V.WebGPUPipes], name: "uniformBatch" };
const Dpe = {
  "point-list": 0,
  "line-list": 1,
  "line-strip": 2,
  "triangle-list": 3,
  "triangle-strip": 4,
};
function Bpe(t, e, n, r, i) {
  return (t << 24) | (e << 16) | (n << 10) | (r << 5) | i;
}
function kpe(t, e, n, r) {
  return (n << 6) | (t << 3) | (r << 1) | e;
}
class CN {
  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(an.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 = _a[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 || (Sk(e, n.attributeData), this._generateBufferKey(e)),
      i || (i = e.topology);
    const o = Bpe(e._layoutKey, n._layoutKey, r.data, r._blendModeId, Dpe[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 === an.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 = md(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 = md(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 &&
            Fe(
              `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 = kpe(
      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);
  }
}
CN.extension = { type: [V.WebGPUSystem], name: "pipeline" };
class Npe {
  constructor() {
    (this.contexts = []), (this.msaaTextures = []), (this.msaaSamples = 1);
  }
}
class Fpe {
  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 ? Gr.ALL : Gr.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 & Gr.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 & Gr.STENCIL ? "clear" : "load",
        u = n & Gr.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 Npe();
    return (
      e.colorTextures.forEach((r, i) => {
        if (r instanceof fo) {
          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 Tn({ 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 AN extends Uk {
  constructor(e) {
    super(e), (this.adaptor = new Fpe()), this.adaptor.init(e, this);
  }
}
AN.extension = { type: [V.WebGPUSystem], name: "renderTarget" };
class TN {
  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);
  }
}
TN.extension = { type: [V.WebGPUSystem], name: "shader" };
const Br = {};
Br.normal = {
  alpha: {
    srcFactor: "one",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
  color: {
    srcFactor: "one",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
};
Br.add = {
  alpha: {
    srcFactor: "src-alpha",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
  color: { srcFactor: "one", dstFactor: "one", operation: "add" },
};
Br.multiply = {
  alpha: {
    srcFactor: "one",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
  color: {
    srcFactor: "dst",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
};
Br.screen = {
  alpha: {
    srcFactor: "one",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
  color: { srcFactor: "one", dstFactor: "one-minus-src", operation: "add" },
};
Br.overlay = {
  alpha: {
    srcFactor: "one",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
  color: { srcFactor: "one", dstFactor: "one-minus-src", operation: "add" },
};
Br.none = {
  alpha: {
    srcFactor: "one",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
  color: { srcFactor: "zero", dstFactor: "zero", operation: "add" },
};
Br["normal-npm"] = {
  alpha: {
    srcFactor: "one",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
  color: {
    srcFactor: "src-alpha",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
};
Br["add-npm"] = {
  alpha: { srcFactor: "one", dstFactor: "one", operation: "add" },
  color: { srcFactor: "src-alpha", dstFactor: "one", operation: "add" },
};
Br["screen-npm"] = {
  alpha: {
    srcFactor: "one",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
  color: {
    srcFactor: "src-alpha",
    dstFactor: "one-minus-src",
    operation: "add",
  },
};
Br.erase = {
  alpha: {
    srcFactor: "zero",
    dstFactor: "one-minus-src-alpha",
    operation: "add",
  },
  color: { srcFactor: "zero", dstFactor: "one-minus-src", operation: "add" },
};
Br.min = {
  alpha: { srcFactor: "one", dstFactor: "one", operation: "min" },
  color: { srcFactor: "one", dstFactor: "one", operation: "min" },
};
Br.max = {
  alpha: { srcFactor: "one", dstFactor: "one", operation: "max" },
  color: { srcFactor: "one", dstFactor: "one", operation: "max" },
};
class PN {
  constructor() {
    (this.defaultState = new Gi()), (this.defaultState.blend = !0);
  }
  contextChange(e) {
    this.gpu = e;
  }
  getColorTargets(e) {
    return [
      {
        format: "bgra8unorm",
        writeMask: 0,
        blend: Br[e.blendMode] || Br.normal,
      },
    ];
  }
  destroy() {
    this.gpu = null;
  }
}
PN.extension = { type: [V.WebGPUSystem], name: "state" };
const Lpe = {
    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 }
      );
    },
  },
  IN = {
    "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 },
  },
  $pe = { blockBytes: 4, blockWidth: 1, blockHeight: 1 },
  Upe = {
    type: "compressed",
    upload(t, e, n) {
      let r = t.pixelWidth,
        i = t.pixelHeight;
      const o = IN[t.format] || $pe;
      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));
      }
    },
  },
  ON = {
    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),
          Fe(
            "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 }
      );
    },
  },
  Gpe = {
    type: "video",
    upload(t, e, n) {
      ON.upload(t, e, n);
    },
  };
class Hpe {
  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 RN {
  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: ON, buffer: Lpe, video: Gpe, compressed: Upe }),
      (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 = IN[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 Hpe(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 Zo({
        0: n,
        1: n.style,
        2: new mr({
          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 = fs.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 fs.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);
  }
}
RN.extension = { type: [V.WebGPUSystem], name: "texture" };
class MN {
  constructor() {
    this._maxTextures = 0;
  }
  contextChange(e) {
    const n = new mr({
      uTransformMatrix: { value: new Re(), 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 = oh({
      name: "graphics",
      bits: [c2, f2(this._maxTextures), che, ah],
    });
    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 g = d[p];
      if (
        (g.topology !== h &&
          ((h = g.topology),
          c.setPipelineFromGeometryProgramAndState(
            a.geometry,
            i.gpuProgram,
            e.state,
            g.topology
          )),
        (i.groups[1] = g.bindGroup),
        !g.gpuBindGroup)
      ) {
        const m = g.textures;
        (g.bindGroup = l2(m.textures, m.count, this._maxTextures)),
          (g.gpuBindGroup = o.bindGroup.getBindGroup(
            g.bindGroup,
            i.gpuProgram,
            1
          ));
      }
      c.setBindGroup(1, g.bindGroup, i.gpuProgram),
        c.renderPassEncoder.drawIndexed(g.size, 1, g.start);
    }
  }
  destroy() {
    this.shader.destroy(!0), (this.shader = null);
  }
}
MN.extension = { type: [V.WebGPUPipesAdaptor], name: "graphics" };
class DN {
  init() {
    const e = oh({ name: "mesh", bits: [Lf, uhe, ah] });
    this._shader = new yi({
      gpuProgram: e,
      resources: {
        uTexture: Ae.EMPTY._source,
        uSampler: Ae.EMPTY._source.style,
        textureUniforms: {
          uTextureMatrix: { type: "mat3x3<f32>", value: new Re() },
        },
      },
    });
  }
  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) {
      Fe("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);
  }
}
DN.extension = { type: [V.WebGPUPipesAdaptor], name: "mesh" };
const Vpe = [...dN, EN, xN, N2, bN, yN, RN, AN, TN, PN, CN, _N, wN, vN],
  zpe = [...hN, SN],
  jpe = [mk, DN, MN],
  BN = [],
  kN = [],
  NN = [];
$e.handleByNamedList(V.WebGPUSystem, BN);
$e.handleByNamedList(V.WebGPUPipes, kN);
$e.handleByNamedList(V.WebGPUPipesAdaptor, NN);
$e.add(...Vpe, ...zpe, ...jpe);
class Wpe extends hm {
  constructor() {
    const e = {
      name: "webgpu",
      type: Kr.WEBGPU,
      systems: BN,
      renderPipes: kN,
      renderPipeAdaptors: NN,
    };
    super(e);
  }
}
const Ype = Object.freeze(
  Object.defineProperty(
    { __proto__: null, WebGPURenderer: Wpe },
    Symbol.toStringTag,
    { value: "Module" }
  )
);
class Xpe {
  constructor() {
    (this.batches = []), (this.batched = !1);
  }
  destroy() {
    this.batches.forEach((e) => {
      gn.return(e);
    }),
      (this.batches.length = 0);
  }
}
class FN {
  constructor(e, n) {
    (this.state = Gi.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),
      ch(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 Xpe();
    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 = gn.get(g2);
      return s.copyTo(a), (a.renderable = e), (a.roundPixels = o), a;
    });
  }
  destroy() {
    (this.renderer = null),
      this._adaptor.destroy(),
      (this._adaptor = null),
      (this.state = null);
  }
}
FN.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "graphics",
};
const LN = class $N extends E2 {
  constructor(...e) {
    super({});
    let n = e[0] ?? {};
    typeof n == "number" &&
      (ke(
        tt,
        "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 = { ...$N.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,
        g = h * this.verticesX + d + 1,
        m = (h + 1) * this.verticesX + d,
        v = (h + 1) * this.verticesX + d + 1;
      o.push(p, g, m, g, v, m);
    }
    (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();
  }
};
LN.defaultOptions = { width: 100, height: 100, verticesX: 10, verticesY: 10 };
let Kpe = LN;
class F2 {
  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 k3 {
  destroy() {}
}
class UN {
  constructor(e, n) {
    (this.localUniforms = new mr({
      uTransformMatrix: { value: new Re(), type: "mat3x3<f32>" },
      uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" },
      uRound: { value: 0, type: "f32" },
    })),
      (this.localUniformsBindGroup = new Zo({ 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 = xd(e.groupBlendMode, e.texture._source);
    const n = this.localUniforms;
    (n.uniforms.uTransformMatrix = e.groupTransform),
      (n.uniforms.uRound = this.renderer._roundPixels | e._roundPixels),
      n.update(),
      ch(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 k3()),
      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 k3()),
      e._gpuData[this.renderer.uid].batchableMesh || this._initBatchableMesh(e)
    );
  }
  _initBatchableMesh(e) {
    const n = new F2();
    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);
  }
}
UN.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "mesh",
};
class qpe {
  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 Zpe {
  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 N3(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 Jpe(t) {
  return { dynamicUpdate: F3(t, !0), staticUpdate: F3(t, !1) };
}
function F3(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 = ca(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 Qpe {
  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 = ca(f.format);
      f.dynamic ? (o += d.stride) : (i += d.stride);
    }
    (this._dynamicStride = o / 4),
      (this._staticStride = i / 4),
      (this.staticAttributeBuffer = new wc(n * 4 * i)),
      (this.dynamicAttributeBuffer = new wc(n * 4 * o)),
      (this.indexBuffer = N3(n));
    const s = new ih();
    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 = ca(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 = e0e(e);
    return this._generateParticleUpdateCache[n]
      ? this._generateParticleUpdateCache[n]
      : ((this._generateParticleUpdateCache[n] =
          this.generateParticleUpdate(e)),
        this._generateParticleUpdateCache[n]);
  }
  generateParticleUpdate(e) {
    return Jpe(e);
  }
  update(e, n) {
    e.length > this._size &&
      ((n = !0),
      (this._size = Math.max(e.length, (this._size * 1.5) | 0)),
      (this.staticAttributeBuffer = new wc(
        this._size * this._staticStride * 4 * 4
      )),
      (this.dynamicAttributeBuffer = new wc(
        this._size * this._dynamicStride * 4 * 4
      )),
      (this.indexBuffer = N3(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 e0e(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 t0e = `varying vec2 vUV;
varying vec4 vColor;

uniform sampler2D uTexture;

void main(void){
    vec4 color = texture2D(uTexture, vUV) * vColor;
    gl_FragColor = color;
}`,
  n0e = `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;
}
`,
  L3 = `
struct ParticleUniforms {
  uTranslationMatrix:mat3x3<f32>,
  uColor:vec4<f32>,
  uRound:f32,
  uResolution:vec2<f32>,
};

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;
}

@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;

   var position = vec4((uniforms.uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);

   if(uniforms.uRound == 1.0) {
       position = vec4(roundPixels(position.xy, uniforms.uResolution), position.zw);
   }

    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 r0e extends yi {
  constructor() {
    const e = ya.from({ vertex: n0e, fragment: t0e }),
      n = ys.from({
        fragment: { source: L3, entryPoint: "mainFragment" },
        vertex: { source: L3, entryPoint: "mainVertex" },
      });
    super({
      glProgram: e,
      gpuProgram: n,
      resources: {
        uTexture: Ae.WHITE.source,
        uSampler: new xo({}),
        uniforms: {
          uTranslationMatrix: { value: new Re(), type: "mat3x3<f32>" },
          uColor: { value: new Ut(16777215), type: "vec4<f32>" },
          uRound: { value: 1, type: "f32" },
          uResolution: { value: [0, 0], type: "vec2<f32>" },
        },
      },
    });
  }
}
class GN {
  constructor(e, n) {
    (this.state = Gi.for2d()),
      (this.localUniforms = new mr({
        uTranslationMatrix: { value: new Re(), 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 r0e()),
      (this.state = Gi.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 Qpe({
        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 = xd(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),
      ch(e.groupColorAlpha, s.uColor, 0),
      this.adaptor.execute(this, e);
  }
  destroy() {
    (this.renderer = null),
      this.defaultShader &&
        (this.defaultShader.destroy(), (this.defaultShader = null));
  }
}
class HN extends GN {
  constructor(e) {
    super(e, new qpe());
  }
}
HN.extension = { type: [V.WebGLPipes], name: "particle" };
class VN extends GN {
  constructor(e) {
    super(e, new Zpe());
  }
}
VN.extension = { type: [V.WebGPUPipes], name: "particle" };
const zN = class fx {
  constructor(e) {
    if (e instanceof Ae) (this.texture = e), H_(this, fx.defaultOptions, {});
    else {
      const n = { ...fx.defaultOptions, ...e };
      H_(this, n, {});
    }
  }
  get alpha() {
    return this._alpha;
  }
  set alpha(e) {
    (this._alpha = Math.min(Math.max(e, 0), 1)), this._updateColor();
  }
  get tint() {
    return Rf(this._tint);
  }
  set tint(e) {
    (this._tint = Ut.shared.setValue(e ?? 16777215).toBgrNumber()),
      this._updateColor();
  }
  _updateColor() {
    this.color = this._tint + (((this._alpha * 255) | 0) << 24);
  }
};
zN.defaultOptions = {
  anchorX: 0,
  anchorY: 0,
  x: 0,
  y: 0,
  scaleX: 1,
  scaleY: 1,
  rotation: 0,
  tint: 16777215,
  alpha: 1,
};
let jPe = zN;
const $3 = {
    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,
    },
  },
  i0e = new jn(0, 0, 0, 0),
  jN = class dx extends nh {
    constructor(e = {}) {
      e = {
        ...dx.defaultOptions,
        ...e,
        dynamicProperties: {
          ...dx.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 $3) {
        const c = $3[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 i0e;
    }
    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"
      );
    }
  };
jN.defaultOptions = {
  dynamicProperties: {
    vertex: !1,
    position: !0,
    rotation: !1,
    uvs: !1,
    color: !1,
  },
  roundPixels: !1,
};
let WPe = jN;
const WN = class YN extends Kpe {
  constructor(e = {}) {
    (e = { ...YN.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),
      g = l * n,
      m = c * r;
    (e[0] = e[8] = e[16] = e[24] = -g),
      (e[2] = e[10] = e[18] = e[26] = i * p - g),
      (e[4] = e[12] = e[20] = e[28] = n - o * p - g),
      (e[6] = e[14] = e[22] = e[30] = n - g),
      (e[1] = e[3] = e[5] = e[7] = -m),
      (e[9] = e[11] = e[13] = e[15] = s * p - m),
      (e[17] = e[19] = e[21] = e[23] = r - a * p - m),
      (e[25] = e[27] = e[29] = e[31] = r - m),
      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();
  }
};
WN.defaultOptions = {
  width: 100,
  height: 100,
  leftWidth: 10,
  topHeight: 10,
  rightWidth: 10,
  bottomHeight: 10,
  originalWidth: 100,
  originalHeight: 100,
};
let o0e = WN;
class s0e extends F2 {
  constructor() {
    super(), (this.geometry = new o0e());
  }
  destroy() {
    this.geometry.destroy();
  }
}
class XN {
  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 s0e()),
      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;
  }
}
XN.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "nineSliceSprite",
};
const a0e = {
    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);
        `,
    },
  },
  l0e = {
    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 sv, av;
class c0e extends yi {
  constructor() {
    sv ?? (sv = oh({ name: "tiling-sprite-shader", bits: [Lf, a0e, ah] })),
      av ?? (av = sh({ name: "tiling-sprite-shader", bits: [C2, l0e, lh] }));
    const e = new mr({
      uMapCoord: { value: new Re(), 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 Re(), type: "mat3x3<f32>" },
      uSizeAnchor: {
        value: new Float32Array([100, 100, 0.5, 0.5]),
        type: "vec4<f32>",
      },
    });
    super({
      glProgram: av,
      gpuProgram: sv,
      resources: {
        localUniforms: new mr({
          uTransformMatrix: { value: new Re(), 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 u0e extends E2 {
  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 f0e(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 d0e(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 h0e(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 = Re.shared;
  a.copyFrom(t._tileTransform.matrix),
    (a.tx /= t.width),
    (a.ty /= t.height),
    a.invert(),
    a.scale(t.width / r, t.height / i),
    d0e(e, 2, 0, a);
}
const Zp = new u0e();
class p0e {
  constructor() {
    (this.canBatch = !0),
      (this.geometry = new E2({
        indices: Zp.indices.slice(),
        positions: Zp.positions.slice(),
        uvs: Zp.uvs.slice(),
      }));
  }
  destroy() {
    var e;
    this.geometry.destroy(), (e = this.shader) == null || e.destroy();
  }
}
class KN {
  constructor(e) {
    (this._state = Gi.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 F2());
      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 c0e()),
        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),
      ch(e.groupColorAlpha, r.uColor, 0),
      (this._state.blendMode = xd(e.groupBlendMode, e.texture._source)),
      this._renderer.encoder.draw({
        geometry: Zp,
        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 p0e();
    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()),
      h0e(e, r.uvs),
      f0e(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
    );
  }
}
KN.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "tilingSprite",
};
const g0e = {
    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));
        `,
    },
  },
  m0e = {
    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));
        `,
    },
  },
  v0e = {
    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;

            }
        `,
    },
  },
  y0e = {
    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 lv, cv;
class _0e extends yi {
  constructor(e) {
    const n = new mr({
      uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" },
      uTransformMatrix: { value: new Re(), type: "mat3x3<f32>" },
      uDistance: { value: 4, type: "f32" },
      uRound: { value: 0, type: "f32" },
    });
    lv ?? (lv = oh({ name: "sdf-shader", bits: [c2, f2(e), g0e, v0e, ah] })),
      cv ?? (cv = sh({ name: "sdf-shader", bits: [u2, d2(e), m0e, y0e, lh] })),
      super({
        glProgram: cv,
        gpuProgram: lv,
        resources: { localUniforms: n, batchSamplers: h2(e) },
      });
  }
}
class x0e extends $0 {
  destroy() {
    this.context.customShader && this.context.customShader.destroy(),
      super.destroy();
  }
}
class qN {
  constructor(e) {
    this._renderer = e;
  }
  validateRenderable(e) {
    const n = this._getGpuBitmapText(e);
    return this._renderer.renderPipes.graphics.validateRenderable(n);
  }
  addRenderable(e, n) {
    const r = this._getGpuBitmapText(e);
    U3(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);
    U3(e, n),
      this._renderer.renderPipes.graphics.updateRenderable(n),
      n.context.customShader && this._updateDistanceField(e);
  }
  _updateContext(e, n) {
    const { context: r } = n,
      i = rx.getFont(e.text, e._style);
    r.clear(),
      i.distanceField.type !== "none" &&
        (r.customShader ||
          (r.customShader = new _0e(
            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,
      g = i.lineHeight;
    s.lineHeight && ((p = s.fontSize / u), (g = s.lineHeight / u));
    let m = (g - p) / 2;
    m - i.baseLineOffset < 0 && (m = 0);
    for (let v = 0; v < l.lines.length; v++) {
      const y = l.lines[v];
      for (let _ = 0; _ < y.charPositions.length; _++) {
        const x = y.chars[_],
          b = i.chars[x];
        if (b != null && b.texture) {
          const w = b.texture;
          r.texture(
            w,
            h || "black",
            Math.round(y.charPositions[_] + b.xOffset),
            Math.round(a + b.yOffset + m),
            w.orig.width,
            w.orig.height
          );
        }
      }
      a += g;
    }
  }
  _getGpuBitmapText(e) {
    return e._gpuData[this._renderer.uid] || this.initGpuText(e);
  }
  initGpuText(e) {
    const n = new x0e();
    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;
  }
}
qN.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "bitmapText",
};
function U3(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 b0e extends vm {
  constructor(e) {
    super(),
      (this.generatingTexture = !1),
      (this.currentKey = "--"),
      (this._renderer = e),
      e.runners.resolutionChange.add(this);
  }
  resolutionChange() {
    const e = this.renderable;
    e._autoResolution && e.onViewUpdate();
  }
  destroy() {
    const { htmlText: e } = this._renderer;
    e.getReferenceCount(this.currentKey) === null
      ? e.returnTexturePromise(this.texturePromise)
      : e.decreaseReferenceCount(this.currentKey),
      this._renderer.runners.resolutionChange.remove(this),
      (this.texturePromise = null),
      (this._renderer = null);
  }
}
function hx(t, e) {
  const { texture: n, bounds: r } = t,
    i = e._style._getFinalPadding();
  UD(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 ZN {
  constructor(e) {
    this._renderer = e;
  }
  validateRenderable(e) {
    const n = this._getGpuText(e),
      r = e.styleKey;
    return n.currentKey !== r;
  }
  addRenderable(e, n) {
    const r = this._getGpuText(e);
    if (e._didTextUpdate) {
      const i = e._autoResolution ? this._renderer.resolution : e.resolution;
      (r.currentKey !== e.styleKey || e.resolution !== i) &&
        this._updateGpuText(e).catch((o) => {
          console.error(o);
        }),
        (e._didTextUpdate = !1),
        hx(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;
    const r = n.texturePromise;
    (n.texturePromise = null),
      (n.generatingTexture = !0),
      (e._resolution = e._autoResolution
        ? this._renderer.resolution
        : e.resolution);
    let i = this._renderer.htmlText.getTexturePromise(e);
    r &&
      (i = i.finally(() => {
        this._renderer.htmlText.decreaseReferenceCount(n.currentKey),
          this._renderer.htmlText.returnTexturePromise(r);
      })),
      (n.texturePromise = i),
      (n.currentKey = e.styleKey),
      (n.texture = await i);
    const o = e.renderGroup || e.parentRenderGroup;
    o && (o.structureDidChange = !0), (n.generatingTexture = !1), hx(n, e);
  }
  _getGpuText(e) {
    return e._gpuData[this._renderer.uid] || this.initGpuText(e);
  }
  initGpuText(e) {
    const n = new b0e(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;
  }
}
ZN.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "htmlText",
};
function w0e() {
  const { userAgent: t } = je.get().getNavigator();
  return /^((?!chrome|android).)*safari/i.test(t);
}
const E0e = new jn();
function JN(t, e, n, r) {
  const i = E0e;
  (i.minX = 0),
    (i.minY = 0),
    (i.maxX = (t.width / r) | 0),
    (i.maxY = (t.height / r) | 0);
  const o = sn.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 S0e(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 C0e(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 A0e(t, e) {
  const n = await C0e(e);
  return `@font-face {
        font-family: "${t.fontFamily}";
        font-weight: ${t.fontWeight};
        font-style: ${t.fontStyle};
        src: url('${n}');
    }`;
}
const uv = new Map();
async function T0e(t) {
  const e = t
    .filter((n) => bt.has(`${n}-and-url`))
    .map((n) => {
      if (!uv.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) =>
              A0e(
                { fontWeight: c.weight, fontStyle: c.style, fontFamily: n },
                s
              )
            )
          );
        }),
          uv.set(
            n,
            Promise.all(i).then((o) =>
              o.join(`
`)
            )
          );
      }
      return uv.get(n);
    });
  return (await Promise.all(e)).join(`
`);
}
function P0e(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 I0e(t, e) {
  const n = fs.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 O0e(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 QN {
  constructor(e) {
    (this._activeTextures = {}),
      (this._renderer = e),
      (this._createCanvas = e.type === Kr.WEBGPU);
  }
  getTexture(e) {
    return this.getTexturePromise(e);
  }
  getManagedTexture(e) {
    const n = e.styleKey;
    if (this._activeTextures[n])
      return this._increaseReferenceCount(n), this._activeTextures[n].promise;
    const r = this._buildTexturePromise(e).then(
      (i) => ((this._activeTextures[n].texture = i), i)
    );
    return (
      (this._activeTextures[n] = { texture: null, promise: r, usageCount: 1 }),
      r
    );
  }
  getReferenceCount(e) {
    var n;
    return (
      ((n = this._activeTextures[e]) == null ? void 0 : n.usageCount) ?? null
    );
  }
  _increaseReferenceCount(e) {
    this._activeTextures[e].usageCount++;
  }
  decreaseReferenceCount(e) {
    const n = this._activeTextures[e];
    n &&
      (n.usageCount--,
      n.usageCount === 0 &&
        (n.texture
          ? this._cleanUp(n.texture)
          : n.promise
              .then((r) => {
                (n.texture = r), this._cleanUp(n.texture);
              })
              .catch(() => {
                Fe("HTMLTextSystem: Failed to clean texture");
              }),
        (this._activeTextures[e] = null)));
  }
  getTexturePromise(e) {
    return this._buildTexturePromise(e);
  }
  async _buildTexturePromise(e) {
    const { text: n, style: r, resolution: i, textureStyle: o } = e,
      s = gn.get(pk),
      a = S0e(n, r),
      l = await T0e(a),
      c = lhe(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 = P0e(n, r, i, l, s);
    await O0e(d, p, w0e() && a.length > 0);
    const g = d;
    let m;
    this._createCanvas && (m = I0e(d, i));
    const v = JN(m ? m.canvas : g, d.width - h, d.height - h, i);
    return (
      o && (v.source.style = o),
      this._createCanvas &&
        (this._renderer.texture.initSource(v.source),
        fs.returnCanvasAndContext(m)),
      gn.return(s),
      v
    );
  }
  returnTexturePromise(e) {
    e.then((n) => {
      this._cleanUp(n);
    }).catch(() => {
      Fe("HTMLTextSystem: Failed to clean texture");
    });
  }
  _cleanUp(e) {
    sn.returnTexture(e, !0),
      (e.source.resource = null),
      (e.source.uploadMethodId = "unknown");
  }
  destroy() {
    this._renderer = null;
    for (const e in this._activeTextures)
      this._activeTextures[e] &&
        this.returnTexturePromise(this._activeTextures[e].promise);
    this._activeTextures = null;
  }
}
QN.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
  name: "htmlText",
};
class R0e extends vm {
  constructor(e) {
    super(), (this._renderer = e), e.runners.resolutionChange.add(this);
  }
  resolutionChange() {
    const e = this.renderable;
    e._autoResolution && e.onViewUpdate();
  }
  destroy() {
    const { canvasText: e } = this._renderer;
    e.getReferenceCount(this.currentKey) > 0
      ? e.decreaseReferenceCount(this.currentKey)
      : this.texture && e.returnTexture(this.texture),
      this._renderer.runners.resolutionChange.remove(this),
      (this._renderer = null);
  }
}
class e5 {
  constructor(e) {
    this._renderer = e;
  }
  validateRenderable(e) {
    const n = this._getGpuText(e),
      r = e.styleKey;
    return n.currentKey !== r ? !0 : e._didTextUpdate;
  }
  addRenderable(e, n) {
    const r = this._getGpuText(e);
    if (e._didTextUpdate) {
      const i = e._autoResolution ? this._renderer.resolution : e.resolution;
      (r.currentKey !== e.styleKey || e.resolution !== i) &&
        this._updateGpuText(e),
        (e._didTextUpdate = !1),
        hx(r, e);
    }
    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.decreaseReferenceCount(n.currentKey),
      (e._resolution = e._autoResolution
        ? this._renderer.resolution
        : e.resolution),
      (n.texture = this._renderer.canvasText.getManagedTexture(e)),
      (n.currentKey = e.styleKey);
  }
  _getGpuText(e) {
    return e._gpuData[this._renderer.uid] || this.initGpuText(e);
  }
  initGpuText(e) {
    const n = new R0e(this._renderer);
    return (
      (n.currentKey = "--"),
      (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;
  }
}
e5.extension = {
  type: [V.WebGLPipes, V.WebGPUPipes, V.CanvasPipes],
  name: "text",
};
class t5 {
  constructor(e) {
    (this._activeTextures = {}), (this._renderer = e);
  }
  getTexture(e, n, r, i) {
    typeof e == "string" &&
      (ke(
        "8.0.0",
        "CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"
      ),
      (e = { text: e, style: r, resolution: n })),
      e.style instanceof Cl || (e.style = new Cl(e.style)),
      e.textureStyle instanceof xo || (e.textureStyle = new xo(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 } = Ff.getCanvasAndContext({
        text: o,
        style: s,
        resolution: l,
      }),
      f = JN(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), Ff.returnCanvasAndContext(u), d;
    }
    return (
      this._renderer.texture.initSource(f._source),
      Ff.returnCanvasAndContext(u),
      f
    );
  }
  returnTexture(e) {
    const n = e.source;
    (n.resource = null),
      (n.uploadMethodId = "unknown"),
      (n.alphaMode = "no-premultiply-alpha"),
      sn.returnTexture(e, !0);
  }
  renderTextToCanvas() {
    ke(
      "8.10.0",
      "CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead"
    );
  }
  getManagedTexture(e) {
    e._resolution = e._autoResolution
      ? this._renderer.resolution
      : e.resolution;
    const n = e.styleKey;
    if (this._activeTextures[n])
      return this._increaseReferenceCount(n), this._activeTextures[n].texture;
    const r = this.getTexture({
      text: e.text,
      style: e.style,
      resolution: e._resolution,
      textureStyle: e.textureStyle,
    });
    return (this._activeTextures[n] = { texture: r, usageCount: 1 }), r;
  }
  decreaseReferenceCount(e) {
    const n = this._activeTextures[e];
    n.usageCount--,
      n.usageCount === 0 &&
        (this.returnTexture(n.texture), (this._activeTextures[e] = null));
  }
  getReferenceCount(e) {
    var n;
    return ((n = this._activeTextures[e]) == null ? void 0 : n.usageCount) ?? 0;
  }
  _increaseReferenceCount(e) {
    this._activeTextures[e].usageCount++;
  }
  _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;
    for (const e in this._activeTextures)
      this._activeTextures[e] &&
        this.returnTexture(this._activeTextures[e].texture);
    this._activeTextures = null;
  }
}
t5.extension = {
  type: [V.WebGLSystem, V.WebGPUSystem, V.CanvasSystem],
  name: "canvasText",
};
$e.add(Jae, Qae);
var ll = {},
  n5 = {},
  Qo = {};
Object.defineProperty(Qo, "__esModule", { value: !0 });
Qo.loop = Qo.conditional = Qo.parse = void 0;
var M0e = 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 = M0e;
var D0e = function (e, n) {
  return function (r, i, o, s) {
    n(r, i, o) && s(r, e, i, o);
  };
};
Qo.conditional = D0e;
var B0e = 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 = B0e;
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 k0e = function (e) {
  return { data: e, pos: 0 };
};
on.buildStream = k0e;
var r5 = function () {
  return function (e) {
    return e.data[e.pos++];
  };
};
on.readByte = r5;
var N0e = function () {
  var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
  return function (n) {
    return n.data[n.pos + e];
  };
};
on.peekByte = N0e;
var ym = function (e) {
  return function (n) {
    return n.data.subarray(n.pos, (n.pos += e));
  };
};
on.readBytes = ym;
var F0e = function (e) {
  return function (n) {
    return n.data.subarray(n.pos, n.pos + e);
  };
};
on.peekBytes = F0e;
var L0e = function (e) {
  return function (n) {
    return Array.from(ym(e)(n))
      .map(function (r) {
        return String.fromCharCode(r);
      })
      .join("");
  };
};
on.readString = L0e;
var $0e = function (e) {
  return function (n) {
    var r = ym(2)(n);
    return e ? (r[1] << 8) + r[0] : (r[0] << 8) + r[1];
  };
};
on.readUnsigned = $0e;
var U0e = function (e, n) {
  return function (r, i, o) {
    for (
      var s = typeof n == "function" ? n(r, i, o) : n,
        a = ym(e),
        l = new Array(s),
        c = 0;
      c < s;
      c++
    )
      l[c] = a(r);
    return l;
  };
};
on.readArray = U0e;
var G0e = 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;
  },
  H0e = function (e) {
    return function (n) {
      for (var r = r5()(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] = G0e(i, l.index, l.length)) : (s[a] = i[l.index]), s
        );
      }, {});
    };
  };
on.readBits = H0e;
(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 = [], g = d.data.length, m = 0, v = (0, n.readByte)()(d);
          v !== h && v;
          v = (0, n.readByte)()(d)
        ) {
          if (d.pos + v >= g) {
            var y = g - d.pos;
            p.push((0, n.readBytes)(y)(d)), (m += y);
            break;
          }
          p.push((0, n.readBytes)(v)(d)), (m += v);
        }
        for (var _ = new Uint8Array(m), 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;
})(n5);
var _m = {};
Object.defineProperty(_m, "__esModule", { value: !0 });
_m.deinterlace = void 0;
var V0e = 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;
};
_m.deinterlace = V0e;
var xm = {};
Object.defineProperty(xm, "__esModule", { value: !0 });
xm.lzw = void 0;
var z0e = function (e, n, r) {
  var i = 4096,
    o = -1,
    s = r,
    a,
    l,
    c,
    u,
    f,
    d,
    h,
    w,
    p,
    g,
    b,
    m,
    E,
    S,
    C,
    P,
    v = new Array(r),
    y = new Array(i),
    _ = new Array(i),
    x = new Array(i + 1);
  for (
    m = e,
      l = 1 << m,
      f = l + 1,
      a = l + 2,
      h = o,
      u = m + 1,
      c = (1 << u) - 1,
      p = 0;
    p < l;
    p++
  )
    (y[p] = 0), (_[p] = p);
  var b, w, E, S, P, C;
  for (b = w = E = S = P = C = 0, g = 0; g < 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 = m + 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 = y[p]);
      (E = _[p] & 255),
        (x[S++] = E),
        a < i &&
          ((y[a] = h), (_[a] = E), a++, !(a & c) && a < i && (u++, (c += a))),
        (h = d);
    }
    S--, (v[P++] = x[S]), g++;
  }
  for (g = P; g < s; g++) v[g] = 0;
  return v;
};
xm.lzw = z0e;
Object.defineProperty(ll, "__esModule", { value: !0 });
var i5 = (ll.decompressFrames = ll.decompressFrame = o5 = ll.parseGIF = void 0),
  j0e = q0e(n5),
  W0e = Qo,
  Y0e = on,
  X0e = _m,
  K0e = xm;
function q0e(t) {
  return t && t.__esModule ? t : { default: t };
}
var Z0e = function (e) {
    var n = new Uint8Array(e);
    return (0, W0e.parse)((0, Y0e.buildStream)(n), j0e.default);
  },
  o5 = (ll.parseGIF = Z0e),
  J0e = 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;
  },
  s5 = 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, K0e.lzw)(i.data.minCodeSize, i.data.blocks, o);
    i.descriptor.lct.interlaced &&
      (s = (0, X0e.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 = J0e(a)),
      a
    );
  };
ll.decompressFrame = s5;
var Q0e = function (e, n) {
  return e.frames
    .filter(function (r) {
      return r.image;
    })
    .map(function (r) {
      return s5(r, e.gct, n);
    });
};
i5 = ll.decompressFrames = Q0e;
class bm {
  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 = (y) => {
        let _ = null;
        for (const x of y.frames)
          (_ = x.gce ?? _), "image" in x && !("gce" in x) && (x.gce = _);
      },
      i = o5(e);
    r(i);
    const o = i5(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 { fps: g = 30, ...m } = n ?? {},
      v = 1e3 / g;
    for (let y = 0; y < o.length; y++) {
      const {
        disposalType: _ = 2,
        delay: x = v,
        patch: b,
        dims: { width: w, height: E, left: S, top: P },
      } = o[y];
      (f.width = w), (f.height = E), d.clearRect(0, 0, w, E);
      const C = d.createImageData(w, E);
      C.data.set(b),
        d.putImageData(C, 0, 0),
        _ === 3 && (p = u.getImageData(0, 0, a, l)),
        u.drawImage(f, S, P);
      const A = u.getImageData(0, 0, a, l);
      _ === 2 ? u.clearRect(0, 0, a, l) : _ === 3 && u.putImageData(p, 0, 0);
      const T = je.get().createCanvas(A.width, A.height);
      T.getContext("2d").putImageData(A, 0, 0),
        s.push({
          start: h,
          end: h + x,
          texture: new Ae({ source: new fo({ resource: T, ...m }) }),
        }),
        (h += x);
    }
    return (c.width = c.height = 0), (f.width = f.height = 0), new bm(s);
  }
}
const ege = {
    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) => Ir.extname(t) === ".gif" || t.startsWith("data:image/gif"),
      load: async (t, e) => {
        const r = await (await je.get().fetch(t)).arrayBuffer();
        return bm.from(r, e == null ? void 0 : e.data);
      },
      unload: async (t) => {
        t.destroy();
      },
    },
  },
  a5 = class px extends bl {
    constructor(...e) {
      const n = e[0] instanceof bm ? { source: e[0] } : e[0],
        {
          source: r,
          fps: i,
          loop: o,
          animationSpeed: s,
          autoPlay: a,
          autoUpdate: l,
          onComplete: c,
          onFrameChange: u,
          onLoop: f,
          ...d
        } = Object.assign({}, px.defaultOptions, n);
      super({ texture: Ae.EMPTY, ...d }),
        (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 = r.textures[0]),
        (this.duration = r.frames[r.frames.length - 1].end),
        (this._source = r),
        (this._playing = !1),
        (this._currentTime = 0),
        (this._isConnectedToTicker = !1),
        Object.assign(this, {
          fps: i,
          loop: o,
          animationSpeed: s,
          autoPlay: a,
          autoUpdate: l,
          onComplete: c,
          onFrameChange: u,
          onLoop: f,
        }),
        (this.currentFrame = 0),
        a && this.play();
    }
    stop() {
      this._playing &&
        ((this._playing = !1),
        this._autoUpdate &&
          this._isConnectedToTicker &&
          (Vn.shared.remove(this.update, this),
          (this._isConnectedToTicker = !1)));
    }
    play() {
      this._playing ||
        ((this._playing = !0),
        this._autoUpdate &&
          !this._isConnectedToTicker &&
          (Vn.shared.add(this.update, this, El.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) / Vn.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
          ? (Vn.shared.remove(this.update, this),
            (this._isConnectedToTicker = !1))
          : this._autoUpdate &&
            !this._isConnectedToTicker &&
            this._playing &&
            (Vn.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 px({
        source: this._source,
        autoUpdate: this._autoUpdate,
        loop: this.loop,
        autoPlay: this.autoPlay,
        animationSpeed: this.animationSpeed,
        onComplete: this.onComplete,
        onFrameChange: this.onFrameChange,
        onLoop: this.onLoop,
      });
      return (e.dirty = !0), e;
    }
  };
a5.defaultOptions = {
  fps: 30,
  loop: !0,
  animationSpeed: 1,
  autoPlay: !0,
  autoUpdate: !0,
  onComplete: null,
  onFrameChange: null,
  onLoop: null,
};
let YPe = a5;
$e.add(ege);
var l5 = { exports: {} };
(function (t, e) {
  (function (n, r) {
    t.exports = r();
  })(os, 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,
              g,
              m,
              v = f.$locale().relativeTime || s,
              y = 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" },
              ],
              _ = y.length,
              x = 0;
            x < _;
            x += 1
          ) {
            var b = y[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 (((m = p > 0), w <= b.r || !b.r)) {
              w <= 1 && x > 0 && (b = y[x - 1]);
              var E = v[b.l];
              h && (w = h("" + w)),
                (g =
                  typeof E == "string" ? E.replace("%d", w) : E(w, u, b.l, m));
              break;
            }
          }
          if (u) return g;
          var S = m ? v.future : v.past;
          return typeof S == "function" ? S(g) : S.replace("%s", g);
        }),
        (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);
        });
    };
  });
})(l5);
var tge = l5.exports;
const XPe = fa(tge);
var nge = { exports: {} };
(function (t, e) {
  (function (n, r) {
    t.exports = r(hw);
  })(os, 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;
  });
})(nge);
var rge = { exports: {} };
(function (t, e) {
  (function (n, r) {
    t.exports = r(hw);
  })(os, 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;
  });
})(rge);
var ige = { exports: {} };
(function (t, e) {
  (function (n, r) {
    t.exports = r();
  })(os, 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]) + "]";
      },
    };
  });
})(ige);
const c5 = 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.`
        );
      },
    }
  ),
  oge = Object.freeze(
    Object.defineProperty(
      { __proto__: null, default: c5 },
      Symbol.toStringTag,
      { value: "Module" }
    )
  );
var gx = null;
function sge(t) {
  try {
    return crypto.getRandomValues(new Uint8Array(t));
  } catch {}
  try {
    return c5.randomBytes(t);
  } catch {}
  if (!gx)
    throw Error(
      "Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative"
    );
  return gx(t);
}
function age(t) {
  gx = t;
}
function L2(t, e) {
  if (((t = t || $2), 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(U0(sge(wd), wd)),
    n.join("")
  );
}
function u5(t, e, n) {
  if (
    (typeof e == "function" && ((n = e), (e = void 0)),
    typeof t == "function" && ((n = t), (t = void 0)),
    typeof t > "u")
  )
    t = $2;
  else if (typeof t != "number") throw Error("illegal arguments: " + typeof t);
  function r(i) {
    Bi(function () {
      try {
        i(null, L2(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 f5(t, e) {
  if (
    (typeof e > "u" && (e = $2),
    typeof e == "number" && (e = L2(e)),
    typeof t != "string" || typeof e != "string")
  )
    throw Error("Illegal arguments: " + typeof t + ", " + typeof e);
  return mx(t, e);
}
function d5(t, e, n, r) {
  function i(o) {
    typeof t == "string" && typeof e == "number"
      ? u5(e, function (s, a) {
          mx(t, a, o, r);
        })
      : typeof t == "string" && typeof e == "string"
      ? mx(t, e, o, r)
      : Bi(
          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 h5(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 lge(t, e) {
  if (typeof t != "string" || typeof e != "string")
    throw Error("Illegal arguments: " + typeof t + ", " + typeof e);
  return e.length !== 60 ? !1 : h5(f5(t, e.substring(0, e.length - 31)), e);
}
function cge(t, e, n, r) {
  function i(o) {
    if (typeof t != "string" || typeof e != "string") {
      Bi(
        o.bind(this, Error("Illegal arguments: " + typeof t + ", " + typeof e))
      );
      return;
    }
    if (e.length !== 60) {
      Bi(o.bind(this, null, !1));
      return;
    }
    d5(
      t,
      e.substring(0, 29),
      function (s, a) {
        s ? o(s) : o(null, h5(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 uge(t) {
  if (typeof t != "string") throw Error("Illegal arguments: " + typeof t);
  return parseInt(t.split("$")[2], 10);
}
function fge(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 dge(t) {
  if (typeof t != "string") throw Error("Illegal arguments: " + typeof t);
  return p5(t) > 72;
}
var Bi =
  typeof process < "u" && process && typeof process.nextTick == "function"
    ? typeof setImmediate == "function"
      ? setImmediate
      : process.nextTick
    : setTimeout;
function p5(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 hge(t) {
  for (var e = 0, n, r, i = new Array(p5(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 ac =
    "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(
      ""
    ),
  Ts = [
    -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 U0(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(ac[(i >> 2) & 63]),
      (i = (i & 3) << 4),
      n >= e)
    ) {
      r.push(ac[i & 63]);
      break;
    }
    if (
      ((o = t[n++] & 255),
      (i |= (o >> 4) & 15),
      r.push(ac[i & 63]),
      (i = (o & 15) << 2),
      n >= e)
    ) {
      r.push(ac[i & 63]);
      break;
    }
    (o = t[n++] & 255),
      (i |= (o >> 6) & 3),
      r.push(ac[i & 63]),
      r.push(ac[o & 63]);
  }
  return r.join("");
}
function g5(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 < Ts.length ? Ts[f] : -1),
    (f = t.charCodeAt(n++)),
    (a = f < Ts.length ? Ts[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 < Ts.length ? Ts[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 < Ts.length ? Ts[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 wd = 16,
  $2 = 10,
  pge = 16,
  gge = 100,
  G3 = [
    608135816, 2242054355, 320440878, 57701188, 2752067618, 698298832,
    137296536, 3964562569, 1160258022, 953160567, 3193202383, 887688300,
    3232508343, 3380367581, 1065670069, 3041331479, 2450970073, 2306472731,
  ],
  H3 = [
    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,
  ],
  m5 = [1332899944, 1700884034, 1701343084, 1684370003, 1668446532, 1869963892];
function Ed(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[pge + 1]),
    (t[e + 1] = o),
    t
  );
}
function vc(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 V3(t, e, n) {
  for (var r = 0, i = [0, 0], o = e.length, s = n.length, a, l = 0; l < o; l++)
    (a = vc(t, r)), (r = a.offp), (e[l] = e[l] ^ a.key);
  for (l = 0; l < o; l += 2)
    (i = Ed(i, 0, e, n)), (e[l] = i[0]), (e[l + 1] = i[1]);
  for (l = 0; l < s; l += 2)
    (i = Ed(i, 0, e, n)), (n[l] = i[0]), (n[l + 1] = i[1]);
}
function mge(t, e, n, r) {
  for (var i = 0, o = [0, 0], s = n.length, a = r.length, l, c = 0; c < s; c++)
    (l = vc(e, i)), (i = l.offp), (n[c] = n[c] ^ l.key);
  for (i = 0, c = 0; c < s; c += 2)
    (l = vc(t, i)),
      (i = l.offp),
      (o[0] ^= l.key),
      (l = vc(t, i)),
      (i = l.offp),
      (o[1] ^= l.key),
      (o = Ed(o, 0, n, r)),
      (n[c] = o[0]),
      (n[c + 1] = o[1]);
  for (c = 0; c < a; c += 2)
    (l = vc(t, i)),
      (i = l.offp),
      (o[0] ^= l.key),
      (l = vc(t, i)),
      (i = l.offp),
      (o[1] ^= l.key),
      (o = Ed(o, 0, n, r)),
      (r[c] = o[0]),
      (r[c + 1] = o[1]);
}
function z3(t, e, n, r, i) {
  var o = m5.slice(),
    s = o.length,
    a;
  if (n < 4 || n > 31)
    if (((a = Error("Illegal number of rounds (4-31): " + n)), r)) {
      Bi(r.bind(this, a));
      return;
    } else throw a;
  if (e.length !== wd)
    if (((a = Error("Illegal salt length: " + e.length + " != " + wd)), r)) {
      Bi(r.bind(this, a));
      return;
    } else throw a;
  n = (1 << n) >>> 0;
  var l,
    c,
    u = 0,
    f;
  typeof Int32Array == "function"
    ? ((l = new Int32Array(G3)), (c = new Int32Array(H3)))
    : ((l = G3.slice()), (c = H3.slice())),
    mge(e, t, l, c);
  function d() {
    if ((i && i(u / n), u < n))
      for (
        var p = Date.now();
        u < n &&
        ((u = u + 1), V3(t, l, c), V3(e, l, c), !(Date.now() - p > gge));

      );
    else {
      for (u = 0; u < 64; u++) for (f = 0; f < s >> 1; f++) Ed(o, f << 1, l, c);
      var g = [];
      for (u = 0; u < s; u++)
        g.push(((o[u] >> 24) & 255) >>> 0),
          g.push(((o[u] >> 16) & 255) >>> 0),
          g.push(((o[u] >> 8) & 255) >>> 0),
          g.push((o[u] & 255) >>> 0);
      if (r) {
        r(null, g);
        return;
      } else return g;
    }
    r && Bi(d);
  }
  if (typeof r < "u") d();
  else for (var h; ; ) if (typeof (h = d()) < "u") return h || [];
}
function mx(t, e, n, r) {
  var i;
  if (typeof t != "string" || typeof e != "string")
    if (((i = Error("Invalid string / salt: Not a string")), n)) {
      Bi(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)) {
      Bi(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)) {
        Bi(n.bind(this, i));
        return;
      } else throw i;
    s = 4;
  }
  if (e.charAt(s + 2) > "$")
    if (((i = Error("Missing salt rounds")), n)) {
      Bi(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 = hge(t),
    d = g5(u, wd);
  function h(p) {
    var g = [];
    return (
      g.push("$2"),
      o >= "a" && g.push(o),
      g.push("$"),
      c < 10 && g.push("0"),
      g.push(c.toString()),
      g.push("$"),
      g.push(U0(d, d.length)),
      g.push(U0(p, m5.length * 4 - 1)),
      g.join("")
    );
  }
  if (typeof n > "u") return h(z3(f, d, c));
  z3(
    f,
    d,
    c,
    function (p, g) {
      p ? n(p, null) : n(null, h(g));
    },
    r
  );
}
function vge(t, e) {
  return U0(t, e);
}
function yge(t, e) {
  return g5(t, e);
}
const KPe = {
    setRandomFallback: age,
    genSaltSync: L2,
    genSalt: u5,
    hashSync: f5,
    hash: d5,
    compareSync: lge,
    compare: cge,
    getRounds: uge,
    getSalt: fge,
    truncates: dge,
    encodeBase64: vge,
    decodeBase64: yge,
  },
  qPe = Jd("App", {
    web: () =>
      Wf(() => Promise.resolve().then(() => fTe), void 0).then(
        (t) => new t.AppWeb()
      ),
  });
const _ge = () => {};
/**
 * @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 v5 = 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;
  },
  xge = 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("");
  },
  y5 = {
    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(v5(t), e);
    },
    decodeString(t, e) {
      return this.HAS_NATIVE_SUPPORT && !e
        ? atob(t)
        : xge(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 bge();
        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 bge extends Error {
  constructor() {
    super(...arguments), (this.name = "DecodeBase64StringError");
  }
}
const wge = function (t) {
    const e = v5(t);
    return y5.encodeByteArray(e, !0);
  },
  _5 = function (t) {
    return wge(t).replace(/\./g, "");
  },
  Ege = function (t) {
    try {
      return y5.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 Sge() {
  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 Cge = () => Sge().__FIREBASE_DEFAULTS__,
  Age = () => {
    if (typeof process > "u" || typeof process.env > "u") return;
    const t = {}.__FIREBASE_DEFAULTS__;
    if (t) return JSON.parse(t);
  },
  Tge = () => {
    if (typeof document > "u") return;
    let t;
    try {
      t = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/);
    } catch {
      return;
    }
    const e = t && Ege(t[1]);
    return e && JSON.parse(e);
  },
  Pge = () => {
    try {
      return _ge() || Cge() || Age() || Tge();
    } catch (t) {
      console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);
      return;
    }
  },
  x5 = () => {
    var t;
    return (t = Pge()) === 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 Ige {
  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 Oge() {
  const t =
    typeof chrome == "object"
      ? chrome.runtime
      : typeof browser == "object"
      ? browser.runtime
      : void 0;
  return typeof t == "object" && t.id !== void 0;
}
function U2() {
  try {
    return typeof indexedDB == "object";
  } catch {
    return !1;
  }
}
function G2() {
  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 b5() {
  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 Rge = "FirebaseError";
class Gl extends Error {
  constructor(e, n, r) {
    super(n),
      (this.code = e),
      (this.customData = r),
      (this.name = Rge),
      Object.setPrototypeOf(this, Gl.prototype),
      Error.captureStackTrace &&
        Error.captureStackTrace(this, uh.prototype.create);
  }
}
class uh {
  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 ? Mge(o, r) : "Error",
      a = `${this.serviceName}: ${s} (${i}).`;
    return new Gl(i, a, r);
  }
}
function Mge(t, e) {
  return t.replace(Dge, (n, r) => {
    const i = e[r];
    return i != null ? String(i) : `<${r}?>`;
  });
}
const Dge = /\{\$([^}]+)}/g;
function G0(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 (j3(o) && j3(s)) {
      if (!G0(o, s)) return !1;
    } else if (o !== s) return !1;
  }
  for (const i of r) if (!n.includes(i)) return !1;
  return !0;
}
function j3(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 Bge = 1e3,
  kge = 2,
  Nge = 4 * 60 * 60 * 1e3,
  Fge = 0.5;
function W3(t, e = Bge, n = kge) {
  const r = e * Math.pow(n, t),
    i = Math.round(Fge * r * (Math.random() - 0.5) * 2);
  return Math.min(Nge, 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 fh(t) {
  return t && t._delegate ? t._delegate : t;
}
class bo {
  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 Fa = "[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 Lge {
  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 Ige();
      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 (Uge(e))
        try {
          this.getOrInitializeService({ instanceIdentifier: Fa });
        } 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 = Fa) {
    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 = Fa) {
    return this.instances.has(e);
  }
  getOptions(e = Fa) {
    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: $ge(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 = Fa) {
    return this.component ? (this.component.multipleInstances ? e : Fa) : e;
  }
  shouldAutoInitialize() {
    return !!this.component && this.component.instantiationMode !== "EXPLICIT";
  }
}
function $ge(t) {
  return t === Fa ? void 0 : t;
}
function Uge(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 Gge {
  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 Lge(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 Hge = {
    debug: Nt.DEBUG,
    verbose: Nt.VERBOSE,
    info: Nt.INFO,
    warn: Nt.WARN,
    error: Nt.ERROR,
    silent: Nt.SILENT,
  },
  Vge = Nt.INFO,
  zge = {
    [Nt.DEBUG]: "log",
    [Nt.VERBOSE]: "log",
    [Nt.INFO]: "info",
    [Nt.WARN]: "warn",
    [Nt.ERROR]: "error",
  },
  jge = (t, e, ...n) => {
    if (e < t.logLevel) return;
    const r = new Date().toISOString(),
      i = zge[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 w5 {
  constructor(e) {
    (this.name = e),
      (this._logLevel = Vge),
      (this._logHandler = jge),
      (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" ? Hge[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 Wge = (t, e) => e.some((n) => t instanceof n);
let Y3, X3;
function Yge() {
  return (
    Y3 ||
    (Y3 = [IDBDatabase, IDBObjectStore, IDBIndex, IDBCursor, IDBTransaction])
  );
}
function Xge() {
  return (
    X3 ||
    (X3 = [
      IDBCursor.prototype.advance,
      IDBCursor.prototype.continue,
      IDBCursor.prototype.continuePrimaryKey,
    ])
  );
}
const E5 = new WeakMap(),
  vx = new WeakMap(),
  S5 = new WeakMap(),
  fv = new WeakMap(),
  H2 = new WeakMap();
function Kge(t) {
  const e = new Promise((n, r) => {
    const i = () => {
        t.removeEventListener("success", o), t.removeEventListener("error", s);
      },
      o = () => {
        n(es(t.result)), i();
      },
      s = () => {
        r(t.error), i();
      };
    t.addEventListener("success", o), t.addEventListener("error", s);
  });
  return (
    e
      .then((n) => {
        n instanceof IDBCursor && E5.set(n, t);
      })
      .catch(() => {}),
    H2.set(e, t),
    e
  );
}
function qge(t) {
  if (vx.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);
  });
  vx.set(t, e);
}
let yx = {
  get(t, e, n) {
    if (t instanceof IDBTransaction) {
      if (e === "done") return vx.get(t);
      if (e === "objectStoreNames") return t.objectStoreNames || S5.get(t);
      if (e === "store")
        return n.objectStoreNames[1]
          ? void 0
          : n.objectStore(n.objectStoreNames[0]);
    }
    return es(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 Zge(t) {
  yx = t(yx);
}
function Jge(t) {
  return t === IDBDatabase.prototype.transaction &&
    !("objectStoreNames" in IDBTransaction.prototype)
    ? function (e, ...n) {
        const r = t.call(dv(this), e, ...n);
        return S5.set(r, e.sort ? e.sort() : [e]), es(r);
      }
    : Xge().includes(t)
    ? function (...e) {
        return t.apply(dv(this), e), es(E5.get(this));
      }
    : function (...e) {
        return es(t.apply(dv(this), e));
      };
}
function Qge(t) {
  return typeof t == "function"
    ? Jge(t)
    : (t instanceof IDBTransaction && qge(t),
      Wge(t, Yge()) ? new Proxy(t, yx) : t);
}
function es(t) {
  if (t instanceof IDBRequest) return Kge(t);
  if (fv.has(t)) return fv.get(t);
  const e = Qge(t);
  return e !== t && (fv.set(t, e), H2.set(e, t)), e;
}
const dv = (t) => H2.get(t);
function wm(t, e, { blocked: n, upgrade: r, blocking: i, terminated: o } = {}) {
  const s = indexedDB.open(t, e),
    a = es(s);
  return (
    r &&
      s.addEventListener("upgradeneeded", (l) => {
        r(es(s.result), l.oldVersion, l.newVersion, es(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 hv(t, { blocked: e } = {}) {
  const n = indexedDB.deleteDatabase(t);
  return (
    e && n.addEventListener("blocked", (r) => e(r.oldVersion, r)),
    es(n).then(() => {})
  );
}
const eme = ["get", "getKey", "getAll", "getAllKeys", "count"],
  tme = ["put", "add", "delete", "clear"],
  pv = new Map();
function K3(t, e) {
  if (!(t instanceof IDBDatabase && !(e in t) && typeof e == "string")) return;
  if (pv.get(e)) return pv.get(e);
  const n = e.replace(/FromIndex$/, ""),
    r = e !== n,
    i = tme.includes(n);
  if (
    !(n in (r ? IDBIndex : IDBObjectStore).prototype) ||
    !(i || eme.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 pv.set(e, o), o;
}
Zge((t) => ({
  ...t,
  get: (e, n, r) => K3(e, n) || t.get(e, n, r),
  has: (e, n) => !!K3(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 nme {
  constructor(e) {
    this.container = e;
  }
  getPlatformInfoString() {
    return this.container
      .getProviders()
      .map((n) => {
        if (rme(n)) {
          const r = n.getImmediate();
          return `${r.library}/${r.version}`;
        } else return null;
      })
      .filter((n) => n)
      .join(" ");
  }
}
function rme(t) {
  const e = t.getComponent();
  return (e == null ? void 0 : e.type) === "VERSION";
}
const _x = "@firebase/app",
  q3 = "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 ds = new w5("@firebase/app"),
  ime = "@firebase/app-compat",
  ome = "@firebase/analytics-compat",
  sme = "@firebase/analytics",
  ame = "@firebase/app-check-compat",
  lme = "@firebase/app-check",
  cme = "@firebase/auth",
  ume = "@firebase/auth-compat",
  fme = "@firebase/database",
  dme = "@firebase/data-connect",
  hme = "@firebase/database-compat",
  pme = "@firebase/functions",
  gme = "@firebase/functions-compat",
  mme = "@firebase/installations",
  vme = "@firebase/installations-compat",
  yme = "@firebase/messaging",
  _me = "@firebase/messaging-compat",
  xme = "@firebase/performance",
  bme = "@firebase/performance-compat",
  wme = "@firebase/remote-config",
  Eme = "@firebase/remote-config-compat",
  Sme = "@firebase/storage",
  Cme = "@firebase/storage-compat",
  Ame = "@firebase/firestore",
  Tme = "@firebase/ai",
  Pme = "@firebase/firestore-compat",
  Ime = "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 xx = "[DEFAULT]",
  Ome = {
    [_x]: "fire-core",
    [ime]: "fire-core-compat",
    [sme]: "fire-analytics",
    [ome]: "fire-analytics-compat",
    [lme]: "fire-app-check",
    [ame]: "fire-app-check-compat",
    [cme]: "fire-auth",
    [ume]: "fire-auth-compat",
    [fme]: "fire-rtdb",
    [dme]: "fire-data-connect",
    [hme]: "fire-rtdb-compat",
    [pme]: "fire-fn",
    [gme]: "fire-fn-compat",
    [mme]: "fire-iid",
    [vme]: "fire-iid-compat",
    [yme]: "fire-fcm",
    [_me]: "fire-fcm-compat",
    [xme]: "fire-perf",
    [bme]: "fire-perf-compat",
    [wme]: "fire-rc",
    [Eme]: "fire-rc-compat",
    [Sme]: "fire-gcs",
    [Cme]: "fire-gcs-compat",
    [Ame]: "fire-fst",
    [Pme]: "fire-fst-compat",
    [Tme]: "fire-vertex",
    "fire-js": "fire-js",
    [Ime]: "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 H0 = new Map(),
  Rme = new Map(),
  bx = new Map();
function Z3(t, e) {
  try {
    t.container.addComponent(e);
  } catch (n) {
    ds.debug(
      `Component ${e.name} failed to register with FirebaseApp ${t.name}`,
      n
    );
  }
}
function hs(t) {
  const e = t.name;
  if (bx.has(e))
    return (
      ds.debug(`There were multiple attempts to register component ${e}.`), !1
    );
  bx.set(e, t);
  for (const n of H0.values()) Z3(n, t);
  for (const n of Rme.values()) Z3(n, t);
  return !0;
}
function dh(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 Mme = {
    "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.",
  },
  Js = new uh("app", "Firebase", Mme);
/**
 * @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 Dme {
  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 bo("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 Js.create("app-deleted", { appName: this._name });
  }
}
function Bme(t, e = {}) {
  let n = t;
  typeof e != "object" && (e = { name: e });
  const r = Object.assign({ name: xx, automaticDataCollectionEnabled: !0 }, e),
    i = r.name;
  if (typeof i != "string" || !i)
    throw Js.create("bad-app-name", { appName: String(i) });
  if ((n || (n = x5()), !n)) throw Js.create("no-options");
  const o = H0.get(i);
  if (o) {
    if (G0(n, o.options) && G0(r, o.config)) return o;
    throw Js.create("duplicate-app", { appName: i });
  }
  const s = new Gge(i);
  for (const l of bx.values()) s.addComponent(l);
  const a = new Dme(n, r, s);
  return H0.set(i, a), a;
}
function C5(t = xx) {
  const e = H0.get(t);
  if (!e && t === xx && x5()) return Bme();
  if (!e) throw Js.create("no-app", { appName: t });
  return e;
}
function ho(t, e, n) {
  var r;
  let i = (r = Ome[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 "/")`
        ),
      ds.warn(a.join(" "));
    return;
  }
  hs(new bo(`${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 kme = "firebase-heartbeat-database",
  Nme = 1,
  Sd = "firebase-heartbeat-store";
let gv = null;
function A5() {
  return (
    gv ||
      (gv = wm(kme, Nme, {
        upgrade: (t, e) => {
          switch (e) {
            case 0:
              try {
                t.createObjectStore(Sd);
              } catch (n) {
                console.warn(n);
              }
          }
        },
      }).catch((t) => {
        throw Js.create("idb-open", { originalErrorMessage: t.message });
      })),
    gv
  );
}
async function Fme(t) {
  try {
    const n = (await A5()).transaction(Sd),
      r = await n.objectStore(Sd).get(T5(t));
    return await n.done, r;
  } catch (e) {
    if (e instanceof Gl) ds.warn(e.message);
    else {
      const n = Js.create("idb-get", {
        originalErrorMessage: e == null ? void 0 : e.message,
      });
      ds.warn(n.message);
    }
  }
}
async function J3(t, e) {
  try {
    const r = (await A5()).transaction(Sd, "readwrite");
    await r.objectStore(Sd).put(e, T5(t)), await r.done;
  } catch (n) {
    if (n instanceof Gl) ds.warn(n.message);
    else {
      const r = Js.create("idb-set", {
        originalErrorMessage: n == null ? void 0 : n.message,
      });
      ds.warn(r.message);
    }
  }
}
function T5(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 Lme = 1024,
  $me = 30;
class Ume {
  constructor(e) {
    (this.container = e), (this._heartbeatsCache = null);
    const n = this.container.getProvider("app").getImmediate();
    (this._storage = new Hme(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 = Q3();
      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 > $me)
      ) {
        const s = Vme(this._heartbeatsCache.heartbeats);
        this._heartbeatsCache.heartbeats.splice(s, 1);
      }
      return this._storage.overwrite(this._heartbeatsCache);
    } catch (r) {
      ds.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 = Q3(),
        { heartbeatsToSend: r, unsentEntries: i } = Gme(
          this._heartbeatsCache.heartbeats
        ),
        o = _5(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 ds.warn(n), "";
    }
  }
}
function Q3() {
  return new Date().toISOString().substring(0, 10);
}
function Gme(t, e = Lme) {
  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), eP(n) > e)) {
        o.dates.pop();
        break;
      }
    } else if ((n.push({ agent: i.agent, dates: [i.date] }), eP(n) > e)) {
      n.pop();
      break;
    }
    r = r.slice(1);
  }
  return { heartbeatsToSend: n, unsentEntries: r };
}
class Hme {
  constructor(e) {
    (this.app = e),
      (this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck());
  }
  async runIndexedDBEnvironmentCheck() {
    return U2()
      ? G2()
          .then(() => !0)
          .catch(() => !1)
      : !1;
  }
  async read() {
    if (await this._canUseIndexedDBPromise) {
      const n = await Fme(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 J3(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 J3(this.app, {
        lastSentHeartbeatDate:
          (n = e.lastSentHeartbeatDate) !== null && n !== void 0
            ? n
            : i.lastSentHeartbeatDate,
        heartbeats: [...i.heartbeats, ...e.heartbeats],
      });
    } else return;
  }
}
function eP(t) {
  return _5(JSON.stringify({ version: 2, heartbeats: t })).length;
}
function Vme(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 zme(t) {
  hs(new bo("platform-logger", (e) => new nme(e), "PRIVATE")),
    hs(new bo("heartbeat", (e) => new Ume(e), "PRIVATE")),
    ho(_x, q3, t),
    ho(_x, q3, "esm2017"),
    ho("fire-js", "");
}
zme("");
var jme = "firebase",
  Wme = "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.
 */ ho(jme, Wme, "app");
const P5 = "@firebase/installations",
  V2 = "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 I5 = 1e4,
  O5 = `w:${V2}`,
  R5 = "FIS_v2",
  Yme = "https://firebaseinstallations.googleapis.com/v1",
  Xme = 60 * 60 * 1e3,
  Kme = "installations",
  qme = "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 Zme = {
    "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.",
  },
  Al = new uh(Kme, qme, Zme);
function M5(t) {
  return t instanceof Gl && 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 D5({ projectId: t }) {
  return `${Yme}/projects/${t}/installations`;
}
function B5(t) {
  return {
    token: t.token,
    requestStatus: 2,
    expiresIn: Qme(t.expiresIn),
    creationTime: Date.now(),
  };
}
async function k5(t, e) {
  const r = (await e.json()).error;
  return Al.create("request-failed", {
    requestName: t,
    serverCode: r.code,
    serverMessage: r.message,
    serverStatus: r.status,
  });
}
function N5({ apiKey: t }) {
  return new Headers({
    "Content-Type": "application/json",
    Accept: "application/json",
    "x-goog-api-key": t,
  });
}
function Jme(t, { refreshToken: e }) {
  const n = N5(t);
  return n.append("Authorization", e1e(e)), n;
}
async function F5(t) {
  const e = await t();
  return e.status >= 500 && e.status < 600 ? t() : e;
}
function Qme(t) {
  return Number(t.replace("s", "000"));
}
function e1e(t) {
  return `${R5} ${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 t1e(
  { appConfig: t, heartbeatServiceProvider: e },
  { fid: n }
) {
  const r = D5(t),
    i = N5(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: R5, appId: t.appId, sdkVersion: O5 },
    a = { method: "POST", headers: i, body: JSON.stringify(s) },
    l = await F5(() => fetch(r, a));
  if (l.ok) {
    const c = await l.json();
    return {
      fid: c.fid || n,
      registrationStatus: 2,
      refreshToken: c.refreshToken,
      authToken: B5(c.authToken),
    };
  } else throw await k5("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 L5(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 n1e(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 r1e = /^[cdef][\w-]{21}$/,
  wx = "";
function i1e() {
  try {
    const t = new Uint8Array(17);
    (self.crypto || self.msCrypto).getRandomValues(t),
      (t[0] = 112 + (t[0] % 16));
    const n = o1e(t);
    return r1e.test(n) ? n : wx;
  } catch {
    return wx;
  }
}
function o1e(t) {
  return n1e(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 Em(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 $5 = new Map();
function U5(t, e) {
  const n = Em(t);
  G5(n, e), s1e(n, e);
}
function G5(t, e) {
  const n = $5.get(t);
  if (n) for (const r of n) r(e);
}
function s1e(t, e) {
  const n = a1e();
  n && n.postMessage({ key: t, fid: e }), l1e();
}
let qa = null;
function a1e() {
  return (
    !qa &&
      "BroadcastChannel" in self &&
      ((qa = new BroadcastChannel("[Firebase] FID Change")),
      (qa.onmessage = (t) => {
        G5(t.data.key, t.data.fid);
      })),
    qa
  );
}
function l1e() {
  $5.size === 0 && qa && (qa.close(), (qa = 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 c1e = "firebase-installations-database",
  u1e = 1,
  Tl = "firebase-installations-store";
let mv = null;
function z2() {
  return (
    mv ||
      (mv = wm(c1e, u1e, {
        upgrade: (t, e) => {
          switch (e) {
            case 0:
              t.createObjectStore(Tl);
          }
        },
      })),
    mv
  );
}
async function V0(t, e) {
  const n = Em(t),
    i = (await z2()).transaction(Tl, "readwrite"),
    o = i.objectStore(Tl),
    s = await o.get(n);
  return (
    await o.put(e, n), await i.done, (!s || s.fid !== e.fid) && U5(t, e.fid), e
  );
}
async function H5(t) {
  const e = Em(t),
    r = (await z2()).transaction(Tl, "readwrite");
  await r.objectStore(Tl).delete(e), await r.done;
}
async function Sm(t, e) {
  const n = Em(t),
    i = (await z2()).transaction(Tl, "readwrite"),
    o = i.objectStore(Tl),
    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) && U5(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 j2(t) {
  let e;
  const n = await Sm(t.appConfig, (r) => {
    const i = f1e(r),
      o = d1e(t, i);
    return (e = o.registrationPromise), o.installationEntry;
  });
  return n.fid === wx
    ? { installationEntry: await e }
    : { installationEntry: n, registrationPromise: e };
}
function f1e(t) {
  const e = t || { fid: i1e(), registrationStatus: 0 };
  return V5(e);
}
function d1e(t, e) {
  if (e.registrationStatus === 0) {
    if (!navigator.onLine) {
      const i = Promise.reject(Al.create("app-offline"));
      return { installationEntry: e, registrationPromise: i };
    }
    const n = {
        fid: e.fid,
        registrationStatus: 1,
        registrationTime: Date.now(),
      },
      r = h1e(t, n);
    return { installationEntry: n, registrationPromise: r };
  } else
    return e.registrationStatus === 1
      ? { installationEntry: e, registrationPromise: p1e(t) }
      : { installationEntry: e };
}
async function h1e(t, e) {
  try {
    const n = await t1e(t, e);
    return V0(t.appConfig, n);
  } catch (n) {
    throw (
      (M5(n) && n.customData.serverCode === 409
        ? await H5(t.appConfig)
        : await V0(t.appConfig, { fid: e.fid, registrationStatus: 0 }),
      n)
    );
  }
}
async function p1e(t) {
  let e = await tP(t.appConfig);
  for (; e.registrationStatus === 1; )
    await L5(100), (e = await tP(t.appConfig));
  if (e.registrationStatus === 0) {
    const { installationEntry: n, registrationPromise: r } = await j2(t);
    return r || n;
  }
  return e;
}
function tP(t) {
  return Sm(t, (e) => {
    if (!e) throw Al.create("installation-not-found");
    return V5(e);
  });
}
function V5(t) {
  return g1e(t) ? { fid: t.fid, registrationStatus: 0 } : t;
}
function g1e(t) {
  return t.registrationStatus === 1 && t.registrationTime + I5 < 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 m1e({ appConfig: t, heartbeatServiceProvider: e }, n) {
  const r = v1e(t, n),
    i = Jme(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: O5, appId: t.appId } },
    a = { method: "POST", headers: i, body: JSON.stringify(s) },
    l = await F5(() => fetch(r, a));
  if (l.ok) {
    const c = await l.json();
    return B5(c);
  } else throw await k5("Generate Auth Token", l);
}
function v1e(t, { fid: e }) {
  return `${D5(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 W2(t, e = !1) {
  let n;
  const r = await Sm(t.appConfig, (o) => {
    if (!z5(o)) throw Al.create("not-registered");
    const s = o.authToken;
    if (!e && x1e(s)) return o;
    if (s.requestStatus === 1) return (n = y1e(t, e)), o;
    {
      if (!navigator.onLine) throw Al.create("app-offline");
      const a = w1e(o);
      return (n = _1e(t, a)), a;
    }
  });
  return n ? await n : r.authToken;
}
async function y1e(t, e) {
  let n = await nP(t.appConfig);
  for (; n.authToken.requestStatus === 1; )
    await L5(100), (n = await nP(t.appConfig));
  const r = n.authToken;
  return r.requestStatus === 0 ? W2(t, e) : r;
}
function nP(t) {
  return Sm(t, (e) => {
    if (!z5(e)) throw Al.create("not-registered");
    const n = e.authToken;
    return E1e(n)
      ? Object.assign(Object.assign({}, e), { authToken: { requestStatus: 0 } })
      : e;
  });
}
async function _1e(t, e) {
  try {
    const n = await m1e(t, e),
      r = Object.assign(Object.assign({}, e), { authToken: n });
    return await V0(t.appConfig, r), n;
  } catch (n) {
    if (
      M5(n) &&
      (n.customData.serverCode === 401 || n.customData.serverCode === 404)
    )
      await H5(t.appConfig);
    else {
      const r = Object.assign(Object.assign({}, e), {
        authToken: { requestStatus: 0 },
      });
      await V0(t.appConfig, r);
    }
    throw n;
  }
}
function z5(t) {
  return t !== void 0 && t.registrationStatus === 2;
}
function x1e(t) {
  return t.requestStatus === 2 && !b1e(t);
}
function b1e(t) {
  const e = Date.now();
  return e < t.creationTime || t.creationTime + t.expiresIn < e + Xme;
}
function w1e(t) {
  const e = { requestStatus: 1, requestTime: Date.now() };
  return Object.assign(Object.assign({}, t), { authToken: e });
}
function E1e(t) {
  return t.requestStatus === 1 && t.requestTime + I5 < 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 S1e(t) {
  const e = t,
    { installationEntry: n, registrationPromise: r } = await j2(e);
  return r ? r.catch(console.error) : W2(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 C1e(t, e = !1) {
  const n = t;
  return await A1e(n), (await W2(n, e)).token;
}
async function A1e(t) {
  const { registrationPromise: e } = await j2(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 T1e(t) {
  if (!t || !t.options) throw vv("App Configuration");
  if (!t.name) throw vv("App Name");
  const e = ["projectId", "apiKey", "appId"];
  for (const n of e) if (!t.options[n]) throw vv(n);
  return {
    appName: t.name,
    projectId: t.options.projectId,
    apiKey: t.options.apiKey,
    appId: t.options.appId,
  };
}
function vv(t) {
  return Al.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 j5 = "installations",
  P1e = "installations-internal",
  I1e = (t) => {
    const e = t.getProvider("app").getImmediate(),
      n = T1e(e),
      r = dh(e, "heartbeat");
    return {
      app: e,
      appConfig: n,
      heartbeatServiceProvider: r,
      _delete: () => Promise.resolve(),
    };
  },
  O1e = (t) => {
    const e = t.getProvider("app").getImmediate(),
      n = dh(e, j5).getImmediate();
    return { getId: () => S1e(n), getToken: (i) => C1e(n, i) };
  };
function R1e() {
  hs(new bo(j5, I1e, "PUBLIC")), hs(new bo(P1e, O1e, "PRIVATE"));
}
R1e();
ho(P5, V2);
ho(P5, V2, "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 z0 = "analytics",
  M1e = "firebase_id",
  D1e = "origin",
  B1e = 60 * 1e3,
  k1e =
    "https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",
  Y2 = "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 Or = new w5("@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 N1e = {
    "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 uh("analytics", "Analytics", N1e);
/**
 * @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 F1e(t) {
  if (!t.startsWith(Y2)) {
    const e = jr.create("invalid-gtag-resource", { gtagURL: t });
    return Or.warn(e.message), "";
  }
  return t;
}
function W5(t) {
  return Promise.all(t.map((e) => e.catch((n) => n)));
}
function L1e(t, e) {
  let n;
  return window.trustedTypes && (n = window.trustedTypes.createPolicy(t, e)), n;
}
function $1e(t, e) {
  const n = L1e("firebase-js-sdk-policy", { createScriptURL: F1e }),
    r = document.createElement("script"),
    i = `${Y2}?l=${t}&id=${e}`;
  (r.src = n ? (n == null ? void 0 : n.createScriptURL(i)) : i),
    (r.async = !0),
    document.head.appendChild(r);
}
function U1e(t) {
  let e = [];
  return Array.isArray(window[t]) ? (e = window[t]) : (window[t] = e), e;
}
async function G1e(t, e, n, r, i, o) {
  const s = r[i];
  try {
    if (s) await e[s];
    else {
      const l = (await W5(n)).find((c) => c.measurementId === i);
      l && (await e[l.appId]);
    }
  } catch (a) {
    Or.error(a);
  }
  t("config", i, o);
}
async function H1e(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 W5(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) {
    Or.error(o);
  }
}
function V1e(t, e, n, r) {
  async function i(o, ...s) {
    try {
      if (o === "event") {
        const [a, l] = s;
        await H1e(t, e, n, a, l);
      } else if (o === "config") {
        const [a, l] = s;
        await G1e(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) {
      Or.error(a);
    }
  }
  return i;
}
function z1e(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] = V1e(o, t, e, n)),
    { gtagCore: o, wrappedGtag: window[i] }
  );
}
function j1e(t) {
  const e = window.document.getElementsByTagName("script");
  for (const n of Object.values(e))
    if (n.src && n.src.includes(Y2) && 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 W1e = 30,
  Y1e = 1e3;
class X1e {
  constructor(e = {}, n = Y1e) {
    (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 Y5 = new X1e();
function K1e(t) {
  return new Headers({ Accept: "application/json", "x-goog-api-key": t });
}
async function q1e(t) {
  var e;
  const { appId: n, apiKey: r } = t,
    i = { method: "GET", headers: K1e(r) },
    o = k1e.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 Z1e(t, e = Y5, 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 eve();
  return (
    setTimeout(
      async () => {
        a.abort();
      },
      n !== void 0 ? n : B1e
    ),
    X5({ appId: r, apiKey: i, measurementId: o }, s, a, e)
  );
}
async function X5(t, { throttleEndTimeMillis: e, backoffCount: n }, r, i = Y5) {
  var o;
  const { appId: s, measurementId: a } = t;
  try {
    await J1e(r, e);
  } catch (l) {
    if (a)
      return (
        Or.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 q1e(t);
    return i.deleteThrottleMetadata(s), l;
  } catch (l) {
    const c = l;
    if (!Q1e(c)) {
      if ((i.deleteThrottleMetadata(s), a))
        return (
          Or.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
          ? W3(n, i.intervalMillis, W1e)
          : W3(n, i.intervalMillis),
      f = { throttleEndTimeMillis: Date.now() + u, backoffCount: n + 1 };
    return (
      i.setThrottleMetadata(s, f),
      Or.debug(`Calling attemptFetch again in ${u} millis`),
      X5(t, f, r, i)
    );
  }
}
function J1e(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 Q1e(t) {
  if (!(t instanceof Gl) || !t.customData) return !1;
  const e = Number(t.customData.httpStatus);
  return e === 429 || e === 500 || e === 503 || e === 504;
}
class eve {
  constructor() {
    this.listeners = [];
  }
  addEventListener(e) {
    this.listeners.push(e);
  }
  abort() {
    this.listeners.forEach((e) => e());
  }
}
async function tve(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 nve() {
  if (U2())
    try {
      await G2();
    } catch (t) {
      return (
        Or.warn(
          jr.create("indexeddb-unavailable", {
            errorInfo: t == null ? void 0 : t.toString(),
          }).message
        ),
        !1
      );
    }
  else
    return (
      Or.warn(
        jr.create("indexeddb-unavailable", {
          errorInfo: "IndexedDB is not available in this environment.",
        }).message
      ),
      !1
    );
  return !0;
}
async function rve(t, e, n, r, i, o, s) {
  var a;
  const l = Z1e(t);
  l
    .then((h) => {
      (n[h.measurementId] = h.appId),
        t.options.measurementId &&
          h.measurementId !== t.options.measurementId &&
          Or.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) => Or.error(h)),
    e.push(l);
  const c = nve().then((h) => {
      if (h) return r.getId();
    }),
    [u, f] = await Promise.all([l, c]);
  j1e(o) || $1e(o, u.measurementId), i("js", new Date());
  const d =
    (a = s == null ? void 0 : s.config) !== null && a !== void 0 ? a : {};
  return (
    (d[D1e] = "firebase"),
    (d.update = !0),
    f != null && (d[M1e] = 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 ive {
  constructor(e) {
    this.app = e;
  }
  _delete() {
    return delete Uf[this.app.options.appId], Promise.resolve();
  }
}
let Uf = {},
  rP = [];
const iP = {};
let yv = "dataLayer",
  ove = "gtag",
  oP,
  K5,
  sP = !1;
function sve() {
  const t = [];
  if (
    (Oge() && t.push("This is a browser extension environment."),
    b5() || 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 });
    Or.warn(n.message);
  }
}
function ave(t, e, n) {
  sve();
  const r = t.options.appId;
  if (!r) throw jr.create("no-app-id");
  if (!t.options.apiKey)
    if (t.options.measurementId)
      Or.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 (Uf[r] != null) throw jr.create("already-exists", { id: r });
  if (!sP) {
    U1e(yv);
    const { wrappedGtag: o, gtagCore: s } = z1e(Uf, rP, iP, yv, ove);
    (K5 = o), (oP = s), (sP = !0);
  }
  return (Uf[r] = rve(t, rP, iP, e, oP, yv, n)), new ive(t);
}
function ZPe(t = C5()) {
  t = fh(t);
  const e = dh(t, z0);
  return e.isInitialized() ? e.getImmediate() : lve(t);
}
function lve(t, e = {}) {
  const n = dh(t, z0);
  if (n.isInitialized()) {
    const i = n.getImmediate();
    if (G0(e, n.getOptions())) return i;
    throw jr.create("already-initialized");
  }
  return n.initialize({ options: e });
}
function cve(t, e, n, r) {
  (t = fh(t)),
    tve(K5, Uf[t.app.options.appId], e, n, r).catch((i) => Or.error(i));
}
const aP = "@firebase/analytics",
  lP = "0.10.17";
function uve() {
  hs(
    new bo(
      z0,
      (e, { options: n }) => {
        const r = e.getProvider("app").getImmediate(),
          i = e.getProvider("installations-internal").getImmediate();
        return ave(r, i, n);
      },
      "PUBLIC"
    )
  ),
    hs(new bo("analytics-internal", t, "PRIVATE")),
    ho(aP, lP),
    ho(aP, lP, "esm2017");
  function t(e) {
    try {
      const n = e.getProvider(z0).getImmediate();
      return { logEvent: (r, i, o) => cve(n, r, i, o) };
    } catch (n) {
      throw jr.create("interop-component-reg-failed", { reason: n });
    }
  }
}
uve();
/**
 * @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 fve = "/firebase-messaging-sw.js",
  dve = "/firebase-cloud-messaging-push-scope",
  q5 =
    "BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",
  hve = "https://fcmregistrations.googleapis.com/v1",
  Z5 = "google.c.a.c_id",
  pve = "google.c.a.c_l",
  gve = "google.c.a.ts",
  mve = "google.c.a.e",
  cP = 1e4;
var uP;
(function (t) {
  (t[(t.DATA_MESSAGE = 1)] = "DATA_MESSAGE"),
    (t[(t.DISPLAY_NOTIFICATION = 3)] = "DISPLAY_NOTIFICATION");
})(uP || (uP = {}));
/**
 * @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 Cd;
(function (t) {
  (t.PUSH_RECEIVED = "push-received"),
    (t.NOTIFICATION_CLICKED = "notification-clicked");
})(Cd || (Cd = {}));
/**
 * @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 Fo(t) {
  const e = new Uint8Array(t);
  return btoa(String.fromCharCode(...e))
    .replace(/=/g, "")
    .replace(/\+/g, "-")
    .replace(/\//g, "_");
}
function vve(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 _v = "fcm_token_details_db",
  yve = 5,
  fP = "fcm_token_object_Store";
async function _ve(t) {
  if (
    "databases" in indexedDB &&
    !(await indexedDB.databases()).map((o) => o.name).includes(_v)
  )
    return null;
  let e = null;
  return (
    (
      await wm(_v, yve, {
        upgrade: async (r, i, o, s) => {
          var a;
          if (i < 2 || !r.objectStoreNames.contains(fP)) return;
          const l = s.objectStore(fP),
            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 : Fo(u.vapidKey),
                },
              };
            } else if (i === 3) {
              const u = c;
              e = {
                token: u.fcmToken,
                createTime: u.createTime,
                subscriptionOptions: {
                  auth: Fo(u.auth),
                  p256dh: Fo(u.p256dh),
                  endpoint: u.endpoint,
                  swScope: u.swScope,
                  vapidKey: Fo(u.vapidKey),
                },
              };
            } else if (i === 4) {
              const u = c;
              e = {
                token: u.fcmToken,
                createTime: u.createTime,
                subscriptionOptions: {
                  auth: Fo(u.auth),
                  p256dh: Fo(u.p256dh),
                  endpoint: u.endpoint,
                  swScope: u.swScope,
                  vapidKey: Fo(u.vapidKey),
                },
              };
            }
          }
        },
      })
    ).close(),
    await hv(_v),
    await hv("fcm_vapid_details_db"),
    await hv("undefined"),
    xve(e) ? e : null
  );
}
function xve(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 bve = "firebase-messaging-database",
  wve = 1,
  Ad = "firebase-messaging-store";
let xv = null;
function J5() {
  return (
    xv ||
      (xv = wm(bve, wve, {
        upgrade: (t, e) => {
          switch (e) {
            case 0:
              t.createObjectStore(Ad);
          }
        },
      })),
    xv
  );
}
async function Eve(t) {
  const e = Q5(t),
    r = await (await J5()).transaction(Ad).objectStore(Ad).get(e);
  if (r) return r;
  {
    const i = await _ve(t.appConfig.senderId);
    if (i) return await X2(t, i), i;
  }
}
async function X2(t, e) {
  const n = Q5(t),
    i = (await J5()).transaction(Ad, "readwrite");
  return await i.objectStore(Ad).put(e, n), await i.done, e;
}
function Q5({ 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 Sve = {
    "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.",
  },
  er = new uh("messaging", "Messaging", Sve);
/**
 * @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 Cve(t, e) {
  const n = await q2(t),
    r = e9(e),
    i = { method: "POST", headers: n, body: JSON.stringify(r) };
  let o;
  try {
    o = await (await fetch(K2(t.appConfig), i)).json();
  } catch (s) {
    throw er.create("token-subscribe-failed", {
      errorInfo: s == null ? void 0 : s.toString(),
    });
  }
  if (o.error) {
    const s = o.error.message;
    throw er.create("token-subscribe-failed", { errorInfo: s });
  }
  if (!o.token) throw er.create("token-subscribe-no-token");
  return o.token;
}
async function Ave(t, e) {
  const n = await q2(t),
    r = e9(e.subscriptionOptions),
    i = { method: "PATCH", headers: n, body: JSON.stringify(r) };
  let o;
  try {
    o = await (await fetch(`${K2(t.appConfig)}/${e.token}`, i)).json();
  } catch (s) {
    throw er.create("token-update-failed", {
      errorInfo: s == null ? void 0 : s.toString(),
    });
  }
  if (o.error) {
    const s = o.error.message;
    throw er.create("token-update-failed", { errorInfo: s });
  }
  if (!o.token) throw er.create("token-update-no-token");
  return o.token;
}
async function Tve(t, e) {
  const r = { method: "DELETE", headers: await q2(t) };
  try {
    const o = await (await fetch(`${K2(t.appConfig)}/${e}`, r)).json();
    if (o.error) {
      const s = o.error.message;
      throw er.create("token-unsubscribe-failed", { errorInfo: s });
    }
  } catch (i) {
    throw er.create("token-unsubscribe-failed", {
      errorInfo: i == null ? void 0 : i.toString(),
    });
  }
}
function K2({ projectId: t }) {
  return `${hve}/projects/${t}/registrations`;
}
async function q2({ 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 e9({ p256dh: t, auth: e, endpoint: n, vapidKey: r }) {
  const i = { web: { endpoint: n, auth: e, p256dh: t } };
  return r !== q5 && (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 Pve = 7 * 24 * 60 * 60 * 1e3;
async function Ive(t) {
  const e = await Rve(t.swRegistration, t.vapidKey),
    n = {
      vapidKey: t.vapidKey,
      swScope: t.swRegistration.scope,
      endpoint: e.endpoint,
      auth: Fo(e.getKey("auth")),
      p256dh: Fo(e.getKey("p256dh")),
    },
    r = await Eve(t.firebaseDependencies);
  if (r) {
    if (Mve(r.subscriptionOptions, n))
      return Date.now() >= r.createTime + Pve
        ? Ove(t, {
            token: r.token,
            createTime: Date.now(),
            subscriptionOptions: n,
          })
        : r.token;
    try {
      await Tve(t.firebaseDependencies, r.token);
    } catch (i) {
      console.warn(i);
    }
    return dP(t.firebaseDependencies, n);
  } else return dP(t.firebaseDependencies, n);
}
async function Ove(t, e) {
  try {
    const n = await Ave(t.firebaseDependencies, e),
      r = Object.assign(Object.assign({}, e), {
        token: n,
        createTime: Date.now(),
      });
    return await X2(t.firebaseDependencies, r), n;
  } catch (n) {
    throw n;
  }
}
async function dP(t, e) {
  const r = {
    token: await Cve(t, e),
    createTime: Date.now(),
    subscriptionOptions: e,
  };
  return await X2(t, r), r.token;
}
async function Rve(t, e) {
  const n = await t.pushManager.getSubscription();
  return (
    n ||
    t.pushManager.subscribe({
      userVisibleOnly: !0,
      applicationServerKey: vve(e),
    })
  );
}
function Mve(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 hP(t) {
  const e = {
    from: t.from,
    collapseKey: t.collapse_key,
    messageId: t.fcmMessageId,
  };
  return Dve(e, t), Bve(e, t), kve(e, t), e;
}
function Dve(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 Bve(t, e) {
  e.data && (t.data = e.data);
}
function kve(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 Nve(t) {
  return typeof t == "object" && !!t && Z5 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.
 */ Fve("AzSCbw63g1R0nCw85jG8", "Iaya3yLKwmgvh7cF0q4");
function Fve(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 Lve(t) {
  if (!t || !t.options) throw bv("App Configuration Object");
  if (!t.name) throw bv("App Name");
  const e = ["projectId", "apiKey", "appId", "messagingSenderId"],
    { options: n } = t;
  for (const r of e) if (!n[r]) throw bv(r);
  return {
    appName: t.name,
    projectId: n.projectId,
    apiKey: n.apiKey,
    appId: n.appId,
    senderId: n.messagingSenderId,
  };
}
function bv(t) {
  return er.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 $ve {
  constructor(e, n, r) {
    (this.deliveryMetricsExportedToBigQueryEnabled = !1),
      (this.onBackgroundMessageHandler = null),
      (this.onMessageHandler = null),
      (this.logEvents = []),
      (this.isLogServiceStarted = !1);
    const i = Lve(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 Uve(t) {
  try {
    (t.swRegistration = await navigator.serviceWorker.register(fve, {
      scope: dve,
    })),
      t.swRegistration.update().catch(() => {}),
      await Gve(t.swRegistration);
  } catch (e) {
    throw er.create("failed-service-worker-registration", {
      browserErrorMessage: e == null ? void 0 : e.message,
    });
  }
}
async function Gve(t) {
  return new Promise((e, n) => {
    const r = setTimeout(
        () => n(new Error(`Service worker not registered after ${cP} ms`)),
        cP
      ),
      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 Hve(t, e) {
  if ((!e && !t.swRegistration && (await Uve(t)), !(!e && t.swRegistration))) {
    if (!(e instanceof ServiceWorkerRegistration))
      throw er.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 Vve(t, e) {
  e ? (t.vapidKey = e) : t.vapidKey || (t.vapidKey = q5);
}
/**
 * @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 t9(t, e) {
  if (!navigator) throw er.create("only-available-in-window");
  if (
    (Notification.permission === "default" &&
      (await Notification.requestPermission()),
    Notification.permission !== "granted")
  )
    throw er.create("permission-blocked");
  return (
    await Vve(t, e == null ? void 0 : e.vapidKey),
    await Hve(t, e == null ? void 0 : e.serviceWorkerRegistration),
    Ive(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 zve(t, e, n) {
  const r = jve(e);
  (await t.firebaseDependencies.analyticsProvider.get()).logEvent(r, {
    message_id: n[Z5],
    message_name: n[pve],
    message_time: n[gve],
    message_device_time: Math.floor(Date.now() / 1e3),
  });
}
function jve(t) {
  switch (t) {
    case Cd.NOTIFICATION_CLICKED:
      return "notification_open";
    case Cd.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 Wve(t, e) {
  const n = e.data;
  if (!n.isFirebaseMessaging) return;
  t.onMessageHandler &&
    n.messageType === Cd.PUSH_RECEIVED &&
    (typeof t.onMessageHandler == "function"
      ? t.onMessageHandler(hP(n))
      : t.onMessageHandler.next(hP(n)));
  const r = n.data;
  Nve(r) && r[mve] === "1" && (await zve(t, n.messageType, r));
}
const pP = "@firebase/messaging",
  gP = "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 Yve = (t) => {
    const e = new $ve(
      t.getProvider("app").getImmediate(),
      t.getProvider("installations-internal").getImmediate(),
      t.getProvider("analytics-internal")
    );
    return (
      navigator.serviceWorker.addEventListener("message", (n) => Wve(e, n)), e
    );
  },
  Xve = (t) => {
    const e = t.getProvider("messaging").getImmediate();
    return { getToken: (r) => t9(e, r) };
  };
function Kve() {
  hs(new bo("messaging", Yve, "PUBLIC")),
    hs(new bo("messaging-internal", Xve, "PRIVATE")),
    ho(pP, gP),
    ho(pP, gP, "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 qve() {
  try {
    await G2();
  } catch {
    return !1;
  }
  return (
    typeof window < "u" &&
    U2() &&
    b5() &&
    "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 Zve(t, e) {
  if (!navigator) throw er.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 JPe(t = C5()) {
  return (
    qve().then(
      (e) => {
        if (!e) throw er.create("unsupported-browser");
      },
      (e) => {
        throw er.create("indexed-db-unsupported");
      }
    ),
    dh(fh(t), "messaging").getImmediate()
  );
}
async function QPe(t, e) {
  return (t = fh(t)), t9(t, e);
}
function eIe(t, e) {
  return (t = fh(t)), Zve(t, e);
}
Kve();
$e.add(oce);
$e.mixin(Xr, sce);
$e.add(IB);
$e.add(OB);
$e.add(ok);
$e.mixin(Xr, Lde);
$e.add(ik);
$e.add(FN);
$e.add(v2);
$e.add(UN);
$e.add(HN);
$e.add(VN);
$e.add(t5);
$e.add(e5);
$e.add(qN);
$e.add(QN);
$e.add(ZN);
$e.add(KN);
$e.add(XN);
$e.add(uk);
$e.add(ck);
const Jve = Object.freeze(
    Object.defineProperty({ __proto__: null }, Symbol.toStringTag, {
      value: "Module",
    })
  ),
  Qve = Object.freeze(
    Object.defineProperty({ __proto__: null }, Symbol.toStringTag, {
      value: "Module",
    })
  );
var hh = {},
  eye = function () {
    return (
      typeof Promise == "function" &&
      Promise.prototype &&
      Promise.prototype.then
    );
  },
  n9 = {},
  Qr = {};
let Z2;
const tye = [
  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 tye[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.');
  Z2 = e;
};
Qr.isKanjiModeEnabled = function () {
  return typeof Z2 < "u";
};
Qr.toSJIS = function (e) {
  return Z2(e);
};
var Cm = {};
(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;
      }
    });
})(Cm);
function r9() {
  (this.buffer = []), (this.length = 0);
}
r9.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 nye = r9;
function ph(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));
}
ph.prototype.set = function (t, e, n, r) {
  const i = t * this.size + e;
  (this.data[i] = n), r && (this.reservedBit[i] = !0);
};
ph.prototype.get = function (t, e) {
  return this.data[t * this.size + e];
};
ph.prototype.xor = function (t, e, n) {
  this.data[t * this.size + e] ^= n;
};
ph.prototype.isReserved = function (t, e) {
  return this.reservedBit[t * this.size + e];
};
var rye = ph,
  i9 = {};
(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;
    });
})(i9);
var o9 = {};
const iye = Qr.getSymbolSize,
  mP = 7;
o9.getPositions = function (e) {
  const n = iye(e);
  return [
    [0, 0],
    [n - mP, 0],
    [0, n - mP],
  ];
};
var s9 = {};
(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;
    });
})(s9);
var Am = {};
const Gs = Cm,
  _p = [
    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,
  ],
  xp = [
    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,
  ];
Am.getBlocksCount = function (e, n) {
  switch (n) {
    case Gs.L:
      return _p[(e - 1) * 4 + 0];
    case Gs.M:
      return _p[(e - 1) * 4 + 1];
    case Gs.Q:
      return _p[(e - 1) * 4 + 2];
    case Gs.H:
      return _p[(e - 1) * 4 + 3];
    default:
      return;
  }
};
Am.getTotalCodewordsCount = function (e, n) {
  switch (n) {
    case Gs.L:
      return xp[(e - 1) * 4 + 0];
    case Gs.M:
      return xp[(e - 1) * 4 + 1];
    case Gs.Q:
      return xp[(e - 1) * 4 + 2];
    case Gs.H:
      return xp[(e - 1) * 4 + 3];
    default:
      return;
  }
};
var a9 = {},
  Tm = {};
const Gf = new Uint8Array(512),
  j0 = new Uint8Array(256);
(function () {
  let e = 1;
  for (let n = 0; n < 255; n++)
    (Gf[n] = e), (j0[e] = n), (e <<= 1), e & 256 && (e ^= 285);
  for (let n = 255; n < 512; n++) Gf[n] = Gf[n - 255];
})();
Tm.log = function (e) {
  if (e < 1) throw new Error("log(" + e + ")");
  return j0[e];
};
Tm.exp = function (e) {
  return Gf[e];
};
Tm.mul = function (e, n) {
  return e === 0 || n === 0 ? 0 : Gf[j0[e] + j0[n]];
};
(function (t) {
  const e = Tm;
  (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;
    });
})(a9);
const l9 = a9;
function J2(t) {
  (this.genPoly = void 0),
    (this.degree = t),
    this.degree && this.initialize(this.degree);
}
J2.prototype.initialize = function (e) {
  (this.degree = e), (this.genPoly = l9.generateECPolynomial(this.degree));
};
J2.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 = l9.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 oye = J2,
  c9 = {},
  xa = {},
  Q2 = {};
Q2.isValid = function (e) {
  return !isNaN(e) && e >= 1 && e <= 40;
};
var Ao = {};
const u9 = "[0-9]+",
  sye = "[A-Z $%*+\\-./:]+";
let Td =
  "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
Td = Td.replace(/u/g, "\\u");
const aye =
  "(?:(?![A-Z0-9 $%*+\\-./:]|" +
  Td +
  `)(?:.|[\r
]))+`;
Ao.KANJI = new RegExp(Td, "g");
Ao.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
Ao.BYTE = new RegExp(aye, "g");
Ao.NUMERIC = new RegExp(u9, "g");
Ao.ALPHANUMERIC = new RegExp(sye, "g");
const lye = new RegExp("^" + Td + "$"),
  cye = new RegExp("^" + u9 + "$"),
  uye = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
Ao.testKanji = function (e) {
  return lye.test(e);
};
Ao.testNumeric = function (e) {
  return cye.test(e);
};
Ao.testAlphanumeric = function (e) {
  return uye.test(e);
};
(function (t) {
  const e = Q2,
    n = Ao;
  (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;
    }
  };
})(xa);
(function (t) {
  const e = Qr,
    n = Am,
    r = Cm,
    i = xa,
    o = Q2,
    s = 7973,
    a = e.getBCHDigit(s);
  function l(d, h, p) {
    for (let g = 1; g <= 40; g++) if (h <= t.getCapacity(g, p, d)) return g;
  }
  function c(d, h) {
    return i.getCharCountIndicator(d, h) + 4;
  }
  function u(d, h) {
    let p = 0;
    return (
      d.forEach(function (g) {
        const m = c(g.mode, h);
        p += m + g.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, g) {
      if (!o.isValid(h)) throw new Error("Invalid QR Code version");
      typeof g > "u" && (g = i.BYTE);
      const m = e.getSymbolTotalCodewords(h),
        v = n.getTotalCodewordsCount(h, p),
        y = (m - v) * 8;
      if (g === i.MIXED) return y;
      const _ = y - c(g, h);
      switch (g) {
        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 g;
      const m = r.from(p, r.M);
      if (Array.isArray(h)) {
        if (h.length > 1) return f(h, m);
        if (h.length === 0) return 1;
        g = h[0];
      } else g = h;
      return l(g.mode, g.getLength(), m);
    }),
    (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;
    });
})(c9);
var f9 = {};
const Ex = Qr,
  d9 = 1335,
  fye = 21522,
  vP = Ex.getBCHDigit(d9);
f9.getEncodedBits = function (e, n) {
  const r = (e.bit << 3) | n;
  let i = r << 10;
  for (; Ex.getBCHDigit(i) - vP >= 0; ) i ^= d9 << (Ex.getBCHDigit(i) - vP);
  return ((r << 10) | i) ^ fye;
};
var h9 = {};
const dye = xa;
function ru(t) {
  (this.mode = dye.NUMERIC), (this.data = t.toString());
}
ru.getBitsLength = function (e) {
  return 10 * Math.floor(e / 3) + (e % 3 ? (e % 3) * 3 + 1 : 0);
};
ru.prototype.getLength = function () {
  return this.data.length;
};
ru.prototype.getBitsLength = function () {
  return ru.getBitsLength(this.data.length);
};
ru.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 hye = ru;
const pye = xa,
  wv = [
    "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 iu(t) {
  (this.mode = pye.ALPHANUMERIC), (this.data = t);
}
iu.getBitsLength = function (e) {
  return 11 * Math.floor(e / 2) + 6 * (e % 2);
};
iu.prototype.getLength = function () {
  return this.data.length;
};
iu.prototype.getBitsLength = function () {
  return iu.getBitsLength(this.data.length);
};
iu.prototype.write = function (e) {
  let n;
  for (n = 0; n + 2 <= this.data.length; n += 2) {
    let r = wv.indexOf(this.data[n]) * 45;
    (r += wv.indexOf(this.data[n + 1])), e.put(r, 11);
  }
  this.data.length % 2 && e.put(wv.indexOf(this.data[n]), 6);
};
var gye = iu;
const mye = xa;
function ou(t) {
  (this.mode = mye.BYTE),
    typeof t == "string"
      ? (this.data = new TextEncoder().encode(t))
      : (this.data = new Uint8Array(t));
}
ou.getBitsLength = function (e) {
  return e * 8;
};
ou.prototype.getLength = function () {
  return this.data.length;
};
ou.prototype.getBitsLength = function () {
  return ou.getBitsLength(this.data.length);
};
ou.prototype.write = function (t) {
  for (let e = 0, n = this.data.length; e < n; e++) t.put(this.data[e], 8);
};
var vye = ou;
const yye = xa,
  _ye = Qr;
function su(t) {
  (this.mode = yye.KANJI), (this.data = t);
}
su.getBitsLength = function (e) {
  return e * 13;
};
su.prototype.getLength = function () {
  return this.data.length;
};
su.prototype.getBitsLength = function () {
  return su.getBitsLength(this.data.length);
};
su.prototype.write = function (t) {
  let e;
  for (e = 0; e < this.data.length; e++) {
    let n = _ye.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 xye = su,
  p9 = { 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, g, m; !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),
            (g = s[u]),
            (m = typeof s[u] > "u"),
            (m || g > p) && ((s[u] = p), a.push(u, p), (o[u] = c)));
      }
      if (typeof i < "u" && typeof s[i] > "u") {
        var v = ["Could not find a path from ", r, " to ", i, "."].join("");
        throw new Error(v);
      }
      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;
})(p9);
var bye = p9.exports;
(function (t) {
  const e = xa,
    n = hye,
    r = gye,
    i = vye,
    o = xye,
    s = Ao,
    a = Qr,
    l = bye;
  function c(v) {
    return unescape(encodeURIComponent(v)).length;
  }
  function u(v, y, _) {
    const x = [];
    let b;
    for (; (b = v.exec(_)) !== null; )
      x.push({ data: b[0], index: b.index, mode: y, length: b[0].length });
    return x;
  }
  function f(v) {
    const y = u(s.NUMERIC, e.NUMERIC, v),
      _ = u(s.ALPHANUMERIC, e.ALPHANUMERIC, v);
    let x, b;
    return (
      a.isKanjiModeEnabled()
        ? ((x = u(s.BYTE, e.BYTE, v)), (b = u(s.KANJI, e.KANJI, v)))
        : ((x = u(s.BYTE_KANJI, e.BYTE, v)), (b = [])),
      y
        .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(v, y) {
    switch (y) {
      case e.NUMERIC:
        return n.getBitsLength(v);
      case e.ALPHANUMERIC:
        return r.getBitsLength(v);
      case e.KANJI:
        return o.getBitsLength(v);
      case e.BYTE:
        return i.getBitsLength(v);
    }
  }
  function h(v) {
    return v.reduce(function (y, _) {
      const x = y.length - 1 >= 0 ? y[y.length - 1] : null;
      return x && x.mode === _.mode
        ? ((y[y.length - 1].data += _.data), y)
        : (y.push(_), y);
    }, []);
  }
  function p(v) {
    const y = [];
    for (let _ = 0; _ < v.length; _++) {
      const x = v[_];
      switch (x.mode) {
        case e.NUMERIC:
          y.push([
            x,
            { data: x.data, mode: e.ALPHANUMERIC, length: x.length },
            { data: x.data, mode: e.BYTE, length: x.length },
          ]);
          break;
        case e.ALPHANUMERIC:
          y.push([x, { data: x.data, mode: e.BYTE, length: x.length }]);
          break;
        case e.KANJI:
          y.push([x, { data: x.data, mode: e.BYTE, length: c(x.data) }]);
          break;
        case e.BYTE:
          y.push([{ data: x.data, mode: e.BYTE, length: c(x.data) }]);
      }
    }
    return y;
  }
  function g(v, y) {
    const _ = {},
      x = { start: {} };
    let b = ["start"];
    for (let w = 0; w < v.length; w++) {
      const E = v[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, y)));
        }
      }
      b = S;
    }
    for (let w = 0; w < b.length; w++) x[b[w]].end = 0;
    return { map: x, table: _ };
  }
  function m(v, y) {
    let _;
    const x = e.getBestModeForData(v);
    if (((_ = e.from(y, x)), _ !== e.BYTE && _.bit < x.bit))
      throw new Error(
        '"' +
          v +
          '" 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(v);
      case e.ALPHANUMERIC:
        return new r(v);
      case e.KANJI:
        return new o(v);
      case e.BYTE:
        return new i(v);
    }
  }
  (t.fromArray = function (y) {
    return y.reduce(function (_, x) {
      return (
        typeof x == "string"
          ? _.push(m(x, null))
          : x.data && _.push(m(x.data, x.mode)),
        _
      );
    }, []);
  }),
    (t.fromString = function (y, _) {
      const x = f(y, a.isKanjiModeEnabled()),
        b = p(x),
        w = g(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 (y) {
      return t.fromArray(f(y, a.isKanjiModeEnabled()));
    });
})(h9);
const Pm = Qr,
  Ev = Cm,
  wye = nye,
  Eye = rye,
  Sye = i9,
  Cye = o9,
  Sx = s9,
  Cx = Am,
  Aye = oye,
  W0 = c9,
  Tye = f9,
  Pye = xa,
  Sv = h9;
function Iye(t, e) {
  const n = t.size,
    r = Cye.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 Oye(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 Rye(t, e) {
  const n = Sye.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 Mye(t, e) {
  const n = t.size,
    r = W0.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 Cv(t, e, n) {
  const r = t.size,
    i = Tye.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 Dye(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 Bye(t, e, n) {
  const r = new wye();
  n.forEach(function (l) {
    r.put(l.mode.bit, 4),
      r.put(l.getLength(), Pye.getCharCountIndicator(l.mode, t)),
      l.write(r);
  });
  const i = Pm.getSymbolTotalCodewords(t),
    o = Cx.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 kye(r, t, e);
}
function kye(t, e, n) {
  const r = Pm.getSymbolTotalCodewords(e),
    i = Cx.getTotalCodewordsCount(e, n),
    o = r - i,
    s = Cx.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 Aye(d);
  let p = 0;
  const g = new Array(s),
    m = new Array(s);
  let v = 0;
  const y = new Uint8Array(t.buffer);
  for (let E = 0; E < s; E++) {
    const S = E < l ? u : f;
    (g[E] = y.slice(p, p + S)),
      (m[E] = h.encode(g[E])),
      (p += S),
      (v = Math.max(v, S));
  }
  const _ = new Uint8Array(r);
  let x = 0,
    b,
    w;
  for (b = 0; b < v; b++)
    for (w = 0; w < s; w++) b < g[w].length && (_[x++] = g[w][b]);
  for (b = 0; b < d; b++) for (w = 0; w < s; w++) _[x++] = m[w][b];
  return _;
}
function Nye(t, e, n, r) {
  let i;
  if (Array.isArray(t)) i = Sv.fromArray(t);
  else if (typeof t == "string") {
    let c = e;
    if (!c) {
      const u = Sv.rawSplit(t);
      c = W0.getBestVersionForData(u, n);
    }
    i = Sv.fromString(t, c || 40);
  } else throw new Error("Invalid data");
  const o = W0.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 = Bye(e, n, i),
    a = Pm.getSymbolSize(e),
    l = new Eye(a);
  return (
    Iye(l, e),
    Oye(l),
    Rye(l, e),
    Cv(l, n, 0),
    e >= 7 && Mye(l, e),
    Dye(l, s),
    isNaN(r) && (r = Sx.getBestMask(l, Cv.bind(null, l, n))),
    Sx.applyMask(r, l),
    Cv(l, n, r),
    {
      modules: l,
      version: e,
      errorCorrectionLevel: n,
      maskPattern: r,
      segments: i,
    }
  );
}
n9.create = function (e, n) {
  if (typeof e > "u" || e === "") throw new Error("No input text");
  let r = Ev.M,
    i,
    o;
  return (
    typeof n < "u" &&
      ((r = Ev.from(n.errorCorrectionLevel, Ev.M)),
      (i = W0.from(n.version)),
      (o = Sx.from(n.maskPattern)),
      n.toSJISFunc && Pm.setToSJISFunction(n.toSJISFunc)),
    Nye(e, i, r, o)
  );
};
var g9 = {},
  eE = {};
(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,
            g = o.color.light;
          if (d >= u && h >= u && d < c - u && h < c - u) {
            const m = Math.floor((d - u) / l),
              v = Math.floor((h - u) / l);
            g = f[a[m * s + v] ? 1 : 0];
          }
          (r[p++] = g.r), (r[p++] = g.g), (r[p++] = g.b), (r[p] = g.a);
        }
    });
})(eE);
(function (t) {
  const e = eE;
  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);
    });
})(g9);
var m9 = {};
const Fye = eE;
function yP(t, e) {
  const n = t.a / 255,
    r = e + '="' + t.hex + '"';
  return n < 1 ? r + " " + e + '-opacity="' + n.toFixed(2).slice(1) + '"' : r;
}
function Av(t, e, n) {
  let r = t + e;
  return typeof n < "u" && (r += " " + n), r;
}
function Lye(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 ? Av("M", l + n, 0.5 + c + n) : Av("m", i, 0)),
            (i = 0),
            (o = !1)),
          (l + 1 < e && t[a + 1]) || ((r += Av("h", s)), (s = 0)))
        : i++;
  }
  return r;
}
m9.render = function (e, n, r) {
  const i = Fye.getOptions(n),
    o = e.modules.size,
    s = e.modules.data,
    a = o + i.margin * 2,
    l = i.color.light.a
      ? "<path " +
        yP(i.color.light, "fill") +
        ' d="M0 0h' +
        a +
        "v" +
        a +
        'H0z"/>'
      : "",
    c =
      "<path " +
      yP(i.color.dark, "stroke") +
      ' d="' +
      Lye(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 $ye = eye,
  Ax = n9,
  v9 = g9,
  Uye = m9;
function tE(t, e, n, r, i) {
  const o = [].slice.call(arguments, 1),
    s = o.length,
    a = typeof o[s - 1] == "function";
  if (!a && !$ye()) 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 = Ax.create(n, r);
          l(t(u, e, r));
        } catch (u) {
          c(u);
        }
      })
    );
  }
  try {
    const l = Ax.create(n, r);
    i(null, t(l, e, r));
  } catch (l) {
    i(l);
  }
}
hh.create = Ax.create;
hh.toCanvas = tE.bind(null, v9.render);
hh.toDataURL = tE.bind(null, v9.renderToDataURL);
hh.toString = tE.bind(null, function (t, e, n) {
  return Uye.render(t, n);
});
function tIe(t, e) {
  const n = N6(t),
    r = Z("");
  return (
    ve(
      n,
      async (i) => {
        n.value && aa && (r.value = await hh.toDataURL(i, e));
      },
      { immediate: !0 }
    ),
    r
  );
}
function _P(t) {
  return (
    t !== null &&
    typeof t == "object" &&
    "constructor" in t &&
    t.constructor === Object
  );
}
function nE(t = {}, e = {}) {
  Object.keys(e).forEach((n) => {
    typeof t[n] > "u"
      ? (t[n] = e[n])
      : _P(e[n]) && _P(t[n]) && Object.keys(e[n]).length > 0 && nE(t[n], e[n]);
  });
}
const y9 = {
  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 tr() {
  const t = typeof document < "u" ? document : {};
  return nE(t, y9), t;
}
const Gye = {
  document: y9,
  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 Ln() {
  const t = typeof window < "u" ? window : {};
  return nE(t, Gye), t;
}
function Hye(t) {
  const e = t.__proto__;
  Object.defineProperty(t, "__proto__", {
    get() {
      return e;
    },
    set(n) {
      e.__proto__ = n;
    },
  });
}
class Hs extends Array {
  constructor(e) {
    typeof e == "number" ? super(e) : (super(...(e || [])), Hye(this));
  }
}
function gh(t = []) {
  const e = [];
  return (
    t.forEach((n) => {
      Array.isArray(n) ? e.push(...gh(n)) : e.push(n);
    }),
    e
  );
}
function _9(t, e) {
  return Array.prototype.filter.call(t, e);
}
function Vye(t) {
  const e = [];
  for (let n = 0; n < t.length; n += 1) e.indexOf(t[n]) === -1 && e.push(t[n]);
  return e;
}
function zye(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 = Ln(),
    r = tr();
  let i = [];
  if (!e && t instanceof Hs) return t;
  if (!t) return new Hs(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 = zye(t.trim(), e || r);
  } else if (t.nodeType || t === n || t === r) i.push(t);
  else if (Array.isArray(t)) {
    if (t instanceof Hs) return t;
    i = t;
  }
  return new Hs(Vye(i));
}
Ie.fn = Hs.prototype;
function jye(...t) {
  const e = gh(t.map((n) => n.split(" ")));
  return (
    this.forEach((n) => {
      n.classList.add(...e);
    }),
    this
  );
}
function Wye(...t) {
  const e = gh(t.map((n) => n.split(" ")));
  return (
    this.forEach((n) => {
      n.classList.remove(...e);
    }),
    this
  );
}
function Yye(...t) {
  const e = gh(t.map((n) => n.split(" ")));
  this.forEach((n) => {
    e.forEach((r) => {
      n.classList.toggle(r);
    });
  });
}
function Xye(...t) {
  const e = gh(t.map((n) => n.split(" ")));
  return (
    _9(this, (n) => e.filter((r) => n.classList.contains(r)).length > 0)
      .length > 0
  );
}
function Kye(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 qye(t) {
  for (let e = 0; e < this.length; e += 1) this[e].removeAttribute(t);
  return this;
}
function Zye(t) {
  for (let e = 0; e < this.length; e += 1) this[e].style.transform = t;
  return this;
}
function Jye(t) {
  for (let e = 0; e < this.length; e += 1)
    this[e].style.transitionDuration = typeof t != "string" ? `${t}ms` : t;
  return this;
}
function Qye(...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 e_e(...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 t_e(...t) {
  const e = Ln(),
    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 n_e(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 r_e(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 i_e(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 o_e() {
  if (this.length > 0) {
    const t = Ln(),
      e = tr(),
      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 s_e() {
  const t = Ln();
  return this[0] ? t.getComputedStyle(this[0], null) : {};
}
function a_e(t, e) {
  const n = Ln();
  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 l_e(t) {
  return t
    ? (this.forEach((e, n) => {
        t.apply(e, [e, n]);
      }),
      this)
    : this;
}
function c_e(t) {
  const e = _9(this, t);
  return Ie(e);
}
function u_e(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 f_e(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 d_e(t) {
  const e = Ln(),
    n = tr(),
    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 Hs) {
    for (i = t.nodeType ? [t] : t, o = 0; o < i.length; o += 1)
      if (i[o] === r) return !0;
    return !1;
  }
  return !1;
}
function h_e() {
  let t = this[0],
    e;
  if (t) {
    for (e = 0; (t = t.previousSibling) !== null; )
      t.nodeType === 1 && (e += 1);
    return e;
  }
}
function p_e(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 g_e(...t) {
  let e;
  const n = tr();
  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 Hs)
        for (let o = 0; o < e.length; o += 1) this[i].appendChild(e[o]);
      else this[i].appendChild(e);
  }
  return this;
}
function m_e(t) {
  const e = tr();
  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 Hs)
      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 v_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 y_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 __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 x_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 b_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 w_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 E_e(t) {
  let e = this;
  return typeof t > "u" ? Ie([]) : (e.is(t) || (e = e.parents(t).eq(0)), e);
}
function S_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 C_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 A_e() {
  for (let t = 0; t < this.length; t += 1)
    this[t].parentNode && this[t].parentNode.removeChild(this[t]);
  return this;
}
const xP = {
  addClass: jye,
  removeClass: Wye,
  hasClass: Xye,
  toggleClass: Yye,
  attr: Kye,
  removeAttr: qye,
  transform: Zye,
  transition: Jye,
  on: Qye,
  off: e_e,
  trigger: t_e,
  transitionEnd: n_e,
  outerWidth: r_e,
  outerHeight: i_e,
  styles: s_e,
  offset: o_e,
  css: a_e,
  each: l_e,
  html: u_e,
  text: f_e,
  is: d_e,
  index: h_e,
  eq: p_e,
  append: g_e,
  prepend: m_e,
  next: v_e,
  nextAll: y_e,
  prev: __e,
  prevAll: x_e,
  parent: b_e,
  parents: w_e,
  closest: E_e,
  find: S_e,
  children: C_e,
  filter: c_e,
  remove: A_e,
};
Object.keys(xP).forEach((t) => {
  Object.defineProperty(Ie.fn, t, { value: xP[t], writable: !0 });
});
function T_e(t) {
  const e = t;
  Object.keys(e).forEach((n) => {
    try {
      e[n] = null;
    } catch {}
    try {
      delete e[n];
    } catch {}
  });
}
function Y0(t, e = 0) {
  return setTimeout(t, e);
}
function Pd() {
  return Date.now();
}
function P_e(t) {
  const e = Ln();
  let n;
  return (
    e.getComputedStyle && (n = e.getComputedStyle(t, null)),
    !n && t.currentStyle && (n = t.currentStyle),
    n || (n = t.style),
    n
  );
}
function I_e(t, e = "x") {
  const n = Ln();
  let r, i, o;
  const s = P_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 bp(t) {
  return (
    typeof t == "object" &&
    t !== null &&
    t.constructor &&
    Object.prototype.toString.call(t).slice(8, -1) === "Object"
  );
}
function O_e(t) {
  return typeof window < "u" && typeof window.HTMLElement < "u"
    ? t instanceof HTMLElement
    : t && (t.nodeType === 1 || t.nodeType === 11);
}
function Ur(...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 && !O_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 &&
          (bp(e[l]) && bp(i[l])
            ? i[l].__swiper__
              ? (e[l] = i[l])
              : Ur(e[l], i[l])
            : !bp(e[l]) && bp(i[l])
            ? ((e[l] = {}), i[l].__swiper__ ? (e[l] = i[l]) : Ur(e[l], i[l]))
            : (e[l] = i[l]));
      }
    }
  }
  return e;
}
function wp(t, e, n) {
  t.style.setProperty(e, n);
}
function x9({ swiper: t, targetPosition: e, side: n }) {
  const r = Ln(),
    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 = 0.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 Tv;
function R_e() {
  const t = Ln(),
    e = tr();
  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 b9() {
  return Tv || (Tv = R_e()), Tv;
}
let Pv;
function M_e({ userAgent: t } = {}) {
  const e = b9(),
    n = Ln(),
    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 D_e(t = {}) {
  return Pv || (Pv = M_e(t)), Pv;
}
let Iv;
function B_e() {
  const t = Ln();
  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 k_e() {
  return Iv || (Iv = B_e()), Iv;
}
function N_e({ swiper: t, on: e, emit: n }) {
  const r = Ln();
  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: g, contentRect: m, target: v }) => {
              (v && v !== t.el) ||
                ((h = m ? m.width : (g[0] || g).inlineSize),
                (p = m ? m.height : (g[0] || g).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 F_e({ swiper: t, extendParams: e, on: n, emit: r }) {
  const i = [],
    o = Ln(),
    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 L_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 $_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 U_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 g = r.slidesOffsetBefore;
  typeof g == "function" && (g = r.slidesOffsetBefore.call(t));
  let m = r.slidesOffsetAfter;
  typeof m == "function" && (m = r.slidesOffsetAfter.call(t));
  const v = t.snapGrid.length,
    y = t.slidesGrid.length;
  let _ = r.spaceBetween,
    x = -g,
    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 &&
      (wp(t.wrapperEl, "--swiper-centered-offset-before", ""),
      wp(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"),
            D = n(T, "padding-left"),
            $ = n(T, "padding-right"),
            z = n(T, "margin-left"),
            K = n(T, "margin-right"),
            fe = T.getPropertyValue("box-sizing");
          if (fe && fe === "border-box") S = G + z + K;
          else {
            const { clientWidth: se, offsetWidth: Y } = A[0];
            S = G + D + $ + z + K + (Y - se);
          }
        }
        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) + m),
    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 ? -g : T > A ? A + m : 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)
  ) {
    wp(t.wrapperEl, "--swiper-centered-offset-before", `${-d[0]}px`),
      wp(
        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 !== v &&
      (t.params.watchOverflow && t.checkOverflow(),
      t.emit("snapGridLengthChange")),
    h.length !== y && 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 G_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 H_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 V_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 z_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 j_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 W_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 Y_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 X_e = {
  updateSize: $_e,
  updateSlides: U_e,
  updateAutoHeight: G_e,
  updateSlidesOffset: H_e,
  updateSlidesProgress: V_e,
  updateProgress: z_e,
  updateSlidesClasses: j_e,
  updateActiveIndex: W_e,
  updateClickedSlide: Y_e,
};
function K_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 = I_e(o[0], t);
  return r && (s = -s), s || 0;
}
function q_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 Z_e() {
  return -this.snapGrid[0];
}
function J_e() {
  return -this.snapGrid[this.snapGrid.length - 1];
}
function Q_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 (
          x9({ 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 exe = {
  getTranslate: K_e,
  setTranslate: q_e,
  minTranslate: Z_e,
  maxTranslate: J_e,
  translateTo: Q_e,
};
function txe(t, e) {
  const n = this;
  n.params.cssMode || n.$wrapperEl.transition(t), n.emit("setTransition", t, e);
}
function w9({ 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 nxe(t = !0, e) {
  const n = this,
    { params: r } = n;
  r.cssMode ||
    (r.autoHeight && n.updateAutoHeight(),
    w9({ swiper: n, runCallbacks: t, direction: e, step: "Start" }));
}
function rxe(t = !0, e) {
  const n = this,
    { params: r } = n;
  (n.animating = !1),
    !r.cssMode &&
      (n.setTransition(0),
      w9({ swiper: n, runCallbacks: t, direction: e, step: "End" }));
}
const ixe = { setTransition: txe, transitionStart: nxe, transitionEnd: rxe };
function oxe(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 g = Math.min(o.params.slidesPerGroupSkip, s);
  let m = g + Math.floor((s - g) / o.params.slidesPerGroup);
  m >= l.length && (m = l.length - 1);
  const v = -l[m];
  if (a.normalizeSlideIndex)
    for (let _ = 0; _ < c.length; _ += 1) {
      const x = -Math.floor(v * 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 && v < o.translate && v < o.minTranslate()) ||
      (!o.allowSlidePrev &&
        v > o.translate &&
        v > o.maxTranslate() &&
        (f || 0) !== s))
  )
    return !1;
  s !== (u || 0) && n && o.emit("beforeSlideChangeStart"), o.updateProgress(v);
  let y;
  if (
    (s > f ? (y = "next") : s < f ? (y = "prev") : (y = "reset"),
    (d && -v === o.translate) || (!d && v === o.translate))
  )
    return (
      o.updateActiveIndex(s),
      a.autoHeight && o.updateAutoHeight(),
      o.updateSlidesClasses(),
      a.effect !== "slide" && o.setTranslate(v),
      y !== "reset" && (o.transitionStart(n, y), o.transitionEnd(n, y)),
      !1
    );
  if (a.cssMode) {
    const _ = o.isHorizontal(),
      x = d ? v : -v;
    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 (
          x9({ swiper: o, targetPosition: x, side: _ ? "left" : "top" }), !0
        );
      h.scrollTo({ [_ ? "left" : "top"]: x, behavior: "smooth" });
    }
    return !0;
  }
  return (
    o.setTransition(e),
    o.setTranslate(v),
    o.updateActiveIndex(s),
    o.updateSlidesClasses(),
    o.emit("beforeTransitionStart", e, r),
    o.transitionStart(n, y),
    e === 0
      ? o.transitionEnd(n, y)
      : 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, y)));
          }),
        o.$wrapperEl[0].addEventListener(
          "transitionend",
          o.onSlideToWrapperTransitionEnd
        ),
        o.$wrapperEl[0].addEventListener(
          "webkitTransitionEnd",
          o.onSlideToWrapperTransitionEnd
        )),
    !0
  );
}
function sxe(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 axe(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 lxe(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(m) {
    return m < 0 ? -Math.floor(Math.abs(m)) : Math.floor(m);
  }
  const d = f(u),
    h = s.map((m) => f(m));
  let p = s[h.indexOf(d) - 1];
  if (typeof p > "u" && i.cssMode) {
    let m;
    s.forEach((v, y) => {
      d >= v && (m = y);
    }),
      typeof m < "u" && (p = s[m > 0 ? m - 1 : m]);
  }
  let g = 0;
  if (
    (typeof p < "u" &&
      ((g = a.indexOf(p)),
      g < 0 && (g = r.activeIndex - 1),
      i.slidesPerView === "auto" &&
        i.slidesPerGroup === 1 &&
        i.slidesPerGroupAuto &&
        ((g = g - r.slidesPerViewDynamic("previous", !0) + 1),
        (g = Math.max(g, 0)))),
    i.rewind && r.isBeginning)
  ) {
    const m =
      r.params.virtual && r.params.virtual.enabled && r.virtual
        ? r.virtual.slides.length - 1
        : r.slides.length - 1;
    return r.slideTo(m, t, e, n);
  }
  return r.slideTo(g, t, e, n);
}
function cxe(t = this.params.speed, e = !0, n) {
  const r = this;
  return r.slideTo(r.activeIndex, t, e, n);
}
function uxe(t = this.params.speed, e = !0, n, r = 0.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 fxe() {
  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()),
            Y0(() => {
              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()),
          Y0(() => {
            t.slideTo(i);
          }))
        : t.slideTo(i);
  } else t.slideTo(i);
}
const dxe = {
  slideTo: oxe,
  slideToLoop: sxe,
  slideNext: axe,
  slidePrev: lxe,
  slideReset: cxe,
  slideToClosest: uxe,
  slideToClickedSlide: fxe,
};
function hxe() {
  const t = this,
    e = tr(),
    { 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 pxe() {
  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 gxe() {
  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 mxe = { loopCreate: hxe, loopFix: pxe, loopDestroy: gxe };
function vxe(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 yxe() {
  const t = this;
  t.support.touch ||
    (t.params.watchOverflow && t.isLocked) ||
    t.params.cssMode ||
    (t[
      t.params.touchEventsTarget === "container" ? "el" : "wrapperEl"
    ].style.cursor = "");
}
const _xe = { setGrabCursor: vxe, unsetGrabCursor: yxe };
function xxe(t, e = this) {
  function n(r) {
    if (!r || r === tr() || r === Ln()) 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 bxe(t) {
  const e = this,
    n = tr(),
    r = Ln(),
    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 ? xxe(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,
    g = s.currentY,
    m = o.edgeSwipeDetection || o.iOSEdgeSwipeDetection,
    v = o.edgeSwipeThreshold || o.iOSEdgeSwipeThreshold;
  if (m && (p <= v || p >= r.innerWidth - v))
    if (m === "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 = g),
    (i.touchStartTime = Pd()),
    (e.allowClick = !0),
    e.updateSize(),
    (e.swipeDirection = void 0),
    o.threshold > 0 && (i.allowThresholdMove = !1),
    l.type !== "touchstart")
  ) {
    let y = !0;
    c.is(i.focusableElements) &&
      ((y = !1), c[0].nodeName === "SELECT" && (i.isTouched = !1)),
      n.activeElement &&
        Ie(n.activeElement).is(i.focusableElements) &&
        n.activeElement !== c[0] &&
        n.activeElement.blur();
    const _ = y && 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 wxe(t) {
  const e = tr(),
    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 = Pd()));
    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 v;
    (n.isHorizontal() && o.currentY === o.startY) ||
    (n.isVertical() && o.currentX === o.startX)
      ? (r.isScrolling = !1)
      : d * d + h * h >= 25 &&
        ((v = (Math.atan2(Math.abs(h), Math.abs(d)) * 180) / Math.PI),
        (r.isScrolling = n.isHorizontal()
          ? v > i.touchAngle
          : 90 - v > 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 g = !0,
    m = i.resistanceRatio;
  if (
    (i.touchReleaseOnEdges && (m = 0),
    p > 0 && r.currentTranslate > n.minTranslate()
      ? ((g = !1),
        i.resistance &&
          (r.currentTranslate =
            n.minTranslate() -
            1 +
            (-n.minTranslate() + r.startTranslate + p) ** m))
      : p < 0 &&
        r.currentTranslate < n.maxTranslate() &&
        ((g = !1),
        i.resistance &&
          (r.currentTranslate =
            n.maxTranslate() +
            1 -
            (n.maxTranslate() - r.startTranslate - p) ** m)),
    g && (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 Exe(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 = Pd(),
    u = c - n.touchStartTime;
  if (e.allowClick) {
    const y = l.path || (l.composedPath && l.composedPath());
    e.updateClickedSlide((y && y[0]) || l.target),
      e.emit("tap click", l),
      u < 300 &&
        c - n.lastClickTime < 300 &&
        e.emit("doubleTap doubleClick", l);
  }
  if (
    ((n.lastClickTime = Pd()),
    Y0(() => {
      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 y = 0;
    y < s.length;
    y += y < r.slidesPerGroupSkip ? 1 : r.slidesPerGroup
  ) {
    const _ = y < r.slidesPerGroupSkip - 1 ? 1 : r.slidesPerGroup;
    typeof s[y + _] < "u"
      ? f >= s[y] && f < s[y + _] && ((d = y), (h = s[y + _] - s[y]))
      : f >= s[y] && ((d = y), (h = s[s.length - 1] - s[s.length - 2]));
  }
  let p = null,
    g = null;
  r.rewind &&
    (e.isBeginning
      ? (g =
          e.params.virtual && e.params.virtual.enabled && e.virtual
            ? e.virtual.slides.length - 1
            : e.slides.length - 1)
      : e.isEnd && (p = 0));
  const m = (f - s[d]) / h,
    v = d < r.slidesPerGroupSkip - 1 ? 1 : r.slidesPerGroup;
  if (u > r.longSwipesMs) {
    if (!r.longSwipes) {
      e.slideTo(e.activeIndex);
      return;
    }
    e.swipeDirection === "next" &&
      (m >= r.longSwipesRatio
        ? e.slideTo(r.rewind && e.isEnd ? p : d + v)
        : e.slideTo(d)),
      e.swipeDirection === "prev" &&
        (m > 1 - r.longSwipesRatio
          ? e.slideTo(d + v)
          : g !== null && m < 0 && Math.abs(m) > r.longSwipesRatio
          ? e.slideTo(g)
          : 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 + v)
        : e.slideTo(d)
      : (e.swipeDirection === "next" && e.slideTo(p !== null ? p : d + v),
        e.swipeDirection === "prev" && e.slideTo(g !== null ? g : d));
  }
}
function bP() {
  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 Sxe(t) {
  const e = this;
  e.enabled &&
    (e.allowClick ||
      (e.params.preventClicks && t.preventDefault(),
      e.params.preventClicksPropagation &&
        e.animating &&
        (t.stopPropagation(), t.stopImmediatePropagation())));
}
function Cxe() {
  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 wP = !1;
function Axe() {}
const E9 = (t, e) => {
  const n = tr(),
    {
      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",
          bP,
          !0
        )
      : t[f]("observerUpdate", bP, !0);
};
function Txe() {
  const t = this,
    e = tr(),
    { params: n, support: r } = t;
  (t.onTouchStart = bxe.bind(t)),
    (t.onTouchMove = wxe.bind(t)),
    (t.onTouchEnd = Exe.bind(t)),
    n.cssMode && (t.onScroll = Cxe.bind(t)),
    (t.onClick = Sxe.bind(t)),
    r.touch && !wP && (e.addEventListener("touchstart", Axe), (wP = !0)),
    E9(t, "on");
}
function Pxe() {
  E9(this, "off");
}
const Ixe = { attachEvents: Txe, detachEvents: Pxe },
  EP = (t, e) => t.grid && e.grid && e.grid.rows > 1;
function Oxe() {
  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 = EP(t, i),
    f = EP(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((m) => {
      const v = i[m] && i[m].enabled,
        y = c[m] && c[m].enabled;
      v && !y && t[m].disable(), !v && y && t[m].enable();
    });
  const h = c.direction && c.direction !== i.direction,
    p = i.loop && (c.slidesPerView !== i.slidesPerView || h);
  h && n && t.changeDirection(), Ur(t.params, c);
  const g = t.params.enabled;
  Object.assign(t, {
    allowTouchMove: t.params.allowTouchMove,
    allowSlideNext: t.params.allowSlideNext,
    allowSlidePrev: t.params.allowSlidePrev,
  }),
    d && !g ? t.disable() : !d && g && 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 Rxe(t, e = "window", n) {
  if (!t || (e === "container" && !n)) return;
  let r = !1;
  const i = Ln(),
    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 Mxe = { setBreakpoint: Oxe, getBreakpoint: Rxe };
function Dxe(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 Bxe() {
  const t = this,
    { classNames: e, params: n, rtl: r, $el: i, device: o, support: s } = t,
    a = Dxe(
      [
        "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 kxe() {
  const t = this,
    { $el: e, classNames: n } = t;
  e.removeClass(n.join(" ")), t.emitContainerClasses();
}
const Nxe = { addClasses: Bxe, removeClasses: kxe };
function Fxe(t, e, n, r, i, o) {
  const s = Ln();
  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 Lxe() {
  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 $xe = { loadImage: Fxe, preloadImages: Lxe };
function Uxe() {
  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 Gxe = { checkOverflow: Uxe },
  SP = {
    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: 0.5,
    longSwipesMs: 300,
    followFinger: !0,
    allowTouchMove: !0,
    threshold: 0,
    touchMoveStopPropagation: !1,
    touchStartPreventDefault: !0,
    touchStartForcePreventDefault: !1,
    touchReleaseOnEdges: !1,
    uniqueNavElements: !0,
    resistance: !0,
    resistanceRatio: 0.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 Hxe(t, e) {
  return function (r = {}) {
    const i = Object.keys(r)[0],
      o = r[i];
    if (typeof o != "object" || o === null) {
      Ur(e, r);
      return;
    }
    if (
      (["navigation", "pagination", "scrollbar"].indexOf(i) >= 0 &&
        t[i] === !0 &&
        (t[i] = { auto: !0 }),
      !(i in t && "enabled" in o))
    ) {
      Ur(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 }),
      Ur(e, r);
  };
}
const Ov = {
    eventsEmitter: L_e,
    update: X_e,
    translate: exe,
    transition: ixe,
    slide: dxe,
    loop: mxe,
    grabCursor: _xe,
    events: Ixe,
    breakpoints: Mxe,
    checkOverflow: Gxe,
    classes: Nxe,
    images: $xe,
  },
  Rv = {};
let au = class No {
  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 = Ur({}, r)),
      n && !r.el && (r.el = n),
      r.el && Ie(r.el).length > 1)
    ) {
      const a = [];
      return (
        Ie(r.el).each((l) => {
          const c = Ur({}, r, { el: l });
          a.push(new No(c));
        }),
        a
      );
    }
    const i = this;
    (i.__swiper__ = !0),
      (i.support = b9()),
      (i.device = D_e({ userAgent: r.userAgent })),
      (i.browser = k_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: Hxe(r, o),
        on: i.on.bind(i),
        once: i.once.bind(i),
        off: i.off.bind(i),
        emit: i.emit.bind(i),
      });
    });
    const s = Ur({}, SP, o);
    return (
      (i.params = Ur({}, s, Rv, r)),
      (i.originalParams = Ur({}, i.params)),
      (i.passedParams = Ur({}, 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: Pd(),
          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 = tr().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), T_e(r)),
        (r.destroyed = !0)),
      null
    );
  }
  static extendDefaults(e) {
    Ur(Rv, e);
  }
  static get extendedDefaults() {
    return Rv;
  }
  static get defaults() {
    return SP;
  }
  static installModule(e) {
    No.prototype.__modules__ || (No.prototype.__modules__ = []);
    const n = No.prototype.__modules__;
    typeof e == "function" && n.indexOf(e) < 0 && n.push(e);
  }
  static use(e) {
    return Array.isArray(e)
      ? (e.forEach((n) => No.installModule(n)), No)
      : (No.installModule(e), No);
  }
};
Object.keys(Ov).forEach((t) => {
  Object.keys(Ov[t]).forEach((e) => {
    au.prototype[e] = Ov[t][e];
  });
});
au.use([N_e, F_e]);
function nIe({ 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 g = t.slides.eq(t.activeIndex);
    let m = t.params.autoplay.delay;
    g.attr("data-swiper-autoplay") &&
      (m = g.attr("data-swiper-autoplay") || t.params.autoplay.delay),
      clearTimeout(i),
      (i = Y0(() => {
        let v;
        t.params.autoplay.reverseDirection
          ? t.params.loop
            ? (t.loopFix(),
              (v = t.slidePrev(t.params.speed, !0, !0)),
              r("autoplay"))
            : t.isBeginning
            ? t.params.autoplay.stopOnLastSlide
              ? a()
              : ((v = t.slideTo(t.slides.length - 1, t.params.speed, !0, !0)),
                r("autoplay"))
            : ((v = t.slidePrev(t.params.speed, !0, !0)), r("autoplay"))
          : t.params.loop
          ? (t.loopFix(),
            (v = t.slideNext(t.params.speed, !0, !0)),
            r("autoplay"))
          : t.isEnd
          ? t.params.autoplay.stopOnLastSlide
            ? a()
            : ((v = t.slideTo(0, t.params.speed, !0, !0)), r("autoplay"))
          : ((v = t.slideNext(t.params.speed, !0, !0)), r("autoplay")),
          ((t.params.cssMode && t.autoplay.running) || v === !1) && o();
      }, m));
  }
  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(g) {
    t.autoplay.running &&
      (t.autoplay.paused ||
        (i && clearTimeout(i),
        (t.autoplay.paused = !0),
        g === 0 || !t.params.autoplay.waitForTransition
          ? ((t.autoplay.paused = !1), o())
          : ["transitionend", "webkitTransitionEnd"].forEach((m) => {
              t.$wrapperEl[0].addEventListener(m, u);
            })));
  }
  function c() {
    const g = tr();
    g.visibilityState === "hidden" && t.autoplay.running && l(),
      g.visibilityState === "visible" &&
        t.autoplay.paused &&
        (o(), (t.autoplay.paused = !1));
  }
  function u(g) {
    !t ||
      t.destroyed ||
      !t.$wrapperEl ||
      (g.target === t.$wrapperEl[0] &&
        (["transitionend", "webkitTransitionEnd"].forEach((m) => {
          t.$wrapperEl[0].removeEventListener(m, u);
        }),
        (t.autoplay.paused = !1),
        t.autoplay.running ? o() : a()));
  }
  function f() {
    t.params.autoplay.disableOnInteraction ? a() : (r("autoplayPause"), l()),
      ["transitionend", "webkitTransitionEnd"].forEach((g) => {
        t.$wrapperEl[0].removeEventListener(g, 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(), tr().addEventListener("visibilitychange", c), h());
  }),
    n("beforeTransitionStart", (g, m, v) => {
      t.autoplay.running &&
        (v || !t.params.autoplay.disableOnInteraction
          ? t.autoplay.pause(m)
          : 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(),
        tr().removeEventListener("visibilitychange", c);
    }),
    Object.assign(t.autoplay, { pause: l, run: o, start: s, stop: a });
}
function Pl(t) {
  return (
    typeof t == "object" &&
    t !== null &&
    t.constructor &&
    Object.prototype.toString.call(t).slice(8, -1) === "Object"
  );
}
function Vs(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])
        : Pl(e[r]) && Pl(t[r]) && Object.keys(e[r]).length > 0
        ? e[r].__swiper__
          ? (t[r] = e[r])
          : Vs(t[r], e[r])
        : (t[r] = e[r]);
    });
}
function S9(t = {}) {
  return (
    t.navigation &&
    typeof t.navigation.nextEl > "u" &&
    typeof t.navigation.prevEl > "u"
  );
}
function C9(t = {}) {
  return t.pagination && typeof t.pagination.el > "u";
}
function A9(t = {}) {
  return t.scrollbar && typeof t.scrollbar.el > "u";
}
function T9(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 P9 = [
  "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 CP(t = {}, e = !0) {
  const n = { on: {} },
    r = {},
    i = {};
  Vs(n, au.defaults),
    Vs(n, au.extendedDefaults),
    (n._emitClasses = !0),
    (n.init = !1);
  const o = {},
    s = P9.map((l) => l.replace(/_/, "")),
    a = Object.assign({}, t);
  return (
    Object.keys(a).forEach((l) => {
      typeof t[l] > "u" ||
        (s.indexOf(l) >= 0
          ? Pl(t[l])
            ? ((n[l] = {}), (i[l] = {}), Vs(n[l], t[l]), Vs(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 Vxe(
  { el: t, nextEl: e, prevEl: n, paginationEl: r, scrollbarEl: i, swiper: o },
  s
) {
  S9(s) &&
    e &&
    n &&
    ((o.params.navigation.nextEl = e),
    (o.originalParams.navigation.nextEl = e),
    (o.params.navigation.prevEl = n),
    (o.originalParams.navigation.prevEl = n)),
    C9(s) &&
      r &&
      ((o.params.pagination.el = r), (o.originalParams.pagination.el = r)),
    A9(s) &&
      i &&
      ((o.params.scrollbar.el = i), (o.originalParams.scrollbar.el = i)),
    o.init(t);
}
const I9 = (t, e) => {
  let n = e.slidesPerView;
  if (e.breakpoints) {
    const i = au.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 zxe(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 = {}),
      Bn(
        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 = Bn("div", { class: `${n.slideClass} ${n.slideBlankClass}` });
        r.push(u);
      }
  }
  n.slidesPerView === "auto" && !n.loopedSlides && (n.loopedSlides = r.length);
  const o = I9(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 jxe(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 (
    P9.filter((l) => l[0] === "_")
      .map((l) => l.replace(/_/, ""))
      .forEach((l) => {
        if (l in t && l in e)
          if (Pl(t[l]) && Pl(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 Mv(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 Wxe({
  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 g, m, v, y, _;
  r.includes("thumbs") &&
    n.thumbs &&
    n.thumbs.swiper &&
    c.thumbs &&
    !c.thumbs.swiper &&
    (g = !0),
    r.includes("controller") &&
      n.controller &&
      n.controller.control &&
      c.controller &&
      !c.controller.control &&
      (m = !0),
    r.includes("pagination") &&
      n.pagination &&
      (n.pagination.el || a) &&
      (c.pagination || c.pagination === !1) &&
      u &&
      !u.el &&
      (v = !0),
    r.includes("scrollbar") &&
      n.scrollbar &&
      (n.scrollbar.el || s) &&
      (c.scrollbar || c.scrollbar === !1) &&
      d &&
      !d.el &&
      (y = !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 (Pl(c[b]) && Pl(n[b])) Vs(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") &&
      !m &&
      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(),
    g && p.init() && p.update(!0),
    m && (t.controller.control = c.controller.control),
    v && (a && (c.pagination.el = a), u.init(), u.render(), u.update()),
    y &&
      (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 Yxe(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),
        Bn(i.type, { ...i.props }, i.children)
      )
    );
}
const Xxe = (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());
  },
  rIe = {
    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: [] },
        g = Z(null),
        m = Z(null),
        v = Z(null),
        y = Z(null),
        { params: _, passedParams: x } = CP(t, !1);
      Mv(n, h, p), (d.value = x), (p.value = h.value);
      const b = () => {
        Mv(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 au(_)),
        (f.value.loopCreate = () => {}),
        (f.value.loopDestroy = () => {}),
        _.loop && (f.value.loopedSlides = I9(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,
        };
        Vs(f.value.params.virtual, E), Vs(f.value.originalParams.virtual, E);
      }
      kl(() => {
        !c.value && f.value && (f.value.emitSlidesClasses(), (c.value = !0));
        const { passedParams: E } = CP(t, !1),
          S = jxe(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 &&
            Wxe({
              swiper: f.value,
              slides: h.value,
              passedParams: E,
              changedParams: S,
              nextEl: g.value,
              prevEl: m.value,
              scrollbarEl: y.value,
              paginationEl: v.value,
            }),
          (l.value = !1);
      }),
        hi("swiper", f),
        ve(a, () => {
          Xe(() => {
            Xxe(f.value);
          });
        }),
        Ht(() => {
          u.value &&
            (Vxe(
              {
                el: u.value,
                nextEl: g.value,
                prevEl: m.value,
                paginationEl: v.value,
                scrollbarEl: y.value,
                swiper: f.value,
              },
              _
            ),
            r("swiper", f.value));
        }),
        qr(() => {
          f.value && !f.value.destroyed && f.value.destroy(!0, !1);
        });
      function w(E) {
        return _.virtual
          ? Yxe(f, E, a.value)
          : !_.loop || (f.value && f.value.destroyed)
          ? (E.forEach((S) => {
              S.props || (S.props = {}), (S.props.swiperRef = f);
            }),
            E)
          : zxe(f, E, _);
      }
      return () => {
        const { slides: E, slots: S } = Mv(n, h, p);
        return Bn(i, { ref: u, class: T9(s.value) }, [
          S["container-start"],
          Bn(o, { class: "swiper-wrapper" }, [
            S["wrapper-start"],
            w(E),
            S["wrapper-end"],
          ]),
          S9(t) && [
            Bn("div", { ref: m, class: "swiper-button-prev" }),
            Bn("div", { ref: g, class: "swiper-button-next" }),
          ],
          A9(t) && Bn("div", { ref: y, class: "swiper-scrollbar" }),
          C9(t) && Bn("div", { ref: v, class: "swiper-pagination" }),
          S["container-end"],
        ]);
      };
    },
  },
  iIe = {
    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));
      }),
        wg(() => {
          r || !i || !i.value || (i.value.on("_slideClass", a), (r = !0));
        }),
        kl(() => {
          !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),
        () =>
          Bn(
            t.tag,
            {
              class: T9(`${s.value}`),
              ref: o,
              "data-swiper-slide-index": t.virtualIndex,
            },
            t.zoom
              ? Bn(
                  "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 Kxe(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 qxe(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 Zxe(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 Lr = { setupDOM: Kxe, onReset: qxe, update: Zxe },
  AP,
  Dv = function (e) {
    return be.pointerEventsEnabled && be.supportsPointerEvents
      ? e.screenY
      : e.touches[0].screenY;
  },
  O9 = 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 = Lr.setupDOM(a)),
          a.shouldPullToRefresh() && (be.pullStartY = Dv(s)),
          clearTimeout(be.timeout),
          Lr.update(a));
    }
    function n(s) {
      if (t && t.ptrElement && be.enable) {
        if (
          (be.pullStartY
            ? (be.pullMoveY = Dv(s))
            : t.shouldPullToRefresh() && (be.pullStartY = Dv(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"),
          Lr.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"),
              Lr.update(t)),
            be.state === "releasing" &&
              be.distResisted < t.distThreshold &&
              (t.ptrElement.classList.remove(t.classPrefix + "release"),
              (be.state = "pulling"),
              Lr.update(t)));
      }
    }
    function r() {
      if (t && t.ptrElement && be.enable) {
        if (
          (clearTimeout(AP),
          (AP = setTimeout(function () {
            t && t.ptrElement && be.state === "pending" && Lr.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 Lr.onReset(t);
              });
              s &&
                typeof s.then == "function" &&
                s.then(function () {
                  return Lr.onReset(t);
                }),
                !s && !t.onRefresh.length && Lr.onReset(t);
            }, t.refreshTimeout));
        else {
          if (be.state === "refreshing") return;
          (t.ptrElement.style[t.cssProp] = "0px"), (be.state = "pending");
        }
        Lr.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);
        },
      }
    );
  },
  Jxe = `
<div class="__PREFIX__box">
  <div class="__PREFIX__content">
    <div class="__PREFIX__icon"></div>
    <div class="__PREFIX__text"></div>
  </div>
</div>
`,
  Qxe = `
.__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);
}
`,
  Bv = {
    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 Jxe;
    },
    getStyles: function () {
      return Qxe;
    },
    onInit: function () {},
    onRefresh: function () {
      return location.reload();
    },
    resistanceFunction: function (t) {
      return Math.min(1, t / 2.5);
    },
    shouldPullToRefresh: function () {
      return !window.scrollY;
    },
  },
  ebe = ["mainElement", "ptrElement", "triggerElement"],
  TP = function (t) {
    var e = {};
    return (
      Object.keys(Bv).forEach(function (n) {
        e[n] = t[n] || Bv[n];
      }),
      (e.refreshTimeout =
        typeof t.refreshTimeout == "number"
          ? t.refreshTimeout
          : Bv.refreshTimeout),
      ebe.forEach(function (n) {
        typeof e[n] == "string" && (e[n] = document.querySelector(e[n]));
      }),
      be.events || (be.events = O9()),
      (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
    );
  },
  tbe = {
    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 = TP(e);
      return be.handlers.push(n), n;
    },
    _: {
      setupHandler: TP,
      setupEvents: O9,
      setupDOM: Lr.setupDOM,
      onReset: Lr.onReset,
      update: Lr.update,
    },
  };
const oIe = tbe;
var R9 = !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 Sr =
  function () {
    return (
      (Sr =
        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;
        }),
      Sr.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 Tx =
  function (t, e) {
    return (
      (Tx =
        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]);
        }),
      Tx(t, e)
    );
  };
function rE(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;
  }
  Tx(t, e),
    (t.prototype =
      e === null ? Object.create(e) : ((n.prototype = e.prototype), new n()));
}
var ts = function () {
  return (
    (ts =
      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;
      }),
    ts.apply(this, arguments)
  );
};
function ns(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 rs(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 Ec(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 Id = 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;
    });
  },
  lu = function (t, e) {
    return Object.prototype.hasOwnProperty.call(t, e);
  },
  iE = function (t) {
    return [].filter
      .call(t, function (e) {
        return (
          e !==
          `
`
        );
      })
      .join("");
  },
  zs = 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
    );
  },
  M9 = 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] = lu(t, c) && Id(t[c], "string", "number") ? e(t[c]) : l[c];
    return [i, o, s, a];
  },
  D9 = 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;
    });
  },
  oE = 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;
  },
  Za = (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
    );
  })(),
  nbe = "__proto__" in {};
function PP(t, e, n, r) {
  Object.defineProperty(t, e, {
    value: n,
    enumerable: !!r,
    writable: !0,
    configurable: !0,
  });
}
var B9 = Array.prototype,
  Jp = Object.create(B9);
["push", "pop", "shift", "unshift", "sort", "splice", "reverse"].forEach(
  function (t) {
    Jp[t] = function () {
      for (var e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n];
      var r = B9[t].apply(this, e),
        i = this.__luckyOb__;
      return (
        ["push", "unshift", "splice"].includes(t) && i.walk(this),
        i.dep.notify(),
        r
      );
    };
  }
);
var rbe = (function () {
  function t(e) {
    (this.dep = new Za()),
      PP(e, "__luckyOb__", this),
      Array.isArray(e) &&
        (nbe
          ? (e.__proto__ = Jp)
          : Object.getOwnPropertyNames(Jp).forEach(function (n) {
              PP(e, n, Jp[n]);
            })),
      this.walk(e);
  }
  return (
    (t.prototype.walk = function (e) {
      Object.keys(e).forEach(function (n) {
        k9(e, n, e[n]);
      });
    }),
    t
  );
})();
function IP(t) {
  if (t && typeof t == "object")
    return "__luckyOb__" in t ? t.__luckyOb__ : new rbe(t);
}
function k9(t, e, n) {
  var r = new Za(),
    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 = IP(n);
    Object.defineProperty(t, e, {
      get: function () {
        var l = o ? o.call(t) : n;
        return (
          Za.target && (r.addSub(Za.target), a && a.dep.addSub(Za.target)), l
        );
      },
      set: function (l) {
        l !== n &&
          ((n = l),
          (o && !s) || (s ? s.call(t, l) : (n = l), (a = IP(l)), r.notify()));
      },
    });
  }
}
var ibe = 0,
  obe = (function () {
    function t(e, n, r, i) {
      i === void 0 && (i = {}),
        (this.id = ibe++),
        (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 () {
        Za.target = this;
        var e = this.getter.call(this.$lucky, this.$lucky);
        return (
          this.deep &&
            (function (n) {
              var r = function (i) {
                Id(i, "array", "object") &&
                  Object.keys(i).forEach(function (o) {
                    var s = i[o];
                    r(s);
                  });
              };
              r(n);
            })(e),
          (Za.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
    );
  })(),
  sE = (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, Ec([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, Ec([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 Id(e, "number")
          ? e
          : Id(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 (
          !lu(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" && k9(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 obe(this, e, n, r);
        return r.immediate && n.call(this, i.value), function () {};
      }),
      (t.version = "1.7.21"),
      t
    );
  })(),
  Ia = function (t) {
    return (Math.PI / 180) * t;
  },
  X0 = 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();
  },
  aE = function (t, e, n, r) {
    return t >= r && (t = r), n * (t /= r) * t + e;
  },
  cu = function (t, e, n, r) {
    return t >= r && (t = r), -n * (t /= r) * (t - 2) + e;
  },
  sbe = (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 (
      rE(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 ts(
            {
              gutter: "0px",
              offsetDegree: 0,
              speed: 20,
              speedFunction: "quad",
              accelerationTime: 2500,
              decelerationTime: 2500,
              stopRange: 0,
            },
            n.defaultConfig
          );
        }),
          this.$computed(this, "_defaultStyle", function () {
            return ts(
              {
                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 ns(this, void 0, void 0, function () {
          var i;
          return rs(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 ns(this, void 0, void 0, function () {
          var o = this;
          return rs(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 ns(o, void 0, void 0, function () {
                          return rs(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;
        zs(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],
                  g = h[1];
                s.save(),
                  a.rotate && s.rotate(Ia(o.rotateDeg)),
                  o.drawImage(s, c, p, g, 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, g, m) {
            return (
              i.drawBlock(p, g, m),
              p - i.getLength(g.padding && g.padding.split(" ")[0])
            );
          }, this.Radius)),
          (this.prizeDeg = 360 / this.prizes.length),
          (this.prizeAng = Ia(this.prizeDeg));
        var u = this.prizeRadius * Math.sin(this.prizeAng / 2) * 2,
          f = Ia(this.rotateDeg - 90 + this.prizeDeg / 2 + l.offsetDegree),
          d = function (p, g) {
            return (
              i.getOffsetX(a.measureText(g).width) + i.getLength(p.left, u)
            );
          },
          h = function (p, g, m) {
            var v = p.lineHeight || c.lineHeight || p.fontSize || c.fontSize;
            return i.getLength(p.top, g) + (m + 1) * i.getLength(v);
          };
        a.save(),
          this.prizes.forEach(function (p, g) {
            var m = f + g * i.prizeAng,
              v = i.prizeRadius - i.maxBtnRadius,
              y = p.background || c.background;
            zs(y) &&
              ((a.fillStyle = y),
              (function (b, w, E, S, P, C) {
                b.beginPath();
                var A,
                  T,
                  I = Ia((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,
                m - i.prizeAng / 2,
                m + i.prizeAng / 2,
                i.getLength(l.gutter)
              ),
              a.fill());
            var _ = Math.cos(m) * i.prizeRadius,
              x = Math.sin(m) * i.prizeRadius;
            a.translate(_, x),
              a.rotate(m + Ia(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,
                        v
                      ),
                      P = S[0],
                      C = S[1],
                      A = [
                        i.getOffsetX(P) + i.getLength(b.left, u),
                        i.getLength(b.top, v),
                      ],
                      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 = lu(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
                    ? oE(
                        a,
                        iE(I),
                        function (B) {
                          var G =
                            (i.prizeRadius - h(b, v, 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, v, G));
                    });
                }),
              a.rotate(Ia(360) - m - Ia(90)),
              a.translate(-_, -x);
          }),
          a.restore(),
          this.buttons.forEach(function (p, g) {
            var m = i.getLength(p.radius, i.prizeRadius);
            (i.maxBtnRadius = Math.max(i.maxBtnRadius, m)),
              zs(p.background) &&
                (a.beginPath(),
                (a.fillStyle = p.background),
                a.arc(0, 0, m, 0, 2 * Math.PI, !1),
                a.fill()),
              p.pointer &&
                zs(p.background) &&
                (a.beginPath(),
                (a.fillStyle = p.background),
                a.moveTo(-m, 0),
                a.lineTo(m, 0),
                a.lineTo(0, 2 * -m),
                a.closePath(),
                a.fill()),
              p.imgs &&
                p.imgs.forEach(function (v, y) {
                  var _ = i.ImageCache.get(v.src);
                  if (_) {
                    var x = i.computedWidthAndHeight(_, v, 2 * m, 2 * m),
                      b = x[0],
                      w = x[1],
                      E = [
                        i.getOffsetX(b) + i.getLength(v.left, m),
                        i.getLength(v.top, m),
                      ],
                      S = E[0],
                      P = E[1];
                    i.drawImage(a, _, S, P, b, w);
                  }
                }),
              p.fonts &&
                p.fonts.forEach(function (v) {
                  var y = v.fontColor || c.fontColor,
                    _ = v.fontWeight || c.fontWeight,
                    x = i.getLength(v.fontSize || c.fontSize),
                    b = v.fontStyle || c.fontStyle;
                  (a.fillStyle = y),
                    (a.font = _ + " " + (x >> 0) + "px " + b),
                    String(v.text)
                      .split(
                        `
`
                      )
                      .forEach(function (w, E) {
                        a.fillText(w, d(v, w), h(v, m, 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 = cu(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 = D9(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 g = aE(d, 0, f, c);
              g === f && (this.step = 2), (p += g % 360);
            } else
              s === 2
                ? ((p += f % 360),
                  a !== void 0 &&
                    a >= 0 &&
                    ((this.step = 3), (this.stopDeg = 0), (this.endDeg = 0)))
                : s === 3
                ? ((p = cu(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 (m, v) {
                return v === a;
              }) || {}
            );
      }),
      (e.prototype.conversionAxis = function (n, r) {
        var i = this.config;
        return [n / i.dpr - this.Radius, r / i.dpr - this.Radius];
      }),
      e
    );
  })(sE),
  abe = (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 (
      rE(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 = ts(
            {
              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 ts(
              {
                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 ts({ 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 ns(this, void 0, void 0, function () {
          var i;
          return rs(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;
        Ec(Ec([], 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 ns(this, void 0, void 0, function () {
          var o = this;
          return rs(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 ns(o, void 0, void 0, function () {
                          var g;
                          return rs(this, function (m) {
                            switch (m.label) {
                              case 0:
                                return typeof (g = u.formatter) != "function"
                                  ? [3, 3]
                                  : [4, Promise.resolve(g.call(this, h))];
                              case 1:
                                return (
                                  (h = m.sent()),
                                  p
                                    ? [4, Promise.resolve(g.call(this, p))]
                                    : [3, 3]
                                );
                              case 2:
                                (p = m.sent()), (m.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 = Ec(Ec([], 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,
                g = f.y,
                m = f.w,
                v = f.h,
                y = M9(d, i.getLength.bind(i)),
                _ = y[0],
                x = y[1],
                b = y[2],
                w = y[3],
                E = d.borderRadius ? i.getLength(d.borderRadius) : 0,
                S = d.background;
              return (
                zs(S) &&
                  ((a.fillStyle = i.handleBackground(p, g, m, v, S)),
                  X0(a, p, g, m, v, 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, m, v),
                        I = T[0],
                        B = T[1],
                        G = [
                          i.getOffsetX(I, m) + i.getLength(P.left, m),
                          i.getLength(P.top, v),
                        ],
                        D = G[0],
                        $ = G[1];
                      i.drawImage(a, A, p + D, g + $, I, B);
                    }
                  }),
                { x: p + b, y: g + _, w: m - b - w, h: v - _ - 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],
              g = h[1],
              m = h[2],
              v = h[3],
              y = !1;
            (i.prizeFlag === void 0 || i.prizeFlag > -1) &&
              (y = d === i.currIndex % i.prizes.length >> 0);
            var _ = y ? u.background : f.background || c.background;
            if (zs(_)) {
              var x = (y ? 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 ? (m -= x[0]) : ((m += x[0]), (p -= x[0])),
                x[1] > 0 ? (v -= x[1]) : ((v += x[1]), (g -= x[1]))),
                (a.fillStyle = i.handleBackground(p, g, m, v, _));
              var b = i.getLength(
                f.borderRadius ? f.borderRadius : c.borderRadius
              );
              X0(a, p, g, m, v, 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 = (y && P) || S;
                    if (C) {
                      var A = i.computedWidthAndHeight(C, w, m, v),
                        T = A[0],
                        I = A[1],
                        B = [
                          p + i.getOffsetX(T, m) + i.getLength(w.left, m),
                          g + i.getLength(w.top, v),
                        ],
                        G = B[0],
                        D = B[1];
                      i.drawImage(a, C, G, D, T, I);
                    }
                  }
                }),
              f.fonts &&
                f.fonts.forEach(function (w) {
                  var E =
                      y && u.fontStyle
                        ? u.fontStyle
                        : w.fontStyle || c.fontStyle,
                    S =
                      y && u.fontWeight
                        ? u.fontWeight
                        : w.fontWeight || c.fontWeight,
                    P =
                      y && u.fontSize
                        ? i.getLength(u.fontSize)
                        : i.getLength(w.fontSize || c.fontSize),
                    C =
                      y && u.lineHeight
                        ? u.lineHeight
                        : w.lineHeight ||
                          c.lineHeight ||
                          w.fontSize ||
                          c.fontSize,
                    A = lu(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 =
                      y && u.fontColor
                        ? u.fontColor
                        : w.fontColor || c.fontColor);
                  var B = [],
                    G = String(w.text);
                  if (A) {
                    var D = i.getLength(T, m);
                    B = oE(
                      a,
                      iE(G),
                      function () {
                        return D;
                      },
                      I
                    );
                  } else
                    B = G.split(`
`);
                  B.forEach(function ($, z) {
                    a.fillText(
                      $,
                      p +
                        i.getOffsetX(a.measureText($).width, m) +
                        i.getLength(w.left, m),
                      g + i.getLength(w.top, v) + (z + 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();
                  }),
                g = p.shift(),
                m = [0, 0, 0, 0];
              if (g.includes("deg")) {
                var v = function (_) {
                  return Math.tan((_ / 180) * Math.PI);
                };
                (g = g.slice(0, -3) % 360) >= 0 && g < 45
                  ? (m = [c, u + d, c + f, u + d - f * v(g - 0)])
                  : g >= 45 && g < 90
                  ? (m = [c, u + d, c + f - d * v(g - 45), u])
                  : g >= 90 && g < 135
                  ? (m = [c + f, u + d, c + f - d * v(g - 90), u])
                  : g >= 135 && g < 180
                  ? (m = [c + f, u + d, c, u + f * v(g - 135)])
                  : g >= 180 && g < 225
                  ? (m = [c + f, u, c, u + f * v(g - 180)])
                  : g >= 225 && g < 270
                  ? (m = [c + f, u, c + d * v(g - 225), u + d])
                  : g >= 270 && g < 315
                  ? (m = [c, u, c + d * v(g - 270), u + d])
                  : g >= 315 &&
                    g < 360 &&
                    (m = [c, u, c + f, u + d - f * v(g - 315)]);
              } else
                g.includes("top")
                  ? (m = [c, u + d, c, u])
                  : g.includes("bottom")
                  ? (m = [c, u, c, u + d])
                  : g.includes("left")
                  ? (m = [c + f, u, c, u])
                  : g.includes("right") && (m = [c, u, c + f, u]);
              var y = l.createLinearGradient.apply(
                l,
                m.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),
                  _
                );
              }, y);
            })(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 = cu(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 = D9(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,
              g = this.currIndex;
            if (s === 1 || h < u) {
              this.FPS = h / n;
              var m = aE(h, 0.1, d - 0.1, u);
              m === d && (this.step = 2), (g += m % a.length);
            } else
              s === 2
                ? ((g += d % a.length),
                  l !== void 0 &&
                    l >= 0 &&
                    ((this.step = 3),
                    (this.stopIndex = 0),
                    (this.endIndex = 0)))
                : s === 3
                ? ((g = cu(p, this.stopIndex, this.endIndex, f)),
                  p >= f && (this.step = 0))
                : this.stop(-1);
            (this.currIndex = g), 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, y) {
                return y === 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
    );
  })(sE),
  lbe = (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 (
      rE(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 = ts(
            {
              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 ts(
              {
                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 ns(this, void 0, void 0, function () {
          var i;
          return rs(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 ns(this, void 0, void 0, function () {
          var o = this;
          return rs(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 ns(o, void 0, void 0, function () {
                          return rs(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;
          }),
          g = 0,
          m = 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;
          (g = Math.max(g, s + d * w)), (m = Math.max(m, a + h * w));
        });
        var v = this.getOffscreenCanvas(g, m),
          y = v._offscreenCanvas,
          _ = v._ctx;
        (this._offscreenCanvas = y),
          this.slots.forEach(function (x, b) {
            var w = u * b,
              E = f * b,
              S = 0,
              P = (function (K, fe) {
                for (var se = {}, Y = [], te = 0; te < K.length; te++)
                  se[te] = K[te];
                for (te = 0; te < fe.length; te++) {
                  var pe = se[fe[te]];
                  pe && (Y[te] = pe);
                }
                return Y;
              })(n.prizes, x.order);
            if (P.length) {
              P.forEach(function (K, fe) {
                if (K) {
                  x.order[fe];
                  var se = d * fe + r.colSpacing / 2,
                    Y = h * fe + r.rowSpacing / 2,
                    te = n.displacement([w, Y, h], [se, E, d]),
                    pe = te[0],
                    F = te[1],
                    J = te[2];
                  S += J;
                  var L = K.background || i.background;
                  if (zs(L)) {
                    var ne = n.getLength(
                      lu(K, "borderRadius") ? K.borderRadius : i.borderRadius
                    );
                    X0(_, pe, F, u, u, ne), (_.fillStyle = L), _.fill();
                  }
                  K.imgs &&
                    K.imgs.forEach(function (ee, de) {
                      var ge = n.ImageCache.get(ee.src);
                      if (ge) {
                        var xe = n.computedWidthAndHeight(ge, ee, u, f),
                          O = xe[0],
                          U = xe[1],
                          W = [
                            pe + n.getOffsetX(O, u) + n.getLength(ee.left, u),
                            F + n.getLength(ee.top, f),
                          ],
                          ce = W[0],
                          ue = W[1];
                        n.drawImage(_, ge, ce, ue, O, U);
                      }
                    }),
                    K.fonts &&
                      K.fonts.forEach(function (ee) {
                        var de = ee.fontStyle || i.fontStyle,
                          ge = ee.fontWeight || i.fontWeight,
                          xe = n.getLength(ee.fontSize || i.fontSize),
                          O =
                            ee.lineHeight ||
                            i.lineHeight ||
                            ee.fontSize ||
                            i.fontSize,
                          U = lu(ee, "wordWrap") ? ee.wordWrap : i.wordWrap,
                          W = ee.lengthLimit || i.lengthLimit,
                          ce = ee.lineClamp || i.lineClamp;
                        (_.font = ge + " " + (xe >> 0) + "px " + de),
                          (_.fillStyle = ee.fontColor || i.fontColor);
                        var ue = [],
                          M = String(ee.text);
                        if (U) {
                          var N = n.getLength(W, u);
                          ue = oE(
                            _,
                            iE(M),
                            function () {
                              return N;
                            },
                            ce
                          );
                        } else
                          ue = M.split(`
`);
                        ue.forEach(function (H, q) {
                          _.fillText(
                            H,
                            pe +
                              n.getOffsetX(_.measureText(H).width, u) +
                              n.getLength(ee.left, u),
                            F +
                              n.getLength(ee.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 < m + S;

              ) {
                var D = n.displacement([A, G], [G, T]),
                  $ = D[0],
                  z = D[1];
                n.drawImage(_, y, A, T, I, B, $, z, 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 = M9(a, n.getLength.bind(n)),
              p = h[0],
              g = h[1],
              m = h[2],
              v = h[3],
              y = a.borderRadius ? n.getLength(a.borderRadius) : 0,
              _ = a.background || o.background;
            return (
              zs(_) && (X0(i, c, u, f, d, y), (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 + m, y: u + p, w: f - m - v, h: d - p - g }
            );
          },
          { 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,
            g = d.cellAndSpacing,
            m = d.widthAndSpacing,
            v = d.heightAndSpacing;
          this.slots.forEach(function (y, _) {
            var x = g * y.order.length,
              b = r.displacement(-(f - v) / 2, -(u - m) / 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 + m * _, c, h, f], [l, c + v * _, u, p]),
              I = T[0],
              B = T[1],
              G = T[2],
              D = T[3];
            r.drawImage(s, r._offscreenCanvas, S, P, C, A, I, B, G, D);
          });
        }
      }),
      (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 (y) {
                    return y === o[l];
                  }),
                  h = s * c.length,
                  p = (n.stopScroll[l] = n.scroll[l]),
                  g = 0;
                ++g;

              ) {
                var m = s * d + h * g * f - p,
                  v = cu(n.FPS, p, m, i.decelerationTime) - p;
                if (Math.abs(v) > u) {
                  n.endScroll[l] = m;
                  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 (!Id(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 g = Date.now() - this.startTime,
              m = 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 || g < h) {
                  o.FPS = g / n;
                  var I = aE(g, 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 && m) {
                  var B = o.stopScroll[w],
                    G = o.endScroll[w];
                  (A = cu(m, B, G, p)), m >= p && (o.step = 0);
                }
                o.scroll[w] = A;
              }
            }),
              this.draw(),
              a(this.run.bind(this, n + 1));
          }
        } else {
          for (var v = c[0], y = 0; y < d.length; y++) {
            var _ = d[y],
              x = c[y];
            if (
              !(!((r = _.order) === null || r === void 0) && r.includes(x)) ||
              v !== x
            ) {
              v = -1;
              break;
            }
          }
          (i = this.endCallback) === null ||
            i === void 0 ||
            i.call(
              this,
              this.prizes.find(function (b, w) {
                return w === v;
              }) || 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
    );
  })(sE),
  lE = 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))),
                Sr(Sr({}, u), (((d = {})[h] = p), d))
              );
            }, {})
          : null;
      })(o),
      l = Sr(Sr(Sr(Sr({}, s), r), i), a);
    return Bn(t, l, n);
  },
  cE = "@lucky-canvas/vue",
  cbe = 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", cE + "@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 sbe(
          {
            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,
          },
          Sr(Sr({}, 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 lE("div", { ref: "myLucky" });
    },
  }),
  ube = 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", cE + "@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 abe(
          {
            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,
          },
          Sr(Sr({}, 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 lE("div", { ref: "myLucky" });
    },
  }),
  fbe = 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", cE + "@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 lbe(
          {
            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,
          },
          Sr(Sr({}, 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 lE("div", { ref: "myLucky" });
    },
  }),
  dbe = function (t) {
    t.component("LuckyWheel", cbe),
      t.component("LuckyGrid", ube),
      t.component("SlotMachine", fbe);
  };
typeof window < "u" && window.Vue && R9 && dbe(window.Vue);
function hbe(t, e) {
  var n = Object.setPrototypeOf;
  n ? n(t, e) : (t.__proto__ = e);
}
function pbe(t, e) {
  e === void 0 && (e = t.constructor);
  var n = Error.captureStackTrace;
  n && n(t, e);
}
var gbe = (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());
    };
  })(),
  mbe = (function (t) {
    gbe(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,
        }),
        hbe(o, i.prototype),
        pbe(o),
        o
      );
    }
    return e;
  })(Error),
  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());
      };
    })(),
  kr = (function (t) {
    vbe(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
    );
  })(mbe),
  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());
      };
    })(),
  rn = (function (t) {
    ybe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (e.kind = "ArgumentException"), e;
  })(kr),
  _be =
    (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());
      };
    })(),
  Ne = (function (t) {
    _be(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (e.kind = "IllegalArgumentException"), e;
  })(kr),
  N9 = (function () {
    function t(e) {
      if (((this.binarizer = e), e === null))
        throw new Ne("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
    );
  })(),
  xbe =
    (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());
      };
    })(),
  dn = (function (t) {
    xbe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (
      (e.getChecksumInstance = function () {
        return new e();
      }),
      (e.kind = "ChecksumException"),
      e
    );
  })(kr),
  bbe = (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
    );
  })(),
  Rt = (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
    );
  })(),
  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());
      };
    })(),
  uE = (function (t) {
    wbe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (e.kind = "IndexOutOfBoundsException"), e;
  })(kr),
  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());
      };
    })(),
  OP = (function (t) {
    Ebe(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;
  })(uE),
  Sbe =
    (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."
      );
    },
  En = (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 Ne("fromIndex(" + n + ") > toIndex(" + r + ")");
        if (n < 0) throw new OP(n);
        if (r > e) throw new OP(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 = Sbe(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 Rt.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
    );
  })(),
  kn = (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);
          Rt.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 Ne();
        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 Ne();
        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 Ne("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 Ne("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 && En.equals(this.bits, n.bits);
      }),
      (t.prototype.hashCode = function () {
        return 31 * this.size + En.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
    );
  })(),
  Px;
(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");
})(Px || (Px = {}));
const Mt = Px;
var 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());
      };
    })(),
  me = (function (t) {
    Cbe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (
      (e.getFormatInstance = function () {
        return new e();
      }),
      (e.kind = "FormatException"),
      e
    );
  })(kr),
  Abe =
    (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 wn = (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 = Abe(s), h = d.next(); !h.done; h = d.next()) {
          var p = h.value;
          t.NAME_TO_ECI.set(p, this);
        }
      } catch (g) {
        i = { error: g };
      } 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
    );
  })(),
  Tbe =
    (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());
      };
    })(),
  Qp = (function (t) {
    Tbe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (e.kind = "UnsupportedOperationException"), e;
  })(kr),
  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 wn ? e : wn.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(wn.UnicodeBigUnmarked))
          return String.fromCharCode.apply(null, new Uint16Array(e.buffer));
        throw new Qp(
          "Encoding " + this.encodingName(n) + " not supported by fallback."
        );
      }),
      (t.isDecodeFallbackSupported = function (e) {
        return (
          e.equals(wn.UTF8) || e.equals(wn.ISO8859_1) || e.equals(wn.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
    );
  })(),
  rt = (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(Mt.CHARACTER_SET) !== void 0)
          return n.get(Mt.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,
            g = 0,
            m = 0,
            v = 0,
            y = 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) && v++),
            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 > g && (g = h))
                : x > 127
                ? (f++, (h = 0), p++, p > m && (m = p))
                : ((h = 0), (p = 0)));
        }
        return (
          s && a > 0 && (s = !1),
          o && f > 0 && (o = !1),
          s && (y || l + c + u > 0)
            ? t.UTF8
            : o && (t.ASSUME_SHIFT_JIS || g >= 3 || m >= 3)
            ? t.SHIFT_JIS
            : i && o
            ? (g === 2 && d === 2) || v * 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 g = parseInt(c), m = c && c[0] + "" == "0" ? "0" : " ";
              p.length < g;

            )
              p = l !== void 0 ? p + m : m + 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 = wn.SJIS.getName()),
      (t.GB2312 = "GB2312"),
      (t.ISO88591 = wn.ISO8859_1.getName()),
      (t.EUC_JP = "EUC_JP"),
      (t.UTF8 = wn.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 += rt.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
    );
  })(),
  wo = (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 Ne("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 Ne("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 Ne("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 Ne("illegal character encountered: " + e.substring(c));
        if (o > s) {
          if (a === -1) a = o - s;
          else if (o - s !== a) throw new Ne("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 Ne("input matrix dimensions do not match");
        for (
          var n = new kn(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 Ne("Left and top must be nonnegative");
        if (i < 1 || r < 1) throw new Ne("Height and width must be at least 1");
        var o = e + r,
          s = n + i;
        if (s > this.height || o > this.width)
          throw new Ne("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 kn(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) {
        Rt.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 kn(e),
            i = new kn(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 &&
          En.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 + En.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
    );
  })(),
  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());
      };
    })(),
  oe = (function (t) {
    Pbe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (
      (e.getNotFoundInstance = function () {
        return new e();
      }),
      (e.kind = "NotFoundException"),
      e
    );
  })(kr),
  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());
      };
    })(),
  Obe = (function (t) {
    Ibe(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 kn(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 wo(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 g = a * r, f = 0; f < r; f++) {
            var d = p[g + 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 g = a - o,
            f = g * g * (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
    );
  })(bbe),
  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());
      };
    })(),
  F9 = (function (t) {
    Rbe(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 wo(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 g = p << e.BLOCK_SIZE_POWER;
            g > u && (g = u);
            for (var m = e.cap(p, 2, r - 3), v = 0, y = -2; y <= 2; y++) {
              var _ = a[h + y];
              v += _[m - 2] + _[m - 1] + _[m] + _[m + 1] + _[m + 2];
            }
            var x = v / 25;
            e.thresholdBlock(n, g, 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, g = 255, m = 0, v = 0, y = f * o + h;
              v < e.BLOCK_SIZE;
              v++, y += o
            ) {
              for (var _ = 0; _ < e.BLOCK_SIZE; _++) {
                var x = n[y + _] & 255;
                (p += x), x < g && (g = x), x > m && (m = x);
              }
              if (m - g > e.MIN_DYNAMIC_RANGE)
                for (v++, y += o; v < e.BLOCK_SIZE; v++, y += o)
                  for (var _ = 0; _ < e.BLOCK_SIZE; _++) p += n[y + _] & 255;
            }
            var b = p >> (e.BLOCK_SIZE_POWER * 2);
            if (m - g <= e.MIN_DYNAMIC_RANGE && ((b = g / 2), u > 0 && d > 0)) {
              var w = (c[u - 1][d] + 2 * c[u][d - 1] + c[u - 1][d - 1]) / 4;
              g < 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
    );
  })(Obe),
  mh = (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 Qp("This luminance source does not support cropping.");
      }),
      (t.prototype.isRotateSupported = function () {
        return !1;
      }),
      (t.prototype.rotateCounterClockwise = function () {
        throw new Qp(
          "This luminance source does not support rotation by 90 degrees."
        );
      }),
      (t.prototype.rotateCounterClockwise45 = function () {
        throw new Qp(
          "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
    );
  })(),
  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());
      };
    })(),
  Im = (function (t) {
    Mbe(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
    );
  })(mh),
  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());
      };
    })(),
  Bbe = (function (t) {
    Dbe(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, g = n.length; a < g; 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 Ne("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 Im(this);
      }),
      (e.DEGREE_TO_RADIANS = Math.PI / 180),
      (e.FRAME_INDEX = !0),
      e
    );
  })(mh),
  kbe = (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
    );
  })(),
  or =
    (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());
      });
    },
  sr =
    (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 };
      }
    },
  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."
      );
    },
  Tu = (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 or(this, void 0, void 0, function () {
          var e, n, r, i, o, s, a, l, c, u, f, d;
          return sr(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 = Nbe(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 or(this, void 0, void 0, function () {
          var e;
          return sr(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 kbe(r.deviceId, r.label);
                    }),
                  ]
                );
            }
          });
        });
      }),
      (t.prototype.findDeviceById = function (e) {
        return or(this, void 0, void 0, function () {
          var n;
          return sr(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 or(this, void 0, void 0, function () {
          return sr(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 or(this, void 0, void 0, function () {
          var r, i;
          return sr(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 or(this, void 0, void 0, function () {
          var r;
          return sr(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 or(this, void 0, void 0, function () {
          var r, i;
          return sr(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 or(this, void 0, void 0, function () {
          return sr(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 or(this, void 0, void 0, function () {
          var i, o;
          return sr(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 or(this, void 0, void 0, function () {
          var i;
          return sr(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 or(this, void 0, void 0, function () {
          var i;
          return sr(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 or(this, void 0, void 0, function () {
          var r;
          return sr(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 or(this, void 0, void 0, function () {
          return sr(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 or(this, void 0, void 0, function () {
          return sr(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 or(this, void 0, void 0, function () {
          return sr(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 dn || 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 dn || 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 Bbe(r, n),
          o = new F9(i);
        return new N9(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
    );
  })(),
  rr = (function () {
    function t(e, n, r, i, o, s) {
      r === void 0 && (r = n == null ? 0 : 8 * n.length),
        s === void 0 && (s = Rt.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 = Rt.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);
          Rt.arraycopy(n, 0, r, 0, n.length),
            Rt.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
    );
  })(),
  Ix;
(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");
})(Ix || (Ix = {}));
const Be = Ix;
var Ox;
(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");
})(Ox || (Ox = {}));
const zn = Ox;
var Om = (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
    );
  })(),
  df = (function () {
    function t() {}
    return (
      (t.prototype.exp = function (e) {
        return this.expTable[e];
      }),
      (t.prototype.log = function (e) {
        if (e === 0) throw new Ne();
        return this.logTable[e];
      }),
      (t.addOrSubtract = function (e, n) {
        return e ^ n;
      }),
      t
    );
  })(),
  Qs = (function () {
    function t(e, n) {
      if (n.length === 0) throw new Ne();
      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)),
            Rt.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 = df.addOrSubtract(r, s);
          }
          return r;
        }
        r = n[0];
        for (var a = n.length, l = this.field, i = 1; i < a; i++)
          r = df.addOrSubtract(l.multiply(e, r), n[i]);
        return r;
      }),
      (t.prototype.addOrSubtract = function (e) {
        if (!this.field.equals(e.field))
          throw new Ne("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;
        Rt.arraycopy(r, 0, o, 0, s);
        for (var a = s; a < r.length; a++)
          o[a] = df.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 Ne("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] = df.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 Ne();
        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 Ne("GenericGFPolys do not have same GenericGF field");
        if (e.isZero()) throw new Ne("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
    );
  })(),
  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());
      };
    })(),
  L9 = (function (t) {
    Fbe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (e.kind = "ArithmeticException"), e;
  })(kr),
  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());
      };
    })(),
  Cr = (function (t) {
    Lbe(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 Qs(o, Int32Array.from([0]))),
        (o.one = new Qs(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 Ne();
        if (r === 0) return this.zero;
        var i = new Int32Array(n + 1);
        return (i[0] = r), new Qs(this, i);
      }),
      (e.prototype.inverse = function (n) {
        if (n === 0) throw new L9();
        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
    );
  })(df),
  $be =
    (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());
      };
    })(),
  Ep = (function (t) {
    $be(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (e.kind = "ReedSolomonException"), e;
  })(kr),
  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());
      };
    })(),
  vh = (function (t) {
    Ube(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (e.kind = "IllegalStateException"), e;
  })(kr),
  Rm = (function () {
    function t(e) {
      this.field = e;
    }
    return (
      (t.prototype.decode = function (e, n) {
        for (
          var r = this.field,
            i = new Qs(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 Qs(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 g = e.length - 1 - r.log(h[a]);
            if (g < 0) throw new Ep("Bad error location");
            e[g] = Cr.addOrSubtract(e[g], 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 Ep("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 g = a.getDegree() - s.getDegree(),
              m = o.multiply(a.getCoefficient(a.getDegree()), p);
            (d = d.addOrSubtract(o.buildMonomial(g, m))),
              (a = a.addOrSubtract(s.multiplyByMonomial(g, m)));
          }
          if (
            ((c = d.multiply(l).addOrSubtract(f)),
            a.getDegree() >= s.getDegree())
          )
            throw new vh("Division algorithm failed to reduce polynomial?");
        }
        var v = c.getCoefficient(0);
        if (v === 0) throw new Ep("sigmaTilde(0) was zero");
        var y = o.inverse(v),
          _ = c.multiplyScalar(y),
          x = a.multiplyScalar(y);
        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 Ep("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
    );
  })(),
  $n;
(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");
})($n || ($n = {}));
var RP = (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 Om(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 = $n.UPPER, i = $n.UPPER, o = "", s = 0;
          s < n;

        )
          if (i === $n.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 += rt.castAsNonUtf8Char(c)), (s += 8);
            }
            i = r;
          } else {
            var u = i === $n.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 $n.LOWER;
          case "P":
            return $n.PUNCT;
          case "M":
            return $n.MIXED;
          case "D":
            return $n.DIGIT;
          case "B":
            return $n.BINARY;
          case "U":
          default:
            return $n.UPPER;
        }
      }),
      (t.getCharacter = function (e, n) {
        switch (e) {
          case $n.UPPER:
            return t.UPPER_TABLE[n];
          case $n.LOWER:
            return t.LOWER_TABLE[n];
          case $n.MIXED:
            return t.MIXED_TABLE[n];
          case $n.PUNCT:
            return t.PUNCT_TABLE[n];
          case $n.DIGIT:
            return t.DIGIT_TABLE[n];
          default:
            throw new vh("Bad table");
        }
      }),
      (t.prototype.correctBits = function (e) {
        var n, r;
        this.ddata.getNbLayers() <= 2
          ? ((r = 6), (n = Cr.AZTEC_DATA_6))
          : this.ddata.getNbLayers() <= 8
          ? ((r = 8), (n = Cr.AZTEC_DATA_8))
          : this.ddata.getNbLayers() <= 22
          ? ((r = 10), (n = Cr.AZTEC_DATA_10))
          : ((r = 12), (n = Cr.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 Rm(n);
          c.decode(a, o - i);
        } catch (m) {
          throw new me(m);
        }
        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 g = r - 1; g >= 0; --g) h[p++] = (d & (1 << g)) !== 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, g = i - 1 - p, m = 0;
            m < h;
            m++
          )
            for (var v = m * 2, y = 0; y < 2; y++)
              (s[d + v + y] = e.get(o[p + y], o[p + m])),
                (s[d + 2 * h + v + y] = e.get(o[p + m], o[g - y])),
                (s[d + 4 * h + v + y] = e.get(o[g - y], o[g - m])),
                (s[d + 6 * h + v + y] = e.get(o[g - m], o[p + y]));
          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 ? -0.5 : 0.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
    );
  })(),
  Rx = (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 * Rx.floatToIntBits(this.x) + Rx.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
    );
  })(),
  fE = (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
    );
  })(),
  Gbe =
    (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());
      };
    })(),
  Hbe = (function (t) {
    Gbe(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
    );
  })(fE),
  Mx = (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 g = !0; (g || !c) && i < h; )
            (g = this.containsBlackPoint(e, n, i, !0)),
              g ? (i++, (s = !0), (c = !0)) : c || i++;
          if (i >= h) {
            o = !0;
            break;
          }
          for (var m = !0; (m || !u) && e >= 0; )
            (m = this.containsBlackPoint(r, i, e, !1)),
              m ? (e--, (s = !0), (u = !0)) : u || e--;
          if (e < 0) {
            o = !0;
            break;
          }
          for (var v = !0; (v || !f) && r >= 0; )
            (v = this.containsBlackPoint(e, n, r, !0)),
              v ? (r--, (s = !0), (f = !0)) : f || r--;
          if (r < 0) {
            o = !0;
            break;
          }
          s && (a = !0);
        }
        if (!o && a) {
          for (var y = n - e, _ = null, x = 1; _ === null && x < y; x++)
            _ = this.getBlackPointOnSegment(e, i - x, e + x, i);
          if (_ == null) throw new oe();
          for (var b = null, x = 1; b === null && x < y; 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 < y; 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 < y; 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
    );
  })(),
  MP = (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
    );
  })(),
  $9 = (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,
        g,
        m
      ) {
        var v = t.quadrilateralToSquare(e, n, r, i, o, s, a, l),
          y = t.squareToQuadrilateral(c, u, f, d, h, p, g, m);
        return y.times(v);
      }),
      (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],
            g = o * h + l * p + f;
          (e[d] = (r * h + s * p + c) / g),
            (e[d + 1] = (i * h + a * p + u) / g);
        }
      }),
      (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],
            g = n[h],
            m = o * p + l * g + f;
          (e[h] = (r * p + s * g + c) / m), (n[h] = (i * p + a * g + u) / m);
        }
      }),
      (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,
          g = f * p - d * h,
          m = (c * p - d * u) / g,
          v = (f * u - c * h) / g;
        return new t(
          r - e + m * r,
          a - e + v * a,
          e,
          i - n + m * i,
          l - n + v * l,
          n,
          m,
          v,
          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
    );
  })(),
  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());
      };
    })(),
  zbe = (function (t) {
    Vbe(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,
        g,
        m,
        v,
        y,
        _,
        x
      ) {
        var b = $9.quadrilateralToQuadrilateral(
          o,
          s,
          a,
          l,
          c,
          u,
          f,
          d,
          h,
          p,
          g,
          m,
          v,
          y,
          _,
          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 wo(r, i), a = new Float32Array(2 * r), l = 0;
          l < i;
          l++
        ) {
          for (var c = a.length, u = l + 0.5, f = 0; f < c; f += 2)
            (a[f] = f / 2 + 0.5), (a[f + 1] = u);
          o.transformPoints(a), MP.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
    );
  })(MP),
  dE = (function () {
    function t() {}
    return (
      (t.setGridSampler = function (e) {
        t.gridSampler = e;
      }),
      (t.getInstance = function () {
        return t.gridSampler;
      }),
      (t.gridSampler = new zbe()),
      t
    );
  })(),
  _r = (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
    );
  })(),
  jbe = (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 Hbe(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 Rm(Cr.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 < 0.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() + 0.5, n.getY() - 0.5),
          h = new Pe(r.getX() + 0.5, r.getY() + 0.5),
          p = new Pe(i.getX() - 0.5, i.getY() + 0.5),
          g = new Pe(o.getX() - 0.5, o.getY() - 0.5);
        return this.expandSquare(
          [d, h, p, g],
          2 * this.nbCenterLayers - 3,
          2 * this.nbCenterLayers
        );
      }),
      (t.prototype.getMatrixCenter = function () {
        var e, n, r, i;
        try {
          var o = new Mx(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 _r(s + 7, a - 7),
            !1,
            1,
            -1
          ).toResultPoint()),
            (n = this.getFirstDifferent(
              new _r(s + 7, a + 7),
              !1,
              1,
              1
            ).toResultPoint()),
            (r = this.getFirstDifferent(
              new _r(s - 7, a + 7),
              !1,
              -1,
              1
            ).toResultPoint()),
            (i = this.getFirstDifferent(
              new _r(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 Mx(this.image, 15, l, c).detect();
          (e = o[0]), (n = o[1]), (r = o[2]), (i = o[3]);
        } catch {
          (e = this.getFirstDifferent(
            new _r(l + 7, c - 7),
            !1,
            1,
            -1
          ).toResultPoint()),
            (n = this.getFirstDifferent(
              new _r(l + 7, c + 7),
              !1,
              1,
              1
            ).toResultPoint()),
            (r = this.getFirstDifferent(
              new _r(l - 7, c + 7),
              !1,
              -1,
              1
            ).toResultPoint()),
            (i = this.getFirstDifferent(
              new _r(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 _r(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 = dE.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 _r(e.getX() - o, e.getY() + o)),
          (n = new _r(n.getX() - o, n.getY() - o)),
          (r = new _r(r.getX() + o, r.getY() - o)),
          (i = new _r(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 > 0.1 && d < 0.9 ? 0 : d <= 0.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 _r(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
    );
  })(),
  K0 = (function () {
    function t() {}
    return (
      (t.prototype.decode = function (e, n) {
        n === void 0 && (n = null);
        var r = null,
          i = new jbe(e.getBlackMatrix()),
          o = null,
          s = null;
        try {
          var a = i.detectMirror(!1);
          (o = a.getPoints()),
            this.reportFoundResultPoints(n, o),
            (s = new RP().decode(a));
        } catch (f) {
          r = f;
        }
        if (s == null)
          try {
            var a = i.detectMirror(!0);
            (o = a.getPoints()),
              this.reportFoundResultPoints(n, o),
              (s = new RP().decode(a));
          } catch (f) {
            throw r ?? f;
          }
        var l = new rr(
            s.getText(),
            s.getRawBytes(),
            s.getNumBits(),
            o,
            Be.AZTEC,
            Rt.currentTimeMillis()
          ),
          c = s.getByteSegments();
        c != null && l.putMetadata(zn.BYTE_SEGMENTS, c);
        var u = s.getECLevel();
        return u != null && l.putMetadata(zn.ERROR_CORRECTION_LEVEL, u), l;
      }),
      (t.prototype.reportFoundResultPoints = function (e, n) {
        if (e != null) {
          var r = e.get(Mt.NEED_RESULT_POINT_CALLBACK);
          r != null &&
            n.forEach(function (i, o, s) {
              r.foundPossibleResultPoint(i);
            });
        }
      }),
      (t.prototype.reset = function () {}),
      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());
      };
    })();
(function (t) {
  Wbe(e, t);
  function e(n) {
    return n === void 0 && (n = 500), t.call(this, new K0(), n) || this;
  }
  return e;
})(Tu);
var Cn = (function () {
    function t() {}
    return (
      (t.prototype.decode = function (e, n) {
        try {
          return this.doDecode(e, n);
        } catch {
          var r = n && n.get(Mt.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(zn.ORIENTATION) === !0 &&
              (a = a + (s.get(zn.ORIENTATION) % 360)),
              o.putMetadata(zn.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 kn(r),
          s = n && n.get(Mt.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 (y) {
                if (
                  y === 1 &&
                  (o.reverse(),
                  n && n.get(Mt.NEED_RESULT_POINT_CALLBACK) === !0)
                ) {
                  var _ = new Map();
                  n.forEach(function (w, E) {
                    return _.set(E, w);
                  }),
                    _.delete(Mt.NEED_RESULT_POINT_CALLBACK),
                    (n = _);
                }
                try {
                  var x = g.decodeRow(h, o, n);
                  if (y === 1) {
                    x.putMetadata(zn.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 {}
              },
              g = this,
              m = 0;
            m < 2;
            m++
          ) {
            var v = p(m);
            if (typeof v == "object") return v.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
    );
  })(),
  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());
      };
    })(),
  DP = (function (t) {
    Ybe(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 = Cn.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) {
        Cn.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(Mt.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],
            g = s[1],
            m = Int32Array.from([0, 0, 0, 0, 0, 0]),
            v = 0,
            y = 0,
            _ = a,
            x = 0,
            b = !0,
            w = !1,
            E = !1;
          !f;

        ) {
          var S = d;
          switch (
            ((d = !1),
            (v = y),
            (y = e.decodeCode(r, m, g)),
            (c[l++] = y),
            y !== e.CODE_STOP && (b = !0),
            y !== e.CODE_STOP && (x++, (_ += x * y)),
            (p = g),
            (g += m.reduce(function ($, z) {
              return $ + z;
            }, 0)),
            y)
          ) {
            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 (y < 64)
                E === w
                  ? (h += String.fromCharCode(" ".charCodeAt(0) + y))
                  : (h += String.fromCharCode(" ".charCodeAt(0) + y + 128)),
                  (E = !1);
              else if (y < 96)
                E === w
                  ? (h += String.fromCharCode(y - 64))
                  : (h += String.fromCharCode(y + 64)),
                  (E = !1);
              else
                switch ((y !== e.CODE_STOP && (b = !1), y)) {
                  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 (y < 96)
                E === w
                  ? (h += String.fromCharCode(" ".charCodeAt(0) + y))
                  : (h += String.fromCharCode(" ".charCodeAt(0) + y + 128)),
                  (E = !1);
              else
                switch ((y !== e.CODE_STOP && (b = !1), y)) {
                  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 (y < 100) y < 10 && (h += "0"), (h += y);
              else
                switch ((y !== e.CODE_STOP && (b = !1), y)) {
                  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 = g - p;
        if (
          ((g = r.getNextUnset(g)),
          !r.isRange(g, Math.min(r.getSize(), g + (g - p) / 2), !1))
        )
          throw new oe();
        if (((_ -= x * v), _ % 103 !== v)) throw new dn();
        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 D = [new Pe(A, n), new Pe(T, n)];
        return new rr(h, B, 0, D, 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 = 0.25),
      (e.MAX_INDIVIDUAL_VARIANCE = 0.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
    );
  })(Cn),
  Xbe =
    (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());
      };
    })(),
  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."
      );
    },
  BP = (function (t) {
    Xbe(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 g = e.toNarrowWidePattern(c);
          if (g < 0) throw new oe();
          (h = e.patternToChar(g)), (this.decodeRowResult += h), (p = f);
          try {
            for (
              var m = ((o = void 0), kv(c)), v = m.next();
              !v.done;
              v = m.next()
            ) {
              var y = v.value;
              f += y;
            }
          } catch (I) {
            o = { error: I };
          } finally {
            try {
              v && !v.done && (s = m.return) && s.call(m);
            } 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 = kv(c), b = x.next(); !b.done; b = x.next()) {
            var y = b.value;
            _ += y;
          }
        } 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 dn();
          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 rr(
          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), kv(n)), u = c.next();
              !u.done;
              u = c.next()
            ) {
              var f = u.value;
              f < l && f > s && (l = f);
            }
          } catch (g) {
            r = { error: g };
          } 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
    );
  })(Cn),
  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());
      };
    })(),
  Nv =
    (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."
      );
    },
  kP = (function (t) {
    Kbe(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 g = this.toPattern(d);
          if (g < 0) throw new oe();
          (h = this.patternToChar(g)), (this.decodeRowResult += h), (p = u);
          try {
            for (
              var m = ((o = void 0), Nv(d)), v = m.next();
              !v.done;
              v = m.next()
            ) {
              var y = v.value;
              u += y;
            }
          } catch (P) {
            o = { error: P };
          } finally {
            try {
              v && !v.done && (s = m.return) && s.call(m);
            } 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 = Nv(d), b = x.next(); !b.done; b = x.next()) {
            var y = b.value;
            _ += y;
          }
        } 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 rr(
          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 = Nv(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 dn();
      }),
      (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
    );
  })(Cn),
  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 =
    (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) {
    qbe(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(Mt.ALLOWED_LENGTHS)),
          f == null && (f = e.DEFAULT_ALLOWED_LENGTHS);
        var d = u.length,
          h = !1,
          p = 0;
        try {
          for (var g = Zbe(f), m = g.next(); !m.done; m = g.next()) {
            var v = m.value;
            if (d === v) {
              h = !0;
              break;
            }
            v > p && (p = v);
          }
        } catch (x) {
          o = { error: x };
        } finally {
          try {
            m && !m.done && (s = g.return) && s.call(g);
          } finally {
            if (o) throw o.error;
          }
        }
        if ((!h && d > p && (h = !0), !h)) throw new me();
        var y = [new Pe(a[1], n), new Pe(l[0], n)],
          _ = new rr(u, null, 0, y, 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; ) {
          Cn.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 (
                Cn.patternMatchVariance(s, i, e.MAX_INDIVIDUAL_VARIANCE) <
                e.MAX_AVG_VARIANCE
              )
                return [u, f];
              (u += s[0] + s[1]),
                Rt.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 = Cn.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 = 0.38),
      (e.MAX_INDIVIDUAL_VARIANCE = 0.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
    );
  })(Cn),
  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());
      };
    })(),
  uu = (function (t) {
    Jbe(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 (
                Cn.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 = Cn.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 = 0.48),
      (e.MAX_INDIVIDUAL_VARIANCE = 0.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
    );
  })(Cn),
  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."
      );
    },
  ewe = (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 rr(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 = uu.decodeDigit(e, s, l, uu.L_AND_G_PATTERNS);
          r += String.fromCharCode("0".charCodeAt(0) + (f % 10));
          try {
            for (
              var d = ((i = void 0), Qbe(s)), h = d.next();
              !h.done;
              h = d.next()
            ) {
              var p = h.value;
              l += p;
            }
          } catch (m) {
            i = { error: m };
          } 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 g = this.determineCheckDigit(c);
        if (t.extensionChecksum(r.toString()) !== g) 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([[zn.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
    );
  })(),
  twe =
    (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.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 rr(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 = uu.decodeDigit(e, s, l, uu.L_AND_G_PATTERNS);
          r += String.fromCharCode("0".charCodeAt(0) + (f % 10));
          try {
            for (
              var d = ((i = void 0), twe(s)), h = d.next();
              !h.done;
              h = d.next()
            ) {
              var p = h.value;
              l += p;
            }
          } catch (g) {
            i = { error: g };
          } 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([[zn.ISSUE_NUMBER, parseInt(e)]]);
      }),
      t
    );
  })(),
  rwe = (function () {
    function t() {}
    return (
      (t.decodeRow = function (e, n, r) {
        var i = uu.findGuardPattern(
          n,
          r,
          !1,
          this.EXTENSION_START_PATTERN,
          new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0)
        );
        try {
          var o = new ewe();
          return o.decodeRow(e, n, i);
        } catch {
          var s = new nwe();
          return s.decodeRow(e, n, i);
        }
      }),
      (t.EXTENSION_START_PATTERN = Int32Array.from([1, 1, 2])),
      t
    );
  })(),
  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());
      };
    })(),
  bn = (function (t) {
    iwe(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(Mt.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],
          g = p + (p - d[0]);
        if (g >= r.getSize() || !r.isRange(p, g, !1)) throw new oe();
        var m = u.toString();
        if (m.length < 8) throw new me();
        if (!e.checkChecksum(m)) throw new dn();
        var v = (o[1] + o[0]) / 2,
          y = (d[1] + d[0]) / 2,
          _ = this.getBarcodeFormat(),
          x = [new Pe(v, n), new Pe(y, n)],
          b = new rr(m, null, 0, x, _, new Date().getTime()),
          w = 0;
        try {
          var E = rwe.decodeRow(n, r, d[1]);
          b.putMetadata(zn.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(Mt.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
    );
  })(uu),
  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());
      };
    })(),
  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."
      );
    },
  Dx = (function (t) {
    owe(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 = bn.decodeDigit(n, c, f, bn.L_AND_G_PATTERNS);
          i += String.fromCharCode("0".charCodeAt(0) + (p % 10));
          try {
            for (
              var g = ((o = void 0), FP(c)), m = g.next();
              !m.done;
              m = g.next()
            ) {
              var v = m.value;
              f += v;
            }
          } catch (b) {
            o = { error: b };
          } finally {
            try {
              m && !m.done && (s = g.return) && s.call(g);
            } finally {
              if (o) throw o.error;
            }
          }
          p >= 10 && (d |= 1 << (5 - h));
        }
        i = e.determineFirstDigit(i, d);
        var y = bn.findGuardPattern(
          n,
          f,
          !0,
          bn.MIDDLE_PATTERN,
          new Int32Array(bn.MIDDLE_PATTERN.length).fill(0)
        );
        f = y[1];
        for (var h = 0; h < 6 && f < u; h++) {
          var p = bn.decodeDigit(n, c, f, bn.L_PATTERNS);
          i += String.fromCharCode("0".charCodeAt(0) + p);
          try {
            for (
              var _ = ((a = void 0), FP(c)), x = _.next();
              !x.done;
              x = _.next()
            ) {
              var v = x.value;
              f += v;
            }
          } 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
    );
  })(bn),
  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());
      };
    })(),
  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."
      );
    },
  $P = (function (t) {
    swe(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 = bn.decodeDigit(n, c, f, bn.L_PATTERNS);
          i += String.fromCharCode("0".charCodeAt(0) + h);
          try {
            for (
              var p = ((o = void 0), LP(c)), g = p.next();
              !g.done;
              g = p.next()
            ) {
              var m = g.value;
              f += m;
            }
          } catch (x) {
            o = { error: x };
          } finally {
            try {
              g && !g.done && (s = p.return) && s.call(p);
            } finally {
              if (o) throw o.error;
            }
          }
        }
        var v = bn.findGuardPattern(
          n,
          f,
          !0,
          bn.MIDDLE_PATTERN,
          new Int32Array(bn.MIDDLE_PATTERN.length).fill(0)
        );
        f = v[1];
        for (var d = 0; d < 4 && f < u; d++) {
          var h = bn.decodeDigit(n, c, f, bn.L_PATTERNS);
          i += String.fromCharCode("0".charCodeAt(0) + h);
          try {
            for (
              var y = ((a = void 0), LP(c)), _ = y.next();
              !_.done;
              _ = y.next()
            ) {
              var m = _.value;
              f += m;
            }
          } catch (w) {
            a = { error: w };
          } finally {
            try {
              _ && !_.done && (l = y.return) && l.call(y);
            } finally {
              if (a) throw a.error;
            }
          }
        }
        return { rowOffset: f, resultString: i };
      }),
      (e.prototype.getBarcodeFormat = function () {
        return Be.EAN_8;
      }),
      e
    );
  })(bn),
  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());
      };
    })(),
  UP = (function (t) {
    awe(e, t);
    function e() {
      var n = (t !== null && t.apply(this, arguments)) || this;
      return (n.ean13Reader = new Dx()), 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 rr(
            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
    );
  })(bn),
  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());
      };
    })(),
  cwe =
    (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."
      );
    },
  GP = (function (t) {
    lwe(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 (m) {
            return m;
          });
        (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), cwe(a)), p = h.next();
              !p.done;
              p = h.next()
            ) {
              var g = p.value;
              c += g;
            }
          } catch (m) {
            o = { error: m };
          } 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 bn.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
    );
  })(bn),
  uwe =
    (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());
      };
    })(),
  HP =
    (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."
      );
    },
  Fv = (function (t) {
    uwe(e, t);
    function e(n) {
      var r = t.call(this) || this,
        i = n == null ? null : n.get(Mt.POSSIBLE_FORMATS),
        o = [];
      return (
        i != null &&
          (i.indexOf(Be.EAN_13) > -1 && o.push(new Dx()),
          i.indexOf(Be.UPC_A) > -1 && o.push(new UP()),
          i.indexOf(Be.EAN_8) > -1 && o.push(new $P()),
          i.indexOf(Be.UPC_E) > -1 && o.push(new GP())),
        o.length === 0 &&
          (o.push(new Dx()),
          o.push(new UP()),
          o.push(new $P()),
          o.push(new GP())),
        (r.readers = o),
        r
      );
    }
    return (
      (e.prototype.decodeRow = function (n, r, i) {
        var o, s;
        try {
          for (var a = HP(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(Mt.POSSIBLE_FORMATS),
                h = d == null || d.includes(Be.UPC_A);
              if (f && h) {
                var p = u.getRawBytes(),
                  g = new rr(
                    u.getText().substring(1),
                    p,
                    p ? p.length : null,
                    u.getResultPoints(),
                    Be.UPC_A
                  );
                return g.putAllMetadata(u.getResultMetadata()), g;
              }
              return u;
            } catch {}
          }
        } catch (m) {
          o = { error: m };
        } 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 = HP(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
    );
  })(Cn),
  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());
      };
    })(),
  dwe = (function (t) {
    fwe(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 rr(
          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
    );
  })(Cn),
  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 =
    (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."
      );
    },
  La = (function (t) {
    hwe(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 (
            Cn.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 = pwe(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 = 0.2),
      (e.MAX_INDIVIDUAL_VARIANCE = 0.45),
      (e.MIN_FINDER_PATTERN_RATIO = 9.5 / 12),
      (e.MAX_FINDER_PATTERN_RATIO = 12.5 / 14),
      e
    );
  })(Cn),
  q0 = (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
    );
  })(),
  U9 = (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
    );
  })(),
  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."
      );
    },
  Sc = (function () {
    function t() {}
    return (
      (t.getRSSvalue = function (e, n, r) {
        var i,
          o,
          s = 0;
        try {
          for (var a = gwe(e), l = a.next(); !l.done; l = a.next()) {
            var c = l.value;
            s += c;
          }
        } catch (y) {
          i = { error: y };
        } 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 g = t.combins(s - p - 1, d - h - 2);
            if (
              (r &&
                f === 0 &&
                s - p - (d - h - 1) >= d - h - 1 &&
                (g -= t.combins(s - p - (d - h), d - h - 2)),
              d - h - 1 > 1)
            ) {
              for (var m = 0, v = s - p - (d - h - 2); v > n; v--)
                m += t.combins(s - p - v - 1, d - h - 3);
              g -= m * (d - 1 - h);
            } else s - p > n && g--;
            u += g;
          }
          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
    );
  })(),
  mwe = (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 kn(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
    );
  })(),
  Oa = (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
    );
  })(),
  hE = (function () {
    function t(e) {
      this.newPosition = e;
    }
    return (
      (t.prototype.getNewPosition = function () {
        return this.newPosition;
      }),
      t
    );
  })(),
  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());
      };
    })(),
  wi = (function (t) {
    vwe(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
    );
  })(hE),
  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());
      };
    })(),
  Ra = (function (t) {
    ywe(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
    );
  })(hE),
  _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());
      };
    })(),
  lc = (function (t) {
    _we(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
    );
  })(hE),
  Sp =
    (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."
      );
    },
  xwe = (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 = Sp(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 g = Sp(t.THREE_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(3, h[2], e)
                : t.processFixedAI(3, h[1], e);
          }
        } catch (w) {
          i = { error: w };
        } finally {
          try {
            m && !m.done && (o = g.return) && o.call(g);
          } finally {
            if (i) throw i.error;
          }
        }
        try {
          for (
            var v = Sp(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH), y = v.next();
            !y.done;
            y = v.next()
          ) {
            var h = y.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 {
            y && !y.done && (a = v.return) && a.call(v);
          } finally {
            if (s) throw s.error;
          }
        }
        if (e.length < 4) throw new oe();
        var _ = e.substring(0, 4);
        try {
          for (
            var x = Sp(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
    );
  })(),
  e0 = (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 = xwe.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 lc(this.information.getSize(), lc.FNC1, lc.FNC1)
            : new lc(this.information.getSize(), n - 1, lc.FNC1);
        }
        var r = this.extractNumericValueFromBitArray(e, 7),
          i = (r - 8) / 11,
          o = (r - 8) % 11;
        return new lc(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 Ra(
              this.current.getPosition(),
              this.buffer.toString(),
              r.getRemainingValue()
            )
          : new Ra(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 Ra(
                    this.current.getPosition(),
                    this.buffer.toString()
                  ))
                : (n = new Ra(
                    this.current.getPosition(),
                    this.buffer.toString(),
                    e.getSecondDigit()
                  )),
              new Oa(!0, n)
            );
          }
          if ((this.buffer.append(e.getFirstDigit()), e.isSecondDigitFNC1())) {
            var n = new Ra(this.current.getPosition(), this.buffer.toString());
            return new Oa(!0, n);
          }
          this.buffer.append(e.getSecondDigit());
        }
        return (
          this.isNumericToAlphaNumericLatch(this.current.getPosition()) &&
            (this.current.setAlpha(), this.current.incrementPosition(4)),
          new Oa(!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 Ra(this.current.getPosition(), this.buffer.toString());
            return new Oa(!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 Oa(!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 Ra(this.current.getPosition(), this.buffer.toString());
            return new Oa(!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 Oa(!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 vh("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
    );
  })(),
  G9 = (function () {
    function t(e) {
      (this.information = e), (this.generalDecoder = new e0(e));
    }
    return (
      (t.prototype.getInformation = function () {
        return this.information;
      }),
      (t.prototype.getGeneralDecoder = function () {
        return this.generalDecoder;
      }),
      t
    );
  })(),
  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());
      };
    })(),
  Oi = (function (t) {
    bwe(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
    );
  })(G9),
  wwe =
    (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());
      };
    })(),
  Ewe = (function (t) {
    wwe(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),
  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());
      };
    })(),
  Cwe = (function (t) {
    Swe(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
    );
  })(G9),
  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());
      };
    })(),
  t0 = (function (t) {
    Awe(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),
  Twe =
    (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());
      };
    })(),
  H9 = (function (t) {
    Twe(e, t);
    function e(n) {
      return t.call(this, n) || this;
    }
    return (
      (e.prototype.parseInformation = function () {
        if (
          this.getInformation().getSize() !==
          e.HEADER_SIZE + t0.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 + t0.GTIN_SIZE,
            e.WEIGHT_SIZE
          ),
          n.toString()
        );
      }),
      (e.HEADER_SIZE = 4 + 1),
      (e.WEIGHT_SIZE = 15),
      e
    );
  })(t0),
  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());
      };
    })(),
  Iwe = (function (t) {
    Pwe(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
    );
  })(H9),
  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());
      };
    })(),
  Rwe = (function (t) {
    Owe(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
    );
  })(H9),
  Mwe =
    (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());
      };
    })(),
  Dwe = (function (t) {
    Mwe(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),
  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());
      };
    })(),
  kwe = (function (t) {
    Bwe(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),
  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());
      };
    })(),
  Ps = (function (t) {
    Nwe(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
    );
  })(t0);
function Fwe(t) {
  try {
    if (t.get(1)) return new Ewe(t);
    if (!t.get(2)) return new Cwe(t);
    var e = e0.extractNumericValueFromBitArray(t, 1, 4);
    switch (e) {
      case 4:
        return new Iwe(t);
      case 5:
        return new Rwe(t);
    }
    var n = e0.extractNumericValueFromBitArray(t, 1, 5);
    switch (n) {
      case 12:
        return new Dwe(t);
      case 13:
        return new kwe(t);
    }
    var r = e0.extractNumericValueFromBitArray(t, 1, 7);
    switch (r) {
      case 56:
        return new Ps(t, "310", "11");
      case 57:
        return new Ps(t, "320", "11");
      case 58:
        return new Ps(t, "310", "13");
      case 59:
        return new Ps(t, "320", "13");
      case 60:
        return new Ps(t, "310", "15");
      case 61:
        return new Ps(t, "320", "15");
      case 62:
        return new Ps(t, "310", "17");
      case 63:
        return new Ps(t, "320", "17");
    }
  } catch (i) {
    throw (console.log(i), new vh("unknown decoder: " + t));
  }
}
var VP = (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
    );
  })(),
  Lwe = (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
    );
  })(),
  $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());
      };
    })(),
  Is =
    (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."
      );
    },
  Uwe = (function (t) {
    $we(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), Is(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 = Is(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 Lwe(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 = Is(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), Is(d.getPairs())), g = p.next();
                  !g.done;
                  g = p.next()
                ) {
                  var m = g.value,
                    v = !1;
                  try {
                    for (
                      var y = ((l = void 0), Is(n)), _ = y.next();
                      !_.done;
                      _ = y.next()
                    ) {
                      var x = _.value;
                      if (VP.equals(m, x)) {
                        v = !0;
                        break;
                      }
                    }
                  } catch (b) {
                    l = { error: b };
                  } finally {
                    try {
                      _ && !_.done && (c = y.return) && c.call(y);
                    } finally {
                      if (l) throw l.error;
                    }
                  }
                  v || (h = !1);
                }
              } catch (b) {
                s = { error: b };
              } finally {
                try {
                  g && !g.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 = Is(r), f = u.next(); !f.done; f = u.next()) {
            var d = f.value,
              h = !0;
            try {
              for (
                var p = ((s = void 0), Is(n)), g = p.next();
                !g.done;
                g = p.next()
              ) {
                var m = g.value,
                  v = !1;
                try {
                  for (
                    var y = ((l = void 0), Is(d.getPairs())), _ = y.next();
                    !_.done;
                    _ = y.next()
                  ) {
                    var x = _.value;
                    if (m.equals(x)) {
                      v = !0;
                      break;
                    }
                  }
                } catch (b) {
                  l = { error: b };
                } finally {
                  try {
                    _ && !_.done && (c = y.return) && c.call(y);
                  } finally {
                    if (l) throw l.error;
                  }
                }
                if (!v) {
                  h = !1;
                  break;
                }
              }
            } catch (b) {
              s = { error: b };
            } finally {
              try {
                g && !g.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 = mwe.buildBitArray(n),
          i = Fwe(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 rr(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 VP(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();
        Rt.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 U9(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 > 0.3) throw new oe();
        for (
          var p = this.getOddCounts(),
            g = this.getEvenCounts(),
            m = this.getOddRoundingErrors(),
            v = this.getEvenRoundingErrors(),
            l = 0;
          l < s.length;
          l++
        ) {
          var y = (1 * s[l]) / d,
            _ = y + 0.5;
          if (_ < 1) {
            if (y < 0.3) throw new oe();
            _ = 1;
          } else if (_ > 8) {
            if (y > 8.7) throw new oe();
            _ = 8;
          }
          var x = l / 2;
          l & 1 ? ((g[x] = _), (v[x] = y - _)) : ((p[x] = _), (m[x] = y - _));
        }
        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 = g.length - 1; l >= 0; l--)
          if (e.isNotA1left(r, i, o)) {
            var S = e.WEIGHTS[b][2 * l + 1];
            P += g[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 = Sc.getRSSvalue(p, T, !0),
          G = Sc.getRSSvalue(g, I, !1),
          D = e.EVEN_TOTAL_SUBSET[A],
          $ = e.GSUM[A],
          z = B * D + G + $;
        return new q0(z, 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
    );
  })(La),
  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());
      };
    })(),
  Hwe = (function (t) {
    Gwe(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
    );
  })(q0),
  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());
      };
    })(),
  Lv =
    (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."
      );
    },
  zP = (function (t) {
    Vwe(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 = Lv(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), Lv(this.possibleRightPairs)),
                    g = p.next();
                  !g.done;
                  g = p.next()
                ) {
                  var m = g.value;
                  if (m.getCount() > 1 && e.checkChecksum(h, m))
                    return e.constructResult(h, m);
                }
              } catch (v) {
                a = { error: v };
              } finally {
                try {
                  g && !g.done && (l = p.return) && l.call(p);
                } finally {
                  if (a) throw a.error;
                }
              }
          }
        } catch (v) {
          o = { error: v };
        } 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 = Lv(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 rr(
          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(Mt.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 Hwe(
            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) Cn.recordPatternInReverse(n, r.getStartEnd()[0], o);
        else {
          Cn.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(),
            g = this.getEvenRoundingErrors(),
            a = 0;
          a < o.length;
          a++
        ) {
          var m = o[a] / f,
            v = Math.floor(m + 0.5);
          v < 1 ? (v = 1) : v > 8 && (v = 8);
          var y = Math.floor(a / 2);
          a & 1 ? ((h[y] = v), (g[y] = m - v)) : ((d[y] = v), (p[y] = m - v));
        }
        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 = Sc.getRSSvalue(d, P, !1),
            T = Sc.getRSSvalue(h, C, !0),
            I = e.OUTSIDE_EVEN_TOTAL_SUBSET[S],
            B = e.OUTSIDE_GSUM[S];
          return new q0(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 = Sc.getRSSvalue(d, P, !0),
            T = Sc.getRSSvalue(h, C, !1),
            G = e.INSIDE_ODD_TOTAL_SUBSET[S],
            B = e.INSIDE_GSUM[S];
          return new q0(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 (La.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);
        Rt.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 U9(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();
          La.increment(this.getOddCounts(), this.getOddRoundingErrors());
        }
        if (
          (a && La.decrement(this.getOddCounts(), this.getOddRoundingErrors()),
          l)
        ) {
          if (c) throw new oe();
          La.increment(this.getEvenCounts(), this.getOddRoundingErrors());
        }
        c && La.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
    );
  })(La),
  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());
      };
    })(),
  Cc = (function (t) {
    zwe(e, t);
    function e(n) {
      var r = t.call(this) || this;
      r.readers = [];
      var i = n ? n.get(Mt.POSSIBLE_FORMATS) : null,
        o = n && n.get(Mt.ASSUME_CODE_39_CHECK_DIGIT) !== void 0,
        s = n && n.get(Mt.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 Fv(n)),
          i.includes(Be.CODE_39) && r.readers.push(new BP(o, s)),
          i.includes(Be.CODE_93) && r.readers.push(new kP()),
          i.includes(Be.CODE_128) && r.readers.push(new DP()),
          i.includes(Be.ITF) && r.readers.push(new NP()),
          i.includes(Be.CODABAR) && r.readers.push(new dwe()),
          i.includes(Be.RSS_14) && r.readers.push(new zP()),
          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 Uwe()))),
        r.readers.length === 0 &&
          (r.readers.push(new Fv(n)),
          r.readers.push(new BP()),
          r.readers.push(new kP()),
          r.readers.push(new Fv(n)),
          r.readers.push(new DP()),
          r.readers.push(new NP()),
          r.readers.push(new zP())),
        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
    );
  })(Cn),
  jwe =
    (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) {
  jwe(e, t);
  function e(n, r) {
    return n === void 0 && (n = 500), t.call(this, new Cc(r), n, r) || this;
  }
  return e;
})(Tu);
var 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."
      );
    },
  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
    );
  })(),
  Wwe = (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 = jP(f), h = d.next(); !h.done; h = d.next()) {
          var p = h.value;
          c += p.getCount() * (p.getDataCodewords() + u);
        }
      } catch (g) {
        a = { error: g };
      } 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 = jP(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
    );
  })(),
  Ywe = (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 wo(
          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 Wwe.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 Ne("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 wo(c, l),
            f = 0;
          f < s;
          ++f
        )
          for (var d = f * i, h = 0; h < a; ++h)
            for (var p = h * o, g = 0; g < i; ++g)
              for (var m = f * (i + 2) + 1 + g, v = d + g, y = 0; y < o; ++y) {
                var _ = h * (o + 2) + 1 + y;
                if (e.get(_, m)) {
                  var x = p + y;
                  u.set(x, v);
                }
              }
        return u;
      }),
      t
    );
  })(),
  WP =
    (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."
      );
    },
  Xwe = (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 = WP(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 g = WP(c), m = g.next(); !m.done; m = g.next())
            for (var d = m.value, v = 0; v < d.getCount(); v++) {
              var y = d.getDataCodewords(),
                _ = a.getECCodewords() + y;
              h[p++] = new t(y, new Uint8Array(_));
            }
        } catch (B) {
          o = { error: B };
        } finally {
          try {
            m && !m.done && (s = g.return) && s.call(g);
          } finally {
            if (o) throw o.error;
          }
        }
        for (
          var x = h[0].codewords.length,
            b = x - a.getECCodewords(),
            w = b - 1,
            E = 0,
            v = 0;
          v < w;
          v++
        )
          for (var S = 0; S < p; S++) h[S].codewords[v] = 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, v = b; v < A; v++)
          for (var S = 0; S < p; S++) {
            var T = P ? (S + 8) % p : S,
              I = P && T > 7 ? v - 1 : v;
            h[T].codewords[I] = e[E++];
          }
        if (E !== e.length) throw new Ne();
        return h;
      }),
      (t.prototype.getNumDataCodewords = function () {
        return this.numDataCodewords;
      }),
      (t.prototype.getCodewords = function () {
        return this.codewords;
      }),
      t
    );
  })(),
  V9 = (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 Ne("" + 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
    );
  })(),
  vn;
(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");
})(vn || (vn = {}));
var Kwe = (function () {
    function t() {}
    return (
      (t.decode = function (e) {
        var n = new V9(e),
          r = new Ke(),
          i = new Ke(),
          o = new Array(),
          s = vn.ASCII_ENCODE;
        do
          if (s === vn.ASCII_ENCODE) s = this.decodeAsciiSegment(n, r, i);
          else {
            switch (s) {
              case vn.C40_ENCODE:
                this.decodeC40Segment(n, r);
                break;
              case vn.TEXT_ENCODE:
                this.decodeTextSegment(n, r);
                break;
              case vn.ANSIX12_ENCODE:
                this.decodeAnsiX12Segment(n, r);
                break;
              case vn.EDIFACT_ENCODE:
                this.decodeEdifactSegment(n, r);
                break;
              case vn.BASE256_ENCODE:
                this.decodeBase256Segment(n, r, o);
                break;
              default:
                throw new me();
            }
            s = vn.ASCII_ENCODE;
          }
        while (s !== vn.PAD_ENCODE && n.available() > 0);
        return (
          i.length() > 0 && r.append(i.toString()),
          new Om(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)),
              vn.ASCII_ENCODE
            );
          if (o === 129) return vn.PAD_ENCODE;
          if (o <= 229) {
            var s = o - 130;
            s < 10 && n.append("0"), n.append("" + s);
          } else
            switch (o) {
              case 230:
                return vn.C40_ENCODE;
              case 231:
                return vn.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 vn.ANSIX12_ENCODE;
              case 239:
                return vn.TEXT_ENCODE;
              case 240:
                return vn.EDIFACT_ENCODE;
              case 241:
                break;
              default:
                if (o !== 254 || e.available() !== 0) throw new me();
                break;
            }
        } while (e.available() > 0);
        return vn.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, rt.ISO88591));
        } catch (c) {
          throw new vh(
            "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
    );
  })(),
  qwe =
    (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() {
      this.rsDecoder = new Rm(Cr.DATA_MATRIX_FIELD_256);
    }
    return (
      (t.prototype.decode = function (e) {
        var n,
          r,
          i = new Ywe(e),
          o = i.getVersion(),
          s = i.readCodewords(),
          a = Xwe.getDataBlocks(s, o),
          l = 0;
        try {
          for (var c = qwe(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 g = a[p],
            m = g.getCodewords(),
            v = g.getNumDataCodewords();
          this.correctErrors(m, v);
          for (var y = 0; y < v; y++) d[y * h + p] = m[y];
        }
        return Kwe.decode(d);
      }),
      (t.prototype.correctErrors = function (e, n) {
        var r = new Int32Array(e);
        try {
          this.rsDecoder.decode(r, e.length - n);
        } catch {
          throw new dn();
        }
        for (var i = 0; i < n; i++) e[i] = r[i];
      }),
      t
    );
  })(),
  Jwe = (function () {
    function t(e) {
      (this.image = e), (this.rectangleDetector = new Mx(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 fE(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 = dE.getInstance();
        return l.sampleGrid(
          e,
          s,
          a,
          0.5,
          0.5,
          s - 0.5,
          0.5,
          s - 0.5,
          a - 0.5,
          0.5,
          a - 0.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,
            g = this.image.get(a ? i : r, a ? r : i),
            m = r,
            v = i;
          m !== o;
          m += h
        ) {
          var y = this.image.get(a ? v : m, a ? m : v);
          if ((y !== g && (p++, (g = y)), (f += u), f > 0)) {
            if (v === s) break;
            (v += d), (f -= c);
          }
        }
        return p;
      }),
      t
    );
  })(),
  Z0 = (function () {
    function t() {
      this.decoder = new Zwe();
    }
    return (
      (t.prototype.decode = function (e, n) {
        n === void 0 && (n = null);
        var r, i;
        if (n != null && n.has(Mt.PURE_BARCODE)) {
          var o = t.extractPureBits(e.getBlackMatrix());
          (r = this.decoder.decode(o)), (i = t.NO_POINTS);
        } else {
          var s = new Jwe(e.getBlackMatrix()).detect();
          (r = this.decoder.decode(s.getBits())), (i = s.getPoints());
        }
        var a = r.getRawBytes(),
          l = new rr(
            r.getText(),
            a,
            8 * a.length,
            i,
            Be.DATA_MATRIX,
            Rt.currentTimeMillis()
          ),
          c = r.getByteSegments();
        c != null && l.putMetadata(zn.BYTE_SEGMENTS, c);
        var u = r.getECLevel();
        return u != null && l.putMetadata(zn.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 wo(c, u), h = 0; h < u; h++)
          for (var p = o + h * i, g = 0; g < c; g++)
            e.get(a + g * i, p) && d.set(g, 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
    );
  })(),
  Qwe =
    (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) {
  Qwe(e, t);
  function e(n) {
    return n === void 0 && (n = 500), t.call(this, new Z0(), n) || this;
  }
  return e;
})(Tu);
var Ac;
(function (t) {
  (t[(t.L = 0)] = "L"),
    (t[(t.M = 1)] = "M"),
    (t[(t.Q = 2)] = "Q"),
    (t[(t.H = 3)] = "H");
})(Ac || (Ac = {}));
var e2e = (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 Ne();
        return t.FOR_BITS.get(e);
      }),
      (t.FOR_BITS = new Map()),
      (t.FOR_VALUE = new Map()),
      (t.L = new t(Ac.L, "L", 1)),
      (t.M = new t(Ac.M, "M", 0)),
      (t.Q = new t(Ac.Q, "Q", 3)),
      (t.H = new t(Ac.H, "H", 2)),
      t
    );
  })(),
  t2e =
    (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."
      );
    },
  z9 = (function () {
    function t(e) {
      (this.errorCorrectionLevel = e2e.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 = t2e(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
    );
  })(),
  n2e =
    (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."
      );
    },
  X = (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 = n2e(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
    );
  })(),
  k = (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
    );
  })(),
  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."
      );
    },
  cl = (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 = r2e(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 Ne();
        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 = z9.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 wo(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 X(7, new k(1, 19)),
          new X(10, new k(1, 16)),
          new X(13, new k(1, 13)),
          new X(17, new k(1, 9))
        ),
        new t(
          2,
          Int32Array.from([6, 18]),
          new X(10, new k(1, 34)),
          new X(16, new k(1, 28)),
          new X(22, new k(1, 22)),
          new X(28, new k(1, 16))
        ),
        new t(
          3,
          Int32Array.from([6, 22]),
          new X(15, new k(1, 55)),
          new X(26, new k(1, 44)),
          new X(18, new k(2, 17)),
          new X(22, new k(2, 13))
        ),
        new t(
          4,
          Int32Array.from([6, 26]),
          new X(20, new k(1, 80)),
          new X(18, new k(2, 32)),
          new X(26, new k(2, 24)),
          new X(16, new k(4, 9))
        ),
        new t(
          5,
          Int32Array.from([6, 30]),
          new X(26, new k(1, 108)),
          new X(24, new k(2, 43)),
          new X(18, new k(2, 15), new k(2, 16)),
          new X(22, new k(2, 11), new k(2, 12))
        ),
        new t(
          6,
          Int32Array.from([6, 34]),
          new X(18, new k(2, 68)),
          new X(16, new k(4, 27)),
          new X(24, new k(4, 19)),
          new X(28, new k(4, 15))
        ),
        new t(
          7,
          Int32Array.from([6, 22, 38]),
          new X(20, new k(2, 78)),
          new X(18, new k(4, 31)),
          new X(18, new k(2, 14), new k(4, 15)),
          new X(26, new k(4, 13), new k(1, 14))
        ),
        new t(
          8,
          Int32Array.from([6, 24, 42]),
          new X(24, new k(2, 97)),
          new X(22, new k(2, 38), new k(2, 39)),
          new X(22, new k(4, 18), new k(2, 19)),
          new X(26, new k(4, 14), new k(2, 15))
        ),
        new t(
          9,
          Int32Array.from([6, 26, 46]),
          new X(30, new k(2, 116)),
          new X(22, new k(3, 36), new k(2, 37)),
          new X(20, new k(4, 16), new k(4, 17)),
          new X(24, new k(4, 12), new k(4, 13))
        ),
        new t(
          10,
          Int32Array.from([6, 28, 50]),
          new X(18, new k(2, 68), new k(2, 69)),
          new X(26, new k(4, 43), new k(1, 44)),
          new X(24, new k(6, 19), new k(2, 20)),
          new X(28, new k(6, 15), new k(2, 16))
        ),
        new t(
          11,
          Int32Array.from([6, 30, 54]),
          new X(20, new k(4, 81)),
          new X(30, new k(1, 50), new k(4, 51)),
          new X(28, new k(4, 22), new k(4, 23)),
          new X(24, new k(3, 12), new k(8, 13))
        ),
        new t(
          12,
          Int32Array.from([6, 32, 58]),
          new X(24, new k(2, 92), new k(2, 93)),
          new X(22, new k(6, 36), new k(2, 37)),
          new X(26, new k(4, 20), new k(6, 21)),
          new X(28, new k(7, 14), new k(4, 15))
        ),
        new t(
          13,
          Int32Array.from([6, 34, 62]),
          new X(26, new k(4, 107)),
          new X(22, new k(8, 37), new k(1, 38)),
          new X(24, new k(8, 20), new k(4, 21)),
          new X(22, new k(12, 11), new k(4, 12))
        ),
        new t(
          14,
          Int32Array.from([6, 26, 46, 66]),
          new X(30, new k(3, 115), new k(1, 116)),
          new X(24, new k(4, 40), new k(5, 41)),
          new X(20, new k(11, 16), new k(5, 17)),
          new X(24, new k(11, 12), new k(5, 13))
        ),
        new t(
          15,
          Int32Array.from([6, 26, 48, 70]),
          new X(22, new k(5, 87), new k(1, 88)),
          new X(24, new k(5, 41), new k(5, 42)),
          new X(30, new k(5, 24), new k(7, 25)),
          new X(24, new k(11, 12), new k(7, 13))
        ),
        new t(
          16,
          Int32Array.from([6, 26, 50, 74]),
          new X(24, new k(5, 98), new k(1, 99)),
          new X(28, new k(7, 45), new k(3, 46)),
          new X(24, new k(15, 19), new k(2, 20)),
          new X(30, new k(3, 15), new k(13, 16))
        ),
        new t(
          17,
          Int32Array.from([6, 30, 54, 78]),
          new X(28, new k(1, 107), new k(5, 108)),
          new X(28, new k(10, 46), new k(1, 47)),
          new X(28, new k(1, 22), new k(15, 23)),
          new X(28, new k(2, 14), new k(17, 15))
        ),
        new t(
          18,
          Int32Array.from([6, 30, 56, 82]),
          new X(30, new k(5, 120), new k(1, 121)),
          new X(26, new k(9, 43), new k(4, 44)),
          new X(28, new k(17, 22), new k(1, 23)),
          new X(28, new k(2, 14), new k(19, 15))
        ),
        new t(
          19,
          Int32Array.from([6, 30, 58, 86]),
          new X(28, new k(3, 113), new k(4, 114)),
          new X(26, new k(3, 44), new k(11, 45)),
          new X(26, new k(17, 21), new k(4, 22)),
          new X(26, new k(9, 13), new k(16, 14))
        ),
        new t(
          20,
          Int32Array.from([6, 34, 62, 90]),
          new X(28, new k(3, 107), new k(5, 108)),
          new X(26, new k(3, 41), new k(13, 42)),
          new X(30, new k(15, 24), new k(5, 25)),
          new X(28, new k(15, 15), new k(10, 16))
        ),
        new t(
          21,
          Int32Array.from([6, 28, 50, 72, 94]),
          new X(28, new k(4, 116), new k(4, 117)),
          new X(26, new k(17, 42)),
          new X(28, new k(17, 22), new k(6, 23)),
          new X(30, new k(19, 16), new k(6, 17))
        ),
        new t(
          22,
          Int32Array.from([6, 26, 50, 74, 98]),
          new X(28, new k(2, 111), new k(7, 112)),
          new X(28, new k(17, 46)),
          new X(30, new k(7, 24), new k(16, 25)),
          new X(24, new k(34, 13))
        ),
        new t(
          23,
          Int32Array.from([6, 30, 54, 78, 102]),
          new X(30, new k(4, 121), new k(5, 122)),
          new X(28, new k(4, 47), new k(14, 48)),
          new X(30, new k(11, 24), new k(14, 25)),
          new X(30, new k(16, 15), new k(14, 16))
        ),
        new t(
          24,
          Int32Array.from([6, 28, 54, 80, 106]),
          new X(30, new k(6, 117), new k(4, 118)),
          new X(28, new k(6, 45), new k(14, 46)),
          new X(30, new k(11, 24), new k(16, 25)),
          new X(30, new k(30, 16), new k(2, 17))
        ),
        new t(
          25,
          Int32Array.from([6, 32, 58, 84, 110]),
          new X(26, new k(8, 106), new k(4, 107)),
          new X(28, new k(8, 47), new k(13, 48)),
          new X(30, new k(7, 24), new k(22, 25)),
          new X(30, new k(22, 15), new k(13, 16))
        ),
        new t(
          26,
          Int32Array.from([6, 30, 58, 86, 114]),
          new X(28, new k(10, 114), new k(2, 115)),
          new X(28, new k(19, 46), new k(4, 47)),
          new X(28, new k(28, 22), new k(6, 23)),
          new X(30, new k(33, 16), new k(4, 17))
        ),
        new t(
          27,
          Int32Array.from([6, 34, 62, 90, 118]),
          new X(30, new k(8, 122), new k(4, 123)),
          new X(28, new k(22, 45), new k(3, 46)),
          new X(30, new k(8, 23), new k(26, 24)),
          new X(30, new k(12, 15), new k(28, 16))
        ),
        new t(
          28,
          Int32Array.from([6, 26, 50, 74, 98, 122]),
          new X(30, new k(3, 117), new k(10, 118)),
          new X(28, new k(3, 45), new k(23, 46)),
          new X(30, new k(4, 24), new k(31, 25)),
          new X(30, new k(11, 15), new k(31, 16))
        ),
        new t(
          29,
          Int32Array.from([6, 30, 54, 78, 102, 126]),
          new X(30, new k(7, 116), new k(7, 117)),
          new X(28, new k(21, 45), new k(7, 46)),
          new X(30, new k(1, 23), new k(37, 24)),
          new X(30, new k(19, 15), new k(26, 16))
        ),
        new t(
          30,
          Int32Array.from([6, 26, 52, 78, 104, 130]),
          new X(30, new k(5, 115), new k(10, 116)),
          new X(28, new k(19, 47), new k(10, 48)),
          new X(30, new k(15, 24), new k(25, 25)),
          new X(30, new k(23, 15), new k(25, 16))
        ),
        new t(
          31,
          Int32Array.from([6, 30, 56, 82, 108, 134]),
          new X(30, new k(13, 115), new k(3, 116)),
          new X(28, new k(2, 46), new k(29, 47)),
          new X(30, new k(42, 24), new k(1, 25)),
          new X(30, new k(23, 15), new k(28, 16))
        ),
        new t(
          32,
          Int32Array.from([6, 34, 60, 86, 112, 138]),
          new X(30, new k(17, 115)),
          new X(28, new k(10, 46), new k(23, 47)),
          new X(30, new k(10, 24), new k(35, 25)),
          new X(30, new k(19, 15), new k(35, 16))
        ),
        new t(
          33,
          Int32Array.from([6, 30, 58, 86, 114, 142]),
          new X(30, new k(17, 115), new k(1, 116)),
          new X(28, new k(14, 46), new k(21, 47)),
          new X(30, new k(29, 24), new k(19, 25)),
          new X(30, new k(11, 15), new k(46, 16))
        ),
        new t(
          34,
          Int32Array.from([6, 34, 62, 90, 118, 146]),
          new X(30, new k(13, 115), new k(6, 116)),
          new X(28, new k(14, 46), new k(23, 47)),
          new X(30, new k(44, 24), new k(7, 25)),
          new X(30, new k(59, 16), new k(1, 17))
        ),
        new t(
          35,
          Int32Array.from([6, 30, 54, 78, 102, 126, 150]),
          new X(30, new k(12, 121), new k(7, 122)),
          new X(28, new k(12, 47), new k(26, 48)),
          new X(30, new k(39, 24), new k(14, 25)),
          new X(30, new k(22, 15), new k(41, 16))
        ),
        new t(
          36,
          Int32Array.from([6, 24, 50, 76, 102, 128, 154]),
          new X(30, new k(6, 121), new k(14, 122)),
          new X(28, new k(6, 47), new k(34, 48)),
          new X(30, new k(46, 24), new k(10, 25)),
          new X(30, new k(2, 15), new k(64, 16))
        ),
        new t(
          37,
          Int32Array.from([6, 28, 54, 80, 106, 132, 158]),
          new X(30, new k(17, 122), new k(4, 123)),
          new X(28, new k(29, 46), new k(14, 47)),
          new X(30, new k(49, 24), new k(10, 25)),
          new X(30, new k(24, 15), new k(46, 16))
        ),
        new t(
          38,
          Int32Array.from([6, 32, 58, 84, 110, 136, 162]),
          new X(30, new k(4, 122), new k(18, 123)),
          new X(28, new k(13, 46), new k(32, 47)),
          new X(30, new k(48, 24), new k(14, 25)),
          new X(30, new k(42, 15), new k(32, 16))
        ),
        new t(
          39,
          Int32Array.from([6, 26, 54, 82, 110, 138, 166]),
          new X(30, new k(20, 117), new k(4, 118)),
          new X(28, new k(40, 47), new k(7, 48)),
          new X(30, new k(43, 24), new k(22, 25)),
          new X(30, new k(10, 15), new k(67, 16))
        ),
        new t(
          40,
          Int32Array.from([6, 30, 58, 86, 114, 142, 170]),
          new X(30, new k(19, 118), new k(6, 119)),
          new X(28, new k(18, 47), new k(31, 48)),
          new X(30, new k(34, 24), new k(34, 25)),
          new X(30, new k(20, 15), new k(61, 16))
        ),
      ]),
      t
    );
  })(),
  In;
(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");
})(In || (In = {}));
var YP = (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([
        [
          In.DATA_MASK_000,
          new t(In.DATA_MASK_000, function (e, n) {
            return ((e + n) & 1) === 0;
          }),
        ],
        [
          In.DATA_MASK_001,
          new t(In.DATA_MASK_001, function (e, n) {
            return (e & 1) === 0;
          }),
        ],
        [
          In.DATA_MASK_010,
          new t(In.DATA_MASK_010, function (e, n) {
            return n % 3 === 0;
          }),
        ],
        [
          In.DATA_MASK_011,
          new t(In.DATA_MASK_011, function (e, n) {
            return (e + n) % 3 === 0;
          }),
        ],
        [
          In.DATA_MASK_100,
          new t(In.DATA_MASK_100, function (e, n) {
            return ((Math.floor(e / 2) + Math.floor(n / 3)) & 1) === 0;
          }),
        ],
        [
          In.DATA_MASK_101,
          new t(In.DATA_MASK_101, function (e, n) {
            return (e * n) % 6 === 0;
          }),
        ],
        [
          In.DATA_MASK_110,
          new t(In.DATA_MASK_110, function (e, n) {
            return (e * n) % 6 < 3;
          }),
        ],
        [
          In.DATA_MASK_111,
          new t(In.DATA_MASK_111, function (e, n) {
            return ((e + n + ((e * n) % 3)) & 1) === 0;
          }),
        ],
      ])),
      t
    );
  })(),
  i2e = (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 = z9.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 cl.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 = cl.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 = cl.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 = YP.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 = YP.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
    );
  })(),
  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."
      );
    },
  o2e = (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 Ne();
        var l = n.getECBlocksForLevel(r),
          c = 0,
          u = l.getECBlocks();
        try {
          for (var f = XP(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),
          g = 0;
        try {
          for (var m = XP(u), v = m.next(); !v.done; v = m.next())
            for (var h = v.value, y = 0; y < h.getCount(); y++) {
              var _ = h.getDataCodewords(),
                x = l.getECCodewordsPerBlock() + _;
              p[g++] = new t(_, new Uint8Array(x));
            }
        } catch (I) {
          s = { error: I };
        } finally {
          try {
            v && !v.done && (a = m.return) && a.call(m);
          } 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, y = 0; y < S; y++)
          for (var C = 0; C < g; C++) p[C].codewords[y] = e[P++];
        for (var C = w; C < g; C++) p[C].codewords[S] = e[P++];
        for (var A = p[0].codewords.length, y = S; y < A; y++)
          for (var C = 0; C < g; C++) {
            var T = C < w ? y : y + 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 Ne();
        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
    );
  })(),
  s2e = (function () {
    function t() {}
    return (
      (t.decode = function (e, n, r, i) {
        var o = new V9(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 = wn.getCharacterSetECIByValue(p)), u === null))
                  throw new me();
                break;
              case kt.HANZI:
                var g = o.readBits(4),
                  m = o.readBits(d.getCharacterCountBits(n));
                g === t.GB2312_SUBSET && t.decodeHanziSegment(o, s, m);
                break;
              default:
                var v = o.readBits(d.getCharacterCountBits(n));
                switch (d) {
                  case kt.NUMERIC:
                    t.decodeNumericSegment(o, s, v);
                    break;
                  case kt.ALPHANUMERIC:
                    t.decodeAlphanumericSegment(o, s, v, f);
                    break;
                  case kt.BYTE:
                    t.decodeByteSegment(o, s, v, u, a, i);
                    break;
                  case kt.KANJI:
                    t.decodeKanjiSegment(o, s, v);
                    break;
                  default:
                    throw new me();
                }
                break;
            }
          } while (d !== kt.TERMINATOR);
        } catch {
          throw new me();
        }
        return new Om(
          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, rt.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, rt.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 = rt.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
    );
  })(),
  j9 = (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
    );
  })(),
  KP =
    (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."
      );
    },
  a2e = (function () {
    function t() {
      this.rsDecoder = new Rm(Cr.QR_CODE_FIELD_256);
    }
    return (
      (t.prototype.decodeBooleanArray = function (e, n) {
        return this.decodeBitMatrix(wo.parseFromBooleanArray(e), n);
      }),
      (t.prototype.decodeBitMatrix = function (e, n) {
        var r = new i2e(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 j9(!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 = o2e.getDataBlocks(c, a, l),
          f = 0;
        try {
          for (var d = KP(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 g = new Uint8Array(f),
          m = 0;
        try {
          for (var v = KP(u), y = v.next(); !y.done; y = v.next()) {
            var p = y.value,
              _ = p.getCodewords(),
              x = p.getNumDataCodewords();
            this.correctErrors(_, x);
            for (var b = 0; b < x; b++) g[m++] = _[b];
          }
        } catch (w) {
          o = { error: w };
        } finally {
          try {
            y && !y.done && (s = v.return) && s.call(v);
          } finally {
            if (o) throw o.error;
          }
        }
        return s2e.decode(g, 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 dn();
        }
        for (var i = 0; i < n; i++) e[i] = r[i];
      }),
      t
    );
  })(),
  l2e =
    (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());
      };
    })(),
  c2e = (function (t) {
    l2e(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),
  u2e =
    (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."
      );
    },
  f2e = (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 = u2e(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 c2e(a, l, c);
          this.possibleCenters.push(h),
            this.resultPointCallback !== null &&
              this.resultPointCallback !== void 0 &&
              this.resultPointCallback.foundPossibleResultPoint(h);
        }
        return null;
      }),
      t
    );
  })(),
  d2e =
    (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());
      };
    })(),
  h2e = (function (t) {
    d2e(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),
  p2e = (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
    );
  })(),
  Qu =
    (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."
      );
    },
  g2e = (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(Mt.TRY_HARDER) !== void 0,
          r = e != null && e.get(Mt.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 g = this.selectBestPatterns();
        return Pe.orderBestPatterns(g), new p2e(g);
      }),
      (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 h2e(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 = Qu(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 = Qu(this.possibleCenters), c = l.next();
            !c.done;
            c = l.next()
          ) {
            var u = c.value;
            u.getCount() >= t.CENTER_QUORUM &&
              (o++, (s += u.getEstimatedModuleSize()));
          }
        } catch (g) {
          e = { error: g };
        } 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 = Qu(this.possibleCenters), p = h.next();
            !p.done;
            p = h.next()
          ) {
            var u = p.value;
            d += Math.abs(u.getEstimatedModuleSize() - f);
          }
        } catch (g) {
          r = { error: g };
        } finally {
          try {
            p && !p.done && (i = h.return) && i.call(h);
          } finally {
            if (r) throw r.error;
          }
        }
        return d <= 0.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 = Qu(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 g = Math.max(0.2 * a, p), m = 0;
            m < s.length && s.length > 3;
            m++
          ) {
            var v = s[m];
            Math.abs(v.getEstimatedModuleSize() - a) > g &&
              (s.splice(m, 1), m--);
          }
        }
        if (s.length > 3) {
          var l = 0;
          try {
            for (var y = Qu(s), _ = y.next(); !_.done; _ = y.next()) {
              var x = _.value;
              l += x.getEstimatedModuleSize();
            }
          } catch (w) {
            r = { error: w };
          } finally {
            try {
              _ && !_.done && (i = y.return) && i.call(y);
            } 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
    );
  })(),
  m2e = (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(Mt.NEED_RESULT_POINT_CALLBACK);
        var n = new g2e(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 = cl.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())),
              g = 4;
            g <= 16;
            g <<= 1
          )
            try {
              c = this.findAlignmentInRegion(o, h, p, g);
              break;
            } catch (_) {
              if (!(_ instanceof oe)) throw _;
            }
        var m = t.createTransform(n, r, i, c, s),
          v = t.sampleGrid(this.image, m, s),
          y;
        return c === null ? (y = [i, n, r]) : (y = [i, n, r, c]), new fE(v, y);
      }),
      (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)),
          $9.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 = dE.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,
            g = n;
          p !== h;
          p += u
        ) {
          var m = o ? g : p,
            v = o ? p : g;
          if ((d === 1) === this.image.get(m, v)) {
            if (d === 2) return ft.distance(p, g, e, n);
            d++;
          }
          if (((c += l), c > 0)) {
            if (g === i) break;
            (g += 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 f2e(
          this.image,
          s,
          l,
          a - s,
          c - l,
          e,
          this.resultPointCallback
        );
        return u.find();
      }),
      t
    );
  })(),
  v2e = (function () {
    function t() {
      this.decoder = new a2e();
    }
    return (
      (t.prototype.getDecoder = function () {
        return this.decoder;
      }),
      (t.prototype.decode = function (e, n) {
        var r, i;
        if (n != null && n.get(Mt.PURE_BARCODE) !== void 0) {
          var o = t.extractPureBits(e.getBlackMatrix());
          (r = this.decoder.decodeBitMatrix(o, n)), (i = t.NO_POINTS);
        } else {
          var s = new m2e(e.getBlackMatrix()).detect(n);
          (r = this.decoder.decodeBitMatrix(s.getBits(), n)),
            (i = s.getPoints());
        }
        r.getOther() instanceof j9 && r.getOther().applyMirroredCorrection(i);
        var a = new rr(
            r.getText(),
            r.getRawBytes(),
            void 0,
            i,
            Be.QR_CODE,
            void 0
          ),
          l = r.getByteSegments();
        l !== null && a.putMetadata(zn.BYTE_SEGMENTS, l);
        var c = r.getECLevel();
        return (
          c !== null && a.putMetadata(zn.ERROR_CORRECTION_LEVEL, c),
          r.hasStructuredAppend() &&
            (a.putMetadata(
              zn.STRUCTURED_APPEND_SEQUENCE,
              r.getStructuredAppendSequenceNumber()
            ),
            a.putMetadata(
              zn.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 wo(c, u), g = 0; g < u; g++)
          for (var m = o + Math.floor(g * i), v = 0; v < c; v++)
            e.get(a + Math.floor(v * i), m) && p.set(v, g);
        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 J0 = v2e;
var 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."
      );
    },
  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 = y2e(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 = En.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
    );
  })(),
  _2e = (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
    );
  })(),
  x2e =
    (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."
      );
    },
  b2e = (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 _2e(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), x2e(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 && En.fill(a, null), a;
      }),
      (t.findGuardPattern = function (e, n, r, i, o, s, a) {
        En.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]),
                Rt.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 = 0.42),
      (t.MAX_INDIVIDUAL_VARIANCE = 0.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
    );
  })(),
  w2e =
    (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."
      );
    },
  Ja = (function () {
    function t(e, n) {
      if (n.length === 0) throw new Ne();
      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)),
            Rt.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 = w2e(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 Ne("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;
        Rt.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 Ne("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 Ne("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 Ne();
        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
    );
  })(),
  E2e = (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 Ne();
        return this.logTable[e];
      }),
      (t.prototype.inverse = function (e) {
        if (e === 0) throw new L9();
        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
    );
  })(),
  S2e =
    (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());
      };
    })(),
  C2e = (function (t) {
    S2e(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 Ja(i, new Int32Array([0]))),
        (i.one = new Ja(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 Ne();
        if (r === 0) return this.zero;
        var i = new Int32Array(n + 1);
        return (i[0] = r), new Ja(this, i);
      }),
      (e.PDF417_GF = new e(at.NUMBER_OF_CODEWORDS, 3)),
      e
    );
  })(E2e),
  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."
      );
    },
  T2e = (function () {
    function t() {
      this.field = C2e.PDF417_GF;
    }
    return (
      (t.prototype.decode = function (e, n, r) {
        for (
          var i,
            o,
            s = new Ja(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 = A2e(r), h = d.next(); !h.done; h = d.next()) {
              var p = h.value,
                g = this.field.exp(e.length - 1 - p),
                m = new Ja(
                  this.field,
                  new Int32Array([this.field.subtract(0, g), 1])
                );
              f = f.multiply(m);
            }
          } catch (S) {
            i = { error: S };
          } finally {
            try {
              h && !h.done && (o = d.return) && o.call(d);
            } finally {
              if (i) throw i.error;
            }
          }
        for (
          var v = new Ja(this.field, a),
            y = this.runEuclideanAlgorithm(
              this.field.buildMonomial(n, 1),
              v,
              n
            ),
            _ = y[0],
            x = y[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 dn.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 dn.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(),
              g = this.field.multiply(s.getCoefficient(s.getDegree()), h);
            (f = f.add(this.field.buildMonomial(p, g))),
              (s = s.subtract(o.multiplyByMonomial(p, g)));
          }
          l = f.multiply(a).subtract(u).negative();
        }
        var m = l.getCoefficient(0);
        if (m === 0) throw dn.getChecksumInstance();
        var v = this.field.inverse(m),
          y = l.multiply(v),
          _ = s.multiply(v);
        return [y, _];
      }),
      (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 dn.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 Ja(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
    );
  })(),
  Bx = (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
    );
  })(),
  P2e = (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
    );
  })(),
  pE = (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), g = l && l[0] + "" == "0" ? "0" : " ";
              h.length < p;

            )
              h = a !== void 0 ? h + g : g + 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
    );
  })(),
  I2e =
    (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."
      );
    },
  W9 = (function () {
    function t(e) {
      (this.boundingBox = new Bx(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 pE(),
          i = 0;
        try {
          for (
            var o = I2e(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
    );
  })(),
  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."
      );
    },
  R2e =
    (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;
    },
  hf = (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 = O2e(this.values.entries()), a = s.next();
            !a.done;
            a = s.next()
          ) {
            var l = R2e(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
    );
  })(),
  M2e =
    (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());
      };
    })(),
  $v =
    (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 (t) {
    M2e(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 = $v(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 g = void 0;
              u > 2 ? (g = (u - 2) * p) : (g = p);
              for (var m = g >= d, v = 1; v <= g && !m; v++)
                m = r[d - v] != null;
              m ? (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 = $v(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 hf(),
          s = new hf(),
          a = new hf(),
          l = new hf();
        try {
          for (var c = $v(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 (g) {
          n = { error: g };
        } 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 P2e(
          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
    );
  })(W9),
  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."
      );
    },
  B2e = (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 = D2e(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 pE(), 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
    );
  })(),
  k2e = (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
    );
  })(),
  N2e = (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 = Rx.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
    );
  })(),
  F2e = (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
    );
  })(),
  ZP = (function () {
    function t() {}
    return (
      (t.parseLong = function (e, n) {
        return n === void 0 && (n = void 0), parseInt(e, n);
      }),
      t
    );
  })(),
  L2e =
    (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());
      };
    })(),
  $2e = (function (t) {
    L2e(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (e.kind = "NullPointerException"), e;
  })(kr),
  U2e = (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 $2e();
        if (n < 0 || n > e.length || r < 0 || n + r > e.length || n + r < 0)
          throw new uE();
        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
    );
  })(),
  G2e =
    (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());
      };
    })(),
  H2e = (function (t) {
    G2e(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return e;
  })(kr),
  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());
      };
    })(),
  z2e = (function (t) {
    V2e(e, t);
    function e(n) {
      n === void 0 && (n = 32);
      var r = t.call(this) || this;
      if (((r.count = 0), n < 0)) throw new Ne("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 H2e();
          i = qe.MAX_VALUE;
        }
        this.buf = En.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 uE();
        this.ensureCapacity(this.count + i),
          Rt.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 En.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
    );
  })(U2e),
  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 Y9() {
  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 Cp;
function Bs(t) {
  if ((typeof Cp > "u" && (Cp = Y9()), Cp === null))
    throw new Error("BigInt is not supported!");
  return Cp(t);
}
function j2e() {
  var t = [];
  t[0] = Bs(1);
  var e = Bs(900);
  t[1] = e;
  for (var n = 2; n < 16; n++) t[n] = t[n - 1] * e;
  return t;
}
var W2e = (function () {
    function t() {}
    return (
      (t.decode = function (e, n) {
        var r = new Ke(""),
          i = wn.ISO8859_1;
        r.enableDecoding(i);
        for (var o = 1, s = e[o++], a = new F2e(); 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:
              wn.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 Om(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(ZP.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(ZP.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 g = n - a;
          r.isLastSegment() && g--,
            r.setOptionalData(En.copyOfRange(e, a, a + g));
        }
        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 z2e(),
          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(Bs(l) >> Bs(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(Bs(l) >> Bs(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 = Bs(0), i = 0; i < n; i++)
          r += t.EXP900[n - i - 1] * Bs(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 = Y9() ? j2e() : []),
      (t.NUMBER_OF_SEQUENCE_CODEWORDS = 2),
      t
    );
  })(),
  ef =
    (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."
      );
    },
  Y2e = (function () {
    function t() {}
    return (
      (t.decode = function (e, n, r, i, o, s, a) {
        for (
          var l = new Bx(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 g = c != null, m = 1; m <= p; m++) {
          var v = g ? m : p - m;
          if (f.getDetectionResultColumn(v) === void 0) {
            var y = void 0;
            v === 0 || v === p ? (y = new qP(l, v === 0)) : (y = new W9(l)),
              f.setDetectionResultColumn(v, y);
            for (var _ = -1, x = _, b = l.getMinY(); b <= l.getMaxY(); b++) {
              if (
                ((_ = t.getStartColumn(f, v, b, g)), _ < 0 || _ > l.getMaxX())
              ) {
                if (x === -1) continue;
                _ = x;
              }
              var w = t.detectCodeword(
                e,
                l.getMinX(),
                l.getMaxX(),
                g,
                _,
                b,
                s,
                a
              );
              w != null &&
                (y.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 = Bx.merge(t.adjustBoundingBox(e), t.adjustBoundingBox(n));
        return new B2e(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 = ef(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 = ef(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 qP(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 dn;
            if (!c) throw u;
          }
          if (s.length === 0) throw dn.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 dn.getChecksumInstance();
        }
        throw dn.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 hf();
        var c = 0;
        try {
          for (
            var u = ef(e.getDetectionResultColumns()), f = u.next();
            !f.done;
            f = u.next()
          ) {
            var d = f.value;
            if (d != null)
              try {
                for (
                  var h = ((i = void 0), ef(d.getCodewords())), p = h.next();
                  !p.done;
                  p = h.next()
                ) {
                  var g = p.value;
                  if (g != null) {
                    var m = g.getRowNumber();
                    if (m >= 0) {
                      if (m >= s.length) continue;
                      s[m][c].setValue(g.getValue());
                    }
                  }
                }
              } catch (v) {
                i = { error: v };
              } finally {
                try {
                  p && !p.done && (o = h.return) && o.call(h);
                } finally {
                  if (i) throw i.error;
                }
              }
            c++;
          }
        } catch (v) {
          n = { error: v };
        } 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),
                  ef(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 = N2e.getDecodedValue(c),
          g = at.getCodeword(p);
        return g === -1 ? null : new k2e(o, u, t.getCodewordBucketNumber(p), g);
      }),
      (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 = W2e.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 dn.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 pE(), 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 T2e()),
      t
    );
  })(),
  X2e =
    (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."
      );
    },
  Q0 = (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 dn
            ? oe.getNotFoundInstance()
            : r;
        }
      }),
      (t.decode = function (e, n, r) {
        var i,
          o,
          s = new Array(),
          a = b2e.detectMultiple(e, n, r);
        try {
          for (
            var l = X2e(a.getPoints()), c = l.next();
            !c.done;
            c = l.next()
          ) {
            var u = c.value,
              f = Y2e.decode(
                a.getBits(),
                u[4],
                u[5],
                u[6],
                u[7],
                t.getMinCodewordWidth(u),
                t.getMaxCodewordWidth(u)
              ),
              d = new rr(f.getText(), f.getRawBytes(), void 0, u, Be.PDF_417);
            d.putMetadata(zn.ERROR_CORRECTION_LEVEL, f.getECLevel());
            var h = f.getOther();
            h != null && d.putMetadata(zn.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
    );
  })(),
  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());
      };
    })(),
  JP = (function (t) {
    K2e(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (e.kind = "ReaderException"), e;
  })(kr),
  QP =
    (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."
      );
    },
  X9 = (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(Mt.TRY_HARDER) !== void 0,
          r = e == null ? null : e.get(Mt.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 Cc(e)),
            r.includes(Be.QR_CODE) && i.push(new J0()),
            r.includes(Be.DATA_MATRIX) && i.push(new Z0()),
            r.includes(Be.AZTEC) && i.push(new K0()),
            r.includes(Be.PDF_417) && i.push(new Q0()),
            o && n && i.push(new Cc(e));
        }
        i.length === 0 &&
          (n || i.push(new Cc(e)),
          i.push(new J0()),
          i.push(new Z0()),
          i.push(new K0()),
          i.push(new Q0()),
          n && i.push(new Cc(e))),
          (this.readers = i);
      }),
      (t.prototype.reset = function () {
        var e, n;
        if (this.readers !== null)
          try {
            for (
              var r = QP(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 JP("No readers where selected, nothing can be read.");
        try {
          for (var i = QP(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 JP) 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
    );
  })(),
  q2e =
    (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) {
  q2e(e, t);
  function e(n, r) {
    n === void 0 && (n = null), r === void 0 && (r = 500);
    var i = this,
      o = new X9();
    return o.setHints(n), (i = t.call(this, o, r) || this), i;
  }
  return (
    (e.prototype.decodeBitmap = function (n) {
      return this.reader.decodeWithState(n);
    }),
    e
  );
})(Tu);
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());
    };
  })();
(function (t) {
  Z2e(e, t);
  function e(n) {
    return n === void 0 && (n = 500), t.call(this, new Q0(), n) || this;
  }
  return e;
})(Tu);
var J2e =
  (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) {
  J2e(e, t);
  function e(n) {
    return n === void 0 && (n = 500), t.call(this, new J0(), n) || this;
  }
  return e;
})(Tu);
var kx;
(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");
})(kx || (kx = {}));
const Ap = kx;
var K9 = (function () {
    function t(e) {
      (this.field = e),
        (this.cachedGenerators = []),
        this.cachedGenerators.push(new Qs(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 Qs(
                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 Ne("No error correction bytes");
        var r = e.length - n;
        if (r <= 0) throw new Ne("No data bytes provided");
        var i = this.buildGenerator(n),
          o = new Int32Array(r);
        Rt.arraycopy(e, 0, o, 0, r);
        var s = new Qs(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;
        Rt.arraycopy(l, 0, e, r + c, l.length);
      }),
      t
    );
  })(),
  pf = (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 Ne("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
    );
  })(),
  Q2e =
    (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."
      );
    },
  eEe = (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 = Q2e(this.bytes), o = i.next(); !o.done; o = i.next()) {
            var s = o.value;
            En.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
    );
  })(),
  Nx = (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
    );
  })(),
  tEe =
    (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) {
    tEe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (e.kind = "WriterException"), e;
  })(kr),
  eI = (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 kn();
        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 kn();
          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 && pf.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 Ne("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 (!Nx.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 kn();
        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
    );
  })(),
  nEe = (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
    );
  })(),
  tI =
    (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 (
        pf.applyMaskPenaltyRule1(e) +
        pf.applyMaskPenaltyRule2(e) +
        pf.applyMaskPenaltyRule3(e) +
        pf.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(Ap.CHARACTER_SET) !== void 0;
      o && (i = r.get(Ap.CHARACTER_SET).toString());
      var s = this.chooseMode(e, i),
        a = new kn();
      if (s === kt.BYTE && (o || t.DEFAULT_BYTE_MODE_ENCODING !== i)) {
        var l = wn.getCharacterSetECIByName(i);
        l !== void 0 && this.appendECI(l, a);
      }
      this.appendModeInfo(s, a);
      var c = new kn();
      this.appendBytes(e, s, c, i);
      var u;
      if (r !== null && r.get(Ap.QR_VERSION) !== void 0) {
        var f = Number.parseInt(r.get(Ap.QR_VERSION).toString(), 10);
        u = cl.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 kn();
      h.appendBitArray(a);
      var p = s === kt.BYTE ? c.getSizeInBytes() : e.length;
      this.appendLengthInfo(p, u, s, h), h.appendBitArray(c);
      var g = u.getECBlocksForLevel(n),
        m = u.getTotalCodewords() - g.getTotalECCodewords();
      this.terminateBits(m, h);
      var v = this.interleaveWithECBytes(
          h,
          u.getTotalCodewords(),
          m,
          g.getNumBlocks()
        ),
        y = new Nx();
      y.setECLevel(n), y.setMode(s), y.setVersion(u);
      var _ = u.getDimensionForVersion(),
        x = new eEe(_, _),
        b = this.chooseMaskPattern(v, n, u, x);
      return (
        y.setMaskPattern(b), eI.buildMatrix(v, n, u, b, x), y.setMatrix(x), y
      );
    }),
    (t.recommendVersion = function (e, n, r, i) {
      var o = this.calculateBitsNeeded(n, r, i, cl.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),
        wn.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, wn.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 < Nx.NUM_MASK_PATTERNS;
        a++
      ) {
        eI.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 = cl.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),
          g = new Int32Array(1);
        t.getNumDataBytesAndNumECBytesForBlockID(n, r, i, h, p, g);
        var m = p[0],
          v = new Uint8Array(m);
        e.toBytes(8 * c, v, 0, m);
        var y = t.generateECBytes(v, g[0]);
        d.push(new nEe(v, y)),
          (u = Math.max(u, m)),
          (f = Math.max(f, y.length)),
          (c += p[0]);
      }
      if (r !== c) throw new Bt("Data bytes does not match offset");
      for (var _ = new kn(), h = 0; h < u; ++h)
        try {
          for (
            var x = ((o = void 0), tI(d)), b = x.next();
            !b.done;
            b = x.next()
          ) {
            var w = b.value,
              v = w.getDataBytes();
            h < v.length && _.appendBits(v[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), tI(d)), S = E.next();
            !S.done;
            S = E.next()
          ) {
            var w = S.value,
              y = w.getErrorCorrectionBytes();
            h < y.length && _.appendBits(y[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 K9(Cr.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, wn.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 = wn.UTF8.getName()),
    t
  );
})();
var rEe =
  (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) {
  rEe(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 Ne("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 Ne("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 Rt.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 Rt.arraycopy(this.yuvData, s, o, 0, i), o;
      for (var a = 0; a < r; a++) {
        var l = a * n;
        Rt.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 Im(this);
    }),
    (e.THUMBNAIL_SCALE_FACTOR = 2),
    e
  );
})(mh);
var iEe =
  (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) {
  iEe(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,
          g = (h >> 7) & 510,
          m = h & 255;
        f[d] = ((p + g + m) / 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 Ne("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 Ne("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 Rt.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 Rt.arraycopy(this.luminances, s, o, 0, i), o;
      for (var a = 0; a < r; a++) {
        var l = a * n;
        Rt.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 Im(this);
    }),
    e
  );
})(mh);
var oEe =
    (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());
      };
    })(),
  sEe = (function (t) {
    oEe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (
      (e.forName = function (n) {
        return this.getCharacterSetECIByName(n);
      }),
      e
    );
  })(wn),
  aEe = (function () {
    function t() {}
    return (t.ISO_8859_1 = wn.ISO8859_1), t;
  })(),
  Fx,
  lEe = 301,
  cEe = function (t, e) {
    for (var n = 1, r = 0; r < 255; r++)
      (e[r] = n), (t[n] = r), (n *= 2), n >= 256 && (n ^= lEe);
    return { LOG: t, ALOG: e };
  };
(Fx = cEe([], [])), Fx.LOG;
Fx.ALOG;
var nI;
(function (t) {
  (t[(t.FORCE_NONE = 0)] = "FORCE_NONE"),
    (t[(t.FORCE_SQUARE = 1)] = "FORCE_SQUARE"),
    (t[(t.FORCE_RECTANGLE = 2)] = "FORCE_RECTANGLE");
})(nI || (nI = {}));
var rI = 129,
  q9 = 230,
  uEe = 231,
  fEe = 235,
  dEe = 236,
  hEe = 237,
  pEe = 238,
  gEe = 239,
  mEe = 240,
  Uv = 254,
  vEe = 254,
  iI = "[)>05",
  oI = "[)>06",
  sI = "",
  xt = 0,
  Un = 1,
  lr = 2,
  yn = 3,
  On = 4,
  Kn = 5,
  yEe = (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 Kn:
                e.writeCodeword(uEe), e.signalEncoderChange(Kn);
                return;
              case Un:
                e.writeCodeword(q9), e.signalEncoderChange(Un);
                return;
              case yn:
                e.writeCodeword(pEe), e.signalEncoderChange(yn);
                break;
              case lr:
                e.writeCodeword(gEe), e.signalEncoderChange(lr);
                break;
              case On:
                e.writeCodeword(mEe), e.signalEncoderChange(On);
                break;
              default:
                throw new Error("Illegal mode: " + i);
            }
          else
            Ri.isExtendedASCII(r)
              ? (e.writeCodeword(fEe), 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
    );
  })(),
  _Ee = (function () {
    function t() {}
    return (
      (t.prototype.getEncodingMode = function () {
        return Kn;
      }),
      (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, rt.getCharAt(o));
          else if (o <= 1555)
            n.setCharAt(0, rt.getCharAt(Math.floor(o / 250) + 249)),
              n.insert(1, rt.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
    );
  })(),
  gE = (function () {
    function t() {}
    return (
      (t.prototype.getEncodingMode = function () {
        return Un;
      }),
      (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(q9), 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(Uv);
        } else if (s === 1 && i === 1) {
          for (; n.length() >= 3; ) this.writeNextTriplet(e, n);
          e.hasMoreCharacters() && e.writeCodeword(Uv), e.pos--;
        } else if (i === 0) {
          for (; n.length() >= 3; ) this.writeNextTriplet(e, n);
          (s > 0 || e.hasMoreCharacters()) && e.writeCodeword(Uv);
        } 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
    );
  })(),
  xEe = (function () {
    function t() {}
    return (
      (t.prototype.getEncodingMode = function () {
        return On;
      }),
      (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(rt.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(rt.getCharAt(e - 64))
          : Ri.illegalCharacter(rt.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
    );
  })(),
  bEe =
    (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());
      };
    })(),
  wEe =
    (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 = wEe(SEe), 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
    );
  })(),
  EEe = (function (t) {
    bEe(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),
  SEe = [
    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 EEe(),
  ],
  CEe = (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
    );
  })(),
  AEe =
    (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());
      };
    })(),
  TEe = (function (t) {
    AEe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (
      (e.prototype.getEncodingMode = function () {
        return yn;
      }),
      (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(rt.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(vEe),
          n.getNewEncoding() < 0 && n.signalEncoderChange(xt);
      }),
      e
    );
  })(gE),
  PEe =
    (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());
      };
    })(),
  IEe = (function (t) {
    PEe(e, t);
    function e() {
      return (t !== null && t.apply(this, arguments)) || this;
    }
    return (
      (e.prototype.getEncodingMode = function () {
        return lr;
      }),
      (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
    );
  })(gE),
  OEe = (function () {
    function t() {}
    return (
      (t.randomize253State = function (e) {
        var n = ((149 * e) % 253) + 1,
          r = rI + 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 gE(),
          a = [new yEe(), s, new IEe(), new TEe(), new xEe(), new _Ee()],
          l = new CEe(e);
        l.setSymbolShape(n),
          l.setSizeConstraints(r, i),
          e.startsWith(iI) && e.endsWith(sI)
            ? (l.writeCodeword(dEe), l.setSkipAtEnd(2), (l.pos += iI.length))
            : e.startsWith(oI) &&
              e.endsWith(sI) &&
              (l.writeCodeword(hEe), l.setSkipAtEnd(2), (l.pos += oI.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 !== Kn && c !== On && l.writeCodeword("þ");
        var d = l.getCodewords();
        for (d.length() < f && d.append(rI); 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 === yn && i === yn) {
          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 === On && i === On) {
          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) {
            En.fill(s, 0), En.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[Kn] > 0) return Kn;
              if (s[On] > 0) return On;
              if (s[lr] > 0) return lr;
              if (s[yn] > 0) return yn;
            }
            return Un;
          }
          var u = e.charCodeAt(n + o);
          if (
            (o++,
            this.isDigit(u)
              ? (i[xt] += 0.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[Un] += 2 / 3)
              : this.isExtendedASCII(u)
              ? (i[Un] += 8 / 3)
              : (i[Un] += 4 / 3),
            this.isNativeText(u)
              ? (i[lr] += 2 / 3)
              : this.isExtendedASCII(u)
              ? (i[lr] += 8 / 3)
              : (i[lr] += 4 / 3),
            this.isNativeX12(u)
              ? (i[yn] += 2 / 3)
              : this.isExtendedASCII(u)
              ? (i[yn] += 13 / 3)
              : (i[yn] += 10 / 3),
            this.isNativeEDIFACT(u)
              ? (i[On] += 3 / 4)
              : this.isExtendedASCII(u)
              ? (i[On] += 17 / 4)
              : (i[On] += 13 / 4),
            this.isSpecialB256(u) ? (i[Kn] += 4) : i[Kn]++,
            o >= 4)
          ) {
            if (
              (En.fill(s, 0),
              En.fill(a, 0),
              this.findMinimums(i, a, qe.MAX_VALUE, s),
              a[xt] < this.min(a[Kn], a[Un], a[lr], a[yn], a[On]))
            )
              return xt;
            if (
              a[Kn] < a[xt] ||
              a[Kn] + 1 < this.min(a[Un], a[lr], a[yn], a[On])
            )
              return Kn;
            if (a[On] + 1 < this.min(a[Kn], a[Un], a[lr], a[yn], a[xt]))
              return On;
            if (a[lr] + 1 < this.min(a[Kn], a[Un], a[On], a[yn], a[xt]))
              return lr;
            if (a[yn] + 1 < this.min(a[Kn], a[Un], a[On], a[lr], a[xt]))
              return yn;
            if (a[Un] + 1 < this.min(a[xt], a[Kn], a[On], a[lr])) {
              if (a[Un] < a[yn]) return Un;
              if (a[Un] === a[yn]) {
                for (var f = n + o + 1; f < e.length; ) {
                  var d = e.charCodeAt(f);
                  if (this.isX12TermSep(d)) return yn;
                  if (!this.isNativeX12(d)) break;
                  f++;
                }
                return Un;
              }
            }
          }
        }
      }),
      (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), En.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 = OEe;
var Gv =
    (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."
      );
    },
  aI = (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
    );
  })(),
  REe = (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 aI(sEe.forName(P));
      })),
        (this.encoders = []);
      var u = [];
      u.push(new aI(aEe.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), Gv(u)), g = p.next();
            !g.done;
            g = p.next()
          ) {
            var m = g.value,
              v = e.charAt(d),
              y = v.charCodeAt(0);
            if (y === r || m.canEncode(v)) {
              h = !0;
              break;
            }
          }
        } catch (P) {
          i = { error: P };
        } finally {
          try {
            g && !g.done && (o = p.return) && o.call(p);
          } finally {
            if (i) throw i.error;
          }
        }
        if (!h)
          try {
            for (
              var _ = ((s = void 0), Gv(this.ENCODERS)), x = _.next();
              !x.done;
              x = _.next()
            ) {
              var m = x.value;
              if (m.canEncode(e.charAt(d))) {
                u.push(m), (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 = Gv(u), E = w.next(); !E.done; E = w.next()) {
            var m = E.value;
            this.encoders[b++] = m;
          }
        } 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(rt.getCharAt(e), this.encoders[n].name);
      }),
      t
    );
  })(),
  MEe = 3,
  DEe = (function () {
    function t(e, n, r) {
      this.fnc1 = r;
      var i = new REe(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 lI(a, n, u, o, s));
      }),
      (t.prototype.encodeMinimally = function (e, n, r) {
        var i = e.length,
          o = new lI[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 g = [], s = 0; s < g.length; s++) g[s] = f[s];
        return g;
      }),
      t
    );
  })(),
  lI = (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 += MEe),
        i != null && (s += i.cachedTotalSize),
        (this.cachedTotalSize = s);
    }
    return (
      (t.prototype.isFNC1 = function () {
        return this.c === 1e3;
      }),
      t
    );
  })(),
  BEe =
    (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 kEe =
  (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 cI;
(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");
})(cI || (cI = {}));
(function (t) {
  BEe(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
  );
})(DEe);
var NEe = (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
    );
  })(),
  uI = (function () {
    function t() {}
    return (
      (t.singletonList = function (e) {
        return [e];
      }),
      (t.min = function (e, n) {
        return e.sort(n)[0];
      }),
      t
    );
  })(),
  FEe = (function () {
    function t(e) {
      this.previous = e;
    }
    return (
      (t.prototype.getPrevious = function () {
        return this.previous;
      }),
      t
    );
  })(),
  LEe =
    (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) {
    LEe(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
    );
  })(FEe),
  $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());
      };
    })(),
  UEe = (function (t) {
    $Ee(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
    );
  })(mE);
function GEe(t, e, n) {
  return new UEe(t, e, n);
}
function tf(t, e, n) {
  return new mE(t, e, n);
}
var HEe = ["UPPER", "LOWER", "DIGIT", "MIXED", "PUNCT"],
  ea = 0,
  eg = 1,
  fi = 2,
  Z9 = 3,
  lo = 4,
  VEe = new mE(null, 0, 0),
  Hv = [
    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,
    ]),
  ],
  zEe =
    (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 jEe(t) {
  var e, n;
  try {
    for (var r = zEe(t), i = r.next(); !i.done; i = r.next()) {
      var o = i.value;
      En.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[ea][lo] = 0),
    (t[eg][lo] = 0),
    (t[eg][ea] = 28),
    (t[Z9][lo] = 0),
    (t[fi][lo] = 0),
    (t[fi][ea] = 15),
    t
  );
}
var J9 = jEe(En.createInt32Array(6, 6)),
  WEe =
    (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."
      );
    },
  YEe = (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 = Hv[this.mode][e];
          (i = tf(i, o & 65535, o >> 16)), (r += o >> 16);
        }
        var s = e === fi ? 4 : 5;
        return (i = tf(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 = tf(r, J9[this.mode][e], i)),
          (r = tf(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 === lo || this.mode === fi) {
          var o = Hv[r][ea];
          (n = tf(n, o & 65535, o >> 16)), (i += o >> 16), (r = ea);
        }
        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 = GEe(
            n,
            e - this.binaryShiftByteCount,
            this.binaryShiftByteCount
          )),
          new t(n, this.mode, 0, this.bitCount)
        );
      }),
      (t.prototype.isBetterThanOrEqualTo = function (e) {
        var n = this.bitCount + (Hv[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 kn();
        try {
          for (var a = WEe(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 rt.format(
          "%s bits=%d bytes=%d",
          HEe[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(VEe, ea, 0, 0)),
      t
    );
  })();
function XEe(t) {
  var e = rt.getCharCode(" "),
    n = rt.getCharCode("."),
    r = rt.getCharCode(",");
  t[ea][e] = 1;
  for (var i = rt.getCharCode("Z"), o = rt.getCharCode("A"), s = o; s <= i; s++)
    t[ea][s] = s - o + 2;
  t[eg][e] = 1;
  for (var a = rt.getCharCode("z"), l = rt.getCharCode("a"), s = l; s <= a; s++)
    t[eg][s] = s - l + 2;
  t[fi][e] = 1;
  for (var c = rt.getCharCode("9"), u = rt.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[Z9][rt.getCharCode(f[d])] = d;
  for (
    var h = [
        "\0",
        "\r",
        "\0",
        "\0",
        "\0",
        "\0",
        "!",
        "'",
        "#",
        "$",
        "%",
        "&",
        "'",
        "(",
        ")",
        "*",
        "+",
        ",",
        "-",
        ".",
        "/",
        ":",
        ";",
        "<",
        "=",
        ">",
        "?",
        "[",
        "]",
        "{",
        "}",
      ],
      d = 0;
    d < h.length;
    d++
  )
    rt.getCharCode(h[d]) > 0 && (t[lo][rt.getCharCode(h[d])] = d);
  return t;
}
var Vv = XEe(En.createInt32Array(5, 256)),
  Tp =
    (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."
      );
    },
  KEe = (function () {
    function t(e) {
      this.text = e;
    }
    return (
      (t.prototype.encode = function () {
        for (
          var e = rt.getCharCode(" "),
            n = rt.getCharCode(`
`),
            r = uI.singletonList(YEe.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 rt.getCharCode("\r"):
              o = s === n ? 2 : 0;
              break;
            case rt.getCharCode("."):
              o = s === e ? 3 : 0;
              break;
            case rt.getCharCode(","):
              o = s === e ? 4 : 0;
              break;
            case rt.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 = uI.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 = Tp(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 = Vv[e.getMode()][i] > 0,
            s = null,
            a = 0;
          a <= lo;
          a++
        ) {
          var l = Vv[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 && J9[e.getMode()][a] >= 0) {
              var u = s.shiftAndAppend(a, l);
              r.push(u);
            }
          }
        }
        if (e.getBinaryShiftByteCount() > 0 || Vv[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 = Tp(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(lo, r)),
          e.getMode() !== lo && i.push(o.shiftAndAppend(lo, 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 = Tp(e), l = a.next(); !l.done; l = a.next()) {
            var c = l.value,
              u = !0,
              f = function (m) {
                if (m.isBetterThanOrEqualTo(c)) return (u = !1), "break";
                c.isBetterThanOrEqualTo(m) &&
                  (s = s.filter(function (v) {
                    return v !== m;
                  }));
              };
            try {
              for (
                var d = ((i = void 0), Tp(s)), h = d.next();
                !h.done;
                h = d.next()
              ) {
                var p = h.value,
                  g = f(p);
                if (g === "break") break;
              }
            } catch (m) {
              i = { error: m };
            } finally {
              try {
                h && !h.done && (o = d.return) && o.call(d);
              } finally {
                if (i) throw i.error;
              }
            }
            u && s.push(c);
          }
        } catch (m) {
          n = { error: m };
        } finally {
          try {
            l && !l.done && (r = a.return) && r.call(a);
          } finally {
            if (n) throw n.error;
          }
        }
        return s;
      }),
      t
    );
  })(),
  qEe =
    (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 KEe(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 Ne(rt.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 Ne("Data to large for user specified layer");
        if (a && f.getSize() > u * 64)
          throw new Ne("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 Ne("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),
        g = f.getSize() / u,
        m = t.generateModeMessage(a, l, g),
        v = (a ? 11 : 14) + l * 4,
        y = new Int32Array(v),
        _;
      if (a) {
        _ = v;
        for (var h = 0; h < y.length; h++) y[h] = h;
      } else {
        _ = v + 1 + 2 * qe.truncDivision(qe.truncDivision(v, 2) - 1, 15);
        for (
          var x = qe.truncDivision(v, 2), b = qe.truncDivision(_, 2), h = 0;
          h < x;
          h++
        ) {
          var w = h + qe.truncDivision(h, 15);
          (y[x - h - 1] = b - w - 1), (y[x + h] = b + w + 1);
        }
      }
      for (var E = new wo(_), 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(y[h * 2 + T], y[h * 2 + C]),
              p.get(S + P * 2 + A + T) &&
                E.set(y[h * 2 + C], y[v - 1 - h * 2 - T]),
              p.get(S + P * 4 + A + T) &&
                E.set(y[v - 1 - h * 2 - T], y[v - 1 - h * 2 - C]),
              p.get(S + P * 6 + A + T) &&
                E.set(y[v - 1 - h * 2 - C], y[h * 2 + T]);
        S += P * 8;
      }
      if ((t.drawModeMessage(E, a, _, m), 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(v, 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 NEe();
      return (
        I.setCompact(a),
        I.setSize(_),
        I.setLayers(l),
        I.setCodeWords(g),
        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 kn();
      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 K9(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 kn();
      f.appendBits(0, u);
      try {
        for (var d = qEe(Array.from(c)), h = d.next(); !h.done; h = d.next()) {
          var p = h.value;
          f.appendBits(p, r);
        }
      } catch (g) {
        i = { error: g };
      } 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 Cr.AZTEC_PARAM;
        case 6:
          return Cr.AZTEC_DATA_6;
        case 8:
          return Cr.AZTEC_DATA_8;
        case 10:
          return Cr.AZTEC_DATA_10;
        case 12:
          return Cr.AZTEC_DATA_12;
        default:
          throw new Ne("Unsupported word size " + e);
      }
    }),
    (t.stuffBits = function (e, n) {
      for (
        var r = new kn(), 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 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());
      };
    })(),
  JEe = (function (t) {
    ZEe(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 Ne("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 Im(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
    );
  })(mh);
function Q9() {
  return typeof navigator < "u";
}
function QEe() {
  return Q9() && !!navigator.mediaDevices;
}
function eSe() {
  return !!(QEe() && navigator.mediaDevices.enumerateDevices);
}
var Tc =
    (globalThis && globalThis.__assign) ||
    function () {
      return (
        (Tc =
          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;
          }),
        Tc.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 };
      }
    },
  zv =
    (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."
      );
    },
  tSe = {
    delayBetweenScanAttempts: 500,
    delayBetweenScanSuccess: 500,
    tryPlayVideoTimeout: 5e3,
  },
  Pu = (function () {
    function t(e, n, r) {
      n === void 0 && (n = new Map()),
        r === void 0 && (r = {}),
        (this.reader = e),
        (this.hints = n),
        (this.options = Tc(Tc({}, tSe), r));
    }
    return (
      Object.defineProperty(t.prototype, "possibleFormats", {
        set: function (e) {
          this.hints.set(Mt.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 = zv(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 JEe(e),
          r = new F9(n);
        return new N9(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 (!Q9())
                  throw new Error(
                    "Can't enumerate devices, navigator is not present."
                  );
                if (!eSe())
                  throw new Error(
                    "Can't enumerate devices, method not supported."
                  );
                return [4, navigator.mediaDevices.enumerateDevices()];
              case 1:
                (e = h.sent()), (n = []);
                try {
                  for (r = zv(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 = Tc(Tc({}, a), {
                    stop: function () {
                      a.stop();
                    },
                    streamVideoConstraintsApply: function (g, m) {
                      return zt(this, void 0, void 0, function () {
                        var v, y, _, x, b, w, E;
                        return jt(this, function (S) {
                          switch (S.label) {
                            case 0:
                              (v = m ? l.filter(m) : l), (S.label = 1);
                            case 1:
                              S.trys.push([1, 6, 7, 8]),
                                (y = zv(v)),
                                (_ = y.next()),
                                (S.label = 2);
                            case 2:
                              return _.done
                                ? [3, 5]
                                : ((x = _.value), [4, x.applyConstraints(g)]);
                            case 3:
                              S.sent(), (S.label = 4);
                            case 4:
                              return (_ = y.next()), [3, 2];
                            case 5:
                              return [3, 8];
                            case 6:
                              return (b = S.sent()), (w = { error: b }), [3, 8];
                            case 7:
                              try {
                                _ && !_.done && (E = y.return) && E.call(y);
                              } finally {
                                if (w) throw w.error;
                              }
                              return [7];
                            case 8:
                              return [2];
                          }
                        });
                      });
                    },
                    streamVideoConstraintsGet: function (g) {
                      return l.find(g).getConstraints();
                    },
                    streamVideoSettingsGet: function (g) {
                      return l.find(g).getSettings();
                    },
                    streamVideoCapabilitiesGet: function (g) {
                      return l.find(g).getCapabilities();
                    },
                  })),
                  (u = t.mediaStreamIsTorchCompatible(e)),
                  u &&
                    ((f =
                      l == null
                        ? void 0
                        : l.find(function (g) {
                            return t.mediaStreamIsTorchCompatibleTrack(g);
                          })),
                    (d = function (g) {
                      return zt(h, void 0, void 0, function () {
                        return jt(this, function (m) {
                          switch (m.label) {
                            case 0:
                              return [4, t.mediaStreamSetTorch(f, g)];
                            case 1:
                              return m.sent(), [2];
                          }
                        });
                      });
                    }),
                    (c.switchTorch = d),
                    (c.stop = function () {
                      return zt(h, void 0, void 0, function () {
                        return jt(this, function (g) {
                          switch (g.label) {
                            case 0:
                              return a.stop(), [4, d(!1)];
                            case 1:
                              return g.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 dn && 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 (v) {
                n(void 0, v, f);
                var p = v instanceof dn,
                  g = v instanceof me,
                  m = v instanceof oe;
                if (p || g || m) {
                  c = setTimeout(d, i.options.delayBetweenScanAttempts);
                  return;
                }
                a(), r && r(v);
              }
          };
        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
    );
  })(),
  nSe =
    (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) {
  nSe(e, t);
  function e(n, r) {
    return t.call(this, new K0(), n, r) || this;
  }
  return e;
})(Pu);
var rSe =
  (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) {
  rSe(e, t);
  function e(n, r) {
    return t.call(this, new Cc(n), n, r) || this;
  }
  return e;
})(Pu);
var iSe =
  (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) {
  iSe(e, t);
  function e(n, r) {
    return t.call(this, new Z0(), n, r) || this;
  }
  return e;
})(Pu);
var oSe =
  (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) {
  oSe(e, t);
  function e(n, r) {
    var i = this,
      o = new X9();
    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(Mt.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
  );
})(Pu);
var sSe =
  (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) {
  sSe(e, t);
  function e(n, r) {
    return t.call(this, new Q0(), n, r) || this;
  }
  return e;
})(Pu);
var aSe =
    (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());
      };
    })(),
  sIe = (function (t) {
    aSe(e, t);
    function e(n, r) {
      return t.call(this, new J0(), n, r) || this;
    }
    return e;
  })(Pu);
const eF = new Set(),
  Wr = new WeakMap(),
  Fc = new WeakMap(),
  Il = new WeakMap(),
  Lx = new WeakMap(),
  lSe = new WeakMap(),
  fu = new WeakMap(),
  tg = new WeakMap();
let ua;
const Qa = "__aa_tgt",
  $x = "__aa_del",
  cSe = (t) => {
    const e = pSe(t);
    e && e.forEach((n) => gSe(n));
  },
  uSe = (t) => {
    t.forEach((e) => {
      e.target === ua && dSe(), Wr.has(e.target) && Hl(e.target);
    });
  };
function fSe(t) {
  const e = Lx.get(t);
  e == null || e.disconnect();
  let n = Wr.get(t),
    r = 0;
  const i = 5;
  n || ((n = du(t)), Wr.set(t, n));
  const { offsetWidth: o, offsetHeight: s } = ua,
    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 && Hl(t);
      },
      { root: ua, threshold: 1, rootMargin: l }
    );
  c.observe(t), Lx.set(t, c);
}
function Hl(t) {
  clearTimeout(tg.get(t));
  const e = Mm(t),
    n = typeof e == "function" ? 500 : e.duration;
  tg.set(
    t,
    setTimeout(() => {
      const r = Il.get(t);
      (!r || r.finished) && (Wr.set(t, du(t)), fSe(t));
    }, n)
  );
}
function dSe() {
  clearTimeout(tg.get(ua)),
    tg.set(
      ua,
      setTimeout(() => {
        eF.forEach((t) => rF(t, (e) => tF(() => Hl(e))));
      }, 100)
    );
}
function hSe(t) {
  setTimeout(() => {
    lSe.set(
      t,
      setInterval(() => tF(Hl.bind(null, t)), 2e3)
    );
  }, Math.round(2e3 * Math.random()));
}
function tF(t) {
  typeof requestIdleCallback == "function"
    ? requestIdleCallback(() => t())
    : requestAnimationFrame(() => t());
}
let Ux, Pc;
typeof window < "u" &&
  ((ua = document.documentElement),
  (Ux = new MutationObserver(cSe)),
  (Pc = new ResizeObserver(uSe)),
  Pc.observe(ua));
function pSe(t) {
  return t.reduce((e, n) => {
    if (e === !1) return !1;
    if (n.target instanceof Element) {
      if ((jv(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 ($x in i) return !1;
            jv(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 ($x in i) return !1;
          i instanceof Element &&
            (e.add(i),
            jv(n.target, i),
            Fc.set(i, [n.previousSibling, n.nextSibling]));
        }
    }
    return e;
  }, new Set());
}
function jv(t, e) {
  !e && !(Qa in t)
    ? Object.defineProperty(t, Qa, { value: t })
    : e && !(Qa in e) && Object.defineProperty(e, Qa, { value: t });
}
function gSe(t) {
  var e;
  const n = ua.contains(t),
    r = Wr.has(t);
  n && Fc.has(t) && Fc.delete(t),
    Il.has(t) && ((e = Il.get(t)) === null || e === void 0 || e.cancel()),
    r && n ? mSe(t) : r && !n ? ySe(t) : vSe(t);
}
function to(t) {
  return Number(t.replace(/[^0-9.\-]/g, ""));
}
function du(t) {
  const e = t.getBoundingClientRect();
  return {
    top: e.top + window.scrollY,
    left: e.left + window.scrollX,
    width: e.width,
    height: e.height,
  };
}
function nF(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 =
        to(a.paddingTop) +
        to(a.paddingBottom) +
        to(a.borderTopWidth) +
        to(a.borderBottomWidth),
      u =
        to(a.paddingLeft) +
        to(a.paddingRight) +
        to(a.borderRightWidth) +
        to(a.borderLeftWidth);
    (r -= u), (o -= u), (i -= c), (s -= c);
  }
  return [r, o, i, s].map(Math.round);
}
function Mm(t) {
  return Qa in t && fu.has(t[Qa])
    ? fu.get(t[Qa])
    : { duration: 250, easing: "ease-in-out" };
}
function rF(t, ...e) {
  e.forEach((n) => n(t, fu.has(t)));
  for (let n = 0; n < t.children.length; n++) {
    const r = t.children.item(n);
    r && e.forEach((i) => i(r, fu.has(r)));
  }
}
function mSe(t) {
  const e = Wr.get(t),
    n = du(t);
  let r;
  if (!e) return;
  const i = Mm(t);
  if (typeof i != "function") {
    const o = e.left - n.left,
      s = e.top - n.top,
      [a, l, c, u] = nF(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();
  Il.set(t, r), Wr.set(t, n), r.addEventListener("finish", Hl.bind(null, t));
}
function vSe(t) {
  const e = du(t);
  Wr.set(t, e);
  const n = Mm(t);
  let r;
  typeof n != "function"
    ? (r = t.animate(
        [
          { transform: "scale(.98)", opacity: 0 },
          { transform: "scale(0.98)", opacity: 0, offset: 0.5 },
          { transform: "scale(1)", opacity: 1 },
        ],
        { duration: n.duration * 1.5, easing: "ease-in" }
      ))
    : ((r = new Animation(n(t, "add", e))), r.play()),
    Il.set(t, r),
    r.addEventListener("finish", Hl.bind(null, t));
}
function ySe(t) {
  if (!Fc.has(t) || !Wr.has(t)) return;
  const [e, n] = Fc.get(t);
  Object.defineProperty(t, $x, { 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] = _Se(t),
    a = Mm(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()),
    Il.set(t, c),
    c.addEventListener("finish", () => {
      var u;
      t.remove(),
        Wr.delete(t),
        Fc.delete(t),
        Il.delete(t),
        (u = Lx.get(t)) === null || u === void 0 || u.disconnect();
    });
}
function _Se(t) {
  const e = Wr.get(t),
    [n, , r] = nF(t, e, du(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) || du(i),
    a = Math.round(e.top - s.top) - to(o.borderTopWidth),
    l = Math.round(e.left - s.left) - to(o.borderLeftWidth);
  return [a, l, n, r];
}
function aIe(t, e = {}) {
  Ux &&
    Pc &&
    (getComputedStyle(t).position === "static" &&
      Object.assign(t.style, { position: "relative" }),
    rF(t, Hl, hSe, (n) => (Pc == null ? void 0 : Pc.observe(n))),
    typeof e == "function"
      ? fu.set(t, e)
      : fu.set(t, { duration: 250, easing: "ease-in-out", ...e }),
    Ux.observe(t, { childList: !0 }),
    eF.add(t));
}
var Iu = TypeError;
const xSe = Db(oge);
var vE = typeof Map == "function" && Map.prototype,
  Wv =
    Object.getOwnPropertyDescriptor && vE
      ? Object.getOwnPropertyDescriptor(Map.prototype, "size")
      : null,
  ng = vE && Wv && typeof Wv.get == "function" ? Wv.get : null,
  fI = vE && Map.prototype.forEach,
  yE = typeof Set == "function" && Set.prototype,
  Yv =
    Object.getOwnPropertyDescriptor && yE
      ? Object.getOwnPropertyDescriptor(Set.prototype, "size")
      : null,
  rg = yE && Yv && typeof Yv.get == "function" ? Yv.get : null,
  dI = yE && Set.prototype.forEach,
  bSe = typeof WeakMap == "function" && WeakMap.prototype,
  Hf = bSe ? WeakMap.prototype.has : null,
  wSe = typeof WeakSet == "function" && WeakSet.prototype,
  Vf = wSe ? WeakSet.prototype.has : null,
  ESe = typeof WeakRef == "function" && WeakRef.prototype,
  hI = ESe ? WeakRef.prototype.deref : null,
  SSe = Boolean.prototype.valueOf,
  CSe = Object.prototype.toString,
  ASe = Function.prototype.toString,
  TSe = String.prototype.match,
  _E = String.prototype.slice,
  js = String.prototype.replace,
  PSe = String.prototype.toUpperCase,
  pI = String.prototype.toLowerCase,
  iF = RegExp.prototype.test,
  gI = Array.prototype.concat,
  io = Array.prototype.join,
  ISe = Array.prototype.slice,
  mI = Math.floor,
  Gx = typeof BigInt == "function" ? BigInt.prototype.valueOf : null,
  Xv = Object.getOwnPropertySymbols,
  Hx =
    typeof Symbol == "function" && typeof Symbol.iterator == "symbol"
      ? Symbol.prototype.toString
      : null,
  hu = typeof Symbol == "function" && typeof Symbol.iterator == "object",
  zf =
    typeof Symbol == "function" &&
    Symbol.toStringTag &&
    (typeof Symbol.toStringTag === hu || "symbol")
      ? Symbol.toStringTag
      : null,
  oF = Object.prototype.propertyIsEnumerable,
  vI =
    (typeof Reflect == "function"
      ? Reflect.getPrototypeOf
      : Object.getPrototypeOf) ||
    ([].__proto__ === Array.prototype
      ? function (t) {
          return t.__proto__;
        }
      : null);
function yI(t, e) {
  if (
    t === 1 / 0 ||
    t === -1 / 0 ||
    t !== t ||
    (t && t > -1e3 && t < 1e3) ||
    iF.call(/e/, e)
  )
    return e;
  var n = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
  if (typeof t == "number") {
    var r = t < 0 ? -mI(-t) : mI(t);
    if (r !== t) {
      var i = String(r),
        o = _E.call(e, i.length + 1);
      return (
        js.call(i, n, "$&_") +
        "." +
        js.call(js.call(o, /([0-9]{3})/g, "$&_"), /_$/, "")
      );
    }
  }
  return js.call(e, n, "$&_");
}
var Vx = xSe,
  _I = Vx.custom,
  xI = lF(_I) ? _I : null,
  sF = { __proto__: null, double: '"', single: "'" },
  OSe = { __proto__: null, double: /(["\\])/g, single: /(['\\])/g },
  Dm = function t(e, n, r, i) {
    var o = n || {};
    if (Lo(o, "quoteStyle") && !Lo(sF, o.quoteStyle))
      throw new TypeError('option "quoteStyle" must be "single" or "double"');
    if (
      Lo(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 = Lo(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 (
      Lo(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 (Lo(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 uF(e, o);
    if (typeof e == "number") {
      if (e === 0) return 1 / 0 / e > 0 ? "0" : "-0";
      var l = String(e);
      return a ? yI(e, l) : l;
    }
    if (typeof e == "bigint") {
      var c = String(e) + "n";
      return a ? yI(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 zx(e) ? "[Array]" : "[Object]";
    var f = XSe(o, r);
    if (typeof i > "u") i = [];
    else if (cF(i, e) >= 0) return "[Circular]";
    function d(I, B, G) {
      if ((B && ((i = ISe.call(i)), i.push(B)), G)) {
        var D = { depth: o.depth };
        return (
          Lo(o, "quoteStyle") && (D.quoteStyle = o.quoteStyle),
          t(I, D, r + 1, i)
        );
      }
      return t(I, o, r + 1, i);
    }
    if (typeof e == "function" && !bI(e)) {
      var h = $Se(e),
        p = Pp(e, d);
      return (
        "[Function" +
        (h ? ": " + h : " (anonymous)") +
        "]" +
        (p.length > 0 ? " { " + io.call(p, ", ") + " }" : "")
      );
    }
    if (lF(e)) {
      var g = hu
        ? js.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1")
        : Hx.call(e);
      return typeof e == "object" && !hu ? nf(g) : g;
    }
    if (jSe(e)) {
      for (
        var m = "<" + pI.call(String(e.nodeName)),
          v = e.attributes || [],
          y = 0;
        y < v.length;
        y++
      )
        m += " " + v[y].name + "=" + aF(RSe(v[y].value), "double", o);
      return (
        (m += ">"),
        e.childNodes && e.childNodes.length && (m += "..."),
        (m += "</" + pI.call(String(e.nodeName)) + ">"),
        m
      );
    }
    if (zx(e)) {
      if (e.length === 0) return "[]";
      var _ = Pp(e, d);
      return f && !YSe(_)
        ? "[" + jx(_, f) + "]"
        : "[ " + io.call(_, ", ") + " ]";
    }
    if (DSe(e)) {
      var x = Pp(e, d);
      return !("cause" in Error.prototype) &&
        "cause" in e &&
        !oF.call(e, "cause")
        ? "{ [" +
            String(e) +
            "] " +
            io.call(gI.call("[cause]: " + d(e.cause), x), ", ") +
            " }"
        : x.length === 0
        ? "[" + String(e) + "]"
        : "{ [" + String(e) + "] " + io.call(x, ", ") + " }";
    }
    if (typeof e == "object" && s) {
      if (xI && typeof e[xI] == "function" && Vx)
        return Vx(e, { depth: u - r });
      if (s !== "symbol" && typeof e.inspect == "function") return e.inspect();
    }
    if (USe(e)) {
      var b = [];
      return (
        fI &&
          fI.call(e, function (I, B) {
            b.push(d(B, e, !0) + " => " + d(I, e));
          }),
        wI("Map", ng.call(e), b, f)
      );
    }
    if (VSe(e)) {
      var w = [];
      return (
        dI &&
          dI.call(e, function (I) {
            w.push(d(I, e));
          }),
        wI("Set", rg.call(e), w, f)
      );
    }
    if (GSe(e)) return Kv("WeakMap");
    if (zSe(e)) return Kv("WeakSet");
    if (HSe(e)) return Kv("WeakRef");
    if (kSe(e)) return nf(d(Number(e)));
    if (FSe(e)) return nf(d(Gx.call(e)));
    if (NSe(e)) return nf(SSe.call(e));
    if (BSe(e)) return nf(d(String(e)));
    if (typeof window < "u" && e === window) return "{ [object Window] }";
    if (
      (typeof globalThis < "u" && e === globalThis) ||
      (typeof os < "u" && e === os)
    )
      return "{ [object globalThis] }";
    if (!MSe(e) && !bI(e)) {
      var E = Pp(e, d),
        S = vI
          ? vI(e) === Object.prototype
          : e instanceof Object || e.constructor === Object,
        P = e instanceof Object ? "" : "null prototype",
        C =
          !S && zf && Object(e) === e && zf in e
            ? _E.call(ba(e), 8, -1)
            : P
            ? "Object"
            : "",
        A =
          S || typeof e.constructor != "function"
            ? ""
            : e.constructor.name
            ? e.constructor.name + " "
            : "",
        T =
          A +
          (C || P
            ? "[" + io.call(gI.call([], C || [], P || []), ": ") + "] "
            : "");
      return E.length === 0
        ? T + "{}"
        : f
        ? T + "{" + jx(E, f) + "}"
        : T + "{ " + io.call(E, ", ") + " }";
    }
    return String(e);
  };
function aF(t, e, n) {
  var r = n.quoteStyle || e,
    i = sF[r];
  return i + t + i;
}
function RSe(t) {
  return js.call(String(t), /"/g, "&quot;");
}
function Vl(t) {
  return !zf || !(typeof t == "object" && (zf in t || typeof t[zf] < "u"));
}
function zx(t) {
  return ba(t) === "[object Array]" && Vl(t);
}
function MSe(t) {
  return ba(t) === "[object Date]" && Vl(t);
}
function bI(t) {
  return ba(t) === "[object RegExp]" && Vl(t);
}
function DSe(t) {
  return ba(t) === "[object Error]" && Vl(t);
}
function BSe(t) {
  return ba(t) === "[object String]" && Vl(t);
}
function kSe(t) {
  return ba(t) === "[object Number]" && Vl(t);
}
function NSe(t) {
  return ba(t) === "[object Boolean]" && Vl(t);
}
function lF(t) {
  if (hu) return t && typeof t == "object" && t instanceof Symbol;
  if (typeof t == "symbol") return !0;
  if (!t || typeof t != "object" || !Hx) return !1;
  try {
    return Hx.call(t), !0;
  } catch {}
  return !1;
}
function FSe(t) {
  if (!t || typeof t != "object" || !Gx) return !1;
  try {
    return Gx.call(t), !0;
  } catch {}
  return !1;
}
var LSe =
  Object.prototype.hasOwnProperty ||
  function (t) {
    return t in this;
  };
function Lo(t, e) {
  return LSe.call(t, e);
}
function ba(t) {
  return CSe.call(t);
}
function $Se(t) {
  if (t.name) return t.name;
  var e = TSe.call(ASe.call(t), /^function\s*([\w$]+)/);
  return e ? e[1] : null;
}
function cF(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 USe(t) {
  if (!ng || !t || typeof t != "object") return !1;
  try {
    ng.call(t);
    try {
      rg.call(t);
    } catch {
      return !0;
    }
    return t instanceof Map;
  } catch {}
  return !1;
}
function GSe(t) {
  if (!Hf || !t || typeof t != "object") return !1;
  try {
    Hf.call(t, Hf);
    try {
      Vf.call(t, Vf);
    } catch {
      return !0;
    }
    return t instanceof WeakMap;
  } catch {}
  return !1;
}
function HSe(t) {
  if (!hI || !t || typeof t != "object") return !1;
  try {
    return hI.call(t), !0;
  } catch {}
  return !1;
}
function VSe(t) {
  if (!rg || !t || typeof t != "object") return !1;
  try {
    rg.call(t);
    try {
      ng.call(t);
    } catch {
      return !0;
    }
    return t instanceof Set;
  } catch {}
  return !1;
}
function zSe(t) {
  if (!Vf || !t || typeof t != "object") return !1;
  try {
    Vf.call(t, Vf);
    try {
      Hf.call(t, Hf);
    } catch {
      return !0;
    }
    return t instanceof WeakSet;
  } catch {}
  return !1;
}
function jSe(t) {
  return !t || typeof t != "object"
    ? !1
    : typeof HTMLElement < "u" && t instanceof HTMLElement
    ? !0
    : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
}
function uF(t, e) {
  if (t.length > e.maxStringLength) {
    var n = t.length - e.maxStringLength,
      r = "... " + n + " more character" + (n > 1 ? "s" : "");
    return uF(_E.call(t, 0, e.maxStringLength), e) + r;
  }
  var i = OSe[e.quoteStyle || "single"];
  i.lastIndex = 0;
  var o = js.call(js.call(t, i, "\\$1"), /[\x00-\x1f]/g, WSe);
  return aF(o, "single", e);
}
function WSe(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" : "") + PSe.call(e.toString(16));
}
function nf(t) {
  return "Object(" + t + ")";
}
function Kv(t) {
  return t + " { ? }";
}
function wI(t, e, n, r) {
  var i = r ? jx(n, r) : io.call(n, ", ");
  return t + " (" + e + ") {" + i + "}";
}
function YSe(t) {
  for (var e = 0; e < t.length; e++)
    if (
      cF(
        t[e],
        `
`
      ) >= 0
    )
      return !1;
  return !0;
}
function XSe(t, e) {
  var n;
  if (t.indent === "	") n = "	";
  else if (typeof t.indent == "number" && t.indent > 0)
    n = io.call(Array(t.indent + 1), " ");
  else return null;
  return { base: n, prev: io.call(Array(e + 1), n) };
}
function jx(t, e) {
  if (t.length === 0) return "";
  var n =
    `
` +
    e.prev +
    e.base;
  return (
    n +
    io.call(t, "," + n) +
    `
` +
    e.prev
  );
}
function Pp(t, e) {
  var n = zx(t),
    r = [];
  if (n) {
    r.length = t.length;
    for (var i = 0; i < t.length; i++) r[i] = Lo(t, i) ? e(t[i], t) : "";
  }
  var o = typeof Xv == "function" ? Xv(t) : [],
    s;
  if (hu) {
    s = {};
    for (var a = 0; a < o.length; a++) s["$" + o[a]] = o[a];
  }
  for (var l in t)
    Lo(t, l) &&
      ((n && String(Number(l)) === l && l < t.length) ||
        (hu && s["$" + l] instanceof Symbol) ||
        (iF.call(/[^\w$]/, l)
          ? r.push(e(l, t) + ": " + e(t[l], t))
          : r.push(l + ": " + e(t[l], t))));
  if (typeof Xv == "function")
    for (var c = 0; c < o.length; c++)
      oF.call(t, o[c]) && r.push("[" + e(o[c]) + "]: " + e(t[o[c]], t));
  return r;
}
var KSe = Dm,
  qSe = Iu,
  Bm = 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;
  },
  ZSe = function (t, e) {
    if (t) {
      var n = Bm(t, e);
      return n && n.value;
    }
  },
  JSe = function (t, e, n) {
    var r = Bm(t, e);
    r ? (r.value = n) : (t.next = { key: e, next: t.next, value: n });
  },
  QSe = function (t, e) {
    return t ? !!Bm(t, e) : !1;
  },
  eCe = function (t, e) {
    if (t) return Bm(t, e, !0);
  },
  tCe = function () {
    var e,
      n = {
        assert: function (r) {
          if (!n.has(r))
            throw new qSe("Side channel does not contain " + KSe(r));
        },
        delete: function (r) {
          var i = e && e.next,
            o = eCe(e, r);
          return o && i && i === o && (e = void 0), !!o;
        },
        get: function (r) {
          return ZSe(e, r);
        },
        has: function (r) {
          return QSe(e, r);
        },
        set: function (r, i) {
          e || (e = { next: void 0 }), JSe(e, r, i);
        },
      };
    return n;
  },
  fF = Object,
  nCe = Error,
  rCe = EvalError,
  iCe = RangeError,
  oCe = ReferenceError,
  sCe = SyntaxError,
  aCe = URIError,
  lCe = Math.abs,
  cCe = Math.floor,
  uCe = Math.max,
  fCe = Math.min,
  dCe = Math.pow,
  hCe = Math.round,
  pCe =
    Number.isNaN ||
    function (e) {
      return e !== e;
    },
  gCe = pCe,
  mCe = function (e) {
    return gCe(e) || e === 0 ? e : e < 0 ? -1 : 1;
  },
  vCe = Object.getOwnPropertyDescriptor,
  n0 = vCe;
if (n0)
  try {
    n0([], "length");
  } catch {
    n0 = null;
  }
var dF = n0,
  r0 = Object.defineProperty || !1;
if (r0)
  try {
    r0({}, "a", { value: 1 });
  } catch {
    r0 = !1;
  }
var yCe = r0,
  qv,
  EI;
function _Ce() {
  return (
    EI ||
      ((EI = 1),
      (qv = 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;
      })),
    qv
  );
}
var Zv, SI;
function xCe() {
  if (SI) return Zv;
  SI = 1;
  var t = typeof Symbol < "u" && Symbol,
    e = _Ce();
  return (
    (Zv = function () {
      return typeof t != "function" ||
        typeof Symbol != "function" ||
        typeof t("foo") != "symbol" ||
        typeof Symbol("bar") != "symbol"
        ? !1
        : e();
    }),
    Zv
  );
}
var Jv, CI;
function hF() {
  return (
    CI ||
      ((CI = 1),
      (Jv = (typeof Reflect < "u" && Reflect.getPrototypeOf) || null)),
    Jv
  );
}
var Qv, AI;
function pF() {
  if (AI) return Qv;
  AI = 1;
  var t = fF;
  return (Qv = t.getPrototypeOf || null), Qv;
}
var ey, TI;
function bCe() {
  if (TI) return ey;
  TI = 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 (
    (ey = 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 v = c.apply(this, i(u, arguments));
              return Object(v) === v ? v : this;
            }
            return c.apply(l, i(u, arguments));
          },
          h = n(0, c.length - u.length),
          p = [],
          g = 0;
        g < h;
        g++
      )
        p[g] = "$" + g;
      if (
        ((f = Function(
          "binder",
          "return function (" +
            s(p, ",") +
            "){ return binder.apply(this,arguments); }"
        )(d)),
        c.prototype)
      ) {
        var m = function () {};
        (m.prototype = c.prototype),
          (f.prototype = new m()),
          (m.prototype = null);
      }
      return f;
    }),
    ey
  );
}
var ty, PI;
function km() {
  if (PI) return ty;
  PI = 1;
  var t = bCe();
  return (ty = Function.prototype.bind || t), ty;
}
var ny, II;
function xE() {
  return II || ((II = 1), (ny = Function.prototype.call)), ny;
}
var ry, OI;
function gF() {
  return OI || ((OI = 1), (ry = Function.prototype.apply)), ry;
}
var wCe = typeof Reflect < "u" && Reflect && Reflect.apply,
  ECe = km(),
  SCe = gF(),
  CCe = xE(),
  ACe = wCe,
  TCe = ACe || ECe.call(CCe, SCe),
  PCe = km(),
  ICe = Iu,
  OCe = xE(),
  RCe = TCe,
  mF = function (e) {
    if (e.length < 1 || typeof e[0] != "function")
      throw new ICe("a function is required");
    return RCe(PCe, OCe, e);
  },
  iy,
  RI;
function MCe() {
  if (RI) return iy;
  RI = 1;
  var t = mF,
    e = dF,
    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 (
    (iy =
      r && typeof r.get == "function"
        ? t([r.get])
        : typeof o == "function"
        ? function (a) {
            return o(a == null ? a : i(a));
          }
        : !1),
    iy
  );
}
var oy, MI;
function DCe() {
  if (MI) return oy;
  MI = 1;
  var t = hF(),
    e = pF(),
    n = MCe();
  return (
    (oy = 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),
    oy
  );
}
var sy, DI;
function BCe() {
  if (DI) return sy;
  DI = 1;
  var t = Function.prototype.call,
    e = Object.prototype.hasOwnProperty,
    n = km();
  return (sy = n.call(t, e)), sy;
}
var Je,
  kCe = fF,
  NCe = nCe,
  FCe = rCe,
  LCe = iCe,
  $Ce = oCe,
  pu = sCe,
  Lc = Iu,
  UCe = aCe,
  GCe = lCe,
  HCe = cCe,
  VCe = uCe,
  zCe = fCe,
  jCe = dCe,
  WCe = hCe,
  YCe = mCe,
  vF = Function,
  ay = function (t) {
    try {
      return vF('"use strict"; return (' + t + ").constructor;")();
    } catch {}
  },
  Od = dF,
  XCe = yCe,
  ly = function () {
    throw new Lc();
  },
  KCe = Od
    ? (function () {
        try {
          return arguments.callee, ly;
        } catch {
          try {
            return Od(arguments, "callee").get;
          } catch {
            return ly;
          }
        }
      })()
    : ly,
  cc = xCe()(),
  Rn = DCe(),
  qCe = pF(),
  ZCe = hF(),
  yF = gF(),
  yh = xE(),
  yc = {},
  JCe = typeof Uint8Array > "u" || !Rn ? Je : Rn(Uint8Array),
  ul = {
    __proto__: null,
    "%AggregateError%": typeof AggregateError > "u" ? Je : AggregateError,
    "%Array%": Array,
    "%ArrayBuffer%": typeof ArrayBuffer > "u" ? Je : ArrayBuffer,
    "%ArrayIteratorPrototype%": cc && Rn ? Rn([][Symbol.iterator]()) : Je,
    "%AsyncFromSyncIteratorPrototype%": Je,
    "%AsyncFunction%": yc,
    "%AsyncGenerator%": yc,
    "%AsyncGeneratorFunction%": yc,
    "%AsyncIteratorPrototype%": yc,
    "%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%": NCe,
    "%eval%": eval,
    "%EvalError%": FCe,
    "%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%": vF,
    "%GeneratorFunction%": yc,
    "%Int8Array%": typeof Int8Array > "u" ? Je : Int8Array,
    "%Int16Array%": typeof Int16Array > "u" ? Je : Int16Array,
    "%Int32Array%": typeof Int32Array > "u" ? Je : Int32Array,
    "%isFinite%": isFinite,
    "%isNaN%": isNaN,
    "%IteratorPrototype%": cc && Rn ? Rn(Rn([][Symbol.iterator]())) : Je,
    "%JSON%": typeof JSON == "object" ? JSON : Je,
    "%Map%": typeof Map > "u" ? Je : Map,
    "%MapIteratorPrototype%":
      typeof Map > "u" || !cc || !Rn ? Je : Rn(new Map()[Symbol.iterator]()),
    "%Math%": Math,
    "%Number%": Number,
    "%Object%": kCe,
    "%Object.getOwnPropertyDescriptor%": Od,
    "%parseFloat%": parseFloat,
    "%parseInt%": parseInt,
    "%Promise%": typeof Promise > "u" ? Je : Promise,
    "%Proxy%": typeof Proxy > "u" ? Je : Proxy,
    "%RangeError%": LCe,
    "%ReferenceError%": $Ce,
    "%Reflect%": typeof Reflect > "u" ? Je : Reflect,
    "%RegExp%": RegExp,
    "%Set%": typeof Set > "u" ? Je : Set,
    "%SetIteratorPrototype%":
      typeof Set > "u" || !cc || !Rn ? Je : Rn(new Set()[Symbol.iterator]()),
    "%SharedArrayBuffer%":
      typeof SharedArrayBuffer > "u" ? Je : SharedArrayBuffer,
    "%String%": String,
    "%StringIteratorPrototype%": cc && Rn ? Rn(""[Symbol.iterator]()) : Je,
    "%Symbol%": cc ? Symbol : Je,
    "%SyntaxError%": pu,
    "%ThrowTypeError%": KCe,
    "%TypedArray%": JCe,
    "%TypeError%": Lc,
    "%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%": UCe,
    "%WeakMap%": typeof WeakMap > "u" ? Je : WeakMap,
    "%WeakRef%": typeof WeakRef > "u" ? Je : WeakRef,
    "%WeakSet%": typeof WeakSet > "u" ? Je : WeakSet,
    "%Function.prototype.call%": yh,
    "%Function.prototype.apply%": yF,
    "%Object.defineProperty%": XCe,
    "%Object.getPrototypeOf%": qCe,
    "%Math.abs%": GCe,
    "%Math.floor%": HCe,
    "%Math.max%": VCe,
    "%Math.min%": zCe,
    "%Math.pow%": jCe,
    "%Math.round%": WCe,
    "%Math.sign%": YCe,
    "%Reflect.getPrototypeOf%": ZCe,
  };
if (Rn)
  try {
    null.error;
  } catch (t) {
    var QCe = Rn(Rn(t));
    ul["%Error.prototype%"] = QCe;
  }
var eAe = function t(e) {
    var n;
    if (e === "%AsyncFunction%") n = ay("async function () {}");
    else if (e === "%GeneratorFunction%") n = ay("function* () {}");
    else if (e === "%AsyncGeneratorFunction%") n = ay("async function* () {}");
    else if (e === "%AsyncGenerator%") {
      var r = t("%AsyncGeneratorFunction%");
      r && (n = r.prototype);
    } else if (e === "%AsyncIteratorPrototype%") {
      var i = t("%AsyncGenerator%");
      i && Rn && (n = Rn(i.prototype));
    }
    return (ul[e] = n), n;
  },
  BI = {
    __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"],
  },
  _h = km(),
  ig = BCe(),
  tAe = _h.call(yh, Array.prototype.concat),
  nAe = _h.call(yF, Array.prototype.splice),
  kI = _h.call(yh, String.prototype.replace),
  og = _h.call(yh, String.prototype.slice),
  rAe = _h.call(yh, RegExp.prototype.exec),
  iAe =
    /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,
  oAe = /\\(\\)?/g,
  sAe = function (e) {
    var n = og(e, 0, 1),
      r = og(e, -1);
    if (n === "%" && r !== "%")
      throw new pu("invalid intrinsic syntax, expected closing `%`");
    if (r === "%" && n !== "%")
      throw new pu("invalid intrinsic syntax, expected opening `%`");
    var i = [];
    return (
      kI(e, iAe, function (o, s, a, l) {
        i[i.length] = a ? kI(l, oAe, "$1") : s || o;
      }),
      i
    );
  },
  aAe = function (e, n) {
    var r = e,
      i;
    if ((ig(BI, r) && ((i = BI[r]), (r = "%" + i[0] + "%")), ig(ul, r))) {
      var o = ul[r];
      if ((o === yc && (o = eAe(r)), typeof o > "u" && !n))
        throw new Lc(
          "intrinsic " +
            e +
            " exists, but is not available. Please file an issue!"
        );
      return { alias: i, name: r, value: o };
    }
    throw new pu("intrinsic " + e + " does not exist!");
  },
  bE = function (e, n) {
    if (typeof e != "string" || e.length === 0)
      throw new Lc("intrinsic name must be a non-empty string");
    if (arguments.length > 1 && typeof n != "boolean")
      throw new Lc('"allowMissing" argument must be a boolean');
    if (rAe(/^%?[^%]*%?$/, e) === null)
      throw new pu(
        "`%` may not be present anywhere but at the beginning and end of the intrinsic name"
      );
    var r = sAe(e),
      i = r.length > 0 ? r[0] : "",
      o = aAe("%" + i + "%", n),
      s = o.name,
      a = o.value,
      l = !1,
      c = o.alias;
    c && ((i = c[0]), nAe(r, tAe([0, 1], c)));
    for (var u = 1, f = !0; u < r.length; u += 1) {
      var d = r[u],
        h = og(d, 0, 1),
        p = og(d, -1);
      if (
        (h === '"' ||
          h === "'" ||
          h === "`" ||
          p === '"' ||
          p === "'" ||
          p === "`") &&
        h !== p
      )
        throw new pu("property names with quotes must have matching quotes");
      if (
        ((d === "constructor" || !f) && (l = !0),
        (i += "." + d),
        (s = "%" + i + "%"),
        ig(ul, s))
      )
        a = ul[s];
      else if (a != null) {
        if (!(d in a)) {
          if (!n)
            throw new Lc(
              "base intrinsic for " +
                e +
                " exists, but the property is not available."
            );
          return;
        }
        if (Od && u + 1 >= r.length) {
          var g = Od(a, d);
          (f = !!g),
            f && "get" in g && !("originalValue" in g.get)
              ? (a = g.get)
              : (a = a[d]);
        } else (f = ig(a, d)), (a = a[d]);
        f && !l && (ul[s] = a);
      }
    }
    return a;
  },
  _F = bE,
  xF = mF,
  lAe = xF([_F("%String.prototype.indexOf%")]),
  bF = function (e, n) {
    var r = _F(e, !!n);
    return typeof r == "function" && lAe(e, ".prototype.") > -1 ? xF([r]) : r;
  },
  cAe = bE,
  xh = bF,
  uAe = Dm,
  fAe = Iu,
  NI = cAe("%Map%", !0),
  dAe = xh("Map.prototype.get", !0),
  hAe = xh("Map.prototype.set", !0),
  pAe = xh("Map.prototype.has", !0),
  gAe = xh("Map.prototype.delete", !0),
  mAe = xh("Map.prototype.size", !0),
  wF =
    !!NI &&
    function () {
      var e,
        n = {
          assert: function (r) {
            if (!n.has(r))
              throw new fAe("Side channel does not contain " + uAe(r));
          },
          delete: function (r) {
            if (e) {
              var i = gAe(e, r);
              return mAe(e) === 0 && (e = void 0), i;
            }
            return !1;
          },
          get: function (r) {
            if (e) return dAe(e, r);
          },
          has: function (r) {
            return e ? pAe(e, r) : !1;
          },
          set: function (r, i) {
            e || (e = new NI()), hAe(e, r, i);
          },
        };
      return n;
    },
  vAe = bE,
  Nm = bF,
  yAe = Dm,
  Ip = wF,
  _Ae = Iu,
  uc = vAe("%WeakMap%", !0),
  xAe = Nm("WeakMap.prototype.get", !0),
  bAe = Nm("WeakMap.prototype.set", !0),
  wAe = Nm("WeakMap.prototype.has", !0),
  EAe = Nm("WeakMap.prototype.delete", !0),
  SAe = uc
    ? function () {
        var e,
          n,
          r = {
            assert: function (i) {
              if (!r.has(i))
                throw new _Ae("Side channel does not contain " + yAe(i));
            },
            delete: function (i) {
              if (uc && i && (typeof i == "object" || typeof i == "function")) {
                if (e) return EAe(e, i);
              } else if (Ip && n) return n.delete(i);
              return !1;
            },
            get: function (i) {
              return uc &&
                i &&
                (typeof i == "object" || typeof i == "function") &&
                e
                ? xAe(e, i)
                : n && n.get(i);
            },
            has: function (i) {
              return uc &&
                i &&
                (typeof i == "object" || typeof i == "function") &&
                e
                ? wAe(e, i)
                : !!n && n.has(i);
            },
            set: function (i, o) {
              uc && i && (typeof i == "object" || typeof i == "function")
                ? (e || (e = new uc()), bAe(e, i, o))
                : Ip && (n || (n = Ip()), n.set(i, o));
            },
          };
        return r;
      }
    : Ip,
  CAe = Iu,
  AAe = Dm,
  TAe = tCe,
  PAe = wF,
  IAe = SAe,
  OAe = IAe || PAe || TAe,
  RAe = function () {
    var e,
      n = {
        assert: function (r) {
          if (!n.has(r))
            throw new CAe("Side channel does not contain " + AAe(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 = OAe()), e.set(r, i);
        },
      };
    return n;
  },
  MAe = String.prototype.replace,
  DAe = /%20/g,
  cy = { RFC1738: "RFC1738", RFC3986: "RFC3986" },
  wE = {
    default: cy.RFC3986,
    formatters: {
      RFC1738: function (t) {
        return MAe.call(t, DAe, "+");
      },
      RFC3986: function (t) {
        return String(t);
      },
    },
    RFC1738: cy.RFC1738,
    RFC3986: cy.RFC3986,
  },
  BAe = wE,
  uy = Object.prototype.hasOwnProperty,
  Ha = Array.isArray,
  Zi = (function () {
    for (var t = [], e = 0; e < 256; ++e)
      t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
    return t;
  })(),
  kAe = function (e) {
    for (; e.length > 1; ) {
      var n = e.pop(),
        r = n.obj[n.prop];
      if (Ha(r)) {
        for (var i = [], o = 0; o < r.length; ++o)
          typeof r[o] < "u" && i.push(r[o]);
        n.obj[n.prop] = i;
      }
    }
  },
  EF = 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;
  },
  NAe = function t(e, n, r) {
    if (!n) return e;
    if (typeof n != "object" && typeof n != "function") {
      if (Ha(e)) e.push(n);
      else if (e && typeof e == "object")
        ((r && (r.plainObjects || r.allowPrototypes)) ||
          !uy.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 (
      Ha(e) && !Ha(n) && (i = EF(e, r)),
      Ha(e) && Ha(n)
        ? (n.forEach(function (o, s) {
            if (uy.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 uy.call(o, s) ? (o[s] = t(o[s], a, r)) : (o[s] = a), o;
          }, i)
    );
  },
  FAe = function (e, n) {
    return Object.keys(n).reduce(function (r, i) {
      return (r[i] = n[i]), r;
    }, e);
  },
  LAe = 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;
    }
  },
  fy = 1024,
  $Ae = 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 += fy) {
      for (
        var c = s.length >= fy ? s.slice(l, l + fy) : 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 === BAe.RFC1738 && (d === 40 || d === 41))
        ) {
          u[u.length] = c.charAt(f);
          continue;
        }
        if (d < 128) {
          u[u.length] = Zi[d];
          continue;
        }
        if (d < 2048) {
          u[u.length] = Zi[192 | (d >> 6)] + Zi[128 | (d & 63)];
          continue;
        }
        if (d < 55296 || d >= 57344) {
          u[u.length] =
            Zi[224 | (d >> 12)] +
            Zi[128 | ((d >> 6) & 63)] +
            Zi[128 | (d & 63)];
          continue;
        }
        (f += 1),
          (d = 65536 + (((d & 1023) << 10) | (c.charCodeAt(f) & 1023))),
          (u[u.length] =
            Zi[240 | (d >> 18)] +
            Zi[128 | ((d >> 12) & 63)] +
            Zi[128 | ((d >> 6) & 63)] +
            Zi[128 | (d & 63)]);
      }
      a += u.join("");
    }
    return a;
  },
  UAe = 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 kAe(n), e;
  },
  GAe = function (e) {
    return Object.prototype.toString.call(e) === "[object RegExp]";
  },
  HAe = function (e) {
    return !e || typeof e != "object"
      ? !1
      : !!(
          e.constructor &&
          e.constructor.isBuffer &&
          e.constructor.isBuffer(e)
        );
  },
  VAe = function (e, n) {
    return [].concat(e, n);
  },
  zAe = function (e, n) {
    if (Ha(e)) {
      for (var r = [], i = 0; i < e.length; i += 1) r.push(n(e[i]));
      return r;
    }
    return n(e);
  },
  SF = {
    arrayToObject: EF,
    assign: FAe,
    combine: VAe,
    compact: UAe,
    decode: LAe,
    encode: $Ae,
    isBuffer: HAe,
    isRegExp: GAe,
    maybeMap: zAe,
    merge: NAe,
  },
  CF = RAe,
  i0 = SF,
  jf = wE,
  jAe = Object.prototype.hasOwnProperty,
  AF = {
    brackets: function (e) {
      return e + "[]";
    },
    comma: "comma",
    indices: function (e, n) {
      return e + "[" + n + "]";
    },
    repeat: function (e) {
      return e;
    },
  },
  ro = Array.isArray,
  WAe = Array.prototype.push,
  TF = function (t, e) {
    WAe.apply(t, ro(e) ? e : [e]);
  },
  YAe = Date.prototype.toISOString,
  FI = jf.default,
  _n = {
    addQueryPrefix: !1,
    allowDots: !1,
    allowEmptyArrays: !1,
    arrayFormat: "indices",
    charset: "utf-8",
    charsetSentinel: !1,
    commaRoundTrip: !1,
    delimiter: "&",
    encode: !0,
    encodeDotInKeys: !1,
    encoder: i0.encode,
    encodeValuesOnly: !1,
    filter: void 0,
    format: FI,
    formatter: jf.formatters[FI],
    indices: !1,
    serializeDate: function (e) {
      return YAe.call(e);
    },
    skipNulls: !1,
    strictNullHandling: !1,
  },
  XAe = function (e) {
    return (
      typeof e == "string" ||
      typeof e == "number" ||
      typeof e == "boolean" ||
      typeof e == "symbol" ||
      typeof e == "bigint"
    );
  },
  dy = {},
  KAe = function t(e, n, r, i, o, s, a, l, c, u, f, d, h, p, g, m, v, y) {
    for (var _ = e, x = y, b = 0, w = !1; (x = x.get(dy)) !== 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(dy) > "u" && (b = 0);
    }
    if (
      (typeof u == "function"
        ? (_ = u(n, _))
        : _ instanceof Date
        ? (_ = h(_))
        : r === "comma" &&
          ro(_) &&
          (_ = i0.maybeMap(_, function (fe) {
            return fe instanceof Date ? h(fe) : fe;
          })),
      _ === null)
    ) {
      if (s) return c && !m ? c(n, _n.encoder, v, "key", p) : n;
      _ = "";
    }
    if (XAe(_) || i0.isBuffer(_)) {
      if (c) {
        var S = m ? n : c(n, _n.encoder, v, "key", p);
        return [g(S) + "=" + g(c(_, _n.encoder, v, "value", p))];
      }
      return [g(n) + "=" + g(String(_))];
    }
    var P = [];
    if (typeof _ > "u") return P;
    var C;
    if (r === "comma" && ro(_))
      m && c && (_ = i0.maybeMap(_, c)),
        (C = [{ value: _.length > 0 ? _.join(",") || null : void 0 }]);
    else if (ro(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 && ro(_) && _.length === 1 ? T + "[]" : T;
    if (o && ro(_) && _.length === 0) return I + "[]";
    for (var B = 0; B < C.length; ++B) {
      var G = C[B],
        D = typeof G == "object" && G && typeof G.value < "u" ? G.value : _[G];
      if (!(a && D === null)) {
        var $ = d && l ? String(G).replace(/\./g, "%2E") : String(G),
          z = ro(_)
            ? typeof r == "function"
              ? r(I, $)
              : I
            : I + (d ? "." + $ : "[" + $ + "]");
        y.set(e, b);
        var K = CF();
        K.set(dy, y),
          TF(
            P,
            t(
              D,
              z,
              r,
              i,
              o,
              s,
              a,
              l,
              r === "comma" && m && ro(_) ? null : c,
              u,
              f,
              d,
              h,
              p,
              g,
              m,
              v,
              K
            )
          );
      }
    }
    return P;
  },
  qAe = function (e) {
    if (!e) return _n;
    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 || _n.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 = jf.default;
    if (typeof e.format < "u") {
      if (!jAe.call(jf.formatters, e.format))
        throw new TypeError("Unknown format option provided.");
      r = e.format;
    }
    var i = jf.formatters[r],
      o = _n.filter;
    (typeof e.filter == "function" || ro(e.filter)) && (o = e.filter);
    var s;
    if (
      (e.arrayFormat in AF
        ? (s = e.arrayFormat)
        : "indices" in e
        ? (s = e.indices ? "indices" : "repeat")
        : (s = _n.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
          : _n.allowDots
        : !!e.allowDots;
    return {
      addQueryPrefix:
        typeof e.addQueryPrefix == "boolean"
          ? e.addQueryPrefix
          : _n.addQueryPrefix,
      allowDots: a,
      allowEmptyArrays:
        typeof e.allowEmptyArrays == "boolean"
          ? !!e.allowEmptyArrays
          : _n.allowEmptyArrays,
      arrayFormat: s,
      charset: n,
      charsetSentinel:
        typeof e.charsetSentinel == "boolean"
          ? e.charsetSentinel
          : _n.charsetSentinel,
      commaRoundTrip: !!e.commaRoundTrip,
      delimiter: typeof e.delimiter > "u" ? _n.delimiter : e.delimiter,
      encode: typeof e.encode == "boolean" ? e.encode : _n.encode,
      encodeDotInKeys:
        typeof e.encodeDotInKeys == "boolean"
          ? e.encodeDotInKeys
          : _n.encodeDotInKeys,
      encoder: typeof e.encoder == "function" ? e.encoder : _n.encoder,
      encodeValuesOnly:
        typeof e.encodeValuesOnly == "boolean"
          ? e.encodeValuesOnly
          : _n.encodeValuesOnly,
      filter: o,
      format: r,
      formatter: i,
      serializeDate:
        typeof e.serializeDate == "function"
          ? e.serializeDate
          : _n.serializeDate,
      skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : _n.skipNulls,
      sort: typeof e.sort == "function" ? e.sort : null,
      strictNullHandling:
        typeof e.strictNullHandling == "boolean"
          ? e.strictNullHandling
          : _n.strictNullHandling,
    };
  },
  ZAe = function (t, e) {
    var n = t,
      r = qAe(e),
      i,
      o;
    typeof r.filter == "function"
      ? ((o = r.filter), (n = o("", n)))
      : ro(r.filter) && ((o = r.filter), (i = o));
    var s = [];
    if (typeof n != "object" || n === null) return "";
    var a = AF[r.arrayFormat],
      l = a === "comma" && r.commaRoundTrip;
    i || (i = Object.keys(n)), r.sort && i.sort(r.sort);
    for (var c = CF(), u = 0; u < i.length; ++u) {
      var f = i[u],
        d = n[f];
      (r.skipNulls && d === null) ||
        TF(
          s,
          KAe(
            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 : ""
    );
  },
  Ol = SF,
  Wx = Object.prototype.hasOwnProperty,
  LI = Array.isArray,
  qt = {
    allowDots: !1,
    allowEmptyArrays: !1,
    allowPrototypes: !1,
    allowSparse: !1,
    arrayLimit: 20,
    charset: "utf-8",
    charsetSentinel: !1,
    comma: !1,
    decodeDotInKeys: !1,
    decoder: Ol.decode,
    delimiter: "&",
    depth: 5,
    duplicates: "combine",
    ignoreQueryPrefix: !1,
    interpretNumericEntities: !1,
    parameterLimit: 1e3,
    parseArrays: !0,
    plainObjects: !1,
    strictDepth: !1,
    strictNullHandling: !1,
    throwOnLimitExceeded: !1,
  },
  JAe = function (t) {
    return t.replace(/&#(\d+);/g, function (e, n) {
      return String.fromCharCode(parseInt(n, 10));
    });
  },
  PF = 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;
  },
  QAe = "utf8=%26%2310003%3B",
  eTe = "utf8=%E2%9C%93",
  tTe = 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] === eTe ? (c = "utf-8") : s[l] === QAe && (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 = Ol.maybeMap(
              PF(u.slice(d + 1), n, LI(r[h]) ? r[h].length : 0),
              function (m) {
                return n.decoder(m, qt.decoder, c, "value");
              }
            ))),
          p &&
            n.interpretNumericEntities &&
            c === "iso-8859-1" &&
            (p = JAe(String(p))),
          u.indexOf("[]=") > -1 && (p = LI(p) ? [p] : p);
        var g = Wx.call(r, h);
        g && n.duplicates === "combine"
          ? (r[h] = Ol.combine(r[h], p))
          : (!g || n.duplicates === "last") && (r[h] = p);
      }
    return r;
  },
  nTe = 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 : PF(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))
            ? []
            : Ol.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;
  },
  rTe = 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 &&
          Wx.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 &&
            Wx.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 nTe(u, n, r, i);
    }
  },
  iTe = 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" || Ol.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,
    };
  },
  oTe = function (t, e) {
    var n = iTe(e);
    if (t === "" || t === null || typeof t > "u")
      return n.plainObjects ? { __proto__: null } : {};
    for (
      var r = typeof t == "string" ? tTe(t, n) : t,
        i = n.plainObjects ? { __proto__: null } : {},
        o = Object.keys(r),
        s = 0;
      s < o.length;
      ++s
    ) {
      var a = o[s],
        l = rTe(a, r[a], n, typeof t == "string");
      i = Ol.merge(i, l, n);
    }
    return n.allowSparse === !0 ? i : Ol.compact(i);
  },
  sTe = ZAe,
  aTe = oTe,
  lTe = wE,
  cTe = { formats: lTe, parse: aTe, stringify: sTe };
const lIe = fa(cTe);
class uTe extends em {
  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 fTe = Object.freeze(
  Object.defineProperty({ __proto__: null, AppWeb: uTe }, Symbol.toStringTag, {
    value: "Module",
  })
);
var IF = { exports: {} };
(function (t, e) {
  (function (n, r) {
    t.exports = r();
  })(os, function () {
    var n = "minute",
      r = /[+-]\d\d(?::?\d\d)?/g,
      i = /([+-]|\d\d)/g;
    return function (o, s, a) {
      var l = s.prototype;
      (a.utc = function (g) {
        var m = { date: g, utc: !0, args: arguments };
        return new s(m);
      }),
        (l.utc = function (g) {
          var m = a(this.toDate(), { locale: this.$L, utc: !0 });
          return g ? m.add(this.utcOffset(), n) : m;
        }),
        (l.local = function () {
          return a(this.toDate(), { locale: this.$L, utc: !1 });
        });
      var c = l.parse;
      l.parse = function (g) {
        g.utc && (this.$u = !0),
          this.$utils().u(g.$offset) || (this.$offset = g.$offset),
          c.call(this, g);
      };
      var u = l.init;
      l.init = function () {
        if (this.$u) {
          var g = this.$d;
          (this.$y = g.getUTCFullYear()),
            (this.$M = g.getUTCMonth()),
            (this.$D = g.getUTCDate()),
            (this.$W = g.getUTCDay()),
            (this.$H = g.getUTCHours()),
            (this.$m = g.getUTCMinutes()),
            (this.$s = g.getUTCSeconds()),
            (this.$ms = g.getUTCMilliseconds());
        } else u.call(this);
      };
      var f = l.utcOffset;
      l.utcOffset = function (g, m) {
        var v = this.$utils().u;
        if (v(g))
          return this.$u ? 0 : v(this.$offset) ? f.call(this) : this.$offset;
        if (
          typeof g == "string" &&
          ((g = (function (b) {
            b === void 0 && (b = "");
            var w = b.match(r);
            if (!w) return null;
            var E = ("" + w[0]).match(i) || ["-", 0, 0],
              S = E[0],
              P = 60 * +E[1] + +E[2];
            return P === 0 ? 0 : S === "+" ? P : -P;
          })(g)),
          g === null)
        )
          return this;
        var y = Math.abs(g) <= 16 ? 60 * g : g;
        if (y === 0) return this.utc(m);
        var _ = this.clone();
        if (m) return (_.$offset = y), (_.$u = !1), _;
        var x = this.$u
          ? this.toDate().getTimezoneOffset()
          : -1 * this.utcOffset();
        return (
          ((_ = this.local().add(y + x, n)).$offset = y),
          (_.$x.$localOffset = x),
          _
        );
      };
      var d = l.format;
      (l.format = function (g) {
        var m = g || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
        return d.call(this, m);
      }),
        (l.valueOf = function () {
          var g = this.$utils().u(this.$offset)
            ? 0
            : this.$offset +
              (this.$x.$localOffset || this.$d.getTimezoneOffset());
          return this.$d.valueOf() - 6e4 * g;
        }),
        (l.isUTC = function () {
          return !!this.$u;
        }),
        (l.toISOString = function () {
          return this.toDate().toISOString();
        }),
        (l.toString = function () {
          return this.toDate().toUTCString();
        });
      var h = l.toDate;
      l.toDate = function (g) {
        return g === "s" && this.$offset
          ? a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate()
          : h.call(this);
      };
      var p = l.diff;
      l.diff = function (g, m, v) {
        if (g && this.$u === g.$u) return p.call(this, g, m, v);
        var y = this.local(),
          _ = a(g).local();
        return p.call(y, _, m, v);
      };
    };
  });
})(IF);
var dTe = IF.exports;
const cIe = fa(dTe);
var OF = { exports: {} };
(function (t, e) {
  (function (n, r) {
    t.exports = r();
  })(os, function () {
    var n = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 },
      r = {};
    return function (i, o, s) {
      var a,
        l = function (d, h, p) {
          p === void 0 && (p = {});
          var g = new Date(d),
            m = (function (v, y) {
              y === void 0 && (y = {});
              var _ = y.timeZoneName || "short",
                x = v + "|" + _,
                b = r[x];
              return (
                b ||
                  ((b = new Intl.DateTimeFormat("en-US", {
                    hour12: !1,
                    timeZone: v,
                    year: "numeric",
                    month: "2-digit",
                    day: "2-digit",
                    hour: "2-digit",
                    minute: "2-digit",
                    second: "2-digit",
                    timeZoneName: _,
                  })),
                  (r[x] = b)),
                b
              );
            })(h, p);
          return m.formatToParts(g);
        },
        c = function (d, h) {
          for (var p = l(d, h), g = [], m = 0; m < p.length; m += 1) {
            var v = p[m],
              y = v.type,
              _ = v.value,
              x = n[y];
            x >= 0 && (g[x] = parseInt(_, 10));
          }
          var b = g[3],
            w = b === 24 ? 0 : b,
            E =
              g[0] +
              "-" +
              g[1] +
              "-" +
              g[2] +
              " " +
              w +
              ":" +
              g[4] +
              ":" +
              g[5] +
              ":000",
            S = +d;
          return (s.utc(E).valueOf() - (S -= S % 1e3)) / 6e4;
        },
        u = o.prototype;
      (u.tz = function (d, h) {
        d === void 0 && (d = a);
        var p,
          g = this.utcOffset(),
          m = this.toDate(),
          v = m.toLocaleString("en-US", { timeZone: d }),
          y = Math.round((m - new Date(v)) / 1e3 / 60),
          _ = 15 * -Math.round(m.getTimezoneOffset() / 15) - y;
        if (!Number(_)) p = this.utcOffset(0, h);
        else if (
          ((p = s(v, { locale: this.$L })
            .$set("millisecond", this.$ms)
            .utcOffset(_, !0)),
          h)
        ) {
          var x = p.utcOffset();
          p = p.add(g - x, "minute");
        }
        return (p.$x.$timezone = d), p;
      }),
        (u.offsetName = function (d) {
          var h = this.$x.$timezone || s.tz.guess(),
            p = l(this.valueOf(), h, { timeZoneName: d }).find(function (g) {
              return g.type.toLowerCase() === "timezonename";
            });
          return p && p.value;
        });
      var f = u.startOf;
      (u.startOf = function (d, h) {
        if (!this.$x || !this.$x.$timezone) return f.call(this, d, h);
        var p = s(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
        return f.call(p, d, h).tz(this.$x.$timezone, !0);
      }),
        (s.tz = function (d, h, p) {
          var g = p && h,
            m = p || h || a,
            v = c(+s(), m);
          if (typeof d != "string") return s(d).tz(m);
          var y = (function (w, E, S) {
              var P = w - 60 * E * 1e3,
                C = c(P, S);
              if (E === C) return [P, E];
              var A = c((P -= 60 * (C - E) * 1e3), S);
              return C === A
                ? [P, C]
                : [w - 60 * Math.min(C, A) * 1e3, Math.max(C, A)];
            })(s.utc(d, g).valueOf(), v, m),
            _ = y[0],
            x = y[1],
            b = s(_).utcOffset(x);
          return (b.$x.$timezone = m), b;
        }),
        (s.tz.guess = function () {
          return Intl.DateTimeFormat().resolvedOptions().timeZone;
        }),
        (s.tz.setDefault = function (d) {
          a = d;
        });
    };
  });
})(OF);
var hTe = OF.exports;
const uIe = fa(hTe);
var $I = function () {
  return (
    ($I =
      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;
      }),
    $I.apply(this, arguments)
  );
};
function fIe(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 dIe(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 hIe(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 pTe(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 gTe = (() => {
  let t = 0;
  const e = () =>
    `0000${((Math.random() * 36 ** 4) << 0).toString(36)}`.slice(-4);
  return () => ((t += 1), `u${e()}${t}`);
})();
function ta(t) {
  const e = [];
  for (let n = 0, r = t.length; n < r; n++) e.push(t[n]);
  return e;
}
let fc = null;
function RF(t = {}) {
  return (
    fc ||
    (t.includeStyleProperties
      ? ((fc = t.includeStyleProperties), fc)
      : ((fc = ta(window.getComputedStyle(document.documentElement))), fc))
  );
}
function sg(t, e) {
  const r = (t.ownerDocument.defaultView || window)
    .getComputedStyle(t)
    .getPropertyValue(e);
  return r ? parseFloat(r.replace("px", "")) : 0;
}
function mTe(t) {
  const e = sg(t, "border-left-width"),
    n = sg(t, "border-right-width");
  return t.clientWidth + e + n;
}
function vTe(t) {
  const e = sg(t, "border-top-width"),
    n = sg(t, "border-bottom-width");
  return t.clientHeight + e + n;
}
function EE(t, e = {}) {
  const n = e.width || mTe(t),
    r = e.height || vTe(t);
  return { width: n, height: r };
}
function yTe() {
  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 Nr = 16384;
function _Te(t) {
  (t.width > Nr || t.height > Nr) &&
    (t.width > Nr && t.height > Nr
      ? t.width > t.height
        ? ((t.height *= Nr / t.width), (t.width = Nr))
        : ((t.width *= Nr / t.height), (t.height = Nr))
      : t.width > Nr
      ? ((t.height *= Nr / t.width), (t.width = Nr))
      : ((t.width *= Nr / t.height), (t.height = Nr)));
}
function xTe(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 ag(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 bTe(t) {
  return Promise.resolve()
    .then(() => new XMLSerializer().serializeToString(t))
    .then(encodeURIComponent)
    .then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
}
async function wTe(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),
    bTe(i)
  );
}
const Rr = (t, e) => {
  if (t instanceof e) return !0;
  const n = Object.getPrototypeOf(t);
  return n === null ? !1 : n.constructor.name === e.name || Rr(n, e);
};
function ETe(t) {
  const e = t.getPropertyValue("content");
  return `${t.cssText} content: '${e.replace(/'|"/g, "")}';`;
}
function STe(t, e) {
  return RF(e)
    .map((n) => {
      const r = t.getPropertyValue(n),
        i = t.getPropertyPriority(n);
      return `${n}: ${r}${i ? " !important" : ""};`;
    })
    .join(" ");
}
function CTe(t, e, n, r) {
  const i = `.${t}:${e}`,
    o = n.cssText ? ETe(n) : STe(n, r);
  return document.createTextNode(`${i}{${o}}`);
}
function UI(t, e, n, r) {
  const i = window.getComputedStyle(t, n),
    o = i.getPropertyValue("content");
  if (o === "" || o === "none") return;
  const s = gTe();
  try {
    e.className = `${e.className} ${s}`;
  } catch {
    return;
  }
  const a = document.createElement("style");
  a.appendChild(CTe(s, n, i, r)), e.appendChild(a);
}
function ATe(t, e, n) {
  UI(t, e, ":before", n), UI(t, e, ":after", n);
}
const GI = "application/font-woff",
  HI = "image/jpeg",
  TTe = {
    woff: GI,
    woff2: GI,
    ttf: "application/font-truetype",
    eot: "application/vnd.ms-fontobject",
    png: "image/png",
    jpg: HI,
    jpeg: HI,
    gif: "image/gif",
    tiff: "image/tiff",
    svg: "image/svg+xml",
    webp: "image/webp",
  };
function PTe(t) {
  const e = /\.([^./]*?)$/g.exec(t);
  return e ? e[1] : "";
}
function SE(t) {
  const e = PTe(t).toLowerCase();
  return TTe[e] || "";
}
function ITe(t) {
  return t.split(/,/)[1];
}
function Yx(t) {
  return t.search(/^(data:)/) !== -1;
}
function MF(t, e) {
  return `data:${e};base64,${t}`;
}
async function DF(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 hy = {};
function OTe(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 CE(t, e, n) {
  const r = OTe(t, e, n.includeQueryParams);
  if (hy[r] != null) return hy[r];
  n.cacheBust && (t += (/\?/.test(t) ? "&" : "?") + new Date().getTime());
  let i;
  try {
    const o = await DF(
      t,
      n.fetchRequestInit,
      ({ res: s, result: a }) => (
        e || (e = s.headers.get("Content-Type") || ""), ITe(a)
      )
    );
    i = MF(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 (hy[r] = i), i;
}
async function RTe(t) {
  const e = t.toDataURL();
  return e === "data:," ? t.cloneNode(!1) : ag(e);
}
async function MTe(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 ag(a);
  }
  const n = t.poster,
    r = SE(n),
    i = await CE(n, r, e);
  return ag(i);
}
async function DTe(t, e) {
  var n;
  try {
    if (
      !(
        (n = t == null ? void 0 : t.contentDocument) === null || n === void 0
      ) &&
      n.body
    )
      return await Fm(t.contentDocument.body, e, !0);
  } catch {}
  return t.cloneNode(!1);
}
async function BTe(t, e) {
  return Rr(t, HTMLCanvasElement)
    ? RTe(t)
    : Rr(t, HTMLVideoElement)
    ? MTe(t, e)
    : Rr(t, HTMLIFrameElement)
    ? DTe(t, e)
    : t.cloneNode(BF(t));
}
const kTe = (t) => t.tagName != null && t.tagName.toUpperCase() === "SLOT",
  BF = (t) => t.tagName != null && t.tagName.toUpperCase() === "SVG";
async function NTe(t, e, n) {
  var r, i;
  if (BF(e)) return e;
  let o = [];
  return (
    kTe(t) && t.assignedNodes
      ? (o = ta(t.assignedNodes()))
      : Rr(t, HTMLIFrameElement) &&
        !((r = t.contentDocument) === null || r === void 0) &&
        r.body
      ? (o = ta(t.contentDocument.body.childNodes))
      : (o = ta(
          ((i = t.shadowRoot) !== null && i !== void 0 ? i : t).childNodes
        )),
    o.length === 0 ||
      Rr(t, HTMLVideoElement) ||
      (await o.reduce(
        (s, a) =>
          s
            .then(() => Fm(a, n))
            .then((l) => {
              l && e.appendChild(l);
            }),
        Promise.resolve()
      )),
    e
  );
}
function FTe(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))
    : RF(n).forEach((o) => {
        let s = i.getPropertyValue(o);
        o === "font-size" &&
          s.endsWith("px") &&
          (s = `${
            Math.floor(parseFloat(s.substring(0, s.length - 2))) - 0.1
          }px`),
          Rr(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 LTe(t, e) {
  Rr(t, HTMLTextAreaElement) && (e.innerHTML = t.value),
    Rr(t, HTMLInputElement) && e.setAttribute("value", t.value);
}
function $Te(t, e) {
  if (Rr(t, HTMLSelectElement)) {
    const n = e,
      r = Array.from(n.children).find(
        (i) => t.value === i.getAttribute("value")
      );
    r && r.setAttribute("selected", "");
  }
}
function UTe(t, e, n) {
  return (
    Rr(e, Element) && (FTe(t, e, n), ATe(t, e, n), LTe(t, e), $Te(t, e)), e
  );
}
async function GTe(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 Fm(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 Fm(t, e, n) {
  return !n && e.filter && !e.filter(t)
    ? null
    : Promise.resolve(t)
        .then((r) => BTe(r, e))
        .then((r) => NTe(t, r, e))
        .then((r) => UTe(t, r, e))
        .then((r) => GTe(r, e));
}
const kF = /url\((['"]?)([^'"]+?)\1\)/g,
  HTe = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,
  VTe = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
function zTe(t) {
  const e = t.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
  return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`, "g");
}
function jTe(t) {
  const e = [];
  return t.replace(kF, (n, r, i) => (e.push(i), n)), e.filter((n) => !Yx(n));
}
async function WTe(t, e, n, r, i) {
  try {
    const o = n ? pTe(e, n) : e,
      s = SE(e);
    let a;
    if (i) {
      const l = await i(o);
      a = MF(l, s);
    } else a = await CE(o, s, r);
    return t.replace(zTe(e), `$1${a}$3`);
  } catch {}
  return t;
}
function YTe(t, { preferredFontFormat: e }) {
  return e
    ? t.replace(VTe, (n) => {
        for (;;) {
          const [r, , i] = HTe.exec(n) || [];
          if (!i) return "";
          if (i === e) return `src: ${r};`;
        }
      })
    : t;
}
function NF(t) {
  return t.search(kF) !== -1;
}
async function FF(t, e, n) {
  if (!NF(t)) return t;
  const r = YTe(t, n);
  return jTe(r).reduce(
    (o, s) => o.then((a) => WTe(a, s, e, n)),
    Promise.resolve(r)
  );
}
async function dc(t, e, n) {
  var r;
  const i =
    (r = e.style) === null || r === void 0 ? void 0 : r.getPropertyValue(t);
  if (i) {
    const o = await FF(i, null, n);
    return e.style.setProperty(t, o, e.style.getPropertyPriority(t)), !0;
  }
  return !1;
}
async function XTe(t, e) {
  (await dc("background", t, e)) || (await dc("background-image", t, e)),
    (await dc("mask", t, e)) ||
      (await dc("-webkit-mask", t, e)) ||
      (await dc("mask-image", t, e)) ||
      (await dc("-webkit-mask-image", t, e));
}
async function KTe(t, e) {
  const n = Rr(t, HTMLImageElement);
  if (!(n && !Yx(t.src)) && !(Rr(t, SVGImageElement) && !Yx(t.href.baseVal)))
    return;
  const r = n ? t.src : t.href.baseVal,
    i = await CE(r, SE(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 qTe(t, e) {
  const r = ta(t.childNodes).map((i) => LF(i, e));
  await Promise.all(r).then(() => t);
}
async function LF(t, e) {
  Rr(t, Element) && (await XTe(t, e), await KTe(t, e), await qTe(t, e));
}
function ZTe(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 VI = {};
async function zI(t) {
  let e = VI[t];
  if (e != null) return e;
  const r = await (await fetch(t)).text();
  return (e = { url: t, cssText: r }), (VI[t] = e), e;
}
async function jI(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),
        DF(
          a,
          e.fetchRequestInit,
          ({ result: l }) => ((n = n.replace(s, `url(${l})`)), [s, l])
        )
      );
    });
  return Promise.all(o).then(() => n);
}
function WI(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 JTe(t, e) {
  const n = [],
    r = [];
  return (
    t.forEach((i) => {
      if ("cssRules" in i)
        try {
          ta(i.cssRules || []).forEach((o, s) => {
            if (o.type === CSSRule.IMPORT_RULE) {
              let a = s + 1;
              const l = o.href,
                c = zI(l)
                  .then((u) => jI(u, e))
                  .then((u) =>
                    WI(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(
              zI(i.href)
                .then((a) => jI(a, e))
                .then((a) =>
                  WI(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 {
              ta(i.cssRules || []).forEach((o) => {
                n.push(o);
              });
            } catch (o) {
              console.error(`Error while reading CSS rules from ${i.href}`, o);
            }
        }),
        n
      )
    )
  );
}
function QTe(t) {
  return t
    .filter((e) => e.type === CSSRule.FONT_FACE_RULE)
    .filter((e) => NF(e.style.getPropertyValue("src")));
}
async function e3e(t, e) {
  if (t.ownerDocument == null)
    throw new Error("Provided element is not within a Document");
  const n = ta(t.ownerDocument.styleSheets),
    r = await JTe(n, e);
  return QTe(r);
}
function $F(t) {
  return t.trim().replace(/["']/g, "");
}
function t3e(t) {
  const e = new Set();
  function n(r) {
    (r.style.fontFamily || getComputedStyle(r).fontFamily)
      .split(",")
      .forEach((o) => {
        e.add($F(o));
      }),
      Array.from(r.children).forEach((o) => {
        o instanceof HTMLElement && n(o);
      });
  }
  return n(t), e;
}
async function UF(t, e) {
  const n = await e3e(t, e),
    r = t3e(t);
  return (
    await Promise.all(
      n
        .filter((o) => r.has($F(o.style.fontFamily)))
        .map((o) => {
          const s = o.parentStyleSheet ? o.parentStyleSheet.href : null;
          return FF(o.cssText, s, e);
        })
    )
  ).join(`
`);
}
async function n3e(t, e) {
  const n =
    e.fontEmbedCSS != null
      ? e.fontEmbedCSS
      : e.skipFonts
      ? null
      : await UF(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 GF(t, e = {}) {
  const { width: n, height: r } = EE(t, e),
    i = await Fm(t, e, !0);
  return await n3e(i, e), await LF(i, e), ZTe(i, e), await wTe(i, n, r);
}
async function bh(t, e = {}) {
  const { width: n, height: r } = EE(t, e),
    i = await GF(t, e),
    o = await ag(i),
    s = document.createElement("canvas"),
    a = s.getContext("2d"),
    l = e.pixelRatio || yTe(),
    c = e.canvasWidth || n,
    u = e.canvasHeight || r;
  return (
    (s.width = c * l),
    (s.height = u * l),
    e.skipAutoScale || _Te(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 r3e(t, e = {}) {
  const { width: n, height: r } = EE(t, e);
  return (await bh(t, e)).getContext("2d").getImageData(0, 0, n, r).data;
}
async function i3e(t, e = {}) {
  return (await bh(t, e)).toDataURL();
}
async function o3e(t, e = {}) {
  return (await bh(t, e)).toDataURL("image/jpeg", e.quality || 1);
}
async function s3e(t, e = {}) {
  const n = await bh(t, e);
  return await xTe(n);
}
async function a3e(t, e = {}) {
  return UF(t, e);
}
const pIe = Object.freeze(
  Object.defineProperty(
    {
      __proto__: null,
      getFontEmbedCSS: a3e,
      toBlob: s3e,
      toCanvas: bh,
      toJpeg: o3e,
      toPixelData: r3e,
      toPng: i3e,
      toSvg: GF,
    },
    Symbol.toStringTag,
    { value: "Module" }
  )
);
export {
  ve as $,
  At as A,
  re as B,
  Ht as C,
  aR as D,
  qr as E,
  w3e as F,
  we as G,
  H7 as H,
  F$ as I,
  Eb as J,
  Ft as K,
  NK as L,
  z7 as M,
  Sg as N,
  hr as O,
  JL as P,
  R as Q,
  LPe as R,
  d3e as S,
  $Pe as T,
  fa as U,
  Xe as V,
  ps as W,
  ms as X,
  Eo as Y,
  pt as Z,
  fIe as _,
  dIe as a,
  Sn as a$,
  hQ as a0,
  $3e as a1,
  wPe as a2,
  Uie as a3,
  APe as a4,
  S3e as a5,
  OPe as a6,
  hi as a7,
  hn as a8,
  Gie as a9,
  G4 as aA,
  Ag as aB,
  x7 as aC,
  b7 as aD,
  F7 as aE,
  g0 as aF,
  bM as aG,
  mM as aH,
  LU as aI,
  cbe as aJ,
  NPe as aK,
  tIe as aL,
  _Pe as aM,
  noe as aN,
  sIe as aO,
  mf as aP,
  xPe as aQ,
  yPe as aR,
  aIe as aS,
  V7 as aT,
  RPe as aU,
  Fn as aV,
  JU as aW,
  cIe as aX,
  uIe as aY,
  TPe as aZ,
  Wd as a_,
  pg as aa,
  jce as ab,
  gp as ac,
  Xr as ad,
  bl as ae,
  zPe as af,
  YPe as ag,
  PPe as ah,
  UPe as ai,
  FPe as aj,
  kPe as ak,
  mPe as al,
  G6 as am,
  XPe as an,
  H$ as ao,
  Ud as ap,
  G$ as aq,
  W7 as ar,
  oIe as as,
  CPe as at,
  wb as au,
  db as av,
  BPe as aw,
  di as ax,
  pi as ay,
  $d as az,
  $I as b,
  U3e as b$,
  iIe as b0,
  rIe as b1,
  nIe as b2,
  bPe as b3,
  hh as b4,
  DO as b5,
  N6 as b6,
  IL as b7,
  aa as b8,
  sa as b9,
  IPe as bA,
  Eg as bB,
  st as bC,
  lIe as bD,
  kQ as bE,
  j7 as bF,
  qPe as bG,
  KPe as bH,
  cse as bI,
  Bme as bJ,
  ZPe as bK,
  JPe as bL,
  QPe as bM,
  eIe as bN,
  W3e as bO,
  g3e as bP,
  O3e as bQ,
  P3e as bR,
  J3e as bS,
  Q3e as bT,
  V3e as bU,
  z3e as bV,
  R3e as bW,
  oZ as bX,
  m3e as bY,
  v3e as bZ,
  K3e as b_,
  vPe as ba,
  cTe as bb,
  os as bc,
  PL as bd,
  Sq as be,
  tn as bf,
  T3e as bg,
  b0 as bh,
  Y3e as bi,
  _3e as bj,
  x3e as bk,
  $7 as bl,
  P7 as bm,
  Vn as bn,
  VPe as bo,
  $0 as bp,
  Gt as bq,
  Yde as br,
  WPe as bs,
  Ae as bt,
  jPe as bu,
  rPe as bv,
  gu as bw,
  Bn as bx,
  Vy as by,
  yt as bz,
  hIe as c,
  G3e as c0,
  k3e as c1,
  N3e as c2,
  vs as c3,
  D3e as c4,
  L3e as c5,
  B3e as c6,
  Z3e as c7,
  tPe as c8,
  j3e as c9,
  A3e as ca,
  Ul as cb,
  AZ as cc,
  F3e as cd,
  ePe as ce,
  iPe as cf,
  M3e as cg,
  q3e as ch,
  Vg as ci,
  X3e as cj,
  MM as ck,
  nPe as cl,
  H3e as cm,
  LO as cn,
  l3e as co,
  u3e as cp,
  MPe as cq,
  Dl as cr,
  SPe as cs,
  DPe as ct,
  gPe as cu,
  pIe as cv,
  sPe as d,
  aPe as e,
  lPe as f,
  cPe as g,
  uPe as h,
  fPe as i,
  dPe as j,
  hPe as k,
  pPe as l,
  oPe as m,
  Wf as n,
  Jd as o,
  C3e as p,
  l_ as q,
  Z as r,
  kK as s,
  b3e as t,
  E3e as u,
  f3e as v,
  h3e as w,
  EPe as x,
  c3e as y,
  Hw as z,
};
