var Ln = Object.defineProperty;
var Bn = (e, t, n) => t in e ? Ln(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var x = (e, t, n) => Bn(e, typeof t != "symbol" ? t + "" : t, n);
import * as Fn from "vue";
import { unref as W, watch as G, nextTick as ke, isRef as Kt, ref as Q, shallowRef as H, watchEffect as Gt, computed as L, toRaw as zt, customRef as ae, toValue as Qe, readonly as Un, provide as ye, inject as J, shallowReactive as Hn, defineComponent as D, reactive as Kn, h as $, getCurrentInstance as qt, renderList as Gn, TransitionGroup as Qt, normalizeStyle as zn, normalizeClass as Ne, toDisplayString as Ae, cloneVNode as Je, vModelDynamic as qn, vShow as Qn, withDirectives as Jn, resolveDynamicComponent as Yn, normalizeProps as Xn, onErrorCaptured as Zn, openBlock as me, createElementBlock as ve, createElementVNode as er, createVNode as tr, createCommentVNode as nr, Fragment as rr, KeepAlive as or } from "vue";
let Jt;
function sr(e) {
  Jt = e;
}
function Ye() {
  return Jt;
}
function Ve() {
  const { queryPath: e, pathParams: t, queryParams: n } = Ye();
  return {
    path: e,
    ...t === void 0 ? {} : { params: t },
    ...n === void 0 ? {} : { queryParams: n }
  };
}
const ft = /* @__PURE__ */ new Map();
function ir(e) {
  var t;
  (t = e.scopes) == null || t.forEach((n) => {
    ft.set(n.id, n);
  });
}
function Ue(e) {
  return ft.get(e);
}
function fe(e) {
  return e && ft.has(e);
}
function he(e) {
  return typeof e == "function" ? e() : W(e);
}
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const Xe = () => {
};
function Ze(e, t = !1, n = "Timeout") {
  return new Promise((r, o) => {
    setTimeout(t ? () => o(n) : r, e);
  });
}
function et(e, t = !1) {
  function n(u, { flush: f = "sync", deep: h = !1, timeout: g, throwOnTimeout: m } = {}) {
    let v = null;
    const _ = [new Promise((R) => {
      v = G(
        e,
        (C) => {
          u(C) !== t && (v ? v() : ke(() => v == null ? void 0 : v()), R(C));
        },
        {
          flush: f,
          deep: h,
          immediate: !0
        }
      );
    })];
    return g != null && _.push(
      Ze(g, m).then(() => he(e)).finally(() => v == null ? void 0 : v())
    ), Promise.race(_);
  }
  function r(u, f) {
    if (!Kt(u))
      return n((C) => C === u, f);
    const { flush: h = "sync", deep: g = !1, timeout: m, throwOnTimeout: v } = f ?? {};
    let E = null;
    const R = [new Promise((C) => {
      E = G(
        [e, u],
        ([M, U]) => {
          t !== (M === U) && (E ? E() : ke(() => E == null ? void 0 : E()), C(M));
        },
        {
          flush: h,
          deep: g,
          immediate: !0
        }
      );
    })];
    return m != null && R.push(
      Ze(m, v).then(() => he(e)).finally(() => (E == null || E(), he(e)))
    ), Promise.race(R);
  }
  function o(u) {
    return n((f) => !!f, u);
  }
  function s(u) {
    return r(null, u);
  }
  function i(u) {
    return r(void 0, u);
  }
  function a(u) {
    return n(Number.isNaN, u);
  }
  function l(u, f) {
    return n((h) => {
      const g = Array.from(h);
      return g.includes(u) || g.includes(he(u));
    }, f);
  }
  function d(u) {
    return c(1, u);
  }
  function c(u = 1, f) {
    let h = -1;
    return n(() => (h += 1, h >= u), f);
  }
  return Array.isArray(he(e)) ? {
    toMatch: n,
    toContains: l,
    changed: d,
    changedTimes: c,
    get not() {
      return et(e, !t);
    }
  } : {
    toMatch: n,
    toBe: r,
    toBeTruthy: o,
    toBeNull: s,
    toBeNaN: a,
    toBeUndefined: i,
    changed: d,
    changedTimes: c,
    get not() {
      return et(e, !t);
    }
  };
}
function ar(e) {
  return et(e);
}
function cr(e, t, n) {
  let r;
  Kt(n) ? r = {
    evaluating: n
  } : r = n || {};
  const {
    lazy: o = !1,
    evaluating: s = void 0,
    shallow: i = !0,
    onError: a = Xe
  } = r, l = Q(!o), d = i ? H(t) : Q(t);
  let c = 0;
  return Gt(async (u) => {
    if (!l.value)
      return;
    c++;
    const f = c;
    let h = !1;
    s && Promise.resolve().then(() => {
      s.value = !0;
    });
    try {
      const g = await e((m) => {
        u(() => {
          s && (s.value = !1), h || m();
        });
      });
      f === c && (d.value = g);
    } catch (g) {
      a(g);
    } finally {
      s && f === c && (s.value = !1), h = !0;
    }
  }), o ? L(() => (l.value = !0, d.value)) : d;
}
function ur(e, t, n) {
  const {
    immediate: r = !0,
    delay: o = 0,
    onError: s = Xe,
    onSuccess: i = Xe,
    resetOnExecute: a = !0,
    shallow: l = !0,
    throwError: d
  } = {}, c = l ? H(t) : Q(t), u = Q(!1), f = Q(!1), h = H(void 0);
  async function g(E = 0, ..._) {
    a && (c.value = t), h.value = void 0, u.value = !1, f.value = !0, E > 0 && await Ze(E);
    const R = typeof e == "function" ? e(..._) : e;
    try {
      const C = await R;
      c.value = C, u.value = !0, i(C);
    } catch (C) {
      if (h.value = C, s(C), d)
        throw C;
    } finally {
      f.value = !1;
    }
    return c.value;
  }
  r && g(o);
  const m = {
    state: c,
    isReady: u,
    isLoading: f,
    error: h,
    execute: g
  };
  function v() {
    return new Promise((E, _) => {
      ar(f).toBe(!1).then(() => E(m)).catch(_);
    });
  }
  return {
    ...m,
    then(E, _) {
      return v().then(E, _);
    }
  };
}
function j(e, t) {
  t = t || {};
  const n = [...Object.keys(t), "__Vue"], r = [...Object.values(t), Fn];
  try {
    return new Function(...n, `return (${e})`)(...r);
  } catch (o) {
    throw new Error(o + " in function code: " + e);
  }
}
function lr(e) {
  if (e.startsWith(":")) {
    e = e.slice(1);
    try {
      return j(e);
    } catch (t) {
      throw new Error(t + " in function code: " + e);
    }
  }
}
function Yt(e) {
  return e.constructor.name === "AsyncFunction";
}
class fr {
  toString() {
    return "";
  }
}
const be = new fr();
function Re(e) {
  return zt(e) === be;
}
function dr(e) {
  return Array.isArray(e) && e[0] === "bind";
}
function hr(e) {
  return e[1];
}
function Xt(e, t, n) {
  if (Array.isArray(t)) {
    const [o, ...s] = t;
    switch (o) {
      case "!":
        return !e;
      case "+":
        return e + s[0];
      case "~+":
        return s[0] + e;
    }
  }
  const r = Zt(t, n);
  return e[r];
}
function Zt(e, t) {
  if (typeof e == "string" || typeof e == "number")
    return e;
  if (!Array.isArray(e))
    throw new Error(`Invalid path ${e}`);
  const [n, ...r] = e;
  switch (n) {
    case "bind":
      if (!t)
        throw new Error("No bindable function provided");
      return t(r[0]);
    default:
      throw new Error(`Invalid flag ${n} in array at ${e}`);
  }
}
function en(e, t, n) {
  return t.reduce(
    (r, o) => Xt(r, o, n),
    e
  );
}
function tn(e, t, n, r) {
  t.reduce((o, s, i) => {
    if (i === t.length - 1)
      o[Zt(s, r)] = n;
    else
      return Xt(o, s, r);
  }, e);
}
function pr(e, t, n) {
  const { paths: r, getBindableValueFn: o } = t, { paths: s, getBindableValueFn: i } = t;
  return r === void 0 || r.length === 0 ? e : ae(() => ({
    get() {
      try {
        return en(
          Qe(e),
          r,
          o
        );
      } catch {
        return;
      }
    },
    set(a) {
      tn(
        Qe(e),
        s || r,
        a,
        i
      );
    }
  }));
}
function dt(e) {
  return ae((t, n) => ({
    get() {
      return t(), e;
    },
    set(r) {
      !Re(e) && JSON.stringify(r) === JSON.stringify(e) || (e = r, n());
    }
  }));
}
function gr(e, t) {
  const { deepCompare: n = !1 } = e;
  return n ? dt(e.value) : Q(e.value);
}
function mr(e, t, n) {
  const { bind: r = {}, code: o, const: s = [] } = e, i = Object.values(r).map((c, u) => s[u] === 1 ? c : t.getVueRefObject(c));
  if (Yt(new Function(o)))
    return cr(
      async () => {
        const c = Object.fromEntries(
          Object.keys(r).map((u, f) => [u, i[f]])
        );
        return await j(o, c)();
      },
      null,
      { lazy: !0 }
    );
  const a = Object.fromEntries(
    Object.keys(r).map((c, u) => [c, i[u]])
  ), l = j(o, a);
  return L(l);
}
function vr(e) {
  const { init: t, deepEqOnInput: n } = e;
  return n === void 0 ? H(t ?? be) : dt(t ?? be);
}
function yr(e, t, n) {
  const {
    inputs: r = [],
    code: o,
    slient: s,
    data: i,
    asyncInit: a = null,
    deepEqOnInput: l = 0
  } = e, d = s || Array(r.length).fill(0), c = i || Array(r.length).fill(0), u = r.filter((v, E) => d[E] === 0 && c[E] === 0).map((v) => t.getVueRefObject(v));
  function f() {
    return r.map(
      (v, E) => c[E] === 1 ? v : t.getValue(v)
    );
  }
  const h = j(o), g = l === 0 ? H(be) : dt(be), m = { immediate: !0, deep: !0 };
  return Yt(h) ? (g.value = a, G(
    u,
    async () => {
      f().some(Re) || (g.value = await h(...f()));
    },
    m
  )) : G(
    u,
    () => {
      const v = f();
      v.some(Re) || (g.value = h(...v));
    },
    m
  ), Un(g);
}
function wr(e) {
  return e.tag === "vfor";
}
function Er(e) {
  return e.tag === "vif";
}
function _r(e) {
  return e.tag === "match";
}
function nn(e) {
  return !("type" in e);
}
function br(e) {
  return "type" in e && e.type === "rp";
}
function ht(e) {
  return "sid" in e && "id" in e;
}
class Rr extends Map {
  constructor(t) {
    super(), this.factory = t;
  }
  getOrDefault(t) {
    if (!this.has(t)) {
      const n = this.factory();
      return this.set(t, n), n;
    }
    return super.get(t);
  }
}
function rn(e) {
  return new Rr(e);
}
class Pr {
  async eventSend(t, n) {
    const { fType: r, hKey: o, key: s } = t, i = Ye().webServerInfo, a = s !== void 0 ? { key: s } : {}, l = r === "sync" ? i.event_url : i.event_async_url;
    let d = {};
    const c = await fetch(l, {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        bind: n,
        hKey: o,
        ...a,
        page: Ve(),
        ...d
      })
    });
    if (!c.ok)
      throw new Error(`HTTP error! status: ${c.status}`);
    return await c.json();
  }
  async watchSend(t) {
    const { fType: n, key: r } = t.watchConfig, o = Ye().webServerInfo, s = n === "sync" ? o.watch_url : o.watch_async_url, i = t.getServerInputs(), a = {
      key: r,
      input: i,
      page: Ve()
    };
    return await (await fetch(s, {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(a)
    })).json();
  }
}
class Sr {
  async eventSend(t, n) {
    const { fType: r, hKey: o, key: s } = t, i = s !== void 0 ? { key: s } : {};
    let a = {};
    const l = {
      bind: n,
      fType: r,
      hKey: o,
      ...i,
      page: Ve(),
      ...a
    };
    return await window.pywebview.api.event_call(l);
  }
  async watchSend(t) {
    const { fType: n, key: r } = t.watchConfig, o = t.getServerInputs(), s = {
      key: r,
      input: o,
      fType: n,
      page: Ve()
    };
    return await window.pywebview.api.watch_call(s);
  }
}
let tt;
function Or(e) {
  switch (e) {
    case "web":
      tt = new Pr();
      break;
    case "webview":
      tt = new Sr();
      break;
  }
}
function on() {
  return tt;
}
var K = /* @__PURE__ */ ((e) => (e[e.Ref = 0] = "Ref", e[e.EventContext = 1] = "EventContext", e[e.Data = 2] = "Data", e[e.JsFn = 3] = "JsFn", e))(K || {}), nt = /* @__PURE__ */ ((e) => (e.const = "c", e.ref = "r", e.range = "n", e))(nt || {}), we = /* @__PURE__ */ ((e) => (e[e.Ref = 0] = "Ref", e[e.RouterAction = 1] = "RouterAction", e[e.ElementRefAction = 2] = "ElementRefAction", e))(we || {});
function kr(e, t) {
  const r = {
    ref: {
      id: t.id,
      sid: e
    },
    type: we.Ref
  };
  return {
    ...t,
    immediate: !0,
    outputs: [r, ...t.outputs || []]
  };
}
function sn(e) {
  const { config: t, varGetter: n } = e;
  if (!t)
    return {
      run: () => {
      },
      tryReset: () => {
      }
    };
  const r = t.map((i) => {
    const a = n.getVueRefObject(i.target);
    return i.type === "const" ? {
      refObj: a,
      preValue: a.value,
      newValue: i.value,
      reset: !0
    } : Nr(a, i, n);
  });
  return {
    run: () => {
      r.forEach((i) => {
        i.newValue !== i.preValue && (i.refObj.value = i.newValue);
      });
    },
    tryReset: () => {
      r.forEach((i) => {
        i.reset && (i.refObj.value = i.preValue);
      });
    }
  };
}
function Nr(e, t, n) {
  const r = j(t.code), o = t.inputs.map((s) => n.getValue(s));
  return {
    refObj: e,
    preValue: e.value,
    reset: t.reset ?? !0,
    newValue: r(...o)
  };
}
function bt(e) {
  return e == null;
}
function $e(e, t, n) {
  if (bt(t) || bt(e.values))
    return;
  t = t;
  const r = e.values, o = e.types ?? Array.from({ length: t.length }).fill(0);
  t.forEach((s, i) => {
    const a = o[i];
    if (a === 1)
      return;
    if (s.type === we.Ref) {
      if (a === 2) {
        r[i].forEach(([c, u]) => {
          const f = s.ref, h = {
            ...f,
            path: [...f.path ?? [], ...c]
          };
          n.updateValue(h, u);
        });
        return;
      }
      n.updateValue(s.ref, r[i]);
      return;
    }
    if (s.type === we.RouterAction) {
      const d = r[i], c = n.getRouter()[d.fn];
      c(...d.args);
      return;
    }
    if (s.type === we.ElementRefAction) {
      const d = s.ref, c = n.getVueRefObject(d).value, u = r[i], { method: f, args: h = [] } = u;
      c[f](...h);
      return;
    }
    const l = n.getVueRefObject(
      s.ref
    );
    l.value = r[i];
  });
}
function Vr(e) {
  const { watchConfigs: t, computedConfigs: n, varMapGetter: r, sid: o } = e;
  return new Cr(t, n, r, o);
}
class Cr {
  constructor(t, n, r, o) {
    x(this, "taskQueue", []);
    x(this, "id2TaskMap", /* @__PURE__ */ new Map());
    x(this, "input2TaskIdMap", rn(() => []));
    this.varMapGetter = r;
    const s = [], i = (a) => {
      var d;
      const l = new Ir(a, r);
      return this.id2TaskMap.set(l.id, l), (d = a.inputs) == null || d.forEach((c, u) => {
        var h, g;
        if (((h = a.data) == null ? void 0 : h[u]) === 0 && ((g = a.slient) == null ? void 0 : g[u]) === 0) {
          if (!nn(c))
            throw new Error("Non-var input bindings are not supported.");
          const m = `${c.sid}-${c.id}`;
          this.input2TaskIdMap.getOrDefault(m).push(l.id);
        }
      }), l;
    };
    t == null || t.forEach((a) => {
      const l = i(a);
      s.push(l);
    }), n == null || n.forEach((a) => {
      const l = i(
        kr(o, a)
      );
      s.push(l);
    }), s.forEach((a) => {
      const {
        deep: l = !0,
        once: d,
        flush: c,
        immediate: u = !0
      } = a.watchConfig, f = {
        immediate: u,
        deep: l,
        once: d,
        flush: c
      }, h = this._getWatchTargets(a);
      G(
        h,
        (g) => {
          g.some(Re) || (a.modify = !0, this.taskQueue.push(new Ar(a)), this._scheduleNextTick());
        },
        f
      );
    });
  }
  _getWatchTargets(t) {
    if (!t.watchConfig.inputs)
      return [];
    const n = t.slientInputs, r = t.constDataInputs;
    return t.watchConfig.inputs.filter(
      (s, i) => !r[i] && !n[i]
    ).map((s) => this.varMapGetter.getVueRefObject(s));
  }
  _scheduleNextTick() {
    ke(() => this._runAllTasks());
  }
  _runAllTasks() {
    const t = this.taskQueue.slice();
    this.taskQueue.length = 0, this._setTaskNodeRelations(t), t.forEach((n) => {
      n.run();
    });
  }
  _setTaskNodeRelations(t) {
    t.forEach((n) => {
      const r = this._findNextNodes(n, t);
      n.appendNextNodes(...r), r.forEach((o) => {
        o.appendPrevNodes(n);
      });
    });
  }
  _findNextNodes(t, n) {
    const r = t.watchTask.watchConfig.outputs;
    if (r && r.length <= 0)
      return [];
    const o = this._getCalculatorTasksByOutput(
      t.watchTask.watchConfig.outputs
    );
    return n.filter(
      (s) => o.has(s.watchTask.id) && s.watchTask.id !== t.watchTask.id
    );
  }
  _getCalculatorTasksByOutput(t) {
    const n = /* @__PURE__ */ new Set();
    return t == null || t.forEach((r) => {
      if (!ht(r.ref))
        throw new Error("Non-var output bindings are not supported.");
      const { sid: o, id: s } = r.ref, i = `${o}-${s}`;
      (this.input2TaskIdMap.get(i) || []).forEach((l) => n.add(l));
    }), n;
  }
}
class Ir {
  constructor(t, n) {
    x(this, "modify", !0);
    x(this, "_running", !1);
    x(this, "id");
    x(this, "_runningPromise", null);
    x(this, "_runningPromiseResolve", null);
    x(this, "_inputInfos");
    this.watchConfig = t, this.varMapGetter = n, this.id = Symbol(t.debug), this._inputInfos = this.createInputInfos();
  }
  createInputInfos() {
    const { inputs: t = [] } = this.watchConfig, n = this.watchConfig.data || Array.from({ length: t.length }).fill(0), r = this.watchConfig.slient || Array.from({ length: t.length }).fill(0);
    return {
      const_data: n,
      slients: r
    };
  }
  get slientInputs() {
    return this._inputInfos.slients;
  }
  get constDataInputs() {
    return this._inputInfos.const_data;
  }
  getServerInputs() {
    const { const_data: t } = this._inputInfos;
    return this.watchConfig.inputs ? this.watchConfig.inputs.map((n, r) => t[r] === 0 ? this.varMapGetter.getValue(n) : n) : [];
  }
  get running() {
    return this._running;
  }
  get runningPromise() {
    return this._runningPromise;
  }
  /**
   * setRunning
   */
  setRunning() {
    this._running = !0, this._runningPromise = new Promise((t) => {
      this._runningPromiseResolve = t;
    }), this._trySetRunningRef(!0);
  }
  /**
   * taskDone
   */
  taskDone() {
    this._running = !1, this._runningPromiseResolve && (this._runningPromiseResolve(), this._runningPromiseResolve = null), this._trySetRunningRef(!1);
  }
  _trySetRunningRef(t) {
    if (this.watchConfig.running) {
      const n = this.varMapGetter.getVueRefObject(
        this.watchConfig.running
      );
      n.value = t;
    }
  }
}
class Ar {
  /**
   *
   */
  constructor(t) {
    x(this, "prevNodes", []);
    x(this, "nextNodes", []);
    x(this, "_runningPrev", !1);
    this.watchTask = t;
  }
  /**
   * appendPrevNodes
   */
  appendPrevNodes(...t) {
    this.prevNodes.push(...t);
  }
  /**
   *
   */
  appendNextNodes(...t) {
    this.nextNodes.push(...t);
  }
  /**
   * hasNextNodes
   */
  hasNextNodes() {
    return this.nextNodes.length > 0;
  }
  /**
   * run
   */
  async run() {
    if (this.prevNodes.length > 0 && !this._runningPrev)
      try {
        this._runningPrev = !0, await Promise.all(this.prevNodes.map((t) => t.run()));
      } finally {
        this._runningPrev = !1;
      }
    if (this.watchTask.running) {
      await this.watchTask.runningPromise;
      return;
    }
    if (this.watchTask.modify) {
      this.watchTask.modify = !1, this.watchTask.setRunning();
      try {
        await $r(this.watchTask);
      } finally {
        this.watchTask.taskDone();
      }
    }
  }
}
async function $r(e) {
  const { varMapGetter: t } = e, { outputs: n, preSetup: r } = e.watchConfig, o = sn({
    config: r,
    varGetter: t
  });
  try {
    o.run();
    const s = await on().watchSend(e);
    if (!s)
      return;
    $e(s, n, t);
  } finally {
    o.tryReset();
  }
}
function Rt(e, t) {
  Object.entries(e).forEach(([n, r]) => t(r, n));
}
function xe(e, t) {
  return an(e, {
    valueFn: t
  });
}
function an(e, t) {
  const { valueFn: n, keyFn: r } = t;
  return Object.fromEntries(
    Object.entries(e).map(([o, s], i) => [
      r ? r(o, s) : o,
      n(s, o, i)
    ])
  );
}
function xr(e, t, n) {
  if (Array.isArray(t)) {
    const [o, ...s] = t;
    switch (o) {
      case "!":
        return !e;
      case "+":
        return e + s[0];
      case "~+":
        return s[0] + e;
    }
  }
  const r = Tr(t);
  return e[r];
}
function Tr(e, t) {
  if (typeof e == "string" || typeof e == "number")
    return e;
  if (!Array.isArray(e))
    throw new Error(`Invalid path ${e}`);
  const [n, ...r] = e;
  switch (n) {
    case "bind":
      throw new Error("No bindable function provided");
    default:
      throw new Error(`Invalid flag ${n} in array at ${e}`);
  }
}
function Dr(e, t, n) {
  return t.reduce(
    (r, o) => xr(r, o),
    e
  );
}
function jr(e, t) {
  return t ? t.reduce((n, r) => n[r], e) : e;
}
const Mr = window.structuredClone || ((e) => JSON.parse(JSON.stringify(e)));
function cn(e) {
  return typeof e == "function" ? e : Mr(zt(e));
}
function Wr(e, t) {
  const {
    on: n,
    code: r,
    immediate: o,
    deep: s,
    once: i,
    flush: a,
    bind: l = {},
    onData: d,
    bindData: c
  } = e, u = d || Array.from({ length: n.length }).fill(0), f = c || Array.from({ length: Object.keys(l).length }).fill(0), h = xe(
    l,
    (v, E, _) => f[_] === 0 ? t.getVueRefObject(v) : v
  ), g = j(r, h), m = n.length === 1 ? Pt(u[0] === 1, n[0], t) : n.map(
    (v, E) => Pt(u[E] === 1, v, t)
  );
  return G(m, g, { immediate: o, deep: s, once: i, flush: a });
}
function Pt(e, t, n) {
  return e ? () => t : n.getVueRefObject(t);
}
function Lr(e, t) {
  const {
    inputs: n = [],
    outputs: r,
    slient: o,
    data: s,
    code: i,
    immediate: a = !0,
    deep: l,
    once: d,
    flush: c
  } = e, u = o || Array.from({ length: n.length }).fill(0), f = s || Array.from({ length: n.length }).fill(0), h = j(i), g = n.filter((v, E) => u[E] === 0 && f[E] === 0).map((v) => t.getVueRefObject(v));
  function m() {
    return n.map((v, E) => f[E] === 0 ? cn(t.getValue(v)) : v);
  }
  G(
    g,
    () => {
      let v = h(...m());
      if (!r)
        return;
      const _ = r.length === 1 ? [v] : v, R = _.map((C) => C === void 0 ? 1 : 0);
      $e(
        {
          values: _,
          types: R
        },
        r,
        t
      );
    },
    { immediate: a, deep: l, once: d, flush: c }
  );
}
const rt = rn(() => Symbol());
function Br(e, t) {
  const n = e.sid, r = rt.getOrDefault(n);
  rt.set(n, r), ye(r, t);
}
function Fr(e) {
  const t = rt.get(e);
  return J(t);
}
function Ur() {
  return un().__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
function un() {
  return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
}
const Hr = typeof Proxy == "function", Kr = "devtools-plugin:setup", Gr = "plugin:settings:set";
let ie, ot;
function zr() {
  var e;
  return ie !== void 0 || (typeof window < "u" && window.performance ? (ie = !0, ot = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (ie = !0, ot = globalThis.perf_hooks.performance) : ie = !1), ie;
}
function qr() {
  return zr() ? ot.now() : Date.now();
}
class Qr {
  constructor(t, n) {
    this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
    const r = {};
    if (t.settings)
      for (const i in t.settings) {
        const a = t.settings[i];
        r[i] = a.defaultValue;
      }
    const o = `__vue-devtools-plugin-settings__${t.id}`;
    let s = Object.assign({}, r);
    try {
      const i = localStorage.getItem(o), a = JSON.parse(i);
      Object.assign(s, a);
    } catch {
    }
    this.fallbacks = {
      getSettings() {
        return s;
      },
      setSettings(i) {
        try {
          localStorage.setItem(o, JSON.stringify(i));
        } catch {
        }
        s = i;
      },
      now() {
        return qr();
      }
    }, n && n.on(Gr, (i, a) => {
      i === this.plugin.id && this.fallbacks.setSettings(a);
    }), this.proxiedOn = new Proxy({}, {
      get: (i, a) => this.target ? this.target.on[a] : (...l) => {
        this.onQueue.push({
          method: a,
          args: l
        });
      }
    }), this.proxiedTarget = new Proxy({}, {
      get: (i, 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((d) => {
        this.targetQueue.push({
          method: a,
          args: l,
          resolve: d
        });
      })
    });
  }
  async setRealTarget(t) {
    this.target = t;
    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 Jr(e, t) {
  const n = e, r = un(), o = Ur(), s = Hr && n.enableEarlyProxy;
  if (o && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !s))
    o.emit(Kr, e, t);
  else {
    const i = s ? new Qr(n, o) : null;
    (r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
      pluginDescriptor: n,
      setupFn: t,
      proxy: i
    }), i && t(i.proxiedTarget);
  }
}
var P = {};
const q = typeof document < "u";
function ln(e) {
  return typeof e == "object" || "displayName" in e || "props" in e || "__vccOpts" in e;
}
function Yr(e) {
  return e.__esModule || e[Symbol.toStringTag] === "Module" || // support CF with dynamic imports that do not
  // add the Module string tag
  e.default && ln(e.default);
}
const N = Object.assign;
function He(e, t) {
  const n = {};
  for (const r in t) {
    const o = t[r];
    n[r] = B(o) ? o.map(e) : e(o);
  }
  return n;
}
const Ee = () => {
}, B = Array.isArray;
function S(e) {
  const t = Array.from(arguments).slice(1);
  console.warn.apply(console, ["[Vue Router warn]: " + e].concat(t));
}
const fn = /#/g, Xr = /&/g, Zr = /\//g, eo = /=/g, to = /\?/g, dn = /\+/g, no = /%5B/g, ro = /%5D/g, hn = /%5E/g, oo = /%60/g, pn = /%7B/g, so = /%7C/g, gn = /%7D/g, io = /%20/g;
function pt(e) {
  return encodeURI("" + e).replace(so, "|").replace(no, "[").replace(ro, "]");
}
function ao(e) {
  return pt(e).replace(pn, "{").replace(gn, "}").replace(hn, "^");
}
function st(e) {
  return pt(e).replace(dn, "%2B").replace(io, "+").replace(fn, "%23").replace(Xr, "%26").replace(oo, "`").replace(pn, "{").replace(gn, "}").replace(hn, "^");
}
function co(e) {
  return st(e).replace(eo, "%3D");
}
function uo(e) {
  return pt(e).replace(fn, "%23").replace(to, "%3F");
}
function lo(e) {
  return e == null ? "" : uo(e).replace(Zr, "%2F");
}
function ce(e) {
  try {
    return decodeURIComponent("" + e);
  } catch {
    P.NODE_ENV !== "production" && S(`Error decoding "${e}". Using original value`);
  }
  return "" + e;
}
const fo = /\/$/, ho = (e) => e.replace(fo, "");
function Ke(e, t, n = "/") {
  let r, o = {}, s = "", i = "";
  const a = t.indexOf("#");
  let l = t.indexOf("?");
  return a < l && a >= 0 && (l = -1), l > -1 && (r = t.slice(0, l), s = t.slice(l + 1, a > -1 ? a : t.length), o = e(s)), a > -1 && (r = r || t.slice(0, a), i = t.slice(a, t.length)), r = mo(r ?? t, n), {
    fullPath: r + (s && "?") + s + i,
    path: r,
    query: o,
    hash: ce(i)
  };
}
function po(e, t) {
  const n = t.query ? e(t.query) : "";
  return t.path + (n && "?") + n + (t.hash || "");
}
function St(e, t) {
  return !t || !e.toLowerCase().startsWith(t.toLowerCase()) ? e : e.slice(t.length) || "/";
}
function Ot(e, t, n) {
  const r = t.matched.length - 1, o = n.matched.length - 1;
  return r > -1 && r === o && Z(t.matched[r], n.matched[o]) && mn(t.params, n.params) && e(t.query) === e(n.query) && t.hash === n.hash;
}
function Z(e, t) {
  return (e.aliasOf || e) === (t.aliasOf || t);
}
function mn(e, t) {
  if (Object.keys(e).length !== Object.keys(t).length)
    return !1;
  for (const n in e)
    if (!go(e[n], t[n]))
      return !1;
  return !0;
}
function go(e, t) {
  return B(e) ? kt(e, t) : B(t) ? kt(t, e) : e === t;
}
function kt(e, t) {
  return B(t) ? e.length === t.length && e.every((n, r) => n === t[r]) : e.length === 1 && e[0] === t;
}
function mo(e, t) {
  if (e.startsWith("/"))
    return e;
  if (P.NODE_ENV !== "production" && !t.startsWith("/"))
    return S(`Cannot resolve a relative location without an absolute path. Trying to resolve "${e}" from "${t}". It should look like "/${t}".`), e;
  if (!e)
    return t;
  const n = t.split("/"), r = e.split("/"), o = r[r.length - 1];
  (o === ".." || o === ".") && r.push("");
  let s = n.length - 1, i, a;
  for (i = 0; i < r.length; i++)
    if (a = r[i], a !== ".")
      if (a === "..")
        s > 1 && s--;
      else
        break;
  return n.slice(0, s).join("/") + "/" + r.slice(i).join("/");
}
const Y = {
  path: "/",
  // TODO: could we use a symbol in the future?
  name: void 0,
  params: {},
  query: {},
  hash: "",
  fullPath: "/",
  matched: [],
  meta: {},
  redirectedFrom: void 0
};
var ue;
(function(e) {
  e.pop = "pop", e.push = "push";
})(ue || (ue = {}));
var te;
(function(e) {
  e.back = "back", e.forward = "forward", e.unknown = "";
})(te || (te = {}));
const Ge = "";
function vn(e) {
  if (!e)
    if (q) {
      const t = document.querySelector("base");
      e = t && t.getAttribute("href") || "/", e = e.replace(/^\w+:\/\/[^\/]+/, "");
    } else
      e = "/";
  return e[0] !== "/" && e[0] !== "#" && (e = "/" + e), ho(e);
}
const vo = /^[^#]+#/;
function yn(e, t) {
  return e.replace(vo, "#") + t;
}
function yo(e, t) {
  const n = document.documentElement.getBoundingClientRect(), r = e.getBoundingClientRect();
  return {
    behavior: t.behavior,
    left: r.left - n.left - (t.left || 0),
    top: r.top - n.top - (t.top || 0)
  };
}
const Te = () => ({
  left: window.scrollX,
  top: window.scrollY
});
function wo(e) {
  let t;
  if ("el" in e) {
    const n = e.el, r = typeof n == "string" && n.startsWith("#");
    if (P.NODE_ENV !== "production" && typeof e.el == "string" && (!r || !document.getElementById(e.el.slice(1))))
      try {
        const s = document.querySelector(e.el);
        if (r && s) {
          S(`The selector "${e.el}" should be passed as "el: document.querySelector('${e.el}')" because it starts with "#".`);
          return;
        }
      } catch {
        S(`The selector "${e.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 o = typeof n == "string" ? r ? document.getElementById(n.slice(1)) : document.querySelector(n) : n;
    if (!o) {
      P.NODE_ENV !== "production" && S(`Couldn't find element using selector "${e.el}" returned by scrollBehavior.`);
      return;
    }
    t = yo(o, e);
  } else
    t = e;
  "scrollBehavior" in document.documentElement.style ? window.scrollTo(t) : window.scrollTo(t.left != null ? t.left : window.scrollX, t.top != null ? t.top : window.scrollY);
}
function Nt(e, t) {
  return (history.state ? history.state.position - t : -1) + e;
}
const it = /* @__PURE__ */ new Map();
function Eo(e, t) {
  it.set(e, t);
}
function _o(e) {
  const t = it.get(e);
  return it.delete(e), t;
}
let bo = () => location.protocol + "//" + location.host;
function wn(e, t) {
  const { pathname: n, search: r, hash: o } = t, s = e.indexOf("#");
  if (s > -1) {
    let a = o.includes(e.slice(s)) ? e.slice(s).length : 1, l = o.slice(a);
    return l[0] !== "/" && (l = "/" + l), St(l, "");
  }
  return St(n, e) + r + o;
}
function Ro(e, t, n, r) {
  let o = [], s = [], i = null;
  const a = ({ state: f }) => {
    const h = wn(e, location), g = n.value, m = t.value;
    let v = 0;
    if (f) {
      if (n.value = h, t.value = f, i && i === g) {
        i = null;
        return;
      }
      v = m ? f.position - m.position : 0;
    } else
      r(h);
    o.forEach((E) => {
      E(n.value, g, {
        delta: v,
        type: ue.pop,
        direction: v ? v > 0 ? te.forward : te.back : te.unknown
      });
    });
  };
  function l() {
    i = n.value;
  }
  function d(f) {
    o.push(f);
    const h = () => {
      const g = o.indexOf(f);
      g > -1 && o.splice(g, 1);
    };
    return s.push(h), h;
  }
  function c() {
    const { history: f } = window;
    f.state && f.replaceState(N({}, f.state, { scroll: Te() }), "");
  }
  function u() {
    for (const f of s)
      f();
    s = [], window.removeEventListener("popstate", a), window.removeEventListener("beforeunload", c);
  }
  return window.addEventListener("popstate", a), window.addEventListener("beforeunload", c, {
    passive: !0
  }), {
    pauseListeners: l,
    listen: d,
    destroy: u
  };
}
function Vt(e, t, n, r = !1, o = !1) {
  return {
    back: e,
    current: t,
    forward: n,
    replaced: r,
    position: window.history.length,
    scroll: o ? Te() : null
  };
}
function Po(e) {
  const { history: t, location: n } = window, r = {
    value: wn(e, n)
  }, o = { value: t.state };
  o.value || s(r.value, {
    back: null,
    current: r.value,
    forward: null,
    // the length is off by one, we need to decrease it
    position: t.length - 1,
    replaced: !0,
    // don't add a scroll as the user may have an anchor, and we want
    // scrollBehavior to be triggered without a saved position
    scroll: null
  }, !0);
  function s(l, d, c) {
    const u = e.indexOf("#"), f = u > -1 ? (n.host && document.querySelector("base") ? e : e.slice(u)) + l : bo() + e + l;
    try {
      t[c ? "replaceState" : "pushState"](d, "", f), o.value = d;
    } catch (h) {
      P.NODE_ENV !== "production" ? S("Error with push/replace State", h) : console.error(h), n[c ? "replace" : "assign"](f);
    }
  }
  function i(l, d) {
    const c = N({}, t.state, Vt(
      o.value.back,
      // keep back and forward entries but override current position
      l,
      o.value.forward,
      !0
    ), d, { position: o.value.position });
    s(l, c, !0), r.value = l;
  }
  function a(l, d) {
    const c = N(
      {},
      // use current history state to gracefully handle a wrong call to
      // history.replaceState
      // https://github.com/vuejs/router/issues/366
      o.value,
      t.state,
      {
        forward: l,
        scroll: Te()
      }
    );
    P.NODE_ENV !== "production" && !t.state && S(`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://router.vuejs.org/guide/migration/#Usage-of-history-state`), s(c.current, c, !0);
    const u = N({}, Vt(r.value, l, null), { position: c.position + 1 }, d);
    s(l, u, !1), r.value = l;
  }
  return {
    location: r,
    state: o,
    push: a,
    replace: i
  };
}
function En(e) {
  e = vn(e);
  const t = Po(e), n = Ro(e, t.state, t.location, t.replace);
  function r(s, i = !0) {
    i || n.pauseListeners(), history.go(s);
  }
  const o = N({
    // it's overridden right after
    location: "",
    base: e,
    go: r,
    createHref: yn.bind(null, e)
  }, t, n);
  return Object.defineProperty(o, "location", {
    enumerable: !0,
    get: () => t.location.value
  }), Object.defineProperty(o, "state", {
    enumerable: !0,
    get: () => t.state.value
  }), o;
}
function So(e = "") {
  let t = [], n = [Ge], r = 0;
  e = vn(e);
  function o(a) {
    r++, r !== n.length && n.splice(r), n.push(a);
  }
  function s(a, l, { direction: d, delta: c }) {
    const u = {
      direction: d,
      delta: c,
      type: ue.pop
    };
    for (const f of t)
      f(a, l, u);
  }
  const i = {
    // rewritten by Object.defineProperty
    location: Ge,
    // TODO: should be kept in queue
    state: {},
    base: e,
    createHref: yn.bind(null, e),
    replace(a) {
      n.splice(r--, 1), o(a);
    },
    push(a, l) {
      o(a);
    },
    listen(a) {
      return t.push(a), () => {
        const l = t.indexOf(a);
        l > -1 && t.splice(l, 1);
      };
    },
    destroy() {
      t = [], n = [Ge], r = 0;
    },
    go(a, l = !0) {
      const d = this.location, c = (
        // we are considering delta === 0 going forward, but in abstract mode
        // using 0 for the delta doesn't make sense like it does in html5 where
        // it reloads the page
        a < 0 ? te.back : te.forward
      );
      r = Math.max(0, Math.min(r + a, n.length - 1)), l && s(this.location, d, {
        direction: c,
        delta: a
      });
    }
  };
  return Object.defineProperty(i, "location", {
    enumerable: !0,
    get: () => n[r]
  }), i;
}
function Oo(e) {
  return e = location.host ? e || location.pathname + location.search : "", e.includes("#") || (e += "#"), P.NODE_ENV !== "production" && !e.endsWith("#/") && !e.endsWith("#") && S(`A hash base must end with a "#":
"${e}" should be "${e.replace(/#.*$/, "#")}".`), En(e);
}
function Ce(e) {
  return typeof e == "string" || e && typeof e == "object";
}
function _n(e) {
  return typeof e == "string" || typeof e == "symbol";
}
const at = Symbol(P.NODE_ENV !== "production" ? "navigation failure" : "");
var Ct;
(function(e) {
  e[e.aborted = 4] = "aborted", e[e.cancelled = 8] = "cancelled", e[e.duplicated = 16] = "duplicated";
})(Ct || (Ct = {}));
const ko = {
  1({ location: e, currentLocation: t }) {
    return `No match for
 ${JSON.stringify(e)}${t ? `
while being at
` + JSON.stringify(t) : ""}`;
  },
  2({ from: e, to: t }) {
    return `Redirected from "${e.fullPath}" to "${Vo(t)}" via a navigation guard.`;
  },
  4({ from: e, to: t }) {
    return `Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`;
  },
  8({ from: e, to: t }) {
    return `Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`;
  },
  16({ from: e, to: t }) {
    return `Avoided redundant navigation to current location: "${e.fullPath}".`;
  }
};
function le(e, t) {
  return P.NODE_ENV !== "production" ? N(new Error(ko[e](t)), {
    type: e,
    [at]: !0
  }, t) : N(new Error(), {
    type: e,
    [at]: !0
  }, t);
}
function z(e, t) {
  return e instanceof Error && at in e && (t == null || !!(e.type & t));
}
const No = ["params", "query", "hash"];
function Vo(e) {
  if (typeof e == "string")
    return e;
  if (e.path != null)
    return e.path;
  const t = {};
  for (const n of No)
    n in e && (t[n] = e[n]);
  return JSON.stringify(t, null, 2);
}
const It = "[^/]+?", Co = {
  sensitive: !1,
  strict: !1,
  start: !0,
  end: !0
}, Io = /[.+*?^${}()[\]/\\]/g;
function Ao(e, t) {
  const n = N({}, Co, t), r = [];
  let o = n.start ? "^" : "";
  const s = [];
  for (const d of e) {
    const c = d.length ? [] : [
      90
      /* PathScore.Root */
    ];
    n.strict && !d.length && (o += "/");
    for (let u = 0; u < d.length; u++) {
      const f = d[u];
      let h = 40 + (n.sensitive ? 0.25 : 0);
      if (f.type === 0)
        u || (o += "/"), o += f.value.replace(Io, "\\$&"), h += 40;
      else if (f.type === 1) {
        const { value: g, repeatable: m, optional: v, regexp: E } = f;
        s.push({
          name: g,
          repeatable: m,
          optional: v
        });
        const _ = E || It;
        if (_ !== It) {
          h += 10;
          try {
            new RegExp(`(${_})`);
          } catch (C) {
            throw new Error(`Invalid custom RegExp for param "${g}" (${_}): ` + C.message);
          }
        }
        let R = m ? `((?:${_})(?:/(?:${_}))*)` : `(${_})`;
        u || (R = // avoid an optional / if there are more segments e.g. /:p?-static
        // or /:p?-:p2
        v && d.length < 2 ? `(?:/${R})` : "/" + R), v && (R += "?"), o += R, h += 20, v && (h += -8), m && (h += -20), _ === ".*" && (h += -50);
      }
      c.push(h);
    }
    r.push(c);
  }
  if (n.strict && n.end) {
    const d = r.length - 1;
    r[d][r[d].length - 1] += 0.7000000000000001;
  }
  n.strict || (o += "/?"), n.end ? o += "$" : n.strict && !o.endsWith("/") && (o += "(?:/|$)");
  const i = new RegExp(o, n.sensitive ? "" : "i");
  function a(d) {
    const c = d.match(i), u = {};
    if (!c)
      return null;
    for (let f = 1; f < c.length; f++) {
      const h = c[f] || "", g = s[f - 1];
      u[g.name] = h && g.repeatable ? h.split("/") : h;
    }
    return u;
  }
  function l(d) {
    let c = "", u = !1;
    for (const f of e) {
      (!u || !c.endsWith("/")) && (c += "/"), u = !1;
      for (const h of f)
        if (h.type === 0)
          c += h.value;
        else if (h.type === 1) {
          const { value: g, repeatable: m, optional: v } = h, E = g in d ? d[g] : "";
          if (B(E) && !m)
            throw new Error(`Provided param "${g}" is an array but it is not repeatable (* or + modifiers)`);
          const _ = B(E) ? E.join("/") : E;
          if (!_)
            if (v)
              f.length < 2 && (c.endsWith("/") ? c = c.slice(0, -1) : u = !0);
            else
              throw new Error(`Missing required param "${g}"`);
          c += _;
        }
    }
    return c || "/";
  }
  return {
    re: i,
    score: r,
    keys: s,
    parse: a,
    stringify: l
  };
}
function $o(e, t) {
  let n = 0;
  for (; n < e.length && n < t.length; ) {
    const r = t[n] - e[n];
    if (r)
      return r;
    n++;
  }
  return e.length < t.length ? e.length === 1 && e[0] === 80 ? -1 : 1 : e.length > t.length ? t.length === 1 && t[0] === 80 ? 1 : -1 : 0;
}
function bn(e, t) {
  let n = 0;
  const r = e.score, o = t.score;
  for (; n < r.length && n < o.length; ) {
    const s = $o(r[n], o[n]);
    if (s)
      return s;
    n++;
  }
  if (Math.abs(o.length - r.length) === 1) {
    if (At(r))
      return 1;
    if (At(o))
      return -1;
  }
  return o.length - r.length;
}
function At(e) {
  const t = e[e.length - 1];
  return e.length > 0 && t[t.length - 1] < 0;
}
const xo = {
  type: 0,
  value: ""
}, To = /[a-zA-Z0-9_]/;
function Do(e) {
  if (!e)
    return [[]];
  if (e === "/")
    return [[xo]];
  if (!e.startsWith("/"))
    throw new Error(P.NODE_ENV !== "production" ? `Route paths should start with a "/": "${e}" should be "/${e}".` : `Invalid path "${e}"`);
  function t(h) {
    throw new Error(`ERR (${n})/"${d}": ${h}`);
  }
  let n = 0, r = n;
  const o = [];
  let s;
  function i() {
    s && o.push(s), s = [];
  }
  let a = 0, l, d = "", c = "";
  function u() {
    d && (n === 0 ? s.push({
      type: 0,
      value: d
    }) : n === 1 || n === 2 || n === 3 ? (s.length > 1 && (l === "*" || l === "+") && t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`), s.push({
      type: 1,
      value: d,
      regexp: c,
      repeatable: l === "*" || l === "+",
      optional: l === "*" || l === "?"
    })) : t("Invalid state to consume buffer"), d = "");
  }
  function f() {
    d += l;
  }
  for (; a < e.length; ) {
    if (l = e[a++], l === "\\" && n !== 2) {
      r = n, n = 4;
      continue;
    }
    switch (n) {
      case 0:
        l === "/" ? (d && u(), i()) : l === ":" ? (u(), n = 1) : f();
        break;
      case 4:
        f(), n = r;
        break;
      case 1:
        l === "(" ? n = 2 : To.test(l) ? f() : (u(), n = 0, l !== "*" && l !== "?" && l !== "+" && a--);
        break;
      case 2:
        l === ")" ? c[c.length - 1] == "\\" ? c = c.slice(0, -1) + l : n = 3 : c += l;
        break;
      case 3:
        u(), n = 0, l !== "*" && l !== "?" && l !== "+" && a--, c = "";
        break;
      default:
        t("Unknown state");
        break;
    }
  }
  return n === 2 && t(`Unfinished custom RegExp for param "${d}"`), u(), i(), o;
}
function jo(e, t, n) {
  const r = Ao(Do(e.path), n);
  if (P.NODE_ENV !== "production") {
    const s = /* @__PURE__ */ new Set();
    for (const i of r.keys)
      s.has(i.name) && S(`Found duplicated params with name "${i.name}" for path "${e.path}". Only the last one will be available on "$route.params".`), s.add(i.name);
  }
  const o = N(r, {
    record: e,
    parent: t,
    // these needs to be populated by the parent
    children: [],
    alias: []
  });
  return t && !o.record.aliasOf == !t.record.aliasOf && t.children.push(o), o;
}
function Mo(e, t) {
  const n = [], r = /* @__PURE__ */ new Map();
  t = Dt({ strict: !1, end: !0, sensitive: !1 }, t);
  function o(u) {
    return r.get(u);
  }
  function s(u, f, h) {
    const g = !h, m = xt(u);
    P.NODE_ENV !== "production" && Fo(m, f), m.aliasOf = h && h.record;
    const v = Dt(t, u), E = [m];
    if ("alias" in u) {
      const C = typeof u.alias == "string" ? [u.alias] : u.alias;
      for (const M of C)
        E.push(
          // we need to normalize again to ensure the `mods` property
          // being non enumerable
          xt(N({}, m, {
            // this allows us to hold a copy of the `components` option
            // so that async components cache is hold on the original record
            components: h ? h.record.components : m.components,
            path: M,
            // we might be the child of an alias
            aliasOf: h ? h.record : m
            // the aliases are always of the same kind as the original since they
            // are defined on the same record
          }))
        );
    }
    let _, R;
    for (const C of E) {
      const { path: M } = C;
      if (f && M[0] !== "/") {
        const U = f.record.path, F = U[U.length - 1] === "/" ? "" : "/";
        C.path = f.record.path + (M && F + M);
      }
      if (P.NODE_ENV !== "production" && C.path === "*")
        throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.`);
      if (_ = jo(C, f, v), P.NODE_ENV !== "production" && f && M[0] === "/" && Ho(_, f), h ? (h.alias.push(_), P.NODE_ENV !== "production" && Bo(h, _)) : (R = R || _, R !== _ && R.alias.push(_), g && u.name && !Tt(_) && (P.NODE_ENV !== "production" && Uo(u, f), i(u.name))), Rn(_) && l(_), m.children) {
        const U = m.children;
        for (let F = 0; F < U.length; F++)
          s(U[F], _, h && h.children[F]);
      }
      h = h || _;
    }
    return R ? () => {
      i(R);
    } : Ee;
  }
  function i(u) {
    if (_n(u)) {
      const f = r.get(u);
      f && (r.delete(u), n.splice(n.indexOf(f), 1), f.children.forEach(i), f.alias.forEach(i));
    } else {
      const f = n.indexOf(u);
      f > -1 && (n.splice(f, 1), u.record.name && r.delete(u.record.name), u.children.forEach(i), u.alias.forEach(i));
    }
  }
  function a() {
    return n;
  }
  function l(u) {
    const f = Ko(u, n);
    n.splice(f, 0, u), u.record.name && !Tt(u) && r.set(u.record.name, u);
  }
  function d(u, f) {
    let h, g = {}, m, v;
    if ("name" in u && u.name) {
      if (h = r.get(u.name), !h)
        throw le(1, {
          location: u
        });
      if (P.NODE_ENV !== "production") {
        const R = Object.keys(u.params || {}).filter((C) => !h.keys.find((M) => M.name === C));
        R.length && S(`Discarded invalid param(s) "${R.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
      }
      v = h.record.name, g = N(
        // paramsFromLocation is a new object
        $t(
          f.params,
          // only keep params that exist in the resolved location
          // only keep optional params coming from a parent record
          h.keys.filter((R) => !R.optional).concat(h.parent ? h.parent.keys.filter((R) => R.optional) : []).map((R) => R.name)
        ),
        // discard any existing params in the current location that do not exist here
        // #1497 this ensures better active/exact matching
        u.params && $t(u.params, h.keys.map((R) => R.name))
      ), m = h.stringify(g);
    } else if (u.path != null)
      m = u.path, P.NODE_ENV !== "production" && !m.startsWith("/") && S(`The Matcher cannot resolve relative paths but received "${m}". Unless you directly called \`matcher.resolve("${m}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`), h = n.find((R) => R.re.test(m)), h && (g = h.parse(m), v = h.record.name);
    else {
      if (h = f.name ? r.get(f.name) : n.find((R) => R.re.test(f.path)), !h)
        throw le(1, {
          location: u,
          currentLocation: f
        });
      v = h.record.name, g = N({}, f.params, u.params), m = h.stringify(g);
    }
    const E = [];
    let _ = h;
    for (; _; )
      E.unshift(_.record), _ = _.parent;
    return {
      name: v,
      path: m,
      params: g,
      matched: E,
      meta: Lo(E)
    };
  }
  e.forEach((u) => s(u));
  function c() {
    n.length = 0, r.clear();
  }
  return {
    addRoute: s,
    resolve: d,
    removeRoute: i,
    clearRoutes: c,
    getRoutes: a,
    getRecordMatcher: o
  };
}
function $t(e, t) {
  const n = {};
  for (const r of t)
    r in e && (n[r] = e[r]);
  return n;
}
function xt(e) {
  const t = {
    path: e.path,
    redirect: e.redirect,
    name: e.name,
    meta: e.meta || {},
    aliasOf: e.aliasOf,
    beforeEnter: e.beforeEnter,
    props: Wo(e),
    children: e.children || [],
    instances: {},
    leaveGuards: /* @__PURE__ */ new Set(),
    updateGuards: /* @__PURE__ */ new Set(),
    enterCallbacks: {},
    // must be declared afterwards
    // mods: {},
    components: "components" in e ? e.components || null : e.component && { default: e.component }
  };
  return Object.defineProperty(t, "mods", {
    value: {}
  }), t;
}
function Wo(e) {
  const t = {}, n = e.props || !1;
  if ("component" in e)
    t.default = n;
  else
    for (const r in e.components)
      t[r] = typeof n == "object" ? n[r] : n;
  return t;
}
function Tt(e) {
  for (; e; ) {
    if (e.record.aliasOf)
      return !0;
    e = e.parent;
  }
  return !1;
}
function Lo(e) {
  return e.reduce((t, n) => N(t, n.meta), {});
}
function Dt(e, t) {
  const n = {};
  for (const r in e)
    n[r] = r in t ? t[r] : e[r];
  return n;
}
function ct(e, t) {
  return e.name === t.name && e.optional === t.optional && e.repeatable === t.repeatable;
}
function Bo(e, t) {
  for (const n of e.keys)
    if (!n.optional && !t.keys.find(ct.bind(null, n)))
      return S(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);
  for (const n of t.keys)
    if (!n.optional && !e.keys.find(ct.bind(null, n)))
      return S(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);
}
function Fo(e, t) {
  t && t.record.name && !e.name && !e.path && S(`The route named "${String(t.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 Uo(e, t) {
  for (let n = t; n; n = n.parent)
    if (n.record.name === e.name)
      throw new Error(`A route named "${String(e.name)}" has been added as a ${t === n ? "child" : "descendant"} of a route with the same name. Route names must be unique and a nested route cannot use the same name as an ancestor.`);
}
function Ho(e, t) {
  for (const n of t.keys)
    if (!e.keys.find(ct.bind(null, n)))
      return S(`Absolute path "${e.record.path}" must have the exact same param named "${n.name}" as its parent "${t.record.path}".`);
}
function Ko(e, t) {
  let n = 0, r = t.length;
  for (; n !== r; ) {
    const s = n + r >> 1;
    bn(e, t[s]) < 0 ? r = s : n = s + 1;
  }
  const o = Go(e);
  return o && (r = t.lastIndexOf(o, r - 1), P.NODE_ENV !== "production" && r < 0 && S(`Finding ancestor route "${o.record.path}" failed for "${e.record.path}"`)), r;
}
function Go(e) {
  let t = e;
  for (; t = t.parent; )
    if (Rn(t) && bn(e, t) === 0)
      return t;
}
function Rn({ record: e }) {
  return !!(e.name || e.components && Object.keys(e.components).length || e.redirect);
}
function zo(e) {
  const t = {};
  if (e === "" || e === "?")
    return t;
  const r = (e[0] === "?" ? e.slice(1) : e).split("&");
  for (let o = 0; o < r.length; ++o) {
    const s = r[o].replace(dn, " "), i = s.indexOf("="), a = ce(i < 0 ? s : s.slice(0, i)), l = i < 0 ? null : ce(s.slice(i + 1));
    if (a in t) {
      let d = t[a];
      B(d) || (d = t[a] = [d]), d.push(l);
    } else
      t[a] = l;
  }
  return t;
}
function jt(e) {
  let t = "";
  for (let n in e) {
    const r = e[n];
    if (n = co(n), r == null) {
      r !== void 0 && (t += (t.length ? "&" : "") + n);
      continue;
    }
    (B(r) ? r.map((s) => s && st(s)) : [r && st(r)]).forEach((s) => {
      s !== void 0 && (t += (t.length ? "&" : "") + n, s != null && (t += "=" + s));
    });
  }
  return t;
}
function qo(e) {
  const t = {};
  for (const n in e) {
    const r = e[n];
    r !== void 0 && (t[n] = B(r) ? r.map((o) => o == null ? null : "" + o) : r == null ? r : "" + r);
  }
  return t;
}
const Qo = Symbol(P.NODE_ENV !== "production" ? "router view location matched" : ""), Mt = Symbol(P.NODE_ENV !== "production" ? "router view depth" : ""), De = Symbol(P.NODE_ENV !== "production" ? "router" : ""), gt = Symbol(P.NODE_ENV !== "production" ? "route location" : ""), ut = Symbol(P.NODE_ENV !== "production" ? "router view location" : "");
function pe() {
  let e = [];
  function t(r) {
    return e.push(r), () => {
      const o = e.indexOf(r);
      o > -1 && e.splice(o, 1);
    };
  }
  function n() {
    e = [];
  }
  return {
    add: t,
    list: () => e.slice(),
    reset: n
  };
}
function X(e, t, n, r, o, s = (i) => i()) {
  const i = r && // name is defined if record is because of the function overload
  (r.enterCallbacks[o] = r.enterCallbacks[o] || []);
  return () => new Promise((a, l) => {
    const d = (f) => {
      f === !1 ? l(le(4, {
        from: n,
        to: t
      })) : f instanceof Error ? l(f) : Ce(f) ? l(le(2, {
        from: t,
        to: f
      })) : (i && // since enterCallbackArray is truthy, both record and name also are
      r.enterCallbacks[o] === i && typeof f == "function" && i.push(f), a());
    }, c = s(() => e.call(r && r.instances[o], t, n, P.NODE_ENV !== "production" ? Jo(d, t, n) : d));
    let u = Promise.resolve(c);
    if (e.length < 3 && (u = u.then(d)), P.NODE_ENV !== "production" && e.length > 2) {
      const f = `The "next" callback was never called inside of ${e.name ? '"' + e.name + '"' : ""}:
${e.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((h) => d._called ? h : (S(f), Promise.reject(new Error("Invalid navigation guard"))));
      else if (c !== void 0 && !d._called) {
        S(f), l(new Error("Invalid navigation guard"));
        return;
      }
    }
    u.catch((f) => l(f));
  });
}
function Jo(e, t, n) {
  let r = 0;
  return function() {
    r++ === 1 && S(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${t.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`), e._called = !0, r === 1 && e.apply(null, arguments);
  };
}
function ze(e, t, n, r, o = (s) => s()) {
  const s = [];
  for (const i of e) {
    P.NODE_ENV !== "production" && !i.components && !i.children.length && S(`Record with path "${i.path}" is either missing a "component(s)" or "children" property.`);
    for (const a in i.components) {
      let l = i.components[a];
      if (P.NODE_ENV !== "production") {
        if (!l || typeof l != "object" && typeof l != "function")
          throw S(`Component "${a}" in record with path "${i.path}" is not a valid component. Received "${String(l)}".`), new Error("Invalid route component");
        if ("then" in l) {
          S(`Component "${a}" in record with path "${i.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 d = l;
          l = () => d;
        } else l.__asyncLoader && // warn only once per component
        !l.__warnedDefineAsync && (l.__warnedDefineAsync = !0, S(`Component "${a}" in record with path "${i.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`));
      }
      if (!(t !== "beforeRouteEnter" && !i.instances[a]))
        if (ln(l)) {
          const c = (l.__vccOpts || l)[t];
          c && s.push(X(c, n, r, i, a, o));
        } else {
          let d = l();
          P.NODE_ENV !== "production" && !("catch" in d) && (S(`Component "${a}" in record with path "${i.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.`), d = Promise.resolve(d)), s.push(() => d.then((c) => {
            if (!c)
              throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);
            const u = Yr(c) ? c.default : c;
            i.mods[a] = c, i.components[a] = u;
            const h = (u.__vccOpts || u)[t];
            return h && X(h, n, r, i, a, o)();
          }));
        }
    }
  }
  return s;
}
function Wt(e) {
  const t = J(De), n = J(gt);
  let r = !1, o = null;
  const s = L(() => {
    const c = W(e.to);
    return P.NODE_ENV !== "production" && (!r || c !== o) && (Ce(c) || (r ? S(`Invalid value for prop "to" in useLink()
- to:`, c, `
- previous to:`, o, `
- props:`, e) : S(`Invalid value for prop "to" in useLink()
- to:`, c, `
- props:`, e)), o = c, r = !0), t.resolve(c);
  }), i = L(() => {
    const { matched: c } = s.value, { length: u } = c, f = c[u - 1], h = n.matched;
    if (!f || !h.length)
      return -1;
    const g = h.findIndex(Z.bind(null, f));
    if (g > -1)
      return g;
    const m = Lt(c[u - 2]);
    return (
      // we are dealing with nested routes
      u > 1 && // if the parent and matched route have the same path, this link is
      // referring to the empty child. Or we currently are on a different
      // child of the same parent
      Lt(f) === m && // avoid comparing the child with its parent
      h[h.length - 1].path !== m ? h.findIndex(Z.bind(null, c[u - 2])) : g
    );
  }), a = L(() => i.value > -1 && ts(n.params, s.value.params)), l = L(() => i.value > -1 && i.value === n.matched.length - 1 && mn(n.params, s.value.params));
  function d(c = {}) {
    if (es(c)) {
      const u = t[W(e.replace) ? "replace" : "push"](
        W(e.to)
        // avoid uncaught errors are they are logged anyway
      ).catch(Ee);
      return e.viewTransition && typeof document < "u" && "startViewTransition" in document && document.startViewTransition(() => u), u;
    }
    return Promise.resolve();
  }
  if (P.NODE_ENV !== "production" && q) {
    const c = qt();
    if (c) {
      const u = {
        route: s.value,
        isActive: a.value,
        isExactActive: l.value,
        error: null
      };
      c.__vrl_devtools = c.__vrl_devtools || [], c.__vrl_devtools.push(u), Gt(() => {
        u.route = s.value, u.isActive = a.value, u.isExactActive = l.value, u.error = Ce(W(e.to)) ? null : 'Invalid "to" value';
      }, { flush: "post" });
    }
  }
  return {
    route: s,
    href: L(() => s.value.href),
    isActive: a,
    isExactActive: l,
    navigate: d
  };
}
function Yo(e) {
  return e.length === 1 ? e[0] : e;
}
const Xo = /* @__PURE__ */ D({
  name: "RouterLink",
  compatConfig: { MODE: 3 },
  props: {
    to: {
      type: [String, Object],
      required: !0
    },
    replace: Boolean,
    activeClass: String,
    // inactiveClass: String,
    exactActiveClass: String,
    custom: Boolean,
    ariaCurrentValue: {
      type: String,
      default: "page"
    }
  },
  useLink: Wt,
  setup(e, { slots: t }) {
    const n = Kn(Wt(e)), { options: r } = J(De), o = L(() => ({
      [Bt(e.activeClass, r.linkActiveClass, "router-link-active")]: n.isActive,
      // [getLinkClass(
      //   props.inactiveClass,
      //   options.linkInactiveClass,
      //   'router-link-inactive'
      // )]: !link.isExactActive,
      [Bt(e.exactActiveClass, r.linkExactActiveClass, "router-link-exact-active")]: n.isExactActive
    }));
    return () => {
      const s = t.default && Yo(t.default(n));
      return e.custom ? s : $("a", {
        "aria-current": n.isExactActive ? e.ariaCurrentValue : null,
        href: n.href,
        // this would override user added attrs but Vue will still add
        // the listener, so we end up triggering both
        onClick: n.navigate,
        class: o.value
      }, s);
    };
  }
}), Zo = Xo;
function es(e) {
  if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && !(e.button !== void 0 && e.button !== 0)) {
    if (e.currentTarget && e.currentTarget.getAttribute) {
      const t = e.currentTarget.getAttribute("target");
      if (/\b_blank\b/i.test(t))
        return;
    }
    return e.preventDefault && e.preventDefault(), !0;
  }
}
function ts(e, t) {
  for (const n in t) {
    const r = t[n], o = e[n];
    if (typeof r == "string") {
      if (r !== o)
        return !1;
    } else if (!B(o) || o.length !== r.length || r.some((s, i) => s !== o[i]))
      return !1;
  }
  return !0;
}
function Lt(e) {
  return e ? e.aliasOf ? e.aliasOf.path : e.path : "";
}
const Bt = (e, t, n) => e ?? t ?? n, ns = /* @__PURE__ */ D({
  name: "RouterView",
  // #674 we manually inherit them
  inheritAttrs: !1,
  props: {
    name: {
      type: String,
      default: "default"
    },
    route: Object
  },
  // Better compat for @vue/compat users
  // https://github.com/vuejs/router/issues/1315
  compatConfig: { MODE: 3 },
  setup(e, { attrs: t, slots: n }) {
    P.NODE_ENV !== "production" && os();
    const r = J(ut), o = L(() => e.route || r.value), s = J(Mt, 0), i = L(() => {
      let d = W(s);
      const { matched: c } = o.value;
      let u;
      for (; (u = c[d]) && !u.components; )
        d++;
      return d;
    }), a = L(() => o.value.matched[i.value]);
    ye(Mt, L(() => i.value + 1)), ye(Qo, a), ye(ut, o);
    const l = Q();
    return G(() => [l.value, a.value, e.name], ([d, c, u], [f, h, g]) => {
      c && (c.instances[u] = d, h && h !== c && d && d === f && (c.leaveGuards.size || (c.leaveGuards = h.leaveGuards), c.updateGuards.size || (c.updateGuards = h.updateGuards))), d && c && // if there is no instance but to and from are the same this might be
      // the first visit
      (!h || !Z(c, h) || !f) && (c.enterCallbacks[u] || []).forEach((m) => m(d));
    }, { flush: "post" }), () => {
      const d = o.value, c = e.name, u = a.value, f = u && u.components[c];
      if (!f)
        return Ft(n.default, { Component: f, route: d });
      const h = u.props[c], g = h ? h === !0 ? d.params : typeof h == "function" ? h(d) : h : null, v = $(f, N({}, g, t, {
        onVnodeUnmounted: (E) => {
          E.component.isUnmounted && (u.instances[c] = null);
        },
        ref: l
      }));
      if (P.NODE_ENV !== "production" && q && v.ref) {
        const E = {
          depth: i.value,
          name: u.name,
          path: u.path,
          meta: u.meta
        };
        (B(v.ref) ? v.ref.map((R) => R.i) : [v.ref.i]).forEach((R) => {
          R.__vrv_devtools = E;
        });
      }
      return (
        // pass the vnode to the slot as a prop.
        // h and <component :is="..."> both accept vnodes
        Ft(n.default, { Component: v, route: d }) || v
      );
    };
  }
});
function Ft(e, t) {
  if (!e)
    return null;
  const n = e(t);
  return n.length === 1 ? n[0] : n;
}
const rs = ns;
function os() {
  const e = qt(), t = e.parent && e.parent.type.name, n = e.parent && e.parent.subTree && e.parent.subTree.type;
  if (t && (t === "KeepAlive" || t.includes("Transition")) && typeof n == "object" && n.name === "RouterView") {
    const r = t === "KeepAlive" ? "keep-alive" : "transition";
    S(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
Use slot props instead:

<router-view v-slot="{ Component }">
  <${r}>
    <component :is="Component" />
  </${r}>
</router-view>`);
  }
}
function ge(e, t) {
  const n = N({}, e, {
    // remove variables that can contain vue instances
    matched: e.matched.map((r) => gs(r, ["instances", "children", "aliasOf"]))
  });
  return {
    _custom: {
      type: null,
      readOnly: !0,
      display: e.fullPath,
      tooltip: t,
      value: n
    }
  };
}
function Oe(e) {
  return {
    _custom: {
      display: e
    }
  };
}
let ss = 0;
function is(e, t, n) {
  if (t.__hasDevtools)
    return;
  t.__hasDevtools = !0;
  const r = ss++;
  Jr({
    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: e
  }, (o) => {
    typeof o.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."), o.on.inspectComponent((c, u) => {
      c.instanceData && c.instanceData.state.push({
        type: "Routing",
        key: "$route",
        editable: !1,
        value: ge(t.currentRoute.value, "Current Route")
      });
    }), o.on.visitComponentTree(({ treeNode: c, componentInstance: u }) => {
      if (u.__vrv_devtools) {
        const f = u.__vrv_devtools;
        c.tags.push({
          label: (f.name ? `${f.name.toString()}: ` : "") + f.path,
          textColor: 0,
          tooltip: "This component is rendered by &lt;router-view&gt;",
          backgroundColor: Pn
        });
      }
      B(u.__vrl_devtools) && (u.__devtoolsApi = o, u.__vrl_devtools.forEach((f) => {
        let h = f.route.path, g = kn, m = "", v = 0;
        f.error ? (h = f.error, g = fs, v = ds) : f.isExactActive ? (g = On, m = "This is exactly active") : f.isActive && (g = Sn, m = "This link is active"), c.tags.push({
          label: h,
          textColor: v,
          tooltip: m,
          backgroundColor: g
        });
      }));
    }), G(t.currentRoute, () => {
      l(), o.notifyComponentUpdate(), o.sendInspectorTree(a), o.sendInspectorState(a);
    });
    const s = "router:navigations:" + r;
    o.addTimelineLayer({
      id: s,
      label: `Router${r ? " " + r : ""} Navigations`,
      color: 4237508
    }), t.onError((c, u) => {
      o.addTimelineEvent({
        layerId: s,
        event: {
          title: "Error during Navigation",
          subtitle: u.fullPath,
          logType: "error",
          time: o.now(),
          data: { error: c },
          groupId: u.meta.__navigationId
        }
      });
    });
    let i = 0;
    t.beforeEach((c, u) => {
      const f = {
        guard: Oe("beforeEach"),
        from: ge(u, "Current Location during this navigation"),
        to: ge(c, "Target location")
      };
      Object.defineProperty(c.meta, "__navigationId", {
        value: i++
      }), o.addTimelineEvent({
        layerId: s,
        event: {
          time: o.now(),
          title: "Start of navigation",
          subtitle: c.fullPath,
          data: f,
          groupId: c.meta.__navigationId
        }
      });
    }), t.afterEach((c, u, f) => {
      const h = {
        guard: Oe("afterEach")
      };
      f ? (h.failure = {
        _custom: {
          type: Error,
          readOnly: !0,
          display: f ? f.message : "",
          tooltip: "Navigation Failure",
          value: f
        }
      }, h.status = Oe("❌")) : h.status = Oe("✅"), h.from = ge(u, "Current Location during this navigation"), h.to = ge(c, "Target location"), o.addTimelineEvent({
        layerId: s,
        event: {
          title: "End of navigation",
          subtitle: c.fullPath,
          time: o.now(),
          data: h,
          logType: f ? "warning" : "default",
          groupId: c.meta.__navigationId
        }
      });
    });
    const a = "router-inspector:" + r;
    o.addInspector({
      id: a,
      label: "Routes" + (r ? " " + r : ""),
      icon: "book",
      treeFilterPlaceholder: "Search routes"
    });
    function l() {
      if (!d)
        return;
      const c = d;
      let u = n.getRoutes().filter((f) => !f.parent || // these routes have a parent with no component which will not appear in the view
      // therefore we still need to include them
      !f.parent.record.components);
      u.forEach(Cn), c.filter && (u = u.filter((f) => (
        // save matches state based on the payload
        lt(f, c.filter.toLowerCase())
      ))), u.forEach((f) => Vn(f, t.currentRoute.value)), c.rootNodes = u.map(Nn);
    }
    let d;
    o.on.getInspectorTree((c) => {
      d = c, c.app === e && c.inspectorId === a && l();
    }), o.on.getInspectorState((c) => {
      if (c.app === e && c.inspectorId === a) {
        const f = n.getRoutes().find((h) => h.record.__vd_id === c.nodeId);
        f && (c.state = {
          options: cs(f)
        });
      }
    }), o.sendInspectorTree(a), o.sendInspectorState(a);
  });
}
function as(e) {
  return e.optional ? e.repeatable ? "*" : "?" : e.repeatable ? "+" : "";
}
function cs(e) {
  const { record: t } = e, n = [
    { editable: !1, key: "path", value: t.path }
  ];
  return t.name != null && n.push({
    editable: !1,
    key: "name",
    value: t.name
  }), n.push({ editable: !1, key: "regexp", value: e.re }), e.keys.length && n.push({
    editable: !1,
    key: "keys",
    value: {
      _custom: {
        type: null,
        readOnly: !0,
        display: e.keys.map((r) => `${r.name}${as(r)}`).join(" "),
        tooltip: "Param keys",
        value: e.keys
      }
    }
  }), t.redirect != null && n.push({
    editable: !1,
    key: "redirect",
    value: t.redirect
  }), e.alias.length && n.push({
    editable: !1,
    key: "aliases",
    value: e.alias.map((r) => r.record.path)
  }), Object.keys(e.record.meta).length && n.push({
    editable: !1,
    key: "meta",
    value: e.record.meta
  }), n.push({
    key: "score",
    editable: !1,
    value: {
      _custom: {
        type: null,
        readOnly: !0,
        display: e.score.map((r) => r.join(", ")).join(" | "),
        tooltip: "Score used to sort routes",
        value: e.score
      }
    }
  }), n;
}
const Pn = 15485081, Sn = 2450411, On = 8702998, us = 2282478, kn = 16486972, ls = 6710886, fs = 16704226, ds = 12131356;
function Nn(e) {
  const t = [], { record: n } = e;
  n.name != null && t.push({
    label: String(n.name),
    textColor: 0,
    backgroundColor: us
  }), n.aliasOf && t.push({
    label: "alias",
    textColor: 0,
    backgroundColor: kn
  }), e.__vd_match && t.push({
    label: "matches",
    textColor: 0,
    backgroundColor: Pn
  }), e.__vd_exactActive && t.push({
    label: "exact",
    textColor: 0,
    backgroundColor: On
  }), e.__vd_active && t.push({
    label: "active",
    textColor: 0,
    backgroundColor: Sn
  }), n.redirect && t.push({
    label: typeof n.redirect == "string" ? `redirect: ${n.redirect}` : "redirects",
    textColor: 16777215,
    backgroundColor: ls
  });
  let r = n.__vd_id;
  return r == null && (r = String(hs++), n.__vd_id = r), {
    id: r,
    label: n.path,
    tags: t,
    children: e.children.map(Nn)
  };
}
let hs = 0;
const ps = /^\/(.*)\/([a-z]*)$/;
function Vn(e, t) {
  const n = t.matched.length && Z(t.matched[t.matched.length - 1], e.record);
  e.__vd_exactActive = e.__vd_active = n, n || (e.__vd_active = t.matched.some((r) => Z(r, e.record))), e.children.forEach((r) => Vn(r, t));
}
function Cn(e) {
  e.__vd_match = !1, e.children.forEach(Cn);
}
function lt(e, t) {
  const n = String(e.re).match(ps);
  if (e.__vd_match = !1, !n || n.length < 3)
    return !1;
  if (new RegExp(n[1].replace(/\$$/, ""), n[2]).test(t))
    return e.children.forEach((i) => lt(i, t)), e.record.path !== "/" || t === "/" ? (e.__vd_match = e.re.test(t), !0) : !1;
  const o = e.record.path.toLowerCase(), s = ce(o);
  return !t.startsWith("/") && (s.includes(t) || o.includes(t)) || s.startsWith(t) || o.startsWith(t) || e.record.name && String(e.record.name).includes(t) ? !0 : e.children.some((i) => lt(i, t));
}
function gs(e, t) {
  const n = {};
  for (const r in e)
    t.includes(r) || (n[r] = e[r]);
  return n;
}
function ms(e) {
  const t = Mo(e.routes, e), n = e.parseQuery || zo, r = e.stringifyQuery || jt, o = e.history;
  if (P.NODE_ENV !== "production" && !o)
    throw new Error('Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history');
  const s = pe(), i = pe(), a = pe(), l = H(Y);
  let d = Y;
  q && e.scrollBehavior && "scrollRestoration" in history && (history.scrollRestoration = "manual");
  const c = He.bind(null, (p) => "" + p), u = He.bind(null, lo), f = (
    // @ts-expect-error: intentionally avoid the type check
    He.bind(null, ce)
  );
  function h(p, w) {
    let y, b;
    return _n(p) ? (y = t.getRecordMatcher(p), P.NODE_ENV !== "production" && !y && S(`Parent route "${String(p)}" not found when adding child route`, w), b = w) : b = p, t.addRoute(b, y);
  }
  function g(p) {
    const w = t.getRecordMatcher(p);
    w ? t.removeRoute(w) : P.NODE_ENV !== "production" && S(`Cannot remove non-existent route "${String(p)}"`);
  }
  function m() {
    return t.getRoutes().map((p) => p.record);
  }
  function v(p) {
    return !!t.getRecordMatcher(p);
  }
  function E(p, w) {
    if (w = N({}, w || l.value), typeof p == "string") {
      const O = Ke(n, p, w.path), I = t.resolve({ path: O.path }, w), ee = o.createHref(O.fullPath);
      return P.NODE_ENV !== "production" && (ee.startsWith("//") ? S(`Location "${p}" resolved to "${ee}". A resolved location cannot start with multiple slashes.`) : I.matched.length || S(`No match found for location with path "${p}"`)), N(O, I, {
        params: f(I.params),
        hash: ce(O.hash),
        redirectedFrom: void 0,
        href: ee
      });
    }
    if (P.NODE_ENV !== "production" && !Ce(p))
      return S(`router.resolve() was passed an invalid location. This will fail in production.
- Location:`, p), E({});
    let y;
    if (p.path != null)
      P.NODE_ENV !== "production" && "params" in p && !("name" in p) && // @ts-expect-error: the type is never
      Object.keys(p.params).length && S(`Path "${p.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`), y = N({}, p, {
        path: Ke(n, p.path, w.path).path
      });
    else {
      const O = N({}, p.params);
      for (const I in O)
        O[I] == null && delete O[I];
      y = N({}, p, {
        params: u(O)
      }), w.params = u(w.params);
    }
    const b = t.resolve(y, w), V = p.hash || "";
    P.NODE_ENV !== "production" && V && !V.startsWith("#") && S(`A \`hash\` should always start with the character "#". Replace "${V}" with "#${V}".`), b.params = c(f(b.params));
    const A = po(r, N({}, p, {
      hash: ao(V),
      path: b.path
    })), k = o.createHref(A);
    return P.NODE_ENV !== "production" && (k.startsWith("//") ? S(`Location "${p}" resolved to "${k}". A resolved location cannot start with multiple slashes.`) : b.matched.length || S(`No match found for location with path "${p.path != null ? p.path : p}"`)), N({
      fullPath: A,
      // keep the hash encoded so fullPath is effectively path + encodedQuery +
      // hash
      hash: V,
      query: (
        // if the user is using a custom query lib like qs, we might have
        // nested objects, so we keep the query as is, meaning it can contain
        // numbers at `$route.query`, but at the point, the user will have to
        // use their own type anyway.
        // https://github.com/vuejs/router/issues/328#issuecomment-649481567
        r === jt ? qo(p.query) : p.query || {}
      )
    }, b, {
      redirectedFrom: void 0,
      href: k
    });
  }
  function _(p) {
    return typeof p == "string" ? Ke(n, p, l.value.path) : N({}, p);
  }
  function R(p, w) {
    if (d !== p)
      return le(8, {
        from: w,
        to: p
      });
  }
  function C(p) {
    return F(p);
  }
  function M(p) {
    return C(N(_(p), { replace: !0 }));
  }
  function U(p) {
    const w = p.matched[p.matched.length - 1];
    if (w && w.redirect) {
      const { redirect: y } = w;
      let b = typeof y == "function" ? y(p) : y;
      if (typeof b == "string" && (b = b.includes("?") || b.includes("#") ? b = _(b) : (
        // force empty params
        { path: b }
      ), b.params = {}), P.NODE_ENV !== "production" && b.path == null && !("name" in b))
        throw S(`Invalid redirect found:
${JSON.stringify(b, null, 2)}
 when navigating to "${p.fullPath}". A redirect must contain a name or path. This will break in production.`), new Error("Invalid redirect");
      return N({
        query: p.query,
        hash: p.hash,
        // avoid transferring params if the redirect has a path
        params: b.path != null ? {} : p.params
      }, b);
    }
  }
  function F(p, w) {
    const y = d = E(p), b = l.value, V = p.state, A = p.force, k = p.replace === !0, O = U(y);
    if (O)
      return F(
        N(_(O), {
          state: typeof O == "object" ? N({}, V, O.state) : V,
          force: A,
          replace: k
        }),
        // keep original redirectedFrom if it exists
        w || y
      );
    const I = y;
    I.redirectedFrom = w;
    let ee;
    return !A && Ot(r, b, y) && (ee = le(16, { to: I, from: b }), Et(
      b,
      b,
      // this is a push, the only way for it to be triggered from a
      // history.listen is with a redirect, which makes it become a push
      !0,
      // This cannot be the first navigation because the initial location
      // cannot be manually navigated to
      !1
    )), (ee ? Promise.resolve(ee) : mt(I, b)).catch((T) => z(T) ? (
      // navigation redirects still mark the router as ready
      z(
        T,
        2
        /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
      ) ? T : Le(T)
    ) : (
      // reject any unknown error
      We(T, I, b)
    )).then((T) => {
      if (T) {
        if (z(
          T,
          2
          /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
        ))
          return P.NODE_ENV !== "production" && // we are redirecting to the same location we were already at
          Ot(r, E(T.to), I) && // and we have done it a couple of times
          w && // @ts-expect-error: added only in dev
          (w._count = w._count ? (
            // @ts-expect-error
            w._count + 1
          ) : 1) > 30 ? (S(`Detected a possibly infinite redirection in a navigation guard when going from "${b.fullPath}" to "${I.fullPath}". Aborting to avoid a Stack Overflow.
 Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`), Promise.reject(new Error("Infinite redirect in navigation guard"))) : F(
            // keep options
            N({
              // preserve an existing replacement but allow the redirect to override it
              replace: k
            }, _(T.to), {
              state: typeof T.to == "object" ? N({}, V, T.to.state) : V,
              force: A
            }),
            // preserve the original redirectedFrom if any
            w || I
          );
      } else
        T = yt(I, b, !0, k, V);
      return vt(I, b, T), T;
    });
  }
  function jn(p, w) {
    const y = R(p, w);
    return y ? Promise.reject(y) : Promise.resolve();
  }
  function je(p) {
    const w = Se.values().next().value;
    return w && typeof w.runWithContext == "function" ? w.runWithContext(p) : p();
  }
  function mt(p, w) {
    let y;
    const [b, V, A] = vs(p, w);
    y = ze(b.reverse(), "beforeRouteLeave", p, w);
    for (const O of b)
      O.leaveGuards.forEach((I) => {
        y.push(X(I, p, w));
      });
    const k = jn.bind(null, p, w);
    return y.push(k), se(y).then(() => {
      y = [];
      for (const O of s.list())
        y.push(X(O, p, w));
      return y.push(k), se(y);
    }).then(() => {
      y = ze(V, "beforeRouteUpdate", p, w);
      for (const O of V)
        O.updateGuards.forEach((I) => {
          y.push(X(I, p, w));
        });
      return y.push(k), se(y);
    }).then(() => {
      y = [];
      for (const O of A)
        if (O.beforeEnter)
          if (B(O.beforeEnter))
            for (const I of O.beforeEnter)
              y.push(X(I, p, w));
          else
            y.push(X(O.beforeEnter, p, w));
      return y.push(k), se(y);
    }).then(() => (p.matched.forEach((O) => O.enterCallbacks = {}), y = ze(A, "beforeRouteEnter", p, w, je), y.push(k), se(y))).then(() => {
      y = [];
      for (const O of i.list())
        y.push(X(O, p, w));
      return y.push(k), se(y);
    }).catch((O) => z(
      O,
      8
      /* ErrorTypes.NAVIGATION_CANCELLED */
    ) ? O : Promise.reject(O));
  }
  function vt(p, w, y) {
    a.list().forEach((b) => je(() => b(p, w, y)));
  }
  function yt(p, w, y, b, V) {
    const A = R(p, w);
    if (A)
      return A;
    const k = w === Y, O = q ? history.state : {};
    y && (b || k ? o.replace(p.fullPath, N({
      scroll: k && O && O.scroll
    }, V)) : o.push(p.fullPath, V)), l.value = p, Et(p, w, y, k), Le();
  }
  let de;
  function Mn() {
    de || (de = o.listen((p, w, y) => {
      if (!_t.listening)
        return;
      const b = E(p), V = U(b);
      if (V) {
        F(N(V, { replace: !0, force: !0 }), b).catch(Ee);
        return;
      }
      d = b;
      const A = l.value;
      q && Eo(Nt(A.fullPath, y.delta), Te()), mt(b, A).catch((k) => z(
        k,
        12
        /* ErrorTypes.NAVIGATION_CANCELLED */
      ) ? k : z(
        k,
        2
        /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
      ) ? (F(
        N(_(k.to), {
          force: !0
        }),
        b
        // avoid an uncaught rejection, let push call triggerError
      ).then((O) => {
        z(
          O,
          20
          /* ErrorTypes.NAVIGATION_DUPLICATED */
        ) && !y.delta && y.type === ue.pop && o.go(-1, !1);
      }).catch(Ee), Promise.reject()) : (y.delta && o.go(-y.delta, !1), We(k, b, A))).then((k) => {
        k = k || yt(
          // after navigation, all matched components are resolved
          b,
          A,
          !1
        ), k && (y.delta && // a new navigation has been triggered, so we do not want to revert, that will change the current history
        // entry while a different route is displayed
        !z(
          k,
          8
          /* ErrorTypes.NAVIGATION_CANCELLED */
        ) ? o.go(-y.delta, !1) : y.type === ue.pop && z(
          k,
          20
          /* ErrorTypes.NAVIGATION_DUPLICATED */
        ) && o.go(-1, !1)), vt(b, A, k);
      }).catch(Ee);
    }));
  }
  let Me = pe(), wt = pe(), Pe;
  function We(p, w, y) {
    Le(p);
    const b = wt.list();
    return b.length ? b.forEach((V) => V(p, w, y)) : (P.NODE_ENV !== "production" && S("uncaught error during route navigation:"), console.error(p)), Promise.reject(p);
  }
  function Wn() {
    return Pe && l.value !== Y ? Promise.resolve() : new Promise((p, w) => {
      Me.add([p, w]);
    });
  }
  function Le(p) {
    return Pe || (Pe = !p, Mn(), Me.list().forEach(([w, y]) => p ? y(p) : w()), Me.reset()), p;
  }
  function Et(p, w, y, b) {
    const { scrollBehavior: V } = e;
    if (!q || !V)
      return Promise.resolve();
    const A = !y && _o(Nt(p.fullPath, 0)) || (b || !y) && history.state && history.state.scroll || null;
    return ke().then(() => V(p, w, A)).then((k) => k && wo(k)).catch((k) => We(k, p, w));
  }
  const Be = (p) => o.go(p);
  let Fe;
  const Se = /* @__PURE__ */ new Set(), _t = {
    currentRoute: l,
    listening: !0,
    addRoute: h,
    removeRoute: g,
    clearRoutes: t.clearRoutes,
    hasRoute: v,
    getRoutes: m,
    resolve: E,
    options: e,
    push: C,
    replace: M,
    go: Be,
    back: () => Be(-1),
    forward: () => Be(1),
    beforeEach: s.add,
    beforeResolve: i.add,
    afterEach: a.add,
    onError: wt.add,
    isReady: Wn,
    install(p) {
      const w = this;
      p.component("RouterLink", Zo), p.component("RouterView", rs), p.config.globalProperties.$router = w, Object.defineProperty(p.config.globalProperties, "$route", {
        enumerable: !0,
        get: () => W(l)
      }), q && // used for the initial navigation client side to avoid pushing
      // multiple times when the router is used in multiple apps
      !Fe && l.value === Y && (Fe = !0, C(o.location).catch((V) => {
        P.NODE_ENV !== "production" && S("Unexpected error when starting the router:", V);
      }));
      const y = {};
      for (const V in Y)
        Object.defineProperty(y, V, {
          get: () => l.value[V],
          enumerable: !0
        });
      p.provide(De, w), p.provide(gt, Hn(y)), p.provide(ut, l);
      const b = p.unmount;
      Se.add(p), p.unmount = function() {
        Se.delete(p), Se.size < 1 && (d = Y, de && de(), de = null, l.value = Y, Fe = !1, Pe = !1), b();
      }, P.NODE_ENV !== "production" && q && is(p, w, t);
    }
  };
  function se(p) {
    return p.reduce((w, y) => w.then(() => je(y)), Promise.resolve());
  }
  return _t;
}
function vs(e, t) {
  const n = [], r = [], o = [], s = Math.max(t.matched.length, e.matched.length);
  for (let i = 0; i < s; i++) {
    const a = t.matched[i];
    a && (e.matched.find((d) => Z(d, a)) ? r.push(a) : n.push(a));
    const l = e.matched[i];
    l && (t.matched.find((d) => Z(d, l)) || o.push(l));
  }
  return [n, r, o];
}
function ys() {
  return J(De);
}
function ws(e) {
  return J(gt);
}
function Es(e) {
  const { immediately: t = !1, code: n } = e;
  let r = j(n);
  return t && (r = r()), r;
}
const _e = /* @__PURE__ */ new Map();
function _s(e) {
  if (!_e.has(e)) {
    const t = Symbol();
    return _e.set(e, t), t;
  }
  return _e.get(e);
}
function re(e, t) {
  var a, l;
  const n = Ue(e), r = Rs(n, t);
  if (r.size > 0) {
    const d = _s(e);
    ye(d, r);
  }
  const o = oe({ attached: { varMap: r, sid: e } });
  Vr({
    watchConfigs: n.py_watch || [],
    computedConfigs: n.web_computed || [],
    varMapGetter: o,
    sid: e
  }), (a = n.js_watch) == null || a.forEach((d) => {
    Lr(d, o);
  }), (l = n.vue_watch) == null || l.forEach((d) => {
    Wr(d, o);
  });
  function s(d, c) {
    const u = Ue(d);
    if (!u.vfor)
      return;
    const { fi: f } = u.vfor;
    f && (r.get(f.id).value = c.index);
  }
  function i(d) {
    const { sid: c, value: u } = d;
    if (!c)
      return;
    const f = Ue(c), { id: h } = f.sp, g = r.get(h);
    g.value = u;
  }
  return {
    updateVforInfo: s,
    updateSlotPropValue: i
  };
}
function oe(e) {
  const { attached: t, sidCollector: n } = e || {}, [r, o, s] = Ps(n);
  t && r.set(t.sid, t.varMap);
  const i = o ? ws() : null, a = s ? ys() : null, l = o ? () => i : () => {
    throw new Error("Route params not found");
  }, d = s ? () => a : () => {
    throw new Error("Router not found");
  };
  function c(m) {
    const v = Qe(f(m));
    return en(v, m.path ?? [], c);
  }
  function u(m) {
    const v = f(m);
    return pr(v, {
      paths: m.path,
      getBindableValueFn: c
    });
  }
  function f(m) {
    return br(m) ? () => l()[m.prop] : r.get(m.sid).get(m.id);
  }
  function h(m, v) {
    if (ht(m)) {
      const E = f(m);
      if (m.path) {
        tn(E.value, m.path, v, c);
        return;
      }
      E.value = v;
      return;
    }
    throw new Error(`Unsupported output binding: ${m}`);
  }
  function g() {
    return d();
  }
  return {
    getValue: c,
    getRouter: g,
    getVueRefObject: u,
    updateValue: h,
    getVueRefObjectWithoutPath: f
  };
}
function In(e) {
  const t = _e.get(e);
  return J(t);
}
function bs(e) {
  const t = In(e);
  if (t === void 0)
    throw new Error(`Scope not found: ${e}`);
  return t;
}
function Rs(e, t) {
  var o, s, i, a, l;
  const n = /* @__PURE__ */ new Map(), r = oe({
    attached: { varMap: n, sid: e.id }
  });
  if (e.data && e.data.forEach((d) => {
    n.set(d.id, d.value);
  }), e.jsFn && e.jsFn.forEach((d) => {
    const c = Es(d);
    n.set(d.id, () => c);
  }), e.vfor && (t != null && t.initVforInfo)) {
    const { fv: d, fi: c, fk: u } = e.vfor, { index: f = 0, keyValue: h = null, config: g } = t.initVforInfo, { sid: m } = g, v = Fr(m);
    if (d) {
      const E = ae(() => ({
        get() {
          const _ = v.value;
          return Array.isArray(_) ? _[f] : Object.values(_)[f];
        },
        set(_) {
          const R = v.value;
          if (!Array.isArray(R)) {
            R[h] = _;
            return;
          }
          R[f] = _;
        }
      }));
      n.set(d.id, E);
    }
    c && n.set(c.id, H(f)), u && n.set(u.id, H(h));
  }
  if (e.sp) {
    const { id: d } = e.sp;
    n.set(d, H(null));
  }
  return (o = e.eRefs) == null || o.forEach((d) => {
    n.set(d.id, H(null));
  }), (s = e.refs) == null || s.forEach((d) => {
    const c = gr(d);
    n.set(d.id, c);
  }), (i = e.web_computed) == null || i.forEach((d) => {
    const c = vr(d);
    n.set(d.id, c);
  }), (a = e.js_computed) == null || a.forEach((d) => {
    const c = yr(
      d,
      r
    );
    n.set(d.id, c);
  }), (l = e.vue_computed) == null || l.forEach((d) => {
    const c = mr(
      d,
      r
    );
    n.set(d.id, c);
  }), n;
}
function Ps(e) {
  const t = /* @__PURE__ */ new Map();
  if (e) {
    const { sids: n, needRouteParams: r = !0, needRouter: o = !0 } = e;
    for (const s of n)
      t.set(s, bs(s));
    return [t, r, o];
  }
  for (const n of _e.keys()) {
    const r = In(n);
    r !== void 0 && t.set(n, r);
  }
  return [t, !0, !0];
}
const Ss = D(Os, {
  props: ["vforConfig", "vforIndex", "vforKeyValue"]
});
function Os(e) {
  const { sid: t, items: n = [] } = e.vforConfig, { updateVforInfo: r } = re(t, {
    initVforInfo: {
      config: e.vforConfig,
      index: e.vforIndex,
      keyValue: e.vforKeyValue
    }
  });
  return () => (r(t, {
    index: e.vforIndex,
    keyValue: e.vforKeyValue
  }), n.length === 1 ? ne(n[0]) : n.map((o) => ne(o)));
}
function Ut(e) {
  const { start: t = 0, end: n, step: r = 1 } = e;
  let o = [];
  if (r > 0)
    for (let s = t; s < n; s += r)
      o.push(s);
  else
    for (let s = t; s > n; s += r)
      o.push(s);
  return o;
}
const An = D(ks, {
  props: ["config"]
});
function ks(e) {
  const { fkey: t, tsGroup: n = {} } = e.config, r = oe(), s = Cs(t ?? "index"), i = Is(e.config, r);
  return Br(e.config, i), () => {
    const a = Gn(i.value, (...l) => {
      const d = l[0], c = l[2] !== void 0, u = c ? l[2] : l[1], f = c ? l[1] : u, h = s(d, u);
      return $(Ss, {
        key: h,
        vforValue: d,
        vforIndex: u,
        vforKeyValue: f,
        vforConfig: e.config
      });
    });
    return n && Object.keys(n).length > 0 ? $(Qt, n, {
      default: () => a
    }) : a;
  };
}
const Ns = (e) => e, Vs = (e, t) => t;
function Cs(e) {
  const t = lr(e);
  return typeof t == "function" ? t : e === "item" ? Ns : Vs;
}
function Is(e, t) {
  const { type: n, value: r } = e.array, o = n === nt.range;
  if (n === nt.const || o && typeof r == "number") {
    const i = o ? Ut({
      end: Math.max(0, r)
    }) : r;
    return ae(() => ({
      get() {
        return i;
      },
      set() {
        throw new Error("Cannot set value to constant array");
      }
    }));
  }
  if (o) {
    const i = r, a = t.getVueRefObject(i);
    return ae(() => ({
      get() {
        return Ut({
          end: Math.max(0, a.value)
        });
      },
      set() {
        throw new Error("Cannot set value to range array");
      }
    }));
  }
  return ae(() => {
    const i = t.getVueRefObject(
      r
    );
    return {
      get() {
        return i.value;
      },
      set(a) {
        i.value = a;
      }
    };
  });
}
const $n = D(As, {
  props: ["config"]
});
function As(e) {
  const { sid: t, items: n, on: r } = e.config;
  fe(t) && re(t);
  const o = oe();
  return () => (typeof r == "boolean" ? r : o.getValue(r)) ? n.map((i) => ne(i)) : void 0;
}
const Ht = D($s, {
  props: ["slotConfig"]
});
function $s(e) {
  const { sid: t, items: n } = e.slotConfig;
  return fe(t) && re(t), () => n.map((r) => ne(r));
}
const qe = ":default", xn = D(xs, {
  props: ["config"]
});
function xs(e) {
  const { on: t, caseValues: n, slots: r, sid: o } = e.config;
  fe(o) && re(o);
  const s = oe();
  return () => {
    const i = s.getValue(t), a = n.map((l, d) => {
      const c = d.toString(), u = r[c];
      return l === i ? $(Ht, { slotConfig: u, key: c }) : null;
    }).filter(Boolean);
    return a.length === 0 && qe in r ? $(Ht, {
      slotConfig: r[qe],
      key: qe
    }) : a;
  };
}
function Ts(e, t) {
  return Object.assign(
    {},
    ...Object.entries(e ?? {}).map(([n, r]) => {
      const o = r.map((a) => {
        if (a.type === "web") {
          const l = Ds(a, t);
          return js(a, l, t);
        } else {
          if (a.type === "vue")
            return Ws(a, t);
          if (a.type === "js")
            return Ms(a, t);
        }
        throw new Error(`unknown event type ${a}`);
      }), i = j(
        " (...args)=> Promise.all(promises(...args))",
        {
          promises: (...a) => o.map(async (l) => {
            await l(...a);
          })
        }
      );
      return { [n]: i };
    })
  );
}
function Ds(e, t) {
  const { inputs: n = [] } = e;
  return (...r) => n.map(({ value: o, type: s }) => {
    if (s === K.EventContext) {
      const { path: i } = o;
      if (i.startsWith(":")) {
        const a = i.slice(1);
        return j(a)(...r);
      }
      return jr(r[0], i.split("."));
    }
    return s === K.Ref ? t.getValue(o) : o;
  });
}
function js(e, t, n) {
  async function r(...o) {
    const s = t(...o), i = sn({
      config: e.preSetup,
      varGetter: n
    });
    try {
      i.run();
      const a = await on().eventSend(e, s);
      if (!a)
        return;
      $e(a, e.sets, n);
    } finally {
      i.tryReset();
    }
  }
  return r;
}
function Ms(e, t) {
  const { sets: n, code: r, inputs: o = [] } = e, s = j(r);
  function i(...a) {
    const l = o.map(({ value: c, type: u }) => {
      if (u === K.EventContext) {
        if (c.path.startsWith(":")) {
          const f = c.path.slice(1);
          return j(f)(...a);
        }
        return Dr(a[0], c.path.split("."));
      }
      if (u === K.Ref)
        return cn(t.getValue(c));
      if (u === K.Data)
        return c;
      if (u === K.JsFn)
        return t.getValue(c);
      throw new Error(`unknown input type ${u}`);
    }), d = s(...l);
    if (n !== void 0) {
      const u = n.length === 1 ? [d] : d, f = u.map((h) => h === void 0 ? 1 : 0);
      $e(
        { values: u, types: f },
        n,
        t
      );
    }
  }
  return i;
}
function Ws(e, t) {
  const { code: n, inputs: r = {} } = e, o = xe(
    r,
    (a) => a.type !== K.Data ? t.getVueRefObject(a.value) : a.value
  ), s = j(n, o);
  function i(...a) {
    s(...a);
  }
  return i;
}
function Ls(e, t) {
  const n = [];
  (e.bStyle || []).forEach((s) => {
    Array.isArray(s) ? n.push(
      ...s.map((i) => t.getValue(i))
    ) : n.push(
      xe(
        s,
        (i) => t.getValue(i)
      )
    );
  });
  const r = zn([e.style || {}, n]);
  return {
    hasStyle: r && Object.keys(r).length > 0,
    styles: r
  };
}
function Bs(e, t) {
  const n = e.classes;
  if (!n)
    return null;
  if (typeof n == "string")
    return Ne(n);
  const { str: r, map: o, bind: s } = n, i = [];
  return r && i.push(r), o && i.push(
    xe(
      o,
      (a) => t.getValue(a)
    )
  ), s && i.push(...s.map((a) => t.getValue(a))), Ne(i);
}
function Ie(e, t = !0) {
  if (!(typeof e != "object" || e === null)) {
    if (Array.isArray(e)) {
      t && e.forEach((n) => Ie(n, !0));
      return;
    }
    for (const [n, r] of Object.entries(e))
      if (n.startsWith(":"))
        try {
          e[n.slice(1)] = new Function(`return (${r})`)(), delete e[n];
        } catch (o) {
          console.error(
            `Error while converting ${n} attribute to function:`,
            o
          );
        }
      else
        t && Ie(r, !0);
  }
}
function Fs(e, t) {
  const n = e.startsWith(":");
  return n && (e = e.slice(1), t = j(t)), { name: e, value: t, isFunc: n };
}
function Us(e, t, n) {
  var o;
  const r = {};
  return Rt(e.bProps || {}, (s, i) => {
    const a = n.getValue(s);
    Re(a) || (Ie(a), r[i] = Hs(a, i));
  }), (o = e.proxyProps) == null || o.forEach((s) => {
    const i = n.getValue(s);
    typeof i == "object" && Rt(i, (a, l) => {
      const { name: d, value: c } = Fs(l, a);
      r[d] = c;
    });
  }), { ...t, ...r };
}
function Hs(e, t) {
  return t === "innerText" ? Ae(e) : e;
}
const Ks = D(Gs, {
  props: ["slotPropValue", "config"]
});
function Gs(e) {
  const { sid: t, items: n } = e.config, r = fe(t) ? re(t).updateSlotPropValue : zs;
  return () => (r({ sid: t, value: e.slotPropValue }), n.map((o) => ne(o)));
}
function zs() {
}
const qs = D(Qs, {
  props: ["config", "sid"]
});
function Qs(e) {
  const { sid: t } = e;
  return fe(t) && re(t), () => ne(e.config);
}
function Js(e) {
  if (!e.slots)
    return null;
  const t = e.slots ?? {};
  return an(t, { keyFn: (s) => s === ":" ? "default" : s, valueFn: (s) => {
    const { items: i } = s;
    return (a) => s.use_prop ? Ys(a, s) : Xs(i, s.sid);
  } });
}
function Ys(e, t) {
  return $(Ks, { config: t, slotPropValue: e });
}
function Xs(e, t) {
  return (e ?? []).map((n) => $(qs, { config: n, sid: t }));
}
function Zs(e, t, n) {
  const r = [], { dir: o = [] } = t;
  return o.forEach((s) => {
    const { sys: i, name: a, arg: l, value: d, mf: c } = s;
    if (a === "vmodel") {
      const u = n.getVueRefObject(d);
      if (e = Je(e, {
        [`onUpdate:${l}`]: (f) => {
          u.value = f;
        }
      }), i === 1) {
        const f = c ? Object.fromEntries(c.map((h) => [h, !0])) : {};
        r.push([qn, u.value, void 0, f]);
      } else
        e = Je(e, {
          [l]: u.value
        });
    } else if (a === "vshow") {
      const u = n.getVueRefObject(d);
      r.push([Qn, u.value]);
    } else
      console.warn(`Directive ${a} is not supported yet`);
  }), Jn(e, r);
}
function ei(e, t, n) {
  const { eRef: r } = t;
  return r ? Je(e, { ref: n.getVueRefObject(r) }) : e;
}
const ti = D(ni, {
  props: ["config"]
});
function ni(e) {
  const { config: t } = e, n = oe({
    sidCollector: new ri(t).getCollectInfo()
  }), r = t.props ?? {};
  return Ie(r, !0), () => {
    const { tag: o } = t, s = typeof o == "string" ? o : n.getValue(o), i = Yn(s), a = Bs(t, n), { styles: l, hasStyle: d } = Ls(t, n), c = Ts(t.events ?? {}, n), u = Js(t), f = Us(t, r, n), h = Xn({
      ...f,
      ...c
    }) || {};
    d && (h.style = l), a && (h.class = a);
    let g = $(i, { ...h }, u);
    return g = ei(g, t, n), Zs(g, t, n);
  };
}
class ri {
  constructor(t) {
    x(this, "sids", /* @__PURE__ */ new Set());
    x(this, "needRouteParams", !0);
    x(this, "needRouter", !0);
    this.config = t;
  }
  /**
   * getCollectFn
   */
  getCollectInfo() {
    const { eRef: t, dir: n, classes: r, bProps: o, proxyProps: s, bStyle: i, events: a } = this.config;
    if (t && this._tryExtractSidToCollection(t), n && n.forEach((l) => {
      this._tryExtractSidToCollection(l.value), this._extendWithPaths(l.value);
    }), r && typeof r != "string") {
      const { map: l, bind: d } = r;
      l && Object.values(l).forEach((c) => {
        this._tryExtractSidToCollection(c), this._extendWithPaths(c);
      }), d && d.forEach((c) => {
        this._tryExtractSidToCollection(c), this._extendWithPaths(c);
      });
    }
    return o && Object.values(o).forEach((l) => {
      this._tryExtractSidToCollection(l), this._extendWithPaths(l);
    }), s && s.forEach((l) => {
      this._tryExtractSidToCollection(l), this._extendWithPaths(l);
    }), i && i.forEach((l) => {
      Array.isArray(l) ? l.forEach((d) => {
        this._tryExtractSidToCollection(d), this._extendWithPaths(d);
      }) : Object.values(l).forEach((d) => {
        this._tryExtractSidToCollection(d), this._extendWithPaths(d);
      });
    }), a && Object.values(a).forEach((l) => {
      this._handleEventInputs(l), this._handleEventSets(l);
    }), {
      sids: this.sids,
      needRouteParams: this.needRouteParams,
      needRouter: this.needRouter
    };
  }
  _tryExtractSidToCollection(t) {
    nn(t) && this.sids.add(t.sid);
  }
  _handleEventInputs(t) {
    t.forEach((n) => {
      if (n.type === "js" || n.type === "web") {
        const { inputs: r } = n;
        r == null || r.forEach((o) => {
          if (o.type === K.Ref) {
            const s = o.value;
            this._tryExtractSidToCollection(s), this._extendWithPaths(s);
          }
        });
      } else if (n.type === "vue") {
        const { inputs: r } = n;
        if (r) {
          const o = Object.values(r);
          o == null || o.forEach((s) => {
            if (s.type === K.Ref) {
              const i = s.value;
              this._tryExtractSidToCollection(i), this._extendWithPaths(i);
            }
          });
        }
      }
    });
  }
  _handleEventSets(t) {
    t.forEach((n) => {
      if (n.type === "js" || n.type === "web") {
        const { sets: r } = n;
        r == null || r.forEach((o) => {
          ht(o.ref) && (this.sids.add(o.ref.sid), this._extendWithPaths(o.ref));
        });
      }
    });
  }
  _extendWithPaths(t) {
    if (!t.path)
      return;
    const n = [];
    for (n.push(...t.path); n.length > 0; ) {
      const r = n.pop();
      if (r === void 0)
        break;
      if (dr(r)) {
        const o = hr(r);
        this._tryExtractSidToCollection(o), o.path && n.push(...o.path);
      }
    }
  }
}
function ne(e, t) {
  return wr(e) ? $(An, { config: e, key: t }) : Er(e) ? $($n, { config: e, key: t }) : _r(e) ? $(xn, { config: e, key: t }) : $(ti, { config: e, key: t });
}
function oi(e, t) {
  return $(Tn, { slotConfig: e, key: t });
}
const Tn = D(si, {
  props: ["slotConfig"]
});
function si(e) {
  const { sid: t, items: n } = e.slotConfig;
  return fe(t) && re(t), () => n.map((r) => ne(r));
}
function ii(e, t) {
  const { state: n, isReady: r, isLoading: o } = ur(async () => {
    let s = e;
    const i = t;
    if (!s && !i)
      throw new Error("Either config or configUrl must be provided");
    if (!s && i && (s = await (await fetch(i)).json()), !s)
      throw new Error("Failed to load config");
    return s;
  }, {});
  return { config: n, isReady: r, isLoading: o };
}
function ai(e) {
  const t = Q(!1), n = Q("");
  function r(o, s) {
    let i;
    return s.component ? i = `Error captured from component:tag: ${s.component.tag} ; id: ${s.component.id} ` : i = "Error captured from app init", console.group(i), console.error("Component:", s.component), console.error("Error:", o), console.groupEnd(), e && (t.value = !0, n.value = `${i} ${o.message}`), !1;
  }
  return Zn(r), { hasError: t, errorMessage: n };
}
const ci = {
  class: "app-box insta-themes",
  "data-scaling": "100%"
}, ui = {
  key: 0,
  style: { position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }
}, li = {
  key: 0,
  style: { color: "red", "font-size": "1.2em", margin: "1rem", border: "1px dashed red", padding: "1rem" }
}, fi = /* @__PURE__ */ D({
  __name: "App",
  props: {
    config: {},
    meta: {},
    configUrl: {}
  },
  setup(e) {
    const t = e, { debug: n = !1 } = t.meta, { config: r, isLoading: o } = ii(
      t.config,
      t.configUrl
    );
    G(r, (a) => {
      a.url && (sr({
        mode: t.meta.mode,
        version: t.meta.version,
        queryPath: a.url.path,
        pathParams: a.url.params,
        webServerInfo: a.webInfo
      }), Or(t.meta.mode)), ir(a);
    });
    const { hasError: s, errorMessage: i } = ai(n);
    return (a, l) => (me(), ve("div", ci, [
      W(o) ? (me(), ve("div", ui, l[0] || (l[0] = [
        er("p", { style: { margin: "auto" } }, "Loading ...", -1)
      ]))) : (me(), ve("div", {
        key: 1,
        class: Ne(["insta-main", W(r).class])
      }, [
        tr(W(Tn), { "slot-config": W(r) }, null, 8, ["slot-config"]),
        W(s) ? (me(), ve("div", li, Ae(W(i)), 1)) : nr("", !0)
      ], 2))
    ]));
  }
});
function di(e, { slots: t }) {
  const { name: n = "fade", tag: r } = e;
  return () => $(
    Qt,
    { name: n, tag: r },
    {
      default: t.default
    }
  );
}
const hi = D(di, {
  props: ["name", "tag"]
});
function pi(e) {
  const { content: t, r: n = 0 } = e, r = oe(), o = n === 1 ? () => r.getValue(t) : () => t;
  return () => Ae(o());
}
const gi = D(pi, {
  props: ["content", "r"]
});
function mi(e) {
  return `i-size-${e}`;
}
function vi(e) {
  return e ? `i-weight-${e}` : "";
}
function yi(e) {
  return e ? `i-text-align-${e}` : "";
}
const wi = /* @__PURE__ */ D({
  __name: "Heading",
  props: {
    text: {},
    size: {},
    weight: {},
    align: {}
  },
  setup(e) {
    const t = e, n = L(() => [
      mi(t.size ?? "6"),
      vi(t.weight),
      yi(t.align)
    ]);
    return (r, o) => (me(), ve("h1", {
      class: Ne(["insta-Heading", n.value])
    }, Ae(r.text), 3));
  }
});
function Ei(e) {
  if (!e.router)
    throw new Error("Router config is not provided.");
  const { routes: t, kAlive: n = !1 } = e.router;
  return t.map(
    (o) => Dn(o, n)
  );
}
function Dn(e, t) {
  var a;
  const { server: n = !1, vueItem: r } = e, o = () => {
    if (n)
      throw new Error("Server-side rendering is not supported yet.");
    return Promise.resolve(_i(e, t));
  }, s = (a = r.children) == null ? void 0 : a.map(
    (l) => Dn(l, t)
  ), i = {
    ...r,
    children: s,
    component: o
  };
  return r.component.length === 0 && delete i.component, s === void 0 && delete i.children, i;
}
function _i(e, t) {
  const { sid: n, vueItem: r } = e, { path: o, component: s } = r, i = oi(
    {
      items: s,
      sid: n
    },
    o
  ), a = $(rr, null, i);
  return t ? $(or, null, () => i) : a;
}
function bi(e, t) {
  const { mode: n = "hash" } = t.router, r = n === "hash" ? Oo() : n === "memory" ? So() : En();
  e.use(
    ms({
      history: r,
      routes: Ei(t)
    })
  );
}
function Si(e, t) {
  e.component("insta-ui", fi), e.component("vif", $n), e.component("vfor", An), e.component("match", xn), e.component("ts-group", hi), e.component("content", gi), e.component("heading", wi), t.router && bi(e, t);
}
export {
  Ie as convertDynamicProperties,
  Si as install
};
//# sourceMappingURL=insta-ui.js.map
