import { getCurrentInstance as Vr, inject as zr, getCurrentScope as Hr, onScopeDispose as Qr, unref as qr, ref as jr, readonly as Jr, watch as Sr, reactive as qe } from "vue";
function Xr(r) {
  return Hr() ? (Qr(r), !0) : !1;
}
const Se = /* @__PURE__ */ new WeakMap(), Yr = (...r) => {
  var e;
  const t = r[0], n = (e = Vr()) == null ? void 0 : e.proxy;
  if (n == null)
    throw new Error("injectLocal must be called in setup");
  return Se.has(n) && t in Se.get(n) ? Se.get(n)[t] : zr(...r);
};
function br(r) {
  return typeof r == "function" ? r() : qr(r);
}
const Zr = typeof window < "u" && typeof document < "u";
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const et = Object.prototype.toString, rt = (r) => et.call(r) === "[object Object]", tt = () => {
};
function nt(r, e) {
  function t(...n) {
    return new Promise((o, a) => {
      Promise.resolve(r(() => e.apply(this, n), { fn: e, thisArg: this, args: n })).then(o).catch(a);
    });
  }
  return t;
}
const wr = (r) => r();
function at(r = wr) {
  const e = jr(!0);
  function t() {
    e.value = !1;
  }
  function n() {
    e.value = !0;
  }
  const o = (...a) => {
    e.value && r(...a);
  };
  return { isActive: Jr(e), pause: t, resume: n, eventFilter: o };
}
function ot(r, e, t = {}) {
  const {
    eventFilter: n = wr,
    ...o
  } = t;
  return Sr(
    r,
    nt(
      n,
      e
    ),
    o
  );
}
function it(r, e, t = {}) {
  const {
    eventFilter: n,
    ...o
  } = t, { eventFilter: a, pause: i, resume: f, isActive: l } = at(n);
  return { stop: ot(
    r,
    e,
    {
      ...o,
      eventFilter: a
    }
  ), pause: i, resume: f, isActive: l };
}
function lt(r) {
  var e;
  const t = br(r);
  return (e = t == null ? void 0 : t.$el) != null ? e : t;
}
const Ar = Zr ? window : void 0;
function je(...r) {
  let e, t, n, o;
  if (typeof r[0] == "string" || Array.isArray(r[0]) ? ([t, n, o] = r, e = Ar) : [e, t, n, o] = r, !e)
    return tt;
  Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
  const a = [], i = () => {
    a.forEach((u) => u()), a.length = 0;
  }, f = (u, s, c, v) => (u.addEventListener(s, c, v), () => u.removeEventListener(s, c, v)), l = Sr(
    () => [lt(e), br(o)],
    ([u, s]) => {
      if (i(), !u)
        return;
      const c = rt(s) ? { ...s } : s;
      a.push(
        ...t.flatMap((v) => n.map((m) => f(u, v, m, c)))
      );
    },
    { immediate: !0, flush: "post" }
  ), p = () => {
    l(), i();
  };
  return Xr(p), p;
}
function ft(r = "history", e = {}) {
  const {
    initialValue: t = {},
    removeNullishValues: n = !0,
    removeFalsyValues: o = !1,
    write: a = !0,
    window: i = Ar
  } = e;
  if (!i)
    return qe(t);
  const f = qe({});
  function l() {
    if (r === "history")
      return i.location.search || "";
    if (r === "hash") {
      const g = i.location.hash || "", h = g.indexOf("?");
      return h > 0 ? g.slice(h) : "";
    } else
      return (i.location.hash || "").replace(/^#/, "");
  }
  function p(g) {
    const h = g.toString();
    if (r === "history")
      return `${h ? `?${h}` : ""}${i.location.hash || ""}`;
    if (r === "hash-params")
      return `${i.location.search || ""}${h ? `#${h}` : ""}`;
    const y = i.location.hash || "#", O = y.indexOf("?");
    return O > 0 ? `${y.slice(0, O)}${h ? `?${h}` : ""}` : `${y}${h ? `?${h}` : ""}`;
  }
  function u() {
    return new URLSearchParams(l());
  }
  function s(g) {
    const h = new Set(Object.keys(f));
    for (const y of g.keys()) {
      const O = g.getAll(y);
      f[y] = O.length > 1 ? O : g.get(y) || "", h.delete(y);
    }
    Array.from(h).forEach((y) => delete f[y]);
  }
  const { pause: c, resume: v } = it(
    f,
    () => {
      const g = new URLSearchParams("");
      Object.keys(f).forEach((h) => {
        const y = f[h];
        Array.isArray(y) ? y.forEach((O) => g.append(h, O)) : n && y == null || o && !y ? g.delete(h) : g.set(h, y);
      }), m(g);
    },
    { deep: !0 }
  );
  function m(g, h) {
    c(), h && s(g), i.history.replaceState(
      i.history.state,
      i.document.title,
      i.location.pathname + p(g)
    ), v();
  }
  function b() {
    a && m(u(), !0);
  }
  je(i, "popstate", b, !1), r !== "history" && je(i, "hashchange", b, !1);
  const E = u();
  return E.keys().next().value ? s(E) : Object.assign(f, t), f;
}
const ut = {
  rowKey: "id",
  title: "Fast Start",
  routerMode: "hash",
  basename: "/"
}, ct = Symbol("FAST_START_CONTEXT"), pt = () => Yr(ct, ut);
var yt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function st(r) {
  if (r.__esModule)
    return r;
  var e = r.default;
  if (typeof e == "function") {
    var t = function n() {
      return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
    };
    t.prototype = e.prototype;
  } else
    t = {};
  return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(r).forEach(function(n) {
    var o = Object.getOwnPropertyDescriptor(r, n);
    Object.defineProperty(t, n, o.get ? o : {
      enumerable: !0,
      get: function() {
        return r[n];
      }
    });
  }), t;
}
var dt = Error, vt = EvalError, ht = RangeError, mt = ReferenceError, Er = SyntaxError, ae = TypeError, gt = URIError, St = function() {
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
    return !1;
  if (typeof Symbol.iterator == "symbol")
    return !0;
  var e = {}, t = Symbol("test"), n = Object(t);
  if (typeof t == "string" || Object.prototype.toString.call(t) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]")
    return !1;
  var o = 42;
  e[t] = o;
  for (t 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 a = Object.getOwnPropertySymbols(e);
  if (a.length !== 1 || a[0] !== t || !Object.prototype.propertyIsEnumerable.call(e, t))
    return !1;
  if (typeof Object.getOwnPropertyDescriptor == "function") {
    var i = Object.getOwnPropertyDescriptor(e, t);
    if (i.value !== o || i.enumerable !== !0)
      return !1;
  }
  return !0;
}, Je = typeof Symbol < "u" && Symbol, bt = St, wt = function() {
  return typeof Je != "function" || typeof Symbol != "function" || typeof Je("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : bt();
}, be = {
  __proto__: null,
  foo: {}
}, At = Object, Et = function() {
  return { __proto__: be }.foo === be.foo && !(be instanceof At);
}, Ot = "Function.prototype.bind called on incompatible ", Pt = Object.prototype.toString, $t = Math.max, Ft = "[object Function]", Xe = function(e, t) {
  for (var n = [], o = 0; o < e.length; o += 1)
    n[o] = e[o];
  for (var a = 0; a < t.length; a += 1)
    n[a + e.length] = t[a];
  return n;
}, It = function(e, t) {
  for (var n = [], o = t || 0, a = 0; o < e.length; o += 1, a += 1)
    n[a] = e[o];
  return n;
}, xt = function(r, e) {
  for (var t = "", n = 0; n < r.length; n += 1)
    t += r[n], n + 1 < r.length && (t += e);
  return t;
}, Tt = function(e) {
  var t = this;
  if (typeof t != "function" || Pt.apply(t) !== Ft)
    throw new TypeError(Ot + t);
  for (var n = It(arguments, 1), o, a = function() {
    if (this instanceof o) {
      var u = t.apply(
        this,
        Xe(n, arguments)
      );
      return Object(u) === u ? u : this;
    }
    return t.apply(
      e,
      Xe(n, arguments)
    );
  }, i = $t(0, t.length - n.length), f = [], l = 0; l < i; l++)
    f[l] = "$" + l;
  if (o = Function("binder", "return function (" + xt(f, ",") + "){ return binder.apply(this,arguments); }")(a), t.prototype) {
    var p = function() {
    };
    p.prototype = t.prototype, o.prototype = new p(), p.prototype = null;
  }
  return o;
}, Dt = Tt, Le = Function.prototype.bind || Dt, Rt = Function.prototype.call, _t = Object.prototype.hasOwnProperty, Nt = Le, Mt = Nt.call(Rt, _t), d, Ct = dt, Bt = vt, Wt = ht, Ut = mt, Q = Er, H = ae, Lt = gt, Or = Function, we = function(r) {
  try {
    return Or('"use strict"; return (' + r + ").constructor;")();
  } catch {
  }
}, U = Object.getOwnPropertyDescriptor;
if (U)
  try {
    U({}, "");
  } catch {
    U = null;
  }
var Ae = function() {
  throw new H();
}, Gt = U ? function() {
  try {
    return arguments.callee, Ae;
  } catch {
    try {
      return U(arguments, "callee").get;
    } catch {
      return Ae;
    }
  }
}() : Ae, K = wt(), kt = Et(), A = Object.getPrototypeOf || (kt ? function(r) {
  return r.__proto__;
} : null), z = {}, Kt = typeof Uint8Array > "u" || !A ? d : A(Uint8Array), L = {
  __proto__: null,
  "%AggregateError%": typeof AggregateError > "u" ? d : AggregateError,
  "%Array%": Array,
  "%ArrayBuffer%": typeof ArrayBuffer > "u" ? d : ArrayBuffer,
  "%ArrayIteratorPrototype%": K && A ? A([][Symbol.iterator]()) : d,
  "%AsyncFromSyncIteratorPrototype%": d,
  "%AsyncFunction%": z,
  "%AsyncGenerator%": z,
  "%AsyncGeneratorFunction%": z,
  "%AsyncIteratorPrototype%": z,
  "%Atomics%": typeof Atomics > "u" ? d : Atomics,
  "%BigInt%": typeof BigInt > "u" ? d : BigInt,
  "%BigInt64Array%": typeof BigInt64Array > "u" ? d : BigInt64Array,
  "%BigUint64Array%": typeof BigUint64Array > "u" ? d : BigUint64Array,
  "%Boolean%": Boolean,
  "%DataView%": typeof DataView > "u" ? d : DataView,
  "%Date%": Date,
  "%decodeURI%": decodeURI,
  "%decodeURIComponent%": decodeURIComponent,
  "%encodeURI%": encodeURI,
  "%encodeURIComponent%": encodeURIComponent,
  "%Error%": Ct,
  "%eval%": eval,
  // eslint-disable-line no-eval
  "%EvalError%": Bt,
  "%Float32Array%": typeof Float32Array > "u" ? d : Float32Array,
  "%Float64Array%": typeof Float64Array > "u" ? d : Float64Array,
  "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? d : FinalizationRegistry,
  "%Function%": Or,
  "%GeneratorFunction%": z,
  "%Int8Array%": typeof Int8Array > "u" ? d : Int8Array,
  "%Int16Array%": typeof Int16Array > "u" ? d : Int16Array,
  "%Int32Array%": typeof Int32Array > "u" ? d : Int32Array,
  "%isFinite%": isFinite,
  "%isNaN%": isNaN,
  "%IteratorPrototype%": K && A ? A(A([][Symbol.iterator]())) : d,
  "%JSON%": typeof JSON == "object" ? JSON : d,
  "%Map%": typeof Map > "u" ? d : Map,
  "%MapIteratorPrototype%": typeof Map > "u" || !K || !A ? d : A((/* @__PURE__ */ new Map())[Symbol.iterator]()),
  "%Math%": Math,
  "%Number%": Number,
  "%Object%": Object,
  "%parseFloat%": parseFloat,
  "%parseInt%": parseInt,
  "%Promise%": typeof Promise > "u" ? d : Promise,
  "%Proxy%": typeof Proxy > "u" ? d : Proxy,
  "%RangeError%": Wt,
  "%ReferenceError%": Ut,
  "%Reflect%": typeof Reflect > "u" ? d : Reflect,
  "%RegExp%": RegExp,
  "%Set%": typeof Set > "u" ? d : Set,
  "%SetIteratorPrototype%": typeof Set > "u" || !K || !A ? d : A((/* @__PURE__ */ new Set())[Symbol.iterator]()),
  "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? d : SharedArrayBuffer,
  "%String%": String,
  "%StringIteratorPrototype%": K && A ? A(""[Symbol.iterator]()) : d,
  "%Symbol%": K ? Symbol : d,
  "%SyntaxError%": Q,
  "%ThrowTypeError%": Gt,
  "%TypedArray%": Kt,
  "%TypeError%": H,
  "%Uint8Array%": typeof Uint8Array > "u" ? d : Uint8Array,
  "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? d : Uint8ClampedArray,
  "%Uint16Array%": typeof Uint16Array > "u" ? d : Uint16Array,
  "%Uint32Array%": typeof Uint32Array > "u" ? d : Uint32Array,
  "%URIError%": Lt,
  "%WeakMap%": typeof WeakMap > "u" ? d : WeakMap,
  "%WeakRef%": typeof WeakRef > "u" ? d : WeakRef,
  "%WeakSet%": typeof WeakSet > "u" ? d : WeakSet
};
if (A)
  try {
    null.error;
  } catch (r) {
    var Vt = A(A(r));
    L["%Error.prototype%"] = Vt;
  }
var zt = function r(e) {
  var t;
  if (e === "%AsyncFunction%")
    t = we("async function () {}");
  else if (e === "%GeneratorFunction%")
    t = we("function* () {}");
  else if (e === "%AsyncGeneratorFunction%")
    t = we("async function* () {}");
  else if (e === "%AsyncGenerator%") {
    var n = r("%AsyncGeneratorFunction%");
    n && (t = n.prototype);
  } else if (e === "%AsyncIteratorPrototype%") {
    var o = r("%AsyncGenerator%");
    o && A && (t = A(o.prototype));
  }
  return L[e] = t, t;
}, Ye = {
  __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"]
}, oe = Le, se = Mt, Ht = oe.call(Function.call, Array.prototype.concat), Qt = oe.call(Function.apply, Array.prototype.splice), Ze = oe.call(Function.call, String.prototype.replace), de = oe.call(Function.call, String.prototype.slice), qt = oe.call(Function.call, RegExp.prototype.exec), jt = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Jt = /\\(\\)?/g, Xt = function(e) {
  var t = de(e, 0, 1), n = de(e, -1);
  if (t === "%" && n !== "%")
    throw new Q("invalid intrinsic syntax, expected closing `%`");
  if (n === "%" && t !== "%")
    throw new Q("invalid intrinsic syntax, expected opening `%`");
  var o = [];
  return Ze(e, jt, function(a, i, f, l) {
    o[o.length] = f ? Ze(l, Jt, "$1") : i || a;
  }), o;
}, Yt = function(e, t) {
  var n = e, o;
  if (se(Ye, n) && (o = Ye[n], n = "%" + o[0] + "%"), se(L, n)) {
    var a = L[n];
    if (a === z && (a = zt(n)), typeof a > "u" && !t)
      throw new H("intrinsic " + e + " exists, but is not available. Please file an issue!");
    return {
      alias: o,
      name: n,
      value: a
    };
  }
  throw new Q("intrinsic " + e + " does not exist!");
}, J = function(e, t) {
  if (typeof e != "string" || e.length === 0)
    throw new H("intrinsic name must be a non-empty string");
  if (arguments.length > 1 && typeof t != "boolean")
    throw new H('"allowMissing" argument must be a boolean');
  if (qt(/^%?[^%]*%?$/, e) === null)
    throw new Q("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
  var n = Xt(e), o = n.length > 0 ? n[0] : "", a = Yt("%" + o + "%", t), i = a.name, f = a.value, l = !1, p = a.alias;
  p && (o = p[0], Qt(n, Ht([0, 1], p)));
  for (var u = 1, s = !0; u < n.length; u += 1) {
    var c = n[u], v = de(c, 0, 1), m = de(c, -1);
    if ((v === '"' || v === "'" || v === "`" || m === '"' || m === "'" || m === "`") && v !== m)
      throw new Q("property names with quotes must have matching quotes");
    if ((c === "constructor" || !s) && (l = !0), o += "." + c, i = "%" + o + "%", se(L, i))
      f = L[i];
    else if (f != null) {
      if (!(c in f)) {
        if (!t)
          throw new H("base intrinsic for " + e + " exists, but the property is not available.");
        return;
      }
      if (U && u + 1 >= n.length) {
        var b = U(f, c);
        s = !!b, s && "get" in b && !("originalValue" in b.get) ? f = b.get : f = f[c];
      } else
        s = se(f, c), f = f[c];
      s && !l && (L[i] = f);
    }
  }
  return f;
}, Pr = { exports: {} }, Ee, er;
function Ge() {
  if (er)
    return Ee;
  er = 1;
  var r = J, e = r("%Object.defineProperty%", !0) || !1;
  if (e)
    try {
      e({}, "a", { value: 1 });
    } catch {
      e = !1;
    }
  return Ee = e, Ee;
}
var Zt = J, pe = Zt("%Object.getOwnPropertyDescriptor%", !0);
if (pe)
  try {
    pe([], "length");
  } catch {
    pe = null;
  }
var $r = pe, rr = Ge(), en = Er, V = ae, tr = $r, rn = function(e, t, n) {
  if (!e || typeof e != "object" && typeof e != "function")
    throw new V("`obj` must be an object or a function`");
  if (typeof t != "string" && typeof t != "symbol")
    throw new V("`property` must be a string or a symbol`");
  if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null)
    throw new V("`nonEnumerable`, if provided, must be a boolean or null");
  if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null)
    throw new V("`nonWritable`, if provided, must be a boolean or null");
  if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null)
    throw new V("`nonConfigurable`, if provided, must be a boolean or null");
  if (arguments.length > 6 && typeof arguments[6] != "boolean")
    throw new V("`loose`, if provided, must be a boolean");
  var o = arguments.length > 3 ? arguments[3] : null, a = arguments.length > 4 ? arguments[4] : null, i = arguments.length > 5 ? arguments[5] : null, f = arguments.length > 6 ? arguments[6] : !1, l = !!tr && tr(e, t);
  if (rr)
    rr(e, t, {
      configurable: i === null && l ? l.configurable : !i,
      enumerable: o === null && l ? l.enumerable : !o,
      value: n,
      writable: a === null && l ? l.writable : !a
    });
  else if (f || !o && !a && !i)
    e[t] = n;
  else
    throw new en("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
}, _e = Ge(), Fr = function() {
  return !!_e;
};
Fr.hasArrayLengthDefineBug = function() {
  if (!_e)
    return null;
  try {
    return _e([], "length", { value: 1 }).length !== 1;
  } catch {
    return !0;
  }
};
var tn = Fr, nn = J, nr = rn, an = tn(), ar = $r, or = ae, on = nn("%Math.floor%"), ln = function(e, t) {
  if (typeof e != "function")
    throw new or("`fn` is not a function");
  if (typeof t != "number" || t < 0 || t > 4294967295 || on(t) !== t)
    throw new or("`length` must be a positive 32-bit integer");
  var n = arguments.length > 2 && !!arguments[2], o = !0, a = !0;
  if ("length" in e && ar) {
    var i = ar(e, "length");
    i && !i.configurable && (o = !1), i && !i.writable && (a = !1);
  }
  return (o || a || !n) && (an ? nr(
    /** @type {Parameters<define>[0]} */
    e,
    "length",
    t,
    !0,
    !0
  ) : nr(
    /** @type {Parameters<define>[0]} */
    e,
    "length",
    t
  )), e;
};
(function(r) {
  var e = Le, t = J, n = ln, o = ae, a = t("%Function.prototype.apply%"), i = t("%Function.prototype.call%"), f = t("%Reflect.apply%", !0) || e.call(i, a), l = Ge(), p = t("%Math.max%");
  r.exports = function(c) {
    if (typeof c != "function")
      throw new o("a function is required");
    var v = f(e, i, arguments);
    return n(
      v,
      1 + p(0, c.length - (arguments.length - 1)),
      !0
    );
  };
  var u = function() {
    return f(e, a, arguments);
  };
  l ? l(r.exports, "apply", { value: u }) : r.exports.apply = u;
})(Pr);
var fn = Pr.exports, Ir = J, xr = fn, un = xr(Ir("String.prototype.indexOf")), cn = function(e, t) {
  var n = Ir(e, !!t);
  return typeof n == "function" && un(e, ".prototype.") > -1 ? xr(n) : n;
};
const pn = {}, yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: pn
}, Symbol.toStringTag, { value: "Module" })), sn = /* @__PURE__ */ st(yn);
var ke = typeof Map == "function" && Map.prototype, Oe = Object.getOwnPropertyDescriptor && ke ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, ve = ke && Oe && typeof Oe.get == "function" ? Oe.get : null, ir = ke && Map.prototype.forEach, Ke = typeof Set == "function" && Set.prototype, Pe = Object.getOwnPropertyDescriptor && Ke ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, he = Ke && Pe && typeof Pe.get == "function" ? Pe.get : null, lr = Ke && Set.prototype.forEach, dn = typeof WeakMap == "function" && WeakMap.prototype, re = dn ? WeakMap.prototype.has : null, vn = typeof WeakSet == "function" && WeakSet.prototype, te = vn ? WeakSet.prototype.has : null, hn = typeof WeakRef == "function" && WeakRef.prototype, fr = hn ? WeakRef.prototype.deref : null, mn = Boolean.prototype.valueOf, gn = Object.prototype.toString, Sn = Function.prototype.toString, bn = String.prototype.match, Ve = String.prototype.slice, N = String.prototype.replace, wn = String.prototype.toUpperCase, ur = String.prototype.toLowerCase, Tr = RegExp.prototype.test, cr = Array.prototype.concat, x = Array.prototype.join, An = Array.prototype.slice, pr = Math.floor, Ne = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, $e = Object.getOwnPropertySymbols, Me = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, q = typeof Symbol == "function" && typeof Symbol.iterator == "object", P = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === q || !0) ? Symbol.toStringTag : null, Dr = Object.prototype.propertyIsEnumerable, yr = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(r) {
  return r.__proto__;
} : null);
function sr(r, e) {
  if (r === 1 / 0 || r === -1 / 0 || r !== r || r && r > -1e3 && r < 1e3 || Tr.call(/e/, e))
    return e;
  var t = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
  if (typeof r == "number") {
    var n = r < 0 ? -pr(-r) : pr(r);
    if (n !== r) {
      var o = String(n), a = Ve.call(e, o.length + 1);
      return N.call(o, t, "$&_") + "." + N.call(N.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
    }
  }
  return N.call(e, t, "$&_");
}
var Ce = sn, dr = Ce.custom, vr = _r(dr) ? dr : null, En = function r(e, t, n, o) {
  var a = t || {};
  if (_(a, "quoteStyle") && a.quoteStyle !== "single" && a.quoteStyle !== "double")
    throw new TypeError('option "quoteStyle" must be "single" or "double"');
  if (_(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null))
    throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
  var i = _(a, "customInspect") ? a.customInspect : !0;
  if (typeof i != "boolean" && i !== "symbol")
    throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
  if (_(a, "indent") && a.indent !== null && a.indent !== "	" && !(parseInt(a.indent, 10) === a.indent && a.indent > 0))
    throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
  if (_(a, "numericSeparator") && typeof a.numericSeparator != "boolean")
    throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
  var f = a.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 Mr(e, a);
  if (typeof e == "number") {
    if (e === 0)
      return 1 / 0 / e > 0 ? "0" : "-0";
    var l = String(e);
    return f ? sr(e, l) : l;
  }
  if (typeof e == "bigint") {
    var p = String(e) + "n";
    return f ? sr(e, p) : p;
  }
  var u = typeof a.depth > "u" ? 5 : a.depth;
  if (typeof n > "u" && (n = 0), n >= u && u > 0 && typeof e == "object")
    return Be(e) ? "[Array]" : "[Object]";
  var s = Gn(a, n);
  if (typeof o > "u")
    o = [];
  else if (Nr(o, e) >= 0)
    return "[Circular]";
  function c($, D, R) {
    if (D && (o = An.call(o), o.push(D)), R) {
      var Z = {
        depth: a.depth
      };
      return _(a, "quoteStyle") && (Z.quoteStyle = a.quoteStyle), r($, Z, n + 1, o);
    }
    return r($, a, n + 1, o);
  }
  if (typeof e == "function" && !hr(e)) {
    var v = Rn(e), m = fe(e, c);
    return "[Function" + (v ? ": " + v : " (anonymous)") + "]" + (m.length > 0 ? " { " + x.call(m, ", ") + " }" : "");
  }
  if (_r(e)) {
    var b = q ? N.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Me.call(e);
    return typeof e == "object" && !q ? ee(b) : b;
  }
  if (Wn(e)) {
    for (var E = "<" + ur.call(String(e.nodeName)), g = e.attributes || [], h = 0; h < g.length; h++)
      E += " " + g[h].name + "=" + Rr(On(g[h].value), "double", a);
    return E += ">", e.childNodes && e.childNodes.length && (E += "..."), E += "</" + ur.call(String(e.nodeName)) + ">", E;
  }
  if (Be(e)) {
    if (e.length === 0)
      return "[]";
    var y = fe(e, c);
    return s && !Ln(y) ? "[" + We(y, s) + "]" : "[ " + x.call(y, ", ") + " ]";
  }
  if ($n(e)) {
    var O = fe(e, c);
    return !("cause" in Error.prototype) && "cause" in e && !Dr.call(e, "cause") ? "{ [" + String(e) + "] " + x.call(cr.call("[cause]: " + c(e.cause), O), ", ") + " }" : O.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + x.call(O, ", ") + " }";
  }
  if (typeof e == "object" && i) {
    if (vr && typeof e[vr] == "function" && Ce)
      return Ce(e, { depth: u - n });
    if (i !== "symbol" && typeof e.inspect == "function")
      return e.inspect();
  }
  if (_n(e)) {
    var C = [];
    return ir && ir.call(e, function($, D) {
      C.push(c(D, e, !0) + " => " + c($, e));
    }), mr("Map", ve.call(e), C, s);
  }
  if (Cn(e)) {
    var Y = [];
    return lr && lr.call(e, function($) {
      Y.push(c($, e));
    }), mr("Set", he.call(e), Y, s);
  }
  if (Nn(e))
    return Fe("WeakMap");
  if (Bn(e))
    return Fe("WeakSet");
  if (Mn(e))
    return Fe("WeakRef");
  if (In(e))
    return ee(c(Number(e)));
  if (Tn(e))
    return ee(c(Ne.call(e)));
  if (xn(e))
    return ee(mn.call(e));
  if (Fn(e))
    return ee(c(String(e)));
  if (typeof window < "u" && e === window)
    return "{ [object Window] }";
  if (e === yt)
    return "{ [object globalThis] }";
  if (!Pn(e) && !hr(e)) {
    var G = fe(e, c), ie = yr ? yr(e) === Object.prototype : e instanceof Object || e.constructor === Object, B = e instanceof Object ? "" : "null prototype", T = !ie && P && Object(e) === e && P in e ? Ve.call(M(e), 8, -1) : B ? "Object" : "", le = ie || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", k = le + (T || B ? "[" + x.call(cr.call([], T || [], B || []), ": ") + "] " : "");
    return G.length === 0 ? k + "{}" : s ? k + "{" + We(G, s) + "}" : k + "{ " + x.call(G, ", ") + " }";
  }
  return String(e);
};
function Rr(r, e, t) {
  var n = (t.quoteStyle || e) === "double" ? '"' : "'";
  return n + r + n;
}
function On(r) {
  return N.call(String(r), /"/g, "&quot;");
}
function Be(r) {
  return M(r) === "[object Array]" && (!P || !(typeof r == "object" && P in r));
}
function Pn(r) {
  return M(r) === "[object Date]" && (!P || !(typeof r == "object" && P in r));
}
function hr(r) {
  return M(r) === "[object RegExp]" && (!P || !(typeof r == "object" && P in r));
}
function $n(r) {
  return M(r) === "[object Error]" && (!P || !(typeof r == "object" && P in r));
}
function Fn(r) {
  return M(r) === "[object String]" && (!P || !(typeof r == "object" && P in r));
}
function In(r) {
  return M(r) === "[object Number]" && (!P || !(typeof r == "object" && P in r));
}
function xn(r) {
  return M(r) === "[object Boolean]" && (!P || !(typeof r == "object" && P in r));
}
function _r(r) {
  if (q)
    return r && typeof r == "object" && r instanceof Symbol;
  if (typeof r == "symbol")
    return !0;
  if (!r || typeof r != "object" || !Me)
    return !1;
  try {
    return Me.call(r), !0;
  } catch {
  }
  return !1;
}
function Tn(r) {
  if (!r || typeof r != "object" || !Ne)
    return !1;
  try {
    return Ne.call(r), !0;
  } catch {
  }
  return !1;
}
var Dn = Object.prototype.hasOwnProperty || function(r) {
  return r in this;
};
function _(r, e) {
  return Dn.call(r, e);
}
function M(r) {
  return gn.call(r);
}
function Rn(r) {
  if (r.name)
    return r.name;
  var e = bn.call(Sn.call(r), /^function\s*([\w$]+)/);
  return e ? e[1] : null;
}
function Nr(r, e) {
  if (r.indexOf)
    return r.indexOf(e);
  for (var t = 0, n = r.length; t < n; t++)
    if (r[t] === e)
      return t;
  return -1;
}
function _n(r) {
  if (!ve || !r || typeof r != "object")
    return !1;
  try {
    ve.call(r);
    try {
      he.call(r);
    } catch {
      return !0;
    }
    return r instanceof Map;
  } catch {
  }
  return !1;
}
function Nn(r) {
  if (!re || !r || typeof r != "object")
    return !1;
  try {
    re.call(r, re);
    try {
      te.call(r, te);
    } catch {
      return !0;
    }
    return r instanceof WeakMap;
  } catch {
  }
  return !1;
}
function Mn(r) {
  if (!fr || !r || typeof r != "object")
    return !1;
  try {
    return fr.call(r), !0;
  } catch {
  }
  return !1;
}
function Cn(r) {
  if (!he || !r || typeof r != "object")
    return !1;
  try {
    he.call(r);
    try {
      ve.call(r);
    } catch {
      return !0;
    }
    return r instanceof Set;
  } catch {
  }
  return !1;
}
function Bn(r) {
  if (!te || !r || typeof r != "object")
    return !1;
  try {
    te.call(r, te);
    try {
      re.call(r, re);
    } catch {
      return !0;
    }
    return r instanceof WeakSet;
  } catch {
  }
  return !1;
}
function Wn(r) {
  return !r || typeof r != "object" ? !1 : typeof HTMLElement < "u" && r instanceof HTMLElement ? !0 : typeof r.nodeName == "string" && typeof r.getAttribute == "function";
}
function Mr(r, e) {
  if (r.length > e.maxStringLength) {
    var t = r.length - e.maxStringLength, n = "... " + t + " more character" + (t > 1 ? "s" : "");
    return Mr(Ve.call(r, 0, e.maxStringLength), e) + n;
  }
  var o = N.call(N.call(r, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, Un);
  return Rr(o, "single", e);
}
function Un(r) {
  var e = r.charCodeAt(0), t = {
    8: "b",
    9: "t",
    10: "n",
    12: "f",
    13: "r"
  }[e];
  return t ? "\\" + t : "\\x" + (e < 16 ? "0" : "") + wn.call(e.toString(16));
}
function ee(r) {
  return "Object(" + r + ")";
}
function Fe(r) {
  return r + " { ? }";
}
function mr(r, e, t, n) {
  var o = n ? We(t, n) : x.call(t, ", ");
  return r + " (" + e + ") {" + o + "}";
}
function Ln(r) {
  for (var e = 0; e < r.length; e++)
    if (Nr(r[e], `
`) >= 0)
      return !1;
  return !0;
}
function Gn(r, e) {
  var t;
  if (r.indent === "	")
    t = "	";
  else if (typeof r.indent == "number" && r.indent > 0)
    t = x.call(Array(r.indent + 1), " ");
  else
    return null;
  return {
    base: t,
    prev: x.call(Array(e + 1), t)
  };
}
function We(r, e) {
  if (r.length === 0)
    return "";
  var t = `
` + e.prev + e.base;
  return t + x.call(r, "," + t) + `
` + e.prev;
}
function fe(r, e) {
  var t = Be(r), n = [];
  if (t) {
    n.length = r.length;
    for (var o = 0; o < r.length; o++)
      n[o] = _(r, o) ? e(r[o], r) : "";
  }
  var a = typeof $e == "function" ? $e(r) : [], i;
  if (q) {
    i = {};
    for (var f = 0; f < a.length; f++)
      i["$" + a[f]] = a[f];
  }
  for (var l in r)
    _(r, l) && (t && String(Number(l)) === l && l < r.length || q && i["$" + l] instanceof Symbol || (Tr.call(/[^\w$]/, l) ? n.push(e(l, r) + ": " + e(r[l], r)) : n.push(l + ": " + e(r[l], r))));
  if (typeof $e == "function")
    for (var p = 0; p < a.length; p++)
      Dr.call(r, a[p]) && n.push("[" + e(a[p]) + "]: " + e(r[a[p]], r));
  return n;
}
var Cr = J, X = cn, kn = En, Kn = ae, ue = Cr("%WeakMap%", !0), ce = Cr("%Map%", !0), Vn = X("WeakMap.prototype.get", !0), zn = X("WeakMap.prototype.set", !0), Hn = X("WeakMap.prototype.has", !0), Qn = X("Map.prototype.get", !0), qn = X("Map.prototype.set", !0), jn = X("Map.prototype.has", !0), ze = function(r, e) {
  for (var t = r, n; (n = t.next) !== null; t = n)
    if (n.key === e)
      return t.next = n.next, n.next = /** @type {NonNullable<typeof list.next>} */
      r.next, r.next = n, n;
}, Jn = function(r, e) {
  var t = ze(r, e);
  return t && t.value;
}, Xn = function(r, e, t) {
  var n = ze(r, e);
  n ? n.value = t : r.next = /** @type {import('.').ListNode<typeof value>} */
  {
    // eslint-disable-line no-param-reassign, no-extra-parens
    key: e,
    next: r.next,
    value: t
  };
}, Yn = function(r, e) {
  return !!ze(r, e);
}, Zn = function() {
  var e, t, n, o = {
    assert: function(a) {
      if (!o.has(a))
        throw new Kn("Side channel does not contain " + kn(a));
    },
    get: function(a) {
      if (ue && a && (typeof a == "object" || typeof a == "function")) {
        if (e)
          return Vn(e, a);
      } else if (ce) {
        if (t)
          return Qn(t, a);
      } else if (n)
        return Jn(n, a);
    },
    has: function(a) {
      if (ue && a && (typeof a == "object" || typeof a == "function")) {
        if (e)
          return Hn(e, a);
      } else if (ce) {
        if (t)
          return jn(t, a);
      } else if (n)
        return Yn(n, a);
      return !1;
    },
    set: function(a, i) {
      ue && a && (typeof a == "object" || typeof a == "function") ? (e || (e = new ue()), zn(e, a, i)) : ce ? (t || (t = new ce()), qn(t, a, i)) : (n || (n = { key: {}, next: null }), Xn(n, a, i));
    }
  };
  return o;
}, ea = String.prototype.replace, ra = /%20/g, Ie = {
  RFC1738: "RFC1738",
  RFC3986: "RFC3986"
}, He = {
  default: Ie.RFC3986,
  formatters: {
    RFC1738: function(r) {
      return ea.call(r, ra, "+");
    },
    RFC3986: function(r) {
      return String(r);
    }
  },
  RFC1738: Ie.RFC1738,
  RFC3986: Ie.RFC3986
}, ta = He, xe = Object.prototype.hasOwnProperty, W = Array.isArray, F = function() {
  for (var r = [], e = 0; e < 256; ++e)
    r.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
  return r;
}(), na = function(e) {
  for (; e.length > 1; ) {
    var t = e.pop(), n = t.obj[t.prop];
    if (W(n)) {
      for (var o = [], a = 0; a < n.length; ++a)
        typeof n[a] < "u" && o.push(n[a]);
      t.obj[t.prop] = o;
    }
  }
}, Br = function(e, t) {
  for (var n = t && t.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, o = 0; o < e.length; ++o)
    typeof e[o] < "u" && (n[o] = e[o]);
  return n;
}, aa = function r(e, t, n) {
  if (!t)
    return e;
  if (typeof t != "object") {
    if (W(e))
      e.push(t);
    else if (e && typeof e == "object")
      (n && (n.plainObjects || n.allowPrototypes) || !xe.call(Object.prototype, t)) && (e[t] = !0);
    else
      return [e, t];
    return e;
  }
  if (!e || typeof e != "object")
    return [e].concat(t);
  var o = e;
  return W(e) && !W(t) && (o = Br(e, n)), W(e) && W(t) ? (t.forEach(function(a, i) {
    if (xe.call(e, i)) {
      var f = e[i];
      f && typeof f == "object" && a && typeof a == "object" ? e[i] = r(f, a, n) : e.push(a);
    } else
      e[i] = a;
  }), e) : Object.keys(t).reduce(function(a, i) {
    var f = t[i];
    return xe.call(a, i) ? a[i] = r(a[i], f, n) : a[i] = f, a;
  }, o);
}, oa = function(e, t) {
  return Object.keys(t).reduce(function(n, o) {
    return n[o] = t[o], n;
  }, e);
}, ia = function(r, e, t) {
  var n = r.replace(/\+/g, " ");
  if (t === "iso-8859-1")
    return n.replace(/%[0-9a-f]{2}/gi, unescape);
  try {
    return decodeURIComponent(n);
  } catch {
    return n;
  }
}, Te = 1024, la = function(e, t, n, o, a) {
  if (e.length === 0)
    return e;
  var i = e;
  if (typeof e == "symbol" ? i = Symbol.prototype.toString.call(e) : typeof e != "string" && (i = String(e)), n === "iso-8859-1")
    return escape(i).replace(/%u[0-9a-f]{4}/gi, function(v) {
      return "%26%23" + parseInt(v.slice(2), 16) + "%3B";
    });
  for (var f = "", l = 0; l < i.length; l += Te) {
    for (var p = i.length >= Te ? i.slice(l, l + Te) : i, u = [], s = 0; s < p.length; ++s) {
      var c = p.charCodeAt(s);
      if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || a === ta.RFC1738 && (c === 40 || c === 41)) {
        u[u.length] = p.charAt(s);
        continue;
      }
      if (c < 128) {
        u[u.length] = F[c];
        continue;
      }
      if (c < 2048) {
        u[u.length] = F[192 | c >> 6] + F[128 | c & 63];
        continue;
      }
      if (c < 55296 || c >= 57344) {
        u[u.length] = F[224 | c >> 12] + F[128 | c >> 6 & 63] + F[128 | c & 63];
        continue;
      }
      s += 1, c = 65536 + ((c & 1023) << 10 | p.charCodeAt(s) & 1023), u[u.length] = F[240 | c >> 18] + F[128 | c >> 12 & 63] + F[128 | c >> 6 & 63] + F[128 | c & 63];
    }
    f += u.join("");
  }
  return f;
}, fa = function(e) {
  for (var t = [{ obj: { o: e }, prop: "o" }], n = [], o = 0; o < t.length; ++o)
    for (var a = t[o], i = a.obj[a.prop], f = Object.keys(i), l = 0; l < f.length; ++l) {
      var p = f[l], u = i[p];
      typeof u == "object" && u !== null && n.indexOf(u) === -1 && (t.push({ obj: i, prop: p }), n.push(u));
    }
  return na(t), e;
}, ua = function(e) {
  return Object.prototype.toString.call(e) === "[object RegExp]";
}, ca = function(e) {
  return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
}, pa = function(e, t) {
  return [].concat(e, t);
}, ya = function(e, t) {
  if (W(e)) {
    for (var n = [], o = 0; o < e.length; o += 1)
      n.push(t(e[o]));
    return n;
  }
  return t(e);
}, Wr = {
  arrayToObject: Br,
  assign: oa,
  combine: pa,
  compact: fa,
  decode: ia,
  encode: la,
  isBuffer: ca,
  isRegExp: ua,
  maybeMap: ya,
  merge: aa
}, Ur = Zn, ye = Wr, ne = He, sa = Object.prototype.hasOwnProperty, Lr = {
  brackets: function(e) {
    return e + "[]";
  },
  comma: "comma",
  indices: function(e, t) {
    return e + "[" + t + "]";
  },
  repeat: function(e) {
    return e;
  }
}, I = Array.isArray, da = Array.prototype.push, Gr = function(r, e) {
  da.apply(r, I(e) ? e : [e]);
}, va = Date.prototype.toISOString, gr = ne.default, w = {
  addQueryPrefix: !1,
  allowDots: !1,
  allowEmptyArrays: !1,
  arrayFormat: "indices",
  charset: "utf-8",
  charsetSentinel: !1,
  delimiter: "&",
  encode: !0,
  encodeDotInKeys: !1,
  encoder: ye.encode,
  encodeValuesOnly: !1,
  format: gr,
  formatter: ne.formatters[gr],
  // deprecated
  indices: !1,
  serializeDate: function(e) {
    return va.call(e);
  },
  skipNulls: !1,
  strictNullHandling: !1
}, ha = function(e) {
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
}, De = {}, ma = function r(e, t, n, o, a, i, f, l, p, u, s, c, v, m, b, E, g, h) {
  for (var y = e, O = h, C = 0, Y = !1; (O = O.get(De)) !== void 0 && !Y; ) {
    var G = O.get(e);
    if (C += 1, typeof G < "u") {
      if (G === C)
        throw new RangeError("Cyclic object value");
      Y = !0;
    }
    typeof O.get(De) > "u" && (C = 0);
  }
  if (typeof u == "function" ? y = u(t, y) : y instanceof Date ? y = v(y) : n === "comma" && I(y) && (y = ye.maybeMap(y, function(ge) {
    return ge instanceof Date ? v(ge) : ge;
  })), y === null) {
    if (i)
      return p && !E ? p(t, w.encoder, g, "key", m) : t;
    y = "";
  }
  if (ha(y) || ye.isBuffer(y)) {
    if (p) {
      var ie = E ? t : p(t, w.encoder, g, "key", m);
      return [b(ie) + "=" + b(p(y, w.encoder, g, "value", m))];
    }
    return [b(t) + "=" + b(String(y))];
  }
  var B = [];
  if (typeof y > "u")
    return B;
  var T;
  if (n === "comma" && I(y))
    E && p && (y = ye.maybeMap(y, p)), T = [{ value: y.length > 0 ? y.join(",") || null : void 0 }];
  else if (I(u))
    T = u;
  else {
    var le = Object.keys(y);
    T = s ? le.sort(s) : le;
  }
  var k = l ? t.replace(/\./g, "%2E") : t, $ = o && I(y) && y.length === 1 ? k + "[]" : k;
  if (a && I(y) && y.length === 0)
    return $ + "[]";
  for (var D = 0; D < T.length; ++D) {
    var R = T[D], Z = typeof R == "object" && typeof R.value < "u" ? R.value : y[R];
    if (!(f && Z === null)) {
      var me = c && l ? R.replace(/\./g, "%2E") : R, Kr = I(y) ? typeof n == "function" ? n($, me) : $ : $ + (c ? "." + me : "[" + me + "]");
      h.set(e, C);
      var Qe = Ur();
      Qe.set(De, h), Gr(B, r(
        Z,
        Kr,
        n,
        o,
        a,
        i,
        f,
        l,
        n === "comma" && E && I(y) ? null : p,
        u,
        s,
        c,
        v,
        m,
        b,
        E,
        g,
        Qe
      ));
    }
  }
  return B;
}, ga = function(e) {
  if (!e)
    return w;
  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 t = e.charset || w.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 n = ne.default;
  if (typeof e.format < "u") {
    if (!sa.call(ne.formatters, e.format))
      throw new TypeError("Unknown format option provided.");
    n = e.format;
  }
  var o = ne.formatters[n], a = w.filter;
  (typeof e.filter == "function" || I(e.filter)) && (a = e.filter);
  var i;
  if (e.arrayFormat in Lr ? i = e.arrayFormat : "indices" in e ? i = e.indices ? "indices" : "repeat" : i = w.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
    throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
  var f = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : w.allowDots : !!e.allowDots;
  return {
    addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : w.addQueryPrefix,
    allowDots: f,
    allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : w.allowEmptyArrays,
    arrayFormat: i,
    charset: t,
    charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : w.charsetSentinel,
    commaRoundTrip: e.commaRoundTrip,
    delimiter: typeof e.delimiter > "u" ? w.delimiter : e.delimiter,
    encode: typeof e.encode == "boolean" ? e.encode : w.encode,
    encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : w.encodeDotInKeys,
    encoder: typeof e.encoder == "function" ? e.encoder : w.encoder,
    encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : w.encodeValuesOnly,
    filter: a,
    format: n,
    formatter: o,
    serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : w.serializeDate,
    skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : w.skipNulls,
    sort: typeof e.sort == "function" ? e.sort : null,
    strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : w.strictNullHandling
  };
}, Sa = function(r, e) {
  var t = r, n = ga(e), o, a;
  typeof n.filter == "function" ? (a = n.filter, t = a("", t)) : I(n.filter) && (a = n.filter, o = a);
  var i = [];
  if (typeof t != "object" || t === null)
    return "";
  var f = Lr[n.arrayFormat], l = f === "comma" && n.commaRoundTrip;
  o || (o = Object.keys(t)), n.sort && o.sort(n.sort);
  for (var p = Ur(), u = 0; u < o.length; ++u) {
    var s = o[u];
    n.skipNulls && t[s] === null || Gr(i, ma(
      t[s],
      s,
      f,
      l,
      n.allowEmptyArrays,
      n.strictNullHandling,
      n.skipNulls,
      n.encodeDotInKeys,
      n.encode ? n.encoder : null,
      n.filter,
      n.sort,
      n.allowDots,
      n.serializeDate,
      n.format,
      n.formatter,
      n.encodeValuesOnly,
      n.charset,
      p
    ));
  }
  var c = i.join(n.delimiter), v = n.addQueryPrefix === !0 ? "?" : "";
  return n.charsetSentinel && (n.charset === "iso-8859-1" ? v += "utf8=%26%2310003%3B&" : v += "utf8=%E2%9C%93&"), c.length > 0 ? v + c : "";
}, j = Wr, Ue = Object.prototype.hasOwnProperty, ba = Array.isArray, S = {
  allowDots: !1,
  allowEmptyArrays: !1,
  allowPrototypes: !1,
  allowSparse: !1,
  arrayLimit: 20,
  charset: "utf-8",
  charsetSentinel: !1,
  comma: !1,
  decodeDotInKeys: !1,
  decoder: j.decode,
  delimiter: "&",
  depth: 5,
  duplicates: "combine",
  ignoreQueryPrefix: !1,
  interpretNumericEntities: !1,
  parameterLimit: 1e3,
  parseArrays: !0,
  plainObjects: !1,
  strictNullHandling: !1
}, wa = function(r) {
  return r.replace(/&#(\d+);/g, function(e, t) {
    return String.fromCharCode(parseInt(t, 10));
  });
}, kr = function(r, e) {
  return r && typeof r == "string" && e.comma && r.indexOf(",") > -1 ? r.split(",") : r;
}, Aa = "utf8=%26%2310003%3B", Ea = "utf8=%E2%9C%93", Oa = function(e, t) {
  var n = { __proto__: null }, o = t.ignoreQueryPrefix ? e.replace(/^\?/, "") : e, a = t.parameterLimit === 1 / 0 ? void 0 : t.parameterLimit, i = o.split(t.delimiter, a), f = -1, l, p = t.charset;
  if (t.charsetSentinel)
    for (l = 0; l < i.length; ++l)
      i[l].indexOf("utf8=") === 0 && (i[l] === Ea ? p = "utf-8" : i[l] === Aa && (p = "iso-8859-1"), f = l, l = i.length);
  for (l = 0; l < i.length; ++l)
    if (l !== f) {
      var u = i[l], s = u.indexOf("]="), c = s === -1 ? u.indexOf("=") : s + 1, v, m;
      c === -1 ? (v = t.decoder(u, S.decoder, p, "key"), m = t.strictNullHandling ? null : "") : (v = t.decoder(u.slice(0, c), S.decoder, p, "key"), m = j.maybeMap(
        kr(u.slice(c + 1), t),
        function(E) {
          return t.decoder(E, S.decoder, p, "value");
        }
      )), m && t.interpretNumericEntities && p === "iso-8859-1" && (m = wa(m)), u.indexOf("[]=") > -1 && (m = ba(m) ? [m] : m);
      var b = Ue.call(n, v);
      b && t.duplicates === "combine" ? n[v] = j.combine(n[v], m) : (!b || t.duplicates === "last") && (n[v] = m);
    }
  return n;
}, Pa = function(r, e, t, n) {
  for (var o = n ? e : kr(e, t), a = r.length - 1; a >= 0; --a) {
    var i, f = r[a];
    if (f === "[]" && t.parseArrays)
      i = t.allowEmptyArrays && o === "" ? [] : [].concat(o);
    else {
      i = t.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
      var l = f.charAt(0) === "[" && f.charAt(f.length - 1) === "]" ? f.slice(1, -1) : f, p = t.decodeDotInKeys ? l.replace(/%2E/g, ".") : l, u = parseInt(p, 10);
      !t.parseArrays && p === "" ? i = { 0: o } : !isNaN(u) && f !== p && String(u) === p && u >= 0 && t.parseArrays && u <= t.arrayLimit ? (i = [], i[u] = o) : p !== "__proto__" && (i[p] = o);
    }
    o = i;
  }
  return o;
}, $a = function(e, t, n, o) {
  if (e) {
    var a = n.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, i = /(\[[^[\]]*])/, f = /(\[[^[\]]*])/g, l = n.depth > 0 && i.exec(a), p = l ? a.slice(0, l.index) : a, u = [];
    if (p) {
      if (!n.plainObjects && Ue.call(Object.prototype, p) && !n.allowPrototypes)
        return;
      u.push(p);
    }
    for (var s = 0; n.depth > 0 && (l = f.exec(a)) !== null && s < n.depth; ) {
      if (s += 1, !n.plainObjects && Ue.call(Object.prototype, l[1].slice(1, -1)) && !n.allowPrototypes)
        return;
      u.push(l[1]);
    }
    return l && u.push("[" + a.slice(l.index) + "]"), Pa(u, t, n, o);
  }
}, Fa = function(e) {
  if (!e)
    return S;
  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");
  var t = typeof e.charset > "u" ? S.charset : e.charset, n = typeof e.duplicates > "u" ? S.duplicates : e.duplicates;
  if (n !== "combine" && n !== "first" && n !== "last")
    throw new TypeError("The duplicates option must be either combine, first, or last");
  var o = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : S.allowDots : !!e.allowDots;
  return {
    allowDots: o,
    allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : S.allowEmptyArrays,
    allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : S.allowPrototypes,
    allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : S.allowSparse,
    arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : S.arrayLimit,
    charset: t,
    charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : S.charsetSentinel,
    comma: typeof e.comma == "boolean" ? e.comma : S.comma,
    decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : S.decodeDotInKeys,
    decoder: typeof e.decoder == "function" ? e.decoder : S.decoder,
    delimiter: typeof e.delimiter == "string" || j.isRegExp(e.delimiter) ? e.delimiter : S.delimiter,
    // eslint-disable-next-line no-implicit-coercion, no-extra-parens
    depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : S.depth,
    duplicates: n,
    ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
    interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : S.interpretNumericEntities,
    parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : S.parameterLimit,
    parseArrays: e.parseArrays !== !1,
    plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : S.plainObjects,
    strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : S.strictNullHandling
  };
}, Ia = function(r, e) {
  var t = Fa(e);
  if (r === "" || r === null || typeof r > "u")
    return t.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
  for (var n = typeof r == "string" ? Oa(r, t) : r, o = t.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, a = Object.keys(n), i = 0; i < a.length; ++i) {
    var f = a[i], l = $a(f, n[f], t, typeof r == "string");
    o = j.merge(o, l, t);
  }
  return t.allowSparse === !0 ? o : j.compact(o);
}, xa = Sa, Ta = Ia, Da = He, Re = {
  formats: Da,
  parse: Ta,
  stringify: xa
};
const Ra = {
  ignoreQueryPrefix: !0
}, _a = {
  skipNulls: !0
};
function Ma(r, e) {
  const { routerMode: t } = pt(), n = { ...Ra, ...e.parseOptions }, o = {
    ..._a,
    ...e.stringifyOptions
  }, a = e.nestedKey ? {
    [e.nestedKey]: Re.stringify(r || "{}", o)
  } : r, i = ft(t || "hash", { initialValue: a }), f = (u) => {
    e != null && e.nestedKey ? i[e.nestedKey] = Re.stringify(u, o) : Object.entries(u).forEach(([s, c]) => {
      i[s] = c;
    });
  }, l = (u) => {
    f(u);
  };
  return [e.nestedKey ? Re.parse(i[e.nestedKey] || "{}", n) : i, l];
}
export {
  Ma as useUrlState
};
//# sourceMappingURL=useUrlState.mjs.map
