arcpay-sdk
Version:
arcpay is a web3 payment processor, facilitating the use of royalty points to purchase digital and real-world assets. The sdk provides a plug and play interface with arcpay contracts and enable users to create and purchase listings.
1,463 lines (1,462 loc) • 692 kB
JavaScript
var Tu = Object.defineProperty;
var Ru = (t, e, n) => e in t ? Tu(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
var Q = (t, e, n) => Ru(t, typeof e != "symbol" ? e + "" : e, n);
import { resolveComponent as sn, openBlock as C, createBlock as W, shallowRef as Is, inject as ce, unref as y, shallowReactive as Iu, nextTick as Mr, defineComponent as N, reactive as zn, computed as B, h as jt, provide as Kr, ref as P, watch as pe, getCurrentInstance as Gn, watchEffect as Pu, normalizeClass as gt, withCtx as O, renderSlot as ie, createElementBlock as I, onMounted as Ie, Fragment as Me, renderList as jn, createVNode as _, createElementVNode as A, createTextVNode as V, toDisplayString as D, createCommentVNode as ee, normalizeStyle as Mu, normalizeProps as fo, guardReactiveProps as mo, mergeProps as _e, resolveDirective as on, createStaticVNode as go, withDirectives as ut, readonly as ju, getCurrentScope as Ji, onScopeDispose as Yi, toRaw as yo, onBeforeUnmount as Du, onUnmounted as vo, vModelText as dx, toRefs as Bu, vShow as Nu, pushScopeId as Lu, popScopeId as Uu, resolveDynamicComponent as Fu, useSlots as Ki, onUpdated as Vu, createApp as zu } from "vue";
import { Primitive as Gu, useForwardPropsEmits as vt, DialogRoot as qu, useForwardProps as qn, DialogTitle as $u, DialogDescription as Qu, ScrollAreaScrollbar as Hu, ScrollAreaThumb as Wu, ScrollAreaRoot as Ju, ScrollAreaViewport as Yu, ScrollAreaCorner as Ku, DialogPortal as Zu, DialogOverlay as Xu, DialogContent as ed, DialogClose as td, VisuallyHidden as nd, NumberFieldRoot as rd, NumberFieldInput as sd, NumberFieldIncrement as od, NumberFieldDecrement as ad, Label as id, ComboboxRoot as ld, ComboboxEmpty as cd, ComboboxGroup as ud, ComboboxLabel as dd, ComboboxInput as pd, ComboboxItem as hd, ComboboxContent as fd, PopoverRoot as md, PopoverTrigger as gd, PopoverPortal as yd, PopoverContent as vd } from "radix-vue";
import z, { TransactionType as Se, OnApplicationComplete as bd } from "algosdk";
import { WalletId as ye, NetworkId as Xn, WalletManager as wd } from "@txnlab/use-wallet";
const ve = [];
for (let t = 0; t < 256; ++t)
ve.push((t + 256).toString(16).slice(1));
function _d(t, e = 0) {
return (ve[t[e + 0]] + ve[t[e + 1]] + ve[t[e + 2]] + ve[t[e + 3]] + "-" + ve[t[e + 4]] + ve[t[e + 5]] + "-" + ve[t[e + 6]] + ve[t[e + 7]] + "-" + ve[t[e + 8]] + ve[t[e + 9]] + "-" + ve[t[e + 10]] + ve[t[e + 11]] + ve[t[e + 12]] + ve[t[e + 13]] + ve[t[e + 14]] + ve[t[e + 15]]).toLowerCase();
}
let Zr;
const xd = new Uint8Array(16);
function Ad() {
if (!Zr) {
if (typeof crypto > "u" || !crypto.getRandomValues)
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
Zr = crypto.getRandomValues.bind(crypto);
}
return Zr(xd);
}
const kd = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), sa = { randomUUID: kd };
function Ed(t, e, n) {
if (sa.randomUUID && !e && !t)
return sa.randomUUID();
t = t || {};
const r = t.random || (t.rng || Ad)();
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, _d(r);
}
const Nt = (t, e) => {
const n = t.__vccOpts || t;
for (const [r, s] of e)
n[r] = s;
return n;
}, Cd = {};
function Sd(t, e) {
const n = sn("router-view");
return C(), W(n);
}
const Od = /* @__PURE__ */ Nt(Cd, [["render", Sd]]);
function Td() {
return Zi().__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
function Zi() {
return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
}
const Rd = typeof Proxy == "function", Id = "devtools-plugin:setup", Pd = "plugin:settings:set";
let zt, Ps;
function Md() {
var t;
return zt !== void 0 || (typeof window < "u" && window.performance ? (zt = !0, Ps = window.performance) : typeof globalThis < "u" && (!((t = globalThis.perf_hooks) === null || t === void 0) && t.performance) ? (zt = !0, Ps = globalThis.perf_hooks.performance) : zt = !1), zt;
}
function jd() {
return Md() ? Ps.now() : Date.now();
}
class Dd {
constructor(e, n) {
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = e, this.hook = n;
const r = {};
if (e.settings)
for (const a in e.settings) {
const i = e.settings[a];
r[a] = i.defaultValue;
}
const s = `__vue-devtools-plugin-settings__${e.id}`;
let o = Object.assign({}, r);
try {
const a = localStorage.getItem(s), i = JSON.parse(a);
Object.assign(o, i);
} catch {
}
this.fallbacks = {
getSettings() {
return o;
},
setSettings(a) {
try {
localStorage.setItem(s, JSON.stringify(a));
} catch {
}
o = a;
},
now() {
return jd();
}
}, n && n.on(Pd, (a, i) => {
a === this.plugin.id && this.fallbacks.setSettings(i);
}), this.proxiedOn = new Proxy({}, {
get: (a, i) => this.target ? this.target.on[i] : (...l) => {
this.onQueue.push({
method: i,
args: l
});
}
}), this.proxiedTarget = new Proxy({}, {
get: (a, i) => this.target ? this.target[i] : i === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(i) ? (...l) => (this.targetQueue.push({
method: i,
args: l,
resolve: () => {
}
}), this.fallbacks[i](...l)) : (...l) => new Promise((c) => {
this.targetQueue.push({
method: i,
args: l,
resolve: c
});
})
});
}
async setRealTarget(e) {
this.target = e;
for (const n of this.onQueue)
this.target.on[n.method](...n.args);
for (const n of this.targetQueue)
n.resolve(await this.target[n.method](...n.args));
}
}
function Bd(t, e) {
const n = t, r = Zi(), s = Td(), o = Rd && n.enableEarlyProxy;
if (s && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !o))
s.emit(Id, t, e);
else {
const a = o ? new Dd(n, s) : null;
(r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
pluginDescriptor: n,
setupFn: e,
proxy: a
}), a && e(a.proxiedTarget);
}
}
/*!
* vue-router v4.5.0
* (c) 2024 Eduardo San Martin Morote
* @license MIT
*/
const Je = typeof document < "u";
function Xi(t) {
return typeof t == "object" || "displayName" in t || "props" in t || "__vccOpts" in t;
}
function Nd(t) {
return t.__esModule || t[Symbol.toStringTag] === "Module" || // support CF with dynamic imports that do not
// add the Module string tag
t.default && Xi(t.default);
}
const ne = Object.assign;
function Xr(t, e) {
const n = {};
for (const r in e) {
const s = e[r];
n[r] = Re(s) ? s.map(t) : t(s);
}
return n;
}
const Cn = () => {
}, Re = Array.isArray;
function Y(t) {
const e = Array.from(arguments).slice(1);
console.warn.apply(console, ["[Vue Router warn]: " + t].concat(e));
}
const el = /#/g, Ld = /&/g, Ud = /\//g, Fd = /=/g, Vd = /\?/g, tl = /\+/g, zd = /%5B/g, Gd = /%5D/g, nl = /%5E/g, qd = /%60/g, rl = /%7B/g, $d = /%7C/g, sl = /%7D/g, Qd = /%20/g;
function bo(t) {
return encodeURI("" + t).replace($d, "|").replace(zd, "[").replace(Gd, "]");
}
function Hd(t) {
return bo(t).replace(rl, "{").replace(sl, "}").replace(nl, "^");
}
function Ms(t) {
return bo(t).replace(tl, "%2B").replace(Qd, "+").replace(el, "%23").replace(Ld, "%26").replace(qd, "`").replace(rl, "{").replace(sl, "}").replace(nl, "^");
}
function Wd(t) {
return Ms(t).replace(Fd, "%3D");
}
function Jd(t) {
return bo(t).replace(el, "%23").replace(Vd, "%3F");
}
function Yd(t) {
return t == null ? "" : Jd(t).replace(Ud, "%2F");
}
function an(t) {
try {
return decodeURIComponent("" + t);
} catch {
process.env.NODE_ENV !== "production" && Y(`Error decoding "${t}". Using original value`);
}
return "" + t;
}
const Kd = /\/$/, Zd = (t) => t.replace(Kd, "");
function es(t, e, n = "/") {
let r, s = {}, o = "", a = "";
const i = e.indexOf("#");
let l = e.indexOf("?");
return i < l && i >= 0 && (l = -1), l > -1 && (r = e.slice(0, l), o = e.slice(l + 1, i > -1 ? i : e.length), s = t(o)), i > -1 && (r = r || e.slice(0, i), a = e.slice(i, e.length)), r = tp(r ?? e, n), {
fullPath: r + (o && "?") + o + a,
path: r,
query: s,
hash: an(a)
};
}
function Xd(t, e) {
const n = e.query ? t(e.query) : "";
return e.path + (n && "?") + n + (e.hash || "");
}
function oa(t, e, n) {
const r = e.matched.length - 1, s = n.matched.length - 1;
return r > -1 && r === s && yt(e.matched[r], n.matched[s]) && ol(e.params, n.params) && t(e.query) === t(n.query) && e.hash === n.hash;
}
function yt(t, e) {
return (t.aliasOf || t) === (e.aliasOf || e);
}
function ol(t, e) {
if (Object.keys(t).length !== Object.keys(e).length)
return !1;
for (const n in t)
if (!ep(t[n], e[n]))
return !1;
return !0;
}
function ep(t, e) {
return Re(t) ? aa(t, e) : Re(e) ? aa(e, t) : t === e;
}
function aa(t, e) {
return Re(e) ? t.length === e.length && t.every((n, r) => n === e[r]) : t.length === 1 && t[0] === e;
}
function tp(t, e) {
if (t.startsWith("/"))
return t;
if (process.env.NODE_ENV !== "production" && !e.startsWith("/"))
return Y(`Cannot resolve a relative location without an absolute path. Trying to resolve "${t}" from "${e}". It should look like "/${e}".`), t;
if (!t)
return e;
const n = e.split("/"), r = t.split("/"), s = r[r.length - 1];
(s === ".." || s === ".") && r.push("");
let o = n.length - 1, a, i;
for (a = 0; a < r.length; a++)
if (i = r[a], i !== ".")
if (i === "..")
o > 1 && o--;
else
break;
return n.slice(0, o).join("/") + "/" + r.slice(a).join("/");
}
const Ze = {
path: "/",
// TODO: could we use a symbol in the future?
name: void 0,
params: {},
query: {},
hash: "",
fullPath: "/",
matched: [],
meta: {},
redirectedFrom: void 0
};
var Dn;
(function(t) {
t.pop = "pop", t.push = "push";
})(Dn || (Dn = {}));
var _r;
(function(t) {
t.back = "back", t.forward = "forward", t.unknown = "";
})(_r || (_r = {}));
const ts = "";
function np(t) {
if (!t)
if (Je) {
const e = document.querySelector("base");
t = e && e.getAttribute("href") || "/", t = t.replace(/^\w+:\/\/[^\/]+/, "");
} else
t = "/";
return t[0] !== "/" && t[0] !== "#" && (t = "/" + t), Zd(t);
}
const rp = /^[^#]+#/;
function sp(t, e) {
return t.replace(rp, "#") + e;
}
function op(t, e) {
const n = document.documentElement.getBoundingClientRect(), r = t.getBoundingClientRect();
return {
behavior: e.behavior,
left: r.left - n.left - (e.left || 0),
top: r.top - n.top - (e.top || 0)
};
}
const ap = () => ({
left: window.scrollX,
top: window.scrollY
});
function ip(t) {
let e;
if ("el" in t) {
const n = t.el, r = typeof n == "string" && n.startsWith("#");
if (process.env.NODE_ENV !== "production" && typeof t.el == "string" && (!r || !document.getElementById(t.el.slice(1))))
try {
const o = document.querySelector(t.el);
if (r && o) {
Y(`The selector "${t.el}" should be passed as "el: document.querySelector('${t.el}')" because it starts with "#".`);
return;
}
} catch {
Y(`The selector "${t.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);
return;
}
const s = typeof n == "string" ? r ? document.getElementById(n.slice(1)) : document.querySelector(n) : n;
if (!s) {
process.env.NODE_ENV !== "production" && Y(`Couldn't find element using selector "${t.el}" returned by scrollBehavior.`);
return;
}
e = op(s, t);
} else
e = t;
"scrollBehavior" in document.documentElement.style ? window.scrollTo(e) : window.scrollTo(e.left != null ? e.left : window.scrollX, e.top != null ? e.top : window.scrollY);
}
function ia(t, e) {
return (history.state ? history.state.position - e : -1) + t;
}
const js = /* @__PURE__ */ new Map();
function lp(t, e) {
js.set(t, e);
}
function cp(t) {
const e = js.get(t);
return js.delete(t), e;
}
function up(t = "") {
let e = [], n = [ts], r = 0;
t = np(t);
function s(i) {
r++, r !== n.length && n.splice(r), n.push(i);
}
function o(i, l, { direction: c, delta: u }) {
const p = {
direction: c,
delta: u,
type: Dn.pop
};
for (const d of e)
d(i, l, p);
}
const a = {
// rewritten by Object.defineProperty
location: ts,
// TODO: should be kept in queue
state: {},
base: t,
createHref: sp.bind(null, t),
replace(i) {
n.splice(r--, 1), s(i);
},
push(i, l) {
s(i);
},
listen(i) {
return e.push(i), () => {
const l = e.indexOf(i);
l > -1 && e.splice(l, 1);
};
},
destroy() {
e = [], n = [ts], r = 0;
},
go(i, l = !0) {
const c = this.location, u = (
// 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
i < 0 ? _r.back : _r.forward
);
r = Math.max(0, Math.min(r + i, n.length - 1)), l && o(this.location, c, {
direction: u,
delta: i
});
}
};
return Object.defineProperty(a, "location", {
enumerable: !0,
get: () => n[r]
}), a;
}
function xr(t) {
return typeof t == "string" || t && typeof t == "object";
}
function al(t) {
return typeof t == "string" || typeof t == "symbol";
}
const Ds = Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
var la;
(function(t) {
t[t.aborted = 4] = "aborted", t[t.cancelled = 8] = "cancelled", t[t.duplicated = 16] = "duplicated";
})(la || (la = {}));
const dp = {
1({ location: t, currentLocation: e }) {
return `No match for
${JSON.stringify(t)}${e ? `
while being at
` + JSON.stringify(e) : ""}`;
},
2({ from: t, to: e }) {
return `Redirected from "${t.fullPath}" to "${hp(e)}" via a navigation guard.`;
},
4({ from: t, to: e }) {
return `Navigation aborted from "${t.fullPath}" to "${e.fullPath}" via a navigation guard.`;
},
8({ from: t, to: e }) {
return `Navigation cancelled from "${t.fullPath}" to "${e.fullPath}" with a new navigation.`;
},
16({ from: t, to: e }) {
return `Avoided redundant navigation to current location: "${t.fullPath}".`;
}
};
function ln(t, e) {
return process.env.NODE_ENV !== "production" ? ne(new Error(dp[t](e)), {
type: t,
[Ds]: !0
}, e) : ne(new Error(), {
type: t,
[Ds]: !0
}, e);
}
function Qe(t, e) {
return t instanceof Error && Ds in t && (e == null || !!(t.type & e));
}
const pp = ["params", "query", "hash"];
function hp(t) {
if (typeof t == "string")
return t;
if (t.path != null)
return t.path;
const e = {};
for (const n of pp)
n in t && (e[n] = t[n]);
return JSON.stringify(e, null, 2);
}
const ca = "[^/]+?", fp = {
sensitive: !1,
strict: !1,
start: !0,
end: !0
}, mp = /[.+*?^${}()[\]/\\]/g;
function gp(t, e) {
const n = ne({}, fp, e), r = [];
let s = n.start ? "^" : "";
const o = [];
for (const c of t) {
const u = c.length ? [] : [
90
/* PathScore.Root */
];
n.strict && !c.length && (s += "/");
for (let p = 0; p < c.length; p++) {
const d = c[p];
let h = 40 + (n.sensitive ? 0.25 : 0);
if (d.type === 0)
p || (s += "/"), s += d.value.replace(mp, "\\$&"), h += 40;
else if (d.type === 1) {
const { value: f, repeatable: g, optional: m, regexp: v } = d;
o.push({
name: f,
repeatable: g,
optional: m
});
const b = v || ca;
if (b !== ca) {
h += 10;
try {
new RegExp(`(${b})`);
} catch (k) {
throw new Error(`Invalid custom RegExp for param "${f}" (${b}): ` + k.message);
}
}
let w = g ? `((?:${b})(?:/(?:${b}))*)` : `(${b})`;
p || (w = // avoid an optional / if there are more segments e.g. /:p?-static
// or /:p?-:p2
m && c.length < 2 ? `(?:/${w})` : "/" + w), m && (w += "?"), s += w, h += 20, m && (h += -8), g && (h += -20), b === ".*" && (h += -50);
}
u.push(h);
}
r.push(u);
}
if (n.strict && n.end) {
const c = r.length - 1;
r[c][r[c].length - 1] += 0.7000000000000001;
}
n.strict || (s += "/?"), n.end ? s += "$" : n.strict && !s.endsWith("/") && (s += "(?:/|$)");
const a = new RegExp(s, n.sensitive ? "" : "i");
function i(c) {
const u = c.match(a), p = {};
if (!u)
return null;
for (let d = 1; d < u.length; d++) {
const h = u[d] || "", f = o[d - 1];
p[f.name] = h && f.repeatable ? h.split("/") : h;
}
return p;
}
function l(c) {
let u = "", p = !1;
for (const d of t) {
(!p || !u.endsWith("/")) && (u += "/"), p = !1;
for (const h of d)
if (h.type === 0)
u += h.value;
else if (h.type === 1) {
const { value: f, repeatable: g, optional: m } = h, v = f in c ? c[f] : "";
if (Re(v) && !g)
throw new Error(`Provided param "${f}" is an array but it is not repeatable (* or + modifiers)`);
const b = Re(v) ? v.join("/") : v;
if (!b)
if (m)
d.length < 2 && (u.endsWith("/") ? u = u.slice(0, -1) : p = !0);
else
throw new Error(`Missing required param "${f}"`);
u += b;
}
}
return u || "/";
}
return {
re: a,
score: r,
keys: o,
parse: i,
stringify: l
};
}
function yp(t, e) {
let n = 0;
for (; n < t.length && n < e.length; ) {
const r = e[n] - t[n];
if (r)
return r;
n++;
}
return t.length < e.length ? t.length === 1 && t[0] === 80 ? -1 : 1 : t.length > e.length ? e.length === 1 && e[0] === 80 ? 1 : -1 : 0;
}
function il(t, e) {
let n = 0;
const r = t.score, s = e.score;
for (; n < r.length && n < s.length; ) {
const o = yp(r[n], s[n]);
if (o)
return o;
n++;
}
if (Math.abs(s.length - r.length) === 1) {
if (ua(r))
return 1;
if (ua(s))
return -1;
}
return s.length - r.length;
}
function ua(t) {
const e = t[t.length - 1];
return t.length > 0 && e[e.length - 1] < 0;
}
const vp = {
type: 0,
value: ""
}, bp = /[a-zA-Z0-9_]/;
function wp(t) {
if (!t)
return [[]];
if (t === "/")
return [[vp]];
if (!t.startsWith("/"))
throw new Error(process.env.NODE_ENV !== "production" ? `Route paths should start with a "/": "${t}" should be "/${t}".` : `Invalid path "${t}"`);
function e(h) {
throw new Error(`ERR (${n})/"${c}": ${h}`);
}
let n = 0, r = n;
const s = [];
let o;
function a() {
o && s.push(o), o = [];
}
let i = 0, l, c = "", u = "";
function p() {
c && (n === 0 ? o.push({
type: 0,
value: c
}) : n === 1 || n === 2 || n === 3 ? (o.length > 1 && (l === "*" || l === "+") && e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`), o.push({
type: 1,
value: c,
regexp: u,
repeatable: l === "*" || l === "+",
optional: l === "*" || l === "?"
})) : e("Invalid state to consume buffer"), c = "");
}
function d() {
c += l;
}
for (; i < t.length; ) {
if (l = t[i++], l === "\\" && n !== 2) {
r = n, n = 4;
continue;
}
switch (n) {
case 0:
l === "/" ? (c && p(), a()) : l === ":" ? (p(), n = 1) : d();
break;
case 4:
d(), n = r;
break;
case 1:
l === "(" ? n = 2 : bp.test(l) ? d() : (p(), n = 0, l !== "*" && l !== "?" && l !== "+" && i--);
break;
case 2:
l === ")" ? u[u.length - 1] == "\\" ? u = u.slice(0, -1) + l : n = 3 : u += l;
break;
case 3:
p(), n = 0, l !== "*" && l !== "?" && l !== "+" && i--, u = "";
break;
default:
e("Unknown state");
break;
}
}
return n === 2 && e(`Unfinished custom RegExp for param "${c}"`), p(), a(), s;
}
function _p(t, e, n) {
const r = gp(wp(t.path), n);
if (process.env.NODE_ENV !== "production") {
const o = /* @__PURE__ */ new Set();
for (const a of r.keys)
o.has(a.name) && Y(`Found duplicated params with name "${a.name}" for path "${t.path}". Only the last one will be available on "$route.params".`), o.add(a.name);
}
const s = ne(r, {
record: t,
parent: e,
// these needs to be populated by the parent
children: [],
alias: []
});
return e && !s.record.aliasOf == !e.record.aliasOf && e.children.push(s), s;
}
function xp(t, e) {
const n = [], r = /* @__PURE__ */ new Map();
e = fa({ strict: !1, end: !0, sensitive: !1 }, e);
function s(p) {
return r.get(p);
}
function o(p, d, h) {
const f = !h, g = pa(p);
process.env.NODE_ENV !== "production" && Cp(g, d), g.aliasOf = h && h.record;
const m = fa(e, p), v = [g];
if ("alias" in p) {
const k = typeof p.alias == "string" ? [p.alias] : p.alias;
for (const S of k)
v.push(
// we need to normalize again to ensure the `mods` property
// being non enumerable
pa(ne({}, g, {
// 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 : g.components,
path: S,
// we might be the child of an alias
aliasOf: h ? h.record : g
// the aliases are always of the same kind as the original since they
// are defined on the same record
}))
);
}
let b, w;
for (const k of v) {
const { path: S } = k;
if (d && S[0] !== "/") {
const U = d.record.path, F = U[U.length - 1] === "/" ? "" : "/";
k.path = d.record.path + (S && F + S);
}
if (process.env.NODE_ENV !== "production" && k.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 (b = _p(k, d, m), process.env.NODE_ENV !== "production" && d && S[0] === "/" && Op(b, d), h ? (h.alias.push(b), process.env.NODE_ENV !== "production" && Ep(h, b)) : (w = w || b, w !== b && w.alias.push(b), f && p.name && !ha(b) && (process.env.NODE_ENV !== "production" && Sp(p, d), a(p.name))), ll(b) && l(b), g.children) {
const U = g.children;
for (let F = 0; F < U.length; F++)
o(U[F], b, h && h.children[F]);
}
h = h || b;
}
return w ? () => {
a(w);
} : Cn;
}
function a(p) {
if (al(p)) {
const d = r.get(p);
d && (r.delete(p), n.splice(n.indexOf(d), 1), d.children.forEach(a), d.alias.forEach(a));
} else {
const d = n.indexOf(p);
d > -1 && (n.splice(d, 1), p.record.name && r.delete(p.record.name), p.children.forEach(a), p.alias.forEach(a));
}
}
function i() {
return n;
}
function l(p) {
const d = Tp(p, n);
n.splice(d, 0, p), p.record.name && !ha(p) && r.set(p.record.name, p);
}
function c(p, d) {
let h, f = {}, g, m;
if ("name" in p && p.name) {
if (h = r.get(p.name), !h)
throw ln(1, {
location: p
});
if (process.env.NODE_ENV !== "production") {
const w = Object.keys(p.params || {}).filter((k) => !h.keys.find((S) => S.name === k));
w.length && Y(`Discarded invalid param(s) "${w.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
}
m = h.record.name, f = ne(
// paramsFromLocation is a new object
da(
d.params,
// only keep params that exist in the resolved location
// only keep optional params coming from a parent record
h.keys.filter((w) => !w.optional).concat(h.parent ? h.parent.keys.filter((w) => w.optional) : []).map((w) => w.name)
),
// discard any existing params in the current location that do not exist here
// #1497 this ensures better active/exact matching
p.params && da(p.params, h.keys.map((w) => w.name))
), g = h.stringify(f);
} else if (p.path != null)
g = p.path, process.env.NODE_ENV !== "production" && !g.startsWith("/") && Y(`The Matcher cannot resolve relative paths but received "${g}". Unless you directly called \`matcher.resolve("${g}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`), h = n.find((w) => w.re.test(g)), h && (f = h.parse(g), m = h.record.name);
else {
if (h = d.name ? r.get(d.name) : n.find((w) => w.re.test(d.path)), !h)
throw ln(1, {
location: p,
currentLocation: d
});
m = h.record.name, f = ne({}, d.params, p.params), g = h.stringify(f);
}
const v = [];
let b = h;
for (; b; )
v.unshift(b.record), b = b.parent;
return {
name: m,
path: g,
params: f,
matched: v,
meta: kp(v)
};
}
t.forEach((p) => o(p));
function u() {
n.length = 0, r.clear();
}
return {
addRoute: o,
resolve: c,
removeRoute: a,
clearRoutes: u,
getRoutes: i,
getRecordMatcher: s
};
}
function da(t, e) {
const n = {};
for (const r of e)
r in t && (n[r] = t[r]);
return n;
}
function pa(t) {
const e = {
path: t.path,
redirect: t.redirect,
name: t.name,
meta: t.meta || {},
aliasOf: t.aliasOf,
beforeEnter: t.beforeEnter,
props: Ap(t),
children: t.children || [],
instances: {},
leaveGuards: /* @__PURE__ */ new Set(),
updateGuards: /* @__PURE__ */ new Set(),
enterCallbacks: {},
// must be declared afterwards
// mods: {},
components: "components" in t ? t.components || null : t.component && { default: t.component }
};
return Object.defineProperty(e, "mods", {
value: {}
}), e;
}
function Ap(t) {
const e = {}, n = t.props || !1;
if ("component" in t)
e.default = n;
else
for (const r in t.components)
e[r] = typeof n == "object" ? n[r] : n;
return e;
}
function ha(t) {
for (; t; ) {
if (t.record.aliasOf)
return !0;
t = t.parent;
}
return !1;
}
function kp(t) {
return t.reduce((e, n) => ne(e, n.meta), {});
}
function fa(t, e) {
const n = {};
for (const r in t)
n[r] = r in e ? e[r] : t[r];
return n;
}
function Bs(t, e) {
return t.name === e.name && t.optional === e.optional && t.repeatable === e.repeatable;
}
function Ep(t, e) {
for (const n of t.keys)
if (!n.optional && !e.keys.find(Bs.bind(null, n)))
return Y(`Alias "${e.record.path}" and the original record: "${t.record.path}" must have the exact same param named "${n.name}"`);
for (const n of e.keys)
if (!n.optional && !t.keys.find(Bs.bind(null, n)))
return Y(`Alias "${e.record.path}" and the original record: "${t.record.path}" must have the exact same param named "${n.name}"`);
}
function Cp(t, e) {
e && e.record.name && !t.name && !t.path && Y(`The route named "${String(e.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`);
}
function Sp(t, e) {
for (let n = e; n; n = n.parent)
if (n.record.name === t.name)
throw new Error(`A route named "${String(t.name)}" has been added as a ${e === 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 Op(t, e) {
for (const n of e.keys)
if (!t.keys.find(Bs.bind(null, n)))
return Y(`Absolute path "${t.record.path}" must have the exact same param named "${n.name}" as its parent "${e.record.path}".`);
}
function Tp(t, e) {
let n = 0, r = e.length;
for (; n !== r; ) {
const o = n + r >> 1;
il(t, e[o]) < 0 ? r = o : n = o + 1;
}
const s = Rp(t);
return s && (r = e.lastIndexOf(s, r - 1), process.env.NODE_ENV !== "production" && r < 0 && Y(`Finding ancestor route "${s.record.path}" failed for "${t.record.path}"`)), r;
}
function Rp(t) {
let e = t;
for (; e = e.parent; )
if (ll(e) && il(t, e) === 0)
return e;
}
function ll({ record: t }) {
return !!(t.name || t.components && Object.keys(t.components).length || t.redirect);
}
function Ip(t) {
const e = {};
if (t === "" || t === "?")
return e;
const r = (t[0] === "?" ? t.slice(1) : t).split("&");
for (let s = 0; s < r.length; ++s) {
const o = r[s].replace(tl, " "), a = o.indexOf("="), i = an(a < 0 ? o : o.slice(0, a)), l = a < 0 ? null : an(o.slice(a + 1));
if (i in e) {
let c = e[i];
Re(c) || (c = e[i] = [c]), c.push(l);
} else
e[i] = l;
}
return e;
}
function ma(t) {
let e = "";
for (let n in t) {
const r = t[n];
if (n = Wd(n), r == null) {
r !== void 0 && (e += (e.length ? "&" : "") + n);
continue;
}
(Re(r) ? r.map((o) => o && Ms(o)) : [r && Ms(r)]).forEach((o) => {
o !== void 0 && (e += (e.length ? "&" : "") + n, o != null && (e += "=" + o));
});
}
return e;
}
function Pp(t) {
const e = {};
for (const n in t) {
const r = t[n];
r !== void 0 && (e[n] = Re(r) ? r.map((s) => s == null ? null : "" + s) : r == null ? r : "" + r);
}
return e;
}
const Mp = Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : ""), ga = Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : ""), jr = Symbol(process.env.NODE_ENV !== "production" ? "router" : ""), wo = Symbol(process.env.NODE_ENV !== "production" ? "route location" : ""), Ns = Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
function mn() {
let t = [];
function e(r) {
return t.push(r), () => {
const s = t.indexOf(r);
s > -1 && t.splice(s, 1);
};
}
function n() {
t = [];
}
return {
add: e,
list: () => t.slice(),
reset: n
};
}
function st(t, e, n, r, s, o = (a) => a()) {
const a = r && // name is defined if record is because of the function overload
(r.enterCallbacks[s] = r.enterCallbacks[s] || []);
return () => new Promise((i, l) => {
const c = (d) => {
d === !1 ? l(ln(4, {
from: n,
to: e
})) : d instanceof Error ? l(d) : xr(d) ? l(ln(2, {
from: e,
to: d
})) : (a && // since enterCallbackArray is truthy, both record and name also are
r.enterCallbacks[s] === a && typeof d == "function" && a.push(d), i());
}, u = o(() => t.call(r && r.instances[s], e, n, process.env.NODE_ENV !== "production" ? jp(c, e, n) : c));
let p = Promise.resolve(u);
if (t.length < 3 && (p = p.then(c)), process.env.NODE_ENV !== "production" && t.length > 2) {
const d = `The "next" callback was never called inside of ${t.name ? '"' + t.name + '"' : ""}:
${t.toString()}
. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;
if (typeof u == "object" && "then" in u)
p = p.then((h) => c._called ? h : (Y(d), Promise.reject(new Error("Invalid navigation guard"))));
else if (u !== void 0 && !c._called) {
Y(d), l(new Error("Invalid navigation guard"));
return;
}
}
p.catch((d) => l(d));
});
}
function jp(t, e, n) {
let r = 0;
return function() {
r++ === 1 && Y(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${e.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`), t._called = !0, r === 1 && t.apply(null, arguments);
};
}
function ns(t, e, n, r, s = (o) => o()) {
const o = [];
for (const a of t) {
process.env.NODE_ENV !== "production" && !a.components && !a.children.length && Y(`Record with path "${a.path}" is either missing a "component(s)" or "children" property.`);
for (const i in a.components) {
let l = a.components[i];
if (process.env.NODE_ENV !== "production") {
if (!l || typeof l != "object" && typeof l != "function")
throw Y(`Component "${i}" in record with path "${a.path}" is not a valid component. Received "${String(l)}".`), new Error("Invalid route component");
if ("then" in l) {
Y(`Component "${i}" in record with path "${a.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 c = l;
l = () => c;
} else l.__asyncLoader && // warn only once per component
!l.__warnedDefineAsync && (l.__warnedDefineAsync = !0, Y(`Component "${i}" in record with path "${a.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`));
}
if (!(e !== "beforeRouteEnter" && !a.instances[i]))
if (Xi(l)) {
const u = (l.__vccOpts || l)[e];
u && o.push(st(u, n, r, a, i, s));
} else {
let c = l();
process.env.NODE_ENV !== "production" && !("catch" in c) && (Y(`Component "${i}" in record with path "${a.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.`), c = Promise.resolve(c)), o.push(() => c.then((u) => {
if (!u)
throw new Error(`Couldn't resolve component "${i}" at "${a.path}"`);
const p = Nd(u) ? u.default : u;
a.mods[i] = u, a.components[i] = p;
const h = (p.__vccOpts || p)[e];
return h && st(h, n, r, a, i, s)();
}));
}
}
}
return o;
}
function ya(t) {
const e = ce(jr), n = ce(wo);
let r = !1, s = null;
const o = B(() => {
const u = y(t.to);
return process.env.NODE_ENV !== "production" && (!r || u !== s) && (xr(u) || (r ? Y(`Invalid value for prop "to" in useLink()
- to:`, u, `
- previous to:`, s, `
- props:`, t) : Y(`Invalid value for prop "to" in useLink()
- to:`, u, `
- props:`, t)), s = u, r = !0), e.resolve(u);
}), a = B(() => {
const { matched: u } = o.value, { length: p } = u, d = u[p - 1], h = n.matched;
if (!d || !h.length)
return -1;
const f = h.findIndex(yt.bind(null, d));
if (f > -1)
return f;
const g = va(u[p - 2]);
return (
// we are dealing with nested routes
p > 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
va(d) === g && // avoid comparing the child with its parent
h[h.length - 1].path !== g ? h.findIndex(yt.bind(null, u[p - 2])) : f
);
}), i = B(() => a.value > -1 && Up(n.params, o.value.params)), l = B(() => a.value > -1 && a.value === n.matched.length - 1 && ol(n.params, o.value.params));
function c(u = {}) {
if (Lp(u)) {
const p = e[y(t.replace) ? "replace" : "push"](
y(t.to)
// avoid uncaught errors are they are logged anyway
).catch(Cn);
return t.viewTransition && typeof document < "u" && "startViewTransition" in document && document.startViewTransition(() => p), p;
}
return Promise.resolve();
}
if (process.env.NODE_ENV !== "production" && Je) {
const u = Gn();
if (u) {
const p = {
route: o.value,
isActive: i.value,
isExactActive: l.value,
error: null
};
u.__vrl_devtools = u.__vrl_devtools || [], u.__vrl_devtools.push(p), Pu(() => {
p.route = o.value, p.isActive = i.value, p.isExactActive = l.value, p.error = xr(y(t.to)) ? null : 'Invalid "to" value';
}, { flush: "post" });
}
}
return {
route: o,
href: B(() => o.value.href),
isActive: i,
isExactActive: l,
navigate: c
};
}
function Dp(t) {
return t.length === 1 ? t[0] : t;
}
const Bp = /* @__PURE__ */ N({
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: ya,
setup(t, { slots: e }) {
const n = zn(ya(t)), { options: r } = ce(jr), s = B(() => ({
[ba(t.activeClass, r.linkActiveClass, "router-link-active")]: n.isActive,
// [getLinkClass(
// props.inactiveClass,
// options.linkInactiveClass,
// 'router-link-inactive'
// )]: !link.isExactActive,
[ba(t.exactActiveClass, r.linkExactActiveClass, "router-link-exact-active")]: n.isExactActive
}));
return () => {
const o = e.default && Dp(e.default(n));
return t.custom ? o : jt("a", {
"aria-current": n.isExactActive ? t.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: s.value
}, o);
};
}
}), Np = Bp;
function Lp(t) {
if (!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey) && !t.defaultPrevented && !(t.button !== void 0 && t.button !== 0)) {
if (t.currentTarget && t.currentTarget.getAttribute) {
const e = t.currentTarget.getAttribute("target");
if (/\b_blank\b/i.test(e))
return;
}
return t.preventDefault && t.preventDefault(), !0;
}
}
function Up(t, e) {
for (const n in e) {
const r = e[n], s = t[n];
if (typeof r == "string") {
if (r !== s)
return !1;
} else if (!Re(s) || s.length !== r.length || r.some((o, a) => o !== s[a]))
return !1;
}
return !0;
}
function va(t) {
return t ? t.aliasOf ? t.aliasOf.path : t.path : "";
}
const ba = (t, e, n) => t ?? e ?? n, Fp = /* @__PURE__ */ N({
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(t, { attrs: e, slots: n }) {
process.env.NODE_ENV !== "production" && zp();
const r = ce(Ns), s = B(() => t.route || r.value), o = ce(ga, 0), a = B(() => {
let c = y(o);
const { matched: u } = s.value;
let p;
for (; (p = u[c]) && !p.components; )
c++;
return c;
}), i = B(() => s.value.matched[a.value]);
Kr(ga, B(() => a.value + 1)), Kr(Mp, i), Kr(Ns, s);
const l = P();
return pe(() => [l.value, i.value, t.name], ([c, u, p], [d, h, f]) => {
u && (u.instances[p] = c, h && h !== u && c && c === d && (u.leaveGuards.size || (u.leaveGuards = h.leaveGuards), u.updateGuards.size || (u.updateGuards = h.updateGuards))), c && u && // if there is no instance but to and from are the same this might be
// the first visit
(!h || !yt(u, h) || !d) && (u.enterCallbacks[p] || []).forEach((g) => g(c));
}, { flush: "post" }), () => {
const c = s.value, u = t.name, p = i.value, d = p && p.components[u];
if (!d)
return wa(n.default, { Component: d, route: c });
const h = p.props[u], f = h ? h === !0 ? c.params : typeof h == "function" ? h(c) : h : null, m = jt(d, ne({}, f, e, {
onVnodeUnmounted: (v) => {
v.component.isUnmounted && (p.instances[u] = null);
},
ref: l
}));
if (process.env.NODE_ENV !== "production" && Je && m.ref) {
const v = {
depth: a.value,
name: p.name,
path: p.path,
meta: p.meta
};
(Re(m.ref) ? m.ref.map((w) => w.i) : [m.ref.i]).forEach((w) => {
w.__vrv_devtools = v;
});
}
return (
// pass the vnode to the slot as a prop.
// h and <component :is="..."> both accept vnodes
wa(n.default, { Component: m, route: c }) || m
);
};
}
});
function wa(t, e) {
if (!t)
return null;
const n = t(e);
return n.length === 1 ? n[0] : n;
}
const Vp = Fp;
function zp() {
const t = Gn(), e = t.parent && t.parent.type.name, n = t.parent && t.parent.subTree && t.parent.subTree.type;
if (e && (e === "KeepAlive" || e.includes("Transition")) && typeof n == "object" && n.name === "RouterView") {
const r = e === "KeepAlive" ? "keep-alive" : "transition";
Y(`<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 gn(t, e) {
const n = ne({}, t, {
// remove variables that can contain vue instances
matched: t.matched.map((r) => Xp(r, ["instances", "children", "aliasOf"]))
});
return {
_custom: {
type: null,
readOnly: !0,
display: t.fullPath,
tooltip: e,
value: n
}
};
}
function er(t) {
return {
_custom: {
display: t
}
};
}
let Gp = 0;
function qp(t, e, n) {
if (e.__hasDevtools)
return;
e.__hasDevtools = !0;
const r = Gp++;
Bd({
id: "org.vuejs.router" + (r ? "." + r : ""),
label: "Vue Router",
packageName: "vue-router",
homepage: "https://router.vuejs.org",
logo: "https://router.vuejs.org/logo.png",
componentStateTypes: ["Routing"],
app: t
}, (s) => {
typeof s.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."), s.on.inspectComponent((u, p) => {
u.instanceData && u.instanceData.state.push({
type: "Routing",
key: "$route",
editable: !1,
value: gn(e.currentRoute.value, "Current Route")
});
}), s.on.visitComponentTree(({ treeNode: u, componentInstance: p }) => {
if (p.__vrv_devtools) {
const d = p.__vrv_devtools;
u.tags.push({
label: (d.name ? `${d.name.toString()}: ` : "") + d.path,
textColor: 0,
tooltip: "This component is rendered by <router-view>",
backgroundColor: cl
});
}
Re(p.__vrl_devtools) && (p.__devtoolsApi = s, p.__vrl_devtools.forEach((d) => {
let h = d.route.path, f = pl, g = "", m = 0;
d.error ? (h = d.error, f = Jp, m = Yp) : d.isExactActive ? (f = dl, g = "This is exactly active") : d.isActive && (f = ul, g = "This link is active"), u.tags.push({
label: h,
textColor: m,
tooltip: g,
backgroundColor: f
});
}));
}), pe(e.currentRoute, () => {
l(), s.notifyComponentUpdate(), s.sendInspectorTree(i), s.sendInspectorState(i);
});
const o = "router:navigations:" + r;
s.addTimelineLayer({
id: o,
label: `Router${r ? " " + r : ""} Navigations`,
color: 4237508
}), e.onError((u, p) => {
s.addTimelineEvent({
layerId: o,
event: {
title: "Error during Navigation",
subtitle: p.fullPath,
logType: "error",
time: s.now(),
data: { error: u },
groupId: p.meta.__navigationId
}
});
});
let a = 0;
e.beforeEach((u, p) => {
const d = {
guard: er("beforeEach"),
from: gn(p, "Current Location during this navigation"),
to: gn(u, "Target location")
};
Object.defineProperty(u.meta, "__navigationId", {
value: a++
}), s.addTimelineEvent({
layerId: o,
event: {
time: s.now(),
title: "Start of navigation",
subtitle: u.fullPath,
data: d,
groupId: u.meta.__navigationId
}
});
}), e.afterEach((u, p, d) => {
const h = {
guard: er("afterEach")
};
d ? (h.failure = {
_custom: {
type: Error,
readOnly: !0,
display: d ? d.message : "",
tooltip: "Navigation Failure",
value: d
}
}, h.status = er("❌")) : h.status = er("✅"), h.from = gn(p, "Current Location during this navigation"), h.to = gn(u, "Target location"), s.addTimelineEvent({
layerId: o,
event: {
title: "End of navigation",
subtitle: u.fullPath,
time: s.now(),
data: h,
logType: d ? "warning" : "default",
groupId: u.meta.__navigationId
}
});
});
const i = "router-inspector:" + r;
s.addInspector({
id: i,
label: "Routes" + (r ? " " + r : ""),
icon: "book",
treeFilterPlaceholder: "Search routes"
});
function l() {
if (!c)
return;
const u = c;
let p = n.getRoutes().filter((d) => !d.parent || // these routes have a parent with no component which will not appear in the view
// therefore we still need to include them
!d.parent.record.components);
p.forEach(ml), u.filter && (p = p.filter((d) => (
// save matches state based on the payload
Ls(d, u.filter.toLowerCase())
))), p.forEach((d) => fl(d, e.currentRoute.value)), u.rootNodes = p.map(hl);
}
let c;
s.on.getInspectorTree((u) => {
c = u, u.app === t && u.inspectorId === i && l();
}), s.on.getInspectorState((u) => {
if (u.app === t && u.inspectorId === i) {
const d = n.getRoutes().find((h) => h.record.__vd_id === u.nodeId);
d && (u.state = {
options: Qp(d)
});
}
}), s.sendInspectorTree(i), s.sendInspectorState(i);
});
}
function $p(t) {
return t.optional ? t.repeatable ? "*" : "?" : t.repeatable ? "+" : "";
}
function Qp(t) {
const { record: e } = t, n = [
{ editable: !1, key: "path", value: e.path }
];
return e.name != null && n.push({
editable: !1,
key: "name",
value: e.name
}), n.push({ editable: !1, key: "regexp", value: t.re }), t.keys.length && n.push({
editable: !1,
key: "keys",
value: {
_custom: {
type: null,
readOnly: !0,
display: t.keys.map((r) => `${r.name}${$p(r)}`).join(" "),
tooltip: "Param keys",
value: t.keys
}
}
}), e.redirect != null && n.push({
editable: !1,
key: "redirect",
value: e.redirect
}), t.alias.length && n.push({
editable: !1,
key: "aliases",
value: t.alias.map((r) => r.record.path)
}), Object.keys(t.record.meta).length && n.push({
editable: !1,
key: "meta",
value: t.record.meta
}), n.push({
key: "score",
editable: !1,
value: {
_custom: {
type: null,
readOnly: !0,
display: t.score.map((r) => r.join(", ")).join(" | "),
tooltip: "Score used to sort routes",
value: t.score
}
}
}), n;
}
const cl = 15485081, ul = 2450411, dl = 8702998, Hp = 2282478, pl = 16486972, Wp = 6710886, Jp = 16704226, Yp = 12131356;
function hl(t) {
const e = [], { record: n } = t;
n.name != null && e.push({
label: String(n.name),
textColor: 0,
backgroundColor: Hp
}), n.aliasOf && e.push({
label: "alias",
textColor: 0,
backgroundColor: pl
}), t.__vd_match && e.push({
label: "matches",
textColor: 0,
backgroundColor: cl
}), t.__vd_exactActive && e.push({
label: "exact",
textColor: 0,
backgroundColor: dl
}), t.__vd_active && e.push({
label: "active",
textColor: 0,
backgroundColor: ul
}), n.redirect && e.push({
label: typeof n.redirect == "string" ? `redirect: ${n.redirect}` : "redirects",
textColor: 16777215,
backgroundColor: Wp
});
let r = n.__vd_id;
return r == null && (r = String(Kp++), n.__vd_id = r), {
id: r,
label: n.path,
tags: e,
children: t.children.map(hl)
};
}
let Kp = 0;
const Zp = /^\/(.*)\/([a-z]*)$/;
function fl(t, e) {
const n = e.matched.length && yt(e.matched[e.matched.length - 1], t.record);
t.__vd_exactActive = t.__vd_active = n, n || (t.__vd_active = e.matched.some((r) => yt(r, t.record))), t.children.forEach((r) => fl(r, e));
}
function ml(t) {
t.__vd_match = !1, t.children.forEach(ml);
}
function Ls(t, e) {
const n = String(t.re).match(Zp);
if (t.__vd_match = !1, !n || n.length < 3)
return !1;
if (new RegExp(n[1].replace(/\$$/, ""), n[2]).test(e))
return t.children.forEach((a) => Ls(a, e)), t.record.path !== "/" || e === "/" ? (t.__vd_match = t.re.test(e), !0) : !1;
const s = t.record.path.toLowerCase(), o = an(s);
return !e.startsWith("/") && (o.includes(e) || s.includes(e)) || o.startsWith(e) || s.startsWith(e) || t.record.name && String(t.record.name).includes(e) ? !0 : t.children.some((a) => Ls(a, e));
}
function Xp(t, e) {
const n = {};
for (const r in t)
e.includes(r) || (n[r] = t[r]);
return n;
}
function eh(t) {
const e = xp(t.routes, t), n = t.parseQuery || Ip, r = t.stringifyQuery || ma, s = t.history;
if (process.env.NODE_ENV !== "production" && !s)
throw new Error('Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history');
const o = mn(), a =