const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./pages-DdhL9w1X.js","./ModuleList-CQMIXl1I.js","./QuerySelector-80miXv9L.js","./_plugin-vue_export-helper-BOaGB7Aw.js","./options-rRuuQb58.js","./search-BpZMsajh.js","./_...all_-CJOf_DG4.js","./metric-C8F-56Ym.js","./hot-Dg2gqCo9.js","./module-CdxQsEe1.js","./module-2YhSO2gi.css","./plugins-C6i3iKye.js"])))=>i.map(i=>d[i]);
//#region \0vite/modulepreload-polyfill.js
(function polyfill() {
const relList = document.createElement("link").relList;
if (relList && relList.supports && relList.supports("modulepreload")) return;
for (const link of document.querySelectorAll("link[rel=\"modulepreload\"]")) processPreload(link);
new MutationObserver((mutations) => {
for (const mutation of mutations) {
if (mutation.type !== "childList") continue;
for (const node of mutation.addedNodes) if (node.tagName === "LINK" && node.rel === "modulepreload") processPreload(node);
}
}).observe(document, {
childList: true,
subtree: true
});
function getFetchOpts(link) {
const fetchOpts = {};
if (link.integrity) fetchOpts.integrity = link.integrity;
if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy;
if (link.crossOrigin === "use-credentials") fetchOpts.credentials = "include";
else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
else fetchOpts.credentials = "same-origin";
return fetchOpts;
}
function processPreload(link) {
if (link.ep) return;
link.ep = true;
const fetchOpts = getFetchOpts(link);
fetch(link.href, fetchOpts);
}
})();
//#endregion
//#region node_modules/.pnpm/@vue+shared@3.5.35/node_modules/@vue/shared/dist/shared.esm-bundler.js
/**
* @vue/shared v3.5.35
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
/* @__NO_SIDE_EFFECTS__ */
function makeMap(str) {
const map = /* @__PURE__ */ Object.create(null);
for (const key of str.split(",")) map[key] = 1;
return (val) => val in map;
}
var EMPTY_OBJ = {};
var EMPTY_ARR = [];
var NOOP = () => {};
var NO = () => false;
var isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
var isModelListener = (key) => key.startsWith("onUpdate:");
var extend = Object.assign;
var remove = (arr, el) => {
const i = arr.indexOf(el);
if (i > -1) arr.splice(i, 1);
};
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
var hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
var isArray$1 = Array.isArray;
var isMap = (val) => toTypeString(val) === "[object Map]";
var isSet = (val) => toTypeString(val) === "[object Set]";
var isDate = (val) => toTypeString(val) === "[object Date]";
var isRegExp = (val) => toTypeString(val) === "[object RegExp]";
var isFunction = (val) => typeof val === "function";
var isString = (val) => typeof val === "string";
var isSymbol = (val) => typeof val === "symbol";
var isObject$1 = (val) => val !== null && typeof val === "object";
var isPromise = (val) => {
return (isObject$1(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
};
var objectToString = Object.prototype.toString;
var toTypeString = (value) => objectToString.call(value);
var toRawType = (value) => {
return toTypeString(value).slice(8, -1);
};
var isPlainObject$1 = (val) => toTypeString(val) === "[object Object]";
var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
var isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
var cacheStringFunction$1 = (fn) => {
const cache = /* @__PURE__ */ Object.create(null);
return ((str) => {
return cache[str] || (cache[str] = fn(str));
});
};
var camelizeRE$1 = /-\w/g;
var camelize$1 = cacheStringFunction$1((str) => {
return str.replace(camelizeRE$1, (c) => c.slice(1).toUpperCase());
});
var hyphenateRE$1 = /\B([A-Z])/g;
var hyphenate$1 = cacheStringFunction$1((str) => str.replace(hyphenateRE$1, "-$1").toLowerCase());
var capitalize = cacheStringFunction$1((str) => {
return str.charAt(0).toUpperCase() + str.slice(1);
});
var toHandlerKey = cacheStringFunction$1((str) => {
return str ? `on${capitalize(str)}` : ``;
});
var hasChanged = (value, oldValue) => !Object.is(value, oldValue);
var invokeArrayFns = (fns, ...arg) => {
for (let i = 0; i < fns.length; i++) fns[i](...arg);
};
var def = (obj, key, value, writable = false) => {
Object.defineProperty(obj, key, {
configurable: true,
enumerable: false,
writable,
value
});
};
var looseToNumber = (val) => {
const n = parseFloat(val);
return isNaN(n) ? val : n;
};
var toNumber = (val) => {
const n = isString(val) ? Number(val) : NaN;
return isNaN(n) ? val : n;
};
var _globalThis;
var getGlobalThis = () => {
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
};
function normalizeStyle(value) {
if (isArray$1(value)) {
const res = {};
for (let i = 0; i < value.length; i++) {
const item = value[i];
const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
if (normalized) for (const key in normalized) res[key] = normalized[key];
}
return res;
} else if (isString(value) || isObject$1(value)) return value;
}
var listDelimiterRE = /;(?![^(]*\))/g;
var propertyDelimiterRE = /:([^]+)/;
var styleCommentRE = /\/\*[^]*?\*\//g;
function parseStringStyle(cssText) {
const ret = {};
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
if (item) {
const tmp = item.split(propertyDelimiterRE);
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
}
});
return ret;
}
function normalizeClass(value) {
let res = "";
if (isString(value)) res = value;
else if (isArray$1(value)) for (let i = 0; i < value.length; i++) {
const normalized = normalizeClass(value[i]);
if (normalized) res += normalized + " ";
}
else if (isObject$1(value)) {
for (const name in value) if (value[name]) res += name + " ";
}
return res.trim();
}
function normalizeProps(props) {
if (!props) return null;
let { class: klass, style } = props;
if (klass && !isString(klass)) props.class = normalizeClass(klass);
if (style) props.style = normalizeStyle(style);
return props;
}
var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
specialBooleanAttrs + "";
function includeBooleanAttr(value) {
return !!value || value === "";
}
function looseCompareArrays(a, b) {
if (a.length !== b.length) return false;
let equal = true;
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
return equal;
}
function looseEqual(a, b) {
if (a === b) return true;
let aValidType = isDate(a);
let bValidType = isDate(b);
if (aValidType || bValidType) return aValidType && bValidType ? a.getTime() === b.getTime() : false;
aValidType = isSymbol(a);
bValidType = isSymbol(b);
if (aValidType || bValidType) return a === b;
aValidType = isArray$1(a);
bValidType = isArray$1(b);
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareArrays(a, b) : false;
aValidType = isObject$1(a);
bValidType = isObject$1(b);
if (aValidType || bValidType) {
if (!aValidType || !bValidType) return false;
if (Object.keys(a).length !== Object.keys(b).length) return false;
for (const key in a) {
const aHasKey = a.hasOwnProperty(key);
const bHasKey = b.hasOwnProperty(key);
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
}
}
return String(a) === String(b);
}
function looseIndexOf(arr, val) {
return arr.findIndex((item) => looseEqual(item, val));
}
var isRef$1 = (val) => {
return !!(val && val["__v_isRef"] === true);
};
var toDisplayString = (val) => {
return isString(val) ? val : val == null ? "" : isArray$1(val) || isObject$1(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
};
var replacer = (_key, val) => {
if (isRef$1(val)) return replacer(_key, val.value);
else if (isMap(val)) return { [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2], i) => {
entries[stringifySymbol(key, i) + " =>"] = val2;
return entries;
}, {}) };
else if (isSet(val)) return { [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) };
else if (isSymbol(val)) return stringifySymbol(val);
else if (isObject$1(val) && !isArray$1(val) && !isPlainObject$1(val)) return String(val);
return val;
};
var stringifySymbol = (v, i = "") => {
var _a;
return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
};
//#endregion
//#region node_modules/.pnpm/@vue+reactivity@3.5.35/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
/**
* @vue/reactivity v3.5.35
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
var activeEffectScope;
var EffectScope = class {
constructor(detached = false) {
this.detached = detached;
/**
* @internal
*/
this._active = true;
/**
* @internal track `on` calls, allow `on` call multiple times
*/
this._on = 0;
/**
* @internal
*/
this.effects = [];
/**
* @internal
*/
this.cleanups = [];
this._isPaused = false;
this._warnOnRun = true;
this.__v_skip = true;
if (!detached && activeEffectScope) if (activeEffectScope.active) {
this.parent = activeEffectScope;
this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
} else {
this._active = false;
this._warnOnRun = false;
}
}
get active() {
return this._active;
}
pause() {
if (this._active) {
this._isPaused = true;
let i, l;
if (this.scopes) for (i = 0, l = this.scopes.length; i < l; i++) this.scopes[i].pause();
for (i = 0, l = this.effects.length; i < l; i++) this.effects[i].pause();
}
}
/**
* Resumes the effect scope, including all child scopes and effects.
*/
resume() {
if (this._active) {
if (this._isPaused) {
this._isPaused = false;
let i, l;
if (this.scopes) for (i = 0, l = this.scopes.length; i < l; i++) this.scopes[i].resume();
for (i = 0, l = this.effects.length; i < l; i++) this.effects[i].resume();
}
}
}
run(fn) {
if (this._active) {
const currentEffectScope = activeEffectScope;
try {
activeEffectScope = this;
return fn();
} finally {
activeEffectScope = currentEffectScope;
}
}
}
/**
* This should only be called on non-detached scopes
* @internal
*/
on() {
if (++this._on === 1) {
this.prevScope = activeEffectScope;
activeEffectScope = this;
}
}
/**
* This should only be called on non-detached scopes
* @internal
*/
off() {
if (this._on > 0 && --this._on === 0) {
if (activeEffectScope === this) activeEffectScope = this.prevScope;
else {
let current = activeEffectScope;
while (current) {
if (current.prevScope === this) {
current.prevScope = this.prevScope;
break;
}
current = current.prevScope;
}
}
this.prevScope = void 0;
}
}
stop(fromParent) {
if (this._active) {
this._active = false;
let i, l;
for (i = 0, l = this.effects.length; i < l; i++) this.effects[i].stop();
this.effects.length = 0;
for (i = 0, l = this.cleanups.length; i < l; i++) this.cleanups[i]();
this.cleanups.length = 0;
if (this.scopes) {
for (i = 0, l = this.scopes.length; i < l; i++) this.scopes[i].stop(true);
this.scopes.length = 0;
}
if (!this.detached && this.parent && !fromParent) {
const last = this.parent.scopes.pop();
if (last && last !== this) {
this.parent.scopes[this.index] = last;
last.index = this.index;
}
}
this.parent = void 0;
}
}
};
function effectScope(detached) {
return new EffectScope(detached);
}
function getCurrentScope() {
return activeEffectScope;
}
function onScopeDispose(fn, failSilently = false) {
if (activeEffectScope) activeEffectScope.cleanups.push(fn);
}
var activeSub;
var pausedQueueEffects = /* @__PURE__ */ new WeakSet();
var ReactiveEffect = class {
constructor(fn) {
this.fn = fn;
/**
* @internal
*/
this.deps = void 0;
/**
* @internal
*/
this.depsTail = void 0;
/**
* @internal
*/
this.flags = 5;
/**
* @internal
*/
this.next = void 0;
/**
* @internal
*/
this.cleanup = void 0;
this.scheduler = void 0;
if (activeEffectScope) if (activeEffectScope.active) activeEffectScope.effects.push(this);
else this.flags &= -2;
}
pause() {
this.flags |= 64;
}
resume() {
if (this.flags & 64) {
this.flags &= -65;
if (pausedQueueEffects.has(this)) {
pausedQueueEffects.delete(this);
this.trigger();
}
}
}
/**
* @internal
*/
notify() {
if (this.flags & 2 && !(this.flags & 32)) return;
if (!(this.flags & 8)) batch(this);
}
run() {
if (!(this.flags & 1)) return this.fn();
this.flags |= 2;
cleanupEffect(this);
prepareDeps(this);
const prevEffect = activeSub;
const prevShouldTrack = shouldTrack;
activeSub = this;
shouldTrack = true;
try {
return this.fn();
} finally {
cleanupDeps(this);
activeSub = prevEffect;
shouldTrack = prevShouldTrack;
this.flags &= -3;
}
}
stop() {
if (this.flags & 1) {
for (let link = this.deps; link; link = link.nextDep) removeSub(link);
this.deps = this.depsTail = void 0;
cleanupEffect(this);
this.onStop && this.onStop();
this.flags &= -2;
}
}
trigger() {
if (this.flags & 64) pausedQueueEffects.add(this);
else if (this.scheduler) this.scheduler();
else this.runIfDirty();
}
/**
* @internal
*/
runIfDirty() {
if (isDirty(this)) this.run();
}
get dirty() {
return isDirty(this);
}
};
var batchDepth = 0;
var batchedSub;
var batchedComputed;
function batch(sub, isComputed = false) {
sub.flags |= 8;
if (isComputed) {
sub.next = batchedComputed;
batchedComputed = sub;
return;
}
sub.next = batchedSub;
batchedSub = sub;
}
function startBatch() {
batchDepth++;
}
function endBatch() {
if (--batchDepth > 0) return;
if (batchedComputed) {
let e = batchedComputed;
batchedComputed = void 0;
while (e) {
const next = e.next;
e.next = void 0;
e.flags &= -9;
e = next;
}
}
let error;
while (batchedSub) {
let e = batchedSub;
batchedSub = void 0;
while (e) {
const next = e.next;
e.next = void 0;
e.flags &= -9;
if (e.flags & 1) try {
e.trigger();
} catch (err) {
if (!error) error = err;
}
e = next;
}
}
if (error) throw error;
}
function prepareDeps(sub) {
for (let link = sub.deps; link; link = link.nextDep) {
link.version = -1;
link.prevActiveLink = link.dep.activeLink;
link.dep.activeLink = link;
}
}
function cleanupDeps(sub) {
let head;
let tail = sub.depsTail;
let link = tail;
while (link) {
const prev = link.prevDep;
if (link.version === -1) {
if (link === tail) tail = prev;
removeSub(link);
removeDep(link);
} else head = link;
link.dep.activeLink = link.prevActiveLink;
link.prevActiveLink = void 0;
link = prev;
}
sub.deps = head;
sub.depsTail = tail;
}
function isDirty(sub) {
for (let link = sub.deps; link; link = link.nextDep) if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) return true;
if (sub._dirty) return true;
return false;
}
function refreshComputed(computed) {
if (computed.flags & 4 && !(computed.flags & 16)) return;
computed.flags &= -17;
if (computed.globalVersion === globalVersion) return;
computed.globalVersion = globalVersion;
if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) return;
computed.flags |= 2;
const dep = computed.dep;
const prevSub = activeSub;
const prevShouldTrack = shouldTrack;
activeSub = computed;
shouldTrack = true;
try {
prepareDeps(computed);
const value = computed.fn(computed._value);
if (dep.version === 0 || hasChanged(value, computed._value)) {
computed.flags |= 128;
computed._value = value;
dep.version++;
}
} catch (err) {
dep.version++;
throw err;
} finally {
activeSub = prevSub;
shouldTrack = prevShouldTrack;
cleanupDeps(computed);
computed.flags &= -3;
}
}
function removeSub(link, soft = false) {
const { dep, prevSub, nextSub } = link;
if (prevSub) {
prevSub.nextSub = nextSub;
link.prevSub = void 0;
}
if (nextSub) {
nextSub.prevSub = prevSub;
link.nextSub = void 0;
}
if (dep.subs === link) {
dep.subs = prevSub;
if (!prevSub && dep.computed) {
dep.computed.flags &= -5;
for (let l = dep.computed.deps; l; l = l.nextDep) removeSub(l, true);
}
}
if (!soft && !--dep.sc && dep.map) dep.map.delete(dep.key);
}
function removeDep(link) {
const { prevDep, nextDep } = link;
if (prevDep) {
prevDep.nextDep = nextDep;
link.prevDep = void 0;
}
if (nextDep) {
nextDep.prevDep = prevDep;
link.nextDep = void 0;
}
}
var shouldTrack = true;
var trackStack = [];
function pauseTracking() {
trackStack.push(shouldTrack);
shouldTrack = false;
}
function resetTracking() {
const last = trackStack.pop();
shouldTrack = last === void 0 ? true : last;
}
function cleanupEffect(e) {
const { cleanup } = e;
e.cleanup = void 0;
if (cleanup) {
const prevSub = activeSub;
activeSub = void 0;
try {
cleanup();
} finally {
activeSub = prevSub;
}
}
}
var globalVersion = 0;
var Link = class {
constructor(sub, dep) {
this.sub = sub;
this.dep = dep;
this.version = dep.version;
this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
}
};
var Dep = class {
constructor(computed) {
this.computed = computed;
this.version = 0;
/**
* Link between this dep and the current active effect
*/
this.activeLink = void 0;
/**
* Doubly linked list representing the subscribing effects (tail)
*/
this.subs = void 0;
/**
* For object property deps cleanup
*/
this.map = void 0;
this.key = void 0;
/**
* Subscriber counter
*/
this.sc = 0;
/**
* @internal
*/
this.__v_skip = true;
}
track(debugInfo) {
if (!activeSub || !shouldTrack || activeSub === this.computed) return;
let link = this.activeLink;
if (link === void 0 || link.sub !== activeSub) {
link = this.activeLink = new Link(activeSub, this);
if (!activeSub.deps) activeSub.deps = activeSub.depsTail = link;
else {
link.prevDep = activeSub.depsTail;
activeSub.depsTail.nextDep = link;
activeSub.depsTail = link;
}
addSub(link);
} else if (link.version === -1) {
link.version = this.version;
if (link.nextDep) {
const next = link.nextDep;
next.prevDep = link.prevDep;
if (link.prevDep) link.prevDep.nextDep = next;
link.prevDep = activeSub.depsTail;
link.nextDep = void 0;
activeSub.depsTail.nextDep = link;
activeSub.depsTail = link;
if (activeSub.deps === link) activeSub.deps = next;
}
}
return link;
}
trigger(debugInfo) {
this.version++;
globalVersion++;
this.notify(debugInfo);
}
notify(debugInfo) {
startBatch();
try {
for (let link = this.subs; link; link = link.prevSub) if (link.sub.notify()) link.sub.dep.notify();
} finally {
endBatch();
}
}
};
function addSub(link) {
link.dep.sc++;
if (link.sub.flags & 4) {
const computed = link.dep.computed;
if (computed && !link.dep.subs) {
computed.flags |= 20;
for (let l = computed.deps; l; l = l.nextDep) addSub(l);
}
const currentTail = link.dep.subs;
if (currentTail !== link) {
link.prevSub = currentTail;
if (currentTail) currentTail.nextSub = link;
}
link.dep.subs = link;
}
}
var targetMap = /* @__PURE__ */ new WeakMap();
var ITERATE_KEY = /* @__PURE__ */ Symbol("");
var MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol("");
var ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol("");
function track(target, type, key) {
if (shouldTrack && activeSub) {
let depsMap = targetMap.get(target);
if (!depsMap) targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
let dep = depsMap.get(key);
if (!dep) {
depsMap.set(key, dep = new Dep());
dep.map = depsMap;
dep.key = key;
}
dep.track();
}
}
function trigger(target, type, key, newValue, oldValue, oldTarget) {
const depsMap = targetMap.get(target);
if (!depsMap) {
globalVersion++;
return;
}
const run = (dep) => {
if (dep) dep.trigger();
};
startBatch();
if (type === "clear") depsMap.forEach(run);
else {
const targetIsArray = isArray$1(target);
const isArrayIndex = targetIsArray && isIntegerKey(key);
if (targetIsArray && key === "length") {
const newLength = Number(newValue);
depsMap.forEach((dep, key2) => {
if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) run(dep);
});
} else {
if (key !== void 0 || depsMap.has(void 0)) run(depsMap.get(key));
if (isArrayIndex) run(depsMap.get(ARRAY_ITERATE_KEY));
switch (type) {
case "add":
if (!targetIsArray) {
run(depsMap.get(ITERATE_KEY));
if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
} else if (isArrayIndex) run(depsMap.get("length"));
break;
case "delete":
if (!targetIsArray) {
run(depsMap.get(ITERATE_KEY));
if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
}
break;
case "set":
if (isMap(target)) run(depsMap.get(ITERATE_KEY));
break;
}
}
}
endBatch();
}
function getDepFromReactive(object, key) {
const depMap = targetMap.get(object);
return depMap && depMap.get(key);
}
function reactiveReadArray(array) {
const raw = /* @__PURE__ */ toRaw(array);
if (raw === array) return raw;
track(raw, "iterate", ARRAY_ITERATE_KEY);
return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
}
function shallowReadArray(arr) {
track(arr = /* @__PURE__ */ toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
return arr;
}
function toWrapped(target, item) {
if (/* @__PURE__ */ isReadonly(target)) return /* @__PURE__ */ isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
return toReactive(item);
}
var arrayInstrumentations = {
__proto__: null,
[Symbol.iterator]() {
return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
},
concat(...args) {
return reactiveReadArray(this).concat(...args.map((x) => isArray$1(x) ? reactiveReadArray(x) : x));
},
entries() {
return iterator(this, "entries", (value) => {
value[1] = toWrapped(this, value[1]);
return value;
});
},
every(fn, thisArg) {
return apply(this, "every", fn, thisArg, void 0, arguments);
},
filter(fn, thisArg) {
return apply(this, "filter", fn, thisArg, (v) => v.map((item) => toWrapped(this, item)), arguments);
},
find(fn, thisArg) {
return apply(this, "find", fn, thisArg, (item) => toWrapped(this, item), arguments);
},
findIndex(fn, thisArg) {
return apply(this, "findIndex", fn, thisArg, void 0, arguments);
},
findLast(fn, thisArg) {
return apply(this, "findLast", fn, thisArg, (item) => toWrapped(this, item), arguments);
},
findLastIndex(fn, thisArg) {
return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
},
forEach(fn, thisArg) {
return apply(this, "forEach", fn, thisArg, void 0, arguments);
},
includes(...args) {
return searchProxy(this, "includes", args);
},
indexOf(...args) {
return searchProxy(this, "indexOf", args);
},
join(separator) {
return reactiveReadArray(this).join(separator);
},
lastIndexOf(...args) {
return searchProxy(this, "lastIndexOf", args);
},
map(fn, thisArg) {
return apply(this, "map", fn, thisArg, void 0, arguments);
},
pop() {
return noTracking(this, "pop");
},
push(...args) {
return noTracking(this, "push", args);
},
reduce(fn, ...args) {
return reduce(this, "reduce", fn, args);
},
reduceRight(fn, ...args) {
return reduce(this, "reduceRight", fn, args);
},
shift() {
return noTracking(this, "shift");
},
some(fn, thisArg) {
return apply(this, "some", fn, thisArg, void 0, arguments);
},
splice(...args) {
return noTracking(this, "splice", args);
},
toReversed() {
return reactiveReadArray(this).toReversed();
},
toSorted(comparer) {
return reactiveReadArray(this).toSorted(comparer);
},
toSpliced(...args) {
return reactiveReadArray(this).toSpliced(...args);
},
unshift(...args) {
return noTracking(this, "unshift", args);
},
values() {
return iterator(this, "values", (item) => toWrapped(this, item));
}
};
function iterator(self, method, wrapValue) {
const arr = shallowReadArray(self);
const iter = arr[method]();
if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
iter._next = iter.next;
iter.next = () => {
const result = iter._next();
if (!result.done) result.value = wrapValue(result.value);
return result;
};
}
return iter;
}
var arrayProto = Array.prototype;
function apply(self, method, fn, thisArg, wrappedRetFn, args) {
const arr = shallowReadArray(self);
const needsWrap = arr !== self && !/* @__PURE__ */ isShallow(self);
const methodFn = arr[method];
if (methodFn !== arrayProto[method]) {
const result2 = methodFn.apply(self, args);
return needsWrap ? toReactive(result2) : result2;
}
let wrappedFn = fn;
if (arr !== self) {
if (needsWrap) wrappedFn = function(item, index) {
return fn.call(this, toWrapped(self, item), index, self);
};
else if (fn.length > 2) wrappedFn = function(item, index) {
return fn.call(this, item, index, self);
};
}
const result = methodFn.call(arr, wrappedFn, thisArg);
return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
}
function reduce(self, method, fn, args) {
const arr = shallowReadArray(self);
const needsWrap = arr !== self && !/* @__PURE__ */ isShallow(self);
let wrappedFn = fn;
let wrapInitialAccumulator = false;
if (arr !== self) {
if (needsWrap) {
wrapInitialAccumulator = args.length === 0;
wrappedFn = function(acc, item, index) {
if (wrapInitialAccumulator) {
wrapInitialAccumulator = false;
acc = toWrapped(self, acc);
}
return fn.call(this, acc, toWrapped(self, item), index, self);
};
} else if (fn.length > 3) wrappedFn = function(acc, item, index) {
return fn.call(this, acc, item, index, self);
};
}
const result = arr[method](wrappedFn, ...args);
return wrapInitialAccumulator ? toWrapped(self, result) : result;
}
function searchProxy(self, method, args) {
const arr = /* @__PURE__ */ toRaw(self);
track(arr, "iterate", ARRAY_ITERATE_KEY);
const res = arr[method](...args);
if ((res === -1 || res === false) && /* @__PURE__ */ isProxy(args[0])) {
args[0] = /* @__PURE__ */ toRaw(args[0]);
return arr[method](...args);
}
return res;
}
function noTracking(self, method, args = []) {
pauseTracking();
startBatch();
const res = (/* @__PURE__ */ toRaw(self))[method].apply(self, args);
endBatch();
resetTracking();
return res;
}
var isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
var builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
function hasOwnProperty(key) {
if (!isSymbol(key)) key = String(key);
const obj = /* @__PURE__ */ toRaw(this);
track(obj, "has", key);
return obj.hasOwnProperty(key);
}
var BaseReactiveHandler = class {
constructor(_isReadonly = false, _isShallow = false) {
this._isReadonly = _isReadonly;
this._isShallow = _isShallow;
}
get(target, key, receiver) {
if (key === "__v_skip") return target["__v_skip"];
const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
if (key === "__v_isReactive") return !isReadonly2;
else if (key === "__v_isReadonly") return isReadonly2;
else if (key === "__v_isShallow") return isShallow2;
else if (key === "__v_raw") {
if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) return target;
return;
}
const targetIsArray = isArray$1(target);
if (!isReadonly2) {
let fn;
if (targetIsArray && (fn = arrayInstrumentations[key])) return fn;
if (key === "hasOwnProperty") return hasOwnProperty;
}
const res = Reflect.get(target, key, /* @__PURE__ */ isRef(target) ? target : receiver);
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) return res;
if (!isReadonly2) track(target, "get", key);
if (isShallow2) return res;
if (/* @__PURE__ */ isRef(res)) {
const value = targetIsArray && isIntegerKey(key) ? res : res.value;
return isReadonly2 && isObject$1(value) ? /* @__PURE__ */ readonly(value) : value;
}
if (isObject$1(res)) return isReadonly2 ? /* @__PURE__ */ readonly(res) : /* @__PURE__ */ reactive(res);
return res;
}
};
var MutableReactiveHandler = class extends BaseReactiveHandler {
constructor(isShallow2 = false) {
super(false, isShallow2);
}
set(target, key, value, receiver) {
let oldValue = target[key];
const isArrayWithIntegerKey = isArray$1(target) && isIntegerKey(key);
if (!this._isShallow) {
const isOldValueReadonly = /* @__PURE__ */ isReadonly(oldValue);
if (!/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) {
oldValue = /* @__PURE__ */ toRaw(oldValue);
value = /* @__PURE__ */ toRaw(value);
}
if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) if (isOldValueReadonly) return true;
else {
oldValue.value = value;
return true;
}
}
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
if (target === /* @__PURE__ */ toRaw(receiver)) {
if (!hadKey) trigger(target, "add", key, value);
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
}
return result;
}
deleteProperty(target, key) {
const hadKey = hasOwn(target, key);
const oldValue = target[key];
const result = Reflect.deleteProperty(target, key);
if (result && hadKey) trigger(target, "delete", key, void 0, oldValue);
return result;
}
has(target, key) {
const result = Reflect.has(target, key);
if (!isSymbol(key) || !builtInSymbols.has(key)) track(target, "has", key);
return result;
}
ownKeys(target) {
track(target, "iterate", isArray$1(target) ? "length" : ITERATE_KEY);
return Reflect.ownKeys(target);
}
};
var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
constructor(isShallow2 = false) {
super(true, isShallow2);
}
set(target, key) {
return true;
}
deleteProperty(target, key) {
return true;
}
};
var mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
var readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
var shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
var shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
var toShallow = (value) => value;
var getProto = (v) => Reflect.getPrototypeOf(v);
function createIterableMethod(method, isReadonly2, isShallow2) {
return function(...args) {
const target = this["__v_raw"];
const rawTarget = /* @__PURE__ */ toRaw(target);
const targetIsMap = isMap(rawTarget);
const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
const isKeyOnly = method === "keys" && targetIsMap;
const innerIterator = target[method](...args);
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
!isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
return extend(Object.create(innerIterator), { next() {
const { value, done } = innerIterator.next();
return done ? {
value,
done
} : {
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
done
};
} });
};
}
function createReadonlyMethod(type) {
return function(...args) {
return type === "delete" ? false : type === "clear" ? void 0 : this;
};
}
function createInstrumentations(readonly, shallow) {
const instrumentations = {
get(key) {
const target = this["__v_raw"];
const rawTarget = /* @__PURE__ */ toRaw(target);
const rawKey = /* @__PURE__ */ toRaw(key);
if (!readonly) {
if (hasChanged(key, rawKey)) track(rawTarget, "get", key);
track(rawTarget, "get", rawKey);
}
const { has } = getProto(rawTarget);
const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
if (has.call(rawTarget, key)) return wrap(target.get(key));
else if (has.call(rawTarget, rawKey)) return wrap(target.get(rawKey));
else if (target !== rawTarget) target.get(key);
},
get size() {
const target = this["__v_raw"];
!readonly && track(/* @__PURE__ */ toRaw(target), "iterate", ITERATE_KEY);
return target.size;
},
has(key) {
const target = this["__v_raw"];
const rawTarget = /* @__PURE__ */ toRaw(target);
const rawKey = /* @__PURE__ */ toRaw(key);
if (!readonly) {
if (hasChanged(key, rawKey)) track(rawTarget, "has", key);
track(rawTarget, "has", rawKey);
}
return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
},
forEach(callback, thisArg) {
const observed = this;
const target = observed["__v_raw"];
const rawTarget = /* @__PURE__ */ toRaw(target);
const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
!readonly && track(rawTarget, "iterate", ITERATE_KEY);
return target.forEach((value, key) => {
return callback.call(thisArg, wrap(value), wrap(key), observed);
});
}
};
extend(instrumentations, readonly ? {
add: createReadonlyMethod("add"),
set: createReadonlyMethod("set"),
delete: createReadonlyMethod("delete"),
clear: createReadonlyMethod("clear")
} : {
add(value) {
const target = /* @__PURE__ */ toRaw(this);
const proto = getProto(target);
const rawValue = /* @__PURE__ */ toRaw(value);
const valueToAdd = !shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value) ? rawValue : value;
if (!(proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue))) {
target.add(valueToAdd);
trigger(target, "add", valueToAdd, valueToAdd);
}
return this;
},
set(key, value) {
if (!shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) value = /* @__PURE__ */ toRaw(value);
const target = /* @__PURE__ */ toRaw(this);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);
if (!hadKey) {
key = /* @__PURE__ */ toRaw(key);
hadKey = has.call(target, key);
}
const oldValue = get.call(target, key);
target.set(key, value);
if (!hadKey) trigger(target, "add", key, value);
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
return this;
},
delete(key) {
const target = /* @__PURE__ */ toRaw(this);
const { has, get } = getProto(target);
let hadKey = has.call(target, key);
if (!hadKey) {
key = /* @__PURE__ */ toRaw(key);
hadKey = has.call(target, key);
}
const oldValue = get ? get.call(target, key) : void 0;
const result = target.delete(key);
if (hadKey) trigger(target, "delete", key, void 0, oldValue);
return result;
},
clear() {
const target = /* @__PURE__ */ toRaw(this);
const hadItems = target.size !== 0;
const oldTarget = void 0;
const result = target.clear();
if (hadItems) trigger(target, "clear", void 0, void 0, oldTarget);
return result;
}
});
[
"keys",
"values",
"entries",
Symbol.iterator
].forEach((method) => {
instrumentations[method] = createIterableMethod(method, readonly, shallow);
});
return instrumentations;
}
function createInstrumentationGetter(isReadonly2, shallow) {
const instrumentations = createInstrumentations(isReadonly2, shallow);
return (target, key, receiver) => {
if (key === "__v_isReactive") return !isReadonly2;
else if (key === "__v_isReadonly") return isReadonly2;
else if (key === "__v_raw") return target;
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
};
}
var mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) };
var shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, true) };
var readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) };
var shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) };
var reactiveMap = /* @__PURE__ */ new WeakMap();
var shallowReactiveMap = /* @__PURE__ */ new WeakMap();
var readonlyMap = /* @__PURE__ */ new WeakMap();
var shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
function targetTypeMap(rawType) {
switch (rawType) {
case "Object":
case "Array": return 1;
case "Map":
case "Set":
case "WeakMap":
case "WeakSet": return 2;
default: return 0;
}
}
/* @__NO_SIDE_EFFECTS__ */
function reactive(target) {
if (/* @__PURE__ */ isReadonly(target)) return target;
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
}
/* @__NO_SIDE_EFFECTS__ */
function shallowReactive(target) {
return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
}
/* @__NO_SIDE_EFFECTS__ */
function readonly(target) {
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
}
/* @__NO_SIDE_EFFECTS__ */
function shallowReadonly(target) {
return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
}
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
if (!isObject$1(target)) return target;
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) return target;
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
const existingProxy = proxyMap.get(target);
if (existingProxy) return existingProxy;
const targetType = targetTypeMap(toRawType(target));
if (targetType === 0) return target;
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
proxyMap.set(target, proxy);
return proxy;
}
/* @__NO_SIDE_EFFECTS__ */
function isReactive(value) {
if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
return !!(value && value["__v_isReactive"]);
}
/* @__NO_SIDE_EFFECTS__ */
function isReadonly(value) {
return !!(value && value["__v_isReadonly"]);
}
/* @__NO_SIDE_EFFECTS__ */
function isShallow(value) {
return !!(value && value["__v_isShallow"]);
}
/* @__NO_SIDE_EFFECTS__ */
function isProxy(value) {
return value ? !!value["__v_raw"] : false;
}
/* @__NO_SIDE_EFFECTS__ */
function toRaw(observed) {
const raw = observed && observed["__v_raw"];
return raw ? /* @__PURE__ */ toRaw(raw) : observed;
}
function markRaw(value) {
if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) def(value, "__v_skip", true);
return value;
}
var toReactive = (value) => isObject$1(value) ? /* @__PURE__ */ reactive(value) : value;
var toReadonly = (value) => isObject$1(value) ? /* @__PURE__ */ readonly(value) : value;
/* @__NO_SIDE_EFFECTS__ */
function isRef(r) {
return r ? r["__v_isRef"] === true : false;
}
/* @__NO_SIDE_EFFECTS__ */
function ref(value) {
return createRef(value, false);
}
/* @__NO_SIDE_EFFECTS__ */
function shallowRef(value) {
return createRef(value, true);
}
function createRef(rawValue, shallow) {
if (/* @__PURE__ */ isRef(rawValue)) return rawValue;
return new RefImpl(rawValue, shallow);
}
var RefImpl = class {
constructor(value, isShallow2) {
this.dep = new Dep();
this["__v_isRef"] = true;
this["__v_isShallow"] = false;
this._rawValue = isShallow2 ? value : /* @__PURE__ */ toRaw(value);
this._value = isShallow2 ? value : toReactive(value);
this["__v_isShallow"] = isShallow2;
}
get value() {
this.dep.track();
return this._value;
}
set value(newValue) {
const oldValue = this._rawValue;
const useDirectValue = this["__v_isShallow"] || /* @__PURE__ */ isShallow(newValue) || /* @__PURE__ */ isReadonly(newValue);
newValue = useDirectValue ? newValue : /* @__PURE__ */ toRaw(newValue);
if (hasChanged(newValue, oldValue)) {
this._rawValue = newValue;
this._value = useDirectValue ? newValue : toReactive(newValue);
this.dep.trigger();
}
}
};
function unref(ref2) {
return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
}
function toValue(source) {
return isFunction(source) ? source() : unref(source);
}
var shallowUnwrapHandlers = {
get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
set: (target, key, value, receiver) => {
const oldValue = target[key];
if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
oldValue.value = value;
return true;
} else return Reflect.set(target, key, value, receiver);
}
};
function proxyRefs(objectWithRefs) {
return /* @__PURE__ */ isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
}
var CustomRefImpl = class {
constructor(factory) {
this["__v_isRef"] = true;
this._value = void 0;
const dep = this.dep = new Dep();
const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
this._get = get;
this._set = set;
}
get value() {
return this._value = this._get();
}
set value(newVal) {
this._set(newVal);
}
};
function customRef(factory) {
return new CustomRefImpl(factory);
}
/* @__NO_SIDE_EFFECTS__ */
function toRefs(object) {
const ret = isArray$1(object) ? new Array(object.length) : {};
for (const key in object) ret[key] = propertyToRef(object, key);
return ret;
}
var ObjectRefImpl = class {
constructor(_object, key, _defaultValue) {
this._object = _object;
this._defaultValue = _defaultValue;
this["__v_isRef"] = true;
this._value = void 0;
this._key = isSymbol(key) ? key : String(key);
this._raw = /* @__PURE__ */ toRaw(_object);
let shallow = true;
let obj = _object;
if (!isArray$1(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) do
shallow = !/* @__PURE__ */ isProxy(obj) || /* @__PURE__ */ isShallow(obj);
while (shallow && (obj = obj["__v_raw"]));
this._shallow = shallow;
}
get value() {
let val = this._object[this._key];
if (this._shallow) val = unref(val);
return this._value = val === void 0 ? this._defaultValue : val;
}
set value(newVal) {
if (this._shallow && /* @__PURE__ */ isRef(this._raw[this._key])) {
const nestedRef = this._object[this._key];
if (/* @__PURE__ */ isRef(nestedRef)) {
nestedRef.value = newVal;
return;
}
}
this._object[this._key] = newVal;
}
get dep() {
return getDepFromReactive(this._raw, this._key);
}
};
var GetterRefImpl = class {
constructor(_getter) {
this._getter = _getter;
this["__v_isRef"] = true;
this["__v_isReadonly"] = true;
this._value = void 0;
}
get value() {
return this._value = this._getter();
}
};
/* @__NO_SIDE_EFFECTS__ */
function toRef$1(source, key, defaultValue) {
if (/* @__PURE__ */ isRef(source)) return source;
else if (isFunction(source)) return new GetterRefImpl(source);
else if (isObject$1(source) && arguments.length > 1) return propertyToRef(source, key, defaultValue);
else return /* @__PURE__ */ ref(source);
}
function propertyToRef(source, key, defaultValue) {
return new ObjectRefImpl(source, key, defaultValue);
}
var ComputedRefImpl = class {
constructor(fn, setter, isSSR) {
this.fn = fn;
this.setter = setter;
/**
* @internal
*/
this._value = void 0;
/**
* @internal
*/
this.dep = new Dep(this);
/**
* @internal
*/
this.__v_isRef = true;
/**
* @internal
*/
this.deps = void 0;
/**
* @internal
*/
this.depsTail = void 0;
/**
* @internal
*/
this.flags = 16;
/**
* @internal
*/
this.globalVersion = globalVersion - 1;
/**
* @internal
*/
this.next = void 0;
this.effect = this;
this["__v_isReadonly"] = !setter;
this.isSSR = isSSR;
}
/**
* @internal
*/
notify() {
this.flags |= 16;
if (!(this.flags & 8) && activeSub !== this) {
batch(this, true);
return true;
}
}
get value() {
const link = this.dep.track();
refreshComputed(this);
if (link) link.version = this.dep.version;
return this._value;
}
set value(newValue) {
if (this.setter) this.setter(newValue);
}
};
/* @__NO_SIDE_EFFECTS__ */
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
let getter;
let setter;
if (isFunction(getterOrOptions)) getter = getterOrOptions;
else {
getter = getterOrOptions.get;
setter = getterOrOptions.set;
}
return new ComputedRefImpl(getter, setter, isSSR);
}
var INITIAL_WATCHER_VALUE = {};
var cleanupMap = /* @__PURE__ */ new WeakMap();
var activeWatcher = void 0;
function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
if (owner) {
let cleanups = cleanupMap.get(owner);
if (!cleanups) cleanupMap.set(owner, cleanups = []);
cleanups.push(cleanupFn);
}
}
function watch$1(source, cb, options = EMPTY_OBJ) {
const { immediate, deep, once, scheduler, augmentJob, call } = options;
const reactiveGetter = (source2) => {
if (deep) return source2;
if (/* @__PURE__ */ isShallow(source2) || deep === false || deep === 0) return traverse(source2, 1);
return traverse(source2);
};
let effect;
let getter;
let cleanup;
let boundCleanup;
let forceTrigger = false;
let isMultiSource = false;
if (/* @__PURE__ */ isRef(source)) {
getter = () => source.value;
forceTrigger = /* @__PURE__ */ isShallow(source);
} else if (/* @__PURE__ */ isReactive(source)) {
getter = () => reactiveGetter(source);
forceTrigger = true;
} else if (isArray$1(source)) {
isMultiSource = true;
forceTrigger = source.some((s) => /* @__PURE__ */ isReactive(s) || /* @__PURE__ */ isShallow(s));
getter = () => source.map((s) => {
if (/* @__PURE__ */ isRef(s)) return s.value;
else if (/* @__PURE__ */ isReactive(s)) return reactiveGetter(s);
else if (isFunction(s)) return call ? call(s, 2) : s();
});
} else if (isFunction(source)) if (cb) getter = call ? () => call(source, 2) : source;
else getter = () => {
if (cleanup) {
pauseTracking();
try {
cleanup();
} finally {
resetTracking();
}
}
const currentEffect = activeWatcher;
activeWatcher = effect;
try {
return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
} finally {
activeWatcher = currentEffect;
}
};
else getter = NOOP;
if (cb && deep) {
const baseGetter = getter;
const depth = deep === true ? Infinity : deep;
getter = () => traverse(baseGetter(), depth);
}
const scope = getCurrentScope();
const watchHandle = () => {
effect.stop();
if (scope && scope.active) remove(scope.effects, effect);
};
if (once && cb) {
const _cb = cb;
cb = (...args) => {
_cb(...args);
watchHandle();
};
}
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
const job = (immediateFirstRun) => {
if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) return;
if (cb) {
const newValue = effect.run();
if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
if (cleanup) cleanup();
const currentWatcher = activeWatcher;
activeWatcher = effect;
try {
const args = [
newValue,
oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
boundCleanup
];
oldValue = newValue;
call ? call(cb, 3, args) : cb(...args);
} finally {
activeWatcher = currentWatcher;
}
}
} else effect.run();
};
if (augmentJob) augmentJob(job);
effect = new ReactiveEffect(getter);
effect.scheduler = scheduler ? () => scheduler(job, false) : job;
boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
cleanup = effect.onStop = () => {
const cleanups = cleanupMap.get(effect);
if (cleanups) {
if (call) call(cleanups, 4);
else for (const cleanup2 of cleanups) cleanup2();
cleanupMap.delete(effect);
}
};
if (cb) if (immediate) job(true);
else oldValue = effect.run();
else if (scheduler) scheduler(job.bind(null, true), true);
else effect.run();
watchHandle.pause = effect.pause.bind(effect);
watchHandle.resume = effect.resume.bind(effect);
watchHandle.stop = watchHandle;
return watchHandle;
}
function traverse(value, depth = Infinity, seen) {
if (depth <= 0 || !isObject$1(value) || value["__v_skip"]) return value;
seen = seen || /* @__PURE__ */ new Map();
if ((seen.get(value) || 0) >= depth) return value;
seen.set(value, depth);
depth--;
if (/* @__PURE__ */ isRef(value)) traverse(value.value, depth, seen);
else if (isArray$1(value)) for (let i = 0; i < value.length; i++) traverse(value[i], depth, seen);
else if (isSet(value) || isMap(value)) value.forEach((v) => {
traverse(v, depth, seen);
});
else if (isPlainObject$1(value)) {
for (const key in value) traverse(value[key], depth, seen);
for (const key of Object.getOwnPropertySymbols(value)) if (Object.prototype.propertyIsEnumerable.call(value, key)) traverse(value[key], depth, seen);
}
return value;
}
//#endregion
//#region node_modules/.pnpm/@vue+runtime-core@3.5.35/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
/**
* @vue/runtime-core v3.5.35
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
function callWithErrorHandling(fn, instance, type, args) {
try {
return args ? fn(...args) : fn();
} catch (err) {
handleError(err, instance, type);
}
}
function callWithAsyncErrorHandling(fn, instance, type, args) {
if (isFunction(fn)) {
const res = callWithErrorHandling(fn, instance, type, args);
if (res && isPromise(res)) res.catch((err) => {
handleError(err, instance, type);
});
return res;
}
if (isArray$1(fn)) {
const values = [];
for (let i = 0; i < fn.length; i++) values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
return values;
}
}
function handleError(err, instance, type, throwInDev = true) {
const contextVNode = instance ? instance.vnode : null;
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
if (instance) {
let cur = instance.parent;
const exposedInstance = instance.proxy;
const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
while (cur) {
const errorCapturedHooks = cur.ec;
if (errorCapturedHooks) {
for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
}
cur = cur.parent;
}
if (errorHandler) {
pauseTracking();
callWithErrorHandling(errorHandler, null, 10, [
err,
exposedInstance,
errorInfo
]);
resetTracking();
return;
}
}
logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
}
function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
if (throwInProd) throw err;
else console.error(err);
}
var queue = [];
var flushIndex = -1;
var pendingPostFlushCbs = [];
var activePostFlushCbs = null;
var postFlushIndex = 0;
var resolvedPromise = /* @__PURE__ */ Promise.resolve();
var currentFlushPromise = null;
function nextTick(fn) {
const p = currentFlushPromise || resolvedPromise;
return fn ? p.then(this ? fn.bind(this) : fn) : p;
}
function findInsertionIndex$1(id) {
let start = flushIndex + 1;
let end = queue.length;
while (start < end) {
const middle = start + end >>> 1;
const middleJob = queue[middle];
const middleJobId = getId(middleJob);
if (middleJobId < id || middleJobId === id && middleJob.flags & 2) start = middle + 1;
else end = middle;
}
return start;
}
function queueJob(job) {
if (!(job.flags & 1)) {
const jobId = getId(job);
const lastJob = queue[queue.length - 1];
if (!lastJob || !(job.flags & 2) && jobId >= getId(lastJob)) queue.push(job);
else queue.splice(findInsertionIndex$1(jobId), 0, job);
job.flags |= 1;
queueFlush();
}
}
function queueFlush() {
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(flushJobs);
}
function queuePostFlushCb(cb) {
if (!isArray$1(cb)) {
if (activePostFlushCbs && cb.id === -1) activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
else if (!(cb.flags & 1)) {
pendingPostFlushCbs.push(cb);
cb.flags |= 1;
}
} else pendingPostFlushCbs.push(...cb);
queueFlush();
}
function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
for (; i < queue.length; i++) {
const cb = queue[i];
if (cb && cb.flags & 2) {
if (instance && cb.id !== instance.uid) continue;
queue.splice(i, 1);
i--;
if (cb.flags & 4) cb.flags &= -2;
cb();
if (!(cb.flags & 4)) cb.flags &= -2;
}
}
}
function flushPostFlushCbs(seen) {
if (pendingPostFlushCbs.length) {
const deduped = [...new Set(pendingPostFlushCbs)].sort((a, b) => getId(a) - getId(b));
pendingPostFlushCbs.length = 0;
if (activePostFlushCbs) {
activePostFlushCbs.push(...deduped);
return;
}
activePostFlushCbs = deduped;
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
const cb = activePostFlushCbs[postFlushIndex];
if (cb.flags & 4) cb.flags &= -2;
if (!(cb.flags & 8)) cb();
cb.flags &= -2;
}
activePostFlushCbs = null;
postFlushIndex = 0;
}
}
var getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
function flushJobs(seen) {
try {
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
const job = queue[flushIndex];
if (job && !(job.flags & 8)) {
if (job.flags & 4) job.flags &= -2;
callWithErrorHandling(job, job.i, job.i ? 15 : 14);
if (!(job.flags & 4)) job.flags &= -2;
}
}
} finally {
for (; flushIndex < queue.length; flushIndex++) {
const job = queue[flushIndex];
if (job) job.flags &= -2;
}
flushIndex = -1;
queue.length = 0;
flushPostFlushCbs(seen);
currentFlushPromise = null;
if (queue.length || pendingPostFlushCbs.length) flushJobs(seen);
}
}
var currentRenderingInstance = null;
var currentScopeId = null;
function setCurrentRenderingInstance(instance) {
const prev = currentRenderingInstance;
currentRenderingInstance = instance;
currentScopeId = instance && instance.type.__scopeId || null;
return prev;
}
function pushScopeId(id) {
currentScopeId = id;
}
function popScopeId() {
currentScopeId = null;
}
var withScopeId = (_id) => withCtx;
function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
if (!ctx) return fn;
if (fn._n) return fn;
const renderFnWithContext = (...args) => {
if (renderFnWithContext._d) setBlockTracking(-1);
const prevInstance = setCurrentRenderingInstance(ctx);
let res;
try {
res = fn(...args);
} finally {
setCurrentRenderingInstance(prevInstance);
if (renderFnWithContext._d) setBlockTracking(1);
}
return res;
};
renderFnWithContext._n = true;
renderFnWithContext._c = true;
renderFnWithContext._d = true;
return renderFnWithContext;
}
function withDirectives(vnode, directives) {
if (currentRenderingInstance === null) return vnode;
const instance = getComponentPublicInstance(currentRenderingInstance);
const bindings = vnode.dirs || (vnode.dirs = []);
for (let i = 0; i < directives.length; i++) {
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
if (dir) {
if (isFunction(dir)) dir = {
mounted: dir,
updated: dir
};
if (dir.deep) traverse(value);
bindings.push({
dir,
instance,
value,
oldValue: void 0,
arg,
modifiers
});
}
}
return vnode;
}
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
const bindings = vnode.dirs;
const oldBindings = prevVNode && prevVNode.dirs;
for (let i = 0; i < bindings.length; i++) {
const binding = bindings[i];
if (oldBindings) binding.oldValue = oldBindings[i].value;
let hook = binding.dir[name];
if (hook) {
pauseTracking();
callWithAsyncErrorHandling(hook, instance, 8, [
vnode.el,
binding,
vnode,
prevVNode
]);
resetTracking();
}
}
}
function provide(key, value) {
if (currentInstance) {
let provides = currentInstance.provides;
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
if (parentProvides === provides) provides = currentInstance.provides = Object.create(parentProvides);
provides[key] = value;
}
}
function inject(key, defaultValue, treatDefaultAsFactory = false) {
const instance = getCurrentInstance();
if (instance || currentApp) {
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
if (provides && key in provides) return provides[key];
else if (arguments.length > 1) return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
}
}
function hasInjectionContext() {
return !!(getCurrentInstance() || currentApp);
}
var ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
var useSSRContext = () => {
{
const ctx = inject(ssrContextKey);
if (!ctx) {}
return ctx;
}
};
function watchEffect(effect, options) {
return doWatch(effect, null, options);
}
function watch(source, cb, options) {
return doWatch(source, cb, options);
}
function doWatch(source, cb, options = EMPTY_OBJ) {
const { immediate, deep, flush, once } = options;
const baseWatchOptions = extend({}, options);
const runsImmediately = cb && immediate || !cb && flush !== "post";
let ssrCleanup;
if (isInSSRComponentSetup) {
if (flush === "sync") {
const ctx = useSSRContext();
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
} else if (!runsImmediately) {
const watchStopHandle = () => {};
watchStopHandle.stop = NOOP;
watchStopHandle.resume = NOOP;
watchStopHandle.pause = NOOP;
return watchStopHandle;
}
}
const instance = currentInstance;
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
let isPre = false;
if (flush === "post") baseWatchOptions.scheduler = (job) => {
queuePostRenderEffect(job, instance && instance.suspense);
};
else if (flush !== "sync") {
isPre = true;
baseWatchOptions.scheduler = (job, isFirstRun) => {
if (isFirstRun) job();
else queueJob(job);
};
}
baseWatchOptions.augmentJob = (job) => {
if (cb) job.flags |= 4;
if (isPre) {
job.flags |= 2;
if (instance) {
job.id = instance.uid;
job.i = instance;
}
}
};
const watchHandle = watch$1(source, cb, baseWatchOptions);
if (isInSSRComponentSetup) {
if (ssrCleanup) ssrCleanup.push(watchHandle);
else if (runsImmediately) watchHandle();
}
return watchHandle;
}
function instanceWatch(source, value, options) {
const publicThis = this.proxy;
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
let cb;
if (isFunction(value)) cb = value;
else {
cb = value.handler;
options = value;
}
const reset = setCurrentInstance(this);
const res = doWatch(getter, cb.bind(publicThis), options);
reset();
return res;
}
function createPathGetter(ctx, path) {
const segments = path.split(".");
return () => {
let cur = ctx;
for (let i = 0; i < segments.length && cur; i++) cur = cur[segments[i]];
return cur;
};
}
var pendingMounts = /* @__PURE__ */ new WeakMap();
var TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
var isTeleport = (type) => type.__isTeleport;
var isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
var isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
var isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
var isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
var resolveTarget = (props, select) => {
const targetSelector = props && props.to;
if (isString(targetSelector)) if (!select) return null;
else return select(targetSelector);
else return targetSelector;
};
var TeleportImpl = {
name: "Teleport",
__isTeleport: true,
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
const disabled = isTeleportDisabled(n2.props);
let { dynamicChildren } = n2;
const mount = (vnode, container2, anchor2) => {
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container2, anchor2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
};
const mountToTarget = (vnode = n2) => {
const disabled2 = isTeleportDisabled(vnode.props);
const target = vnode.target = resolveTarget(vnode.props, querySelector);
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
if (target) {
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
if (!disabled2) {
mount(vnode, target, targetAnchor);
updateCssVars(vnode, false);
}
}
};
const queuePendingMount = (vnode) => {
const mountJob = () => {
if (pendingMounts.get(vnode) !== mountJob) return;
pendingMounts.delete(vnode);
if (isTeleportDisabled(vnode.props)) {
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
updateCssVars(vnode, true);
}
mountToTarget(vnode);
};
pendingMounts.set(vnode, mountJob);
queuePostRenderEffect(mountJob, parentSuspense);
};
if (n1 == null) {
const placeholder = n2.el = createText("");
const mainAnchor = n2.anchor = createText("");
insert(placeholder, container, anchor);
insert(mainAnchor, container, anchor);
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
queuePendingMount(n2);
return;
}
if (disabled) {
mount(n2, container, mainAnchor);
updateCssVars(n2, true);
}
mountToTarget();
} else {
n2.el = n1.el;
const mainAnchor = n2.anchor = n1.anchor;
const pendingMount = pendingMounts.get(n1);
if (pendingMount) {
pendingMount.flags |= 8;
pendingMounts.delete(n1);
queuePendingMount(n2);
return;
}
n2.targetStart = n1.targetStart;
const target = n2.target = n1.target;
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
const wasDisabled = isTeleportDisabled(n1.props);
const currentContainer = wasDisabled ? container : target;
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
if (namespace === "svg" || isTargetSVG(target)) namespace = "svg";
else if (namespace === "mathml" || isTargetMathML(target)) namespace = "mathml";
if (dynamicChildren) {
patchBlockChildren(n1.dynamicChildren, dynamicChildren, currentContainer, parentComponent, parentSuspense, namespace, slotScopeIds);
traverseStaticChildren(n1, n2, true);
} else if (!optimized) patchChildren(n1, n2, currentContainer, currentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, false);
if (disabled) {
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, 1);
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
const nextTarget = n2.target = resolveTarget(n2.props, querySelector);
if (nextTarget) moveTeleport(n2, nextTarget, null, internals, 0);
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, 1);
updateCssVars(n2, disabled);
}
},
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
const shouldRemove = doRemove || !isTeleportDisabled(props);
const pendingMount = pendingMounts.get(vnode);
if (pendingMount) {
pendingMount.flags |= 8;
pendingMounts.delete(vnode);
}
if (target) {
hostRemove(targetStart);
hostRemove(targetAnchor);
}
doRemove && hostRemove(anchor);
if (!pendingMount && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
const child = children[i];
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
}
},
move: moveTeleport,
hydrate: hydrateTeleport
};
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
if (moveType === 0) insert(vnode.targetAnchor, container, parentAnchor);
const { el, anchor, shapeFlag, children, props } = vnode;
const isReorder = moveType === 2;
if (isReorder) insert(el, container, parentAnchor);
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2);
}
if (isReorder) insert(anchor, container, parentAnchor);
}
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { o: { nextSibling, parentNode, querySelector, insert, createText } }, hydrateChildren) {
function hydrateAnchor(target2, targetNode) {
let targetAnchor = targetNode;
while (targetAnchor) {
if (targetAnchor && targetAnchor.nodeType === 8) {
if (targetAnchor.data === "teleport start anchor") vnode.targetStart = targetAnchor;
else if (targetAnchor.data === "teleport anchor") {
vnode.targetAnchor = targetAnchor;
target2._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
break;
}
}
targetAnchor = nextSibling(targetAnchor);
}
}
function hydrateDisabledTeleport(node2, vnode2) {
vnode2.anchor = hydrateChildren(nextSibling(node2), vnode2, parentNode(node2), parentComponent, parentSuspense, slotScopeIds, optimized);
}
const target = vnode.target = resolveTarget(vnode.props, querySelector);
const disabled = isTeleportDisabled(vnode.props);
if (target) {
const targetNode = target._lpa || target.firstChild;
if (vnode.shapeFlag & 16) if (disabled) {
hydrateDisabledTeleport(node, vnode);
hydrateAnchor(target, targetNode);
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
} else {
vnode.anchor = nextSibling(node);
hydrateAnchor(target, targetNode);
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
}
updateCssVars(vnode, disabled);
} else if (disabled) {
if (vnode.shapeFlag & 16) {
hydrateDisabledTeleport(node, vnode);
vnode.targetStart = node;
vnode.targetAnchor = nextSibling(node);
}
}
return vnode.anchor && nextSibling(vnode.anchor);
}
var Teleport = TeleportImpl;
function updateCssVars(vnode, isDisabled) {
const ctx = vnode.ctx;
if (ctx && ctx.ut) {
let node, anchor;
if (isDisabled) {
node = vnode.el;
anchor = vnode.anchor;
} else {
node = vnode.targetStart;
anchor = vnode.targetAnchor;
}
while (node && node !== anchor) {
if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
node = node.nextSibling;
}
ctx.ut();
}
}
function prepareAnchor(target, vnode, createText, insert, anchor = null) {
const targetStart = vnode.targetStart = createText("");
const targetAnchor = vnode.targetAnchor = createText("");
targetStart[TeleportEndKey] = targetAnchor;
if (target) {
insert(targetStart, target, anchor);
insert(targetAnchor, target, anchor);
}
return targetAnchor;
}
var leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
function setTransitionHooks(vnode, hooks) {
if (vnode.shapeFlag & 6 && vnode.component) {
vnode.transition = hooks;
setTransitionHooks(vnode.component.subTree, hooks);
} else if (vnode.shapeFlag & 128) {
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
} else vnode.transition = hooks;
}
/* @__NO_SIDE_EFFECTS__ */
function defineComponent(options, extraOptions) {
return isFunction(options) ? /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))() : options;
}
function markAsyncBoundary(instance) {
instance.ids = [
instance.ids[0] + instance.ids[2]++ + "-",
0,
0
];
}
function useTemplateRef(key) {
const i = getCurrentInstance();
const r = /* @__PURE__ */ shallowRef(null);
if (i) {
const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
Object.defineProperty(refs, key, {
enumerable: true,
get: () => r.value,
set: (val) => r.value = val
});
}
return r;
}
function isTemplateRefKey(refs, key) {
let desc;
return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
}
var pendingSetRefMap = /* @__PURE__ */ new WeakMap();
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
if (isArray$1(rawRef)) {
rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray$1(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
return;
}
if (isAsyncWrapper(vnode) && !isUnmount) {
if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
return;
}
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
const value = isUnmount ? null : refValue;
const { i: owner, r: ref } = rawRef;
const oldRef = oldRawRef && oldRawRef.r;
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
const setupState = owner.setupState;
const rawSetupState = /* @__PURE__ */ toRaw(setupState);
const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
if (isTemplateRefKey(refs, key)) return false;
return hasOwn(rawSetupState, key);
};
const canSetRef = (ref2, key) => {
if (key && isTemplateRefKey(refs, key)) return false;
return true;
};
if (oldRef != null && oldRef !== ref) {
invalidatePendingSetRef(oldRawRef);
if (isString(oldRef)) {
refs[oldRef] = null;
if (canSetSetupRef(oldRef)) setupState[oldRef] = null;
} else if (/* @__PURE__ */ isRef(oldRef)) {
const oldRawRefAtom = oldRawRef;
if (canSetRef(oldRef, oldRawRefAtom.k)) oldRef.value = null;
if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
}
}
if (isFunction(ref)) callWithErrorHandling(ref, owner, 12, [value, refs]);
else {
const _isString = isString(ref);
const _isRef = /* @__PURE__ */ isRef(ref);
if (_isString || _isRef) {
const doSet = () => {
if (rawRef.f) {
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
if (isUnmount) isArray$1(existing) && remove(existing, refValue);
else if (!isArray$1(existing)) if (_isString) {
refs[ref] = [refValue];
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
} else {
const newVal = [refValue];
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
if (rawRef.k) refs[rawRef.k] = newVal;
}
else if (!existing.includes(refValue)) existing.push(refValue);
} else if (_isString) {
refs[ref] = value;
if (canSetSetupRef(ref)) setupState[ref] = value;
} else if (_isRef) {
if (canSetRef(ref, rawRef.k)) ref.value = value;
if (rawRef.k) refs[rawRef.k] = value;
}
};
if (value) {
const job = () => {
doSet();
pendingSetRefMap.delete(rawRef);
};
job.id = -1;
pendingSetRefMap.set(rawRef, job);
queuePostRenderEffect(job, parentSuspense);
} else {
invalidatePendingSetRef(rawRef);
doSet();
}
}
}
}
function invalidatePendingSetRef(rawRef) {
const pendingSetRef = pendingSetRefMap.get(rawRef);
if (pendingSetRef) {
pendingSetRef.flags |= 8;
pendingSetRefMap.delete(rawRef);
}
}
getGlobalThis().requestIdleCallback;
getGlobalThis().cancelIdleCallback;
var isAsyncWrapper = (i) => !!i.type.__asyncLoader;
var isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
var KeepAlive = {
name: `KeepAlive`,
__isKeepAlive: true,
props: {
include: [
String,
RegExp,
Array
],
exclude: [
String,
RegExp,
Array
],
max: [String, Number]
},
setup(props, { slots }) {
const instance = getCurrentInstance();
const sharedContext = instance.ctx;
if (!sharedContext.renderer) return () => {
const children = slots.default && slots.default();
return children && children.length === 1 ? children[0] : children;
};
const cache = /* @__PURE__ */ new Map();
const keys = /* @__PURE__ */ new Set();
let current = null;
const parentSuspense = instance.suspense;
const { renderer: { p: patch, m: move, um: _unmount, o: { createElement } } } = sharedContext;
const storageContainer = createElement("div");
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
const instance2 = vnode.component;
move(vnode, container, anchor, 0, parentSuspense);
patch(instance2.vnode, vnode, container, anchor, instance2, parentSuspense, namespace, vnode.slotScopeIds, optimized);
queuePostRenderEffect(() => {
instance2.isDeactivated = false;
if (instance2.a) invokeArrayFns(instance2.a);
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
if (vnodeHook) invokeVNodeHook(vnodeHook, instance2.parent, vnode);
}, parentSuspense);
};
sharedContext.deactivate = (vnode) => {
const instance2 = vnode.component;
invalidateMount(instance2.m);
invalidateMount(instance2.a);
move(vnode, storageContainer, null, 1, parentSuspense);
queuePostRenderEffect(() => {
if (instance2.da) invokeArrayFns(instance2.da);
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
if (vnodeHook) invokeVNodeHook(vnodeHook, instance2.parent, vnode);
instance2.isDeactivated = true;
}, parentSuspense);
};
function unmount(vnode) {
resetShapeFlag(vnode);
_unmount(vnode, instance, parentSuspense, true);
}
function pruneCache(filter) {
cache.forEach((vnode, key) => {
const name = getComponentName(isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type);
if (name && !filter(name)) pruneCacheEntry(key);
});
}
function pruneCacheEntry(key) {
const cached = cache.get(key);
if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
else if (current) resetShapeFlag(current);
cache.delete(key);
keys.delete(key);
}
watch(() => [props.include, props.exclude], ([include, exclude]) => {
include && pruneCache((name) => matches(include, name));
exclude && pruneCache((name) => !matches(exclude, name));
}, {
flush: "post",
deep: true
});
let pendingCacheKey = null;
const cacheSubtree = () => {
if (pendingCacheKey != null) if (isSuspense(instance.subTree.type)) queuePostRenderEffect(() => {
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
}, instance.subTree.suspense);
else cache.set(pendingCacheKey, getInnerChild(instance.subTree));
};
onMounted(cacheSubtree);
onUpdated(cacheSubtree);
onBeforeUnmount(() => {
cache.forEach((cached) => {
const { subTree, suspense } = instance;
const vnode = getInnerChild(subTree);
if (cached.type === vnode.type && cached.key === vnode.key) {
resetShapeFlag(vnode);
const da = vnode.component.da;
da && queuePostRenderEffect(da, suspense);
return;
}
unmount(cached);
});
});
return () => {
pendingCacheKey = null;
if (!slots.default) return current = null;
const children = slots.default();
const rawVNode = children[0];
if (children.length > 1) {
current = null;
return children;
} else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
current = null;
return rawVNode;
}
let vnode = getInnerChild(rawVNode);
if (vnode.type === Comment) {
current = null;
return vnode;
}
const comp = vnode.type;
const name = getComponentName(isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp);
const { include, exclude, max } = props;
if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
vnode.shapeFlag &= -257;
current = vnode;
return rawVNode;
}
const key = vnode.key == null ? comp : vnode.key;
const cachedVNode = cache.get(key);
if (vnode.el) {
vnode = cloneVNode(vnode);
if (rawVNode.shapeFlag & 128) rawVNode.ssContent = vnode;
}
pendingCacheKey = key;
if (cachedVNode) {
vnode.el = cachedVNode.el;
vnode.component = cachedVNode.component;
if (vnode.transition) setTransitionHooks(vnode, vnode.transition);
vnode.shapeFlag |= 512;
keys.delete(key);
keys.add(key);
} else {
keys.add(key);
if (max && keys.size > parseInt(max, 10)) pruneCacheEntry(keys.values().next().value);
}
vnode.shapeFlag |= 256;
current = vnode;
return isSuspense(rawVNode.type) ? rawVNode : vnode;
};
}
};
function matches(pattern, name) {
if (isArray$1(pattern)) return pattern.some((p) => matches(p, name));
else if (isString(pattern)) return pattern.split(",").includes(name);
else if (isRegExp(pattern)) {
pattern.lastIndex = 0;
return pattern.test(name);
}
return false;
}
function onActivated(hook, target) {
registerKeepAliveHook(hook, "a", target);
}
function onDeactivated(hook, target) {
registerKeepAliveHook(hook, "da", target);
}
function registerKeepAliveHook(hook, type, target = currentInstance) {
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
let current = target;
while (current) {
if (current.isDeactivated) return;
current = current.parent;
}
return hook();
});
injectHook(type, wrappedHook, target);
if (target) {
let current = target.parent;
while (current && current.parent) {
if (isKeepAlive(current.parent.vnode)) injectToKeepAliveRoot(wrappedHook, type, target, current);
current = current.parent;
}
}
}
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
const injected = injectHook(type, hook, keepAliveRoot, true);
onUnmounted(() => {
remove(keepAliveRoot[type], injected);
}, target);
}
function resetShapeFlag(vnode) {
vnode.shapeFlag &= -257;
vnode.shapeFlag &= -513;
}
function getInnerChild(vnode) {
return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
}
function injectHook(type, hook, target = currentInstance, prepend = false) {
if (target) {
const hooks = target[type] || (target[type] = []);
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
pauseTracking();
const reset = setCurrentInstance(target);
const res = callWithAsyncErrorHandling(hook, target, type, args);
reset();
resetTracking();
return res;
});
if (prepend) hooks.unshift(wrappedHook);
else hooks.push(wrappedHook);
return wrappedHook;
}
}
var createHook = (lifecycle) => (hook, target = currentInstance) => {
if (!isInSSRComponentSetup || lifecycle === "sp") injectHook(lifecycle, (...args) => hook(...args), target);
};
var onBeforeMount = createHook("bm");
var onMounted = createHook("m");
var onBeforeUpdate = createHook("bu");
var onUpdated = createHook("u");
var onBeforeUnmount = createHook("bum");
var onUnmounted = createHook("um");
var onServerPrefetch = createHook("sp");
var onRenderTriggered = createHook("rtg");
var onRenderTracked = createHook("rtc");
function onErrorCaptured(hook, target = currentInstance) {
injectHook("ec", hook, target);
}
var COMPONENTS = "components";
function resolveComponent(name, maybeSelfReference) {
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
}
var NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
function resolveDynamicComponent(component) {
if (isString(component)) return resolveAsset(COMPONENTS, component, false) || component;
else return component || NULL_DYNAMIC_COMPONENT;
}
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
const instance = currentRenderingInstance || currentInstance;
if (instance) {
const Component = instance.type;
if (type === COMPONENTS) {
const selfName = getComponentName(Component, false);
if (selfName && (selfName === name || selfName === camelize$1(name) || selfName === capitalize(camelize$1(name)))) return Component;
}
const res = resolve(instance[type] || Component[type], name) || resolve(instance.appContext[type], name);
if (!res && maybeSelfReference) return Component;
return res;
}
}
function resolve(registry, name) {
return registry && (registry[name] || registry[camelize$1(name)] || registry[capitalize(camelize$1(name))]);
}
function renderList(source, renderItem, cache, index) {
let ret;
const cached = cache && cache[index];
const sourceIsArray = isArray$1(source);
if (sourceIsArray || isString(source)) {
const sourceIsReactiveArray = sourceIsArray && /* @__PURE__ */ isReactive(source);
let needsWrap = false;
let isReadonlySource = false;
if (sourceIsReactiveArray) {
needsWrap = !/* @__PURE__ */ isShallow(source);
isReadonlySource = /* @__PURE__ */ isReadonly(source);
source = shallowReadArray(source);
}
ret = new Array(source.length);
for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
} else if (typeof source === "number") {
ret = new Array(source);
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
} else if (isObject$1(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
else {
const keys = Object.keys(source);
ret = new Array(keys.length);
for (let i = 0, l = keys.length; i < l; i++) {
const key = keys[i];
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
}
}
else ret = [];
if (cache) cache[index] = ret;
return ret;
}
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
const hasProps = Object.keys(props).length > 0;
if (name !== "default") props.name = name;
return openBlock(), createBlock(Fragment, null, [createVNode("slot", props, fallback && fallback())], hasProps ? -2 : 64);
}
let slot = slots[name];
if (slot && slot._c) slot._d = false;
openBlock();
const validSlotContent = slot && ensureValidVNode(slot(props));
const slotKey = props.key || validSlotContent && validSlotContent.key;
const rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
if (slot && slot._c) slot._d = true;
return rendered;
}
function ensureValidVNode(vnodes) {
return vnodes.some((child) => {
if (!isVNode(child)) return true;
if (child.type === Comment) return false;
if (child.type === Fragment && !ensureValidVNode(child.children)) return false;
return true;
}) ? vnodes : null;
}
var getPublicInstance = (i) => {
if (!i) return null;
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
return getPublicInstance(i.parent);
};
var publicPropertiesMap = /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
$: (i) => i,
$el: (i) => i.vnode.el,
$data: (i) => i.data,
$props: (i) => i.props,
$attrs: (i) => i.attrs,
$slots: (i) => i.slots,
$refs: (i) => i.refs,
$parent: (i) => getPublicInstance(i.parent),
$root: (i) => getPublicInstance(i.root),
$host: (i) => i.ce,
$emit: (i) => i.emit,
$options: (i) => resolveMergedOptions(i),
$forceUpdate: (i) => i.f || (i.f = () => {
queueJob(i.update);
}),
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
$watch: (i) => instanceWatch.bind(i)
});
var hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
var PublicInstanceProxyHandlers = {
get({ _: instance }, key) {
if (key === "__v_skip") return true;
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
if (key[0] !== "$") {
const n = accessCache[key];
if (n !== void 0) switch (n) {
case 1: return setupState[key];
case 2: return data[key];
case 4: return ctx[key];
case 3: return props[key];
}
else if (hasSetupBinding(setupState, key)) {
accessCache[key] = 1;
return setupState[key];
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
accessCache[key] = 2;
return data[key];
} else if (hasOwn(props, key)) {
accessCache[key] = 3;
return props[key];
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
accessCache[key] = 4;
return ctx[key];
} else if (shouldCacheAccess) accessCache[key] = 0;
}
const publicGetter = publicPropertiesMap[key];
let cssModule, globalProperties;
if (publicGetter) {
if (key === "$attrs") track(instance.attrs, "get", "");
return publicGetter(instance);
} else if ((cssModule = type.__cssModules) && (cssModule = cssModule[key])) return cssModule;
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
accessCache[key] = 4;
return ctx[key];
} else if (globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) return globalProperties[key];
},
set({ _: instance }, key, value) {
const { data, setupState, ctx } = instance;
if (hasSetupBinding(setupState, key)) {
setupState[key] = value;
return true;
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
data[key] = value;
return true;
} else if (hasOwn(instance.props, key)) return false;
if (key[0] === "$" && key.slice(1) in instance) return false;
else ctx[key] = value;
return true;
},
has({ _: { data, setupState, accessCache, ctx, appContext, props, type } }, key) {
let cssModules;
return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
},
defineProperty(target, key, descriptor) {
if (descriptor.get != null) target._.accessCache[key] = 0;
else if (hasOwn(descriptor, "value")) this.set(target, key, descriptor.value, null);
return Reflect.defineProperty(target, key, descriptor);
}
};
function useSlots() {
return getContext("useSlots").slots;
}
function useAttrs() {
return getContext("useAttrs").attrs;
}
function getContext(calledFunctionName) {
const i = getCurrentInstance();
return i.setupContext || (i.setupContext = createSetupContext(i));
}
function normalizePropsOrEmits(props) {
return isArray$1(props) ? props.reduce((normalized, p) => (normalized[p] = null, normalized), {}) : props;
}
function withAsyncContext(getAwaitable) {
const ctx = getCurrentInstance();
const inSSRSetup = isInSSRComponentSetup;
let awaitable = getAwaitable();
unsetCurrentInstance();
if (inSSRSetup) setInSSRSetupState(false);
const restore = () => {
setCurrentInstance(ctx);
if (inSSRSetup) setInSSRSetupState(true);
};
const cleanup = () => {
if (getCurrentInstance() !== ctx) ctx.scope.off();
unsetCurrentInstance();
if (inSSRSetup) setInSSRSetupState(false);
};
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
restore();
Promise.resolve().then(() => Promise.resolve().then(cleanup));
throw e;
});
return [awaitable, () => {
restore();
Promise.resolve().then(cleanup);
}];
}
var shouldCacheAccess = true;
function applyOptions(instance) {
const options = resolveMergedOptions(instance);
const publicThis = instance.proxy;
const ctx = instance.ctx;
shouldCacheAccess = false;
if (options.beforeCreate) callHook(options.beforeCreate, instance, "bc");
const { data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions, created, beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render, renderTracked, renderTriggered, errorCaptured, serverPrefetch, expose, inheritAttrs, components, directives, filters } = options;
const checkDuplicateProperties = null;
if (injectOptions) resolveInjections(injectOptions, ctx, checkDuplicateProperties);
if (methods) for (const key in methods) {
const methodHandler = methods[key];
if (isFunction(methodHandler)) ctx[key] = methodHandler.bind(publicThis);
}
if (dataOptions) {
const data = dataOptions.call(publicThis, publicThis);
if (!isObject$1(data)) {} else instance.data = /* @__PURE__ */ reactive(data);
}
shouldCacheAccess = true;
if (computedOptions) for (const key in computedOptions) {
const opt = computedOptions[key];
const c = computed({
get: isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP,
set: !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP
});
Object.defineProperty(ctx, key, {
enumerable: true,
configurable: true,
get: () => c.value,
set: (v) => c.value = v
});
}
if (watchOptions) for (const key in watchOptions) createWatcher(watchOptions[key], ctx, publicThis, key);
if (provideOptions) {
const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
Reflect.ownKeys(provides).forEach((key) => {
provide(key, provides[key]);
});
}
if (created) callHook(created, instance, "c");
function registerLifecycleHook(register, hook) {
if (isArray$1(hook)) hook.forEach((_hook) => register(_hook.bind(publicThis)));
else if (hook) register(hook.bind(publicThis));
}
registerLifecycleHook(onBeforeMount, beforeMount);
registerLifecycleHook(onMounted, mounted);
registerLifecycleHook(onBeforeUpdate, beforeUpdate);
registerLifecycleHook(onUpdated, updated);
registerLifecycleHook(onActivated, activated);
registerLifecycleHook(onDeactivated, deactivated);
registerLifecycleHook(onErrorCaptured, errorCaptured);
registerLifecycleHook(onRenderTracked, renderTracked);
registerLifecycleHook(onRenderTriggered, renderTriggered);
registerLifecycleHook(onBeforeUnmount, beforeUnmount);
registerLifecycleHook(onUnmounted, unmounted);
registerLifecycleHook(onServerPrefetch, serverPrefetch);
if (isArray$1(expose)) {
if (expose.length) {
const exposed = instance.exposed || (instance.exposed = {});
expose.forEach((key) => {
Object.defineProperty(exposed, key, {
get: () => publicThis[key],
set: (val) => publicThis[key] = val,
enumerable: true
});
});
} else if (!instance.exposed) instance.exposed = {};
}
if (render && instance.render === NOOP) instance.render = render;
if (inheritAttrs != null) instance.inheritAttrs = inheritAttrs;
if (components) instance.components = components;
if (directives) instance.directives = directives;
if (serverPrefetch) markAsyncBoundary(instance);
}
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
if (isArray$1(injectOptions)) injectOptions = normalizeInject(injectOptions);
for (const key in injectOptions) {
const opt = injectOptions[key];
let injected;
if (isObject$1(opt)) if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
else injected = inject(opt.from || key);
else injected = inject(opt);
if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
enumerable: true,
configurable: true,
get: () => injected.value,
set: (v) => injected.value = v
});
else ctx[key] = injected;
}
}
function callHook(hook, instance, type) {
callWithAsyncErrorHandling(isArray$1(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
}
function createWatcher(raw, ctx, publicThis, key) {
let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
if (isString(raw)) {
const handler = ctx[raw];
if (isFunction(handler)) watch(getter, handler);
} else if (isFunction(raw)) watch(getter, raw.bind(publicThis));
else if (isObject$1(raw)) if (isArray$1(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
else {
const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
if (isFunction(handler)) watch(getter, handler, raw);
}
}
function resolveMergedOptions(instance) {
const base = instance.type;
const { mixins, extends: extendsOptions } = base;
const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
const cached = cache.get(base);
let resolved;
if (cached) resolved = cached;
else if (!globalMixins.length && !mixins && !extendsOptions) resolved = base;
else {
resolved = {};
if (globalMixins.length) globalMixins.forEach((m) => mergeOptions$1(resolved, m, optionMergeStrategies, true));
mergeOptions$1(resolved, base, optionMergeStrategies);
}
if (isObject$1(base)) cache.set(base, resolved);
return resolved;
}
function mergeOptions$1(to, from, strats, asMixin = false) {
const { mixins, extends: extendsOptions } = from;
if (extendsOptions) mergeOptions$1(to, extendsOptions, strats, true);
if (mixins) mixins.forEach((m) => mergeOptions$1(to, m, strats, true));
for (const key in from) if (asMixin && key === "expose") {} else {
const strat = internalOptionMergeStrats[key] || strats && strats[key];
to[key] = strat ? strat(to[key], from[key]) : from[key];
}
return to;
}
var internalOptionMergeStrats = {
data: mergeDataFn,
props: mergeEmitsOrPropsOptions,
emits: mergeEmitsOrPropsOptions,
methods: mergeObjectOptions,
computed: mergeObjectOptions,
beforeCreate: mergeAsArray,
created: mergeAsArray,
beforeMount: mergeAsArray,
mounted: mergeAsArray,
beforeUpdate: mergeAsArray,
updated: mergeAsArray,
beforeDestroy: mergeAsArray,
beforeUnmount: mergeAsArray,
destroyed: mergeAsArray,
unmounted: mergeAsArray,
activated: mergeAsArray,
deactivated: mergeAsArray,
errorCaptured: mergeAsArray,
serverPrefetch: mergeAsArray,
components: mergeObjectOptions,
directives: mergeObjectOptions,
watch: mergeWatchOptions,
provide: mergeDataFn,
inject: mergeInject
};
function mergeDataFn(to, from) {
if (!from) return to;
if (!to) return from;
return function mergedDataFn() {
return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
};
}
function mergeInject(to, from) {
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
}
function normalizeInject(raw) {
if (isArray$1(raw)) {
const res = {};
for (let i = 0; i < raw.length; i++) res[raw[i]] = raw[i];
return res;
}
return raw;
}
function mergeAsArray(to, from) {
return to ? [...new Set([].concat(to, from))] : from;
}
function mergeObjectOptions(to, from) {
return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
}
function mergeEmitsOrPropsOptions(to, from) {
if (to) {
if (isArray$1(to) && isArray$1(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
return extend(/* @__PURE__ */ Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from != null ? from : {}));
} else return from;
}
function mergeWatchOptions(to, from) {
if (!to) return from;
if (!from) return to;
const merged = extend(/* @__PURE__ */ Object.create(null), to);
for (const key in from) merged[key] = mergeAsArray(to[key], from[key]);
return merged;
}
function createAppContext() {
return {
app: null,
config: {
isNativeTag: NO,
performance: false,
globalProperties: {},
optionMergeStrategies: {},
errorHandler: void 0,
warnHandler: void 0,
compilerOptions: {}
},
mixins: [],
components: {},
directives: {},
provides: /* @__PURE__ */ Object.create(null),
optionsCache: /* @__PURE__ */ new WeakMap(),
propsCache: /* @__PURE__ */ new WeakMap(),
emitsCache: /* @__PURE__ */ new WeakMap()
};
}
var uid$1 = 0;
function createAppAPI(render, hydrate) {
return function createApp(rootComponent, rootProps = null) {
if (!isFunction(rootComponent)) rootComponent = extend({}, rootComponent);
if (rootProps != null && !isObject$1(rootProps)) rootProps = null;
const context = createAppContext();
const installedPlugins = /* @__PURE__ */ new WeakSet();
const pluginCleanupFns = [];
let isMounted = false;
const app = context.app = {
_uid: uid$1++,
_component: rootComponent,
_props: rootProps,
_container: null,
_context: context,
_instance: null,
version,
get config() {
return context.config;
},
set config(v) {},
use(plugin, ...options) {
if (installedPlugins.has(plugin)) {} else if (plugin && isFunction(plugin.install)) {
installedPlugins.add(plugin);
plugin.install(app, ...options);
} else if (isFunction(plugin)) {
installedPlugins.add(plugin);
plugin(app, ...options);
}
return app;
},
mixin(mixin) {
if (!context.mixins.includes(mixin)) context.mixins.push(mixin);
return app;
},
component(name, component) {
if (!component) return context.components[name];
context.components[name] = component;
return app;
},
directive(name, directive) {
if (!directive) return context.directives[name];
context.directives[name] = directive;
return app;
},
mount(rootContainer, isHydrate, namespace) {
if (!isMounted) {
const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
vnode.appContext = context;
if (namespace === true) namespace = "svg";
else if (namespace === false) namespace = void 0;
if (isHydrate && hydrate) hydrate(vnode, rootContainer);
else render(vnode, rootContainer, namespace);
isMounted = true;
app._container = rootContainer;
rootContainer.__vue_app__ = app;
return getComponentPublicInstance(vnode.component);
}
},
onUnmount(cleanupFn) {
pluginCleanupFns.push(cleanupFn);
},
unmount() {
if (isMounted) {
callWithAsyncErrorHandling(pluginCleanupFns, app._instance, 16);
render(null, app._container);
delete app._container.__vue_app__;
}
},
provide(key, value) {
context.provides[key] = value;
return app;
},
runWithContext(fn) {
const lastApp = currentApp;
currentApp = app;
try {
return fn();
} finally {
currentApp = lastApp;
}
}
};
return app;
};
}
var currentApp = null;
var getModelModifiers = (props, modelName) => {
return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize$1(modelName)}Modifiers`] || props[`${hyphenate$1(modelName)}Modifiers`];
};
function emit(instance, event, ...rawArgs) {
if (instance.isUnmounted) return;
const props = instance.vnode.props || EMPTY_OBJ;
let args = rawArgs;
const isModelListener = event.startsWith("update:");
const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
if (modifiers) {
if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
if (modifiers.number) args = rawArgs.map(looseToNumber);
}
let handlerName;
let handler = props[handlerName = toHandlerKey(event)] || props[handlerName = toHandlerKey(camelize$1(event))];
if (!handler && isModelListener) handler = props[handlerName = toHandlerKey(hyphenate$1(event))];
if (handler) callWithAsyncErrorHandling(handler, instance, 6, args);
const onceHandler = props[handlerName + `Once`];
if (onceHandler) {
if (!instance.emitted) instance.emitted = {};
else if (instance.emitted[handlerName]) return;
instance.emitted[handlerName] = true;
callWithAsyncErrorHandling(onceHandler, instance, 6, args);
}
}
var mixinEmitsCache = /* @__PURE__ */ new WeakMap();
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
const cached = cache.get(comp);
if (cached !== void 0) return cached;
const raw = comp.emits;
let normalized = {};
let hasExtends = false;
if (!isFunction(comp)) {
const extendEmits = (raw2) => {
const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
if (normalizedFromExtend) {
hasExtends = true;
extend(normalized, normalizedFromExtend);
}
};
if (!asMixin && appContext.mixins.length) appContext.mixins.forEach(extendEmits);
if (comp.extends) extendEmits(comp.extends);
if (comp.mixins) comp.mixins.forEach(extendEmits);
}
if (!raw && !hasExtends) {
if (isObject$1(comp)) cache.set(comp, null);
return null;
}
if (isArray$1(raw)) raw.forEach((key) => normalized[key] = null);
else extend(normalized, raw);
if (isObject$1(comp)) cache.set(comp, normalized);
return normalized;
}
function isEmitListener(options, key) {
if (!options || !isOn(key)) return false;
key = key.slice(2).replace(/Once$/, "");
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate$1(key)) || hasOwn(options, key);
}
function renderComponentRoot(instance) {
const { type: Component, vnode, proxy, withProxy, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, props, data, setupState, ctx, inheritAttrs } = instance;
const prev = setCurrentRenderingInstance(instance);
let result;
let fallthroughAttrs;
try {
if (vnode.shapeFlag & 4) {
const proxyToUse = withProxy || proxy;
const thisProxy = proxyToUse;
result = normalizeVNode(render.call(thisProxy, proxyToUse, renderCache, props, setupState, data, ctx));
fallthroughAttrs = attrs;
} else {
const render2 = Component;
result = normalizeVNode(render2.length > 1 ? render2(props, {
attrs,
slots,
emit
}) : render2(props, null));
fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
}
} catch (err) {
blockStack.length = 0;
handleError(err, instance, 1);
result = createVNode(Comment);
}
let root = result;
if (fallthroughAttrs && inheritAttrs !== false) {
const keys = Object.keys(fallthroughAttrs);
const { shapeFlag } = root;
if (keys.length) {
if (shapeFlag & 7) {
if (propsOptions && keys.some(isModelListener)) fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
root = cloneVNode(root, fallthroughAttrs, false, true);
}
}
}
if (vnode.dirs) {
root = cloneVNode(root, null, false, true);
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
}
if (vnode.transition) setTransitionHooks(root, vnode.transition);
result = root;
setCurrentRenderingInstance(prev);
return result;
}
function filterSingleRoot(children, recurse = true) {
let singleRoot;
for (let i = 0; i < children.length; i++) {
const child = children[i];
if (isVNode(child)) {
if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
else singleRoot = child;
} else return;
}
return singleRoot;
}
var getFunctionalFallthrough = (attrs) => {
let res;
for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
return res;
};
var filterModelListeners = (attrs, props) => {
const res = {};
for (const key in attrs) if (!isModelListener(key) || !(key.slice(9) in props)) res[key] = attrs[key];
return res;
};
function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
const { props: prevProps, children: prevChildren, component } = prevVNode;
const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
const emits = component.emitsOptions;
if (nextVNode.dirs || nextVNode.transition) return true;
if (optimized && patchFlag >= 0) {
if (patchFlag & 1024) return true;
if (patchFlag & 16) {
if (!prevProps) return !!nextProps;
return hasPropsChanged(prevProps, nextProps, emits);
} else if (patchFlag & 8) {
const dynamicProps = nextVNode.dynamicProps;
for (let i = 0; i < dynamicProps.length; i++) {
const key = dynamicProps[i];
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emits, key)) return true;
}
}
} else {
if (prevChildren || nextChildren) {
if (!nextChildren || !nextChildren.$stable) return true;
}
if (prevProps === nextProps) return false;
if (!prevProps) return !!nextProps;
if (!nextProps) return true;
return hasPropsChanged(prevProps, nextProps, emits);
}
return false;
}
function hasPropsChanged(prevProps, nextProps, emitsOptions) {
const nextKeys = Object.keys(nextProps);
if (nextKeys.length !== Object.keys(prevProps).length) return true;
for (let i = 0; i < nextKeys.length; i++) {
const key = nextKeys[i];
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
}
return false;
}
function hasPropValueChanged(nextProps, prevProps, key) {
const nextProp = nextProps[key];
const prevProp = prevProps[key];
if (key === "style" && isObject$1(nextProp) && isObject$1(prevProp)) return !looseEqual(nextProp, prevProp);
return nextProp !== prevProp;
}
function updateHOCHostEl({ vnode, parent, suspense }, el) {
while (parent) {
const root = parent.subTree;
if (root.suspense && root.suspense.activeBranch === vnode) {
root.suspense.vnode.el = root.el = el;
vnode = root;
}
if (root === vnode) {
(vnode = parent.vnode).el = el;
parent = parent.parent;
} else break;
}
if (suspense && suspense.activeBranch === vnode) suspense.vnode.el = el;
}
var internalObjectProto = {};
var createInternalObject = () => Object.create(internalObjectProto);
var isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
function initProps(instance, rawProps, isStateful, isSSR = false) {
const props = {};
const attrs = createInternalObject();
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
setFullProps(instance, rawProps, props, attrs);
for (const key in instance.propsOptions[0]) if (!(key in props)) props[key] = void 0;
if (isStateful) instance.props = isSSR ? props : /* @__PURE__ */ shallowReactive(props);
else if (!instance.type.props) instance.props = attrs;
else instance.props = props;
instance.attrs = attrs;
}
function updateProps(instance, rawProps, rawPrevProps, optimized) {
const { props, attrs, vnode: { patchFlag } } = instance;
const rawCurrentProps = /* @__PURE__ */ toRaw(props);
const [options] = instance.propsOptions;
let hasAttrsChanged = false;
if ((optimized || patchFlag > 0) && !(patchFlag & 16)) {
if (patchFlag & 8) {
const propsToUpdate = instance.vnode.dynamicProps;
for (let i = 0; i < propsToUpdate.length; i++) {
let key = propsToUpdate[i];
if (isEmitListener(instance.emitsOptions, key)) continue;
const value = rawProps[key];
if (options) if (hasOwn(attrs, key)) {
if (value !== attrs[key]) {
attrs[key] = value;
hasAttrsChanged = true;
}
} else {
const camelizedKey = camelize$1(key);
props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false);
}
else if (value !== attrs[key]) {
attrs[key] = value;
hasAttrsChanged = true;
}
}
}
} else {
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
let kebabKey;
for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate$1(key)) === key || !hasOwn(rawProps, kebabKey))) if (options) {
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, rawCurrentProps, key, void 0, instance, true);
} else delete props[key];
if (attrs !== rawCurrentProps) {
for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
delete attrs[key];
hasAttrsChanged = true;
}
}
}
if (hasAttrsChanged) trigger(instance.attrs, "set", "");
}
function setFullProps(instance, rawProps, props, attrs) {
const [options, needCastKeys] = instance.propsOptions;
let hasAttrsChanged = false;
let rawCastValues;
if (rawProps) for (let key in rawProps) {
if (isReservedProp(key)) continue;
const value = rawProps[key];
let camelKey;
if (options && hasOwn(options, camelKey = camelize$1(key))) if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
else if (!isEmitListener(instance.emitsOptions, key)) {
if (!(key in attrs) || value !== attrs[key]) {
attrs[key] = value;
hasAttrsChanged = true;
}
}
}
if (needCastKeys) {
const rawCurrentProps = /* @__PURE__ */ toRaw(props);
const castValues = rawCastValues || EMPTY_OBJ;
for (let i = 0; i < needCastKeys.length; i++) {
const key = needCastKeys[i];
props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn(castValues, key));
}
}
return hasAttrsChanged;
}
function resolvePropValue(options, props, key, value, instance, isAbsent) {
const opt = options[key];
if (opt != null) {
const hasDefault = hasOwn(opt, "default");
if (hasDefault && value === void 0) {
const defaultValue = opt.default;
if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
const { propsDefaults } = instance;
if (key in propsDefaults) value = propsDefaults[key];
else {
const reset = setCurrentInstance(instance);
value = propsDefaults[key] = defaultValue.call(null, props);
reset();
}
} else value = defaultValue;
if (instance.ce) instance.ce._setProp(key, value);
}
if (opt[0]) {
if (isAbsent && !hasDefault) value = false;
else if (opt[1] && (value === "" || value === hyphenate$1(key))) value = true;
}
}
return value;
}
var mixinPropsCache = /* @__PURE__ */ new WeakMap();
function normalizePropsOptions(comp, appContext, asMixin = false) {
const cache = asMixin ? mixinPropsCache : appContext.propsCache;
const cached = cache.get(comp);
if (cached) return cached;
const raw = comp.props;
const normalized = {};
const needCastKeys = [];
let hasExtends = false;
if (!isFunction(comp)) {
const extendProps = (raw2) => {
hasExtends = true;
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
extend(normalized, props);
if (keys) needCastKeys.push(...keys);
};
if (!asMixin && appContext.mixins.length) appContext.mixins.forEach(extendProps);
if (comp.extends) extendProps(comp.extends);
if (comp.mixins) comp.mixins.forEach(extendProps);
}
if (!raw && !hasExtends) {
if (isObject$1(comp)) cache.set(comp, EMPTY_ARR);
return EMPTY_ARR;
}
if (isArray$1(raw)) for (let i = 0; i < raw.length; i++) {
const normalizedKey = camelize$1(raw[i]);
if (validatePropName(normalizedKey)) normalized[normalizedKey] = EMPTY_OBJ;
}
else if (raw) for (const key in raw) {
const normalizedKey = camelize$1(key);
if (validatePropName(normalizedKey)) {
const opt = raw[key];
const prop = normalized[normalizedKey] = isArray$1(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
const propType = prop.type;
let shouldCast = false;
let shouldCastTrue = true;
if (isArray$1(propType)) for (let index = 0; index < propType.length; ++index) {
const type = propType[index];
const typeName = isFunction(type) && type.name;
if (typeName === "Boolean") {
shouldCast = true;
break;
} else if (typeName === "String") shouldCastTrue = false;
}
else shouldCast = isFunction(propType) && propType.name === "Boolean";
prop[0] = shouldCast;
prop[1] = shouldCastTrue;
if (shouldCast || hasOwn(prop, "default")) needCastKeys.push(normalizedKey);
}
}
const res = [normalized, needCastKeys];
if (isObject$1(comp)) cache.set(comp, res);
return res;
}
function validatePropName(key) {
if (key[0] !== "$" && !isReservedProp(key)) return true;
return false;
}
var isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
var normalizeSlotValue = (value) => isArray$1(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
var normalizeSlot$1 = (key, rawSlot, ctx) => {
if (rawSlot._n) return rawSlot;
const normalized = withCtx((...args) => {
return normalizeSlotValue(rawSlot(...args));
}, ctx);
normalized._c = false;
return normalized;
};
var normalizeObjectSlots = (rawSlots, slots, instance) => {
const ctx = rawSlots._ctx;
for (const key in rawSlots) {
if (isInternalKey(key)) continue;
const value = rawSlots[key];
if (isFunction(value)) slots[key] = normalizeSlot$1(key, value, ctx);
else if (value != null) {
const normalized = normalizeSlotValue(value);
slots[key] = () => normalized;
}
}
};
var normalizeVNodeSlots = (instance, children) => {
const normalized = normalizeSlotValue(children);
instance.slots.default = () => normalized;
};
var assignSlots = (slots, children, optimized) => {
for (const key in children) if (optimized || !isInternalKey(key)) slots[key] = children[key];
};
var initSlots = (instance, children, optimized) => {
const slots = instance.slots = createInternalObject();
if (instance.vnode.shapeFlag & 32) {
const type = children._;
if (type) {
assignSlots(slots, children, optimized);
if (optimized) def(slots, "_", type, true);
} else normalizeObjectSlots(children, slots);
} else if (children) normalizeVNodeSlots(instance, children);
};
var updateSlots = (instance, children, optimized) => {
const { vnode, slots } = instance;
let needDeletionCheck = true;
let deletionComparisonTarget = EMPTY_OBJ;
if (vnode.shapeFlag & 32) {
const type = children._;
if (type) if (optimized && type === 1) needDeletionCheck = false;
else assignSlots(slots, children, optimized);
else {
needDeletionCheck = !children.$stable;
normalizeObjectSlots(children, slots);
}
deletionComparisonTarget = children;
} else if (children) {
normalizeVNodeSlots(instance, children);
deletionComparisonTarget = { default: 1 };
}
if (needDeletionCheck) {
for (const key in slots) if (!isInternalKey(key) && deletionComparisonTarget[key] == null) delete slots[key];
}
};
var queuePostRenderEffect = queueEffectWithSuspense;
function createRenderer(options) {
return baseCreateRenderer(options);
}
function baseCreateRenderer(options, createHydrationFns) {
const target = getGlobalThis();
target.__VUE__ = true;
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, insertStaticContent: hostInsertStaticContent } = options;
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
if (n1 === n2) return;
if (n1 && !isSameVNodeType(n1, n2)) {
anchor = getNextHostNode(n1);
unmount(n1, parentComponent, parentSuspense, true);
n1 = null;
}
if (n2.patchFlag === -2) {
optimized = false;
n2.dynamicChildren = null;
}
const { type, ref, shapeFlag } = n2;
switch (type) {
case Text:
processText(n1, n2, container, anchor);
break;
case Comment:
processCommentNode(n1, n2, container, anchor);
break;
case Static:
if (n1 == null) mountStaticNode(n2, container, anchor, namespace);
break;
case Fragment:
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
break;
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
else if (shapeFlag & 64) type.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
else if (shapeFlag & 128) type.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
}
if (ref != null && parentComponent) setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
else if (ref == null && n1 && n1.ref != null) setRef(n1.ref, null, parentSuspense, n1, true);
};
const processText = (n1, n2, container, anchor) => {
if (n1 == null) hostInsert(n2.el = hostCreateText(n2.children), container, anchor);
else {
const el = n2.el = n1.el;
if (n2.children !== n1.children) hostSetText(el, n2.children);
}
};
const processCommentNode = (n1, n2, container, anchor) => {
if (n1 == null) hostInsert(n2.el = hostCreateComment(n2.children || ""), container, anchor);
else n2.el = n1.el;
};
const mountStaticNode = (n2, container, anchor, namespace) => {
[n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, namespace, n2.el, n2.anchor);
};
const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
let next;
while (el && el !== anchor) {
next = hostNextSibling(el);
hostInsert(el, container, nextSibling);
el = next;
}
hostInsert(anchor, container, nextSibling);
};
const removeStaticNode = ({ el, anchor }) => {
let next;
while (el && el !== anchor) {
next = hostNextSibling(el);
hostRemove(el);
el = next;
}
hostRemove(anchor);
};
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
if (n2.type === "svg") namespace = "svg";
else if (n2.type === "math") namespace = "mathml";
if (n1 == null) mountElement(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
else {
const customElement = n1.el && n1.el._isVueCE ? n1.el : null;
try {
if (customElement) customElement._beginPatch();
patchElement(n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
} finally {
if (customElement) customElement._endPatch();
}
}
};
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
let el;
let vnodeHook;
const { props, shapeFlag, transition, dirs } = vnode;
el = vnode.el = hostCreateElement(vnode.type, namespace, props && props.is, props);
if (shapeFlag & 8) hostSetElementText(el, vnode.children);
else if (shapeFlag & 16) mountChildren(vnode.children, el, null, parentComponent, parentSuspense, resolveChildrenNamespace(vnode, namespace), slotScopeIds, optimized);
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
if (props) {
for (const key in props) if (key !== "value" && !isReservedProp(key)) hostPatchProp(el, key, null, props[key], namespace, parentComponent);
if ("value" in props) hostPatchProp(el, "value", null, props.value, namespace);
if (vnodeHook = props.onVnodeBeforeMount) invokeVNodeHook(vnodeHook, parentComponent, vnode);
}
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
const needCallTransitionHooks = needTransition(parentSuspense, transition);
if (needCallTransitionHooks) transition.beforeEnter(el);
hostInsert(el, container, anchor);
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) queuePostRenderEffect(() => {
try {
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
needCallTransitionHooks && transition.enter(el);
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
} finally {}
}, parentSuspense);
};
const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
if (scopeId) hostSetScopeId(el, scopeId);
if (slotScopeIds) for (let i = 0; i < slotScopeIds.length; i++) hostSetScopeId(el, slotScopeIds[i]);
if (parentComponent) {
let subTree = parentComponent.subTree;
if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
const parentVNode = parentComponent.vnode;
setScopeId(el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent);
}
}
};
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
for (let i = start; i < children.length; i++) patch(null, children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
};
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
const el = n2.el = n1.el;
let { patchFlag, dynamicChildren, dirs } = n2;
patchFlag |= n1.patchFlag & 16;
const oldProps = n1.props || EMPTY_OBJ;
const newProps = n2.props || EMPTY_OBJ;
let vnodeHook;
parentComponent && toggleRecurse(parentComponent, false);
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
parentComponent && toggleRecurse(parentComponent, true);
if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) hostSetElementText(el, "");
if (dynamicChildren) patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, resolveChildrenNamespace(n2, namespace), slotScopeIds);
else if (!optimized) patchChildren(n1, n2, el, null, parentComponent, parentSuspense, resolveChildrenNamespace(n2, namespace), slotScopeIds, false);
if (patchFlag > 0) {
if (patchFlag & 16) patchProps(el, oldProps, newProps, parentComponent, namespace);
else {
if (patchFlag & 2) {
if (oldProps.class !== newProps.class) hostPatchProp(el, "class", null, newProps.class, namespace);
}
if (patchFlag & 4) hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
if (patchFlag & 8) {
const propsToUpdate = n2.dynamicProps;
for (let i = 0; i < propsToUpdate.length; i++) {
const key = propsToUpdate[i];
const prev = oldProps[key];
const next = newProps[key];
if (next !== prev || key === "value") hostPatchProp(el, key, prev, next, namespace, parentComponent);
}
}
}
if (patchFlag & 1) {
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
}
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
}, parentSuspense);
};
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
for (let i = 0; i < newChildren.length; i++) {
const oldVNode = oldChildren[i];
const newVNode = newChildren[i];
patch(oldVNode, newVNode, oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
}
};
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
if (oldProps !== newProps) {
if (oldProps !== EMPTY_OBJ) {
for (const key in oldProps) if (!isReservedProp(key) && !(key in newProps)) hostPatchProp(el, key, oldProps[key], null, namespace, parentComponent);
}
for (const key in newProps) {
if (isReservedProp(key)) continue;
const next = newProps[key];
const prev = oldProps[key];
if (next !== prev && key !== "value") hostPatchProp(el, key, prev, next, namespace, parentComponent);
}
if ("value" in newProps) hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
}
};
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
if (n1 == null) {
hostInsert(fragmentStartAnchor, container, anchor);
hostInsert(fragmentEndAnchor, container, anchor);
mountChildren(n2.children || [], container, fragmentEndAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
} else if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, namespace, slotScopeIds);
if (n2.key != null || parentComponent && n2 === parentComponent.subTree) traverseStaticChildren(n1, n2, true);
} else patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
};
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
n2.slotScopeIds = slotScopeIds;
if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
else updateComponent(n1, n2, optimized);
};
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
if (isKeepAlive(initialVNode)) instance.ctx.renderer = internals;
setupComponent(instance, false, optimized);
if (instance.asyncDep) {
parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
if (!initialVNode.el) {
const placeholder = instance.subTree = createVNode(Comment);
processCommentNode(null, placeholder, container, anchor);
initialVNode.placeholder = placeholder.el;
}
} else setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, namespace, optimized);
};
const updateComponent = (n1, n2, optimized) => {
const instance = n2.component = n1.component;
if (shouldUpdateComponent(n1, n2, optimized)) if (instance.asyncDep && !instance.asyncResolved) {
updateComponentPreRender(instance, n2, optimized);
return;
} else {
instance.next = n2;
instance.update();
}
else {
n2.el = n1.el;
instance.vnode = n2;
}
};
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
const componentUpdateFn = () => {
if (!instance.isMounted) {
let vnodeHook;
const { el, props } = initialVNode;
const { bm, m, parent, root, type } = instance;
const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
toggleRecurse(instance, false);
if (bm) invokeArrayFns(bm);
if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) invokeVNodeHook(vnodeHook, parent, initialVNode);
toggleRecurse(instance, true);
if (el && hydrateNode) {
const hydrateSubTree = () => {
instance.subTree = renderComponentRoot(instance);
hydrateNode(el, instance.subTree, instance, parentSuspense, null);
};
if (isAsyncWrapperVNode && type.__asyncHydrate) type.__asyncHydrate(el, instance, hydrateSubTree);
else hydrateSubTree();
} else {
if (root.ce && root.ce._hasShadowRoot()) root.ce._injectChildStyle(type, instance.parent ? instance.parent.type : void 0);
const subTree = instance.subTree = renderComponentRoot(instance);
patch(null, subTree, container, anchor, instance, parentSuspense, namespace);
initialVNode.el = subTree.el;
}
if (m) queuePostRenderEffect(m, parentSuspense);
if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
const scopedInitialVNode = initialVNode;
queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
}
if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) instance.a && queuePostRenderEffect(instance.a, parentSuspense);
instance.isMounted = true;
initialVNode = container = anchor = null;
} else {
let { next, bu, u, parent, vnode } = instance;
{
const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
if (nonHydratedAsyncRoot) {
if (next) {
next.el = vnode.el;
updateComponentPreRender(instance, next, optimized);
}
nonHydratedAsyncRoot.asyncDep.then(() => {
queuePostRenderEffect(() => {
if (!instance.isUnmounted) update();
}, parentSuspense);
});
return;
}
}
let originNext = next;
let vnodeHook;
toggleRecurse(instance, false);
if (next) {
next.el = vnode.el;
updateComponentPreRender(instance, next, optimized);
} else next = vnode;
if (bu) invokeArrayFns(bu);
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
toggleRecurse(instance, true);
const nextTree = renderComponentRoot(instance);
const prevTree = instance.subTree;
instance.subTree = nextTree;
patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
next.el = nextTree.el;
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
if (u) queuePostRenderEffect(u, parentSuspense);
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
}
};
instance.scope.on();
const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
instance.scope.off();
const update = instance.update = effect.run.bind(effect);
const job = instance.job = effect.runIfDirty.bind(effect);
job.i = instance;
job.id = instance.uid;
effect.scheduler = () => queueJob(job);
toggleRecurse(instance, true);
update();
};
const updateComponentPreRender = (instance, nextVNode, optimized) => {
nextVNode.component = instance;
const prevProps = instance.vnode.props;
instance.vnode = nextVNode;
instance.next = null;
updateProps(instance, nextVNode.props, prevProps, optimized);
updateSlots(instance, nextVNode.children, optimized);
pauseTracking();
flushPreFlushCbs(instance);
resetTracking();
};
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
const c1 = n1 && n1.children;
const prevShapeFlag = n1 ? n1.shapeFlag : 0;
const c2 = n2.children;
const { patchFlag, shapeFlag } = n2;
if (patchFlag > 0) {
if (patchFlag & 128) {
patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
return;
} else if (patchFlag & 256) {
patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
return;
}
}
if (shapeFlag & 8) {
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
if (c2 !== c1) hostSetElementText(container, c2);
} else if (prevShapeFlag & 16) if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
else unmountChildren(c1, parentComponent, parentSuspense, true);
else {
if (prevShapeFlag & 8) hostSetElementText(container, "");
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
}
};
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
c1 = c1 || EMPTY_ARR;
c2 = c2 || EMPTY_ARR;
const oldLength = c1.length;
const newLength = c2.length;
const commonLength = Math.min(oldLength, newLength);
let i;
for (i = 0; i < commonLength; i++) {
const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
}
if (oldLength > newLength) unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength);
else mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, commonLength);
};
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
let i = 0;
const l2 = c2.length;
let e1 = c1.length - 1;
let e2 = l2 - 1;
while (i <= e1 && i <= e2) {
const n1 = c1[i];
const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
if (isSameVNodeType(n1, n2)) patch(n1, n2, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
else break;
i++;
}
while (i <= e1 && i <= e2) {
const n1 = c1[e1];
const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
if (isSameVNodeType(n1, n2)) patch(n1, n2, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
else break;
e1--;
e2--;
}
if (i > e1) {
if (i <= e2) {
const nextPos = e2 + 1;
const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
while (i <= e2) {
patch(null, c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
i++;
}
}
} else if (i > e2) while (i <= e1) {
unmount(c1[i], parentComponent, parentSuspense, true);
i++;
}
else {
const s1 = i;
const s2 = i;
const keyToNewIndexMap = /* @__PURE__ */ new Map();
for (i = s2; i <= e2; i++) {
const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
if (nextChild.key != null) keyToNewIndexMap.set(nextChild.key, i);
}
let j;
let patched = 0;
const toBePatched = e2 - s2 + 1;
let moved = false;
let maxNewIndexSoFar = 0;
const newIndexToOldIndexMap = new Array(toBePatched);
for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
for (i = s1; i <= e1; i++) {
const prevChild = c1[i];
if (patched >= toBePatched) {
unmount(prevChild, parentComponent, parentSuspense, true);
continue;
}
let newIndex;
if (prevChild.key != null) newIndex = keyToNewIndexMap.get(prevChild.key);
else for (j = s2; j <= e2; j++) if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
newIndex = j;
break;
}
if (newIndex === void 0) unmount(prevChild, parentComponent, parentSuspense, true);
else {
newIndexToOldIndexMap[newIndex - s2] = i + 1;
if (newIndex >= maxNewIndexSoFar) maxNewIndexSoFar = newIndex;
else moved = true;
patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
patched++;
}
}
const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
j = increasingNewIndexSequence.length - 1;
for (i = toBePatched - 1; i >= 0; i--) {
const nextIndex = s2 + i;
const nextChild = c2[nextIndex];
const anchorVNode = c2[nextIndex + 1];
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
else if (moved) if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2);
else j--;
}
}
};
const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
const { el, type, transition, children, shapeFlag } = vnode;
if (shapeFlag & 6) {
move(vnode.component.subTree, container, anchor, moveType);
return;
}
if (shapeFlag & 128) {
vnode.suspense.move(container, anchor, moveType);
return;
}
if (shapeFlag & 64) {
type.move(vnode, container, anchor, internals);
return;
}
if (type === Fragment) {
hostInsert(el, container, anchor);
for (let i = 0; i < children.length; i++) move(children[i], container, anchor, moveType);
hostInsert(vnode.anchor, container, anchor);
return;
}
if (type === Static) {
moveStaticNode(vnode, container, anchor);
return;
}
if (moveType !== 2 && shapeFlag & 1 && transition) if (moveType === 0) if (transition.persisted && !el[leaveCbKey]) hostInsert(el, container, anchor);
else {
transition.beforeEnter(el);
hostInsert(el, container, anchor);
queuePostRenderEffect(() => transition.enter(el), parentSuspense);
}
else {
const { leave, delayLeave, afterLeave } = transition;
const remove2 = () => {
if (vnode.ctx.isUnmounted) hostRemove(el);
else hostInsert(el, container, anchor);
};
const performLeave = () => {
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
if (el._isLeaving) el[leaveCbKey](true);
if (transition.persisted && !wasLeaving) remove2();
else leave(el, () => {
remove2();
afterLeave && afterLeave();
});
};
if (delayLeave) delayLeave(el, remove2, performLeave);
else performLeave();
}
else hostInsert(el, container, anchor);
};
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
if (patchFlag === -2) optimized = false;
if (ref != null) {
pauseTracking();
setRef(ref, null, parentSuspense, vnode, true);
resetTracking();
}
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
if (shapeFlag & 256) {
parentComponent.ctx.deactivate(vnode);
return;
}
const shouldInvokeDirs = shapeFlag & 1 && dirs;
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
let vnodeHook;
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
else {
if (shapeFlag & 128) {
vnode.suspense.unmount(parentSuspense, doRemove);
return;
}
if (shouldInvokeDirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
if (shapeFlag & 64) vnode.type.remove(vnode, parentComponent, parentSuspense, internals, doRemove);
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
if (doRemove) remove(vnode);
}
const shouldInvalidateMemo = memo != null && cacheIndex == null;
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) queuePostRenderEffect(() => {
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
if (shouldInvalidateMemo) vnode.el = null;
}, parentSuspense);
};
const remove = (vnode) => {
const { type, el, anchor, transition } = vnode;
if (type === Fragment) {
removeFragment(el, anchor);
return;
}
if (type === Static) {
removeStaticNode(vnode);
return;
}
const performRemove = () => {
hostRemove(el);
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
};
if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
const { leave, delayLeave } = transition;
const performLeave = () => leave(el, performRemove);
if (delayLeave) delayLeave(vnode.el, performRemove, performLeave);
else performLeave();
} else performRemove();
};
const removeFragment = (cur, end) => {
let next;
while (cur !== end) {
next = hostNextSibling(cur);
hostRemove(cur);
cur = next;
}
hostRemove(end);
};
const unmountComponent = (instance, parentSuspense, doRemove) => {
const { bum, scope, job, subTree, um, m, a } = instance;
invalidateMount(m);
invalidateMount(a);
if (bum) invokeArrayFns(bum);
scope.stop();
if (job) {
job.flags |= 8;
unmount(subTree, instance, parentSuspense, doRemove);
}
if (um) queuePostRenderEffect(um, parentSuspense);
queuePostRenderEffect(() => {
instance.isUnmounted = true;
}, parentSuspense);
};
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
for (let i = start; i < children.length; i++) unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
};
const getNextHostNode = (vnode) => {
if (vnode.shapeFlag & 6) return getNextHostNode(vnode.component.subTree);
if (vnode.shapeFlag & 128) return vnode.suspense.next();
const el = hostNextSibling(vnode.anchor || vnode.el);
const teleportEnd = el && el[TeleportEndKey];
return teleportEnd ? hostNextSibling(teleportEnd) : el;
};
let isFlushing = false;
const render = (vnode, container, namespace) => {
let instance;
if (vnode == null) {
if (container._vnode) {
unmount(container._vnode, null, null, true);
instance = container._vnode.component;
}
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
container._vnode = vnode;
if (!isFlushing) {
isFlushing = true;
flushPreFlushCbs(instance);
flushPostFlushCbs();
isFlushing = false;
}
};
const internals = {
p: patch,
um: unmount,
m: move,
r: remove,
mt: mountComponent,
mc: mountChildren,
pc: patchChildren,
pbc: patchBlockChildren,
n: getNextHostNode,
o: options
};
let hydrate;
let hydrateNode;
if (createHydrationFns) [hydrate, hydrateNode] = createHydrationFns(internals);
return {
render,
hydrate,
createApp: createAppAPI(render, hydrate)
};
}
function resolveChildrenNamespace({ type, props }, currentNamespace) {
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
}
function toggleRecurse({ effect, job }, allowed) {
if (allowed) {
effect.flags |= 32;
job.flags |= 4;
} else {
effect.flags &= -33;
job.flags &= -5;
}
}
function needTransition(parentSuspense, transition) {
return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
}
function traverseStaticChildren(n1, n2, shallow = false) {
const ch1 = n1.children;
const ch2 = n2.children;
if (isArray$1(ch1) && isArray$1(ch2)) for (let i = 0; i < ch1.length; i++) {
const c1 = ch1[i];
let c2 = ch2[i];
if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
c2 = ch2[i] = cloneIfMounted(ch2[i]);
c2.el = c1.el;
}
if (!shallow && c2.patchFlag !== -2) traverseStaticChildren(c1, c2);
}
if (c2.type === Text) {
if (c2.patchFlag === -1) c2 = ch2[i] = cloneIfMounted(c2);
c2.el = c1.el;
}
if (c2.type === Comment && !c2.el) c2.el = c1.el;
}
}
function getSequence(arr) {
const p = arr.slice();
const result = [0];
let i, j, u, v, c;
const len = arr.length;
for (i = 0; i < len; i++) {
const arrI = arr[i];
if (arrI !== 0) {
j = result[result.length - 1];
if (arr[j] < arrI) {
p[i] = j;
result.push(i);
continue;
}
u = 0;
v = result.length - 1;
while (u < v) {
c = u + v >> 1;
if (arr[result[c]] < arrI) u = c + 1;
else v = c;
}
if (arrI < arr[result[u]]) {
if (u > 0) p[i] = result[u - 1];
result[u] = i;
}
}
}
u = result.length;
v = result[u - 1];
while (u-- > 0) {
result[u] = v;
v = p[v];
}
return result;
}
function locateNonHydratedAsyncRoot(instance) {
const subComponent = instance.subTree.component;
if (subComponent) if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
else return locateNonHydratedAsyncRoot(subComponent);
}
function invalidateMount(hooks) {
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 8;
}
function resolveAsyncComponentPlaceholder(anchorVnode) {
if (anchorVnode.placeholder) return anchorVnode.placeholder;
const instance = anchorVnode.component;
if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
return null;
}
var isSuspense = (type) => type.__isSuspense;
var suspenseId = 0;
var Suspense = {
name: "Suspense",
__isSuspense: true,
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
else {
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
n2.suspense = n1.suspense;
n2.suspense.vnode = n2;
n2.el = n1.el;
return;
}
patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
}
},
hydrate: hydrateSuspense,
normalize: normalizeSuspenseChildren
};
function triggerEvent(vnode, name) {
const eventListener = vnode.props && vnode.props[name];
if (isFunction(eventListener)) eventListener();
}
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
const { p: patch, o: { createElement } } = rendererInternals;
const hiddenContainer = createElement("div");
const suspense = vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals);
patch(null, suspense.pendingBranch = vnode.ssContent, hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds);
if (suspense.deps > 0) {
triggerEvent(vnode, "onPending");
triggerEvent(vnode, "onFallback");
patch(null, vnode.ssFallback, container, anchor, parentComponent, null, namespace, slotScopeIds);
setActiveBranch(suspense, vnode.ssFallback);
} else suspense.resolve(false, true);
}
function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
const suspense = n2.suspense = n1.suspense;
suspense.vnode = n2;
n2.el = n1.el;
const newBranch = n2.ssContent;
const newFallback = n2.ssFallback;
const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
if (pendingBranch) {
suspense.pendingBranch = newBranch;
if (isSameVNodeType(pendingBranch, newBranch)) {
patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
if (suspense.deps <= 0) suspense.resolve();
else if (isInFallback) {
if (!isHydrating) {
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
setActiveBranch(suspense, newFallback);
}
}
} else {
suspense.pendingId = suspenseId++;
if (isHydrating) {
suspense.isHydrating = false;
suspense.activeBranch = pendingBranch;
} else unmount(pendingBranch, parentComponent, suspense);
suspense.deps = 0;
suspense.effects.length = 0;
suspense.hiddenContainer = createElement("div");
if (isInFallback) {
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
if (suspense.deps <= 0) suspense.resolve();
else {
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
setActiveBranch(suspense, newFallback);
}
} else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, namespace, slotScopeIds, optimized);
suspense.resolve(true);
} else {
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
if (suspense.deps <= 0) suspense.resolve();
}
}
} else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, namespace, slotScopeIds, optimized);
setActiveBranch(suspense, newBranch);
} else {
triggerEvent(n2, "onPending");
suspense.pendingBranch = newBranch;
if (newBranch.shapeFlag & 512) suspense.pendingId = newBranch.component.suspenseId;
else suspense.pendingId = suspenseId++;
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
if (suspense.deps <= 0) suspense.resolve();
else {
const { timeout, pendingId } = suspense;
if (timeout > 0) setTimeout(() => {
if (suspense.pendingId === pendingId) suspense.fallback(newFallback);
}, timeout);
else if (timeout === 0) suspense.fallback(newFallback);
}
}
}
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
let parentSuspenseId;
const isSuspensible = isVNodeSuspensible(vnode);
if (isSuspensible) {
if (parentSuspense && parentSuspense.pendingBranch) {
parentSuspenseId = parentSuspense.pendingId;
parentSuspense.deps++;
}
}
const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
const initialAnchor = anchor;
const suspense = {
vnode,
parent: parentSuspense,
parentComponent,
namespace,
container,
hiddenContainer,
deps: 0,
pendingId: suspenseId++,
timeout: typeof timeout === "number" ? timeout : -1,
activeBranch: null,
isFallbackMountPending: false,
pendingBranch: null,
isInFallback: !isHydrating,
isHydrating,
isUnmounted: false,
effects: [],
resolve(resume = false, sync = false) {
const { vnode: vnode2, activeBranch, pendingBranch, pendingId, effects, parentComponent: parentComponent2, container: container2, isInFallback } = suspense;
let delayEnter = false;
if (suspense.isHydrating) suspense.isHydrating = false;
else if (!resume) {
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
let hasUpdatedAnchor = false;
if (delayEnter) activeBranch.transition.afterLeave = () => {
if (pendingId === suspense.pendingId) {
move(pendingBranch, container2, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0);
queuePostFlushCb(effects);
if (isInFallback && vnode2.ssFallback) vnode2.ssFallback.el = null;
}
};
if (activeBranch && !suspense.isFallbackMountPending) {
if (parentNode(activeBranch.el) === container2) {
anchor = next(activeBranch);
hasUpdatedAnchor = true;
}
unmount(activeBranch, parentComponent2, suspense, true);
if (!delayEnter && isInFallback && vnode2.ssFallback) queuePostRenderEffect(() => vnode2.ssFallback.el = null, suspense);
}
if (!delayEnter) move(pendingBranch, container2, anchor, 0);
}
suspense.isFallbackMountPending = false;
setActiveBranch(suspense, pendingBranch);
suspense.pendingBranch = null;
suspense.isInFallback = false;
let parent = suspense.parent;
let hasUnresolvedAncestor = false;
while (parent) {
if (parent.pendingBranch) {
parent.effects.push(...effects);
hasUnresolvedAncestor = true;
break;
}
parent = parent.parent;
}
if (!hasUnresolvedAncestor && !delayEnter) queuePostFlushCb(effects);
suspense.effects = [];
if (isSuspensible) {
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
parentSuspense.deps--;
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
}
}
triggerEvent(vnode2, "onResolve");
},
fallback(fallbackVNode) {
if (!suspense.pendingBranch) return;
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
triggerEvent(vnode2, "onFallback");
const anchor2 = next(activeBranch);
const mountFallback = () => {
suspense.isFallbackMountPending = false;
if (!suspense.isInFallback) return;
patch(null, fallbackVNode, container2, anchor2, parentComponent2, null, namespace2, slotScopeIds, optimized);
setActiveBranch(suspense, fallbackVNode);
};
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
if (delayEnter) {
suspense.isFallbackMountPending = true;
activeBranch.transition.afterLeave = mountFallback;
}
suspense.isInFallback = true;
unmount(activeBranch, parentComponent2, null, true);
if (!delayEnter) mountFallback();
},
move(container2, anchor2, type) {
suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
suspense.container = container2;
},
next() {
return suspense.activeBranch && next(suspense.activeBranch);
},
registerDep(instance, setupRenderEffect, optimized2) {
const isInPendingSuspense = !!suspense.pendingBranch;
if (isInPendingSuspense) suspense.deps++;
const hydratedEl = instance.vnode.el;
instance.asyncDep.catch((err) => {
handleError(err, instance, 0);
}).then((asyncSetupResult) => {
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
unsetCurrentInstance();
instance.asyncResolved = true;
const { vnode: vnode2 } = instance;
handleSetupResult(instance, asyncSetupResult, false);
if (hydratedEl) vnode2.el = hydratedEl;
const placeholder = !hydratedEl && instance.subTree.el;
setupRenderEffect(instance, vnode2, parentNode(hydratedEl || instance.subTree.el), hydratedEl ? null : next(instance.subTree), suspense, namespace, optimized2);
if (placeholder) {
vnode2.placeholder = null;
remove(placeholder);
}
updateHOCHostEl(instance, vnode2.el);
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
});
},
unmount(parentSuspense2, doRemove) {
suspense.isUnmounted = true;
if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense2, doRemove);
if (suspense.pendingBranch) unmount(suspense.pendingBranch, parentComponent, parentSuspense2, doRemove);
}
};
return suspense;
}
function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
const suspense = vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, node.parentNode, document.createElement("div"), null, namespace, slotScopeIds, optimized, rendererInternals, true);
const result = hydrateNode(node, suspense.pendingBranch = vnode.ssContent, parentComponent, suspense, slotScopeIds, optimized);
if (suspense.deps === 0) suspense.resolve(false, true);
return result;
}
function normalizeSuspenseChildren(vnode) {
const { shapeFlag, children } = vnode;
const isSlotChildren = shapeFlag & 32;
vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children);
vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
}
function normalizeSuspenseSlot(s) {
let block;
if (isFunction(s)) {
const trackBlock = isBlockTreeEnabled && s._c;
if (trackBlock) {
s._d = false;
openBlock();
}
s = s();
if (trackBlock) {
s._d = true;
block = currentBlock;
closeBlock();
}
}
if (isArray$1(s)) s = filterSingleRoot(s);
s = normalizeVNode(s);
if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
return s;
}
function queueEffectWithSuspense(fn, suspense) {
if (suspense && suspense.pendingBranch) if (isArray$1(fn)) suspense.effects.push(...fn);
else suspense.effects.push(fn);
else queuePostFlushCb(fn);
}
function setActiveBranch(suspense, branch) {
suspense.activeBranch = branch;
const { vnode, parentComponent } = suspense;
let el = branch.el;
while (!el && branch.component) {
branch = branch.component.subTree;
el = branch.el;
}
vnode.el = el;
if (parentComponent && parentComponent.subTree === vnode) {
parentComponent.vnode.el = el;
updateHOCHostEl(parentComponent, el);
}
}
function isVNodeSuspensible(vnode) {
const suspensible = vnode.props && vnode.props.suspensible;
return suspensible != null && suspensible !== false;
}
var Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
var Text = /* @__PURE__ */ Symbol.for("v-txt");
var Comment = /* @__PURE__ */ Symbol.for("v-cmt");
var Static = /* @__PURE__ */ Symbol.for("v-stc");
var blockStack = [];
var currentBlock = null;
function openBlock(disableTracking = false) {
blockStack.push(currentBlock = disableTracking ? null : []);
}
function closeBlock() {
blockStack.pop();
currentBlock = blockStack[blockStack.length - 1] || null;
}
var isBlockTreeEnabled = 1;
function setBlockTracking(value, inVOnce = false) {
isBlockTreeEnabled += value;
if (value < 0 && currentBlock && inVOnce) currentBlock.hasOnce = true;
}
function setupBlock(vnode) {
vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
closeBlock();
if (isBlockTreeEnabled > 0 && currentBlock) currentBlock.push(vnode);
return vnode;
}
function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true));
}
function createBlock(type, props, children, patchFlag, dynamicProps) {
return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true));
}
function isVNode(value) {
return value ? value.__v_isVNode === true : false;
}
function isSameVNodeType(n1, n2) {
return n1.type === n2.type && n1.key === n2.key;
}
var normalizeKey = ({ key }) => key != null ? key : null;
var normalizeRef = ({ ref, ref_key, ref_for }) => {
if (typeof ref === "number") ref = "" + ref;
return ref != null ? isString(ref) || /* @__PURE__ */ isRef(ref) || isFunction(ref) ? {
i: currentRenderingInstance,
r: ref,
k: ref_key,
f: !!ref_for
} : ref : null;
};
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
const vnode = {
__v_isVNode: true,
__v_skip: true,
type,
props,
key: props && normalizeKey(props),
ref: props && normalizeRef(props),
scopeId: currentScopeId,
slotScopeIds: null,
children,
component: null,
suspense: null,
ssContent: null,
ssFallback: null,
dirs: null,
transition: null,
el: null,
anchor: null,
target: null,
targetStart: null,
targetAnchor: null,
staticCount: 0,
shapeFlag,
patchFlag,
dynamicProps,
dynamicChildren: null,
appContext: null,
ctx: currentRenderingInstance
};
if (needFullChildrenNormalization) {
normalizeChildren(vnode, children);
if (shapeFlag & 128) type.normalize(vnode);
} else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
return vnode;
}
var createVNode = _createVNode;
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
if (!type || type === NULL_DYNAMIC_COMPONENT) type = Comment;
if (isVNode(type)) {
const cloned = cloneVNode(type, props, true);
if (children) normalizeChildren(cloned, children);
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
else currentBlock.push(cloned);
cloned.patchFlag = -2;
return cloned;
}
if (isClassComponent(type)) type = type.__vccOpts;
if (props) {
props = guardReactiveProps(props);
let { class: klass, style } = props;
if (klass && !isString(klass)) props.class = normalizeClass(klass);
if (isObject$1(style)) {
if (/* @__PURE__ */ isProxy(style) && !isArray$1(style)) style = extend({}, style);
props.style = normalizeStyle(style);
}
}
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$1(type) ? 4 : isFunction(type) ? 2 : 0;
return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true);
}
function guardReactiveProps(props) {
if (!props) return null;
return /* @__PURE__ */ isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
}
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
const { props, ref, patchFlag, children, transition } = vnode;
const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
const cloned = {
__v_isVNode: true,
__v_skip: true,
type: vnode.type,
props: mergedProps,
key: mergedProps && normalizeKey(mergedProps),
ref: extraProps && extraProps.ref ? mergeRef && ref ? isArray$1(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref,
scopeId: vnode.scopeId,
slotScopeIds: vnode.slotScopeIds,
children,
target: vnode.target,
targetStart: vnode.targetStart,
targetAnchor: vnode.targetAnchor,
staticCount: vnode.staticCount,
shapeFlag: vnode.shapeFlag,
patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
dynamicProps: vnode.dynamicProps,
dynamicChildren: vnode.dynamicChildren,
appContext: vnode.appContext,
dirs: vnode.dirs,
transition,
component: vnode.component,
suspense: vnode.suspense,
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
placeholder: vnode.placeholder,
el: vnode.el,
anchor: vnode.anchor,
ctx: vnode.ctx,
ce: vnode.ce
};
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
return cloned;
}
function createTextVNode(text = " ", flag = 0) {
return createVNode(Text, null, text, flag);
}
function createCommentVNode(text = "", asBlock = false) {
return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
}
function normalizeVNode(child) {
if (child == null || typeof child === "boolean") return createVNode(Comment);
else if (isArray$1(child)) return createVNode(Fragment, null, child.slice());
else if (isVNode(child)) return cloneIfMounted(child);
else return createVNode(Text, null, String(child));
}
function cloneIfMounted(child) {
return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
}
function normalizeChildren(vnode, children) {
let type = 0;
const { shapeFlag } = vnode;
if (children == null) children = null;
else if (isArray$1(children)) type = 16;
else if (typeof children === "object") if (shapeFlag & 65) {
const slot = children.default;
if (slot) {
slot._c && (slot._d = false);
normalizeChildren(vnode, slot());
slot._c && (slot._d = true);
}
return;
} else {
type = 32;
const slotFlag = children._;
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
else if (slotFlag === 3 && currentRenderingInstance) if (currentRenderingInstance.slots._ === 1) children._ = 1;
else {
children._ = 2;
vnode.patchFlag |= 1024;
}
}
else if (isFunction(children)) {
children = {
default: children,
_ctx: currentRenderingInstance
};
type = 32;
} else {
children = String(children);
if (shapeFlag & 64) {
type = 16;
children = [createTextVNode(children)];
} else type = 8;
}
vnode.children = children;
vnode.shapeFlag |= type;
}
function mergeProps(...args) {
const ret = {};
for (let i = 0; i < args.length; i++) {
const toMerge = args[i];
for (const key in toMerge) if (key === "class") {
if (ret.class !== toMerge.class) ret.class = normalizeClass([ret.class, toMerge.class]);
} else if (key === "style") ret.style = normalizeStyle([ret.style, toMerge.style]);
else if (isOn(key)) {
const existing = ret[key];
const incoming = toMerge[key];
if (incoming && existing !== incoming && !(isArray$1(existing) && existing.includes(incoming))) ret[key] = existing ? [].concat(existing, incoming) : incoming;
else if (incoming == null && existing == null && !isModelListener(key)) ret[key] = incoming;
} else if (key !== "") ret[key] = toMerge[key];
}
return ret;
}
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
callWithAsyncErrorHandling(hook, instance, 7, [vnode, prevVNode]);
}
var emptyAppContext = createAppContext();
var uid = 0;
function createComponentInstance(vnode, parent, suspense) {
const type = vnode.type;
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
const instance = {
uid: uid++,
vnode,
type,
parent,
appContext,
root: null,
next: null,
subTree: null,
effect: null,
update: null,
job: null,
scope: new EffectScope(true),
render: null,
proxy: null,
exposed: null,
exposeProxy: null,
withProxy: null,
provides: parent ? parent.provides : Object.create(appContext.provides),
ids: parent ? parent.ids : [
"",
0,
0
],
accessCache: null,
renderCache: [],
components: null,
directives: null,
propsOptions: normalizePropsOptions(type, appContext),
emitsOptions: normalizeEmitsOptions(type, appContext),
emit: null,
emitted: null,
propsDefaults: EMPTY_OBJ,
inheritAttrs: type.inheritAttrs,
ctx: EMPTY_OBJ,
data: EMPTY_OBJ,
props: EMPTY_OBJ,
attrs: EMPTY_OBJ,
slots: EMPTY_OBJ,
refs: EMPTY_OBJ,
setupState: EMPTY_OBJ,
setupContext: null,
suspense,
suspenseId: suspense ? suspense.pendingId : 0,
asyncDep: null,
asyncResolved: false,
isMounted: false,
isUnmounted: false,
isDeactivated: false,
bc: null,
c: null,
bm: null,
m: null,
bu: null,
u: null,
um: null,
bum: null,
da: null,
a: null,
rtg: null,
rtc: null,
ec: null,
sp: null
};
instance.ctx = { _: instance };
instance.root = parent ? parent.root : instance;
instance.emit = emit.bind(null, instance);
if (vnode.ce) vnode.ce(instance);
return instance;
}
var currentInstance = null;
var getCurrentInstance = () => currentInstance || currentRenderingInstance;
var internalSetCurrentInstance;
var setInSSRSetupState;
{
const g = getGlobalThis();
const registerGlobalSetter = (key, setter) => {
let setters;
if (!(setters = g[key])) setters = g[key] = [];
setters.push(setter);
return (v) => {
if (setters.length > 1) setters.forEach((set) => set(v));
else setters[0](v);
};
};
internalSetCurrentInstance = registerGlobalSetter(`__VUE_INSTANCE_SETTERS__`, (v) => currentInstance = v);
setInSSRSetupState = registerGlobalSetter(`__VUE_SSR_SETTERS__`, (v) => isInSSRComponentSetup = v);
}
var setCurrentInstance = (instance) => {
const prev = currentInstance;
internalSetCurrentInstance(instance);
instance.scope.on();
return () => {
instance.scope.off();
internalSetCurrentInstance(prev);
};
};
var unsetCurrentInstance = () => {
currentInstance && currentInstance.scope.off();
internalSetCurrentInstance(null);
};
function isStatefulComponent(instance) {
return instance.vnode.shapeFlag & 4;
}
var isInSSRComponentSetup = false;
function setupComponent(instance, isSSR = false, optimized = false) {
isSSR && setInSSRSetupState(isSSR);
const { props, children } = instance.vnode;
const isStateful = isStatefulComponent(instance);
initProps(instance, props, isStateful, isSSR);
initSlots(instance, children, optimized || isSSR);
const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
isSSR && setInSSRSetupState(false);
return setupResult;
}
function setupStatefulComponent(instance, isSSR) {
const Component = instance.type;
instance.accessCache = /* @__PURE__ */ Object.create(null);
instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
const { setup } = Component;
if (setup) {
pauseTracking();
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
const reset = setCurrentInstance(instance);
const setupResult = callWithErrorHandling(setup, instance, 0, [instance.props, setupContext]);
const isAsyncSetup = isPromise(setupResult);
resetTracking();
reset();
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
if (isAsyncSetup) {
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
if (isSSR) return setupResult.then((resolvedResult) => {
handleSetupResult(instance, resolvedResult, isSSR);
}).catch((e) => {
handleError(e, instance, 0);
});
else instance.asyncDep = setupResult;
} else handleSetupResult(instance, setupResult, isSSR);
} else finishComponentSetup(instance, isSSR);
}
function handleSetupResult(instance, setupResult, isSSR) {
if (isFunction(setupResult)) if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
else instance.render = setupResult;
else if (isObject$1(setupResult)) instance.setupState = proxyRefs(setupResult);
finishComponentSetup(instance, isSSR);
}
var compile;
var installWithProxy;
function finishComponentSetup(instance, isSSR, skipOptions) {
const Component = instance.type;
if (!instance.render) {
if (!isSSR && compile && !Component.render) {
const template = Component.template || resolveMergedOptions(instance).template;
if (template) {
const { isCustomElement, compilerOptions } = instance.appContext.config;
const { delimiters, compilerOptions: componentCompilerOptions } = Component;
Component.render = compile(template, extend(extend({
isCustomElement,
delimiters
}, compilerOptions), componentCompilerOptions));
}
}
instance.render = Component.render || NOOP;
if (installWithProxy) installWithProxy(instance);
}
{
const reset = setCurrentInstance(instance);
pauseTracking();
try {
applyOptions(instance);
} finally {
resetTracking();
reset();
}
}
}
var attrsProxyHandlers = { get(target, key) {
track(target, "get", "");
return target[key];
} };
function createSetupContext(instance) {
const expose = (exposed) => {
instance.exposed = exposed || {};
};
return {
attrs: new Proxy(instance.attrs, attrsProxyHandlers),
slots: instance.slots,
emit: instance.emit,
expose
};
}
function getComponentPublicInstance(instance) {
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
get(target, key) {
if (key in target) return target[key];
else if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
},
has(target, key) {
return key in target || key in publicPropertiesMap;
}
}));
else return instance.proxy;
}
function getComponentName(Component, includeInferred = true) {
return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
}
function isClassComponent(value) {
return isFunction(value) && "__vccOpts" in value;
}
var computed = (getterOrOptions, debugOptions) => {
return /* @__PURE__ */ computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
};
function h(type, propsOrChildren, children) {
try {
setBlockTracking(-1);
const l = arguments.length;
if (l === 2) if (isObject$1(propsOrChildren) && !isArray$1(propsOrChildren)) {
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
return createVNode(type, propsOrChildren);
} else return createVNode(type, null, propsOrChildren);
else {
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
else if (l === 3 && isVNode(children)) children = [children];
return createVNode(type, propsOrChildren, children);
}
} finally {
setBlockTracking(1);
}
}
var version = "3.5.35";
var warn = NOOP;
//#endregion
//#region node_modules/.pnpm/@vue+runtime-dom@3.5.35/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
/**
* @vue/runtime-dom v3.5.35
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
var policy = void 0;
var tt = typeof window !== "undefined" && window.trustedTypes;
if (tt) try {
policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val });
} catch (e) {}
var unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
var svgNS = "http://www.w3.org/2000/svg";
var mathmlNS = "http://www.w3.org/1998/Math/MathML";
var doc = typeof document !== "undefined" ? document : null;
var templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
var nodeOps = {
insert: (child, parent, anchor) => {
parent.insertBefore(child, anchor || null);
},
remove: (child) => {
const parent = child.parentNode;
if (parent) parent.removeChild(child);
},
createElement: (tag, namespace, is, props) => {
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
if (tag === "select" && props && props.multiple != null) el.setAttribute("multiple", props.multiple);
return el;
},
createText: (text) => doc.createTextNode(text),
createComment: (text) => doc.createComment(text),
setText: (node, text) => {
node.nodeValue = text;
},
setElementText: (el, text) => {
el.textContent = text;
},
parentNode: (node) => node.parentNode,
nextSibling: (node) => node.nextSibling,
querySelector: (selector) => doc.querySelector(selector),
setScopeId(el, id) {
el.setAttribute(id, "");
},
insertStaticContent(content, parent, anchor, namespace, start, end) {
const before = anchor ? anchor.previousSibling : parent.lastChild;
if (start && (start === end || start.nextSibling)) while (true) {
parent.insertBefore(start.cloneNode(true), anchor);
if (start === end || !(start = start.nextSibling)) break;
}
else {
templateContainer.innerHTML = unsafeToTrustedHTML(namespace === "svg" ? `` : namespace === "mathml" ? `` : content);
const template = templateContainer.content;
if (namespace === "svg" || namespace === "mathml") {
const wrapper = template.firstChild;
while (wrapper.firstChild) template.appendChild(wrapper.firstChild);
template.removeChild(wrapper);
}
parent.insertBefore(template, anchor);
}
return [before ? before.nextSibling : parent.firstChild, anchor ? anchor.previousSibling : parent.lastChild];
}
};
var vtcKey = /* @__PURE__ */ Symbol("_vtc");
function patchClass(el, value, isSVG) {
const transitionClasses = el[vtcKey];
if (transitionClasses) value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
if (value == null) el.removeAttribute("class");
else if (isSVG) el.setAttribute("class", value);
else el.className = value;
}
var vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
var vShowHidden = /* @__PURE__ */ Symbol("_vsh");
var vShow = {
name: "show",
beforeMount(el, { value }, { transition }) {
el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
if (transition && value) transition.beforeEnter(el);
else setDisplay(el, value);
},
mounted(el, { value }, { transition }) {
if (transition && value) transition.enter(el);
},
updated(el, { value, oldValue }, { transition }) {
if (!value === !oldValue) return;
if (transition) if (value) {
transition.beforeEnter(el);
setDisplay(el, true);
transition.enter(el);
} else transition.leave(el, () => {
setDisplay(el, false);
});
else setDisplay(el, value);
},
beforeUnmount(el, { value }) {
setDisplay(el, value);
}
};
function setDisplay(el, value) {
el.style.display = value ? el[vShowOriginalDisplay] : "none";
el[vShowHidden] = !value;
}
var CSS_VAR_TEXT = /* @__PURE__ */ Symbol("");
var displayRE = /(?:^|;)\s*display\s*:/;
function patchStyle(el, prev, next) {
const style = el.style;
const isCssString = isString(next);
let hasControlledDisplay = false;
if (next && !isCssString) {
if (prev) if (!isString(prev)) {
for (const key in prev) if (next[key] == null) setStyle(style, key, "");
} else for (const prevStyle of prev.split(";")) {
const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
if (next[key] == null) setStyle(style, key, "");
}
for (const key in next) {
if (key === "display") hasControlledDisplay = true;
const value = next[key];
if (value != null) {
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
} else setStyle(style, key, "");
}
} else if (isCssString) {
if (prev !== next) {
const cssVarText = style[CSS_VAR_TEXT];
if (cssVarText) next += ";" + cssVarText;
style.cssText = next;
hasControlledDisplay = displayRE.test(next);
}
} else if (prev) el.removeAttribute("style");
if (vShowOriginalDisplay in el) {
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
if (el[vShowHidden]) style.display = "none";
}
}
var importantRE = /\s*!important$/;
function setStyle(style, name, val) {
if (isArray$1(val)) val.forEach((v) => setStyle(style, name, v));
else {
if (val == null) val = "";
if (name.startsWith("--")) style.setProperty(name, val);
else {
const prefixed = autoPrefix(style, name);
if (importantRE.test(val)) style.setProperty(hyphenate$1(prefixed), val.replace(importantRE, ""), "important");
else style[prefixed] = val;
}
}
}
var prefixes = [
"Webkit",
"Moz",
"ms"
];
var prefixCache = {};
function autoPrefix(style, rawName) {
const cached = prefixCache[rawName];
if (cached) return cached;
let name = camelize$1(rawName);
if (name !== "filter" && name in style) return prefixCache[rawName] = name;
name = capitalize(name);
for (let i = 0; i < prefixes.length; i++) {
const prefixed = prefixes[i] + name;
if (prefixed in style) return prefixCache[rawName] = prefixed;
}
return rawName;
}
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
}
var xlinkNS = "http://www.w3.org/1999/xlink";
function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
else el.setAttributeNS(xlinkNS, key, value);
else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
}
function patchDOMProp(el, key, value, parentComponent, attrName) {
if (key === "innerHTML" || key === "textContent") {
if (value != null) el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
return;
}
const tag = el.tagName;
if (key === "value" && tag !== "PROGRESS" && !tag.includes("-")) {
const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
const newValue = value == null ? el.type === "checkbox" ? "on" : "" : String(value);
if (oldValue !== newValue || !("_value" in el)) el.value = newValue;
if (value == null) el.removeAttribute(key);
el._value = value;
return;
}
let needRemove = false;
if (value === "" || value == null) {
const type = typeof el[key];
if (type === "boolean") value = includeBooleanAttr(value);
else if (value == null && type === "string") {
value = "";
needRemove = true;
} else if (type === "number") {
value = 0;
needRemove = true;
}
}
try {
el[key] = value;
} catch (e) {}
needRemove && el.removeAttribute(attrName || key);
}
function addEventListener(el, event, handler, options) {
el.addEventListener(event, handler, options);
}
function removeEventListener(el, event, handler, options) {
el.removeEventListener(event, handler, options);
}
var veiKey = /* @__PURE__ */ Symbol("_vei");
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
const invokers = el[veiKey] || (el[veiKey] = {});
const existingInvoker = invokers[rawName];
if (nextValue && existingInvoker) existingInvoker.value = nextValue;
else {
const [name, options] = parseName(rawName);
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(nextValue, instance), options);
else if (existingInvoker) {
removeEventListener(el, name, existingInvoker, options);
invokers[rawName] = void 0;
}
}
}
var optionsModifierRE = /(?:Once|Passive|Capture)$/;
function parseName(name) {
let options;
if (optionsModifierRE.test(name)) {
options = {};
let m;
while (m = name.match(optionsModifierRE)) {
name = name.slice(0, name.length - m[0].length);
options[m[0].toLowerCase()] = true;
}
}
return [name[2] === ":" ? name.slice(3) : hyphenate$1(name.slice(2)), options];
}
var cachedNow = 0;
var p = /* @__PURE__ */ Promise.resolve();
var getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
function createInvoker(initialValue, instance) {
const invoker = (e) => {
if (!e._vts) e._vts = Date.now();
else if (e._vts <= invoker.attached) return;
const value = invoker.value;
if (isArray$1(value)) {
const originalStop = e.stopImmediatePropagation;
e.stopImmediatePropagation = () => {
originalStop.call(e);
e._stopped = true;
};
const handlers = value.slice();
const args = [e];
for (let i = 0; i < handlers.length; i++) {
if (e._stopped) break;
const handler = handlers[i];
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
}
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
};
invoker.value = initialValue;
invoker.attached = getNow();
return invoker;
}
var isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
var patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
const isSVG = namespace === "svg";
if (key === "class") patchClass(el, nextValue, isSVG);
else if (key === "style") patchStyle(el, prevValue, nextValue);
else if (isOn(key)) {
if (!isModelListener(key)) patchEvent(el, key, prevValue, nextValue, parentComponent);
} else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
patchDOMProp(el, key, nextValue);
if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
} else if (el._isVueCE && (shouldSetAsPropForVueCE(el, key) || el._def.__asyncLoader && (/[A-Z]/.test(key) || !isString(nextValue)))) patchDOMProp(el, camelize$1(key), nextValue, parentComponent, key);
else {
if (key === "true-value") el._trueValue = nextValue;
else if (key === "false-value") el._falseValue = nextValue;
patchAttr(el, key, nextValue, isSVG);
}
};
function shouldSetAsProp(el, key, value, isSVG) {
if (isSVG) {
if (key === "innerHTML" || key === "textContent") return true;
if (key in el && isNativeOn(key) && isFunction(value)) return true;
return false;
}
if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") return false;
if (key === "sandbox" && el.tagName === "IFRAME") return false;
if (key === "form") return false;
if (key === "list" && el.tagName === "INPUT") return false;
if (key === "type" && el.tagName === "TEXTAREA") return false;
if (key === "width" || key === "height") {
const tag = el.tagName;
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") return false;
}
if (isNativeOn(key) && isString(value)) return false;
return key in el;
}
function shouldSetAsPropForVueCE(el, key) {
const props = el._def.props;
if (!props) return false;
const camelKey = camelize$1(key);
return Array.isArray(props) ? props.some((prop) => camelize$1(prop) === camelKey) : Object.keys(props).some((prop) => camelize$1(prop) === camelKey);
}
var getModelAssigner = (vnode) => {
const fn = vnode.props["onUpdate:modelValue"] || false;
return isArray$1(fn) ? (value) => invokeArrayFns(fn, value) : fn;
};
function onCompositionStart(e) {
e.target.composing = true;
}
function onCompositionEnd(e) {
const target = e.target;
if (target.composing) {
target.composing = false;
target.dispatchEvent(new Event("input"));
}
}
var assignKey = /* @__PURE__ */ Symbol("_assign");
function castValue(value, trim, number) {
if (trim) value = value.trim();
if (number) value = looseToNumber(value);
return value;
}
var vModelText = {
created(el, { modifiers: { lazy, trim, number } }, vnode) {
el[assignKey] = getModelAssigner(vnode);
const castToNumber = number || vnode.props && vnode.props.type === "number";
addEventListener(el, lazy ? "change" : "input", (e) => {
if (e.target.composing) return;
el[assignKey](castValue(el.value, trim, castToNumber));
});
if (trim || castToNumber) addEventListener(el, "change", () => {
el.value = castValue(el.value, trim, castToNumber);
});
if (!lazy) {
addEventListener(el, "compositionstart", onCompositionStart);
addEventListener(el, "compositionend", onCompositionEnd);
addEventListener(el, "change", onCompositionEnd);
}
},
mounted(el, { value }) {
el.value = value == null ? "" : value;
},
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
el[assignKey] = getModelAssigner(vnode);
if (el.composing) return;
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
const newValue = value == null ? "" : value;
if (elValue === newValue) return;
const rootNode = el.getRootNode();
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
if (lazy && value === oldValue) return;
if (trim && el.value.trim() === newValue) return;
}
el.value = newValue;
}
};
var vModelCheckbox = {
deep: true,
created(el, _, vnode) {
el[assignKey] = getModelAssigner(vnode);
addEventListener(el, "change", () => {
const modelValue = el._modelValue;
const elementValue = getValue(el);
const checked = el.checked;
const assign = el[assignKey];
if (isArray$1(modelValue)) {
const index = looseIndexOf(modelValue, elementValue);
const found = index !== -1;
if (checked && !found) assign(modelValue.concat(elementValue));
else if (!checked && found) {
const filtered = [...modelValue];
filtered.splice(index, 1);
assign(filtered);
}
} else if (isSet(modelValue)) {
const cloned = new Set(modelValue);
if (checked) cloned.add(elementValue);
else cloned.delete(elementValue);
assign(cloned);
} else assign(getCheckboxValue(el, checked));
});
},
mounted: setChecked,
beforeUpdate(el, binding, vnode) {
el[assignKey] = getModelAssigner(vnode);
setChecked(el, binding, vnode);
}
};
function setChecked(el, { value, oldValue }, vnode) {
el._modelValue = value;
let checked;
if (isArray$1(value)) checked = looseIndexOf(value, vnode.props.value) > -1;
else if (isSet(value)) checked = value.has(vnode.props.value);
else {
if (value === oldValue) return;
checked = looseEqual(value, getCheckboxValue(el, true));
}
if (el.checked !== checked) el.checked = checked;
}
function getValue(el) {
return "_value" in el ? el._value : el.value;
}
function getCheckboxValue(el, checked) {
const key = checked ? "_trueValue" : "_falseValue";
return key in el ? el[key] : checked;
}
var keyNames = {
esc: "escape",
space: " ",
up: "arrow-up",
left: "arrow-left",
right: "arrow-right",
down: "arrow-down",
delete: "backspace"
};
var withKeys = (fn, modifiers) => {
const cache = fn._withKeys || (fn._withKeys = {});
const cacheKey = modifiers.join(".");
return cache[cacheKey] || (cache[cacheKey] = ((event) => {
if (!("key" in event)) return;
const eventKey = hyphenate$1(event.key);
if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) return fn(event);
}));
};
var rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
var renderer;
function ensureRenderer() {
return renderer || (renderer = createRenderer(rendererOptions));
}
var createApp = ((...args) => {
const app = ensureRenderer().createApp(...args);
const { mount } = app;
app.mount = (containerOrSelector) => {
const container = normalizeContainer(containerOrSelector);
if (!container) return;
const component = app._component;
if (!isFunction(component) && !component.render && !component.template) component.template = container.innerHTML;
if (container.nodeType === 1) container.textContent = "";
const proxy = mount(container, false, resolveRootNamespace(container));
if (container instanceof Element) {
container.removeAttribute("v-cloak");
container.setAttribute("data-v-app", "");
}
return proxy;
};
return app;
});
function resolveRootNamespace(container) {
if (container instanceof SVGElement) return "svg";
if (typeof MathMLElement === "function" && container instanceof MathMLElement) return "mathml";
}
function normalizeContainer(container) {
if (isString(container)) return document.querySelector(container);
return container;
}
//#endregion
//#region node_modules/.pnpm/pinia@3.0.4_typescript@6.0.3_vue@3.5.35_typescript@6.0.3_/node_modules/pinia/dist/pinia.mjs
/*!
* pinia v3.0.4
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/
var IS_CLIENT = typeof window !== "undefined";
/**
* setActivePinia must be called to handle SSR at the top of functions like
* `fetch`, `setup`, `serverPrefetch` and others
*/
var activePinia;
/**
* Sets or unsets the active pinia. Used in SSR and internally when calling
* actions and getters
*
* @param pinia - Pinia instance
*/
var setActivePinia = (pinia) => activePinia = pinia;
var piniaSymbol = Symbol();
function isPlainObject(o) {
return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
}
/**
* Possible types for SubscriptionCallback
*/
var MutationType;
(function(MutationType) {
/**
* Direct mutation of the state:
*
* - `store.name = 'new name'`
* - `store.$state.name = 'new name'`
* - `store.list.push('new item')`
*/
MutationType["direct"] = "direct";
/**
* Mutated the state with `$patch` and an object
*
* - `store.$patch({ name: 'newName' })`
*/
MutationType["patchObject"] = "patch object";
/**
* Mutated the state with `$patch` and a function
*
* - `store.$patch(state => state.name = 'newName')`
*/
MutationType["patchFunction"] = "patch function";
})(MutationType || (MutationType = {}));
var _global$1 = /* @__PURE__ */ (() => typeof window === "object" && window.window === window ? window : typeof self === "object" && self.self === self ? self : typeof global === "object" && global.global === global ? global : typeof globalThis === "object" ? globalThis : { HTMLElement: null })();
function bom(blob, { autoBom = false } = {}) {
if (autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) return new Blob([String.fromCharCode(65279), blob], { type: blob.type });
return blob;
}
function download(url, name, opts) {
const xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.responseType = "blob";
xhr.onload = function() {
saveAs(xhr.response, name, opts);
};
xhr.onerror = function() {
console.error("could not download file");
};
xhr.send();
}
function corsEnabled(url) {
const xhr = new XMLHttpRequest();
xhr.open("HEAD", url, false);
try {
xhr.send();
} catch (e) {}
return xhr.status >= 200 && xhr.status <= 299;
}
function click(node) {
try {
node.dispatchEvent(new MouseEvent("click"));
} catch (e) {
const evt = new MouseEvent("click", {
bubbles: true,
cancelable: true,
view: window,
detail: 0,
screenX: 80,
screenY: 20,
clientX: 80,
clientY: 20,
ctrlKey: false,
altKey: false,
shiftKey: false,
metaKey: false,
button: 0,
relatedTarget: null
});
node.dispatchEvent(evt);
}
}
var _navigator = typeof navigator === "object" ? navigator : { userAgent: "" };
var isMacOSWebView = /* @__PURE__ */ (() => /Macintosh/.test(_navigator.userAgent) && /AppleWebKit/.test(_navigator.userAgent) && !/Safari/.test(_navigator.userAgent))();
var saveAs = !IS_CLIENT ? () => {} : typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype && !isMacOSWebView ? downloadSaveAs : "msSaveOrOpenBlob" in _navigator ? msSaveAs : fileSaverSaveAs;
function downloadSaveAs(blob, name = "download", opts) {
const a = document.createElement("a");
a.download = name;
a.rel = "noopener";
if (typeof blob === "string") {
a.href = blob;
if (a.origin !== location.origin) if (corsEnabled(a.href)) download(blob, name, opts);
else {
a.target = "_blank";
click(a);
}
else click(a);
} else {
a.href = URL.createObjectURL(blob);
setTimeout(function() {
URL.revokeObjectURL(a.href);
}, 4e4);
setTimeout(function() {
click(a);
}, 0);
}
}
function msSaveAs(blob, name = "download", opts) {
if (typeof blob === "string") if (corsEnabled(blob)) download(blob, name, opts);
else {
const a = document.createElement("a");
a.href = blob;
a.target = "_blank";
setTimeout(function() {
click(a);
});
}
else navigator.msSaveOrOpenBlob(bom(blob, opts), name);
}
function fileSaverSaveAs(blob, name, opts, popup) {
popup = popup || open("", "_blank");
if (popup) popup.document.title = popup.document.body.innerText = "downloading...";
if (typeof blob === "string") return download(blob, name, opts);
const force = blob.type === "application/octet-stream";
const isSafari = /constructor/i.test(String(_global$1.HTMLElement)) || "safari" in _global$1;
const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);
if ((isChromeIOS || force && isSafari || isMacOSWebView) && typeof FileReader !== "undefined") {
const reader = new FileReader();
reader.onloadend = function() {
let url = reader.result;
if (typeof url !== "string") {
popup = null;
throw new Error("Wrong reader.result type");
}
url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, "data:attachment/file;");
if (popup) popup.location.href = url;
else location.assign(url);
popup = null;
};
reader.readAsDataURL(blob);
} else {
const url = URL.createObjectURL(blob);
if (popup) popup.location.assign(url);
else location.href = url;
popup = null;
setTimeout(function() {
URL.revokeObjectURL(url);
}, 4e4);
}
}
var { assign: assign$1 } = Object;
/**
* Creates a Pinia instance to be used by the application
*/
function createPinia() {
const scope = effectScope(true);
const state = scope.run(() => /* @__PURE__ */ ref({}));
let _p = [];
let toBeInstalled = [];
const pinia = markRaw({
install(app) {
setActivePinia(pinia);
pinia._a = app;
app.provide(piniaSymbol, pinia);
app.config.globalProperties.$pinia = pinia;
toBeInstalled.forEach((plugin) => _p.push(plugin));
toBeInstalled = [];
},
use(plugin) {
if (!this._a) toBeInstalled.push(plugin);
else _p.push(plugin);
return this;
},
_p,
_a: null,
_e: scope,
_s: /* @__PURE__ */ new Map(),
state
});
return pinia;
}
var noop$2 = () => {};
function addSubscription(subscriptions, callback, detached, onCleanup = noop$2) {
subscriptions.add(callback);
const removeSubscription = () => {
subscriptions.delete(callback) && onCleanup();
};
if (!detached && getCurrentScope()) onScopeDispose(removeSubscription);
return removeSubscription;
}
function triggerSubscriptions(subscriptions, ...args) {
subscriptions.forEach((callback) => {
callback(...args);
});
}
var fallbackRunWithContext = (fn) => fn();
/**
* Marks a function as an action for `$onAction`
* @internal
*/
var ACTION_MARKER = Symbol();
/**
* Action name symbol. Allows to add a name to an action after defining it
* @internal
*/
var ACTION_NAME = Symbol();
function mergeReactiveObjects(target, patchToApply) {
if (target instanceof Map && patchToApply instanceof Map) patchToApply.forEach((value, key) => target.set(key, value));
else if (target instanceof Set && patchToApply instanceof Set) patchToApply.forEach(target.add, target);
for (const key in patchToApply) {
if (!patchToApply.hasOwnProperty(key)) continue;
const subPatch = patchToApply[key];
const targetValue = target[key];
if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !/* @__PURE__ */ isRef(subPatch) && !/* @__PURE__ */ isReactive(subPatch)) target[key] = mergeReactiveObjects(targetValue, subPatch);
else target[key] = subPatch;
}
return target;
}
var skipHydrateSymbol = Symbol();
/**
* Returns whether a value should be hydrated
*
* @param obj - target variable
* @returns true if `obj` should be hydrated
*/
function shouldHydrate(obj) {
return !isPlainObject(obj) || !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol);
}
var { assign: assign$2 } = Object;
function isComputed(o) {
return !!(/* @__PURE__ */ isRef(o) && o.effect);
}
function createOptionsStore(id, options, pinia, hot) {
const { state, actions, getters } = options;
const initialState = pinia.state.value[id];
let store;
function setup() {
if (!initialState && true)
/* istanbul ignore if */
pinia.state.value[id] = state ? state() : {};
return assign$2(/* @__PURE__ */ toRefs(pinia.state.value[id]), actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
computedGetters[name] = markRaw(computed(() => {
setActivePinia(pinia);
const store = pinia._s.get(id);
return getters[name].call(store, store);
}));
return computedGetters;
}, {}));
}
store = createSetupStore(id, setup, options, pinia, hot, true);
return store;
}
function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
let scope;
const optionsForPlugin = assign$2({ actions: {} }, options);
const $subscribeOptions = { deep: true };
let isListening;
let isSyncListening;
let subscriptions = /* @__PURE__ */ new Set();
let actionSubscriptions = /* @__PURE__ */ new Set();
let debuggerEvents;
const initialState = pinia.state.value[$id];
if (!isOptionsStore && !initialState && true)
/* istanbul ignore if */
pinia.state.value[$id] = {};
let activeListener;
function $patch(partialStateOrMutator) {
let subscriptionMutation;
isListening = isSyncListening = false;
if (typeof partialStateOrMutator === "function") {
partialStateOrMutator(pinia.state.value[$id]);
subscriptionMutation = {
type: MutationType.patchFunction,
storeId: $id,
events: debuggerEvents
};
} else {
mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
subscriptionMutation = {
type: MutationType.patchObject,
payload: partialStateOrMutator,
storeId: $id,
events: debuggerEvents
};
}
const myListenerId = activeListener = Symbol();
nextTick().then(() => {
if (activeListener === myListenerId) isListening = true;
});
isSyncListening = true;
triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
}
const $reset = isOptionsStore ? function $reset() {
const { state } = options;
const newState = state ? state() : {};
this.$patch(($state) => {
assign$2($state, newState);
});
} : noop$2;
function $dispose() {
scope.stop();
subscriptions.clear();
actionSubscriptions.clear();
pinia._s.delete($id);
}
/**
* Helper that wraps function so it can be tracked with $onAction
* @param fn - action to wrap
* @param name - name of the action
*/
const action = (fn, name = "") => {
if (ACTION_MARKER in fn) {
fn[ACTION_NAME] = name;
return fn;
}
const wrappedAction = function() {
setActivePinia(pinia);
const args = Array.from(arguments);
const afterCallbackSet = /* @__PURE__ */ new Set();
const onErrorCallbackSet = /* @__PURE__ */ new Set();
function after(callback) {
afterCallbackSet.add(callback);
}
function onError(callback) {
onErrorCallbackSet.add(callback);
}
triggerSubscriptions(actionSubscriptions, {
args,
name: wrappedAction[ACTION_NAME],
store,
after,
onError
});
let ret;
try {
ret = fn.apply(this && this.$id === $id ? this : store, args);
} catch (error) {
triggerSubscriptions(onErrorCallbackSet, error);
throw error;
}
if (ret instanceof Promise) return ret.then((value) => {
triggerSubscriptions(afterCallbackSet, value);
return value;
}).catch((error) => {
triggerSubscriptions(onErrorCallbackSet, error);
return Promise.reject(error);
});
triggerSubscriptions(afterCallbackSet, ret);
return ret;
};
wrappedAction[ACTION_MARKER] = true;
wrappedAction[ACTION_NAME] = name;
return wrappedAction;
};
const store = /* @__PURE__ */ reactive({
_p: pinia,
$id,
$onAction: addSubscription.bind(null, actionSubscriptions),
$patch,
$reset,
$subscribe(callback, options = {}) {
const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher());
const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {
if (options.flush === "sync" ? isSyncListening : isListening) callback({
storeId: $id,
type: MutationType.direct,
events: debuggerEvents
}, state);
}, assign$2({}, $subscribeOptions, options)));
return removeSubscription;
},
$dispose
});
pinia._s.set($id, store);
const setupStore = (pinia._a && pinia._a.runWithContext || fallbackRunWithContext)(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action }))));
for (const key in setupStore) {
const prop = setupStore[key];
if (/* @__PURE__ */ isRef(prop) && !isComputed(prop) || /* @__PURE__ */ isReactive(prop)) {
if (!isOptionsStore) {
if (initialState && shouldHydrate(prop)) if (/* @__PURE__ */ isRef(prop)) prop.value = initialState[key];
else mergeReactiveObjects(prop, initialState[key]);
pinia.state.value[$id][key] = prop;
}
} else if (typeof prop === "function") {
setupStore[key] = action(prop, key);
optionsForPlugin.actions[key] = prop;
}
}
/* istanbul ignore if */
assign$2(store, setupStore);
assign$2(/* @__PURE__ */ toRaw(store), setupStore);
Object.defineProperty(store, "$state", {
get: () => pinia.state.value[$id],
set: (state) => {
$patch(($state) => {
assign$2($state, state);
});
}
});
pinia._p.forEach((extender) => {
assign$2(store, scope.run(() => extender({
store,
app: pinia._a,
pinia,
options: optionsForPlugin
})));
});
if (initialState && isOptionsStore && options.hydrate) options.hydrate(store.$state, initialState);
isListening = true;
isSyncListening = true;
return store;
}
/*! #__NO_SIDE_EFFECTS__ */
function defineStore(id, setup, setupOptions) {
let options;
const isSetupStore = typeof setup === "function";
options = isSetupStore ? setupOptions : setup;
function useStore(pinia, hot) {
const hasContext = hasInjectionContext();
pinia = pinia || (hasContext ? inject(piniaSymbol, null) : null);
if (pinia) setActivePinia(pinia);
pinia = activePinia;
if (!pinia._s.has(id)) if (isSetupStore) createSetupStore(id, setup, options, pinia);
else createOptionsStore(id, options, pinia);
return pinia._s.get(id);
}
useStore.$id = id;
return useStore;
}
//#endregion
//#region node_modules/.pnpm/vue-router@5.1.0_@vue+compiler-sfc@3.5.35_pinia@3.0.4_typescript@6.0.3_vue@3.5.35_types_821fcf17a47f3043d01d3f1ccaea0a86/node_modules/vue-router/dist/useApi-s_02lHjl.js
/*!
* vue-router v5.1.0
* (c) 2026 Eduardo San Martin Morote
* @license MIT
*/
var isBrowser = typeof document !== "undefined";
/**
* Allows differentiating lazy components from functional components and vue-class-component
* @internal
*
* @param component
*/
function isRouteComponent(component) {
return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
}
function isESModule(obj) {
return obj.__esModule || obj[Symbol.toStringTag] === "Module" || obj.default && isRouteComponent(obj.default);
}
var assign = Object.assign;
function applyToParams(fn, params) {
const newParams = {};
for (const key in params) {
const value = params[key];
newParams[key] = isArray(value) ? value.map(fn) : fn(value);
}
return newParams;
}
var noop$1 = () => {};
/**
* Typesafe alternative to Array.isArray
* https://github.com/microsoft/TypeScript/pull/48228
*
* @internal
*/
var isArray = Array.isArray;
function mergeOptions(defaults, partialOptions) {
const options = {};
for (const key in defaults) options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
return options;
}
var NavigationFailureSymbol = Symbol("");
/**
* Creates a typed NavigationFailure object.
* @internal
* @param type - NavigationFailureType
* @param params - { from, to }
*/
function createRouterError(type, params) {
return assign(/* @__PURE__ */ new Error(), {
type,
[NavigationFailureSymbol]: true
}, params);
}
function isNavigationFailure(error, type) {
return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
}
/**
* RouteRecord being rendered by the closest ancestor Router View. Used for
* `onBeforeRouteUpdate` and `onBeforeRouteLeave`. rvlm stands for Router View
* Location Matched
*
* @internal
*/
var matchedRouteKey = Symbol("");
/**
* Allows overriding the router view depth to control which component in
* `matched` is rendered. rvd stands for Router View Depth
*
* @internal
*/
var viewDepthKey = Symbol("");
/**
* Allows overriding the router instance returned by `useRouter` in tests. r
* stands for router
*
* @internal
*/
var routerKey = Symbol("");
/**
* Allows overriding the current route returned by `useRoute` in tests. rl
* stands for route location
*
* @internal
*/
var routeLocationKey = Symbol("");
/**
* Allows overriding the current route used by router-view. Internally this is
* used when the `route` prop is passed.
*
* @internal
*/
var routerViewLocationKey = Symbol("");
/**
* Returns the router instance. Equivalent to using `$router` inside
* templates.
*/
function useRouter() {
return inject(routerKey);
}
/**
* Returns the current route location. Equivalent to using `$route` inside
* templates.
*/
function useRoute(_name) {
return inject(routeLocationKey);
}
//#endregion
//#region node_modules/.pnpm/vue-router@5.1.0_@vue+compiler-sfc@3.5.35_pinia@3.0.4_typescript@6.0.3_vue@3.5.35_types_821fcf17a47f3043d01d3f1ccaea0a86/node_modules/vue-router/dist/devtools-DCoWQoU_.js
/*!
* vue-router v5.1.0
* (c) 2026 Eduardo San Martin Morote
* @license MIT
*/
/**
* Encoding Rules (␣ = Space)
* - Path: ␣ " < > # ? { }
* - Query: ␣ " < > # & =
* - Hash: ␣ " < > `
*
* On top of that, the RFC3986 (https://tools.ietf.org/html/rfc3986#section-2.2)
* defines some extra characters to be encoded. Most browsers do not encode them
* in encodeURI https://github.com/whatwg/url/issues/369, so it may be safer to
* also encode `!'()*`. Leaving un-encoded only ASCII alphanumeric(`a-zA-Z0-9`)
* plus `-._~`. This extra safety should be applied to query by patching the
* string returned by encodeURIComponent encodeURI also encodes `[\]^`. `\`
* should be encoded to avoid ambiguity. Browsers (IE, FF, C) transform a `\`
* into a `/` if directly typed in. The _backtick_ (`````) should also be
* encoded everywhere because some browsers like FF encode it when directly
* written while others don't. Safari and IE don't encode ``"<>{}``` in hash.
*/
var HASH_RE = /#/g;
var AMPERSAND_RE = /&/g;
var SLASH_RE = /\//g;
var EQUAL_RE = /=/g;
var IM_RE = /\?/g;
var PLUS_RE = /\+/g;
/**
* NOTE: It's not clear to me if we should encode the + symbol in queries, it
* seems to be less flexible than not doing so and I can't find out the legacy
* systems requiring this for regular requests like text/html. In the standard,
* the encoding of the plus character is only mentioned for
* application/x-www-form-urlencoded
* (https://url.spec.whatwg.org/#urlencoded-parsing) and most browsers seems lo
* leave the plus character as is in queries. To be more flexible, we allow the
* plus character on the query, but it can also be manually encoded by the user.
*
* Resources:
* - https://url.spec.whatwg.org/#urlencoded-parsing
* - https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20
*/
var ENC_BRACKET_OPEN_RE = /%5B/g;
var ENC_BRACKET_CLOSE_RE = /%5D/g;
var ENC_CARET_RE = /%5E/g;
var ENC_BACKTICK_RE = /%60/g;
var ENC_CURLY_OPEN_RE = /%7B/g;
var ENC_PIPE_RE = /%7C/g;
var ENC_CURLY_CLOSE_RE = /%7D/g;
var ENC_SPACE_RE = /%20/g;
/**
* Encode characters that need to be encoded on the path, search and hash
* sections of the URL.
*
* @internal
* @param text - string to encode
* @returns encoded string
*/
function commonEncode(text) {
return text == null ? "" : encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
}
/**
* Encode characters that need to be encoded on the hash section of the URL.
*
* @param text - string to encode
* @returns encoded string
*/
function encodeHash(text) {
return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
}
/**
* Encode characters that need to be encoded query values on the query
* section of the URL.
*
* @param text - string to encode
* @returns encoded string
*/
function encodeQueryValue(text) {
return commonEncode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
}
/**
* Like `encodeQueryValue` but also encodes the `=` character.
*
* @param text - string to encode
*/
function encodeQueryKey(text) {
return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
}
/**
* Encode characters that need to be encoded on the path section of the URL.
*
* @param text - string to encode
* @returns encoded string
*/
function encodePath(text) {
return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
}
/**
* Encode characters that need to be encoded on the path section of the URL as a
* param. This function encodes everything {@link encodePath} does plus the
* slash (`/`) character. If `text` is `null` or `undefined`, returns an empty
* string instead.
*
* @param text - string to encode
* @returns encoded string
*/
function encodeParam(text) {
return encodePath(text).replace(SLASH_RE, "%2F");
}
function decode(text) {
if (text == null) return null;
try {
return decodeURIComponent("" + text);
} catch {}
return "" + text;
}
var TRAILING_SLASH_RE = /\/$/;
var removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
/**
* Transforms a URI into a normalized history location
*
* @param parseQuery
* @param location - URI to normalize
* @param currentLocation - current absolute location. Allows resolving relative
* paths. Must start with `/`. Defaults to `/`
* @returns a normalized history location
*/
function parseURL(parseQuery, location, currentLocation = "/") {
let path, query = {}, searchString = "", hash = "";
const hashPos = location.indexOf("#");
let searchPos = location.indexOf("?");
searchPos = hashPos >= 0 && searchPos > hashPos ? -1 : searchPos;
if (searchPos >= 0) {
path = location.slice(0, searchPos);
searchString = location.slice(searchPos, hashPos > 0 ? hashPos : location.length);
query = parseQuery(searchString.slice(1));
}
if (hashPos >= 0) {
path = path || location.slice(0, hashPos);
hash = location.slice(hashPos, location.length);
}
path = resolveRelativePath(path != null ? path : location, currentLocation);
return {
fullPath: path + searchString + hash,
path,
query,
hash: decode(hash)
};
}
/**
* Stringifies a URL object
*
* @param stringifyQuery
* @param location
*/
function stringifyURL(stringifyQuery, location) {
const query = location.query ? stringifyQuery(location.query) : "";
return location.path + (query && "?") + query + (location.hash || "");
}
/**
* Strips off the base from the beginning of a location.pathname in a non-case-sensitive way.
*
* @param pathname - location.pathname
* @param base - base to strip off
*/
function stripBase(pathname, base) {
if (!base || !pathname.toLowerCase().startsWith(base.toLowerCase())) return pathname;
return pathname.slice(base.length) || "/";
}
/**
* Checks if two RouteLocation are equal. This means that both locations are
* pointing towards the same {@link RouteRecord} and that all `params`, `query`
* parameters and `hash` are the same
*
* @param stringifyQuery - A function that takes a query object of type LocationQueryRaw and returns a string representation of it.
* @param a - first {@link RouteLocation}
* @param b - second {@link RouteLocation}
*/
function isSameRouteLocation(stringifyQuery, a, b) {
const aLastIndex = a.matched.length - 1;
const bLastIndex = b.matched.length - 1;
return aLastIndex > -1 && aLastIndex === bLastIndex && isSameRouteRecord(a.matched[aLastIndex], b.matched[bLastIndex]) && isSameRouteLocationParams(a.params, b.params) && stringifyQuery(a.query) === stringifyQuery(b.query) && a.hash === b.hash;
}
/**
* Check if two `RouteRecords` are equal. Takes into account aliases: they are
* considered equal to the `RouteRecord` they are aliasing.
*
* @param a - first {@link RouteRecord}
* @param b - second {@link RouteRecord}
*/
function isSameRouteRecord(a, b) {
return (a.aliasOf || a) === (b.aliasOf || b);
}
function isSameRouteLocationParams(a, b) {
if (Object.keys(a).length !== Object.keys(b).length) return false;
for (var key in a) if (!isSameRouteLocationParamsValue(a[key], b[key])) return false;
return true;
}
function isSameRouteLocationParamsValue(a, b) {
return isArray(a) ? isEquivalentArray(a, b) : isArray(b) ? isEquivalentArray(b, a) : (a && a.valueOf()) === (b && b.valueOf());
}
/**
* Check if two arrays are the same or if an array with one single entry is the
* same as another primitive value. Used to check query and parameters
*
* @param a - array of values
* @param b - array of values or a single value
*/
function isEquivalentArray(a, b) {
return isArray(b) ? a.length === b.length && a.every((value, i) => value === b[i]) : a.length === 1 && a[0] === b;
}
/**
* Resolves a relative path that starts with `.`.
*
* @param to - path location we are resolving
* @param from - currentLocation.path, should start with `/`
*/
function resolveRelativePath(to, from) {
if (to.startsWith("/")) return to;
if (!to) return from;
const fromSegments = from.split("/");
const toSegments = to.split("/");
const lastToSegment = toSegments[toSegments.length - 1];
if (lastToSegment === ".." || lastToSegment === ".") toSegments.push("");
let position = fromSegments.length - 1;
let toPosition;
let segment;
for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
segment = toSegments[toPosition];
if (segment === ".") continue;
if (segment === "..") {
if (position > 1) position--;
} else break;
}
return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition).join("/");
}
/**
* Initial route location where the router is. Can be used in navigation guards
* to differentiate the initial navigation.
*
* @example
* ```js
* import { START_LOCATION } from 'vue-router'
*
* router.beforeEach((to, from) => {
* if (from === START_LOCATION) {
* // initial navigation
* }
* })
* ```
*/
var START_LOCATION_NORMALIZED = {
path: "/",
name: void 0,
params: {},
query: {},
hash: "",
fullPath: "/",
matched: [],
meta: {},
redirectedFrom: void 0
};
/**
* Normalizes a base by removing any trailing slash and reading the base tag if
* present.
*
* @param base - base to normalize
*/
function normalizeBase(base) {
if (!base) if (isBrowser) {
const baseEl = document.querySelector("base");
base = baseEl && baseEl.getAttribute("href") || "/";
base = base.replace(/^\w+:\/\/[^/]+/, "");
} else base = "/";
if (base[0] !== "/" && base[0] !== "#") base = "/" + base;
return removeTrailingSlash(base);
}
var BEFORE_HASH_RE = /^[^#]+#/;
function createHref(base, location) {
return base.replace(BEFORE_HASH_RE, "#") + location;
}
function getElementPosition(el, offset) {
const docRect = document.documentElement.getBoundingClientRect();
const elRect = el.getBoundingClientRect();
return {
behavior: offset.behavior,
left: elRect.left - docRect.left - (offset.left || 0),
top: elRect.top - docRect.top - (offset.top || 0)
};
}
var computeScrollPosition = () => ({
left: window.scrollX,
top: window.scrollY
});
function scrollToPosition(position) {
let scrollToOptions;
if ("el" in position) {
const positionEl = position.el;
const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
if (!el) return;
scrollToOptions = getElementPosition(el, position);
} else scrollToOptions = position;
if ("scrollBehavior" in document.documentElement.style) window.scrollTo(scrollToOptions);
else window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
}
function getScrollKey(path, delta) {
return (history.state ? history.state.position - delta : -1) + path;
}
var scrollPositions = /* @__PURE__ */ new Map();
function saveScrollPosition(key, scrollPosition) {
scrollPositions.set(key, scrollPosition);
}
function getSavedScrollPosition(key) {
const scroll = scrollPositions.get(key);
scrollPositions.delete(key);
return scroll;
}
/**
* ScrollBehavior instance used by the router to compute and restore the scroll
* position when navigating.
*/
function isRouteLocation(route) {
return typeof route === "string" || route && typeof route === "object";
}
function isRouteName(name) {
return typeof name === "string" || typeof name === "symbol";
}
/**
* Transforms a queryString into a {@link LocationQuery} object. Accept both, a
* version with the leading `?` and without Should work as URLSearchParams
* @internal
*
* @param search - search string to parse
* @returns a query object
*/
function parseQuery(search) {
const query = {};
if (search === "" || search === "?") return query;
const searchParams = (search[0] === "?" ? search.slice(1) : search).split("&");
for (let i = 0; i < searchParams.length; ++i) {
const searchParam = searchParams[i].replace(PLUS_RE, " ");
const eqPos = searchParam.indexOf("=");
const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
if (key in query) {
let currentValue = query[key];
if (!isArray(currentValue)) currentValue = query[key] = [currentValue];
currentValue.push(value);
} else query[key] = value;
}
return query;
}
/**
* Stringifies a {@link LocationQueryRaw} object. Like `URLSearchParams`, it
* doesn't prepend a `?`
*
* @internal
*
* @param query - query object to stringify
* @returns string version of the query without the leading `?`
*/
function stringifyQuery(query) {
let search = "";
for (let key in query) {
const value = query[key];
key = encodeQueryKey(key);
if (value == null) {
if (value !== void 0) search += (search.length ? "&" : "") + key;
continue;
}
(isArray(value) ? value.map((v) => v && encodeQueryValue(v)) : [value && encodeQueryValue(value)]).forEach((value) => {
if (value !== void 0) {
search += (search.length ? "&" : "") + key;
if (value != null) search += "=" + value;
}
});
}
return search;
}
/**
* Transforms a {@link LocationQueryRaw} into a {@link LocationQuery} by casting
* numbers into strings, removing keys with an undefined value and replacing
* undefined with null in arrays
*
* @param query - query object to normalize
* @returns a normalized query object
*/
function normalizeQuery(query) {
const normalizedQuery = {};
for (const key in query) {
const value = query[key];
if (value !== void 0) normalizedQuery[key] = isArray(value) ? value.map((v) => v == null ? null : "" + v) : value == null ? value : "" + value;
}
return normalizedQuery;
}
/**
* Create a list of callbacks that can be reset. Used to create before and after navigation guards list
*/
function useCallbacks() {
let handlers = [];
function add(handler) {
handlers.push(handler);
return () => {
const i = handlers.indexOf(handler);
if (i > -1) handlers.splice(i, 1);
};
}
function reset() {
handlers = [];
}
return {
add,
list: () => handlers.slice(),
reset
};
}
function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn) => fn()) {
const enterCallbackArray = record && (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
return () => new Promise((resolve, reject) => {
const next = (valid) => {
if (valid === false) reject(createRouterError(4, {
from,
to
}));
else if (valid instanceof Error) reject(valid);
else if (isRouteLocation(valid)) reject(createRouterError(2, {
from: to,
to: valid
}));
else {
if (enterCallbackArray && record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") enterCallbackArray.push(valid);
resolve();
}
};
const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
let guardCall = Promise.resolve(guardReturn);
if (guard.length < 3) guardCall = guardCall.then(next);
guardCall.catch((err) => reject(err));
});
}
function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn) => fn()) {
const guards = [];
for (const record of matched) for (const name in record.components) {
let rawComponent = record.components[name];
if (guardType !== "beforeRouteEnter" && !record.instances[name]) continue;
if (isRouteComponent(rawComponent)) {
const guard = (rawComponent.__vccOpts || rawComponent)[guardType];
guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
} else {
let componentPromise = rawComponent();
guards.push(() => componentPromise.then((resolved) => {
if (!resolved) throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
record.mods[name] = resolved;
record.components[name] = resolvedComponent;
const guard = (resolvedComponent.__vccOpts || resolvedComponent)[guardType];
return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
}));
}
}
return guards;
}
/**
* Split the leaving, updating, and entering records.
* @internal
*
* @param to - Location we are navigating to
* @param from - Location we are navigating from
*/
function extractChangingRecords(to, from) {
const leavingRecords = [];
const updatingRecords = [];
const enteringRecords = [];
const len = Math.max(from.matched.length, to.matched.length);
for (let i = 0; i < len; i++) {
const recordFrom = from.matched[i];
if (recordFrom) if (to.matched.find((record) => isSameRouteRecord(record, recordFrom))) updatingRecords.push(recordFrom);
else leavingRecords.push(recordFrom);
const recordTo = to.matched[i];
if (recordTo) {
if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) enteringRecords.push(recordTo);
}
}
return [
leavingRecords,
updatingRecords,
enteringRecords
];
}
//#endregion
//#region node_modules/.pnpm/vue-router@5.1.0_@vue+compiler-sfc@3.5.35_pinia@3.0.4_typescript@6.0.3_vue@3.5.35_types_821fcf17a47f3043d01d3f1ccaea0a86/node_modules/vue-router/dist/vue-router.js
/*!
* vue-router v5.1.0
* (c) 2026 Eduardo San Martin Morote
* @license MIT
*/
var createBaseLocation = () => location.protocol + "//" + location.host;
/**
* Creates a normalized history location from a window.location object
* @param base - The base path
* @param location - The window.location object
*/
function createCurrentLocation(base, location) {
const { pathname, search, hash } = location;
const hashPos = base.indexOf("#");
if (hashPos > -1) {
let slicePos = hash.includes(base.slice(hashPos)) ? base.slice(hashPos).length : 1;
let pathFromHash = hash.slice(slicePos);
if (pathFromHash[0] !== "/") pathFromHash = "/" + pathFromHash;
return stripBase(pathFromHash, "");
}
return stripBase(pathname, base) + search + hash;
}
function useHistoryListeners(base, historyState, currentLocation, replace) {
let listeners = [];
let teardowns = [];
let pauseState = null;
const popStateHandler = ({ state }) => {
const to = createCurrentLocation(base, location);
const from = currentLocation.value;
const fromState = historyState.value;
let delta = 0;
if (state) {
currentLocation.value = to;
historyState.value = state;
if (pauseState && pauseState === from) {
pauseState = null;
return;
}
delta = fromState ? state.position - fromState.position : 0;
} else replace(to);
listeners.forEach((listener) => {
listener(currentLocation.value, from, {
delta,
type: "pop",
direction: delta ? delta > 0 ? "forward" : "back" : ""
});
});
};
function pauseListeners() {
pauseState = currentLocation.value;
}
function listen(callback) {
listeners.push(callback);
const teardown = () => {
const index = listeners.indexOf(callback);
if (index > -1) listeners.splice(index, 1);
};
teardowns.push(teardown);
return teardown;
}
function beforeUnloadListener() {
if (document.visibilityState === "hidden") {
const { history } = window;
if (!history.state) return;
history.replaceState(assign({}, history.state, { scroll: computeScrollPosition() }), "");
}
}
function destroy() {
for (const teardown of teardowns) teardown();
teardowns = [];
window.removeEventListener("popstate", popStateHandler);
window.removeEventListener("pagehide", beforeUnloadListener);
document.removeEventListener("visibilitychange", beforeUnloadListener);
}
window.addEventListener("popstate", popStateHandler);
window.addEventListener("pagehide", beforeUnloadListener);
document.addEventListener("visibilitychange", beforeUnloadListener);
return {
pauseListeners,
listen,
destroy
};
}
/**
* Creates a state object
*/
function buildState(back, current, forward, replaced = false, computeScroll = false) {
return {
back,
current,
forward,
replaced,
position: window.history.length,
scroll: computeScroll ? computeScrollPosition() : null
};
}
function useHistoryStateNavigation(base) {
const { history, location } = window;
const currentLocation = { value: createCurrentLocation(base, location) };
const historyState = { value: history.state };
if (!historyState.value) changeLocation(currentLocation.value, {
back: null,
current: currentLocation.value,
forward: null,
position: history.length - 1,
replaced: true,
scroll: null
}, true);
function changeLocation(to, state, replace) {
/**
* if a base tag is provided, and we are on a normal domain, we have to
* respect the provided `base` attribute because pushState() will use it and
* potentially erase anything before the `#` like at
* https://github.com/vuejs/router/issues/685 where a base of
* `/folder/#` but a base of `/` would erase the `/folder/` section. If
* there is no host, the `` tag makes no sense and if there isn't a
* base tag we can just use everything after the `#`.
*/
const hashIndex = base.indexOf("#");
const url = hashIndex > -1 ? (location.host && document.querySelector("base") ? base : base.slice(hashIndex)) + to : createBaseLocation() + base + to;
try {
history[replace ? "replaceState" : "pushState"](state, "", url);
historyState.value = state;
} catch (err) {
console.error(err);
location[replace ? "replace" : "assign"](url);
}
}
function replace(to, data) {
changeLocation(to, assign({}, history.state, buildState(historyState.value.back, to, historyState.value.forward, true), data, { position: historyState.value.position }), true);
currentLocation.value = to;
}
function push(to, data) {
const currentState = assign({}, historyState.value, history.state, {
forward: to,
scroll: computeScrollPosition()
});
changeLocation(currentState.current, currentState, true);
changeLocation(to, assign({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data), false);
currentLocation.value = to;
}
return {
location: currentLocation,
state: historyState,
push,
replace
};
}
/**
* Creates an HTML5 history. Most common history for single page applications.
*
* @param base -
*/
function createWebHistory(base) {
base = normalizeBase(base);
const historyNavigation = useHistoryStateNavigation(base);
const historyListeners = useHistoryListeners(base, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
function go(delta, triggerListeners = true) {
if (!triggerListeners) historyListeners.pauseListeners();
history.go(delta);
}
const routerHistory = assign({
location: "",
base,
go,
createHref: createHref.bind(null, base)
}, historyNavigation, historyListeners);
Object.defineProperty(routerHistory, "location", {
enumerable: true,
get: () => historyNavigation.location.value
});
Object.defineProperty(routerHistory, "state", {
enumerable: true,
get: () => historyNavigation.state.value
});
return routerHistory;
}
/**
* Creates a hash history. Useful for web applications with no host (e.g. `file://`) or when configuring a server to
* handle any URL is not possible.
*
* @param base - optional base to provide. Defaults to `location.pathname + location.search` If there is a `` tag
* in the `head`, its value will be ignored in favor of this parameter **but note it affects all the history.pushState()
* calls**, meaning that if you use a `` tag, it's `href` value **has to match this parameter** (ignoring anything
* after the `#`).
*
* @example
* ```js
* // at https://example.com/folder
* createWebHashHistory() // gives a url of `https://example.com/folder#`
* createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
* // if the `#` is provided in the base, it won't be added by `createWebHashHistory`
* createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
* // you should avoid doing this because it changes the original url and breaks copying urls
* createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
*
* // at file:///usr/etc/folder/index.html
* // for locations with no `host`, the base is ignored
* createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
* ```
*/
function createWebHashHistory(base) {
base = location.host ? base || location.pathname + location.search : "";
if (!base.includes("#")) base += "#";
return createWebHistory(base);
}
var ROOT_TOKEN = {
type: 0,
value: ""
};
var VALID_PARAM_RE = /[a-zA-Z0-9_]/;
function tokenizePath(path) {
if (!path) return [[]];
if (path === "/") return [[ROOT_TOKEN]];
if (!path.startsWith("/")) throw new Error(`Invalid path "${path}"`);
function crash(message) {
throw new Error(`ERR (${state})/"${buffer}": ${message}`);
}
let state = 0;
let previousState = state;
const tokens = [];
let segment;
function finalizeSegment() {
if (segment) tokens.push(segment);
segment = [];
}
let i = 0;
let char;
let buffer = "";
let customRe = "";
function consumeBuffer() {
if (!buffer) return;
if (state === 0) segment.push({
type: 0,
value: buffer
});
else if (state === 1 || state === 2 || state === 3) {
if (segment.length > 1 && (char === "*" || char === "+")) crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
segment.push({
type: 1,
value: buffer,
regexp: customRe,
repeatable: char === "*" || char === "+",
optional: char === "*" || char === "?"
});
} else crash("Invalid state to consume buffer");
buffer = "";
}
function addCharToBuffer() {
buffer += char;
}
while (i < path.length) {
char = path[i++];
switch (state) {
case 0:
if (char === "\\") {
previousState = state;
state = 4;
} else if (char === "/") {
if (buffer) consumeBuffer();
finalizeSegment();
} else if (char === ":") {
consumeBuffer();
state = 1;
} else addCharToBuffer();
break;
case 4:
addCharToBuffer();
state = previousState;
break;
case 1:
if (char === "(") state = 2;
else if (VALID_PARAM_RE.test(char)) addCharToBuffer();
else {
consumeBuffer();
state = 0;
if (char !== "*" && char !== "?" && char !== "+") i--;
}
break;
case 2:
if (char === ")") if (customRe[customRe.length - 1] == "\\") customRe = customRe.slice(0, -1) + char;
else state = 3;
else customRe += char;
break;
case 3:
consumeBuffer();
state = 0;
if (char !== "*" && char !== "?" && char !== "+") i--;
customRe = "";
break;
default:
crash("Unknown state");
break;
}
}
if (state === 2) crash(`Unfinished custom RegExp for param "${buffer}"`);
consumeBuffer();
finalizeSegment();
return tokens;
}
var BASE_PARAM_PATTERN = "[^/]+?";
var BASE_PATH_PARSER_OPTIONS = {
sensitive: false,
strict: false,
start: true,
end: true
};
var REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
/**
* Creates a path parser from an array of Segments (a segment is an array of Tokens)
*
* @param segments - array of segments returned by tokenizePath
* @param extraOptions - optional options for the regexp
* @returns a PathParser
*/
function tokensToParser(segments, extraOptions) {
const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
const score = [];
let pattern = options.start ? "^" : "";
const keys = [];
for (const segment of segments) {
const segmentScores = segment.length ? [] : [90];
if (options.strict && !segment.length) pattern += "/";
for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
const token = segment[tokenIndex];
let subSegmentScore = 40 + (options.sensitive ? .25 : 0);
if (token.type === 0) {
if (!tokenIndex) pattern += "/";
pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
subSegmentScore += 40;
} else if (token.type === 1) {
const { value, repeatable, optional, regexp } = token;
keys.push({
name: value,
repeatable,
optional
});
const re = regexp ? regexp : BASE_PARAM_PATTERN;
if (re !== BASE_PARAM_PATTERN) {
subSegmentScore += 10;
try {
new RegExp(`(${re})`);
} catch (err) {
throw new Error(`Invalid custom RegExp for param "${value}" (${re}): ` + err.message);
}
}
let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;
if (!tokenIndex) subPattern = optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
if (optional) subPattern += "?";
pattern += subPattern;
subSegmentScore += 20;
if (optional) subSegmentScore += -8;
if (repeatable) subSegmentScore += -20;
if (re === ".*") subSegmentScore += -50;
}
segmentScores.push(subSegmentScore);
}
score.push(segmentScores);
}
if (options.strict && options.end) {
const i = score.length - 1;
score[i][score[i].length - 1] += .7000000000000001;
}
if (!options.strict) pattern += "/?";
if (options.end) pattern += "$";
else if (options.strict && !pattern.endsWith("/")) pattern += "(?:/|$)";
const re = new RegExp(pattern, options.sensitive ? "" : "i");
function parse(path) {
const match = path.match(re);
const params = {};
if (!match) return null;
for (let i = 1; i < match.length; i++) {
const value = match[i] || "";
const key = keys[i - 1];
params[key.name] = value && key.repeatable ? value.split("/") : value;
}
return params;
}
function stringify(params) {
let path = "";
let avoidDuplicatedSlash = false;
for (const segment of segments) {
if (!avoidDuplicatedSlash || !path.endsWith("/")) path += "/";
avoidDuplicatedSlash = false;
for (const token of segment) if (token.type === 0) path += token.value;
else if (token.type === 1) {
const { value, repeatable, optional } = token;
const param = value in params ? params[value] : "";
if (isArray(param) && !repeatable) throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
const text = isArray(param) ? param.join("/") : param;
if (!text) if (optional) {
if (segment.length < 2) if (path.endsWith("/")) path = path.slice(0, -1);
else avoidDuplicatedSlash = true;
} else throw new Error(`Missing required param "${value}"`);
path += text;
}
}
return path || "/";
}
return {
re,
score,
keys,
parse,
stringify
};
}
/**
* Compares an array of numbers as used in PathParser.score and returns a
* number. This function can be used to `sort` an array
*
* @param a - first array of numbers
* @param b - second array of numbers
* @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
* should be sorted first
*/
function compareScoreArray(a, b) {
let i = 0;
while (i < a.length && i < b.length) {
const diff = b[i] - a[i];
if (diff) return diff;
i++;
}
if (a.length < b.length) return a.length === 1 && a[0] === 80 ? -1 : 1;
else if (a.length > b.length) return b.length === 1 && b[0] === 80 ? 1 : -1;
return 0;
}
/**
* Compare function that can be used with `sort` to sort an array of PathParser
*
* @param a - first PathParser
* @param b - second PathParser
* @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
*/
function comparePathParserScore(a, b) {
let i = 0;
const aScore = a.score;
const bScore = b.score;
while (i < aScore.length && i < bScore.length) {
const comp = compareScoreArray(aScore[i], bScore[i]);
if (comp) return comp;
i++;
}
if (Math.abs(bScore.length - aScore.length) === 1) {
if (isLastScoreNegative(aScore)) return 1;
if (isLastScoreNegative(bScore)) return -1;
}
return bScore.length - aScore.length;
}
/**
* This allows detecting splats at the end of a path: /home/:id(.*)*
*
* @param score - score to check
* @returns true if the last entry is negative
*/
function isLastScoreNegative(score) {
const last = score[score.length - 1];
return score.length > 0 && last[last.length - 1] < 0;
}
var PATH_PARSER_OPTIONS_DEFAULTS = {
strict: false,
end: true,
sensitive: false
};
function createRouteRecordMatcher(record, parent, options) {
const matcher = assign(tokensToParser(tokenizePath(record.path), options), {
record,
parent,
children: [],
alias: []
});
if (parent) {
if (!matcher.record.aliasOf === !parent.record.aliasOf) parent.children.push(matcher);
}
return matcher;
}
/**
* Creates a Router Matcher.
*
* @internal
* @param routes - array of initial routes
* @param globalOptions - global route options
*/
function createRouterMatcher(routes, globalOptions) {
const matchers = [];
const matcherMap = /* @__PURE__ */ new Map();
globalOptions = mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS, globalOptions);
function getRecordMatcher(name) {
return matcherMap.get(name);
}
function addRoute(record, parent, originalRecord) {
const isRootAdd = !originalRecord;
const mainNormalizedRecord = normalizeRouteRecord(record);
mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
const options = mergeOptions(globalOptions, record);
const normalizedRecords = [mainNormalizedRecord];
if ("alias" in record) {
const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
for (const alias of aliases) normalizedRecords.push(normalizeRouteRecord(assign({}, mainNormalizedRecord, {
components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
path: alias,
aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
})));
}
let matcher;
let originalMatcher;
for (const normalizedRecord of normalizedRecords) {
const { path } = normalizedRecord;
if (parent && path[0] !== "/") {
const parentPath = parent.record.path;
const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
}
matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
if (originalRecord) originalRecord.alias.push(matcher);
else {
originalMatcher = originalMatcher || matcher;
if (originalMatcher !== matcher) originalMatcher.alias.push(matcher);
if (isRootAdd && record.name && !isAliasRecord(matcher)) removeRoute(record.name);
}
if (isMatchable(matcher)) insertMatcher(matcher);
if (mainNormalizedRecord.children) {
const children = mainNormalizedRecord.children;
for (let i = 0; i < children.length; i++) addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);
}
originalRecord = originalRecord || matcher;
}
return originalMatcher ? () => {
removeRoute(originalMatcher);
} : noop$1;
}
function removeRoute(matcherRef) {
if (isRouteName(matcherRef)) {
const matcher = matcherMap.get(matcherRef);
if (matcher) {
matcherMap.delete(matcherRef);
matchers.splice(matchers.indexOf(matcher), 1);
matcher.children.forEach(removeRoute);
matcher.alias.forEach(removeRoute);
}
} else {
const index = matchers.indexOf(matcherRef);
if (index > -1) {
matchers.splice(index, 1);
if (matcherRef.record.name) matcherMap.delete(matcherRef.record.name);
matcherRef.children.forEach(removeRoute);
matcherRef.alias.forEach(removeRoute);
}
}
}
function getRoutes() {
return matchers;
}
function insertMatcher(matcher) {
const index = findInsertionIndex(matcher, matchers);
matchers.splice(index, 0, matcher);
if (matcher.record.name && !isAliasRecord(matcher)) matcherMap.set(matcher.record.name, matcher);
}
function resolve(location, currentLocation) {
let matcher;
let params = {};
let path;
let name;
if ("name" in location && location.name) {
matcher = matcherMap.get(location.name);
if (!matcher) throw createRouterError(1, { location });
name = matcher.record.name;
params = assign(pickParams(currentLocation.params, matcher.keys.filter((k) => !k.optional).concat(matcher.parent ? matcher.parent.keys.filter((k) => k.optional) : []).map((k) => k.name)), location.params && pickParams(location.params, matcher.keys.map((k) => k.name)));
path = matcher.stringify(params);
} else if (location.path != null) {
path = location.path;
matcher = matchers.find((m) => m.re.test(path));
if (matcher) {
params = matcher.parse(path);
name = matcher.record.name;
matcher.keys.forEach((key) => {
if (key.optional && !params[key.name]) delete params[key.name];
});
}
} else {
matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m) => m.re.test(currentLocation.path));
if (!matcher) throw createRouterError(1, {
location,
currentLocation
});
name = matcher.record.name;
params = assign({}, currentLocation.params, location.params);
path = matcher.stringify(params);
}
const matched = [];
let parentMatcher = matcher;
while (parentMatcher) {
matched.unshift(parentMatcher.record);
parentMatcher = parentMatcher.parent;
}
return {
name,
path,
params,
matched,
meta: mergeMetaFields(matched)
};
}
routes.forEach((route) => addRoute(route));
function clearRoutes() {
matchers.length = 0;
matcherMap.clear();
}
return {
addRoute,
resolve,
removeRoute,
clearRoutes,
getRoutes,
getRecordMatcher
};
}
/**
* Picks an object param to contain only specified keys.
*
* @param params - params object to pick from
* @param keys - keys to pick
*/
function pickParams(params, keys) {
const newParams = {};
for (const key of keys) if (key in params) newParams[key] = params[key];
return newParams;
}
/**
* Normalizes a RouteRecordRaw. Creates a copy
*
* @param record
* @returns the normalized version
*/
function normalizeRouteRecord(record) {
const normalized = {
path: record.path,
redirect: record.redirect,
name: record.name,
meta: record.meta || {},
aliasOf: record.aliasOf,
beforeEnter: record.beforeEnter,
props: normalizeRecordProps(record),
children: record.children || [],
instances: {},
leaveGuards: /* @__PURE__ */ new Set(),
updateGuards: /* @__PURE__ */ new Set(),
enterCallbacks: {},
components: "components" in record ? record.components || null : record.component && { default: record.component }
};
Object.defineProperty(normalized, "mods", { value: {} });
return normalized;
}
/**
* Normalize the optional `props` in a record to always be an object similar to
* components. Also accept a boolean for components.
* @param record
*/
function normalizeRecordProps(record) {
const propsObject = {};
const props = record.props || false;
if ("component" in record) propsObject.default = props;
else for (const name in record.components) propsObject[name] = typeof props === "object" ? props[name] : props;
return propsObject;
}
/**
* Checks if a record or any of its parent is an alias
* @param record
*/
function isAliasRecord(record) {
while (record) {
if (record.record.aliasOf) return true;
record = record.parent;
}
return false;
}
/**
* Merge meta fields of an array of records
*
* @param matched - array of matched records
*/
function mergeMetaFields(matched) {
return matched.reduce((meta, record) => assign(meta, record.meta), {});
}
/**
* Performs a binary search to find the correct insertion index for a new matcher.
*
* Matchers are primarily sorted by their score. If scores are tied then we also consider parent/child relationships,
* with descendants coming before ancestors. If there's still a tie, new routes are inserted after existing routes.
*
* @param matcher - new matcher to be inserted
* @param matchers - existing matchers
*/
function findInsertionIndex(matcher, matchers) {
let lower = 0;
let upper = matchers.length;
while (lower !== upper) {
const mid = lower + upper >> 1;
if (comparePathParserScore(matcher, matchers[mid]) < 0) upper = mid;
else lower = mid + 1;
}
const insertionAncestor = getInsertionAncestor(matcher);
if (insertionAncestor) upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
return upper;
}
function getInsertionAncestor(matcher) {
let ancestor = matcher;
while (ancestor = ancestor.parent) if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0) return ancestor;
}
/**
* Checks if a matcher can be reachable. This means if it's possible to reach it as a route. For example, routes without
* a component, or name, or redirect, are just used to group other routes.
* @param matcher
* @param matcher.record record of the matcher
* @returns
*/
function isMatchable({ record }) {
return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
}
/**
* Returns the internal behavior of a {@link RouterLink} without the rendering part.
*
* @param props - a `to` location and an optional `replace` flag
*/
function useLink(props) {
const router = inject(routerKey);
const currentRoute = inject(routeLocationKey);
const route = computed(() => {
const to = unref(props.to);
return router.resolve(to);
});
const activeRecordIndex = computed(() => {
const { matched } = route.value;
const { length } = matched;
const routeMatched = matched[length - 1];
const currentMatched = currentRoute.matched;
if (!routeMatched || !currentMatched.length) return -1;
const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
if (index > -1) return index;
const parentRecordPath = getOriginalPath(matched[length - 2]);
return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index;
});
const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
function navigate(e = {}) {
if (guardEvent(e)) {
const p = router[unref(props.replace) ? "replace" : "push"](unref(props.to)).catch(noop$1);
if (props.viewTransition && typeof document !== "undefined" && "startViewTransition" in document) document.startViewTransition(() => p);
return p;
}
return Promise.resolve();
}
/**
* NOTE: update {@link _RouterLinkI}'s `$slots` type when updating this
*/
return {
route,
href: computed(() => route.value.href),
isActive,
isExactActive,
navigate
};
}
function preferSingleVNode(vnodes) {
return vnodes.length === 1 ? vnodes[0] : vnodes;
}
/**
* Component to render a link that triggers a navigation on click.
*/
var RouterLink = /* @__PURE__ */ defineComponent({
name: "RouterLink",
compatConfig: { MODE: 3 },
props: {
to: {
type: [String, Object],
required: true
},
replace: Boolean,
activeClass: String,
exactActiveClass: String,
custom: Boolean,
ariaCurrentValue: {
type: String,
default: "page"
},
viewTransition: Boolean
},
useLink,
setup(props, { slots }) {
const link = /* @__PURE__ */ reactive(useLink(props));
const { options } = inject(routerKey);
const elClass = computed(() => ({
[getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
[getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
}));
return () => {
const children = slots.default && preferSingleVNode(slots.default(link));
return props.custom ? children : h("a", {
"aria-current": link.isExactActive ? props.ariaCurrentValue : null,
href: link.href,
onClick: link.navigate,
class: elClass.value
}, children);
};
}
});
function guardEvent(e) {
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
if (e.defaultPrevented) return;
if (e.button !== void 0 && e.button !== 0) return;
if (e.currentTarget && e.currentTarget.getAttribute) {
const target = e.currentTarget.getAttribute("target");
if (/\b_blank\b/i.test(target)) return;
}
if (e.preventDefault) e.preventDefault();
return true;
}
function includesParams(outer, inner) {
for (const key in inner) {
const innerValue = inner[key];
const outerValue = outer[key];
if (typeof innerValue === "string") {
if (innerValue !== outerValue) return false;
} else if (!isArray(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value.valueOf() !== outerValue[i].valueOf())) return false;
}
return true;
}
/**
* Get the original path value of a record by following its aliasOf
* @param record
*/
function getOriginalPath(record) {
return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
}
/**
* Utility class to get the active class based on defaults.
* @param propClass
* @param globalClass
* @param defaultClass
*/
var getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
var RouterViewImpl = /* @__PURE__ */ defineComponent({
name: "RouterView",
inheritAttrs: false,
props: {
name: {
type: String,
default: "default"
},
route: Object
},
compatConfig: { MODE: 3 },
setup(props, { attrs, slots }) {
const injectedRoute = inject(routerViewLocationKey);
const routeToDisplay = computed(() => props.route || injectedRoute.value);
const injectedDepth = inject(viewDepthKey, 0);
const depth = computed(() => {
let initialDepth = unref(injectedDepth);
const { matched } = routeToDisplay.value;
let matchedRoute;
while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) initialDepth++;
return initialDepth;
});
const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
provide(viewDepthKey, computed(() => depth.value + 1));
provide(matchedRouteKey, matchedRouteRef);
provide(routerViewLocationKey, routeToDisplay);
const viewRef = /* @__PURE__ */ ref();
watch(() => [
viewRef.value,
matchedRouteRef.value,
props.name
], ([instance, to, name], [oldInstance, from, _oldName]) => {
if (to) {
to.instances[name] = instance;
if (from && from !== to && instance && instance === oldInstance) {
if (!to.leaveGuards.size) to.leaveGuards = from.leaveGuards;
if (!to.updateGuards.size) to.updateGuards = from.updateGuards;
}
}
if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance)) (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
}, { flush: "post" });
return () => {
const route = routeToDisplay.value;
const currentName = props.name;
const matchedRoute = matchedRouteRef.value;
const ViewComponent = matchedRoute && matchedRoute.components[currentName];
if (!ViewComponent) return normalizeSlot(slots.default, {
Component: ViewComponent,
route
});
const routePropsOption = matchedRoute.props[currentName];
const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
const onVnodeUnmounted = (vnode) => {
if (vnode.component.isUnmounted) matchedRoute.instances[currentName] = null;
};
const component = h(ViewComponent, assign({}, routeProps, attrs, {
onVnodeUnmounted,
ref: viewRef
}));
return normalizeSlot(slots.default, {
Component: component,
route
}) || component;
};
}
});
function normalizeSlot(slot, data) {
if (!slot) return null;
const slotContent = slot(data);
return slotContent.length === 1 ? slotContent[0] : slotContent;
}
/**
* Component to display the current route the user is at.
*/
var RouterView = RouterViewImpl;
/**
* Creates a Router instance that can be used by a Vue app.
*
* @param options - {@link RouterOptions}
*/
function createRouter(options) {
const matcher = createRouterMatcher(options.routes, options);
const parseQuery$1 = options.parseQuery || parseQuery;
const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
const routerHistory = options.history;
const beforeGuards = useCallbacks();
const beforeResolveGuards = useCallbacks();
const afterGuards = useCallbacks();
const currentRoute = /* @__PURE__ */ shallowRef(START_LOCATION_NORMALIZED);
let pendingLocation = START_LOCATION_NORMALIZED;
if (isBrowser && options.scrollBehavior && "scrollRestoration" in history) history.scrollRestoration = "manual";
const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
const encodeParams = applyToParams.bind(null, encodeParam);
const decodeParams = applyToParams.bind(null, decode);
function addRoute(parentOrRoute, route) {
let parent;
let record;
if (isRouteName(parentOrRoute)) {
parent = matcher.getRecordMatcher(parentOrRoute);
record = route;
} else record = parentOrRoute;
return matcher.addRoute(record, parent);
}
function removeRoute(name) {
const recordMatcher = matcher.getRecordMatcher(name);
if (recordMatcher) matcher.removeRoute(recordMatcher);
}
function getRoutes() {
return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
}
function hasRoute(name) {
return !!matcher.getRecordMatcher(name);
}
function resolve(rawLocation, currentLocation) {
currentLocation = assign({}, currentLocation || currentRoute.value);
if (typeof rawLocation === "string") {
const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
const matchedRoute = matcher.resolve({ path: locationNormalized.path }, currentLocation);
const href = routerHistory.createHref(locationNormalized.fullPath);
return assign(locationNormalized, matchedRoute, {
params: decodeParams(matchedRoute.params),
redirectedFrom: void 0,
href
});
}
let matcherLocation;
if (rawLocation.path != null) matcherLocation = assign({}, rawLocation, { path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path });
else {
const targetParams = assign({}, rawLocation.params);
for (const key in targetParams) if (targetParams[key] == null) delete targetParams[key];
matcherLocation = assign({}, rawLocation, { params: encodeParams(targetParams) });
currentLocation.params = encodeParams(currentLocation.params);
}
const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
const hash = rawLocation.hash || "";
matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
const fullPath = stringifyURL(stringifyQuery$1, assign({}, rawLocation, {
hash: encodeHash(hash),
path: matchedRoute.path
}));
const href = routerHistory.createHref(fullPath);
return assign({
fullPath,
hash,
query: stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
}, matchedRoute, {
redirectedFrom: void 0,
href
});
}
function locationAsObject(to) {
return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign({}, to);
}
function checkCanceledNavigation(to, from) {
if (pendingLocation !== to) return createRouterError(8, {
from,
to
});
}
function push(to) {
return pushWithRedirect(to);
}
function replace(to) {
return push(assign(locationAsObject(to), { replace: true }));
}
function handleRedirectRecord(to, from) {
const lastMatched = to.matched[to.matched.length - 1];
if (lastMatched && lastMatched.redirect) {
const { redirect } = lastMatched;
let newTargetLocation = typeof redirect === "function" ? redirect(to, from) : redirect;
if (typeof newTargetLocation === "string") {
newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : { path: newTargetLocation };
newTargetLocation.params = {};
}
return assign({
query: to.query,
hash: to.hash,
params: newTargetLocation.path != null ? {} : to.params
}, newTargetLocation);
}
}
function pushWithRedirect(to, redirectedFrom) {
const targetLocation = pendingLocation = resolve(to);
const from = currentRoute.value;
const data = to.state;
const force = to.force;
const replace = to.replace === true;
const shouldRedirect = handleRedirectRecord(targetLocation, from);
if (shouldRedirect) return pushWithRedirect(assign(locationAsObject(shouldRedirect), {
state: typeof shouldRedirect === "object" ? assign({}, data, shouldRedirect.state) : data,
force,
replace
}), redirectedFrom || targetLocation);
const toLocation = targetLocation;
toLocation.redirectedFrom = redirectedFrom;
let failure;
if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
failure = createRouterError(16, {
to: toLocation,
from
});
handleScroll(from, from, true, false);
}
return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, 2) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure) => {
if (failure) {
if (isNavigationFailure(failure, 2)) return pushWithRedirect(assign({ replace }, locationAsObject(failure.to), {
state: typeof failure.to === "object" ? assign({}, data, failure.to.state) : data,
force
}), redirectedFrom || toLocation);
} else failure = finalizeNavigation(toLocation, from, true, replace, data);
triggerAfterEach(toLocation, from, failure);
return failure;
});
}
/**
* Helper to reject and skip all navigation guards if a new navigation happened
* @param to
* @param from
*/
function checkCanceledNavigationAndReject(to, from) {
const error = checkCanceledNavigation(to, from);
return error ? Promise.reject(error) : Promise.resolve();
}
function runWithContext(fn) {
const app = installedApps.values().next().value;
return app && typeof app.runWithContext === "function" ? app.runWithContext(fn) : fn();
}
function navigate(to, from) {
let guards;
const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
for (const record of leavingRecords) record.leaveGuards.forEach((guard) => {
guards.push(guardToPromiseFn(guard, to, from));
});
const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
guards.push(canceledNavigationCheck);
return runGuardQueue(guards).then(() => {
guards = [];
for (const guard of beforeGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
for (const record of updatingRecords) record.updateGuards.forEach((guard) => {
guards.push(guardToPromiseFn(guard, to, from));
});
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
guards = [];
for (const record of enteringRecords) if (record.beforeEnter) if (isArray(record.beforeEnter)) for (const beforeEnter of record.beforeEnter) guards.push(guardToPromiseFn(beforeEnter, to, from));
else guards.push(guardToPromiseFn(record.beforeEnter, to, from));
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
to.matched.forEach((record) => record.enterCallbacks = {});
guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
guards = [];
for (const guard of beforeResolveGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).catch((err) => isNavigationFailure(err, 8) ? err : Promise.reject(err));
}
function triggerAfterEach(to, from, failure) {
afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
}
/**
* - Cleans up any navigation guards
* - Changes the url if necessary
* - Calls the scrollBehavior
*/
function finalizeNavigation(toLocation, from, isPush, replace, data) {
const error = checkCanceledNavigation(toLocation, from);
if (error) return error;
const isFirstNavigation = from === START_LOCATION_NORMALIZED;
const state = !isBrowser ? {} : history.state;
if (isPush) if (replace || isFirstNavigation) routerHistory.replace(toLocation.fullPath, assign({ scroll: isFirstNavigation && state && state.scroll }, data));
else routerHistory.push(toLocation.fullPath, data);
currentRoute.value = toLocation;
handleScroll(toLocation, from, isPush, isFirstNavigation);
markAsReady();
}
let removeHistoryListener;
function setupListeners() {
if (removeHistoryListener) return;
removeHistoryListener = routerHistory.listen((to, _from, info) => {
if (!router.listening) return;
const toLocation = resolve(to);
const shouldRedirect = handleRedirectRecord(toLocation, router.currentRoute.value);
if (shouldRedirect) {
pushWithRedirect(assign(shouldRedirect, {
replace: true,
force: true
}), toLocation).catch(noop$1);
return;
}
pendingLocation = toLocation;
const from = currentRoute.value;
if (isBrowser) saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
navigate(toLocation, from).catch((error) => {
if (isNavigationFailure(error, 12)) return error;
if (isNavigationFailure(error, 2)) {
pushWithRedirect(assign(locationAsObject(error.to), { force: true }), toLocation).then((failure) => {
if (isNavigationFailure(failure, 20) && !info.delta && info.type === "pop") routerHistory.go(-1, false);
}).catch(noop$1);
return Promise.reject();
}
if (info.delta) routerHistory.go(-info.delta, false);
return triggerError(error, toLocation, from);
}).then((failure) => {
failure = failure || finalizeNavigation(toLocation, from, false);
if (failure) {
if (info.delta && !isNavigationFailure(failure, 8)) routerHistory.go(-info.delta, false);
else if (info.type === "pop" && isNavigationFailure(failure, 20)) routerHistory.go(-1, false);
}
triggerAfterEach(toLocation, from, failure);
}).catch(noop$1);
});
}
let readyHandlers = useCallbacks();
let errorListeners = useCallbacks();
let ready;
/**
* Trigger errorListeners added via onError and throws the error as well
*
* @param error - error to throw
* @param to - location we were navigating to when the error happened
* @param from - location we were navigating from when the error happened
* @returns the error as a rejected promise
*/
function triggerError(error, to, from) {
markAsReady(error);
const list = errorListeners.list();
if (list.length) list.forEach((handler) => handler(error, to, from));
else console.error(error);
return Promise.reject(error);
}
function isReady() {
if (ready && currentRoute.value !== START_LOCATION_NORMALIZED) return Promise.resolve();
return new Promise((resolve, reject) => {
readyHandlers.add([resolve, reject]);
});
}
function markAsReady(err) {
if (!ready) {
ready = !err;
setupListeners();
readyHandlers.list().forEach(([resolve, reject]) => err ? reject(err) : resolve());
readyHandlers.reset();
}
return err;
}
function handleScroll(to, from, isPush, isFirstNavigation) {
const { scrollBehavior } = options;
if (!isBrowser || !scrollBehavior) return Promise.resolve();
const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
}
const go = (delta) => routerHistory.go(delta);
let started;
const installedApps = /* @__PURE__ */ new Set();
const router = {
currentRoute,
listening: true,
addRoute,
removeRoute,
clearRoutes: matcher.clearRoutes,
hasRoute,
getRoutes,
resolve,
options,
push,
replace,
go,
back: () => go(-1),
forward: () => go(1),
beforeEach: beforeGuards.add,
beforeResolve: beforeResolveGuards.add,
afterEach: afterGuards.add,
onError: errorListeners.add,
isReady,
install(app) {
app.component("RouterLink", RouterLink);
app.component("RouterView", RouterView);
app.config.globalProperties.$router = router;
Object.defineProperty(app.config.globalProperties, "$route", {
enumerable: true,
get: () => unref(currentRoute)
});
if (isBrowser && !started && currentRoute.value === START_LOCATION_NORMALIZED) {
started = true;
push(routerHistory.location).catch((err) => {});
}
const reactiveRoute = {};
for (const key in START_LOCATION_NORMALIZED) Object.defineProperty(reactiveRoute, key, {
get: () => currentRoute.value[key],
enumerable: true
});
app.provide(routerKey, router);
app.provide(routeLocationKey, /* @__PURE__ */ shallowReactive(reactiveRoute));
app.provide(routerViewLocationKey, currentRoute);
const unmountApp = app.unmount;
installedApps.add(app);
app.unmount = function() {
installedApps.delete(app);
if (installedApps.size < 1) {
pendingLocation = START_LOCATION_NORMALIZED;
removeHistoryListener && removeHistoryListener();
removeHistoryListener = null;
currentRoute.value = START_LOCATION_NORMALIZED;
started = false;
ready = false;
}
unmountApp();
};
}
};
function runGuardQueue(guards) {
return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
}
return router;
}
//#endregion
//#region \0vite/preload-helper.js
var scriptRel = "modulepreload";
var assetsURL = function(dep, importerUrl) {
return new URL(dep, importerUrl).href;
};
var seen = {};
var __vitePreload = function preload(baseModule, deps, importerUrl) {
let promise = Promise.resolve();
if (deps && deps.length > 0) {
const links = document.getElementsByTagName("link");
const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
function allSettled(promises) {
return Promise.all(promises.map((p) => Promise.resolve(p).then((value) => ({
status: "fulfilled",
value
}), (reason) => ({
status: "rejected",
reason
}))));
}
promise = allSettled(deps.map((dep) => {
dep = assetsURL(dep, importerUrl);
if (dep in seen) return;
seen[dep] = true;
const isCss = dep.endsWith(".css");
const cssSelector = isCss ? "[rel=\"stylesheet\"]" : "";
if (!!importerUrl) for (let i = links.length - 1; i >= 0; i--) {
const link = links[i];
if (link.href === dep && (!isCss || link.rel === "stylesheet")) return;
}
else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) return;
const link = document.createElement("link");
link.rel = isCss ? "stylesheet" : scriptRel;
if (!isCss) link.as = "script";
link.crossOrigin = "";
link.href = dep;
if (cspNonce) link.setAttribute("nonce", cspNonce);
document.head.appendChild(link);
if (isCss) return new Promise((res, rej) => {
link.addEventListener("load", res);
link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
});
}));
}
function handlePreloadError(err) {
const e = new Event("vite:preloadError", { cancelable: true });
e.payload = err;
window.dispatchEvent(e);
if (!e.defaultPrevented) throw err;
}
return promise.then((res) => {
for (const item of res || []) {
if (item.status !== "rejected") continue;
handlePreloadError(item.reason);
}
return baseModule().catch(handlePreloadError);
});
};
//#endregion
//#region ../../../../../__vue-router/auto-routes
var routes = [{
path: "/",
name: "/",
component: () => __vitePreload(() => import("./pages-DdhL9w1X.js"), __vite__mapDeps([0,1,2,3,4,5]), import.meta.url),
children: [
{
path: ":all(.*)",
name: "//[...all]",
component: () => __vitePreload(() => import("./_...all_-CJOf_DG4.js"), __vite__mapDeps([6,3]), import.meta.url)
},
{
path: "metric",
name: "//metric",
component: () => __vitePreload(() => import("./metric-C8F-56Ym.js"), __vite__mapDeps([7,8,5,4,2,3]), import.meta.url)
},
{
path: "module",
name: "//module",
component: () => __vitePreload(() => import("./module-CdxQsEe1.js"), __vite__mapDeps([9,8,1,2,3,4,10]), import.meta.url)
},
{
path: "plugins",
name: "//plugins",
component: () => __vitePreload(() => import("./plugins-C6i3iKye.js"), __vite__mapDeps([11,2,3]), import.meta.url)
}
]
}];
//#endregion
//#region node_modules/.pnpm/@vueuse+shared@14.3.0_vue@3.5.35_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
/**
* Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
*
* @param fn
*/
function tryOnScopeDispose(fn, failSilently) {
if (getCurrentScope()) {
onScopeDispose(fn, failSilently);
return true;
}
return false;
}
/**
* Utility for creating event hooks
*
* @see https://vueuse.org/createEventHook
*
* @__NO_SIDE_EFFECTS__
*/
function createEventHook() {
const fns = /* @__PURE__ */ new Set();
const off = (fn) => {
fns.delete(fn);
};
const clear = () => {
fns.clear();
};
const on = (fn) => {
fns.add(fn);
const offFn = () => off(fn);
tryOnScopeDispose(offFn);
return { off: offFn };
};
const trigger = (...args) => {
return Promise.all(Array.from(fns).map((fn) => fn(...args)));
};
return {
on,
off,
trigger,
clear
};
}
var localProvidedStateMap = /* @__PURE__ */ new WeakMap();
/**
* On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.
*
* @example
* ```ts
* injectLocal('MyInjectionKey', 1)
* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1
* ```
*
* @__NO_SIDE_EFFECTS__
*/
var injectLocal = (...args) => {
var _getCurrentInstance;
const key = args[0];
const instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;
const owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();
if (owner == null && !hasInjectionContext()) throw new Error("injectLocal must be called in setup");
if (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];
return inject(...args);
};
var isClient = typeof window !== "undefined" && typeof document !== "undefined";
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
var toString = Object.prototype.toString;
var isObject = (val) => toString.call(val) === "[object Object]";
var noop = () => {};
function toRef(...args) {
if (args.length !== 1) return /* @__PURE__ */ toRef$1(...args);
const r = args[0];
return typeof r === "function" ? /* @__PURE__ */ readonly(customRef(() => ({
get: r,
set: noop
}))) : /* @__PURE__ */ ref(r);
}
/**
* @internal
*/
function createFilterWrapper(filter, fn) {
function wrapper(...args) {
return new Promise((resolve, reject) => {
Promise.resolve(filter(() => fn.apply(this, args), {
fn,
thisArg: this,
args
})).then(resolve).catch(reject);
});
}
return wrapper;
}
var bypassFilter = (invoke) => {
return invoke();
};
/**
* EventFilter that gives extra controls to pause and resume the filter
*
* @param extendFilter Extra filter to apply when the PausableFilter is active, default to none
* @param options Options to configure the filter
*/
function pausableFilter(extendFilter = bypassFilter, options = {}) {
const { initialState = "active" } = options;
const isActive = toRef(initialState === "active");
function pause() {
isActive.value = false;
}
function resume() {
isActive.value = true;
}
const eventFilter = (...args) => {
if (isActive.value) extendFilter(...args);
};
return {
isActive: /* @__PURE__ */ shallowReadonly(isActive),
pause,
resume,
eventFilter
};
}
/**
* Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client
*/
function pxValue(px) {
return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
}
function toArray(value) {
return Array.isArray(value) ? value : [value];
}
function getLifeCycleTarget(target) {
return target || getCurrentInstance();
}
function watchWithFilter(source, cb, options = {}) {
const { eventFilter = bypassFilter, ...watchOptions } = options;
return watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
}
/** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */
function watchPausable(source, cb, options = {}) {
const { eventFilter: filter, initialState = "active", ...watchOptions } = options;
const { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });
return {
stop: watchWithFilter(source, cb, {
...watchOptions,
eventFilter
}),
pause,
resume,
isActive
};
}
/**
* Call onMounted() if it's inside a component lifecycle, if not, just call the function
*
* @param fn
* @param sync if set to false, it will run in the nextTick() of Vue
* @param target
*/
function tryOnMounted(fn, sync = true, target) {
if (getLifeCycleTarget(target)) onMounted(fn, target);
else if (sync) fn();
else nextTick(fn);
}
/**
* A boolean ref with a toggler
*
* @see https://vueuse.org/useToggle
* @param [initialValue]
* @param options
*
* @__NO_SIDE_EFFECTS__
*/
function useToggle(initialValue = false, options = {}) {
const { truthyValue = true, falsyValue = false } = options;
const valueIsRef = /* @__PURE__ */ isRef(initialValue);
const _value = /* @__PURE__ */ shallowRef(initialValue);
function toggle(value) {
if (arguments.length) {
_value.value = value;
return _value.value;
} else {
const truthy = toValue(truthyValue);
_value.value = _value.value === truthy ? toValue(falsyValue) : truthy;
return _value.value;
}
}
if (valueIsRef) return toggle;
else return [_value, toggle];
}
/**
* Shorthand for watching value with {immediate: true}
*
* @see https://vueuse.org/watchImmediate
*/
function watchImmediate(source, cb, options) {
return watch(source, cb, {
...options,
immediate: true
});
}
//#endregion
//#region node_modules/.pnpm/@vueuse+core@14.3.0_vue@3.5.35_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
var defaultWindow = isClient ? window : void 0;
isClient && window.document;
isClient && window.navigator;
isClient && window.location;
/**
* Get the dom element of a ref of element or Vue component instance
*
* @param elRef
*/
function unrefElement(elRef) {
var _$el;
const plain = toValue(elRef);
return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;
}
function useEventListener(...args) {
const register = (el, event, listener, options) => {
el.addEventListener(event, listener, options);
return () => el.removeEventListener(event, listener, options);
};
const firstParamTargets = computed(() => {
const test = toArray(toValue(args[0])).filter((e) => e != null);
return test.every((e) => typeof e !== "string") ? test : void 0;
});
return watchImmediate(() => {
var _firstParamTargets$va, _firstParamTargets$va2;
return [
(_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),
toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
toArray(unref(firstParamTargets.value ? args[2] : args[1])),
toValue(firstParamTargets.value ? args[3] : args[2])
];
}, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {
if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;
const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));
onCleanup(() => {
cleanups.forEach((fn) => fn());
});
}, { flush: "post" });
}
/**
* Mounted state in ref.
*
* @see https://vueuse.org/useMounted
*
* @__NO_SIDE_EFFECTS__
*/
function useMounted() {
const isMounted = /* @__PURE__ */ shallowRef(false);
const instance = getCurrentInstance();
if (instance) onMounted(() => {
isMounted.value = true;
}, instance);
return isMounted;
}
/* @__NO_SIDE_EFFECTS__ */
function useSupported(callback) {
const isMounted = useMounted();
return computed(() => {
isMounted.value;
return Boolean(callback());
});
}
function createKeyPredicate(keyFilter) {
if (typeof keyFilter === "function") return keyFilter;
else if (typeof keyFilter === "string") return (event) => event.key === keyFilter;
else if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key);
return () => true;
}
function onKeyStroke(...args) {
let key;
let handler;
let options = {};
if (args.length === 3) {
key = args[0];
handler = args[1];
options = args[2];
} else if (args.length === 2) if (typeof args[1] === "object") {
key = true;
handler = args[0];
options = args[1];
} else {
key = args[0];
handler = args[1];
}
else {
key = true;
handler = args[0];
}
const { target = defaultWindow, eventName = "keydown", passive = false, dedupe = false } = options;
const predicate = createKeyPredicate(key);
const listener = (e) => {
if (e.repeat && toValue(dedupe)) return;
if (predicate(e)) handler(e);
};
return useEventListener(target, eventName, listener, passive);
}
/**
* Listen to the keydown event of the given key.
*
* @see https://vueuse.org/onKeyStroke
* @param key
* @param handler
* @param options
*/
function onKeyDown(key, handler, options = {}) {
return onKeyStroke(key, handler, {
...options,
eventName: "keydown"
});
}
var ssrWidthSymbol = Symbol("vueuse-ssr-width");
/* @__NO_SIDE_EFFECTS__ */
function useSSRWidth() {
const ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;
return typeof ssrWidth === "number" ? ssrWidth : void 0;
}
/**
* Reactive Media Query.
*
* @see https://vueuse.org/useMediaQuery
* @param query
* @param options
*/
function useMediaQuery(query, options = {}) {
const { window = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
const isSupported = /* @__PURE__ */ useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
const ssrSupport = /* @__PURE__ */ shallowRef(typeof ssrWidth === "number");
const mediaQuery = /* @__PURE__ */ shallowRef();
const matches = /* @__PURE__ */ shallowRef(false);
const handler = (event) => {
matches.value = event.matches;
};
watchEffect(() => {
if (ssrSupport.value) {
ssrSupport.value = !isSupported.value;
matches.value = toValue(query).split(",").some((queryString) => {
const not = queryString.includes("not all");
const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
let res = Boolean(minWidth || maxWidth);
if (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);
if (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);
return not ? !res : res;
});
return;
}
if (!isSupported.value) return;
mediaQuery.value = window.matchMedia(toValue(query));
matches.value = mediaQuery.value.matches;
});
useEventListener(mediaQuery, "change", handler, { passive: true });
return computed(() => matches.value);
}
var _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
var globalKey = "__vueuse_ssr_handlers__";
var handlers = /* @__PURE__ */ getHandlers();
function getHandlers() {
if (!(globalKey in _global)) _global[globalKey] = _global[globalKey] || {};
return _global[globalKey];
}
function getSSRHandler(key, fallback) {
return handlers[key] || fallback;
}
/**
* Reactive dark theme preference.
*
* @see https://vueuse.org/usePreferredDark
* @param [options]
*
* @__NO_SIDE_EFFECTS__
*/
function usePreferredDark(options) {
return useMediaQuery("(prefers-color-scheme: dark)", options);
}
function guessSerializerType(rawInit) {
return rawInit == null ? "any" : rawInit instanceof Set ? "set" : rawInit instanceof Map ? "map" : rawInit instanceof Date ? "date" : typeof rawInit === "boolean" ? "boolean" : typeof rawInit === "string" ? "string" : typeof rawInit === "object" ? "object" : !Number.isNaN(rawInit) ? "number" : "any";
}
var StorageSerializers = {
boolean: {
read: (v) => v === "true",
write: (v) => String(v)
},
object: {
read: (v) => JSON.parse(v),
write: (v) => JSON.stringify(v)
},
number: {
read: (v) => Number.parseFloat(v),
write: (v) => String(v)
},
any: {
read: (v) => v,
write: (v) => String(v)
},
string: {
read: (v) => v,
write: (v) => String(v)
},
map: {
read: (v) => new Map(JSON.parse(v)),
write: (v) => JSON.stringify(Array.from(v.entries()))
},
set: {
read: (v) => new Set(JSON.parse(v)),
write: (v) => JSON.stringify(Array.from(v))
},
date: {
read: (v) => new Date(v),
write: (v) => v.toISOString()
}
};
var customStorageEventName = "vueuse-storage";
/**
* Reactive LocalStorage/SessionStorage.
*
* @see https://vueuse.org/useStorage
*/
function useStorage(key, defaults, storage, options = {}) {
var _options$serializer;
const { flush = "pre", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window = defaultWindow, eventFilter, onError = (e) => {
console.error(e);
}, initOnMounted } = options;
const data = (shallow ? shallowRef : ref)(typeof defaults === "function" ? defaults() : defaults);
const keyComputed = computed(() => toValue(key));
if (!storage) try {
storage = getSSRHandler("getDefaultStorage", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();
} catch (e) {
onError(e);
}
if (!storage) return data;
const rawInit = toValue(defaults);
const type = guessSerializerType(rawInit);
const serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];
const { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, (newValue) => write(newValue), {
flush,
deep,
eventFilter
});
watch(keyComputed, () => update(), { flush });
let firstMounted = false;
const onStorageEvent = (ev) => {
if (initOnMounted && !firstMounted) return;
update(ev);
};
const onStorageCustomEvent = (ev) => {
if (initOnMounted && !firstMounted) return;
updateFromCustomEvent(ev);
};
/**
* The custom event is needed for same-document syncing when using custom
* storage backends, but it doesn't work across different documents.
*
* TODO: Consider implementing a BroadcastChannel-based solution that fixes this.
*/
if (window && listenToStorageChanges) if (storage instanceof Storage) useEventListener(window, "storage", onStorageEvent, { passive: true });
else useEventListener(window, customStorageEventName, onStorageCustomEvent);
if (initOnMounted) tryOnMounted(() => {
firstMounted = true;
update();
});
else update();
function dispatchWriteEvent(oldValue, newValue) {
if (window) {
const payload = {
key: keyComputed.value,
oldValue,
newValue,
storageArea: storage
};
window.dispatchEvent(storage instanceof Storage ? new StorageEvent("storage", payload) : new CustomEvent(customStorageEventName, { detail: payload }));
}
}
function write(v) {
try {
const oldValue = storage.getItem(keyComputed.value);
if (v == null) {
dispatchWriteEvent(oldValue, null);
storage.removeItem(keyComputed.value);
} else {
const serialized = serializer.write(v);
if (oldValue !== serialized) {
storage.setItem(keyComputed.value, serialized);
dispatchWriteEvent(oldValue, serialized);
}
}
} catch (e) {
onError(e);
}
}
function read(event) {
const rawValue = event ? event.newValue : storage.getItem(keyComputed.value);
if (rawValue == null) {
if (writeDefaults && rawInit != null) storage.setItem(keyComputed.value, serializer.write(rawInit));
return rawInit;
} else if (!event && mergeDefaults) {
const value = serializer.read(rawValue);
if (typeof mergeDefaults === "function") return mergeDefaults(value, rawInit);
else if (type === "object" && !Array.isArray(value)) return {
...rawInit,
...value
};
return value;
} else if (typeof rawValue !== "string") return rawValue;
else return serializer.read(rawValue);
}
function update(event) {
if (event && event.storageArea !== storage) return;
if (event && event.key == null) {
data.value = rawInit;
return;
}
if (event && event.key !== keyComputed.value) return;
pauseWatch();
try {
const serializedData = serializer.write(data.value);
if (event === void 0 || (event === null || event === void 0 ? void 0 : event.newValue) !== serializedData) data.value = read(event);
} catch (e) {
onError(e);
} finally {
if (event) nextTick(resumeWatch);
else resumeWatch();
}
}
function updateFromCustomEvent(event) {
update(event.detail);
}
return data;
}
var CSS_DISABLE_TRANS = "*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
/**
* Reactive color mode with auto data persistence.
*
* @see https://vueuse.org/useColorMode
* @param options
*/
function useColorMode(options = {}) {
const { selector = "html", attribute = "class", initialValue = "auto", window = defaultWindow, storage, storageKey = "vueuse-color-scheme", listenToStorageChanges = true, storageRef, emitAuto, disableTransition = true } = options;
const modes = {
auto: "",
light: "light",
dark: "dark",
...options.modes || {}
};
const preferredDark = usePreferredDark({ window });
const system = computed(() => preferredDark.value ? "dark" : "light");
const store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, {
window,
listenToStorageChanges
}));
const state = computed(() => store.value === "auto" ? system.value : store.value);
const updateHTMLAttrs = getSSRHandler("updateHTMLAttrs", (selector, attribute, value) => {
const el = typeof selector === "string" ? window === null || window === void 0 ? void 0 : window.document.querySelector(selector) : unrefElement(selector);
if (!el) return;
const classesToAdd = /* @__PURE__ */ new Set();
const classesToRemove = /* @__PURE__ */ new Set();
let attributeToChange = null;
if (attribute === "class") {
const current = value.split(/\s/g);
Object.values(modes).flatMap((i) => (i || "").split(/\s/g)).filter(Boolean).forEach((v) => {
if (current.includes(v)) classesToAdd.add(v);
else classesToRemove.add(v);
});
} else attributeToChange = {
key: attribute,
value
};
if (classesToAdd.size === 0 && classesToRemove.size === 0 && attributeToChange === null) return;
let style;
if (disableTransition) {
style = window.document.createElement("style");
style.appendChild(document.createTextNode(CSS_DISABLE_TRANS));
window.document.head.appendChild(style);
}
for (const c of classesToAdd) el.classList.add(c);
for (const c of classesToRemove) el.classList.remove(c);
if (attributeToChange) el.setAttribute(attributeToChange.key, attributeToChange.value);
if (disableTransition) {
window.getComputedStyle(style).opacity;
document.head.removeChild(style);
}
});
function defaultOnChanged(mode) {
var _modes$mode;
updateHTMLAttrs(selector, attribute, (_modes$mode = modes[mode]) !== null && _modes$mode !== void 0 ? _modes$mode : mode);
}
function onChanged(mode) {
if (options.onChanged) options.onChanged(mode, defaultOnChanged);
else defaultOnChanged(mode);
}
watch(state, onChanged, {
flush: "post",
immediate: true
});
tryOnMounted(() => onChanged(state.value));
const auto = computed({
get() {
return emitAuto ? store.value : state.value;
},
set(v) {
store.value = v;
}
});
return Object.assign(auto, {
store,
system,
state
});
}
/**
* Reactive dark mode with auto data persistence.
*
* @see https://vueuse.org/useDark
* @param options
*/
function useDark(options = {}) {
const { valueDark = "dark", valueLight = "" } = options;
const mode = useColorMode({
...options,
onChanged: (mode, defaultHandler) => {
var _options$onChanged;
if (options.onChanged) (_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, mode === "dark", defaultHandler, mode);
else defaultHandler(mode);
},
modes: {
dark: valueDark,
light: valueLight
}
});
const system = computed(() => mode.system.value);
return computed({
get() {
return mode.value === "dark";
},
set(v) {
const modeVal = v ? "dark" : "light";
if (system.value === modeVal) mode.value = "auto";
else mode.value = modeVal;
}
});
}
/**
* Reports changes to the dimensions of an Element's content or the border-box
*
* @see https://vueuse.org/useResizeObserver
* @param target
* @param callback
* @param options
*/
function useResizeObserver(target, callback, options = {}) {
const { window = defaultWindow, ...observerOptions } = options;
let observer;
const isSupported = /* @__PURE__ */ useSupported(() => window && "ResizeObserver" in window);
const cleanup = () => {
if (observer) {
observer.disconnect();
observer = void 0;
}
};
const stopWatch = watch(computed(() => {
const _targets = toValue(target);
return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
}), (els) => {
cleanup();
if (isSupported.value && window) {
observer = new ResizeObserver(callback);
for (const _el of els) if (_el) observer.observe(_el, observerOptions);
}
}, {
immediate: true,
flush: "post"
});
const stop = () => {
cleanup();
stopWatch();
};
tryOnScopeDispose(stop);
return {
isSupported,
stop
};
}
/**
* Reactive size of an HTML element.
*
* @see https://vueuse.org/useElementSize
*/
function useElementSize(target, initialSize = {
width: 0,
height: 0
}, options = {}) {
const { window = defaultWindow, box = "content-box" } = options;
const isSVG = computed(() => {
var _unrefElement;
return (_unrefElement = unrefElement(target)) === null || _unrefElement === void 0 || (_unrefElement = _unrefElement.namespaceURI) === null || _unrefElement === void 0 ? void 0 : _unrefElement.includes("svg");
});
const width = /* @__PURE__ */ shallowRef(initialSize.width);
const height = /* @__PURE__ */ shallowRef(initialSize.height);
const { stop: stop1 } = useResizeObserver(target, ([entry]) => {
const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
if (window && isSVG.value) {
const $elem = unrefElement(target);
if ($elem) {
const rect = $elem.getBoundingClientRect();
width.value = rect.width;
height.value = rect.height;
}
} else if (boxSize) {
const formatBoxSize = toArray(boxSize);
width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
} else {
width.value = entry.contentRect.width;
height.value = entry.contentRect.height;
}
}, options);
tryOnMounted(() => {
const ele = unrefElement(target);
if (ele) {
width.value = "offsetWidth" in ele ? ele.offsetWidth : initialSize.width;
height.value = "offsetHeight" in ele ? ele.offsetHeight : initialSize.height;
}
});
const stop2 = watch(() => unrefElement(target), (ele) => {
width.value = ele ? initialSize.width : 0;
height.value = ele ? initialSize.height : 0;
});
function stop() {
stop1();
stop2();
}
return {
width,
height,
stop
};
}
/**
* Reactive LocalStorage.
*
* @see https://vueuse.org/useLocalStorage
* @param key
* @param initialValue
* @param options
*/
function useLocalStorage(key, initialValue, options = {}) {
const { window = defaultWindow } = options;
return useStorage(key, initialValue, window === null || window === void 0 ? void 0 : window.localStorage, options);
}
Number.POSITIVE_INFINITY;
/**
* Please consider using [`vue-virtual-scroller`](https://github.com/Akryum/vue-virtual-scroller) if you are looking for more features.
*/
function useVirtualList(list, options) {
const { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = "itemHeight" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);
return {
list: currentList,
scrollTo,
containerProps: {
ref: containerRef,
onScroll: () => {
calculateRange();
},
style: containerStyle
},
wrapperProps
};
}
function useVirtualListResources(list) {
const containerRef = /* @__PURE__ */ shallowRef(null);
const size = useElementSize(containerRef);
return {
state: /* @__PURE__ */ ref({
start: 0,
end: 10
}),
source: /* @__PURE__ */ shallowRef(list),
currentList: /* @__PURE__ */ ref([]),
size,
containerRef
};
}
function createGetViewCapacity(state, source, itemSize) {
return (containerSize) => {
if (typeof itemSize === "number") return Math.ceil(containerSize / itemSize);
const { start = 0 } = state.value;
let sum = 0;
let capacity = 0;
for (let i = start; i < source.value.length; i++) {
const size = itemSize(i);
sum += size;
capacity = i;
if (sum > containerSize) break;
}
return capacity - start;
};
}
function createGetOffset(source, itemSize) {
return (scrollDirection) => {
if (typeof itemSize === "number") return Math.floor(scrollDirection / itemSize) + 1;
let sum = 0;
let offset = 0;
for (let i = 0; i < source.value.length; i++) {
const size = itemSize(i);
sum += size;
if (sum >= scrollDirection) {
offset = i;
break;
}
}
return offset + 1;
};
}
function createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {
return () => {
const element = containerRef.value;
if (element) {
const offset = getOffset(type === "vertical" ? element.scrollTop : element.scrollLeft);
const viewCapacity = getViewCapacity(type === "vertical" ? element.clientHeight : element.clientWidth);
const from = offset - overscan;
const to = offset + viewCapacity + overscan;
state.value = {
start: from < 0 ? 0 : from,
end: to > source.value.length ? source.value.length : to
};
currentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({
data: ele,
index: index + state.value.start
}));
}
};
}
function createGetDistance(itemSize, source) {
return (index) => {
if (typeof itemSize === "number") return index * itemSize;
return source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);
};
}
function useWatchForSizes(size, listRef, containerRef, calculateRange) {
watch([
size.width,
size.height,
listRef,
containerRef
], () => {
calculateRange();
});
}
function createComputedTotalSize(itemSize, source) {
return computed(() => {
if (typeof itemSize === "number") return source.value.length * itemSize;
return source.value.reduce((sum, _, index) => sum + itemSize(index), 0);
});
}
var scrollToDictionaryForElementScrollKey = {
horizontal: "scrollLeft",
vertical: "scrollTop"
};
function createScrollTo(type, calculateRange, getDistance, containerRef) {
return (index) => {
if (containerRef.value) {
containerRef.value[scrollToDictionaryForElementScrollKey[type]] = getDistance(index);
calculateRange();
}
};
}
function useHorizontalVirtualList(options, list) {
const resources = useVirtualListResources(list);
const { state, source, currentList, size, containerRef } = resources;
const containerStyle = { overflowX: "auto" };
const { itemWidth, overscan = 5 } = options;
const getViewCapacity = createGetViewCapacity(state, source, itemWidth);
const calculateRange = createCalculateRange("horizontal", overscan, createGetOffset(source, itemWidth), getViewCapacity, resources);
const getDistanceLeft = createGetDistance(itemWidth, source);
const offsetLeft = computed(() => getDistanceLeft(state.value.start));
const totalWidth = createComputedTotalSize(itemWidth, source);
useWatchForSizes(size, source, containerRef, calculateRange);
return {
scrollTo: createScrollTo("horizontal", calculateRange, getDistanceLeft, containerRef),
calculateRange,
wrapperProps: computed(() => {
return { style: {
height: "100%",
width: `${totalWidth.value - offsetLeft.value}px`,
marginLeft: `${offsetLeft.value}px`,
display: "flex"
} };
}),
containerStyle,
currentList,
containerRef
};
}
function useVerticalVirtualList(options, list) {
const resources = useVirtualListResources(list);
const { state, source, currentList, size, containerRef } = resources;
const containerStyle = { overflowY: "auto" };
const { itemHeight, overscan = 5 } = options;
const getViewCapacity = createGetViewCapacity(state, source, itemHeight);
const calculateRange = createCalculateRange("vertical", overscan, createGetOffset(source, itemHeight), getViewCapacity, resources);
const getDistanceTop = createGetDistance(itemHeight, source);
const offsetTop = computed(() => getDistanceTop(state.value.start));
const totalHeight = createComputedTotalSize(itemHeight, source);
useWatchForSizes(size, source, containerRef, calculateRange);
return {
calculateRange,
scrollTo: createScrollTo("vertical", calculateRange, getDistanceTop, containerRef),
containerStyle,
wrapperProps: computed(() => {
return { style: {
width: "100%",
height: `${totalHeight.value - offsetTop.value}px`,
marginTop: `${offsetTop.value}px`
} };
}),
currentList,
containerRef
};
}
//#endregion
//#region src/client/logic/dark.ts
var isDark = useDark();
var toggleDark = useToggle(isDark);
//#endregion
//#region node_modules/.pnpm/birpc@4.0.0/node_modules/birpc/dist/index.mjs
var TYPE_REQUEST = "q";
var TYPE_RESPONSE = "s";
function createPromiseWithResolvers() {
let resolve;
let reject;
return {
promise: new Promise((res, rej) => {
resolve = res;
reject = rej;
}),
resolve,
reject
};
}
var random = Math.random.bind(Math);
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
function nanoid(size = 21) {
let id = "";
let i = size;
while (i--) id += urlAlphabet[random() * 64 | 0];
return id;
}
var DEFAULT_TIMEOUT = 6e4;
var defaultSerialize = (i) => i;
var defaultDeserialize = defaultSerialize;
var { clearTimeout: clearTimeout$1, setTimeout: setTimeout$1 } = globalThis;
function createBirpc($functions, options) {
const { post, on, off = () => {}, eventNames = [], serialize = defaultSerialize, deserialize = defaultDeserialize, resolver, bind = "rpc", timeout = DEFAULT_TIMEOUT, proxify = true } = options;
let $closed = false;
const _rpcPromiseMap = /* @__PURE__ */ new Map();
let _promiseInit;
let rpc;
async function _call(method, args, event, optional) {
if ($closed) throw new Error(`[birpc] rpc is closed, cannot call "${method}"`);
const req = {
m: method,
a: args,
t: TYPE_REQUEST
};
if (optional) req.o = true;
const send = async (_req) => post(serialize(_req));
if (event) {
await send(req);
return;
}
if (_promiseInit) try {
await _promiseInit;
} finally {
_promiseInit = void 0;
}
let { promise, resolve, reject } = createPromiseWithResolvers();
const id = nanoid();
req.i = id;
let timeoutId;
async function handler(newReq = req) {
if (timeout >= 0) {
timeoutId = setTimeout$1(() => {
try {
if (options.onTimeoutError?.call(rpc, method, args) !== true) throw new Error(`[birpc] timeout on calling "${method}"`);
} catch (e) {
reject(e);
}
_rpcPromiseMap.delete(id);
}, timeout);
if (typeof timeoutId === "object") timeoutId = timeoutId.unref?.();
}
_rpcPromiseMap.set(id, {
resolve,
reject,
timeoutId,
method
});
await send(newReq);
return promise;
}
try {
if (options.onRequest) await options.onRequest.call(rpc, req, handler, resolve);
else await handler();
} catch (e) {
if (options.onGeneralError?.call(rpc, e) !== true) throw e;
return;
} finally {
clearTimeout$1(timeoutId);
_rpcPromiseMap.delete(id);
}
return promise;
}
const builtinMethods = {
$call: (method, ...args) => _call(method, args, false),
$callOptional: (method, ...args) => _call(method, args, false, true),
$callEvent: (method, ...args) => _call(method, args, true),
$callRaw: (options$1) => _call(options$1.method, options$1.args, options$1.event, options$1.optional),
$rejectPendingCalls,
get $closed() {
return $closed;
},
get $meta() {
return options.meta;
},
$close,
$functions
};
if (proxify) rpc = new Proxy({}, { get(_, method) {
if (Object.prototype.hasOwnProperty.call(builtinMethods, method)) return builtinMethods[method];
if (method === "then" && !eventNames.includes("then") && !("then" in $functions)) return void 0;
const sendEvent = (...args) => _call(method, args, true);
if (eventNames.includes(method)) {
sendEvent.asEvent = sendEvent;
return sendEvent;
}
const sendCall = (...args) => _call(method, args, false);
sendCall.asEvent = sendEvent;
return sendCall;
} });
else rpc = builtinMethods;
function $close(customError) {
$closed = true;
_rpcPromiseMap.forEach(({ reject, method }) => {
const error = /* @__PURE__ */ new Error(`[birpc] rpc is closed, cannot call "${method}"`);
if (customError) {
customError.cause ??= error;
return reject(customError);
}
reject(error);
});
_rpcPromiseMap.clear();
off(onMessage);
}
function $rejectPendingCalls(handler) {
const handlerResults = Array.from(_rpcPromiseMap.values()).map(({ method, reject }) => {
if (!handler) return reject(/* @__PURE__ */ new Error(`[birpc]: rejected pending call "${method}".`));
return handler({
method,
reject
});
});
_rpcPromiseMap.clear();
return handlerResults;
}
async function onMessage(data, ...extra) {
let msg;
try {
msg = deserialize(data);
} catch (e) {
if (options.onGeneralError?.call(rpc, e) !== true) throw e;
return;
}
if (msg.t === TYPE_REQUEST) {
const { m: method, a: args, o: optional } = msg;
let result, error;
let fn = await (resolver ? resolver.call(rpc, method, $functions[method]) : $functions[method]);
if (optional) fn ||= () => void 0;
if (!fn) error = /* @__PURE__ */ new Error(`[birpc] function "${method}" not found`);
else try {
result = await fn.apply(bind === "rpc" ? rpc : $functions, args);
} catch (e) {
error = e;
}
if (msg.i) {
if (error && options.onFunctionError) {
if (options.onFunctionError.call(rpc, error, method, args) === true) return;
}
if (!error) try {
await post(serialize({
t: TYPE_RESPONSE,
i: msg.i,
r: result
}), ...extra);
return;
} catch (e) {
error = e;
if (options.onGeneralError?.call(rpc, e, method, args) !== true) throw e;
}
try {
await post(serialize({
t: TYPE_RESPONSE,
i: msg.i,
e: error
}), ...extra);
} catch (e) {
if (options.onGeneralError?.call(rpc, e, method, args) !== true) throw e;
}
}
} else {
const { i: ack, r: result, e: error } = msg;
const promise = _rpcPromiseMap.get(ack);
if (promise) {
clearTimeout$1(promise.timeoutId);
if (error) promise.reject(error);
else promise.resolve(result);
}
_rpcPromiseMap.delete(ack);
}
}
_promiseInit = on(onMessage);
return rpc;
}
//#endregion
//#region node_modules/.pnpm/vite-dev-rpc@2.0.0_vite@8.0.14_@types+node@25.9.1_jiti@2.7.0_yaml@2.9.0_/node_modules/vite-dev-rpc/dist/index.mjs
function createRPCClient(name, hot, functions = {}, options = {}) {
const event = `${name}:rpc`;
const promise = Promise.resolve(hot).then((r) => {
if (!r) console.warn("[vite-hot-client] Received undefined hot context, RPC calls are ignored");
return r;
});
return createBirpc(functions, {
...options,
on: async (fn) => {
(await promise)?.on(event, fn);
},
post: async (data) => {
(await promise)?.send(event, data);
}
});
}
//#endregion
//#region node_modules/.pnpm/vite-hot-client@2.2.0_vite@8.0.14_@types+node@25.9.1_jiti@2.7.0_yaml@2.9.0_/node_modules/vite-hot-client/dist/index.mjs
async function getViteClient(base = "/", warning = true) {
try {
const url = `${base}@vite/client`;
const res = await fetch(url);
if ((await res.text()).startsWith("<") || !res.headers.get("content-type")?.includes("javascript")) throw new Error("Not javascript");
return await __vitePreload(() => import(
/* @vite-ignore */
url
), [], import.meta.url);
} catch {
if (warning) console.error(`[vite-hot-client] Failed to import "${base}@vite/client"`);
}
}
async function createHotContext(path = "/____", base = "/") {
return (await getViteClient(base))?.createHotContext(path);
}
//#endregion
//#region src/client/logic/rpc-static.ts
var dataCache = /* @__PURE__ */ new Map();
function fetchJson(url) {
if (!dataCache.has(url)) dataCache.set(url, fetch(url).then((r) => r.json()));
return dataCache.get(url);
}
function createStaticRpcClient() {
async function getModuleTransformInfo(query, id) {
const { hash } = await __vitePreload(async () => {
const { hash } = await import("./dist-BOKanP0V.js");
return { hash };
}, [], import.meta.url);
return fetchJson(`./reports/${query.vite}-${query.env}/transforms/${hash(id)}.json`);
}
return {
getMetadata: () => fetchJson("./reports/metadata.json"),
getModulesList: (query) => fetchJson(`./reports/${query.vite}-${query.env}/modules.json`),
getPluginMetrics: (query) => fetchJson(`./reports/${query.vite}-${query.env}/metric-plugins.json`),
getModuleTransformInfo,
resolveId: (query, id) => getModuleTransformInfo(query, id).then((r) => r.resolvedId),
onModuleUpdated: async () => void 0,
getServerMetrics: async () => ({})
};
}
//#endregion
//#region src/client/logic/rpc.ts
var onModuleUpdated = createEventHook();
var isStaticMode = document.body.getAttribute("data-vite-inspect-mode") === "BUILD";
var hot = createHotContext("/___", `${location.pathname.split("/__inspect")[0] || ""}/`.replace(/\/\//g, "/"));
var rpc = isStaticMode ? createStaticRpcClient() : createRPCClient("vite-plugin-inspect", hot, { async onModuleUpdated() {
onModuleUpdated.trigger();
} });
//#endregion
//#region src/client/logic/utils.ts
function guessMode(code) {
if (code.trimStart().startsWith("<")) return "htmlmixed";
if (/^import\s/.test(code)) return "javascript";
if (/^[.#].+\{/.test(code)) return "css";
return "javascript";
}
function inspectSourcemaps({ code, sourcemaps }) {
console.info("sourcemaps", JSON.stringify(sourcemaps, null, 2));
const serialized = serializeForSourcemapsVisualizer(code, sourcemaps);
window.open(`https://evanw.github.io/source-map-visualization#${serialized}`, "_blank");
}
function safeJsonParse(str) {
try {
return JSON.parse(str);
} catch {
console.error("Failed to parse JSON", str);
return null;
}
}
function serializeForSourcemapsVisualizer(code, map) {
const encoder = new TextEncoder();
const codeArray = encoder.encode(code);
const mapArray = encoder.encode(map);
const codeLengthArray = encoder.encode(codeArray.length.toString());
const mapLengthArray = encoder.encode(mapArray.length.toString());
const combinedArray = new Uint8Array(codeLengthArray.length + 1 + codeArray.length + mapLengthArray.length + 1 + mapArray.length);
combinedArray.set(codeLengthArray);
combinedArray.set([0], codeLengthArray.length);
combinedArray.set(codeArray, codeLengthArray.length + 1);
combinedArray.set(mapLengthArray, codeLengthArray.length + 1 + codeArray.length);
combinedArray.set([0], codeLengthArray.length + 1 + codeArray.length + mapLengthArray.length);
combinedArray.set(mapArray, codeLengthArray.length + 1 + codeArray.length + mapLengthArray.length + 1);
let binary = "";
const len = combinedArray.byteLength;
for (let i = 0; i < len; i++) binary += String.fromCharCode(combinedArray[i]);
return btoa(binary);
}
//#endregion
//#region src/client/stores/payload.ts
var usePayloadStore = defineStore("payload", () => {
const isLoading = /* @__PURE__ */ ref(false);
const metadata = /* @__PURE__ */ shallowRef({ instances: [] });
const query = useLocalStorage("vite-inspect-v1-query", {
vite: "",
env: ""
}, { mergeDefaults: true });
const modules = /* @__PURE__ */ shallowRef([]);
const queryCache = /* @__PURE__ */ new Map();
async function init() {
metadata.value = await rpc.getMetadata();
if (!metadata.value.instances.some((i) => i.vite === query.value.vite)) query.value.vite = metadata.value.instances[0].vite;
if (!metadata.value.instances.some((i) => i.vite === query.value.vite && i.environments.includes(query.value.env))) {
const instance = metadata.value.instances.find((i) => i.vite === query.value.vite);
if (instance) query.value.env = instance.environments[0] || "client";
else query.value.env = metadata.value.instances[0].environments[0] || "client";
}
await doQuery();
watch(query, async () => {
await doQuery();
}, { deep: true });
onModuleUpdated.on(() => refetch());
}
async function doQuery() {
const key = `${query.value.vite}-${query.value.env}`;
if (!queryCache.has(key)) queryCache.set(key, rpc.getModulesList(query.value));
isLoading.value = true;
modules.value = [];
try {
modules.value = Object.freeze(await queryCache.get(key));
} finally {
isLoading.value = false;
}
}
async function refetch(force = false) {
queryCache.clear();
if (force) metadata.value = await rpc.getMetadata();
await doQuery();
}
const instance = computed(() => metadata.value.instances.find((i) => i.vite === query.value.vite));
return {
init,
metadata,
query,
modules,
instance,
root: computed(() => instance.value.root),
isLoading,
isStatic: isStaticMode,
refetch
};
});
//#endregion
//#region src/client/App.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = {
grid: "~ rows-[min-content_1fr]",
size: "h-full w-screen"
};
//#endregion
//#region src/client/App.vue
var App_default = /* @__PURE__ */ defineComponent({
__name: "App",
async setup(__props) {
let __temp, __restore;
onMounted(() => {
if (isStaticMode) document.title = "Vite Inspect (Production)";
});
const payload = usePayloadStore();
[__temp, __restore] = withAsyncContext(() => payload.init()), await __temp, __restore();
return (_ctx, _cache) => {
const _component_RouterView = resolveComponent("RouterView");
return openBlock(), createElementBlock("main", _hoisted_1, [(openBlock(), createBlock(Suspense, null, {
fallback: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Loading... ", -1)])]),
default: withCtx(() => [createVNode(_component_RouterView)]),
_: 1
}))]);
};
}
});
//#endregion
//#region src/client/main.ts
var app = createApp(() => h(Suspense, {}, {
default: () => h(App_default),
fallback: "Loading..."
}));
var router = createRouter({
routes,
history: createWebHashHistory()
});
var pinia = createPinia();
app.use(pinia);
app.use(router);
app.mount("#app");
//#endregion
export { useAttrs as $, createCommentVNode as A, nextTick as B, Fragment as C, computed as D, Teleport as E, getCurrentInstance as F, openBlock as G, onMounted as H, guardReactiveProps as I, pushScopeId as J, popScopeId as K, h as L, createTextVNode as M, createVNode as N, createBaseVNode as O, defineComponent as P, resolveDynamicComponent as Q, inject as R, withKeys as S, Suspense as T, onUnmounted as U, onBeforeUnmount as V, onUpdated as W, renderSlot as X, renderList as Y, resolveComponent as Z, defineStore as _, normalizeClass as _t, isStaticMode as a, withAsyncContext as at, vModelText as b, toDisplayString as bt, createHotContext as c, withScopeId as ct, onKeyDown as d, shallowReactive as dt, useSlots as et, useLocalStorage as f, shallowRef as ft, useRouter as g, unref as gt, useRoute as h, toValue as ht, safeJsonParse as i, watchEffect as it, createElementBlock as j, createBlock as k, isDark as l, customRef as lt, tryOnScopeDispose as m, toRefs as mt, guessMode as n, warn as nt, onModuleUpdated as o, withCtx as ot, useVirtualList as p, toRef$1 as pt, provide as q, inspectSourcemaps as r, watch as rt, rpc as s, withDirectives as st, usePayloadStore as t, useTemplateRef as tt, toggleDark as u, ref as ut, createApp as v, normalizeProps as vt, KeepAlive as w, vShow as x, vModelCheckbox as y, normalizeStyle as yt, mergeProps as z };